[PATCH 0/7] wmcube adoption

12 views
Skip to first unread message

Jeremy Sowden

unread,
May 16, 2020, 3:54:42 PM5/16/20
to Window Maker Dev
The upstream URL from the Debian package of wmcube no longer works, and
my e-mail to the upstream contact to ask about its status bounced, so I
have extracted the upstream branch from the Debian package and applied
the Debian patches to it with a view to adopting it in dockapps.net

Doug Torrance (5):
wmcube: imported Upstream version 0.98
wmcube: imported Upstream version 0.99-pre1
wmcube: bump to version 1.0.0.
wmcube: imported Upstream version 1.0.1
wmcube: imported Upstream version 1.0.2

Jeremy Sowden (2):
wmcube: use wmgeneral functions in libdockapp instead of the private
copy.
wmcube: remove root chown from Makefile.

wmcube/3D-objects/2planes-solid.wmc | 23 +
wmcube/3D-objects/4d.wmc | 59 ++
wmcube/3D-objects/8star-small.wmc | 40 +
wmcube/3D-objects/8star.wmc | 40 +
wmcube/3D-objects/CONTRIBUTE | 66 ++
wmcube/3D-objects/README | 54 +
wmcube/3D-objects/X-lines.wmc | 65 ++
wmcube/3D-objects/X-planes.wmc | 68 ++
wmcube/3D-objects/ball-solid.wmc | 104 ++
wmcube/3D-objects/ball.wmc | 83 ++
wmcube/3D-objects/beryllium.wmc | 89 ++
wmcube/3D-objects/celtic.wmc | 71 ++
wmcube/3D-objects/cross.wmc | 63 ++
wmcube/3D-objects/cross2-solid.wmc | 80 ++
wmcube/3D-objects/cross2.wmc | 51 +
wmcube/3D-objects/cross3-solid.wmc | 107 ++
wmcube/3D-objects/cross3.wmc | 95 ++
wmcube/3D-objects/cross4-solid.wmc | 107 ++
wmcube/3D-objects/crystal.wmc | 108 ++
wmcube/3D-objects/cube-solid.wmc | 27 +
wmcube/3D-objects/cube.wmc | 24 +
wmcube/3D-objects/diamond.wmc | 66 ++
wmcube/3D-objects/dice-solid.wmc | 81 ++
wmcube/3D-objects/e.wmc | 69 ++
wmcube/3D-objects/e2.wmc | 160 +++
wmcube/3D-objects/foo.wmc | 149 +++
wmcube/3D-objects/gnustep.wmc | 110 ++
wmcube/3D-objects/hyperpyramid.wmc | 54 +
wmcube/3D-objects/jeep.wmc | 157 +++
wmcube/3D-objects/multicube.wmc | 83 ++
wmcube/3D-objects/peace.wmc | 155 +++
wmcube/3D-objects/pyramid.wmc | 16 +
wmcube/3D-objects/radioactive.wmc | 185 ++++
wmcube/3D-objects/shield.wmc | 197 ++++
wmcube/3D-objects/slackware1.wmc | 130 +++
wmcube/3D-objects/slackware2.wmc | 256 +++++
wmcube/3D-objects/slackware3.wmc | 319 ++++++
wmcube/3D-objects/spaceshuttle.wmc | 382 +++++++
wmcube/3D-objects/spiral.wmc | 49 +
wmcube/3D-objects/star.wmc | 95 ++
wmcube/3D-objects/starcube.wmc | 69 ++
wmcube/3D-objects/wmlogo.wmc | 59 ++
wmcube/CHANGES | 65 ++
wmcube/COPYING | 674 +++++++++++++
wmcube/INSTALL | 39 +
wmcube/README | 88 ++
wmcube/THANKS | 32 +
wmcube/wmcube/Makefile | 58 ++
wmcube/wmcube/Makefile.FREEBSD | 62 ++
wmcube/wmcube/Makefile.LINUX | 62 ++
wmcube/wmcube/Makefile.NETBSD | 60 ++
wmcube/wmcube/Makefile.OPENBSD | 61 ++
wmcube/wmcube/Makefile.SOLARIS | 62 ++
wmcube/wmcube/wmcube.1 | 85 ++
wmcube/wmcube/wmcube.c | 1449 +++++++++++++++++++++++++++
wmcube/wmcube/wmcube.xpm | 174 ++++
wmcube/wmcube/wmcubeblue.xpm | 168 ++++
wmcube/wmcube/wmcubecyan.xpm | 168 ++++
wmcube/wmcube/wmcubegreen.xpm | 168 ++++
wmcube/wmcube/wmcubemagenta.xpm | 168 ++++
wmcube/wmcube/wmcubered.xpm | 168 ++++
wmcube/wmcube/wmcubeyellow.xpm | 168 ++++
wmcube/wmgeneral/list.c | 170 ++++
wmcube/wmgeneral/list.h | 55 +
wmcube/wmgeneral/misc.c | 164 +++
wmcube/wmgeneral/misc.h | 9 +
wmcube/wmgeneral/wmgeneral.c | 481 +++++++++
wmcube/wmgeneral/wmgeneral.h | 59 ++
68 files changed, 9182 insertions(+)
create mode 100644 wmcube/3D-objects/2planes-solid.wmc
create mode 100644 wmcube/3D-objects/4d.wmc
create mode 100644 wmcube/3D-objects/8star-small.wmc
create mode 100644 wmcube/3D-objects/8star.wmc
create mode 100644 wmcube/3D-objects/CONTRIBUTE
create mode 100644 wmcube/3D-objects/README
create mode 100644 wmcube/3D-objects/X-lines.wmc
create mode 100644 wmcube/3D-objects/X-planes.wmc
create mode 100644 wmcube/3D-objects/ball-solid.wmc
create mode 100644 wmcube/3D-objects/ball.wmc
create mode 100644 wmcube/3D-objects/beryllium.wmc
create mode 100644 wmcube/3D-objects/celtic.wmc
create mode 100644 wmcube/3D-objects/cross.wmc
create mode 100644 wmcube/3D-objects/cross2-solid.wmc
create mode 100644 wmcube/3D-objects/cross2.wmc
create mode 100644 wmcube/3D-objects/cross3-solid.wmc
create mode 100644 wmcube/3D-objects/cross3.wmc
create mode 100644 wmcube/3D-objects/cross4-solid.wmc
create mode 100644 wmcube/3D-objects/crystal.wmc
create mode 100644 wmcube/3D-objects/cube-solid.wmc
create mode 100644 wmcube/3D-objects/cube.wmc
create mode 100644 wmcube/3D-objects/diamond.wmc
create mode 100644 wmcube/3D-objects/dice-solid.wmc
create mode 100644 wmcube/3D-objects/e.wmc
create mode 100644 wmcube/3D-objects/e2.wmc
create mode 100644 wmcube/3D-objects/foo.wmc
create mode 100644 wmcube/3D-objects/gnustep.wmc
create mode 100644 wmcube/3D-objects/hyperpyramid.wmc
create mode 100644 wmcube/3D-objects/jeep.wmc
create mode 100644 wmcube/3D-objects/multicube.wmc
create mode 100644 wmcube/3D-objects/peace.wmc
create mode 100644 wmcube/3D-objects/pyramid.wmc
create mode 100644 wmcube/3D-objects/radioactive.wmc
create mode 100644 wmcube/3D-objects/shield.wmc
create mode 100644 wmcube/3D-objects/slackware1.wmc
create mode 100644 wmcube/3D-objects/slackware2.wmc
create mode 100644 wmcube/3D-objects/slackware3.wmc
create mode 100644 wmcube/3D-objects/spaceshuttle.wmc
create mode 100644 wmcube/3D-objects/spiral.wmc
create mode 100644 wmcube/3D-objects/star.wmc
create mode 100644 wmcube/3D-objects/starcube.wmc
create mode 100644 wmcube/3D-objects/wmlogo.wmc
create mode 100644 wmcube/CHANGES
create mode 100644 wmcube/COPYING
create mode 100644 wmcube/INSTALL
create mode 100644 wmcube/README
create mode 100644 wmcube/THANKS
create mode 100644 wmcube/wmcube/Makefile
create mode 100644 wmcube/wmcube/Makefile.FREEBSD
create mode 100644 wmcube/wmcube/Makefile.LINUX
create mode 100644 wmcube/wmcube/Makefile.NETBSD
create mode 100644 wmcube/wmcube/Makefile.OPENBSD
create mode 100644 wmcube/wmcube/Makefile.SOLARIS
create mode 100644 wmcube/wmcube/wmcube.1
create mode 100644 wmcube/wmcube/wmcube.c
create mode 100644 wmcube/wmcube/wmcube.xpm
create mode 100644 wmcube/wmcube/wmcubeblue.xpm
create mode 100644 wmcube/wmcube/wmcubecyan.xpm
create mode 100644 wmcube/wmcube/wmcubegreen.xpm
create mode 100644 wmcube/wmcube/wmcubemagenta.xpm
create mode 100644 wmcube/wmcube/wmcubered.xpm
create mode 100644 wmcube/wmcube/wmcubeyellow.xpm
create mode 100644 wmcube/wmgeneral/list.c
create mode 100644 wmcube/wmgeneral/list.h
create mode 100644 wmcube/wmgeneral/misc.c
create mode 100644 wmcube/wmgeneral/misc.h
create mode 100644 wmcube/wmgeneral/wmgeneral.c
create mode 100644 wmcube/wmgeneral/wmgeneral.h

--
2.26.2

Jeremy Sowden

unread,
May 16, 2020, 3:54:44 PM5/16/20
to Window Maker Dev, Doug Torrance
From: Doug Torrance <dtor...@piedmont.edu>

---
wmcube/3D-objects/CONTRIBUTE | 2 +-
wmcube/CHANGES | 5 +++++
wmcube/INSTALL | 4 ++--
wmcube/README | 6 +++---
wmcube/THANKS | 6 +++++-
wmcube/wmcube/Makefile | 2 +-
wmcube/wmcube/Makefile.FREEBSD | 2 +-
wmcube/wmcube/Makefile.LINUX | 2 +-
wmcube/wmcube/Makefile.NETBSD | 2 +-
wmcube/wmcube/Makefile.OPENBSD | 2 +-
wmcube/wmcube/Makefile.SOLARIS | 2 +-
wmcube/wmcube/wmcube.1 | 16 ++++++++--------
wmcube/wmcube/wmcube.c | 15 ++++++++-------
wmcube/wmgeneral/list.c | 21 +++++++++++----------
wmcube/wmgeneral/list.h | 24 ++++++++++--------------
15 files changed, 59 insertions(+), 52 deletions(-)

diff --git a/wmcube/3D-objects/CONTRIBUTE b/wmcube/3D-objects/CONTRIBUTE
index 9945ee89cf4f..14367582d71b 100644
--- a/wmcube/3D-objects/CONTRIBUTE
+++ b/wmcube/3D-objects/CONTRIBUTE
@@ -58,7 +58,7 @@ Cezary M. Kruk <c.k...@bigfoot.com>
- slackware2.wmc
- slackware3.wmc

-Three objects recommended by Doug Torrance <dtor...@monmouthcollege.edu>
+Three objects recommended by Doug Torrance <dtor...@piedmont.edu>

- X-lines.wmc
- X-planes.wmc
diff --git a/wmcube/CHANGES b/wmcube/CHANGES
index 855a4db05e6d..1b8f1b28b4a9 100644
--- a/wmcube/CHANGES
+++ b/wmcube/CHANGES
@@ -1,3 +1,8 @@
+wmcube 1.0.2 (February 28, 2016):
+ * Two following patches by Douglas Torrance: avoiding
+ hyphen-used-as-minus-sign Lintian warning as well as removing
+ inline keywords and allowing builds using gcc5.
+
wmcube 1.0.1 (February 19, 2015):
* Applied a few patches written by Doug Torrance (see: THANKS
file).
diff --git a/wmcube/INSTALL b/wmcube/INSTALL
index f5750eaeb618..3185803f3264 100644
--- a/wmcube/INSTALL
+++ b/wmcube/INSTALL
@@ -21,9 +21,9 @@ them to your needs is up to you.

Installation
--------------------------------------------------------------
-1) $ tar -zxf wmcube-1.0.1.tar.gz
+1) $ tar -zxf wmcube-1.0.2.tar.gz

-2) $ cd wmcube-1.0.1/wmcube
+2) $ cd wmcube-1.0.2/wmcube

3) $ make # if you run Linux
or:
diff --git a/wmcube/README b/wmcube/README
index 5757609190ec..0c5b9d1f1c56 100644
--- a/wmcube/README
+++ b/wmcube/README
@@ -1,11 +1,11 @@
-wmcube 1.0.1
+wmcube 1.0.2
---------------------------------------------------------------
Author: Cezary M. Kruk
c.k...@bigfoot.com
http://linux-bsd-unix.strefa.pl

Contributors:
- Doug Torrance <dtor...@monmouthcollege.edu>
+ Doug Torrance <dtor...@piedmont.edu>

wmCube 0.98
---------------------------------------------------------------
@@ -83,6 +83,6 @@ detailed as you can.

Copyright
---------------------------------------------------------------
-wmcube (C) 2014-2015 by Cezary M. Kruk, Wrocław, Poland
+wmcube (C) 2014-2016 by Cezary M. Kruk, Wrocław, Poland
wmCube (C) 2000-2001 by Robert Kling, Lulea, Sweden

diff --git a/wmcube/THANKS b/wmcube/THANKS
index d96d20843185..142c992d9158 100644
--- a/wmcube/THANKS
+++ b/wmcube/THANKS
@@ -1,9 +1,13 @@

-I would like to thank to Doug Torrance for his contribution to
+I would like to thank to Douglas Torrance for his contribution to
wmcube including:

* a set of patches:

+ - remove_inline_keywords.patch -- removes inline keywords; allows
+ builds using gcc5.
+ - manpage_escape_hyphens.patch -- avoids hyphen-used-as-minus-sign
+ Lintian warning.
- 30_bts-386850_fix_smp.patch -- fixes smp support, reading
all the fields in /proc/stat;
- 40_bts-357072_long_uptime_fix.patch -- fixes execution on
diff --git a/wmcube/wmcube/Makefile b/wmcube/wmcube/Makefile
index 2a66a332e478..9109993c181d 100644
--- a/wmcube/wmcube/Makefile
+++ b/wmcube/wmcube/Makefile
@@ -1,7 +1,7 @@
CC = gcc
OS = -DLINUX

-VERSION = 1.0.1
+VERSION = 1.0.2

LIBDIR = -L/usr/X11R6/lib
LIBDIR = -L/usr/X11R6/lib
diff --git a/wmcube/wmcube/Makefile.FREEBSD b/wmcube/wmcube/Makefile.FREEBSD
index 98c589b8e609..63401e302c7e 100644
--- a/wmcube/wmcube/Makefile.FREEBSD
+++ b/wmcube/wmcube/Makefile.FREEBSD
@@ -1,7 +1,7 @@
CC = gcc
OS = -DFREEBSD

-VERSION = 1.0.1
+VERSION = 1.0.2

LIBDIR = -L/usr/X11R6/lib
LIBDIR = -L/usr/X11R6/lib
diff --git a/wmcube/wmcube/Makefile.LINUX b/wmcube/wmcube/Makefile.LINUX
index 2a66a332e478..9109993c181d 100644
--- a/wmcube/wmcube/Makefile.LINUX
+++ b/wmcube/wmcube/Makefile.LINUX
@@ -1,7 +1,7 @@
CC = gcc
OS = -DLINUX

-VERSION = 1.0.1
+VERSION = 1.0.2

LIBDIR = -L/usr/X11R6/lib
LIBDIR = -L/usr/X11R6/lib
diff --git a/wmcube/wmcube/Makefile.NETBSD b/wmcube/wmcube/Makefile.NETBSD
index aa3a5aa202e0..8a4bcd951df6 100644
--- a/wmcube/wmcube/Makefile.NETBSD
+++ b/wmcube/wmcube/Makefile.NETBSD
@@ -1,7 +1,7 @@
CC = gcc
OS = -DNETBSD

-VERSION = 1.0.1
+VERSION = 1.0.2

LIBDIR = -L/usr/X11R6/lib -L./libdocapp/

diff --git a/wmcube/wmcube/Makefile.OPENBSD b/wmcube/wmcube/Makefile.OPENBSD
index adfd8a096d35..675214bb1640 100644
--- a/wmcube/wmcube/Makefile.OPENBSD
+++ b/wmcube/wmcube/Makefile.OPENBSD
@@ -1,7 +1,7 @@
CC = gcc
OS = -DOPENBSD

-VERSION = 1.0.1
+VERSION = 1.0.2

LIBDIR = -L/usr/X11R6/lib -L./libdocapp/

diff --git a/wmcube/wmcube/Makefile.SOLARIS b/wmcube/wmcube/Makefile.SOLARIS
index eed97b4b40c4..79b99dd2b617 100644
--- a/wmcube/wmcube/Makefile.SOLARIS
+++ b/wmcube/wmcube/Makefile.SOLARIS
@@ -1,7 +1,7 @@
CC = gcc
OS = -DSOLARIS

-VERSION = 1.0.1
+VERSION = 1.0.2

LIBDIR = -L/usr/X11R6/lib
LIBDIR = -L/usr/openwin/lib -L/opt/sfw/lib -L/usr/local/lib -R/usr/openwin/lib -R/opt/sfw/lib -R/usr/local/lib
diff --git a/wmcube/wmcube/wmcube.1 b/wmcube/wmcube/wmcube.1
index f69d93eb2077..a2a3218ce868 100644
--- a/wmcube/wmcube/wmcube.1
+++ b/wmcube/wmcube/wmcube.1
@@ -1,5 +1,5 @@
.\" -*- nroff -*-
-.TH WMCUBE 1 "February 19, 2015" "Version 1.0.1" "3D object CPU Load display applet"
+.TH WMCUBE 1 "February 28, 2016" "Version 1.0.2" "3D object CPU Load display applet"

.SH NAME
wmcube \-\- spinning 3D object that shows the current CPU load
@@ -55,16 +55,16 @@ use blue image.
display this help.

.SH TIPS & TRICKS
-By combining together -RG, -RB, or -GB switches you get yellow, magenta, or cyan
-images. Combining -RGB switches produces the gray image \-\- the same as without
+By combining together \-RG, \-RB, or \-GB switches you get yellow, magenta, or cyan
+images. Combining \-RGB switches produces the gray image \-\- the same as without
any swiches.

.SH PROGRAM AUTHORS
-wmcube 1.0.1:
+wmcube 1.0.2:
.IP
-(C) 2014-2015 Cezary M. Kruk <\fIc....@bigfoot.com\fP>
+(C) 2014-2016 Cezary M. Kruk <\fIc....@bigfoot.com\fP>
.IP
-(C) 2015 Doug Torrance
+(C) 2015-2016 Doug Torrance <\fIdto...@piedmont.edu\fP>
.LP
wmCube 0.98:
.IP
@@ -77,9 +77,9 @@ Filip Van Raemdonck <mech...@digibel.org> \-\- manpage for version 0.98 of wmcu
.LP
Sandro Tosi <matri...@gmail.com> \-\- manpage for version 0.99-pre1 of wmcube.
.LP
-Doug Torrance <dtor...@monmouthcollege.edu> \-\- manpage for version 1.0.0.
+Doug Torrance <dtor...@piedmont.edu> \-\- manpage for version 1.0.0.
.LP
-Cezary M. Kruk <c.k...@bigfoot.com> \-\- manpage for version 1.0.1.
+Cezary M. Kruk <c.k...@bigfoot.com> \-\- manpage for version 1.0.2.

.SH SEE ALSO
.BR fvwm (1), wmaker (1)
diff --git a/wmcube/wmcube/wmcube.c b/wmcube/wmcube/wmcube.c
index 516e971bea91..37eca879ff1e 100644
--- a/wmcube/wmcube/wmcube.c
+++ b/wmcube/wmcube/wmcube.c
@@ -2,13 +2,14 @@

wmcube.c

- Version 1.0.1 (2015-02-19)
+ Version 1.0.2 (2016-02-28)
Cezary M. Kruk <c.k...@bigfoot.com>
http://linux-bsd-unix.strefa.pl

Contributions:
A few patches, three new objects, and other updates by Doug Torrance
- <dtor...@monmouthcollege.edu> (2015-02-19)
+ A small improvement of the manpage by Doug Torrance
+ <dtor...@piedmont.edu> (2016-02-28)

Versions 0.98 (2000-10-23)
Robert Kling <robk...@student.luth.se>
@@ -31,10 +32,10 @@

*/

-#define CK_WMCUBE_VERSION "1.0.1"
-#define CK_REV_YEAR "2014-2015"
-#define CK_REV_DATE "2015-02-19"
-#define DT_REV_YEAR "2015"
+#define CK_WMCUBE_VERSION "1.0.2"
+#define CK_REV_YEAR "2014-2016"
+#define CK_REV_DATE "2016-02-28"
+#define DT_REV_YEAR "2015-2016"
#define RK_WMCUBE_VERSION "0.98"
#define RK_REV_YEAR "2000"
#define RK_REV_DATE "2000-10-23"
@@ -908,7 +909,7 @@ void setupobj(char *filename)

void print_help() {
printf("\nwmcube %s (C) %s Cezary M. Kruk (%s)\n", CK_WMCUBE_VERSION, CK_REV_YEAR, CK_REV_DATE);
- printf(" (C) %s Doug Torrance\n", DT_REV_YEAR);
+ printf(" (C) %s Doug Torrance\n", DT_REV_YEAR);
printf("wmCube %s (C) %s Robert Kling (%s)\n\n", RK_WMCUBE_VERSION, RK_REV_YEAR, RK_REV_DATE);

printf(" Usage: wmcube [-o <filename>] [-drcfnbipRGBh]\n\n");
diff --git a/wmcube/wmgeneral/list.c b/wmcube/wmgeneral/list.c
index f804b2c7abff..1e3764b05e85 100644
--- a/wmcube/wmgeneral/list.c
+++ b/wmcube/wmgeneral/list.c
@@ -5,7 +5,8 @@
Author: Kresten Krab Thorup

Many modifications by Alfredo K. Kojima
-
+
+Modified by Douglas Torrance

This file is part of GNU CC.

@@ -38,7 +39,7 @@ Boston, MA 02111-1307, USA. */

/* Return a cons cell produced from (head . tail) */

-INLINE LinkedList*
+LinkedList*
list_cons(void* head, LinkedList* tail)
{
LinkedList* cell;
@@ -51,7 +52,7 @@ list_cons(void* head, LinkedList* tail)

/* Return the length of a list, list_length(NULL) returns zero */

-INLINE int
+int
list_length(LinkedList* list)
{
int i = 0;
@@ -66,7 +67,7 @@ list_length(LinkedList* list)
/* Return the Nth element of LIST, where N count from zero. If N
larger than the list length, NULL is returned */

-INLINE void*
+void*
list_nth(int index, LinkedList* list)
{
while(index-- != 0)
@@ -81,7 +82,7 @@ list_nth(int index, LinkedList* list)

/* Remove the element at the head by replacing it by its successor */

-INLINE void
+void
list_remove_head(LinkedList** list)
{
if (!*list) return;
@@ -101,7 +102,7 @@ list_remove_head(LinkedList** list)

/* Remove the element with `car' set to ELEMENT */
/*
-INLINE void
+void
list_remove_elem(LinkedList** list, void* elem)
{
while (*list)
@@ -112,7 +113,7 @@ list_remove_elem(LinkedList** list, void* elem)
}
}*/

-INLINE LinkedList *
+LinkedList *
list_remove_elem(LinkedList* list, void* elem)
{
LinkedList *tmp;
@@ -132,7 +133,7 @@ list_remove_elem(LinkedList* list, void* elem)

/* Return element that has ELEM as car */

-INLINE LinkedList*
+LinkedList*
list_find(LinkedList* list, void* elem)
{
while(list)
@@ -146,7 +147,7 @@ list_find(LinkedList* list, void* elem)

/* Free list (backwards recursive) */

-INLINE void
+void
list_free(LinkedList* list)
{
if(list)
@@ -158,7 +159,7 @@ list_free(LinkedList* list)

/* Map FUNCTION over all elements in LIST */

-INLINE void
+void
list_mapcar(LinkedList* list, void(*function)(void*))
{
while(list)
diff --git a/wmcube/wmgeneral/list.h b/wmcube/wmgeneral/list.h
index af0f22c2a882..7491b6b8063d 100644
--- a/wmcube/wmgeneral/list.h
+++ b/wmcube/wmgeneral/list.h
@@ -3,6 +3,8 @@

Author: Kresten Krab Thorup

+Modified by Douglas Torrance
+
This file is part of GNU CC.

GNU CC is free software; you can redistribute it and/or modify
@@ -29,31 +31,25 @@ Boston, MA 02111-1307, USA. */
#ifndef __LIST_H_
#define __LIST_H_

-#if defined(__GNUC__) && !defined(__STRICT_ANSI__)
-# define INLINE inline
-#else
-# define INLINE
-#endif
-
typedef struct LinkedList {
void *head;
struct LinkedList *tail;
} LinkedList;

-INLINE LinkedList* list_cons(void* head, LinkedList* tail);
+LinkedList* list_cons(void* head, LinkedList* tail);

-INLINE int list_length(LinkedList* list);
+int list_length(LinkedList* list);

-INLINE void* list_nth(int index, LinkedList* list);
+void* list_nth(int index, LinkedList* list);

-INLINE void list_remove_head(LinkedList** list);
+void list_remove_head(LinkedList** list);

-INLINE LinkedList *list_remove_elem(LinkedList* list, void* elem);
+LinkedList *list_remove_elem(LinkedList* list, void* elem);

-INLINE void list_mapcar(LinkedList* list, void(*function)(void*));
+void list_mapcar(LinkedList* list, void(*function)(void*));

-INLINE LinkedList*list_find(LinkedList* list, void* elem);
+LinkedList*list_find(LinkedList* list, void* elem);

-INLINE void list_free(LinkedList* list);
+void list_free(LinkedList* list);

#endif
--
2.26.2

Jeremy Sowden

unread,
May 16, 2020, 3:54:44 PM5/16/20
to Window Maker Dev
Signed-off-by: Jeremy Sowden <jer...@azazel.net>
---
wmcube/wmcube/Makefile | 1 -
1 file changed, 1 deletion(-)

diff --git a/wmcube/wmcube/Makefile b/wmcube/wmcube/Makefile
index 5039dd75942a..973532b54ad4 100644
--- a/wmcube/wmcube/Makefile
+++ b/wmcube/wmcube/Makefile
@@ -39,7 +39,6 @@ clean::
install:: wmcube
cp -f wmcube $(BINDIR)
chmod 755 $(BINDIR)/wmcube
- chown root:root $(BINDIR)/wmcube
mkdir -p $(DOCDIR)
cp -p ../CHANGES ../COPYING ../INSTALL ../README ../THANKS $(DOCDIR)
cp -pr ../3D-objects $(DOCDIR)
--
2.26.2

Jeremy Sowden

unread,
May 16, 2020, 3:54:44 PM5/16/20
to Window Maker Dev, Doug Torrance
From: Doug Torrance <dtor...@monmouthcollege.edu>

---
wmcube/3D-objects/CONTRIBUTE | 8 +-
wmcube/3D-objects/X-lines.wmc | 65 ++++++++++++++++
wmcube/3D-objects/X-planes.wmc | 68 ++++++++++++++++
wmcube/3D-objects/beryllium.wmc | 89 +++++++++++++++++++++
wmcube/CHANGES | 21 +++--
wmcube/INSTALL | 14 +++-
wmcube/README | 28 ++++---
wmcube/THANKS | 28 +++++++
wmcube/wmcube/Makefile | 15 ++--
wmcube/wmcube/Makefile.FREEBSD | 9 ++-
wmcube/wmcube/Makefile.LINUX | 15 ++--
wmcube/wmcube/Makefile.NETBSD | 9 ++-
wmcube/wmcube/Makefile.OPENBSD | 9 ++-
wmcube/wmcube/Makefile.SOLARIS | 9 ++-
wmcube/wmcube/wmcube.1 | 85 ++++++++++++++++++++
wmcube/wmcube/wmcube.c | 132 ++++++++++++++++++--------------
16 files changed, 508 insertions(+), 96 deletions(-)
create mode 100644 wmcube/3D-objects/X-lines.wmc
create mode 100644 wmcube/3D-objects/X-planes.wmc
create mode 100644 wmcube/3D-objects/beryllium.wmc
create mode 100644 wmcube/THANKS
create mode 100644 wmcube/wmcube/wmcube.1

diff --git a/wmcube/3D-objects/CONTRIBUTE b/wmcube/3D-objects/CONTRIBUTE
index 1636ed257888..9945ee89cf4f 100644
--- a/wmcube/3D-objects/CONTRIBUTE
+++ b/wmcube/3D-objects/CONTRIBUTE
@@ -29,7 +29,7 @@ Aaron Benner <ben...@mcn.net>
- 8star.wmc
- 8star-small.wmc

-Per Ĺkergren <akep...@student.luth.se>
+Per Akergren <akep...@student.luth.se>

- e.wmc
- e2.wmc
@@ -58,3 +58,9 @@ Cezary M. Kruk <c.k...@bigfoot.com>
- slackware2.wmc
- slackware3.wmc

+Three objects recommended by Doug Torrance <dtor...@monmouthcollege.edu>
+
+ - X-lines.wmc
+ - X-planes.wmc
+ - beryllium.wmc
+
diff --git a/wmcube/3D-objects/X-lines.wmc b/wmcube/3D-objects/X-lines.wmc
new file mode 100644
index 000000000000..8c1600f01a4b
--- /dev/null
+++ b/wmcube/3D-objects/X-lines.wmc
@@ -0,0 +1,65 @@
+WMCUBE_COORDINATES
+1 30 -30 -10
+2 10 -30 -10
+3 -3 -10 -10
+4 -20 -30 -10
+5 -30 -30 -10
+6 -8 -3 -10
+7 -30 30 -10
+8 -10 30 -10
+9 3 10 -10
+10 20 30 -10
+11 30 30 -10
+12 8 3 -10
+13 30 -30 10
+14 10 -30 10
+15 -3 -10 10
+16 -20 -30 10
+17 -30 -30 10
+18 -8 -3 10
+19 -30 30 10
+20 -10 30 10
+21 3 10 10
+22 20 30 10
+23 30 30 10
+24 8 3 10
+
+WMCUBE_LINES
+1 2
+2 3
+3 4
+4 5
+5 6
+6 7
+7 8
+8 9
+9 10
+10 11
+11 12
+12 1
+
+13 14
+14 15
+15 16
+16 17
+17 18
+18 19
+19 20
+20 21
+21 22
+22 23
+23 24
+24 13
+
+1 13
+2 14
+3 15
+4 16
+5 17
+6 18
+7 19
+8 20
+9 21
+10 22
+11 23
+12 24
diff --git a/wmcube/3D-objects/X-planes.wmc b/wmcube/3D-objects/X-planes.wmc
new file mode 100644
index 000000000000..a4d67691636d
--- /dev/null
+++ b/wmcube/3D-objects/X-planes.wmc
@@ -0,0 +1,68 @@
+WMCUBE_COORDINATES
+1 30 -30 -10
+2 10 -30 -10
+3 -3 -10 -10
+4 -20 -30 -10
+5 -30 -30 -10
+6 -8 -3 -10
+7 -30 30 -10
+8 -10 30 -10
+9 3 10 -10
+10 20 30 -10
+11 30 30 -10
+12 8 3 -10
+13 30 -30 10
+14 10 -30 10
+15 -3 -10 10
+16 -20 -30 10
+17 -30 -30 10
+18 -8 -3 10
+19 -30 30 10
+20 -10 30 10
+21 3 10 10
+22 20 30 10
+23 30 30 10
+24 8 3 10
+
+WMCUBE_PLANES
+1 2 7
+7 8 1
+4 5 10
+10 11 4
+
+13 20 19
+19 14 13
+23 22 17
+17 16 23
+
+1 12 24
+24 13 1
+12 11 23
+23 24 12
+
+3 2 14
+14 15 3
+4 3 15
+15 16 4
+
+7 6 18
+18 19 7
+6 5 17
+17 18 6
+
+8 20 21
+21 9 8
+9 21 22
+22 10 9
+
+1 13 14
+14 2 1
+
+4 16 17
+17 5 4
+
+10 22 23
+23 11 10
+
+7 19 20
+20 8 7
diff --git a/wmcube/3D-objects/beryllium.wmc b/wmcube/3D-objects/beryllium.wmc
new file mode 100644
index 000000000000..b8fc4998a748
--- /dev/null
+++ b/wmcube/3D-objects/beryllium.wmc
@@ -0,0 +1,89 @@
+WMCUBE_COORDINATES
+1 200 -200 000
+2 200 200 400
+3 600 -200 400
+4 600 200 000
+5 530 130 330
+6 530 -130 070
+7 270 130 070
+8 270 -130 330
+9 0 0 0
+10 0 0 0
+11 -600 -200 000
+12 -600 200 400
+13 -200 -200 400
+14 -200 200 000
+15 -270 130 330
+16 -270 -130 070
+17 -530 130 070
+18 -530 -130 330
+19 0 0 0
+20 0 0 0
+21 -200 200 -400
+22 -200 600 000
+23 200 200 000
+24 200 600 -400
+25 130 530 -070
+26 130 270 -330
+27 -130 530 -330
+28 -130 270 -070
+29 0 0 0
+30 0 0 0
+31 -200 -600 -400
+32 -200 -200 000
+33 200 -600 000
+34 200 -200 -400
+35 130 -270 -070
+36 130 -530 -330
+37 -130 -270 -330
+38 -130 -530 -070
+
+WMCUBE_PLANES
+2 5 3
+5 4 3
+2 4 5
+6 1 3
+6 4 1
+6 3 4
+7 2 1
+7 4 2
+7 1 4
+8 1 2
+8 2 3
+8 3 1
+12 15 13
+15 14 13
+12 14 15
+16 11 13
+16 14 11
+16 13 14
+17 12 11
+17 14 12
+17 11 14
+18 11 12
+18 12 13
+18 13 11
+22 25 23
+25 24 23
+22 24 25
+26 21 23
+26 24 21
+26 23 24
+27 22 21
+27 24 22
+27 21 24
+28 21 22
+28 22 23
+28 23 21
+32 35 33
+35 34 33
+32 34 35
+36 31 33
+36 34 31
+36 33 34
+37 32 31
+37 34 32
+37 31 34
+38 31 32
+38 32 33
+38 33 31
diff --git a/wmcube/CHANGES b/wmcube/CHANGES
index 63d172a0eaf9..855a4db05e6d 100644
--- a/wmcube/CHANGES
+++ b/wmcube/CHANGES
@@ -1,4 +1,15 @@
-wmcube 1.0.0:
+wmcube 1.0.1 (February 19, 2015):
+ * Applied a few patches written by Doug Torrance (see: THANKS
+ file).
+ * Updated Makefile (Makefile.LINUX) file according to the
+ modifications by Doug Torrance.
+ * Added three new objects -- X-lines.wmc, X-planes.wmc, and
+ beryllium.wmc -- all of them recommended by Doug Torrance.
+ * Added updated version of wmcube.1 manual page borrowed from
+ Debian.
+ * Added THANKS file.
+
+wmcube 1.0.0 (November 26, 2014):
* Default color scheme changed to the gray one.
* Added red, green, and blue color schemes (you may combine them
in order to get cyan, magenta, and yellow ones).
@@ -12,7 +23,7 @@ wmcube 1.0.0:
* Licence changed to GNU GPL v. 3.
* The program since this version is maintained by Cezary M. Kruk.

-wmcube 0.98:
+wmCube 0.98:
* Added solid flat-shading to 3d-engine.
* New tag in object-files (WMCUBE_PLANES) for solid objects.

@@ -32,17 +43,17 @@ wmCube 0.96:
* FreeBSD support.
* More bundled objects.
* Possibility to change object at run-time by clicking the app
- (Scans the specified directory for objects).
+ (scans the specified directory for objects).

wmCube 0.95:
* You can now design and use other objects than the default cube.
* SMP-support: Commandline option to choose which cpu to monitor.
* Commandline option to leave out "nice" processes when calculating
- cpu-load (Thanks Thorsten Jens).
+ cpu-load (thanks to Thorsten Jens).
* Commandline option to invert the relationship between rotation-
speed and cpu-load.
* Commandline option not to display cpu-load.
- * Improvements in the cpu-load calculation (Thanks Jakob Borg).
+ * Improvements in the cpu-load calculation (thanks to Jakob Borg).

wmCube 0.90:
* Initial release.
diff --git a/wmcube/INSTALL b/wmcube/INSTALL
index cef21b973404..f5750eaeb618 100644
--- a/wmcube/INSTALL
+++ b/wmcube/INSTALL
@@ -1,6 +1,5 @@
Requirements
--------------------------------------------------------------
-
- Linux (glibc at least 2.1) tested on various distributions
or Solaris 8 Sparc/x86 (should work on Solaris 2.x and 7),
or OpenBSD,
@@ -12,13 +11,22 @@ Requirements
To be able to install the application system-wide you need
the root access.

+Disclaimer
+--------------------------------------------------------------
+I tested the current version of wmcube just on Linux. The
+Makefiles for FreeBSD, NetBDS, OpenBSD, and Solaris were
+prepared in 2000 by different contributors and I can not
+guarantee that they still work as they should. So customizing
+them to your needs is up to you.
+
Installation
--------------------------------------------------------------
-1) $ tar -zxf wmcube-1.0.0.tar.gz
+1) $ tar -zxf wmcube-1.0.1.tar.gz

-2) $ cd wmcube-1.0.0/wmcube
+2) $ cd wmcube-1.0.1/wmcube

3) $ make # if you run Linux
+ or:
$ make -f Makefile.XXX # for XXX OS running

Optional:
diff --git a/wmcube/README b/wmcube/README
index 44ddcf0cc383..5757609190ec 100644
--- a/wmcube/README
+++ b/wmcube/README
@@ -1,9 +1,12 @@
-wmcube 1.0.0
+wmcube 1.0.1
---------------------------------------------------------------
Author: Cezary M. Kruk
c.k...@bigfoot.com
http://linux-bsd-unix.strefa.pl

+Contributors:
+ Doug Torrance <dtor...@monmouthcollege.edu>
+
wmCube 0.98
---------------------------------------------------------------
Author: Robert Kling
@@ -11,12 +14,12 @@ Author: Robert Kling
http://boombox.campus.luth.se

Contributors:
- Thorsten Jens (th...@et-inf.fho-emden.de)
- Jakob Borg (email-adress goes here)
- Dan Price (d...@rampant.org)
- Brian Joseph Czapiga (r...@godsey.net)
- Tai-hwa Liang (ava...@mmlab.cse.yzu.edu.tw)
- Jared Smolens (jsmo...@andrew.cmu.edu)
+ Thorsten Jens <th...@et-inf.fho-emden.de>
+ Jakob Borg <email-adress goes here>
+ Dan Price <d...@rampant.org>
+ Brian Joseph Czapiga <r...@godsey.net>
+ Tai-hwa Liang <ava...@mmlab.cse.yzu.edu.tw>
+ Jared Smolens <jsmo...@andrew.cmu.edu>

Description
---------------------------------------------------------------
@@ -46,7 +49,7 @@ Run sample.wmc plugin from the selected directory:

$ wmcube -o ~/myplugins/sample.wmc &

-(The default directory is set to /usr/share/wmcube).
+(The default directory is set to /usr/share/wmcube.)

Mouse actions
---------------------------------------------------------------
@@ -67,9 +70,10 @@ Files
---------------------------------------------------------------
3D-objects 3D object files (plugins)
COPYING GNU General Public License Version 3
-CHANGES Description of the changes
-INSTALL Installation instructions
-README This file
+CHANGES description of the changes
+INSTALL installation instructions
+README this file
+THANKS my thanks to other people

Bugs
---------------------------------------------------------------
@@ -79,6 +83,6 @@ detailed as you can.

Copyright
---------------------------------------------------------------
-wmcube (C) 2014 by Cezary M. Kruk, Wrocław, Poland
+wmcube (C) 2014-2015 by Cezary M. Kruk, Wrocław, Poland
wmCube (C) 2000-2001 by Robert Kling, Lulea, Sweden

diff --git a/wmcube/THANKS b/wmcube/THANKS
new file mode 100644
index 000000000000..d96d20843185
--- /dev/null
+++ b/wmcube/THANKS
@@ -0,0 +1,28 @@
+
+I would like to thank to Doug Torrance for his contribution to
+wmcube including:
+
+* a set of patches:
+
+ - 30_bts-386850_fix_smp.patch -- fixes smp support, reading
+ all the fields in /proc/stat;
+ - 40_bts-357072_long_uptime_fix.patch -- fixes execution on
+ machine with long uptime;
+ - fix_-Wunused-result_v2.patch -- fixes -Wunused-result
+ compiler warnings;
+ - fix_cppcheck_warnings.patch -- fixes warnings found by
+ cppcheck;
+ - fix_grammar.patch -- fixes grammar in error message;
+ - freebsd_sysctl.patch -- uses sysctl instead of kvm to get
+ cpu stats on kfreebsd;
+
+* a few updates in Makefile (Makefile.LINUX) file;
+
+* three new objects:
+
+ - X-lines.wmc,
+ - X-planes.wmc,
+ - beryllium.wmc;
+
+* wmcube.1 manual page.
+
diff --git a/wmcube/wmcube/Makefile b/wmcube/wmcube/Makefile
index f0b3d170b382..2a66a332e478 100644
--- a/wmcube/wmcube/Makefile
+++ b/wmcube/wmcube/Makefile
@@ -1,20 +1,23 @@
CC = gcc
OS = -DLINUX

+VERSION = 1.0.1
+
LIBDIR = -L/usr/X11R6/lib
LIBDIR = -L/usr/X11R6/lib
INCDIR = -I/usr/X11R6/share/include

PREFIX = /usr
BINDIR = $(PREFIX)/bin
-DOCDIR = $(PREFIX)/doc/wmcube-1.0.0
+DOCDIR = $(PREFIX)/doc/wmcube-$(VERSION)
+MANDIR = $(PREFIX)/man/man1
OBJDIR = $(PREFIX)/share/wmcube

# Edit OSLIBS as appropriate to include OS specific libraries.

OSLIBS =
LIBS = -lXpm -lXext -lX11 -lm $(OSLIBS)
-CFLAGS = -Wall -O2 $(OS)
+CFLAGS = -Wall -O2

OBJS = wmcube.o \
../wmgeneral/wmgeneral.o \
@@ -22,10 +25,10 @@ OBJS = wmcube.o \
../wmgeneral/list.o

.c.o:
- $(CC) $(CFLAGS) $(INCDIR) -c $< -o $*.o
+ $(CC) $(OS) $(CPPFLAGS) $(CFLAGS) $(INCDIR) -c $< -o $*.o

wmcube: $(OBJS)
- $(CC) -o wmcube $^ -lXext $(LIBDIR) $(LIBS)
+ $(CC) $(LDFLAGS) -o wmcube $^ -lXext $(LIBDIR) $(LIBS)

all:: wmcube

@@ -41,8 +44,9 @@ install:: wmcube
chmod 755 $(BINDIR)/wmcube
chown root:root $(BINDIR)/wmcube
mkdir -p $(DOCDIR)
- cp -p ../CHANGES ../COPYING ../INSTALL ../README $(DOCDIR)
+ cp -p ../CHANGES ../COPYING ../INSTALL ../README ../THANKS $(DOCDIR)
cp -pr ../3D-objects $(DOCDIR)
+ cp -p wmcube.1 $(MANDIR)
mkdir -p $(OBJDIR)
cp -p ../3D-objects/* $(OBJDIR)
@echo "wmcube installation finished..."
@@ -53,5 +57,6 @@ uninstall::
if [ -d $(DOCDIR)/3D-objects ]; then rmdir $(DOCDIR)/3D-objects; fi
rm -f $(DOCDIR)/*
if [ -d $(DOCDIR) ]; then rmdir $(DOCDIR); fi
+ rm -f $(MANDIR)/wmcube.1
rm -f $(OBJDIR)/*
if [ -d $(OBJDIR) ]; then rmdir $(OBJDIR); fi
diff --git a/wmcube/wmcube/Makefile.FREEBSD b/wmcube/wmcube/Makefile.FREEBSD
index 9bc78bcc28ee..98c589b8e609 100644
--- a/wmcube/wmcube/Makefile.FREEBSD
+++ b/wmcube/wmcube/Makefile.FREEBSD
@@ -1,13 +1,16 @@
CC = gcc
OS = -DFREEBSD

+VERSION = 1.0.1
+
LIBDIR = -L/usr/X11R6/lib
LIBDIR = -L/usr/X11R6/lib
INCDIR = -I/usr/X11R6/include

PREFIX = /usr
BINDIR = $(PREFIX)/bin
-DOCDIR = $(PREFIX)/doc/wmcube-1.0.0
+DOCDIR = $(PREFIX)/doc/wmcube-$(VERSION)
+MANDIR = $(PREFIX)/man/man1
OBJDIR = $(PREFIX)/share/wmcube

# Edit OSLIBS as appropriate to include OS specific libraries.
@@ -41,8 +44,9 @@ install:: wmcube
chmod 755 $(BINDIR)/wmcube
chown root:root $(BINDIR)/wmcube
mkdir -p $(DOCDIR)
- cp -p ../CHANGES ../COPYING ../INSTALL ../README $(DOCDIR)
+ cp -p ../CHANGES ../COPYING ../INSTALL ../README ../THANKS $(DOCDIR)
cp -pr ../3D-objects $(DOCDIR)
+ cp -p wmcube.1 $(MANDIR)
mkdir -p $(OBJDIR)
cp -p ../3D-objects/* $(OBJDIR)
@echo "wmcube installation finished..."
@@ -53,5 +57,6 @@ uninstall::
if [ -d $(DOCDIR)/3D-objects ]; then rmdir $(DOCDIR)/3D-objects; fi
rm -f $(DOCDIR)/*
if [ -d $(DOCDIR) ]; then rmdir $(DOCDIR); fi
+ rm -f $(MANDIR)/wmcube.1
rm -f $(OBJDIR)/*
if [ -d $(OBJDIR) ]; then rmdir $(OBJDIR); fi
diff --git a/wmcube/wmcube/Makefile.LINUX b/wmcube/wmcube/Makefile.LINUX
index f0b3d170b382..2a66a332e478 100644
--- a/wmcube/wmcube/Makefile.LINUX
+++ b/wmcube/wmcube/Makefile.LINUX
@@ -1,20 +1,23 @@
CC = gcc
OS = -DLINUX

+VERSION = 1.0.1
+
LIBDIR = -L/usr/X11R6/lib
LIBDIR = -L/usr/X11R6/lib
INCDIR = -I/usr/X11R6/share/include

PREFIX = /usr
BINDIR = $(PREFIX)/bin
-DOCDIR = $(PREFIX)/doc/wmcube-1.0.0
+DOCDIR = $(PREFIX)/doc/wmcube-$(VERSION)
+MANDIR = $(PREFIX)/man/man1
OBJDIR = $(PREFIX)/share/wmcube

# Edit OSLIBS as appropriate to include OS specific libraries.

OSLIBS =
LIBS = -lXpm -lXext -lX11 -lm $(OSLIBS)
-CFLAGS = -Wall -O2 $(OS)
+CFLAGS = -Wall -O2

OBJS = wmcube.o \
../wmgeneral/wmgeneral.o \
@@ -22,10 +25,10 @@ OBJS = wmcube.o \
../wmgeneral/list.o

.c.o:
- $(CC) $(CFLAGS) $(INCDIR) -c $< -o $*.o
+ $(CC) $(OS) $(CPPFLAGS) $(CFLAGS) $(INCDIR) -c $< -o $*.o

wmcube: $(OBJS)
- $(CC) -o wmcube $^ -lXext $(LIBDIR) $(LIBS)
+ $(CC) $(LDFLAGS) -o wmcube $^ -lXext $(LIBDIR) $(LIBS)

all:: wmcube

@@ -41,8 +44,9 @@ install:: wmcube
chmod 755 $(BINDIR)/wmcube
chown root:root $(BINDIR)/wmcube
mkdir -p $(DOCDIR)
- cp -p ../CHANGES ../COPYING ../INSTALL ../README $(DOCDIR)
+ cp -p ../CHANGES ../COPYING ../INSTALL ../README ../THANKS $(DOCDIR)
cp -pr ../3D-objects $(DOCDIR)
+ cp -p wmcube.1 $(MANDIR)
mkdir -p $(OBJDIR)
cp -p ../3D-objects/* $(OBJDIR)
@echo "wmcube installation finished..."
@@ -53,5 +57,6 @@ uninstall::
if [ -d $(DOCDIR)/3D-objects ]; then rmdir $(DOCDIR)/3D-objects; fi
rm -f $(DOCDIR)/*
if [ -d $(DOCDIR) ]; then rmdir $(DOCDIR); fi
+ rm -f $(MANDIR)/wmcube.1
rm -f $(OBJDIR)/*
if [ -d $(OBJDIR) ]; then rmdir $(OBJDIR); fi
diff --git a/wmcube/wmcube/Makefile.NETBSD b/wmcube/wmcube/Makefile.NETBSD
index 874553b2f6e8..aa3a5aa202e0 100644
--- a/wmcube/wmcube/Makefile.NETBSD
+++ b/wmcube/wmcube/Makefile.NETBSD
@@ -1,6 +1,8 @@
CC = gcc
OS = -DNETBSD

+VERSION = 1.0.1
+
LIBDIR = -L/usr/X11R6/lib -L./libdocapp/

# Edit OSLIBS as appropriate to include OS specific libraries.
@@ -11,7 +13,8 @@ CFLAGS = -Wall -I/usr/X11R6/include -O2 $(OS)

PREFIX = /usr
BINDIR = $(PREFIX)/bin
-DOCDIR = $(PREFIX)/doc/wmcube-1.0.0
+DOCDIR = $(PREFIX)/doc/wmcube-$(VERSION)
+MANDIR = $(PREFIX)/man/man1
OBJDIR = $(PREFIX)/share/wmcube

OBJS = wmcube.o \
@@ -39,8 +42,9 @@ install:: wmcube
chmod 755 $(BINDIR)/wmcube
chown root:root $(BINDIR)/wmcube
mkdir -p $(DOCDIR)
- cp -p ../CHANGES ../COPYING ../INSTALL ../README $(DOCDIR)
+ cp -p ../CHANGES ../COPYING ../INSTALL ../README ../THANKS $(DOCDIR)
cp -pr ../3D-objects $(DOCDIR)
+ cp -p wmcube.1 $(MANDIR)
mkdir -p $(OBJDIR)
cp -p ../3D-objects/* $(OBJDIR)
@echo "wmcube installation finished..."
@@ -51,5 +55,6 @@ uninstall::
if [ -d $(DOCDIR)/3D-objects ]; then rmdir $(DOCDIR)/3D-objects; fi
rm -f $(DOCDIR)/*
if [ -d $(DOCDIR) ]; then rmdir $(DOCDIR); fi
+ rm -f $(MANDIR)/wmcube.1
rm -f $(OBJDIR)/*
if [ -d $(OBJDIR) ]; then rmdir $(OBJDIR); fi
diff --git a/wmcube/wmcube/Makefile.OPENBSD b/wmcube/wmcube/Makefile.OPENBSD
index 7313e9bb1d60..adfd8a096d35 100644
--- a/wmcube/wmcube/Makefile.OPENBSD
+++ b/wmcube/wmcube/Makefile.OPENBSD
@@ -1,6 +1,8 @@
CC = gcc
OS = -DOPENBSD

+VERSION = 1.0.1
+
LIBDIR = -L/usr/X11R6/lib -L./libdocapp/

# Edit OSLIBS as appropriate to include OS specific libraries.
@@ -12,7 +14,8 @@ CFLAGS = -Wall -O2 $(OS) $(INCLUDES)

PREFIX = /usr
BINDIR = $(PREFIX)/bin
-DOCDIR = $(PREFIX)/doc/wmcube-1.0.0
+DOCDIR = $(PREFIX)/doc/wmcube-$(VERSION)
+MANDIR = $(PREFIX)/man/man1
OBJDIR = $(PREFIX)/share/wmcube

OBJS = wmcube.o \
@@ -40,8 +43,9 @@ install:: wmcube
chmod 755 $(BINDIR)/wmcube
chown root:root $(BINDIR)/wmcube
mkdir -p $(DOCDIR)
- cp -p ../CHANGES ../COPYING ../INSTALL ../README $(DOCDIR)
+ cp -p ../CHANGES ../COPYING ../INSTALL ../README ../THANKS $(DOCDIR)
cp -pr ../3D-objects $(DOCDIR)
+ cp -p wmcube.1 $(MANDIR)
mkdir -p $(OBJDIR)
cp -p ../3D-objects/* $(OBJDIR)
@echo "wmcube installation finished..."
@@ -52,5 +56,6 @@ uninstall::
if [ -d $(DOCDIR)/3D-objects ]; then rmdir $(DOCDIR)/3D-objects; fi
rm -f $(DOCDIR)/*
if [ -d $(DOCDIR) ]; then rmdir $(DOCDIR); fi
+ rm -f $(MANDIR)/wmcube.1
rm -f $(OBJDIR)/*
if [ -d $(OBJDIR) ]; then rmdir $(OBJDIR); fi
diff --git a/wmcube/wmcube/Makefile.SOLARIS b/wmcube/wmcube/Makefile.SOLARIS
index f0c4c14f4213..eed97b4b40c4 100644
--- a/wmcube/wmcube/Makefile.SOLARIS
+++ b/wmcube/wmcube/Makefile.SOLARIS
@@ -1,13 +1,16 @@
CC = gcc
OS = -DSOLARIS

+VERSION = 1.0.1
+
LIBDIR = -L/usr/X11R6/lib
LIBDIR = -L/usr/openwin/lib -L/opt/sfw/lib -L/usr/local/lib -R/usr/openwin/lib -R/opt/sfw/lib -R/usr/local/lib
INCDIR = -I/usr/openwin/include -I/opt/sfw/include -I/usr/local/include

PREFIX = /usr
BINDIR = $(PREFIX)/bin
-DOCDIR = $(PREFIX)/doc/wmcube-1.0.0
+DOCDIR = $(PREFIX)/doc/wmcube-$(VERSION)
+MANDIR = $(PREFIX)/man/man1
OBJDIR = $(PREFIX)/share/wmcube

# Edit OSLIBS as appropriate to include OS specific libraries.
@@ -41,8 +44,9 @@ install:: wmcube
chmod 755 $(BINDIR)/wmcube
chown root:root $(BINDIR)/wmcube
mkdir -p $(DOCDIR)
- cp -p ../CHANGES ../COPYING ../INSTALL ../README $(DOCDIR)
+ cp -p ../CHANGES ../COPYING ../INSTALL ../README ../THANKS $(DOCDIR)
cp -pr ../3D-objects $(DOCDIR)
+ cp -p wmcube.1 $(MANDIR)
mkdir -p $(OBJDIR)
cp -p ../3D-objects/* $(OBJDIR)
@echo "wmcube installation finished..."
@@ -53,5 +57,6 @@ uninstall::
if [ -d $(DOCDIR)/3D-objects ]; then rmdir $(DOCDIR)/3D-objects; fi
rm -f $(DOCDIR)/*
if [ -d $(DOCDIR) ]; then rmdir $(DOCDIR); fi
+ rm -f $(MANDIR)/wmcube.1
rm -f $(OBJDIR)/*
if [ -d $(OBJDIR) ]; then rmdir $(OBJDIR); fi
diff --git a/wmcube/wmcube/wmcube.1 b/wmcube/wmcube/wmcube.1
new file mode 100644
index 000000000000..f69d93eb2077
--- /dev/null
+++ b/wmcube/wmcube/wmcube.1
@@ -0,0 +1,85 @@
+.\" -*- nroff -*-
+.TH WMCUBE 1 "February 19, 2015" "Version 1.0.1" "3D object CPU Load display applet"
+
+.SH NAME
+wmcube \-\- spinning 3D object that shows the current CPU load
+
+.SH SYNOPSIS
+wmcube
+[\fI\,OPTIONS\/\fR]
+
+.SH DESCRIPTION
+.I wmcube
+is a dockapp that displays a realtime rotating 3D-object which indicates
+current CPU load. The higher the load, the faster the object spins.
+
+.SH OPTIONS
+.TP
+\fB\-o\fR <filename>
+load external 3D object (plugin).
+.TP
+\fB\-d\fR x
+rotate x degrees/step when the CPU is idle (default 1).
+.TP
+\fB\-r\fR x
+rotate 1 degree faster every x percent of the CPU usage (default 25).
+.TP
+\fB\-c\fR x
+which CPU (0, 1, 2...) to monitor (default average over all).
+.TP
+\fB\-f\fR
+use smooth font (default OFF).
+.TP
+\fB\-n\fR
+exclude "nice" processes (default OFF).
+.TP
+\fB\-b\fR
+draw the cube in a brighter color (default OFF).
+.TP
+\fB\-i\fR
+invert cube speed (default OFF).
+.TP
+\fB\-p\fR
+do not display the CPU load (default OFF).
+.TP
+\fB\-R\fR
+use red image.
+.TP
+\fB\-G\fR
+use green image.
+.TP
+\fB\-B\fR
+use blue image.
+.TP
+\fB\-h\fR
+display this help.
+
+.SH TIPS & TRICKS
+By combining together -RG, -RB, or -GB switches you get yellow, magenta, or cyan
+images. Combining -RGB switches produces the gray image \-\- the same as without
+any swiches.
+
+.SH PROGRAM AUTHORS
+wmcube 1.0.1:
+.IP
+(C) 2014-2015 Cezary M. Kruk <\fIc....@bigfoot.com\fP>
+.IP
+(C) 2015 Doug Torrance
+.LP
+wmCube 0.98:
+.IP
+(C) 2000 Robert Kling
+
+.SH MANPAGE AUTHORS
+Evelyn Mitchell <e...@tummy.com> \-\- manpage for the Debian prepackaged version of wmcube.
+.LP
+Filip Van Raemdonck <mech...@digibel.org> \-\- manpage for version 0.98 of wmcube.
+.LP
+Sandro Tosi <matri...@gmail.com> \-\- manpage for version 0.99-pre1 of wmcube.
+.LP
+Doug Torrance <dtor...@monmouthcollege.edu> \-\- manpage for version 1.0.0.
+.LP
+Cezary M. Kruk <c.k...@bigfoot.com> \-\- manpage for version 1.0.1.
+
+.SH SEE ALSO
+.BR fvwm (1), wmaker (1)
diff --git a/wmcube/wmcube/wmcube.c b/wmcube/wmcube/wmcube.c
index 28ceb1e9f039..516e971bea91 100644
--- a/wmcube/wmcube/wmcube.c
+++ b/wmcube/wmcube/wmcube.c
@@ -2,37 +2,42 @@

wmcube.c

- Version 1.0.0 (2014-11-26)
+ Version 1.0.1 (2015-02-19)
+ Contributions:
+ A few patches, three new objects, and other updates by Doug Torrance
+ <dtor...@monmouthcollege.edu> (2015-02-19)
+
Versions 0.98 (2000-10-23)
Robert Kling <robk...@student.luth.se>
http://boombox.campus.luth.se/projects.php

Contributions:
- -n option patch by Thorsten Jens (th...@et-inf.fho-emden.de) (2000-05-12)
+ -n option patch by Thorsten Jens <th...@et-inf.fho-emden.de> (2000-05-12)
Various bugfixes and optimizations by Jakob Borg (2000-05-13)
- Solaris Port by Dan Price (d...@rampant.org) (2000-07-16)
- OpenBSD Port by Brian Joseph Czapiga (r...@godsey.net) (2000-07-19)
- FreeBSD Port by Tai-hwa Liang (ava...@mmlab.cse.yzu.edu.tw) (2000-07-20)
+ Solaris Port by Dan Price <d...@rampant.org> (2000-07-16)
+ OpenBSD Port by Brian Joseph Czapiga <r...@godsey.net> (2000-07-19)
+ FreeBSD Port by Tai-hwa Liang <ava...@mmlab.cse.yzu.edu.tw> (2000-07-20)
NetBSD Port by Jared Smolens <jsmo...@andrew.cmu.edu> (2000-09-23)

This software is licensed through the GNU General Public Licence.

- See http://www.BenSinclair.com/dockapp/ for more wm dock apps.
+ See http://www.BenSinclair.com/dockapp/ for more Window Maker dockapps.

If you want to port wmcube to another OS the system specific code is
sectioned the bottom of this file. See instructions there.

*/

-#define WMCUBE_VERSION "1.0.0"
-#define REV_YEAR "2014"
-#define REV_DATE "2014-11-26"
-#define WMCUBE_OLDVERSION "0.98"
-#define OLDREV_YEAR "2000"
-#define OLDREV_DATE "2000-10-23"
+#define CK_WMCUBE_VERSION "1.0.1"
+#define CK_REV_YEAR "2014-2015"
+#define CK_REV_DATE "2015-02-19"
+#define DT_REV_YEAR "2015"
+#define RK_WMCUBE_VERSION "0.98"
+#define RK_REV_YEAR "2000"
+#define RK_REV_DATE "2000-10-23"

#include <stdlib.h>
#include <stdio.h>
@@ -58,7 +63,9 @@
#include <X11/extensions/shape.h>

#ifdef FREEBSD
-#include <kvm.h>
+#include <sys/resource.h>
+#include <sys/sysctl.h>
+#include <errno.h>
#endif

#include "../wmgeneral/wmgeneral.h"
@@ -143,11 +150,6 @@ int but_stat = -1;

float lum_vector[3] = { 0, 0, 100 }; // Lightsource vector

-#ifdef FREEBSD
-static kvm_t *kd;
-static struct nlist nlst[] = { {"_cp_time"}, {0} };
-#endif
-
char obj_filename[256];
char *plugin = {""};

@@ -414,7 +416,7 @@ void startup_seq()
char *tmp = malloc(32);
int oldzoff = 3600;

- sprintf(tmp,"%s",WMCUBE_VERSION);
+ sprintf(tmp,"%s",CK_WMCUBE_VERSION);

RedrawWindow();
BlitString("WMCUBE",13,22);
@@ -437,6 +439,7 @@ void startup_seq()
usleep(9000);
}

+ free(tmp);
zoff = 3600;
}

@@ -904,8 +907,9 @@ void setupobj(char *filename)
//*************************************************

void print_help() {
- printf("\nwmcube %s (C) %s Cezary M. Kruk (%s)\n", WMCUBE_VERSION, REV_YEAR, REV_DATE);
- printf("wmCube %s (C) %s Robert Kling (%s)\n\n", WMCUBE_OLDVERSION, OLDREV_YEAR, OLDREV_DATE);
+ printf("\nwmcube %s (C) %s Cezary M. Kruk (%s)\n", CK_WMCUBE_VERSION, CK_REV_YEAR, CK_REV_DATE);
+ printf(" (C) %s Doug Torrance\n", DT_REV_YEAR);
+ printf("wmCube %s (C) %s Robert Kling (%s)\n\n", RK_WMCUBE_VERSION, RK_REV_YEAR, RK_REV_DATE);

printf(" Usage: wmcube [-o <filename>] [-drcfnbipRGBh]\n\n");

@@ -992,7 +996,8 @@ int loadobj(char *filename) {
exit(0);
}

- fscanf(fp,"%s",tmp);
+ if (fscanf(fp,"%s",tmp) < 1)
+ printf("WARNING: Could not read first line of object-file (%s).\n",filename);

if (strcmp(tmp,"WMCUBE_COORDINATES") != 0) {
printf("\nError in objectfile: it must start with WMCUBE_COORDINATES\n\n");
@@ -1000,13 +1005,15 @@ int loadobj(char *filename) {
exit(0);
}

- fscanf(fp,"%s",tmp);
+ if (fscanf(fp,"%s",tmp) < 1)
+ printf("WARNING: Could not read second line of object-file (%s).\n",filename);

while ((strcmp(tmp,"WMCUBE_LINES") != 0) && (strcmp(tmp,"WMCUBE_PLANES") != 0)) {

matrix = (float **)realloc(matrix,(i+1)*sizeof(float *)); mem_alloc_error(matrix);
matrix[i] = (float *)malloc(3*sizeof(float)); mem_alloc_error(matrix[i]);
- fscanf(fp,"%f %f %f",&matrix[i][0],&matrix[i][1],&matrix[i][2]);
+ if (fscanf(fp,"%f %f %f",&matrix[i][0],&matrix[i][1],&matrix[i][2]) < 3 )
+ printf("WARNING: Could not read coordinates in object-file (%s).\n",filename);
//printf("\n%d: %f %f %f",atoi(tmp), matrix[i][0],matrix[i][1],matrix[i][2]);

if (atoi(tmp) != (++i)) {
@@ -1016,7 +1023,8 @@ int loadobj(char *filename) {
fclose(fp);
exit(0);
}
- fscanf(fp,"%s",tmp);
+ if (fscanf(fp,"%s",tmp) < 1)
+ printf("WARNING: Could not read next line of object-file (%s).\n",filename);

if (feof(fp)) {
printf("\nError in objectfile: you must have a section WMCUBE_LINES or WMCUBE_PLANES\n\n");
@@ -1034,14 +1042,18 @@ int loadobj(char *filename) {
while (1) {

cline = (int *)realloc(cline,(i+2)*sizeof(int)); mem_alloc_error(cline);
- fscanf(fp,"%d %d",&cline[i],&cline[i+1]);
+ if (fscanf(fp,"%d %d",&cline[i],&cline[i+1]) < 2) {
+ if (feof(fp))
+ break;
+ else
+ printf("WARNING: Could not read line coordinates in object-file (%s).\n",filename);
+ }
i += 2;
//printf("\n%d %d",cline[i-2],cline[i-1]);
- if (feof(fp)) break;

if (cline[i-2] > nofcoords || cline[i-1] > nofcoords) {
printf("\nError in objectfile (WMCUBE_LINES section):\n"
- "coordinates %d or/and %d doesnt exist\n\n",cline[i-2],cline[i-1]);
+ "coordinates %d and/or %d don't exist\n\n",cline[i-2],cline[i-1]);
fclose(fp);
exit(0);
}
@@ -1054,17 +1066,20 @@ int loadobj(char *filename) {
while (1) {
planes = (int **)realloc(planes,(i+1)*sizeof(int *)); mem_alloc_error(planes);
planes[i] = (int *)malloc(3*sizeof(int)); mem_alloc_error(planes[i]);
- fscanf(fp,"%d %d %d",&planes[i][0],&planes[i][1],&planes[i][2]);
+ if (fscanf(fp,"%d %d %d",&planes[i][0],&planes[i][1],&planes[i][2]) < 3) {
+ if (feof(fp))
+ break;
+ else
+ printf("WARNING: Could not read plane coordinates in object-file (%s).\n",filename);
+ }
//printf("\n%d: %d %d %d",i,planes[i][0],planes[i][1],planes[i][2]);

planes[i][0]--; planes[i][1]--; planes[i][2]--;
//printf("\n%d: %d %d %d\n",i,planes[i][0],planes[i][1],planes[i][2]);

- if (feof(fp)) break;
-
if (planes[i][0] > nofcoords || planes[i][1] > nofcoords || planes[i][2] > nofcoords) {
printf("\nError in objectfile (WMCUBE_PLANES section):\n"
- "coordinates %d or/and %d or/and %d doesnt exist\n\n",planes[i][0],planes[i][1],planes[i][2]);
+ "coordinates %d and/or %d and/or %d don't exist\n\n",planes[i][0],planes[i][1],planes[i][2]);
fclose(fp);
exit(0);
}
@@ -1118,6 +1133,7 @@ int init_calc_cpu()
int i;
char cpuid[6];
char check_cpu[6];
+ char tmp[32];

sprintf(check_cpu, "cpu%d", which_cpu);

@@ -1130,7 +1146,8 @@ int init_calc_cpu()
return 0;

for (i = -2; i < which_cpu; i++) {
- fscanf(fp, "%s", cpuid);
+ if (fscanf(fp, "%5s %31s %31s %31s %31s %31s %31s %31s %31s", cpuid, tmp, tmp, tmp, tmp, tmp, tmp, tmp, tmp) < 1)
+ fprintf(stderr, "WARNING: could not read cpuid from /proc/stat\n");
}

if (strcmp(check_cpu,cpuid) != 0) {
@@ -1138,20 +1155,24 @@ int init_calc_cpu()
"sure you have an SMP system?\n",check_cpu);
return -1;
}
+ fclose(fp);
return (0);
}

int calc_cpu_total() {
- int total, used, t=0, i;
+ unsigned int total, used;
+ int t=0, i;
static int previous_total = 0, previous_used = 0;
char cpuid[6];
- int cpu,nice,system,idle;
+ unsigned int cpu,nice,system,idle;
+ char tmp[32];
FILE *fp;

fp = fopen("/proc/stat","rt");

for (i = -2; i < which_cpu; i++) {
- fscanf(fp,"%s %d %d %d %d",cpuid,&cpu,&nice,&system,&idle);
+ if (fscanf(fp,"%5s %u %u %u %u %31s %31s %31s %31s", cpuid, &cpu, &nice, &system, &idle, tmp, tmp, tmp, tmp) < 5)
+ fprintf(stderr, "WARNING: could not read statistics from /proc/stat\n");
}

fclose(fp);
@@ -1300,26 +1321,28 @@ int calc_cpu_total()
}

#elif defined FREEBSD
-#include <nlist.h>
-#include <fcntl.h>
-#include <sys/dkstat.h>

int init_calc_cpu()
{
+ return 0;
+}

- if ((kd = kvm_open(NULL, NULL, NULL, O_RDONLY, "kvm_open")) == NULL)
- {
- printf("\nError: unable to open kvm\n\n");
- exit(0);
- }
- kvm_nlist(kd, nlst);
- if (nlst[0].n_type == 0)
- {
- printf("\nError: unable to get nlist\n\n");
- exit(1);
- }
+#define GETSYSCTL(name, var) getsysctl(name, &(var), sizeof(var))

- return 0;
+static void getsysctl(const char *name, void *ptr, size_t len)
+{
+ size_t nlen = len;
+
+ if (sysctlbyname(name, ptr, &nlen, NULL, 0) == -1) {
+ fprintf(stderr, "sysctl(%s...) failed: %s\n", name,
+ strerror(errno));
+ exit(1);
+ }
+ if (nlen != len) {
+ fprintf(stderr, "sysctl(%s...) expected %lu, got %lu\n",
+ name, (unsigned long)len, (unsigned long)nlen);
+ exit(1);
+ }
}

int calc_cpu_total() {
@@ -1328,12 +1351,7 @@ int calc_cpu_total() {
int cpu,nice,system,idle;
unsigned long int cpu_time[CPUSTATES];

- if (kvm_read(kd, nlst[0].n_value, &cpu_time, sizeof(cpu_time))
- != sizeof(cpu_time))
- {
- printf("\nError reading kvm\n\n");
- exit(0);
- }
+ GETSYSCTL("kern.cp_time", cpu_time);

cpu = cpu_time[CP_USER];
nice = cpu_time[CP_NICE];
--
2.26.2

Jeremy Sowden

unread,
May 16, 2020, 3:54:44 PM5/16/20
to Window Maker Dev
Signed-off-by: Jeremy Sowden <jer...@azazel.net>
---
wmcube/wmcube/Makefile | 7 ++-----
wmcube/wmcube/wmcube.c | 4 ++--
2 files changed, 4 insertions(+), 7 deletions(-)

diff --git a/wmcube/wmcube/Makefile b/wmcube/wmcube/Makefile
index 9109993c181d..5039dd75942a 100644
--- a/wmcube/wmcube/Makefile
+++ b/wmcube/wmcube/Makefile
@@ -16,13 +16,10 @@ OBJDIR = $(PREFIX)/share/wmcube
# Edit OSLIBS as appropriate to include OS specific libraries.

OSLIBS =
-LIBS = -lXpm -lXext -lX11 -lm $(OSLIBS)
+LIBS = -lXpm -lXext -lX11 -ldockapp -lm $(OSLIBS)
CFLAGS = -Wall -O2

-OBJS = wmcube.o \
- ../wmgeneral/wmgeneral.o \
- ../wmgeneral/misc.o \
- ../wmgeneral/list.o
+OBJS = wmcube.o

.c.o:
$(CC) $(OS) $(CPPFLAGS) $(CFLAGS) $(INCDIR) -c $< -o $*.o
diff --git a/wmcube/wmcube/wmcube.c b/wmcube/wmcube/wmcube.c
index 37eca879ff1e..b2cdf3ad1d5e 100644
--- a/wmcube/wmcube/wmcube.c
+++ b/wmcube/wmcube/wmcube.c
@@ -69,8 +69,8 @@
#include <errno.h>
#endif

-#include "../wmgeneral/wmgeneral.h"
-#include "../wmgeneral/misc.h"
+#include <libdockapp/wmgeneral.h>
+#include <libdockapp/misc.h>

#include "wmcube.xpm"
#include "wmcubered.xpm"
--
2.26.2

Jeremy Sowden

unread,
May 16, 2020, 6:55:37 PM5/16/20
to Window Maker Dev
On 2020-05-16, at 20:54:33 +0100, Jeremy Sowden wrote:
> The upstream URL from the Debian package of wmcube no longer works,
> and my e-mail to the upstream contact to ask about its status bounced,
> so I have extracted the upstream branch from the Debian package and
> applied the Debian patches to it with a view to adopting it in
> dockapps.net
>
> Doug Torrance (5):
> wmcube: imported Upstream version 0.98
> wmcube: imported Upstream version 0.99-pre1
> wmcube: bump to version 1.0.0.
> wmcube: imported Upstream version 1.0.1
> wmcube: imported Upstream version 1.0.2
>
> Jeremy Sowden (2):
> wmcube: use wmgeneral functions in libdockapp instead of the private
> copy.
> wmcube: remove root chown from Makefile.

The first three patches have yet to reach the mailing-list. I'm
guessing they were too big. I've made a copy of my repo publicly
accessible. Would you mind pulling from it? Details below.

J.
signature.asc
wmcube-pull-request.txt

Jeremy Sowden

unread,
May 16, 2020, 7:10:25 PM5/16/20
to Window Maker Dev, Doug Torrance
From: Doug Torrance <dtor...@monmouthcollege.edu>

---
wmcube/3dObjects/2planes-solid.wmc | 23 +
wmcube/3dObjects/4d.wmc | 59 ++
wmcube/3dObjects/8star-small.wmc | 40 +
wmcube/3dObjects/8star.wmc | 40 +
wmcube/3dObjects/CONTRIBUTE | 51 ++
wmcube/3dObjects/README | 54 ++
wmcube/3dObjects/ball-solid.wmc | 104 +++
wmcube/3dObjects/ball.wmc | 83 ++
wmcube/3dObjects/celtic.wmc | 71 ++
wmcube/3dObjects/cross.wmc | 63 ++
wmcube/3dObjects/cross2-solid.wmc | 80 ++
wmcube/3dObjects/cross2.wmc | 51 ++
wmcube/3dObjects/cross3-solid.wmc | 107 +++
wmcube/3dObjects/cross3.wmc | 95 ++
wmcube/3dObjects/cross4-solid.wmc | 107 +++
wmcube/3dObjects/crystal.wmc | 108 +++
wmcube/3dObjects/cube-solid.wmc | 27 +
wmcube/3dObjects/cube.wmc | 24 +
wmcube/3dObjects/diamond.wmc | 66 ++
wmcube/3dObjects/dice-solid.wmc | 81 ++
wmcube/3dObjects/e.wmc | 69 ++
wmcube/3dObjects/e2.wmc | 160 ++++
wmcube/3dObjects/foo.wmc | 149 +++
wmcube/3dObjects/gnustep.wmc | 110 +++
wmcube/3dObjects/hyperpyramid.wmc | 54 ++
wmcube/3dObjects/jeep.wmc | 157 ++++
wmcube/3dObjects/multicube.wmc | 83 ++
wmcube/3dObjects/peace.wmc | 155 ++++
wmcube/3dObjects/pyramid.wmc | 16 +
wmcube/3dObjects/radioactive.wmc | 185 ++++
wmcube/3dObjects/shield.wmc | 197 ++++
wmcube/3dObjects/spaceshuttle.wmc | 382 ++++++++
wmcube/3dObjects/spiral.wmc | 49 +
wmcube/3dObjects/star.wmc | 95 ++
wmcube/3dObjects/starcube.wmc | 69 ++
wmcube/3dObjects/wmlogo.wmc | 59 ++
wmcube/CHANGES | 34 +
wmcube/COPYING | 339 +++++++
wmcube/INSTALL | 37 +
wmcube/README | 41 +
wmcube/TODO | 8 +
wmcube/wmcube/Makefile | 39 +
wmcube/wmcube/Makefile.FREEBSD | 38 +
wmcube/wmcube/Makefile.LINUX | 39 +
wmcube/wmcube/Makefile.NETBSD | 36 +
wmcube/wmcube/Makefile.OPENBSD | 37 +
wmcube/wmcube/Makefile.SOLARIS | 38 +
wmcube/wmcube/wmcube.c | 1351 ++++++++++++++++++++++++++++
wmcube/wmcube/wmcube.xpm | 142 +++
wmcube/wmgeneral/list.c | 169 ++++
wmcube/wmgeneral/list.h | 59 ++
wmcube/wmgeneral/misc.c | 164 ++++
wmcube/wmgeneral/misc.h | 9 +
wmcube/wmgeneral/wmgeneral.c | 481 ++++++++++
wmcube/wmgeneral/wmgeneral.h | 59 ++
55 files changed, 6443 insertions(+)
create mode 100644 wmcube/3dObjects/2planes-solid.wmc
create mode 100644 wmcube/3dObjects/4d.wmc
create mode 100644 wmcube/3dObjects/8star-small.wmc
create mode 100644 wmcube/3dObjects/8star.wmc
create mode 100644 wmcube/3dObjects/CONTRIBUTE
create mode 100644 wmcube/3dObjects/README
create mode 100644 wmcube/3dObjects/ball-solid.wmc
create mode 100644 wmcube/3dObjects/ball.wmc
create mode 100644 wmcube/3dObjects/celtic.wmc
create mode 100644 wmcube/3dObjects/cross.wmc
create mode 100644 wmcube/3dObjects/cross2-solid.wmc
create mode 100644 wmcube/3dObjects/cross2.wmc
create mode 100644 wmcube/3dObjects/cross3-solid.wmc
create mode 100644 wmcube/3dObjects/cross3.wmc
create mode 100644 wmcube/3dObjects/cross4-solid.wmc
create mode 100644 wmcube/3dObjects/crystal.wmc
create mode 100644 wmcube/3dObjects/cube-solid.wmc
create mode 100644 wmcube/3dObjects/cube.wmc
create mode 100644 wmcube/3dObjects/diamond.wmc
create mode 100644 wmcube/3dObjects/dice-solid.wmc
create mode 100644 wmcube/3dObjects/e.wmc
create mode 100644 wmcube/3dObjects/e2.wmc
create mode 100644 wmcube/3dObjects/foo.wmc
create mode 100644 wmcube/3dObjects/gnustep.wmc
create mode 100644 wmcube/3dObjects/hyperpyramid.wmc
create mode 100644 wmcube/3dObjects/jeep.wmc
create mode 100644 wmcube/3dObjects/multicube.wmc
create mode 100644 wmcube/3dObjects/peace.wmc
create mode 100644 wmcube/3dObjects/pyramid.wmc
create mode 100644 wmcube/3dObjects/radioactive.wmc
create mode 100644 wmcube/3dObjects/shield.wmc
create mode 100644 wmcube/3dObjects/spaceshuttle.wmc
create mode 100644 wmcube/3dObjects/spiral.wmc
create mode 100644 wmcube/3dObjects/star.wmc
create mode 100644 wmcube/3dObjects/starcube.wmc
create mode 100644 wmcube/3dObjects/wmlogo.wmc
create mode 100644 wmcube/CHANGES
create mode 100644 wmcube/COPYING
create mode 100644 wmcube/INSTALL
create mode 100644 wmcube/README
create mode 100644 wmcube/TODO
create mode 100644 wmcube/wmcube/Makefile
create mode 100644 wmcube/wmcube/Makefile.FREEBSD
create mode 100644 wmcube/wmcube/Makefile.LINUX
create mode 100644 wmcube/wmcube/Makefile.NETBSD
create mode 100644 wmcube/wmcube/Makefile.OPENBSD
create mode 100644 wmcube/wmcube/Makefile.SOLARIS
create mode 100644 wmcube/wmcube/wmcube.c
create mode 100644 wmcube/wmcube/wmcube.xpm
create mode 100644 wmcube/wmgeneral/list.c
create mode 100644 wmcube/wmgeneral/list.h
create mode 100644 wmcube/wmgeneral/misc.c
create mode 100644 wmcube/wmgeneral/misc.h
create mode 100644 wmcube/wmgeneral/wmgeneral.c
create mode 100644 wmcube/wmgeneral/wmgeneral.h

diff --git a/wmcube/3dObjects/2planes-solid.wmc b/wmcube/3dObjects/2planes-solid.wmc
new file mode 100644
index 000000000000..b884b3507c4d
--- /dev/null
+++ b/wmcube/3dObjects/2planes-solid.wmc
@@ -0,0 +1,23 @@
+WMCUBE_COORDINATES
+1 -180 -180 180
+2 180 -180 180
+3 180 180 80
+4 -180 180 80
+5 -180 -180 -180
+6 180 -180 -180
+7 180 180 -80
+8 -180 180 -80
+
+WMCUBE_PLANES
+1 2 3
+1 3 4
+2 1 4
+2 4 3
+
+5 6 7
+5 7 8
+6 5 7
+7 5 8
+
+
+
diff --git a/wmcube/3dObjects/4d.wmc b/wmcube/3dObjects/4d.wmc
new file mode 100644
index 000000000000..21716d190de1
--- /dev/null
+++ b/wmcube/3dObjects/4d.wmc
@@ -0,0 +1,59 @@
+WMCUBE_COORDINATES
+ 1 -51 50 0
+ 2 0 50 51
+ 3 51 50 0
+ 4 0 50 -51
+
+ 5 74 0 0
+ 6 37 0 64
+ 7 -37 0 64
+ 8 -74 0 0
+ 9 -37 0 -64
+ 10 37 0 -64
+
+ 11 -51 -50 0
+ 12 0 -50 51
+ 13 51 -50 0
+ 14 0 -50 -51
+
+
+ 15 0 100 0
+ 16 0 -100 0
+
+ WMCUBE_LINES
+
+ 15 1
+ 15 2
+ 15 3
+ 15 4
+
+ 1 5
+ 1 6
+ 1 7
+ 2 5
+ 2 8
+ 2 9
+ 3 6
+ 3 8
+ 3 10
+ 4 7
+ 4 9
+ 4 10
+
+ 5 11
+ 5 12
+ 6 11
+ 6 13
+ 7 12
+ 7 13
+ 8 11
+ 8 14
+ 9 12
+ 9 14
+ 10 13
+ 10 14
+
+ 11 16
+ 12 16
+ 13 16
+ 14 16
diff --git a/wmcube/3dObjects/8star-small.wmc b/wmcube/3dObjects/8star-small.wmc
new file mode 100644
index 000000000000..35dddf59dc53
--- /dev/null
+++ b/wmcube/3dObjects/8star-small.wmc
@@ -0,0 +1,40 @@
+WMCUBE_COORDINATES
+ 1 -50 -50 0
+ 2 50 -50 0
+ 3 50 50 0
+ 4 -50 50 0
+ 5 0 0 71
+ 6 0 0 -71
+ 7 0 82 58
+ 8 82 0 58
+ 9 0 -82 58
+ 10 -82 0 58
+ 11 0 82 -58
+ 12 82 0 -58
+ 13 0 -82 -58
+ 14 -82 0 -58
+ WMCUBE_LINES
+ 2 8
+ 2 9
+ 2 12
+ 2 13
+ 4 7
+ 4 10
+ 4 11
+ 4 14
+ 1 9
+ 1 10
+ 1 13
+ 1 14
+ 3 7
+ 3 8
+ 3 11
+ 3 12
+ 5 7
+ 5 8
+ 5 9
+ 5 10
+ 6 11
+ 6 12
+ 6 13
+ 6 14
diff --git a/wmcube/3dObjects/8star.wmc b/wmcube/3dObjects/8star.wmc
new file mode 100644
index 000000000000..c04e721f79e5
--- /dev/null
+++ b/wmcube/3dObjects/8star.wmc
@@ -0,0 +1,40 @@
+WMCUBE_COORDINATES
+ 1 -10 -10 0
+ 2 10 -10 0
+ 3 10 10 0
+ 4 -10 10 0
+ 5 0 0 21
+ 6 0 0 -21
+ 7 0 82 58
+ 8 82 0 58
+ 9 0 -82 58
+ 10 -82 0 58
+ 11 0 82 -58
+ 12 82 0 -58
+ 13 0 -82 -58
+ 14 -82 0 -58
+ WMCUBE_LINES
+ 2 8
+ 2 9
+ 2 12
+ 2 13
+ 4 7
+ 4 10
+ 4 11
+ 4 14
+ 1 9
+ 1 10
+ 1 13
+ 1 14
+ 3 7
+ 3 8
+ 3 11
+ 3 12
+ 5 7
+ 5 8
+ 5 9
+ 5 10
+ 6 11
+ 6 12
+ 6 13
+ 6 14
diff --git a/wmcube/3dObjects/CONTRIBUTE b/wmcube/3dObjects/CONTRIBUTE
new file mode 100644
index 000000000000..374365519908
--- /dev/null
+++ b/wmcube/3dObjects/CONTRIBUTE
@@ -0,0 +1,51 @@
+These are the people who have contributed by making objects for wmCube:
+
+FuzzyBear <fl...@andrew.cmu.edu>
+
+ - 4d.wmc
+ - crystal.wmc
+ - starcube.wmc
+
+Peter Kokles <kok...@bb.telecom.sk>
+
+ - celtic.wmc
+ - multicube.wmc
+ - peace.wmc
+ - radioactive.wmc
+ - shield.wmc
+
+Jeff Frasca <phae...@thereactor.cleptoscastle.com>
+
+ - spiral.wmc
+
+Axel Ahrens <ahr...@ewerk.de>
+
+ - hyperpyramid.wmc
+
+Aaron Benner <ben...@mcn.net>
+
+ - 8star.wmc
+ - 8star-small.wmc
+
+Per Ã…kergren <akep...@student.luth.se>
+
+ - e.wmc
+ - e2.wmc
+
+Adam Hapworth <ad...@mint.net>
+
+ - foo.wmc
+ - jeep.wmc
+
+tarzeau <tar...@space.ch>
+
+ - spaceshuttle.wmc
+
+Rafael Garcia-Suarez <garcia...@kazibao.net>
+
+ - wmlogo.wmc
+
+Nicolas Mieville <n...@altern.org>
+
+ - diamond.wmc
+ - gnustep.wmc
diff --git a/wmcube/3dObjects/README b/wmcube/3dObjects/README
new file mode 100644
index 000000000000..a5cad7589710
--- /dev/null
+++ b/wmcube/3dObjects/README
@@ -0,0 +1,54 @@
+The object-files to be used with wmCube has the
+following format:
+
+WMCUBE_COORDINATES
+
+1 50 -40 30
+2 -50 50 -30
+3 -20 70 -20
+^ ^ ^ ^
+| | | \__ Z-coordinate relative the center
+| | \______ Y-coordinate relative the center
+| \___________ X-coordinate relative the center
+ \_______________ Coordinate index
+
+
+The indexes must be 1,2,3...n on a object with n coordinates.
+The center of the object is the coordinate the object will
+revolve around (0,0,0);
+
+The next section is either (case sensitive):
+
+* WMCUBE_LINES
+
+1 2
+2 3
+3 1
+
+These are the coordinates wmCube will draw lines
+between.
+
+or
+
+* WMCUBE_PLANES
+
+1 2 3
+2 3 1
+1 3 2
+2 1 3
+
+These are the coordinates wmCube will use as corner-
+coordinates for a plane. The tricky part is that the
+plane will be drawn only if you list the coordinates
+making up the plane in clockwise order. In the example
+above, the first two rows making up planes with coordinates
+1 2 3 and 2 3 1 will NOT be drawn until the object
+has rotated some X degrees but the other two will be
+drawn at once. Its kinda hard to explain, just try and you
+will eventually understand how it works.
+
+
+Done! Save the file with a .wmc suffix (preferably) and try
+running wmCube with the -o option and it will tell you if
+something is wrong with the object. Otherwise enjoy and
+remember to send me all the cool objects you create :-)
diff --git a/wmcube/3dObjects/ball-solid.wmc b/wmcube/3dObjects/ball-solid.wmc
new file mode 100644
index 000000000000..fa6f2ff2d289
--- /dev/null
+++ b/wmcube/3dObjects/ball-solid.wmc
@@ -0,0 +1,104 @@
+WMCUBE_COORDINATES
+1 -100 -100 100
+2 100 -100 100
+3 100 100 100
+4 -100 100 100
+5 -100 -100 -100
+6 100 -100 -100
+7 100 100 -100
+8 -100 100 -100
+9 -50 -150 -50
+10 50 -150 -50
+11 150 -50 -50
+12 150 50 -50
+13 50 150 -50
+14 -50 150 -50
+15 -150 50 -50
+16 -150 -50 -50
+17 -150 -50 50
+18 -50 -150 50
+19 50 -150 50
+20 150 -50 50
+21 150 50 50
+22 50 150 50
+23 -50 150 50
+24 -150 50 50
+25 -50 -50 150
+26 50 -50 150
+27 50 50 150
+28 -50 50 150
+29 -50 -50 -150
+30 50 -50 -150
+31 50 50 -150
+32 -50 50 -150
+WMCUBE_PLANES
+1 18 19
+1 19 2
+17 1 24
+24 1 4
+2 20 3
+3 20 21
+4 3 23
+23 3 22
+
+10 9 5
+6 10 5
+8 14 7
+7 14 13
+5 16 15
+5 15 8
+6 7 11
+11 7 12
+
+17 16 5
+17 5 1
+9 18 5
+18 1 5
+
+9 19 18
+9 10 19
+19 10 6
+19 6 2
+
+6 20 2
+6 11 20
+20 11 12
+20 12 21
+
+3 7 13
+3 13 22
+21 12 7
+3 21 7
+
+23 22 14
+22 13 14
+8 4 14
+4 23 14
+
+24 4 8
+24 8 15
+16 17 24
+16 24 15
+
+1 25 28
+1 28 4
+1 2 25
+2 26 25
+26 2 3
+26 3 27
+28 3 4
+28 27 3
+28 25 27
+25 26 27
+
+29 5 8
+29 8 32
+6 30 31
+6 31 7
+29 6 5
+29 30 6
+8 31 32
+8 7 31
+
+29 32 30
+31 30 32
diff --git a/wmcube/3dObjects/ball.wmc b/wmcube/3dObjects/ball.wmc
new file mode 100644
index 000000000000..5a0d8be8bf7a
--- /dev/null
+++ b/wmcube/3dObjects/ball.wmc
@@ -0,0 +1,83 @@
+WMCUBE_COORDINATES
+1 -100 -100 100
+2 100 -100 100
+3 100 100 100
+4 -100 100 100
+5 -100 -100 -100
+6 100 -100 -100
+7 100 100 -100
+8 -100 100 -100
+9 -50 -150 -50
+10 50 -150 -50
+11 150 -50 -50
+12 150 50 -50
+13 50 150 -50
+14 -50 150 -50
+15 -150 50 -50
+16 -150 -50 -50
+17 -150 -50 50
+18 -50 -150 50
+19 50 -150 50
+20 150 -50 50
+21 150 50 50
+22 50 150 50
+23 -50 150 50
+24 -150 50 50
+25 -50 -50 150
+26 50 -50 150
+27 50 50 150
+28 -50 50 150
+29 -50 -50 -150
+30 50 -50 -150
+31 50 50 -150
+32 -50 50 -150
+
+WMCUBE_LINES
+9 10
+10 6
+6 11
+11 12
+12 7
+7 13
+13 14
+14 8
+8 15
+15 16
+16 5
+5 9
+17 1
+1 18
+18 19
+19 2
+2 20
+20 21
+21 3
+3 22
+22 23
+23 4
+4 24
+24 17
+9 18
+10 19
+11 20
+12 21
+13 22
+14 23
+15 24
+16 17
+25 26
+26 27
+27 28
+28 25
+25 1
+26 2
+27 3
+28 4
+29 30
+30 31
+31 32
+32 29
+5 29
+6 30
+7 31
+8 32
diff --git a/wmcube/3dObjects/celtic.wmc b/wmcube/3dObjects/celtic.wmc
new file mode 100644
index 000000000000..5f4523247642
--- /dev/null
+++ b/wmcube/3dObjects/celtic.wmc
@@ -0,0 +1,71 @@
+WMCUBE_COORDINATES
+1 -40 40 40
+2 -40 -40 40
+3 40 -40 40
+4 40 40 40
+5 -60 20 20
+6 -60 -20 20
+7 60 -20 20
+8 60 20 20
+9 -20 60 20
+10 -20 -60 20
+11 20 -60 20
+12 20 60 20
+13 -40 40 -40
+14 -40 -40 -40
+15 40 -40 -40
+16 40 40 -40
+17 -60 20 -20
+18 -60 -20 -20
+19 60 -20 -20
+20 60 20 -20
+21 -20 60 -20
+22 -20 -60 -20
+23 20 -60 -20
+24 20 60 -20
+25 20 20 60
+26 -20 20 60
+27 20 -20 60
+28 -20 -20 60
+29 20 20 -60
+30 -20 20 -60
+31 20 -20 -60
+32 -20 -20 -60
+
+WMCUBE_LINES
+8 18
+20 6
+5 19
+7 17
+8 20
+7 19
+5 17
+6 18
+8 7
+20 19
+5 6
+17 18
+25 26
+26 28
+28 27
+27 25
+29 30
+30 32
+32 31
+31 29
+25 32
+28 29
+26 31
+27 30
+9 23
+11 21
+10 24
+12 22
+24 12
+23 11
+9 21
+10 22
+11 10
+9 12
+23 22
+24 21
diff --git a/wmcube/3dObjects/cross.wmc b/wmcube/3dObjects/cross.wmc
new file mode 100644
index 000000000000..72e9cf6218b2
--- /dev/null
+++ b/wmcube/3dObjects/cross.wmc
@@ -0,0 +1,63 @@
+WMCUBE_COORDINATES
+1 -50 -50 50
+2 50 -50 50
+3 50 50 50
+4 -50 50 50
+5 -50 -50 -50
+6 50 -50 -50
+7 50 50 -50
+8 -50 50 -50
+9 -50 -150 -50
+10 50 -150 -50
+11 150 -50 -50
+12 150 50 -50
+13 50 150 -50
+14 -50 150 -50
+15 -150 50 -50
+16 -150 -50 -50
+17 -150 -50 50
+18 -50 -150 50
+19 50 -150 50
+20 150 -50 50
+21 150 50 50
+22 50 150 50
+23 -50 150 50
+24 -150 50 50
+
+WMCUBE_LINES
+1 5
+2 6
+7 3
+8 4
+9 10
+10 6
+6 11
+11 12
+12 7
+7 13
+13 14
+14 8
+8 15
+15 16
+16 5
+5 9
+17 1
+1 18
+18 19
+19 2
+2 20
+20 21
+21 3
+3 22
+22 23
+23 4
+4 24
+24 17
+9 18
+10 19
+11 20
+12 21
+13 22
+14 23
+15 24
+16 17
diff --git a/wmcube/3dObjects/cross2-solid.wmc b/wmcube/3dObjects/cross2-solid.wmc
new file mode 100644
index 000000000000..4196bec0b2bb
--- /dev/null
+++ b/wmcube/3dObjects/cross2-solid.wmc
@@ -0,0 +1,80 @@
+WMCUBE_COORDINATES
+1 -50 -50 50
+2 50 -50 50
+3 50 50 50
+4 -50 50 50
+5 -50 -50 -50
+6 50 -50 -50
+7 50 50 -50
+8 -50 50 -50
+9 -50 -150 -50
+10 50 -150 -50
+11 150 -50 -50
+12 150 50 -50
+13 50 150 -50
+14 -50 150 -50
+15 -150 50 -50
+16 -150 -50 -50
+17 -150 -50 50
+18 -50 -150 50
+19 50 -150 50
+20 150 -50 50
+21 150 50 50
+22 50 150 50
+23 -50 150 50
+24 -150 50 50
+
+WMCUBE_PLANES
+1 18 19
+1 19 2
+17 1 24
+24 1 4
+1 2 4
+2 3 4
+2 20 3
+3 20 21
+4 3 23
+23 3 22
+
+10 9 5
+6 10 5
+8 14 7
+7 14 13
+5 16 15
+5 15 8
+5 8 6
+8 7 6
+6 7 11
+11 7 12
+
+17 16 5
+17 5 1
+9 18 5
+18 1 5
+
+9 19 18
+9 10 19
+19 10 6
+19 6 2
+
+6 20 2
+6 11 20
+20 11 12
+20 12 21
+
+3 7 13
+3 13 22
+21 12 7
+3 21 7
+
+23 22 14
+22 13 14
+8 4 14
+4 23 14
+
+24 4 8
+24 8 15
+16 17 24
+16 24 15
+
+
diff --git a/wmcube/3dObjects/cross2.wmc b/wmcube/3dObjects/cross2.wmc
new file mode 100644
index 000000000000..61b5a39c046c
--- /dev/null
+++ b/wmcube/3dObjects/cross2.wmc
@@ -0,0 +1,51 @@
+WMCUBE_COORDINATES
+1 -50 -50 50
+2 50 -50 50
+3 50 50 50
+4 -50 50 50
+5 -50 -50 -50
+6 50 -50 -50
+7 50 50 -50
+8 -50 50 -50
+9 -50 -150 -50
+10 50 -150 -50
+11 150 -50 -50
+12 150 50 -50
+13 50 150 -50
+14 -50 150 -50
+15 -150 50 -50
+16 -150 -50 -50
+17 -150 -50 50
+18 -50 -150 50
+19 50 -150 50
+20 150 -50 50
+21 150 50 50
+22 50 150 50
+23 -50 150 50
+24 -150 50 50
+
+WMCUBE_LINES
+9 10
+10 6
+6 11
+11 12
+12 7
+7 13
+13 14
+14 8
+8 15
+15 16
+16 5
+5 9
+17 1
+1 18
+18 19
+19 2
+2 20
+20 21
+21 3
+3 22
+22 23
+23 4
+4 24
+24 17
diff --git a/wmcube/3dObjects/cross3-solid.wmc b/wmcube/3dObjects/cross3-solid.wmc
new file mode 100644
index 000000000000..db2246774199
--- /dev/null
+++ b/wmcube/3dObjects/cross3-solid.wmc
@@ -0,0 +1,107 @@
+WMCUBE_COORDINATES
+1 -50 -50 50
+2 50 -50 50
+3 50 50 50
+4 -50 50 50
+5 -50 -50 -50
+6 50 -50 -50
+7 50 50 -50
+8 -50 50 -50
+9 -50 -150 -50
+10 50 -150 -50
+11 150 -50 -50
+12 150 50 -50
+13 50 150 -50
+14 -50 150 -50
+15 -150 50 -50
+16 -150 -50 -50
+17 -150 -50 50
+18 -50 -150 50
+19 50 -150 50
+20 150 -50 50
+21 150 50 50
+22 50 150 50
+23 -50 150 50
+24 -150 50 50
+25 -50 -50 150
+26 50 -50 150
+27 50 50 150
+28 -50 50 150
+29 -50 -50 -150
+30 50 -50 -150
+31 50 50 -150
+32 -50 50 -150
+
+WMCUBE_PLANES
+1 18 19
+1 19 2
+17 1 24
+24 1 4
+2 20 3
+3 20 21
+4 3 23
+23 3 22
+
+10 9 5
+6 10 5
+8 14 7
+7 14 13
+5 16 15
+5 15 8
+6 7 11
+11 7 12
+
+17 16 5
+17 5 1
+9 18 5
+18 1 5
+
+9 19 18
+9 10 19
+19 10 6
+19 6 2
+
+6 20 2
+6 11 20
+20 11 12
+20 12 21
+
+3 7 13
+3 13 22
+21 12 7
+3 21 7
+
+23 22 14
+22 13 14
+8 4 14
+4 23 14
+
+24 4 8
+24 8 15
+16 17 24
+16 24 15
+
+1 25 28
+1 28 4
+1 2 25
+2 26 25
+26 2 3
+26 3 27
+28 3 4
+28 27 3
+28 25 27
+25 26 27
+
+29 5 8
+29 8 32
+6 30 31
+6 31 7
+29 6 5
+29 30 6
+8 31 32
+8 7 31
+29 32 30
+32 31 30
+
+
+
diff --git a/wmcube/3dObjects/cross3.wmc b/wmcube/3dObjects/cross3.wmc
new file mode 100644
index 000000000000..6916934c5483
--- /dev/null
+++ b/wmcube/3dObjects/cross3.wmc
@@ -0,0 +1,95 @@
+WMCUBE_COORDINATES
+1 -50 -50 50
+2 50 -50 50
+3 50 50 50
+4 -50 50 50
+5 -50 -50 -50
+6 50 -50 -50
+7 50 50 -50
+8 -50 50 -50
+9 -50 -150 -50
+10 50 -150 -50
+11 150 -50 -50
+12 150 50 -50
+13 50 150 -50
+14 -50 150 -50
+15 -150 50 -50
+16 -150 -50 -50
+17 -150 -50 50
+18 -50 -150 50
+19 50 -150 50
+20 150 -50 50
+21 150 50 50
+22 50 150 50
+23 -50 150 50
+24 -150 50 50
+25 -50 -50 150
+26 50 -50 150
+27 50 50 150
+28 -50 50 150
+29 -50 -50 -150
+30 50 -50 -150
+31 50 50 -150
+32 -50 50 -150
+
+WMCUBE_LINES
+1 5
+2 6
+7 3
+8 4
+9 10
+10 6
+6 11
+11 12
+12 7
+7 13
+13 14
+14 8
+8 15
+15 16
+16 5
+5 9
+17 1
+1 18
+18 19
+19 2
+2 20
+20 21
+21 3
+3 22
+22 23
+23 4
+4 24
+24 17
+9 18
+10 19
+11 20
+12 21
+13 22
+14 23
+15 24
+16 17
+25 26
+26 27
+27 28
+28 25
+25 1
+26 2
+27 3
+28 4
+5 6
+6 7
+7 8
+8 5
+29 30
+30 31
+31 32
+32 29
+5 29
+6 30
+7 31
+8 32
+1 2
+2 3
+3 4
+4 1
diff --git a/wmcube/3dObjects/cross4-solid.wmc b/wmcube/3dObjects/cross4-solid.wmc
new file mode 100644
index 000000000000..371d57e7a525
--- /dev/null
+++ b/wmcube/3dObjects/cross4-solid.wmc
@@ -0,0 +1,107 @@
+WMCUBE_COORDINATES
+1 -50 -50 50
+2 50 -50 50
+3 50 50 50
+4 -50 50 50
+5 -50 -50 -50
+6 50 -50 -50
+7 50 50 -50
+8 -50 50 -50
+9 -50 -300 -50
+10 50 -300 -50
+11 300 -50 -50
+12 300 50 -50
+13 50 300 -50
+14 -50 300 -50
+15 -300 50 -50
+16 -300 -50 -50
+17 -300 -50 50
+18 -50 -300 50
+19 50 -300 50
+20 300 -50 50
+21 300 50 50
+22 50 300 50
+23 -50 300 50
+24 -300 50 50
+25 -50 -50 300
+26 50 -50 300
+27 50 50 300
+28 -50 50 300
+29 -50 -50 -300
+30 50 -50 -300
+31 50 50 -300
+32 -50 50 -300
+
+WMCUBE_PLANES
+1 18 19
+1 19 2
+17 1 24
+24 1 4
+2 20 3
+3 20 21
+4 3 23
+23 3 22
+
+10 9 5
+6 10 5
+8 14 7
+7 14 13
+5 16 15
+5 15 8
+6 7 11
+11 7 12
+
+17 16 5
+17 5 1
+9 18 5
+18 1 5
+
+9 19 18
+9 10 19
+19 10 6
+19 6 2
+
+6 20 2
+6 11 20
+20 11 12
+20 12 21
+
+3 7 13
+3 13 22
+21 12 7
+3 21 7
+
+23 22 14
+22 13 14
+8 4 14
+4 23 14
+
+24 4 8
+24 8 15
+16 17 24
+16 24 15
+
+1 25 28
+1 28 4
+1 2 25
+2 26 25
+26 2 3
+26 3 27
+28 3 4
+28 27 3
+28 25 27
+25 26 27
+
+29 5 8
+29 8 32
+6 30 31
+6 31 7
+29 6 5
+29 30 6
+8 31 32
+8 7 31
+29 32 30
+32 31 30
+
+
+
diff --git a/wmcube/3dObjects/crystal.wmc b/wmcube/3dObjects/crystal.wmc
new file mode 100644
index 000000000000..e2341ce53f9b
--- /dev/null
+++ b/wmcube/3dObjects/crystal.wmc
@@ -0,0 +1,108 @@
+WMCUBE_COORDINATES
+ 1 0 0 0
+
+ 2 150 0 0
+ 3 0 150 0
+ 4 0 0 150
+ 5 -150 0 0
+ 6 0 -150 0
+ 7 0 0 -150
+
+ 8 100 -30 -30
+ 9 100 -30 30
+ 10 100 30 30
+ 11 100 30 -30
+
+ 12 30 100 -30
+ 13 30 100 30
+ 14 -30 100 30
+ 15 -30 100 -30
+
+ 16 -100 -30 -30
+ 17 -100 -30 30
+ 18 -100 30 30
+ 19 -100 30 -30
+
+ 20 30 -100 -30
+ 21 30 -100 30
+ 22 -30 -100 30
+ 23 -30 -100 -30
+
+ 24 30 -30 100
+ 25 30 30 100
+ 26 -30 30 100
+ 27 -30 -30 100
+
+ 28 30 -30 -100
+ 29 30 30 -100
+ 30 -30 30 -100
+ 31 -30 -30 -100
+
+ WMCUBE_LINES
+
+ 1 11
+ 1 8
+ 1 9
+ 1 10
+
+ 1 15
+ 1 12
+ 1 13
+ 1 14
+
+ 1 18
+ 1 19
+ 1 16
+ 1 17
+
+ 1 20
+ 1 21
+ 1 22
+ 1 23
+
+ 1 27
+ 1 24
+ 1 25
+ 1 26
+
+ 1 31
+ 1 28
+ 1 29
+ 1 30
+
+ 2 8
+ 2 9
+ 2 10
+ 2 11
+
+ 3 15
+ 3 12
+ 3 13
+ 3 14
+
+ 4 27
+ 4 24
+ 4 25
+ 4 26
+
+ 5 16
+ 5 17
+ 5 18
+ 5 19
+
+ 6 20
+ 6 21
+ 6 22
+ 6 23
+
+ 7 31
+ 7 28
+ 7 29
+ 7 30
+
+ 1 2
+ 1 3
+ 1 4
+ 1 5
+ 1 6
+ 1 7
diff --git a/wmcube/3dObjects/cube-solid.wmc b/wmcube/3dObjects/cube-solid.wmc
new file mode 100644
index 000000000000..31d6a7ba2a6a
--- /dev/null
+++ b/wmcube/3dObjects/cube-solid.wmc
@@ -0,0 +1,27 @@
+WMCUBE_COORDINATES
+1 -180 -180 180
+2 180 -180 180
+3 180 180 180
+4 -180 180 180
+5 -180 -180 -180
+6 180 -180 -180
+7 180 180 -180
+8 -180 180 -180
+
+WMCUBE_PLANES
+1 2 3
+1 3 4
+2 6 7
+2 7 3
+5 1 4
+5 4 8
+5 2 1
+5 6 2
+4 3 8
+3 7 8
+6 5 8
+6 8 7
+
+
+
+
diff --git a/wmcube/3dObjects/cube.wmc b/wmcube/3dObjects/cube.wmc
new file mode 100644
index 000000000000..a55e9755d33d
--- /dev/null
+++ b/wmcube/3dObjects/cube.wmc
@@ -0,0 +1,24 @@
+WMCUBE_COORDINATES
+1 -180 -180 180
+2 180 -180 180
+3 180 180 180
+4 -180 180 180
+5 -180 -180 -180
+6 180 -180 -180
+7 180 180 -180
+8 -180 180 -180
+
+WMCUBE_LINES
+1 2
+2 3
+3 4
+4 1
+5 6
+6 7
+7 8
+8 5
+1 5
+2 6
+3 7
+4 8
+
diff --git a/wmcube/3dObjects/diamond.wmc b/wmcube/3dObjects/diamond.wmc
new file mode 100644
index 000000000000..b8d391709239
--- /dev/null
+++ b/wmcube/3dObjects/diamond.wmc
@@ -0,0 +1,66 @@
+WMCUBE_COORDINATES
+
+1 -50 0 0
+2 -35 0 35
+3 0 0 50
+4 35 0 35
+5 50 0 0
+6 35 0 -35
+7 0 0 -50
+8 -35 0 -35
+
+9 -32 10 13
+10 -13 10 32
+11 13 10 32
+12 32 10 13
+13 32 10 -13
+14 13 10 -32
+15 -13 10 -32
+16 -32 10 -13
+
+17 0 -60 0
+WMCUBE_LINES
+
+1 2
+2 3
+3 4
+4 5
+5 6
+6 7
+7 8
+8 1
+
+9 10
+10 11
+11 12
+12 13
+13 14
+14 15
+15 16
+16 9
+
+1 9
+1 8
+2 10
+2 9
+3 11
+3 10
+4 12
+4 11
+5 13
+5 12
+6 14
+6 13
+7 15
+7 14
+8 16
+8 15
+
+17 1
+17 2
+17 3
+17 4
+17 5
+17 6
+17 7
+17 8
diff --git a/wmcube/3dObjects/dice-solid.wmc b/wmcube/3dObjects/dice-solid.wmc
new file mode 100644
index 000000000000..cd561df21923
--- /dev/null
+++ b/wmcube/3dObjects/dice-solid.wmc
@@ -0,0 +1,81 @@
+WMCUBE_COORDINATES
+1 -70 -120 120
+2 70 -120 120
+3 120 -70 120
+4 120 70 120
+5 70 120 120
+6 -70 120 120
+7 -120 70 120
+8 -120 -70 120
+9 -70 -120 -120
+10 70 -120 -120
+11 120 -70 -120
+12 120 70 -120
+13 70 120 -120
+14 -70 120 -120
+15 -120 70 -120
+16 -120 -70 -120
+
+17 -120 -120 70
+18 120 -120 70
+19 120 120 70
+20 -120 120 70
+
+21 -120 -120 -70
+22 120 -120 -70
+23 120 120 -70
+24 -120 120 -70
+
+WMCUBE_PLANES
+
+17 1 8
+2 18 3
+7 6 20
+5 4 19
+
+21 16 9
+10 11 22
+12 13 23
+15 24 14
+
+1 2 3
+1 3 4
+1 4 5
+1 5 6
+1 6 7
+1 7 8
+
+18 22 11
+18 11 12
+18 12 23
+18 23 19
+18 19 4
+18 4 3
+
+21 17 8
+21 8 7
+21 7 20
+21 20 24
+21 24 15
+21 15 16
+
+9 10 22
+9 22 18
+9 18 2
+9 2 1
+9 1 17
+9 17 21
+
+6 5 19
+6 19 23
+6 23 13
+6 13 14
+6 14 24
+6 24 20
+
+9 11 10
+9 12 11
+9 13 12
+9 14 13
+9 15 14
+9 16 15
diff --git a/wmcube/3dObjects/e.wmc b/wmcube/3dObjects/e.wmc
new file mode 100644
index 000000000000..7c7807035db4
--- /dev/null
+++ b/wmcube/3dObjects/e.wmc
@@ -0,0 +1,69 @@
+WMCUBE_COORDINATES
+1 -60 -120 30
+2 80 -120 30
+3 80 -60 30
+4 0 -60 30
+5 0 -20 30
+6 40 -20 30
+7 40 20 30
+8 0 20 30
+9 0 60 30
+10 80 60 30
+11 80 120 30
+12 -60 120 30
+13 -60 -120 -30
+14 80 -120 -30
+15 80 -60 -30
+16 0 -60 -30
+17 0 -20 -30
+18 40 -20 -30
+19 40 20 -30
+20 0 20 -30
+21 0 60 -30
+22 80 60 -30
+23 80 120 -30
+24 -60 120 -30
+
+
+WMCUBE_LINES
+1 2
+2 3
+3 4
+4 5
+5 6
+6 7
+7 8
+8 9
+9 10
+10 11
+11 12
+ 1 12
+13 14
+14 15
+15 16
+16 17
+17 18
+18 19
+19 20
+20 21
+21 22
+22 23
+23 24
+13 24
+
+1 13
+2 14
+3 15
+4 16
+5 17
+6 18
+7 19
+8 20
+9 21
+10 22
+11 23
+12 24
+
+
+
+
diff --git a/wmcube/3dObjects/e2.wmc b/wmcube/3dObjects/e2.wmc
new file mode 100644
index 000000000000..cd80bd6b735e
--- /dev/null
+++ b/wmcube/3dObjects/e2.wmc
@@ -0,0 +1,160 @@
+WMCUBE_COORDINATES
+1 -60 -120 30
+2 80 -120 30
+3 80 -60 30
+4 0 -60 30
+5 0 -20 30
+6 40 -20 30
+7 40 20 30
+8 0 20 30
+9 0 60 30
+10 80 60 30
+11 80 120 30
+12 -60 120 30
+13 -60 -120 -30
+14 80 -120 -30
+15 80 -60 -30
+16 0 -60 -30
+17 0 -20 -30
+18 40 -20 -30
+19 40 20 -30
+20 0 20 -30
+21 0 60 -30
+22 80 60 -30
+23 80 120 -30
+24 -60 120 -30
+
+25 -60 -10 0
+26 -60 -40 0
+27 -80 -10 0
+28 -80 -40 0
+29 -80 -10 -15
+30 -80 -40 -15
+31 -80 -20 -20
+32 -80 -30 -20
+33 -80 -20 -30
+34 -80 -30 -30
+
+35 -60 -60 0
+36 -60 -90 0
+37 -80 -60 0
+38 -80 -90 0
+39 -80 -60 -15
+40 -80 -90 -15
+41 -80 -70 -20
+42 -80 -80 -20
+43 -80 -70 -30
+44 -80 -80 -30
+
+45 -60 10 0
+46 -60 40 0
+47 -80 10 0
+48 -80 40 0
+49 -80 10 -15
+50 -80 40 -15
+51 -80 20 -20
+52 -80 30 -20
+53 -80 20 -30
+54 -80 30 -30
+
+55 -60 60 0
+56 -60 90 0
+57 -80 60 0
+58 -80 90 0
+59 -80 60 -15
+60 -80 90 -15
+61 -80 70 -20
+62 -80 80 -20
+63 -80 70 -30
+64 -80 80 -30
+WMCUBE_LINES
+1 2
+2 3
+3 4
+4 5
+5 6
+6 7
+7 8
+8 9
+9 10
+10 11
+11 12
+ 1 12
+13 14
+14 15
+15 16
+16 17
+17 18
+18 19
+19 20
+20 21
+21 22
+22 23
+23 24
+13 24
+1 13
+2 14
+3 15
+4 16
+5 17
+6 18
+7 19
+8 20
+9 21
+10 22
+11 23
+12 24
+
+25 26
+27 28
+25 27
+26 28
+27 29
+28 30
+29 31
+30 32
+31 33
+32 34
+33 34
+
+
+35 36
+37 38
+35 37
+36 38
+37 39
+38 40
+39 41
+40 42
+41 43
+42 44
+43 44
+
+45 46
+47 48
+45 47
+46 48
+47 49
+48 50
+49 51
+50 52
+51 53
+52 54
+53 54
+
+55 56
+57 58
+55 57
+56 58
+57 59
+58 60
+59 61
+60 62
+61 63
+62 64
+63 64
+
+
+
+
+
diff --git a/wmcube/3dObjects/foo.wmc b/wmcube/3dObjects/foo.wmc
new file mode 100644
index 000000000000..04add8fd031b
--- /dev/null
+++ b/wmcube/3dObjects/foo.wmc
@@ -0,0 +1,149 @@
+WMCUBE_COORDINATES
+ 1 -190 110 50
+ 2 -190 -90 50
+ 3 -160 -90 50
+ 4 -160 20 50
+ 5 -90 20 50
+ 6 -90 50 50
+ 7 -160 50 50
+ 8 -160 80 50
+ 9 -90 80 50
+ 10 -90 110 50
+
+ 11 -190 110 0
+ 12 -190 -90 0
+ 13 -160 -90 0
+ 14 -160 20 0
+ 15 -90 20 0
+ 16 -90 50 0
+ 17 -160 50 0
+ 18 -160 80 0
+ 19 -90 80 0
+ 20 -90 110 0
+
+
+ 21 -50 110 50
+ 22 60 110 50
+ 23 60 -90 50
+ 24 -50 -90 50
+ 25 -20 -50 50
+ 26 40 -50 50
+ 27 40 70 50
+ 28 -20 70 50
+
+ 29 -50 110 0
+ 30 60 110 0
+ 31 60 -90 0
+ 32 -50 -90 0
+ 33 -20 -50 0
+ 34 20 -50 0
+ 35 20 70 0
+ 36 -20 70 0
+
+
+ 37 110 110 50
+ 38 210 110 50
+ 39 210 -90 50
+ 40 110 -90 50
+ 41 130 -50 50
+ 42 190 -50 50
+ 43 190 70 50
+ 44 130 70 50
+
+ 45 110 110 0
+ 46 210 110 0
+ 47 210 -90 0
+ 48 110 -90 0
+ 49 130 -50 0
+ 50 190 -50 0
+ 51 190 70 0
+ 52 130 70 0
+
+
+ WMCUBE_LINES
+ 1 2
+ 2 3
+ 3 4
+ 4 5
+ 5 6
+ 6 7
+ 7 8
+ 8 9
+ 9 10
+ 10 1
+
+ 11 12
+ 12 13
+ 13 14
+ 14 15
+ 15 16
+ 16 17
+ 17 18
+ 18 19
+ 19 20
+ 20 11
+
+ 1 11
+ 2 12
+ 3 13
+ 4 14
+ 5 15
+ 6 16
+ 7 17
+ 8 18
+ 9 19
+ 10 20
+
+ 21 22
+ 22 23
+ 23 24
+ 24 21
+ 25 26
+ 26 27
+ 27 28
+ 28 25
+
+ 29 30
+ 30 31
+ 31 32
+ 32 29
+ 33 34
+ 34 35
+ 35 36
+ 36 33
+
+ 21 29
+ 22 30
+ 23 31
+ 24 32
+ 25 33
+ 26 34
+ 27 35
+ 28 36
+
+ 37 38
+ 38 39
+ 39 40
+ 40 37
+ 41 42
+ 42 43
+ 43 44
+ 44 41
+
+ 45 46
+ 46 47
+ 47 48
+ 48 45
+ 49 50
+ 50 51
+ 51 52
+ 52 49
+
+ 37 45
+ 38 46
+ 39 47
+ 40 48
+ 41 49
+ 42 50
+ 43 51
+ 44 52
diff --git a/wmcube/3dObjects/gnustep.wmc b/wmcube/3dObjects/gnustep.wmc
new file mode 100644
index 000000000000..93893fd1ae27
--- /dev/null
+++ b/wmcube/3dObjects/gnustep.wmc
@@ -0,0 +1,110 @@
+WMCUBE_COORDINATES
+
+1 50 0 -10
+2 46 19 -10
+3 35 35 -10
+4 19 46 -10
+5 0 50 -10
+6 -19 46 -10
+7 -35 35 -10
+8 -46 19 -10
+9 -50 0 -10
+10 -46 -19 -10
+11 -35 -35 -10
+12 -19 -46 -10
+13 0 -50 -10
+14 19 -46 -10
+15 35 -35 -10
+16 46 -19 -10
+17 -25 35 -10
+18 -25 0 -10
+19 25 0 -10
+20 25 -35 -10
+
+21 50 0 10
+22 46 19 10
+23 35 35 10
+24 19 46 10
+25 0 50 10
+26 -19 46 10
+27 -35 35 10
+28 -46 19 10
+29 -50 0 10
+30 -46 -19 10
+31 -35 -35 10
+32 -19 -46 10
+33 0 -50 10
+34 19 -46 10
+35 35 -35 10
+36 46 -19 10
+37 -25 35 10
+38 -25 0 10
+39 25 0 10
+40 25 -35 10
+WMCUBE_LINES
+
+1 2
+2 3
+3 4
+4 5
+5 6
+6 7
+7 8
+8 9
+9 10
+10 11
+11 12
+12 13
+13 14
+14 15
+15 16
+16 1
+7 17
+17 18
+18 19
+19 20
+20 15
+
+21 22
+22 23
+23 24
+24 25
+25 26
+26 27
+27 28
+28 29
+29 30
+30 31
+31 32
+32 33
+33 34
+34 35
+35 36
+36 21
+27 37
+37 38
+38 39
+39 40
+40 35
+
+17 37
+18 38
+19 39
+20 40
+
+1 21
+2 22
+3 23
+4 24
+5 25
+6 26
+7 27
+8 28
+9 29
+10 30
+11 31
+12 32
+13 33
+14 34
+15 35
+16 36
diff --git a/wmcube/3dObjects/hyperpyramid.wmc b/wmcube/3dObjects/hyperpyramid.wmc
new file mode 100644
index 000000000000..588d8027b192
--- /dev/null
+++ b/wmcube/3dObjects/hyperpyramid.wmc
@@ -0,0 +1,54 @@
+WMCUBE_COORDINATES
+1 300 0 0
+2 -150 260 0
+3 -150 -260 0
+4 50 87 0
+5 -100 0 0
+6 50 -87 0
+7 0 0 90
+8 50 87 -250
+9 -100 0 -250
+10 50 -87 -250
+11 0 0 -90
+12 100 0 -50
+13 -87 100 -50
+14 -87 -100 -50
+
+WMCUBE_LINES
+1 4
+4 2
+2 5
+5 3
+3 6
+6 1
+1 7
+2 7
+3 7
+4 7
+5 7
+6 7
+4 8
+5 9
+6 10
+8 11
+9 11
+10 11
+1 12
+8 12
+10 12
+4 12
+6 12
+11 12
+4 13
+2 13
+5 13
+8 13
+9 13
+11 13
+5 14
+3 14
+6 14
+11 14
+9 14
+10 14
+
diff --git a/wmcube/3dObjects/jeep.wmc b/wmcube/3dObjects/jeep.wmc
new file mode 100644
index 000000000000..5fb8f1d80239
--- /dev/null
+++ b/wmcube/3dObjects/jeep.wmc
@@ -0,0 +1,157 @@
+WMCUBE_COORDINATES
+ 1 -150 -20 0
+ 2 -150 50 0
+ 3 -40 50 0
+ 4 -40 20 0
+ 5 30 20 0
+ 6 30 60 0
+ 7 20 130 0
+ 8 30 50 0
+ 9 160 50 0
+ 10 160 -20 0
+ 11 140 -20 0
+ 12 130 0 0
+ 13 90 0 0
+ 14 80 -20 0
+ 15 80 -40 0
+ 16 100 -60 0
+ 17 110 -60 0
+ 18 140 -40 0
+ 19 -70 -20 0
+ 20 -70 -40 0
+ 21 -90 -60 0
+ 22 -110 -60 0
+ 23 -130 -40 0
+ 24 -130 -20 0
+ 25 -120 0 0
+ 26 -80 0 0
+ 27 -150 50 0
+ 28 -80 120 0
+ 29 -80 50 0
+ 30 90 40 0
+ 31 170 40 0
+ 32 180 30 0
+ 33 180 10 0
+ 34 160 10 0
+ 35 80 -10 0
+ 36 -80 -10 0
+
+ 37 -150 -20 100
+ 38 -150 50 100
+ 39 -40 50 100
+ 40 -40 20 100
+ 41 30 20 100
+ 42 30 60 100
+ 43 20 130 100
+ 44 30 50 100
+ 45 160 50 100
+ 46 160 -20 100
+ 47 140 -20 100
+ 48 130 0 100
+ 49 90 0 100
+ 50 80 -20 100
+ 51 80 -40 100
+ 52 100 -60 100
+ 53 110 -60 100
+ 54 140 -40 100
+ 55 -70 -20 100
+ 56 -70 -40 100
+ 57 -90 -60 100
+ 58 -110 -60 100
+ 59 -130 -40 100
+ 60 -130 -20 100
+ 61 -120 0 100
+ 62 -80 0 100
+ 63 -150 50 100
+ 64 -80 120 100
+ 65 -80 50 100
+ 66 90 40 100
+ 67 170 40 100
+ 68 180 30 100
+ 69 180 10 100
+ 70 160 10 100
+ 71 80 -10 100
+ 72 -80 -10 100
+
+ WMCUBE_LINES
+ 1 2
+ 2 3
+ 3 4
+ 4 5
+ 5 6
+ 6 7
+ 8 9
+ 9 10
+ 10 11
+ 11 12
+ 12 13
+ 13 14
+ 14 15
+ 15 16
+ 16 17
+ 17 18
+ 35 36
+ 19 20
+ 20 21
+ 21 22
+ 22 23
+ 23 24
+ 24 1
+ 24 25
+ 25 26
+ 27 28
+ 28 29
+ 30 31
+ 31 32
+ 32 33
+ 33 34
+ 18 11
+
+ 37 38
+ 38 39
+ 39 40
+ 40 41
+ 41 42
+ 42 43
+ 44 45
+ 45 46
+ 46 47
+ 47 48
+ 48 49
+ 49 50
+ 50 51
+ 51 52
+ 52 53
+ 53 54
+ 71 72
+ 55 56
+ 56 57
+ 57 58
+ 58 59
+ 59 60
+ 60 37
+ 60 61
+ 61 62
+ 63 64
+ 64 65
+ 66 67
+ 67 68
+ 68 69
+ 69 70
+ 54 47
+
+ 1 37
+ 2 38
+ 3 39
+ 4 40
+ 5 41
+ 6 42
+ 7 43
+ 8 44
+ 9 45
+ 10 46
+ 11 47
+ 35 71
+ 36 72
+ 24 60
+ 28 64
diff --git a/wmcube/3dObjects/multicube.wmc b/wmcube/3dObjects/multicube.wmc
new file mode 100644
index 000000000000..ba0543929042
--- /dev/null
+++ b/wmcube/3dObjects/multicube.wmc
@@ -0,0 +1,83 @@
+WMCUBE_COORDINATES
+1 -40 40 40
+2 -40 -40 40
+3 40 -40 40
+4 40 40 40
+5 -60 20 20
+6 -60 -20 20
+7 60 -20 20
+8 60 20 20
+9 -20 60 20
+10 -20 -60 20
+11 20 -60 20
+12 20 60 20
+13 -40 40 -40
+14 -40 -40 -40
+15 40 -40 -40
+16 40 40 -40
+17 -60 20 -20
+18 -60 -20 -20
+19 60 -20 -20
+20 60 20 -20
+21 -20 60 -20
+22 -20 -60 -20
+23 20 -60 -20
+24 20 60 -20
+25 20 20 60
+26 -20 20 60
+27 20 -20 60
+28 -20 -20 60
+29 20 20 -60
+30 -20 20 -60
+31 20 -20 -60
+32 -20 -20 -60
+
+WMCUBE_LINES
+1 2
+2 3
+3 4
+4 1
+5 6
+6 7
+7 8
+8 5
+9 10
+10 11
+11 12
+12 9
+13 14
+14 15
+15 16
+16 13
+1 13
+2 14
+3 15
+4 16
+17 18
+18 19
+19 20
+20 17
+8 20
+5 17
+6 18
+7 19
+21 22
+22 23
+23 24
+24 21
+12 24
+23 11
+9 21
+10 22
+25 26
+26 28
+27 28
+27 25
+25 29
+26 30
+28 31
+27 32
+29 30
+30 32
+31 32
+31 29
diff --git a/wmcube/3dObjects/peace.wmc b/wmcube/3dObjects/peace.wmc
new file mode 100644
index 000000000000..22b57cbcf7c8
--- /dev/null
+++ b/wmcube/3dObjects/peace.wmc
@@ -0,0 +1,155 @@
+WMCUBE_COORDINATES
+1 0 -120 10
+2 -46 -111 10
+3 -85 -85 10
+4 -111 -46 10
+5 -120 0 10
+6 -111 46 10
+7 -85 85 10
+8 -46 111 10
+9 0 120 10
+10 46 111 10
+11 85 85 10
+12 111 46 10
+13 120 0 10
+14 111 -46 10
+15 85 -85 10
+16 46 -111 10
+17 63 -77 10
+18 38 -92 10
+19 0 -100 10
+20 -38 -92 10
+21 -63 -77 10
+22 -77 -63 10
+23 -92 -38 10
+24 -100 0 10
+25 -92 38 10
+26 -71 71 10
+27 -38 92 10
+28 -10 100 10
+29 10 100 10
+30 38 92 10
+31 71 71 10
+32 92 38 10
+33 100 0 10
+34 92 -38 10
+35 77 -63 10
+36 0 -14 10
+37 -10 4 10
+38 10 4 10
+39 0 -120 -10
+40 -46 -111 -10
+41 -85 -85 -10
+42 -111 -46 -10
+43 -120 0 -10
+44 -111 46 -10
+45 -85 85 -10
+46 -46 111 -10
+47 0 120 -10
+48 46 111 -10
+49 85 85 -10
+50 111 46 -10
+51 120 0 -10
+52 111 -46 -10
+53 85 -85 -10
+54 46 -111 -10
+55 63 -77 -10
+56 38 -92 -10
+57 0 -100 -10
+58 -38 -92 -10
+59 -63 -77 -10
+60 -77 -63 -10
+61 -92 -38 -10
+62 -100 0 -10
+63 -92 38 -10
+64 -71 71 -10
+65 -38 92 -10
+66 -10 100 -10
+67 10 100 -10
+68 38 92 -10
+69 71 71 -10
+70 92 38 -10
+71 100 0 -10
+72 92 -38 -10
+73 77 -63 -10
+74 0 -14 -10
+75 -10 4 -10
+76 10 4 -10
+
+WMCUBE_LINES
+1 2
+2 3
+3 4
+4 5
+5 6
+6 7
+7 8
+8 9
+9 10
+10 11
+11 12
+12 13
+13 14
+14 15
+15 16
+16 1
+36 17
+17 18
+18 19
+19 20
+20 21
+21 36
+22 23
+23 24
+24 25
+25 26
+26 27
+27 28
+28 37
+37 22
+38 29
+29 30
+30 31
+31 32
+32 33
+33 34
+34 35
+35 38
+39 40
+40 41
+41 42
+42 43
+43 44
+44 45
+45 46
+46 47
+47 48
+48 49
+49 50
+50 51
+51 52
+52 53
+53 54
+54 39
+76 67
+67 68
+68 69
+69 70
+70 71
+71 72
+72 73
+73 76
+74 55
+55 56
+56 57
+57 58
+58 59
+59 74
+75 60
+60 61
+61 62
+62 63
+63 64
+64 65
+65 66
+66 75
diff --git a/wmcube/3dObjects/pyramid.wmc b/wmcube/3dObjects/pyramid.wmc
new file mode 100644
index 000000000000..99a618cab9b5
--- /dev/null
+++ b/wmcube/3dObjects/pyramid.wmc
@@ -0,0 +1,16 @@
+WMCUBE_COORDINATES
+1 -150 -150 -150
+2 150 -150 -150
+3 150 150 -150
+4 -150 150 -150
+5 0 0 250
+WMCUBE_LINES
+1 2
+2 3
+3 4
+4 1
+1 5
+2 5
+3 5
+4 5
+
diff --git a/wmcube/3dObjects/radioactive.wmc b/wmcube/3dObjects/radioactive.wmc
new file mode 100644
index 000000000000..675ee081eeb5
--- /dev/null
+++ b/wmcube/3dObjects/radioactive.wmc
@@ -0,0 +1,185 @@
+WMCUBE_COORDINATES
+1 0 0 0
+2 5 -19 0
+3 -5 -19 0
+4 -14 -14 0
+5 -19 -5 0
+6 -19 5 0
+7 -14 14 0
+8 -5 19 0
+9 5 19 0
+10 14 14 0
+11 19 5 0
+12 19 -5 0
+13 14 -14 0
+14 -30 -17 0
+15 -34 -9 0
+16 -35 0 0
+17 -34 9 0
+18 -30 17 0
+19 0 35 0
+20 9 34 0
+21 17 30 0
+22 25 25 0
+23 30 17 0
+24 30 -17 0
+25 25 -25 0
+26 17 -30 0
+27 9 -34 0
+28 0 -35 0
+29 87 -50 0
+30 71 -71 0
+31 50 -87 0
+32 26 -97 0
+33 0 -100 0
+34 -87 -50 0
+35 -97 -26 0
+36 -100 0 0
+37 -97 26 0
+38 -87 50 0
+39 0 100 0
+40 26 97 0
+41 50 87 0
+42 71 71 0
+43 87 50 0
+
+44 5 -19 20
+45 -5 -19 20
+46 -14 -14 20
+47 -19 -5 20
+48 -19 5 20
+49 -14 14 20
+50 -5 19 20
+51 5 19 20
+52 14 14 20
+53 19 5 20
+54 19 -5 20
+55 14 -14 20
+56 -30 -17 20
+57 -34 -9 20
+58 -35 0 20
+59 -34 9 20
+60 -30 17 20
+61 0 35 20
+62 9 34 20
+63 17 30 20
+64 25 25 20
+65 30 17 20
+66 30 -17 20
+67 25 -25 20
+68 17 -30 20
+69 9 -34 20
+70 0 -35 20
+71 87 -50 20
+72 71 -71 20
+73 50 -87 20
+74 26 -97 20
+75 0 -100 20
+76 -87 -50 20
+77 -97 -26 20
+78 -100 0 20
+79 -97 26 20
+80 -87 50 20
+81 0 100 20
+82 26 97 20
+83 50 87 20
+84 71 71 20
+85 87 50 20
+
+WMCUBE_LINES
+2 3
+3 4
+4 5
+5 6
+6 7
+7 8
+8 9
+9 10
+10 11
+11 12
+12 13
+13 2
+24 25
+25 26
+26 27
+27 28
+28 33
+33 32
+32 31
+31 30
+30 29
+29 24
+19 20
+20 21
+21 22
+22 23
+23 43
+43 42
+42 41
+41 40
+40 39
+39 19
+14 15
+15 16
+16 17
+17 18
+18 38
+38 37
+37 36
+36 35
+35 34
+34 14
+44 45
+45 46
+46 47
+47 48
+48 49
+49 50
+50 51
+51 52
+52 53
+53 54
+54 55
+55 44
+76 77
+77 78
+78 79
+79 80
+80 60
+56 76
+56 57
+57 58
+58 59
+59 60
+61 62
+62 63
+63 64
+64 65
+81 82
+82 83
+83 84
+84 85
+85 65
+61 81
+66 67
+67 68
+68 69
+69 70
+71 72
+72 73
+73 74
+74 75
+71 66
+75 70
+75 33
+71 29
+85 43
+81 39
+80 38
+76 34
+66 24
+28 70
+56 14
+60 18
+61 19
+65 23
diff --git a/wmcube/3dObjects/shield.wmc b/wmcube/3dObjects/shield.wmc
new file mode 100644
index 000000000000..3451f45f8a5a
--- /dev/null
+++ b/wmcube/3dObjects/shield.wmc
@@ -0,0 +1,197 @@
+WMCUBE_COORDINATES
+1 -76 112 -10
+2 76 112 -10
+3 -10 99 -10
+4 10 99 -10
+5 10 75 -10
+6 33 75 -10
+7 33 55 -10
+8 10 55 -10
+9 -10 55 -10
+10 -33 55 -10
+11 -33 75 -10
+12 -10 75 -10
+13 -55 20 -10
+14 -10 20 -10
+15 10 20 -10
+16 55 20 -10
+17 55 0 -10
+18 10 0 -10
+19 -10 0 -10
+20 -55 0 -10
+21 -76 0 -10
+22 -72 -29 -10
+23 -59 -56 -10
+24 -34 -79 -10
+25 0 -89 -10
+26 35 -79 -10
+27 59 -56 -10
+28 72 -27 -10
+29 76 0 -10
+30 -53 -48 -10
+31 -45 -42 -10
+32 -36 -40 -10
+33 -26 -42 -10
+34 -19 -35 -10
+35 -10 -32 -10
+36 0 -30 -10
+37 10 -32 -10
+38 19 -35 -10
+39 26 -42 -10
+40 36 -40 -10
+41 45 -42 -10
+42 53 -48 -10
+43 -76 112 20
+44 76 112 20
+45 -10 99 20
+46 10 99 20
+47 10 75 20
+48 33 75 20
+49 33 55 20
+50 10 55 20
+51 -10 55 20
+52 -33 55 20
+53 -33 75 20
+54 10 75 20
+55 -55 20 20
+56 -10 20 20
+57 10 20 20
+58 55 20 20
+59 55 0 20
+60 10 0 20
+61 -10 0 20
+62 -55 0 20
+63 -76 0 20
+64 -72 -29 20
+65 -59 -56 20
+66 -34 -79 20
+67 0 -89 20
+68 35 -79 20
+69 59 -56 20
+70 72 -27 20
+71 76 0 20
+72 -53 -48 20
+73 -45 -42 20
+74 -36 -40 20
+75 -26 -42 20
+76 -19 -35 20
+77 -10 -32 20
+78 0 -30 20
+79 10 -32 20
+80 19 -35 20
+81 26 -42 20
+82 36 -40 20
+83 45 -42 20
+84 53 -48 20
+
+
+WMCUBE_LINES
+1 2
+2 29
+29 28
+28 27
+27 26
+26 25
+25 24
+24 23
+23 22
+22 21
+21 1
+3 4
+4 5
+5 6
+6 7
+7 8
+8 15
+15 16
+16 17
+17 18
+18 37
+35 19
+19 20
+20 13
+13 14
+14 9
+9 10
+10 11
+11 12
+12 3
+23 30
+30 31
+31 32
+32 33
+33 34
+34 35
+35 36
+36 37
+37 38
+38 39
+39 40
+40 41
+41 42
+42 27
+43 44
+44 71
+71 70
+70 69
+69 68
+68 67
+67 66
+66 65
+45 46
+46 47
+47 48
+48 49
+49 50
+50 57
+57 58
+58 59
+59 60
+60 79
+35 61
+61 62
+62 55
+55 56
+56 51
+51 52
+52 53
+53 54
+54 45
+65 72
+72 73
+73 74
+74 75
+75 76
+76 77
+77 78
+78 79
+79 80
+80 81
+81 82
+82 83
+83 84
+84 69
+43 63
+63 64
+64 65
+1 43
+2 44
+3 45
+4 46
+5 47
+6 48
+7 49
+8 50
+15 57
+16 58
+17 59
+18 60
+19 61
+20 62
+13 55
+14 56
+9 51
+10 52
+11 53
+12 54
+67 25
diff --git a/wmcube/3dObjects/spaceshuttle.wmc b/wmcube/3dObjects/spaceshuttle.wmc
new file mode 100644
index 000000000000..fb4bc1518333
--- /dev/null
+++ b/wmcube/3dObjects/spaceshuttle.wmc
@@ -0,0 +1,382 @@
+WMCUBE_COORDINATES
+1 -44 0 14
+2 55 0 15
+3 60 0 10
+4 83 0 0
+5 86 0 -3
+6 85 0 -6
+7 77 0 -10
+8 45 0 -12
+9 -44 0 14
+10 -45 0 19
+11 -45 0 19
+12 -82 0 52
+13 -92 0 52
+14 -94 0 51
+15 -80 0 22
+16 -70 0 18
+17 -68 -16 -13
+18 -61 -58 -9
+19 -54 -58 -9
+20 -42 -56 -10
+21 -13 -26 -12
+22 47 -13 -10
+23 -68 16 -13
+24 -61 58 -9
+25 -54 58 -9
+26 -42 55 -10
+27 -13 27 -12
+28 47 13 -10
+29 45 -13 -14
+30 45 -13 9
+31 45 -9 13
+32 45 -4 15
+33 45 4 15
+34 45 9 13
+35 45 13 9
+36 45 13 -14
+37 -45 -13 -14
+38 -45 -13 9
+39 -45 -9 13
+40 -45 -4 15
+41 -45 4 15
+42 -45 9 13
+43 -45 13 9
+44 -45 13 -14
+45 45 13 -4
+46 48 13 -4
+47 78 7 -4
+48 85 3 -4
+49 86 0 -4
+50 45 -13 -4
+51 48 -13 -4
+52 78 -7 -4
+53 85 -3 -4
+54 86 0 -4
+55 45 13 -12
+56 -42 13 -15
+57 -72 13 -14
+58 45 -13 -12
+59 -42 -13 -15
+60 -72 -13 -14
+61 45 13 -12
+62 45 -13 -12
+63 -72 13 -14
+64 -72 -13 -14
+65 -72 14 -14
+66 -84 14 -13
+67 -72 14 -12
+68 -72 -14 -14
+69 -84 -14 -13
+70 -72 -14 -12
+71 -84 14 -13
+72 -84 -14 -13
+73 -72 16 -12
+74 -70 14 4
+75 -69 2 16
+76 -69 -2 16
+77 -70 -15 4
+78 -72 -16 -12
+79 -56 57 -9
+80 -56 16 -13
+81 -56 -57 -9
+82 -56 -16 -13
+83 -93 0 48
+84 -87 0 48
+85 -70 0 23
+86 -80 0 23
+87 -69 15 4
+88 -69 18 12
+89 -69 10 20
+90 -69 2 16
+91 -69 -15 4
+92 -69 -19 12
+93 -69 -11 20
+94 -69 -2 16
+95 -69 15 4
+96 -44 13 5
+97 -69 2 16
+98 -44 2 14
+99 -69 18 12
+100 -52 18 13
+101 -69 10 20
+102 -52 10 21
+103 -52 18 13
+104 -52 -10 21
+105 -52 18 13
+106 -44 13 5
+107 -52 10 21
+108 -44 2 14
+109 -69 -15 4
+110 -44 -13 5
+111 -69 -2 16
+112 -44 -2 14
+113 -69 -19 12
+114 -52 -19 13
+115 -69 -11 20
+116 -52 -10 21
+117 -52 -19 13
+118 -52 -10 21
+119 -52 -19 13
+120 -44 -13 5
+121 -52 -10 21
+122 -44 -2 14
+123 -80 0 16
+124 -81 3 14
+125 -82 3 8
+126 -83 0 6
+127 -82 -3 8
+128 -81 -3 14
+129 -80 0 16
+130 -80 0 16
+131 -69 0 12
+132 -83 0 6
+133 -70 0 4
+134 -82 3 11
+135 -69 2 8
+136 -82 -3 11
+137 -69 -2 -8
+138 -69 0 12
+139 -69 2 8
+140 -70 0 4
+141 -69 -2 8
+142 -69 0 12
+143 -83 8 2
+144 -84 13 -1
+145 -85 13 -6
+146 -85 8 -9
+147 -85 3 -6
+148 -84 3 -1
+149 -83 8 2
+150 -83 8 2
+151 -72 7 -2
+152 -85 8 -9
+153 -73 7 -9
+154 -84 13 -3
+155 -73 10 -5
+156 -84 3 -3
+157 -73 4 -5
+158 -72 7 -2
+159 -73 10 -5
+160 -73 7 -9
+161 -73 4 -5
+162 -72 7 -2
+163 -83 -8 2
+164 -84 -13 -1
+165 -85 -13 -6
+166 -85 -8 -9
+167 -85 -4 -6
+168 -84 -4 -1
+169 -83 -8 2
+170 -83 -8 2
+171 -72 -7 -2
+172 -85 -8 -9
+173 -73 -7 -9
+174 -84 -13 -3
+175 -73 -10 -5
+176 -84 -4 -3
+177 -73 -4 -5
+178 -72 -7 -2
+179 -73 -10 -5
+180 -73 -7 -9
+181 -73 -4 -5
+182 -72 -7 -2
+183 61 2 10
+184 60 5 10
+185 57 5 13
+186 58 3 13
+187 61 2 10
+188 61 -2 10
+189 60 -5 10
+190 57 -5 13
+191 58 -3 13
+192 61 -2 10
+193 60 5 10
+194 57 9 8
+195 55 7 12
+196 57 5 13
+197 60 -5 10
+198 57 -9 8
+199 55 -7 12
+200 57 -5 13
+201 57 9 8
+202 53 10 9
+203 53 7 12
+204 55 7 12
+205 57 -9 8
+206 53 -10 9
+207 53 -7 12
+208 55 -7 12
+209 45 13 5
+210 -45 13 4
+211 45 -13 5
+212 -45 -13 4
+213 45 13 -12
+214 48 13 -12
+215 78 6 -9
+216 85 3 -5
+217 86 0 -4
+218 45 -13 -12
+219 48 -13 -12
+220 78 -7 -9
+221 85 -3 -5
+222 86 0 -4
+223 0 0 0
+WMCUBE_LINES
+2 1
+3 2
+4 3
+5 4
+6 5
+7 6
+8 7
+10 9
+12 11
+13 12
+14 13
+15 14
+16 15
+18 17
+19 18
+20 19
+21 20
+22 21
+24 23
+25 24
+26 25
+27 26
+28 27
+30 29
+31 30
+32 31
+33 32
+34 33
+35 34
+36 35
+38 37
+39 38
+40 39
+41 40
+42 41
+43 42
+44 43
+46 45
+47 46
+48 47
+49 48
+51 50
+52 51
+53 52
+54 53
+56 55
+57 56
+59 58
+60 59
+62 61
+64 63
+66 65
+67 66
+69 68
+70 69
+72 71
+74 73
+75 74
+76 75
+77 76
+78 77
+80 79
+82 81
+84 83
+85 84
+86 85
+88 87
+89 88
+90 89
+92 91
+93 92
+94 93
+96 95
+98 97
+100 99
+102 101
+104 103
+106 105
+108 107
+110 109
+112 111
+114 113
+116 115
+118 117
+120 119
+122 121
+124 123
+125 124
+126 125
+127 126
+128 127
+129 128
+131 130
+133 132
+135 134
+137 136
+139 138
+140 139
+141 140
+142 141
+144 143
+145 144
+146 145
+147 146
+148 147
+149 148
+151 150
+153 152
+155 154
+157 156
+159 158
+160 159
+161 160
+162 161
+164 163
+165 164
+166 165
+167 166
+168 167
+169 168
+171 170
+173 172
+175 174
+177 176
+179 178
+180 179
+181 180
+182 181
+184 183
+185 184
+186 185
+187 186
+189 188
+190 189
+191 190
+192 191
+194 193
+195 194
+196 195
+198 197
+199 198
+200 199
+202 201
+203 202
+204 203
+206 205
+207 206
+208 207
+210 209
+212 211
+214 213
+215 214
+216 215
+217 216
+219 218
+220 219
+221 220
\ No newline at end of file
diff --git a/wmcube/3dObjects/spiral.wmc b/wmcube/3dObjects/spiral.wmc
new file mode 100644
index 000000000000..0af2d4fb8d14
--- /dev/null
+++ b/wmcube/3dObjects/spiral.wmc
@@ -0,0 +1,49 @@
+WMCUBE_COORDINATES
+
+1 80 0 0
+2 0 -90 25
+3 -100 0 50
+4 0 110 75
+5 120 0 100
+6 0 -130 125
+7 -140 0 150
+8 0 150 175
+9 160 0 200
+10 0 70 -25
+11 -60 0 -50
+12 0 -50 -75
+13 40 0 -100
+14 0 30 -125
+15 -20 0 -150
+16 0 -10 -175
+17 0 0 -200
+18 0 -160 200
+19 -160 0 200
+20 0 160 200
+
+WMCUBE_LINES
+
+1 2
+2 3
+3 4
+4 5
+5 6
+6 7
+7 8
+8 9
+1 10
+10 11
+11 12
+12 13
+13 14
+14 15
+15 16
+16 17
+17 9
+17 18
+17 19
+17 20
+9 18
+18 19
+19 20
+20 9
diff --git a/wmcube/3dObjects/star.wmc b/wmcube/3dObjects/star.wmc
new file mode 100644
index 000000000000..1fd0b244a5e4
--- /dev/null
+++ b/wmcube/3dObjects/star.wmc
@@ -0,0 +1,95 @@
+WMCUBE_COORDINATES
+1 -90 -90 90
+2 90 -90 90
+3 90 90 90
+4 -90 90 90
+5 -90 -90 -90
+6 90 -90 -90
+7 90 90 -90
+8 -90 90 -90
+9 -10 -350 -10
+10 10 -350 -10
+11 350 -10 -10
+12 350 10 -10
+13 10 350 -10
+14 -10 350 -10
+15 -350 10 -10
+16 -350 -10 -10
+17 -350 -10 10
+18 -10 -350 10
+19 10 -350 10
+20 350 -10 10
+21 350 10 10
+22 10 350 10
+23 -10 350 10
+24 -350 10 10
+25 -10 -10 350
+26 10 -10 350
+27 10 10 350
+28 -10 10 350
+29 -10 -10 -350
+30 10 -10 -350
+31 10 10 -350
+32 -10 10 -350
+
+WMCUBE_LINES
+1 5
+2 6
+7 3
+8 4
+9 10
+10 6
+6 11
+11 12
+12 7
+7 13
+13 14
+14 8
+8 15
+15 16
+16 5
+5 9
+17 1
+1 18
+18 19
+19 2
+2 20
+20 21
+21 3
+3 22
+22 23
+23 4
+4 24
+24 17
+9 18
+10 19
+11 20
+12 21
+13 22
+14 23
+15 24
+16 17
+25 26
+26 27
+27 28
+28 25
+25 1
+26 2
+27 3
+28 4
+5 6
+6 7
+7 8
+8 5
+29 30
+30 31
+31 32
+32 29
+5 29
+6 30
+7 31
+8 32
+1 2
+2 3
+3 4
+4 1
diff --git a/wmcube/3dObjects/starcube.wmc b/wmcube/3dObjects/starcube.wmc
new file mode 100644
index 000000000000..a7bc2dfe501a
--- /dev/null
+++ b/wmcube/3dObjects/starcube.wmc
@@ -0,0 +1,69 @@
+WMCUBE_COORDINATES
+ 1 -100 -100 100
+ 2 100 -100 100
+ 3 100 100 100
+ 4 -100 100 100
+ 5 -100 -100 -100
+ 6 100 -100 -100
+ 7 100 100 -100
+ 8 -100 100 -100
+
+ 9 75 0 0
+ 10 0 75 0
+ 11 0 0 75
+ 12 -75 0 0
+ 13 0 -75 0
+ 14 0 0 -75
+
+ 15 -75 -75 75
+ 16 75 -75 75
+ 17 75 75 75
+ 18 -75 75 75
+ 19 -75 -75 -75
+ 20 75 -75 -75
+ 21 75 75 -75
+ 22 -75 75 -75
+
+ WMCUBE_LINES
+ 1 2
+ 2 3
+ 3 4
+ 4 1
+ 5 6
+ 6 7
+ 7 8
+ 8 5
+ 1 5
+ 2 6
+ 3 7
+ 4 8
+
+ 9 15
+ 9 18
+ 9 19
+ 9 22
+
+ 10 15
+ 10 16
+ 10 19
+ 10 20
+
+ 11 19
+ 11 20
+ 11 21
+ 11 22
+
+ 12 16
+ 12 17
+ 12 20
+ 12 21
+
+ 13 17
+ 13 18
+ 13 21
+ 13 22
+
+ 14 15
+ 14 16
+ 14 17
+ 14 18
diff --git a/wmcube/3dObjects/wmlogo.wmc b/wmcube/3dObjects/wmlogo.wmc
new file mode 100644
index 000000000000..8051cee32c57
--- /dev/null
+++ b/wmcube/3dObjects/wmlogo.wmc
@@ -0,0 +1,59 @@
+WMCUBE_COORDINATES
+ 1 30 -30 10
+ 2 -30 -30 10
+ 3 -30 20 10
+ 4 -10 20 10
+ 5 -10 0 10
+ 6 10 0 10
+ 7 10 -20 10
+ 8 30 -20 10
+ 9 30 -30 -10
+ 10 -30 -30 -10
+ 11 -30 20 -10
+ 12 -10 20 -10
+ 13 -10 0 -10
+ 14 10 0 -10
+ 15 10 -20 -10
+ 16 30 -20 -10
+ 17 30 0 0
+ 18 26 -15 0
+ 19 15 -26 0
+ 20 0 -30 0
+ 21 -15 -26 0
+ 22 -26 -15 0
+ 23 -30 0 0
+ 24 -26 15 0
+ 25 -15 26 0
+ 26 0 30 0
+ 27 15 26 0
+ 28 26 15 0
+
+ WMCUBE_LINES
+ 1 2
+ 2 3
+ 3 4
+ 4 5
+ 5 6
+ 6 7
+ 7 8
+ 8 1
+ 9 10
+ 10 11
+ 11 12
+ 12 13
+ 13 14
+ 14 15
+ 15 16
+ 16 9
+ 17 18
+ 18 19
+ 19 20
+ 20 21
+ 21 22
+ 22 23
+ 23 24
+ 24 25
+ 25 26
+ 26 27
+ 27 28
+ 28 17
diff --git a/wmcube/CHANGES b/wmcube/CHANGES
new file mode 100644
index 000000000000..5b38c4ee9eee
--- /dev/null
+++ b/wmcube/CHANGES
@@ -0,0 +1,34 @@
+wmcube 0.98:
+ * Added solid flat-shading to 3d-engine
+ * New tag in object-files (WMCUBE_PLANES) for solid objects
+
+wmCube 0.97:
+ * NetBSD support
+ * New improved automatic scaling of objects
+ * Click cpu-load to hide/reveal usage
+ * More bundled objects
+ * Bugfixes in object-loading
+ * Bugfixes in intro-sequence
+ * Bugfixes in Linux SMP
+ * Removed scanning directory for objects in Solaris (doesnt work)
+
+wmCube 0.96:
+ * Solaris (Sparc/x86) support
+ * OpenBSD support
+ * FreeBSD support
+ * More bundled objects
+ * Possibility to change object at run-time by clicking the app
+ (Scans the specified directory for objects)
+
+wmCube 0.95:
+ * You can now design and use other objects than the default cube
+ * SMP-support: Commandline option to choose which cpu to monitor
+ * Commandline option to leave out "nice" processes when calculating
+ cpu-load (Thanks Thorsten Jens)
+ * Commandline option to invert the relationship between rotation-
+ speed and cpu-load
+ * Commandline option not to display cpu-load
+ * Improvements in the cpu-load calculation (Thanks Jakob Borg)
+
+wmCube 0.90:
+ * Initial release
diff --git a/wmcube/COPYING b/wmcube/COPYING
new file mode 100644
index 000000000000..a43ea2126fb6
--- /dev/null
+++ b/wmcube/COPYING
@@ -0,0 +1,339 @@
+ GNU GENERAL PUBLIC LICENSE
+ Version 2, June 1991
+
+ Copyright (C) 1989, 1991 Free Software Foundation, Inc.
+ 675 Mass Ave, Cambridge, MA 02139, USA
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+ Preamble
+
+ The licenses for most software are designed to take away your
+freedom to share and change it. By contrast, the GNU General Public
+License is intended to guarantee your freedom to share and change free
+software--to make sure the software is free for all its users. This
+General Public License applies to most of the Free Software
+Foundation's software and to any other program whose authors commit to
+using it. (Some other Free Software Foundation software is covered by
+the GNU Library General Public License instead.) You can apply it to
+your programs, too.
+
+ When we speak of free software, we are referring to freedom, not
+price. Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+this service if you wish), that you receive source code or can get it
+if you want it, that you can change the software or use pieces of it
+in new free programs; and that you know you can do these things.
+
+ To protect your rights, we need to make restrictions that forbid
+anyone to deny you these rights or to ask you to surrender the rights.
+These restrictions translate to certain responsibilities for you if you
+distribute copies of the software, or if you modify it.
+
+ For example, if you distribute copies of such a program, whether
+gratis or for a fee, you must give the recipients all the rights that
+you have. You must make sure that they, too, receive or can get the
+source code. And you must show them these terms so they know their
+rights.
+
+ We protect your rights with two steps: (1) copyright the software, and
+(2) offer you this license which gives you legal permission to copy,
+distribute and/or modify the software.
+
+ Also, for each author's protection and ours, we want to make certain
+that everyone understands that there is no warranty for this free
+software. If the software is modified by someone else and passed on, we
+want its recipients to know that what they have is not the original, so
+that any problems introduced by others will not reflect on the original
+authors' reputations.
+
+ Finally, any free program is threatened constantly by software
+patents. We wish to avoid the danger that redistributors of a free
+program will individually obtain patent licenses, in effect making the
+program proprietary. To prevent this, we have made it clear that any
+patent must be licensed for everyone's free use or not licensed at all.
+
+ The precise terms and conditions for copying, distribution and
+modification follow.
+
+ GNU GENERAL PUBLIC LICENSE
+ TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+ 0. This License applies to any program or other work which contains
+a notice placed by the copyright holder saying it may be distributed
+under the terms of this General Public License. The "Program", below,
+refers to any such program or work, and a "work based on the Program"
+means either the Program or any derivative work under copyright law:
+that is to say, a work containing the Program or a portion of it,
+either verbatim or with modifications and/or translated into another
+language. (Hereinafter, translation is included without limitation in
+the term "modification".) Each licensee is addressed as "you".
+
+Activities other than copying, distribution and modification are not
+covered by this License; they are outside its scope. The act of
+running the Program is not restricted, and the output from the Program
+is covered only if its contents constitute a work based on the
+Program (independent of having been made by running the Program).
+Whether that is true depends on what the Program does.
+
+ 1. You may copy and distribute verbatim copies of the Program's
+source code as you receive it, in any medium, provided that you
+conspicuously and appropriately publish on each copy an appropriate
+copyright notice and disclaimer of warranty; keep intact all the
+notices that refer to this License and to the absence of any warranty;
+and give any other recipients of the Program a copy of this License
+along with the Program.
+
+You may charge a fee for the physical act of transferring a copy, and
+you may at your option offer warranty protection in exchange for a fee.
+
+ 2. You may modify your copy or copies of the Program or any portion
+of it, thus forming a work based on the Program, and copy and
+distribute such modifications or work under the terms of Section 1
+above, provided that you also meet all of these conditions:
+
+ a) You must cause the modified files to carry prominent notices
+ stating that you changed the files and the date of any change.
+
+ b) You must cause any work that you distribute or publish, that in
+ whole or in part contains or is derived from the Program or any
+ part thereof, to be licensed as a whole at no charge to all third
+ parties under the terms of this License.
+
+ c) If the modified program normally reads commands interactively
+ when run, you must cause it, when started running for such
+ interactive use in the most ordinary way, to print or display an
+ announcement including an appropriate copyright notice and a
+ notice that there is no warranty (or else, saying that you provide
+ a warranty) and that users may redistribute the program under
+ these conditions, and telling the user how to view a copy of this
+ License. (Exception: if the Program itself is interactive but
+ does not normally print such an announcement, your work based on
+ the Program is not required to print an announcement.)
+
+These requirements apply to the modified work as a whole. If
+identifiable sections of that work are not derived from the Program,
+and can be reasonably considered independent and separate works in
+themselves, then this License, and its terms, do not apply to those
+sections when you distribute them as separate works. But when you
+distribute the same sections as part of a whole which is a work based
+on the Program, the distribution of the whole must be on the terms of
+this License, whose permissions for other licensees extend to the
+entire whole, and thus to each and every part regardless of who wrote it.
+
+Thus, it is not the intent of this section to claim rights or contest
+your rights to work written entirely by you; rather, the intent is to
+exercise the right to control the distribution of derivative or
+collective works based on the Program.
+
+In addition, mere aggregation of another work not based on the Program
+with the Program (or with a work based on the Program) on a volume of
+a storage or distribution medium does not bring the other work under
+the scope of this License.
+
+ 3. You may copy and distribute the Program (or a work based on it,
+under Section 2) in object code or executable form under the terms of
+Sections 1 and 2 above provided that you also do one of the following:
+
+ a) Accompany it with the complete corresponding machine-readable
+ source code, which must be distributed under the terms of Sections
+ 1 and 2 above on a medium customarily used for software interchange; or,
+
+ b) Accompany it with a written offer, valid for at least three
+ years, to give any third party, for a charge no more than your
+ cost of physically performing source distribution, a complete
+ machine-readable copy of the corresponding source code, to be
+ distributed under the terms of Sections 1 and 2 above on a medium
+ customarily used for software interchange; or,
+
+ c) Accompany it with the information you received as to the offer
+ to distribute corresponding source code. (This alternative is
+ allowed only for noncommercial distribution and only if you
+ received the program in object code or executable form with such
+ an offer, in accord with Subsection b above.)
+
+The source code for a work means the preferred form of the work for
+making modifications to it. For an executable work, complete source
+code means all the source code for all modules it contains, plus any
+associated interface definition files, plus the scripts used to
+control compilation and installation of the executable. However, as a
+special exception, the source code distributed need not include
+anything that is normally distributed (in either source or binary
+form) with the major components (compiler, kernel, and so on) of the
+operating system on which the executable runs, unless that component
+itself accompanies the executable.
+
+If distribution of executable or object code is made by offering
+access to copy from a designated place, then offering equivalent
+access to copy the source code from the same place counts as
+distribution of the source code, even though third parties are not
+compelled to copy the source along with the object code.
+
+ 4. You may not copy, modify, sublicense, or distribute the Program
+except as expressly provided under this License. Any attempt
+otherwise to copy, modify, sublicense or distribute the Program is
+void, and will automatically terminate your rights under this License.
+However, parties who have received copies, or rights, from you under
+this License will not have their licenses terminated so long as such
+parties remain in full compliance.
+
+ 5. You are not required to accept this License, since you have not
+signed it. However, nothing else grants you permission to modify or
+distribute the Program or its derivative works. These actions are
+prohibited by law if you do not accept this License. Therefore, by
+modifying or distributing the Program (or any work based on the
+Program), you indicate your acceptance of this License to do so, and
+all its terms and conditions for copying, distributing or modifying
+the Program or works based on it.
+
+ 6. Each time you redistribute the Program (or any work based on the
+Program), the recipient automatically receives a license from the
+original licensor to copy, distribute or modify the Program subject to
+these terms and conditions. You may not impose any further
+restrictions on the recipients' exercise of the rights granted herein.
+You are not responsible for enforcing compliance by third parties to
+this License.
+
+ 7. If, as a consequence of a court judgment or allegation of patent
+infringement or for any other reason (not limited to patent issues),
+conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License. If you cannot
+distribute so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you
+may not distribute the Program at all. For example, if a patent
+license would not permit royalty-free redistribution of the Program by
+all those who receive copies directly or indirectly through you, then
+the only way you could satisfy both it and this License would be to
+refrain entirely from distribution of the Program.
+
+If any portion of this section is held invalid or unenforceable under
+any particular circumstance, the balance of the section is intended to
+apply and the section as a whole is intended to apply in other
+circumstances.
+
+It is not the purpose of this section to induce you to infringe any
+patents or other property right claims or to contest validity of any
+such claims; this section has the sole purpose of protecting the
+integrity of the free software distribution system, which is
+implemented by public license practices. Many people have made
+generous contributions to the wide range of software distributed
+through that system in reliance on consistent application of that
+system; it is up to the author/donor to decide if he or she is willing
+to distribute software through any other system and a licensee cannot
+impose that choice.
+
+This section is intended to make thoroughly clear what is believed to
+be a consequence of the rest of this License.
+
+ 8. If the distribution and/or use of the Program is restricted in
+certain countries either by patents or by copyrighted interfaces, the
+original copyright holder who places the Program under this License
+may add an explicit geographical distribution limitation excluding
+those countries, so that distribution is permitted only in or among
+countries not thus excluded. In such case, this License incorporates
+the limitation as if written in the body of this License.
+
+ 9. The Free Software Foundation may publish revised and/or new versions
+of the General Public License from time to time. Such new versions will
+be similar in spirit to the present version, but may differ in detail to
+address new problems or concerns.
+
+Each version is given a distinguishing version number. If the Program
+specifies a version number of this License which applies to it and "any
+later version", you have the option of following the terms and conditions
+either of that version or of any later version published by the Free
+Software Foundation. If the Program does not specify a version number of
+this License, you may choose any version ever published by the Free Software
+Foundation.
+
+ 10. If you wish to incorporate parts of the Program into other free
+programs whose distribution conditions are different, write to the author
+to ask for permission. For software which is copyrighted by the Free
+Software Foundation, write to the Free Software Foundation; we sometimes
+make exceptions for this. Our decision will be guided by the two goals
+of preserving the free status of all derivatives of our free software and
+of promoting the sharing and reuse of software generally.
+
+ NO WARRANTY
+
+ 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
+FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
+OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
+PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
+OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
+TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
+PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
+REPAIR OR CORRECTION.
+
+ 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
+REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
+INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
+OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
+TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
+YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
+PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
+POSSIBILITY OF SUCH DAMAGES.
+
+ END OF TERMS AND CONDITIONS
+
+ Appendix: How to Apply These Terms to Your New Programs
+
+ If you develop a new program, and you want it to be of the greatest
+possible use to the public, the best way to achieve this is to make it
+free software which everyone can redistribute and change under these terms.
+
+ To do so, attach the following notices to the program. It is safest
+to attach them to the start of each source file to most effectively
+convey the exclusion of warranty; and each file should have at least
+the "copyright" line and a pointer to where the full notice is found.
+
+ <one line to give the program's name and a brief idea of what it does.>
+ Copyright (C) 19yy <name of author>
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+
+Also add information on how to contact you by electronic and paper mail.
+
+If the program is interactive, make it output a short notice like this
+when it starts in an interactive mode:
+
+ Gnomovision version 69, Copyright (C) 19yy name of author
+ Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
+ This is free software, and you are welcome to redistribute it
+ under certain conditions; type `show c' for details.
+
+The hypothetical commands `show w' and `show c' should show the appropriate
+parts of the General Public License. Of course, the commands you use may
+be called something other than `show w' and `show c'; they could even be
+mouse-clicks or menu items--whatever suits your program.
+
+You should also get your employer (if you work as a programmer) or your
+school, if any, to sign a "copyright disclaimer" for the program, if
+necessary. Here is a sample; alter the names:
+
+ Yoyodyne, Inc., hereby disclaims all copyright interest in the program
+ `Gnomovision' (which makes passes at compilers) written by James Hacker.
+
+ <signature of Ty Coon>, 1 April 1989
+ Ty Coon, President of Vice
+
+This General Public License does not permit incorporating your program into
+proprietary programs. If your program is a subroutine library, you may
+consider it more useful to permit linking proprietary applications with the
+library. If this is what you want to do, use the GNU Library General
+Public License instead of this License.
diff --git a/wmcube/INSTALL b/wmcube/INSTALL
new file mode 100644
index 000000000000..8cae7e6858ee
--- /dev/null
+++ b/wmcube/INSTALL
@@ -0,0 +1,37 @@
+Requirements
+--------------------------------------------------------------
+
+- Linux (glibc 2.1) (Tested on various distributions)
+ or Solaris 8 Sparc/x86 (should work on Solaris 2.x and 7)
+ or OpenBSD
+ or FreeBSD 3-stable, 4-stable
+ or NetBSD
+
+- root access
+
+ To be able to install the application system-wide
+ you need root access.
+
+Installation
+--------------------------------------------------------------
+1) % tar -zxvf wmcube-0.98.tar.gz
+
+2) % cd wmcube/wmcube
+
+3) % make (if you are running Linux) or
+ % make -f Makefile.xxx (where xxx is the OS you running)
+
+Optional
+
+4) % su root
+
+5) % make install
+
+6) % wmcube & (or wmcube -h for command line options).
+
+General Notes
+--------------------------------------------------------------
+Note 1: If "make install" fails on your system, please edit
+ the Makefile to set the paths according to your setup.
+ "make install" defaults to /usr/local/bin, $HOME & /etc.
+
diff --git a/wmcube/README b/wmcube/README
new file mode 100644
index 000000000000..9275d458c889
--- /dev/null
+++ b/wmcube/README
@@ -0,0 +1,41 @@
+wmCube 0.98
+--------------------------------------------------------------
+Author: Robert Kling
+ robk...@student.luth.se
+ http://boombox.campus.luth.se
+
+Contributions by:
+ Thorsten Jens (th...@et-inf.fho-emden.de)
+ Jakob Borg (email-adress goes here)
+ Dan Price (d...@rampant.org)
+ Brian Joseph Czapiga (r...@godsey.net)
+ Tai-hwa Liang (ava...@mmlab.cse.yzu.edu.tw)
+ Jared Smolens (jsmo...@andrew.cmu.edu)
+
+Description
+--------------------------------------------------------------
+
+wmCube is a dockapp that displays a realtime rotating 3d-object
+and the current CPU load.
+
+Files
+--------------------------------------------------------------
+3dObjects/ In here you will find bundled object-files.
+README This file.
+INSTALL Installation instructions.
+CHANGES Description of changes.
+TODO Things I've already planned for wmCube
+COPYING GNU General Public License Version 2.
+
+Bugs
+--------------------------------------------------------------
+If you discover any bugs in this software, please send a
+bugreport to robk...@student.luth.se and describe the
+problem as detailed as you can.
+
+Copyright
+--------------------------------------------------------------
+wmCube is Copyright (C) 2000/01 by Robert Kling, Lulea SWEDEN
+
+wmCube is licensed through the GNU General Public License.
+Read the COPYING file for the complete GNU license.
diff --git a/wmcube/TODO b/wmcube/TODO
new file mode 100644
index 000000000000..01df841af48b
--- /dev/null
+++ b/wmcube/TODO
@@ -0,0 +1,8 @@
+TODO list for wmCube future versions
+--------------------------------------------------------------
+
+* Ports to more OS's.
+* Goroud shading, texture mapping (hmm.. do I smell overkill?)
+
+If you have any suggestions, ideas, comments of how to make
+this app better please send it to robk...@student.luth.se.
diff --git a/wmcube/wmcube/Makefile b/wmcube/wmcube/Makefile
new file mode 100644
index 000000000000..1410b29139bb
--- /dev/null
+++ b/wmcube/wmcube/Makefile
@@ -0,0 +1,39 @@
+CC = gcc
+OS = -DLINUX
+
+LIBDIR = -L/usr/X11R6/lib
+LIBDIR = -L/usr/X11R6/lib
+INCDIR = -I/usr/X11R6/share/include
+
+# Edit OSLIBS as appropriate to include OS specific libraries.
+
+OSLIBS =
+LIBS = -lXpm -lXext -lX11 -lm $(OSLIBS)
+CFLAGS = -Wall -O2 $(OS)
+
+OBJS = wmcube.o \
+ ../wmgeneral/wmgeneral.o \
+ ../wmgeneral/misc.o \
+ ../wmgeneral/list.o
+
+.c.o:
+ $(CC) $(CFLAGS) $(INCDIR) -c $< -o $*.o
+
+wmcube: $(OBJS)
+ $(CC) -o wmcube $^ -lXext $(LIBDIR) $(LIBS)
+
+
+all:: wmcube
+
+clean::
+ for i in $(OBJS) ; do \
+ rm -f $$i ; \
+ done
+ rm -f wmcube
+ rm -f *~
+
+install:: wmcube
+ cp -f wmcube /usr/local/bin/
+ chmod 755 /usr/local/bin/wmcube
+ chown root:root /usr/local/bin/wmcube
+ @echo "wmCube installation finished..."
diff --git a/wmcube/wmcube/Makefile.FREEBSD b/wmcube/wmcube/Makefile.FREEBSD
new file mode 100644
index 000000000000..815e32dbc96a
--- /dev/null
+++ b/wmcube/wmcube/Makefile.FREEBSD
@@ -0,0 +1,38 @@
+CC = gcc
+OS = -DFREEBSD
+
+LIBDIR = -L/usr/X11R6/lib
+LIBDIR = -L/usr/X11R6/lib
+INCDIR = -I/usr/X11R6/include
+
+# Edit OSLIBS as appropriate to include OS specific libraries.
+
+OSLIBS = -lkvm
+LIBS = -lXpm -lXext -lX11 -lm $(OSLIBS)
+CFLAGS = -Wall -O2 $(OS)
+
+OBJS = wmcube.o \
+ ../wmgeneral/wmgeneral.o \
+ ../wmgeneral/misc.o \
+ ../wmgeneral/list.o
+
+.c.o:
+ $(CC) $(CFLAGS) $(INCDIR) -c $< -o $*.o
+
+wmcube: $(OBJS)
+ $(CC) -o wmcube $(OBJS) -lXext $(LIBDIR) $(LIBS)
+
+all:: wmcube
+
+clean::
+ for i in $(OBJS) ; do \
+ rm -f $$i ; \
+ done
+ rm -f wmcube
+ rm -f *~
+
+install:: wmcube
+ cp -f wmcube /usr/local/bin/
+ chmod g+s /usr/local/bin/wmcube
+ chown root.kmem /usr/local/bin/wmcube
+ @echo "wmCube installation finished..."
diff --git a/wmcube/wmcube/Makefile.LINUX b/wmcube/wmcube/Makefile.LINUX
new file mode 100644
index 000000000000..1410b29139bb
--- /dev/null
+++ b/wmcube/wmcube/Makefile.LINUX
@@ -0,0 +1,39 @@
+CC = gcc
+OS = -DLINUX
+
+LIBDIR = -L/usr/X11R6/lib
+LIBDIR = -L/usr/X11R6/lib
+INCDIR = -I/usr/X11R6/share/include
+
+# Edit OSLIBS as appropriate to include OS specific libraries.
+
+OSLIBS =
+LIBS = -lXpm -lXext -lX11 -lm $(OSLIBS)
+CFLAGS = -Wall -O2 $(OS)
+
+OBJS = wmcube.o \
+ ../wmgeneral/wmgeneral.o \
+ ../wmgeneral/misc.o \
+ ../wmgeneral/list.o
+
+.c.o:
+ $(CC) $(CFLAGS) $(INCDIR) -c $< -o $*.o
+
+wmcube: $(OBJS)
+ $(CC) -o wmcube $^ -lXext $(LIBDIR) $(LIBS)
+
+
+all:: wmcube
+
+clean::
+ for i in $(OBJS) ; do \
+ rm -f $$i ; \
+ done
+ rm -f wmcube
+ rm -f *~
+
+install:: wmcube
+ cp -f wmcube /usr/local/bin/
+ chmod 755 /usr/local/bin/wmcube
+ chown root:root /usr/local/bin/wmcube
+ @echo "wmCube installation finished..."
diff --git a/wmcube/wmcube/Makefile.NETBSD b/wmcube/wmcube/Makefile.NETBSD
new file mode 100644
index 000000000000..26fe59920933
--- /dev/null
+++ b/wmcube/wmcube/Makefile.NETBSD
@@ -0,0 +1,36 @@
+CC = gcc
+OS = -DNETBSD
+
+LIBDIR = -L/usr/X11R6/lib -L./libdocapp/
+
+# Edit OSLIBS as appropriate to include OS specific libraries.
+
+OSLIBS =
+LIBS = -lXpm -lXext -lX11 -lm $(OSLIBS)
+CFLAGS = -Wall -I/usr/X11R6/include -O2 $(OS)
+
+OBJS = wmcube.o \
+ ../wmgeneral/wmgeneral.o \
+ ../wmgeneral/misc.o \
+ ../wmgeneral/list.o
+
+.c.o:
+ $(CC) $(CFLAGS) $(INCDIR) -c $< -o $*.o
+
+wmcube: $(OBJS)
+ $(CC) -o wmcube -lXext $(LIBDIR) $(LIBS) $(OBJS)
+
+all:: wmcube
+
+clean::
+ for i in $(OBJS) ; do \
+ rm -f $$i ; \
+ done
+ rm -f wmcube
+ rm -f *~
+
+install:: wmcube
+ cp -f wmcube /usr/local/bin/
+ chmod 755 /usr/local/bin/wmcube
+ chown root:root /usr/local/bin/wmcube
+ @echo "wmCube installation finished..."
diff --git a/wmcube/wmcube/Makefile.OPENBSD b/wmcube/wmcube/Makefile.OPENBSD
new file mode 100644
index 000000000000..abe1d13dffc7
--- /dev/null
+++ b/wmcube/wmcube/Makefile.OPENBSD
@@ -0,0 +1,37 @@
+CC = gcc
+OS = -DOPENBSD
+
+LIBDIR = -L/usr/X11R6/lib -L./libdocapp/
+
+# Edit OSLIBS as appropriate to include OS specific libraries.
+
+OSLIBS =
+LIBS = -lXpm -lXext -lX11 -lm $(OSLIBS)
+INCLUDES = -I/usr/X11R6/include
+CFLAGS = -Wall -O2 $(OS) $(INCLUDES)
+
+OBJS = wmcube.o \
+ ../wmgeneral/wmgeneral.o \
+ ../wmgeneral/misc.o \
+ ../wmgeneral/list.o
+
+.c.o:
+ $(CC) $(CFLAGS) $(INCDIR) -c $< -o $*.o
+
+wmcube: $(OBJS)
+ $(CC) -o wmcube $^ -lXext $(LIBDIR) $(LIBS) $>
+
+all:: wmcube
+
+clean::
+ for i in $(OBJS) ; do \
+ rm -f $$i ; \
+ done
+ rm -f wmcube
+ rm -f *~
+
+install:: wmcube
+ cp -f wmcube /usr/local/bin/
+ chmod 755 /usr/local/bin/wmcube
+ chown root:root /usr/local/bin/wmcube
+ @echo "wmCube installation finished..."
diff --git a/wmcube/wmcube/Makefile.SOLARIS b/wmcube/wmcube/Makefile.SOLARIS
new file mode 100644
index 000000000000..5ebc89366664
--- /dev/null
+++ b/wmcube/wmcube/Makefile.SOLARIS
@@ -0,0 +1,38 @@
+CC = gcc
+OS = -DSOLARIS
+
+LIBDIR = -L/usr/X11R6/lib
+LIBDIR = -L/usr/openwin/lib -L/opt/sfw/lib -L/usr/local/lib -R/usr/openwin/lib -R/opt/sfw/lib -R/usr/local/lib
+INCDIR = -I/usr/openwin/include -I/opt/sfw/include -I/usr/local/include
+
+# Edit OSLIBS as appropriate to include OS specific libraries.
+
+OSLIBS = -lkstat
+LIBS = -lXpm -lXext -lX11 -lm $(OSLIBS)
+CFLAGS = -Wall -O2 $(OS)
+
+OBJS = wmcube.o \
+ ../wmgeneral/wmgeneral.o \
+ ../wmgeneral/misc.o \
+ ../wmgeneral/list.o
+
+.c.o:
+ $(CC) $(CFLAGS) $(INCDIR) -c $< -o $*.o
+
+wmcube: $(OBJS)
+ $(CC) -o wmcube $^ -lXext $(LIBDIR) $(LIBS)
+
+all:: wmcube
+
+clean::
+ for i in $(OBJS) ; do \
+ rm -f $$i ; \
+ done
+ rm -f wmcube
+ rm -f *~
+
+install:: wmcube
+ cp -f wmcube /usr/local/bin/
+ chmod 755 /usr/local/bin/wmcube
+ chown root:root /usr/local/bin/wmcube
+ @echo "wmCube installation finished..."
diff --git a/wmcube/wmcube/wmcube.c b/wmcube/wmcube/wmcube.c
new file mode 100644
index 000000000000..a586b55387a0
--- /dev/null
+++ b/wmcube/wmcube/wmcube.c
@@ -0,0 +1,1351 @@
+/*
+
+ wmcube.c
+ Version 0.98 (2000-10-20)
+
+ Robert Kling (robk...@student.luth.se)
+ http://boombox.campus.luth.se/projects.php
+
+ Contributions:
+ -n option patch by Thorsten Jens (th...@et-inf.fho-emden.de) (2000-05-12)
+ Various bugfixes and optimizations by Jakob Borg (2000-05-13)
+ Solaris Port by Dan Price (d...@rampant.org) (2000-07-16)
+ OpenBSD Port by Brian Joseph Czapiga (r...@godsey.net) (2000-07-19)
+ FreeBSD Port by Tai-hwa Liang (ava...@mmlab.cse.yzu.edu.tw) (2000-07-20)
+ NetBSD Port by Jared Smolens <jsmo...@andrew.cmu.edu> (2000-09-23)
+
+ This software is licensed through the GNU General Public Licence.
+
+ See http://www.BenSinclair.com/dockapp/ for more wm dock apps.
+
+ If you want to port wmcube to another OS the system specific code is
+ sectioned the bottom of this file. See instructions there.
+
+*/
+
+#define WMCUBE_VERSION "0.98"
+#define REV_DATE "2000-10-23"
+
+#include <stdlib.h>
+#include <stdio.h>
+#include <time.h>
+#include <string.h>
+#include <fcntl.h>
+#include <unistd.h>
+#include <ctype.h>
+#include <math.h>
+
+#include <sys/wait.h>
+#include <sys/stat.h>
+#include <sys/param.h>
+#include <sys/types.h>
+#include <sys/ioctl.h>
+#include <sys/socket.h>
+
+#include <utmp.h>
+#include <dirent.h>
+
+#include <X11/Xlib.h>
+#include <X11/xpm.h>
+#include <X11/extensions/shape.h>
+
+#ifdef FREEBSD
+#include <kvm.h>
+#endif
+
+#include "../wmgeneral/wmgeneral.h"
+#include "../wmgeneral/misc.h"
+
+#include "wmcube.xpm"
+char wmcube_mask_bits[64*64];
+int wmcube_mask_width = 64;
+int wmcube_mask_height = 64;
+
+#define CHAR_WIDTH 5
+#define CHAR_HEIGHT 7
+#define PI 3.1415926535
+
+//**** Graphics ***********************************
+
+void putpixel(int x, int y, int c);
+void line(int x1, int y1, int x2, int y2, int c);
+void hline(int x1, int x2, int y, int c);
+void triangle(int x1, int y1, int x2, int y2, int x3, int y3, int c);
+void BlitString(char *name, int x, int y);
+void BlitNum(int num, int x, int y);
+void clearscr();
+void draw();
+void startup_seq();
+
+//**** 3d specific ********************************
+
+void setupobj(char *filename) ;
+void setUpAngles();
+void rotate(int xang, int yang, int zang);
+int normal(float p1[], float p2[], float p3[]);
+int luminate(float p1[], float p2[], float p3[]);
+void sortz(int nofelements);
+
+//**** Application Management, I/O etc. ***********
+
+void print_help();
+int loadobj(char *filename);
+void mem_alloc_error(void *block);
+int scan4objects(char *dir);
+int next_object();
+void die();
+
+//**** System specific functions ******************
+
+int init_calc_cpu();
+int calc_cpu_total();
+
+//**** Global variables ***************************
+
+int xcenter, ycenter, zoff;
+double cost[361], sint[361];
+double acost[100];
+float **matrix;
+float **rmatrix;
+int **planes;
+int *plane_color;
+int *zorder;
+int *cline;
+int nofcoords, noflines, nofplanes;
+char *objects[1000];
+int nof_objects = 0;
+int show_load = 1;
+int use_nice = 1;
+int which_cpu = -1;
+int planesORlines = 1;
+char *pname;
+
+float lum_vector[3] = { 0, 0, 100 }; // Lightsource vector
+
+#ifdef FREEBSD
+static kvm_t *kd;
+static struct nlist nlst[] = { {"_cp_time"}, {0} };
+#endif
+
+int main(int argc, char **argv)
+{
+ int j, i = 0, rot_speed = 0, cpu_usage = 0, rot_step = 1;
+ long screen_speed = 10000; // microseconds between screen updates (approx.)
+ long cpu_update = 490000; // microseconds between cpu update (approx.)
+ int but_stat = -1;
+ int loop = 0;
+ XEvent Event;
+
+ char *rotdiv = {"25"};
+ char *rotstep = {"1"};
+ char *obj_filename = {""};
+ int rot;
+ int cube_color = 1;
+ int c = 0;
+ int invert_speed = 0;
+
+ pname = strrchr(argv[0], '/');
+ if (pname == NULL) pname = argv[0];
+
+ srand((unsigned)time(NULL));
+ opterr = 0;
+
+ while ((c = getopt (argc, argv, "d:nhpbir:o:c:")) != -1) {
+ switch (c)
+ {
+ case 'c':
+ which_cpu = atoi(optarg);
+ break;
+ case 'd':
+ rotstep = optarg;
+ break;
+ case 'h':
+ print_help();
+ return 1;
+ case 'i':
+ invert_speed = 1;
+ break;
+ case 'p':
+ show_load = 0;
+ break;
+ case 'b':
+ cube_color = 2;
+ break;
+ case 'r':
+ rotdiv = optarg;
+ break;
+ case 'o':
+ obj_filename = optarg;
+ break;
+ case 'n':
+ use_nice = 0;
+ break;
+ case '?':
+ print_help();
+ return 1;
+ default:
+ abort();
+ }
+ }
+
+ /*
+ * Validate that wmcube can run on this system given the parameters,
+ * then setup the statistics gathering subsystem.
+ */
+
+ if (init_calc_cpu() != 0) die();
+
+ /*
+ * Scan directory for .wmc files and choose one randomly. If the user
+ * specified a particular file, load that one.
+ */
+
+#ifndef SOLARIS // scan4objects doesnt work on Solaris, load object immediatly
+ scan4objects(obj_filename);
+
+ if (nof_objects != 0)
+ next_object();
+ else
+#endif
+ setupobj(obj_filename);
+
+ /*
+ * Various initializion stuff for the 3d-engine etc.
+ */
+
+ setUpAngles();
+
+ rot = atoi(rotdiv);
+ if ((rot >= 1) && (rot <=100)) ; else rot = 25;
+
+ rot_step = atoi(rotstep);
+ if (rot_step < 0) rot_step = -rot_step;
+
+ if (calc_cpu_total() == -1) die();
+
+ cpu_update /= screen_speed;
+
+ createXBMfromXPM(wmcube_mask_bits, wmcube_xpm, wmcube_mask_width, wmcube_mask_height);
+ openXwindow(argc, argv, wmcube_xpm, wmcube_mask_bits, wmcube_mask_width, wmcube_mask_height);
+
+ startup_seq();
+
+ if (calc_cpu_total() == -1) die();
+
+ // index, left, top, right, bottom
+ AddMouseRegion(1, 45, 45, 58, 58); // + Zoom In
+ AddMouseRegion(5, 5, 45, 20, 58); // - Zoom Out
+ AddMouseRegion(3, 21, 45, 45, 58); // Show cpu-load
+ AddMouseRegion(2, 5, 5, 55, 45); // Everywhere else (almost) to change object
+
+ /*
+ * Main loop begins here
+ */
+
+ while (1)
+ {
+ i = (i+rot_speed+rot_step) % 360;
+
+ clearscr();
+ rotate(i,i,i);
+
+ draw(cube_color);
+
+ if (show_load) {
+ BlitNum(cpu_usage,24,49);
+ BlitString("Z",38,49);
+ }
+
+ RedrawWindow();
+
+ if (loop++ == cpu_update) {
+ loop = 0;
+
+ /*
+ * call calc_cpu_total to update statistics. If some
+ * sort of bad event occurs, calc_cpu_total will return
+ * -1, and we exit.
+ */
+
+ if ((cpu_usage = calc_cpu_total()) == -1) {
+ die();
+ }
+ rot_speed = abs( invert_speed*(100 / rot) - cpu_usage / rot);
+ }
+
+ // X Events
+
+ while (XPending(display))
+ {
+ XNextEvent(display, &Event);
+ switch (Event.type)
+ {
+ case Expose:
+ RedrawWindow();
+ break;
+ case DestroyNotify:
+ XCloseDisplay(display);
+ exit(0);
+ break;
+ case ButtonPress:
+ j = CheckMouseRegion(Event.xbutton.x, Event.xbutton.y);
+ but_stat = j;
+
+ break;
+ case ButtonRelease:
+ j = CheckMouseRegion(Event.xbutton.x, Event.xbutton.y);
+
+ switch(j)
+ {
+ case 1:
+ if (zoff > 750) {
+ BlitString("ö",48,48);
+ RedrawWindow();
+ zoff -= 150;
+ }
+ break;
+
+ case 2:
+ next_object();
+ break;
+
+ case 3:
+ if (show_load == 1) show_load = 0; else show_load = 1;
+ ycenter = 15 - 2*show_load;
+ break;
+
+ case 5:
+ BlitString("ä",11,49);
+ RedrawWindow();
+ zoff += 150;
+ break;
+ }
+ }
+ break;
+ }
+ usleep(screen_speed);
+ }
+
+ /*
+ * Free up memory used by the object (dirty...)
+ */
+
+ free(matrix);
+ free(rmatrix);
+ free(cline);
+
+ return 1;
+}
+
+
+//**** Graphics ***********************************
+//*************************************************
+
+void startup_seq()
+{
+ char *tmp = malloc(32);
+ int oldzoff = 3600;
+
+ sprintf(tmp,"V%s",WMCUBE_VERSION);
+
+ RedrawWindow();
+ BlitString("WMCUBE",13,22);
+ BlitString(tmp,15,31);
+ RedrawWindow();
+ RedrawWindow();
+ usleep(3000000);
+ RedrawWindow();
+
+ zoff = 1200;
+
+ for (;zoff < oldzoff; zoff += 35)
+ {
+ rotate((zoff-1200)/8,0,0);
+ clearscr();
+ BlitString("WMCUBE",13,22);
+ BlitString(tmp,15,31);
+ draw(1);
+ RedrawWindow();
+ usleep(9000);
+ }
+
+ zoff = 3600;
+}
+
+void draw(int color)
+{
+ int i;
+
+ if (planesORlines) {
+
+ sortz(nofplanes);
+ for (i = 0; i < nofplanes; i++) {
+ if (normal(rmatrix[planes[zorder[i]][0]], rmatrix[planes[zorder[i]][1]], rmatrix[planes[zorder[i]][2]]) > 0) {
+
+ triangle(xcenter+rmatrix[planes[zorder[i]][0]][0], ycenter+rmatrix[planes[zorder[i]][0]][1],
+ xcenter+rmatrix[planes[zorder[i]][1]][0], ycenter+rmatrix[planes[zorder[i]][1]][1],
+ xcenter+rmatrix[planes[zorder[i]][2]][0], ycenter+rmatrix[planes[zorder[i]][2]][1], plane_color[zorder[i]]);
+ }
+ }
+
+ } else {
+ for (i = 0; i < noflines; i += 2)
+ line(xcenter+rmatrix[cline[i ]-1][0], ycenter+rmatrix[cline[i ]-1][1],
+ xcenter+rmatrix[cline[i+1]-1][0], ycenter+rmatrix[cline[i+1]-1][1],color);
+ }
+}
+
+void putpixel(int x, int y,int c)
+{
+ if ((x > 4) && (x < 59) && (y > 4) && (y < 59))
+ copyXPMArea(160-c,0,1,1,x,y);
+}
+
+void hline(int x1, int x2, int y, int c)
+{
+ if ((y > 4) && (y < 59)) {
+ if (x1 <= 4) x1 = 5; else if (x1 > 57) return;
+ if (x2 > 57) x2 = 57; else if (x2 <= 4) return;
+
+ copyXPMArea(105, 56+c + 9*(c/18), x2-x1, 1, x1, y);
+ }
+}
+
+void triangle(int x1, int y1, int x2, int y2, int x3, int y3, int c) // Draws a filled triangle
+{
+ int k,k2,x,x_2,i, tmp1;
+
+ int x1t, x2t;
+
+ if (y3<y2)
+ {
+ tmp1=y2;
+ y2=y3;
+ y3=tmp1;
+ tmp1=x2;
+ x2=x3;
+ x3=tmp1;
+ }
+
+ if (y2<y1)
+ {
+ tmp1=y1;
+ y1=y2;
+ y2=tmp1;
+ tmp1=x1;
+ x1=x2;
+ x2=tmp1;
+ }
+
+ if (y3<y2)
+ {
+ tmp1=y2;
+ y2=y3;
+ y3=tmp1;
+ tmp1=x2;
+ x2=x3;
+ x3=tmp1;
+ }
+
+ if (y1!=y3) k=((x1-x3) << 6) / (y1-y3);
+ else k=(x1-x3) << 6;
+
+ if (y1!=y2) k2=((x1-x2) << 6) / (y1-y2);
+ else k2=(x1-x2) << 6;
+
+ x=x1 << 6;
+ x_2=x;
+ i=y1;
+
+ if (i!=y2)
+ do
+ {
+ x+=k;
+ x_2+=k2;
+ i++;
+
+ if ((x1t = x >> 6) > (x2t = x_2 >> 6))
+ hline(x2t, x1t, i, c);
+ else
+ hline(x1t, x2t, i, c);
+ }
+ while (i!=y2);
+
+ if (i==y3) return;
+
+ if (y2!=y3) k2=((x2-x3) << 6) / (y2-y3);
+ else k2=((x2-x3) << 6);
+
+ x_2=x2 << 6;
+ i=y2;
+ do
+ {
+ x+=k;
+ x_2+=k2;
+ i++;
+
+ if ((x1t = x >> 6) > (x2t = x_2 >> 6))
+ hline(x2t, x1t, i, c);
+ else
+ hline(x1t, x2t, i, c);
+ }
+ while (i!=y3);
+}
+
+void clearscr()
+{
+ copyXPMArea(78,0,56,56,4,4);
+}
+
+// Blits a string at given co-ordinates
+void BlitString(char *name, int x, int y)
+{
+ int i;
+ int c;
+ int k;
+
+ k = x;
+
+ copyXPMArea(73,64,1,8,k-1,y);
+
+ for (i=0; name[i]; i++)
+ {
+ c = toupper(name[i]);
+ //printf("%c",c);
+
+ if (c >= 'A' && c <= 'Z')
+ { // its a letter
+ c -= 'A';
+ if ( k > -2) copyXPMArea(c * 6, 74, 6, 8, k, y);
+ k += 6;
+ } else
+ if (c >= '0' && c<= ':')
+ { // its a number or symbol
+ c -= '0';
+ if ( k > -2) copyXPMArea(c * 6, 64, 6, 8, k, y);
+ k += 6;
+ } else
+ if (c == 246) {
+ if ( k > -2) copyXPMArea(0, 84, 6, 9, k, y);
+ k += 6;
+ } else
+ if (c == 228) {
+ if ( k > -2) copyXPMArea(6, 84, 6, 9, k, y);
+ k += 6;
+ } else
+ if (c == 229) {
+ if ( k > -2) copyXPMArea(12, 84, 6, 9, k, y);
+ k += 6;
+ } else
+ { // its a blank or something else
+ if ( k > -2) copyXPMArea(73,64,6,8,k,y);
+ k += 6;
+ }
+ if (k >= 58) break;
+ }
+ copyXPMArea(73,64,1,8,k,y);
+
+}
+
+// Blits number to given coordinates.. two 0's, right justified
+
+void BlitNum(int num, int x, int y)
+{
+ char buf[1024];
+ int newx=x;
+
+ if (num > 99)
+ {
+ newx -= CHAR_WIDTH;
+ }
+
+ if (num > 999)
+ {
+ newx -= CHAR_WIDTH;
+ }
+
+ sprintf(buf, "%02i", num);
+
+ BlitString(buf, newx, y);
+}
+
+void line(int x1, int y1, int x2, int y2, int c)
+{
+ int i, deltax, deltay, numpixels,
+ d, dinc1, dinc2,
+ x, xinc1, xinc2,
+ y, yinc1, yinc2;
+
+ deltax = abs(x2 - x1);
+ deltay = abs(y2 - y1);
+ if (deltax >= deltay)
+ {
+ numpixels = deltax + 1;
+ d = (deltay << 1) - deltax;
+ dinc1 = deltay << 1;
+ dinc2 = (deltay - deltax) << 1;
+ xinc1 = 1;
+ xinc2 = 1;
+ yinc1 = 0;
+ yinc2 = 1;
+ }
+ else
+ {
+ numpixels = deltay + 1;
+ d = (deltax << 1) - deltay;
+ dinc1 = deltax << 1;
+ dinc2 = (deltax - deltay) << 1;
+ xinc1 = 0;
+ xinc2 = 1;
+ yinc1 = 1;
+ yinc2 = 1;
+ }
+ if (x1 > x2)
+ {
+ xinc1 = - xinc1;
+ xinc2 = - xinc2;
+ }
+ if (y1 > y2)
+ {
+ yinc1 = - yinc1;
+ yinc2 = - yinc2;
+ }
+ x = x1;
+ y = y1;
+ for (i=1; i<numpixels; i++)
+ {
+ putpixel(x, y, c);
+ if (d < 0)
+ {
+ d = d + dinc1;
+ x = x + xinc1;
+ y = y + yinc1;
+ }
+ else
+ {
+ d = d + dinc2;
+ x = x + xinc2;
+ y = y + yinc2;
+ }
+ }
+}
+
+
+//**** 3d specific ********************************
+//*************************************************
+
+void rotate(int xang, int yang, int zang)
+{
+ float tx, ty, tz;
+ int i;
+
+ for (i = 0; i < nofcoords; i++)
+ {
+ tx = cost[yang]*matrix[i][0]-sint[yang]*matrix[i][2];
+ tz = sint[yang]*matrix[i][0]+cost[yang]*matrix[i][2];
+ ty = cost[zang]*matrix[i][1]-sint[zang]*tx;
+
+ rmatrix[i][0] = (cost[zang]*tx+sint[zang]*matrix[i][1]);
+ rmatrix[i][1] = (sint[xang]*tz+cost[xang]*ty);
+ rmatrix[i][2] = (cost[xang]*tz-sint[xang]*ty);
+ }
+
+ if (planesORlines)
+ for (i = 0; i < nofplanes; i++)
+ if (normal(rmatrix[planes[i][0]], rmatrix[planes[i][1]], rmatrix[planes[i][2]]) > 0)
+ plane_color[i] = luminate(rmatrix[planes[i][0]], rmatrix[planes[i][1]], rmatrix[planes[i][2]]);
+
+ for (i = 0; i < nofcoords; i++) {
+ // Perspective correcting lines...
+ rmatrix[i][0] = (rmatrix[i][0] *256) / (2*rmatrix[i][2] - zoff) + xcenter;
+ rmatrix[i][1] = (rmatrix[i][1] *256) / (2*rmatrix[i][2] - zoff) + ycenter;
+ }
+}
+
+void sortz(int nofelements) { // Insertion-sort the planes in increasing z-distance
+
+ int i, j, k;
+ float key;
+ float temparr[nofelements];
+
+ for (i = 0; i < nofelements; i++)
+ {
+ zorder[i] = i;
+ temparr[i] = rmatrix[planes[i][0]][2]+rmatrix[planes[i][1]][2]+rmatrix[planes[i][2]][2];
+ }
+
+ for (j = 1; j < nofelements; j++) {
+
+ key = temparr[j];
+ k = zorder[j];
+ i = j - 1;
+
+ while ((i > -1) && (temparr[i] > key)) {
+ temparr[i+1] = temparr[i];
+ zorder[i+1] = zorder[i--];
+ }
+
+ zorder[i+1] = k;
+ temparr[i+1] = key;
+ }
+}
+
+int normal(float p1[], float p2[], float p3[])
+{
+ return ((p1[0]-p3[0])*(p2[1]-p3[1])-(p2[0]-p3[0])*(p1[1]-p3[1]));
+}
+
+int luminate(float p1[], float p2[], float p3[])
+{
+ double x1 = (float)(p1[0]-p3[0]), y1 = (float)(p1[1]-p3[1]), z1 = (float)(p1[2]-p3[2]);
+ double x2 = (float)(p2[0]-p3[0]), y2 = (float)(p2[1]-p3[1]), z2 = (float)(p2[2]-p3[2]);
+ double nx = y1*z2-y2*z1, ny =-(x1*z2-x2*z1),nz = x1*y2-y1*x2;
+
+ return (int)(53 * (acost[(int)(50 + 50*(nx*lum_vector[0]+ny*lum_vector[1]+nz*lum_vector[2])/
+ (sqrt(nx*nx+ny*ny+nz*nz)*
+ sqrt(lum_vector[0]*lum_vector[0]+lum_vector[1]*lum_vector[1]+
+ lum_vector[2]*lum_vector[2])))] / PI));
+
+ // Do I smell optimization? :-)
+}
+
+void setUpAngles()
+{
+ int i;
+ for (i = 0; i < 361; i++) {
+ cost[i] = cos((double)i*(2*PI/(double)360));
+ sint[i] = sin((double)i*(2*PI/(double)360));
+ }
+
+ for (i = 0; i < 100; i++) acost[i] = acos((double)(-50+i)/50);
+}
+
+void setupobj(char *filename)
+{
+ int i, j = 0;
+ int biggest = 0;
+ float scale = 1;
+
+ xcenter = 16;
+ ycenter = 15 - 2*show_load;
+
+ if (strcmp(filename,"") != 0)
+ loadobj(filename);
+ else
+ {
+ nofcoords = 8;
+ noflines = 24;
+ nofplanes = 12;
+ planesORlines = 1;
+
+ matrix = (float **)malloc(nofcoords*sizeof(float *)); mem_alloc_error(matrix);
+ planes = (int **)malloc(nofplanes*sizeof(int *)); mem_alloc_error(planes);
+ plane_color = (int *)malloc(nofplanes*sizeof(int)); mem_alloc_error(plane_color);
+ zorder = (int *)malloc(nofplanes*sizeof(int)); mem_alloc_error(zorder);
+
+ for (i = 0; i < nofplanes; i++) zorder[i] = i;
+
+ for (i = 0; i < nofcoords; i++) {
+ matrix[i] = (float *)malloc(3*sizeof(float));
+ mem_alloc_error(matrix[i]);
+ }
+
+ for (i = 0; i < nofplanes; i++) {
+ planes[i] = (int *)malloc(3*sizeof(int));
+ mem_alloc_error(planes[i]);
+ }
+
+ cline = (int *)malloc((noflines+1)*sizeof(int)); mem_alloc_error(cline);
+
+ matrix[0][0] = -180; matrix[0][1] = -180; matrix[0][2] = 180; // 0
+ matrix[1][0] = 180; matrix[1][1] = -180; matrix[1][2] = 180; // 1
+ matrix[2][0] = 180; matrix[2][1] = 180; matrix[2][2] = 180; // 2
+ matrix[3][0] = -180; matrix[3][1] = 180; matrix[3][2] = 180; // 3
+ matrix[4][0] = -180; matrix[4][1] = -180; matrix[4][2] = -180; // 4
+ matrix[5][0] = 180; matrix[5][1] = -180; matrix[5][2] = -180; // 5
+ matrix[6][0] = 180; matrix[6][1] = 180; matrix[6][2] = -180; // 6
+ matrix[7][0] = -180; matrix[7][1] = 180; matrix[7][2] = -180; // 7
+
+ cline[0] = 1; cline[1] = 2;
+ cline[2] = 2; cline[3] = 3;
+ cline[4] = 3; cline[5] = 4;
+ cline[6] = 4; cline[7] = 1;
+ cline[8] = 5; cline[9] = 6;
+ cline[10] = 6; cline[11] = 7;
+ cline[12] = 7; cline[13] = 8;
+ cline[14] = 8; cline[15] = 5;
+ cline[16] = 1; cline[17] = 5;
+ cline[18] = 2; cline[19] = 6;
+ cline[20] = 3; cline[21] = 7;
+ cline[22] = 4; cline[23] = 8;
+
+ planes[0][0] = 0; planes[0][1] = 1; planes[0][2] = 3;
+ planes[1][0] = 1; planes[1][1] = 2; planes[1][2] = 3;
+ planes[2][0] = 1; planes[2][1] = 5; planes[2][2] = 6;
+ planes[3][0] = 1; planes[3][1] = 6; planes[3][2] = 2;
+
+ planes[4][0] = 4; planes[4][1] = 0; planes[4][2] = 3;
+ planes[5][0] = 4; planes[5][1] = 3; planes[5][2] = 7;
+ planes[6][0] = 3; planes[6][1] = 2; planes[6][2] = 7;
+ planes[7][0] = 7; planes[7][1] = 2; planes[7][2] = 6;
+
+ planes[8][0] = 4; planes[8][1] = 1; planes[8][2] = 0;
+ planes[9][0] = 4; planes[9][1] = 5; planes[9][2] = 1;
+ planes[10][0] = 5; planes[10][1] = 4; planes[10][2] = 7;
+ planes[11][0] = 5; planes[11][1] = 7; planes[11][2] = 6;
+ }
+
+ rmatrix = (float **)realloc(rmatrix,nofcoords*sizeof(float *)); mem_alloc_error(rmatrix);
+ for (i = 0; i < nofcoords; i++) {
+ rmatrix[i] = (float *)malloc(3*sizeof(float));
+ mem_alloc_error(rmatrix[i]);
+ }
+
+ /*
+ * Find the longest discance between all coordinates relative to the origin
+ */
+
+ for (i = 0; i < nofcoords; i++) {
+ j = (int)sqrt((pow(matrix[i][0],2)+pow(matrix[i][1],2)+pow(matrix[i][2],2)));
+ if (j > biggest) biggest = j;
+ }
+
+ /*
+ * Scale every coordinate using the calculated factor
+ */
+
+ scale = 280 / (float)biggest;
+
+ for (i = 0; i < nofcoords; i++) {
+ matrix[i][0] *= scale;
+ matrix[i][1] *= scale;
+ matrix[i][2] *= scale;
+ }
+}
+
+
+
+
+//**** Application Management, I/O etc. ***********
+//*************************************************
+
+void print_help() {
+ printf("\nwmCube %s (%s)\n\n", WMCUBE_VERSION, REV_DATE);
+
+#ifndef SOLARIS
+ printf(" -o <filename or directory>: load external 3d-object(s).\n\n");
+#else
+ printf(" -o <filename>: load external 3d-object.\n\n");
+#endif
+
+ printf(" -d x: rotate x degrees/step when the cpu is idle. (default 1)\n");
+ printf(" -r x: rotate 1 degree faster every x percent of cpu-usage. (default 25)\n");
+
+#ifdef LINUX
+ printf(" -c x: which cpu (0,1,2..) to monitor. (default average over all)\n");
+ printf(" -n : exclude \"nice\" processes. (default OFF)\n");
+#endif
+
+#ifdef SOLARIS
+ printf(" -c x: which cpu (0,1,2..) to monitor. (default average over all)\n");
+#endif
+
+#ifdef FREEBSD
+ printf(" -n : exclude \"nice\" processes. (default OFF)\n");
+#endif
+
+#ifdef NETBSD
+ printf(" -n : exclude \"nice\" processes. (default OFF)\n");
+#endif
+
+ printf(" -b : draw the cube in a brighter color. (default OFF)\n");
+ printf(" -i : invert cube speed. (default OFF)\n");
+ printf(" -p : do not display cpu-load (default OFF)\n");
+ printf(" -h : display this helptext.\n\n");
+}
+
+void die()
+{
+ fprintf(stderr, "%s: exiting", pname);
+ exit (1);
+}
+
+#ifndef SOLARIS // scan4objects doesnt work on Solaris because of alphasort
+int scan4objects(char *dir)
+{
+ struct dirent **names;
+ int n;
+
+ n = scandir(dir,&names,0,alphasort);
+
+ while (n-- > 0)
+ if (strstr(names[n]->d_name,".wmc") != NULL)
+ {
+ objects[nof_objects] = (char *)malloc(strlen(dir)+strlen(names[n]->d_name)+2);
+ strcpy(objects[nof_objects],dir);
+ if (dir[strlen(dir)] != '/') strcat(objects[nof_objects],"/");
+ strcat(objects[nof_objects++],names[n]->d_name);
+ }
+
+ return nof_objects;
+}
+#endif
+
+int next_object()
+{
+ if (nof_objects == 0) return -1;
+ setupobj(objects[rand() % (nof_objects )]);
+
+ return 0;
+}
+
+
+int loadobj(char *filename) {
+
+ FILE *fp;
+ char tmp[64] = {""};
+ int i = 0, counter = 1;
+
+ //printf("\nLoading file %s...",filename); fflush(stdout);
+
+ if ((fp = fopen(filename,"rt")) == NULL) {
+ printf("\nERROR: wmCube object-file not found (%s).\n\n",filename);
+ exit(0);
+ }
+
+ fscanf(fp,"%s",tmp);
+
+ if (strcmp(tmp,"WMCUBE_COORDINATES") != 0) {
+ printf("\nError in objectfile: it must start with WMCUBE_COORDINATES\n\n");
+ fclose(fp);
+ exit(0);
+ }
+
+ fscanf(fp,"%s",tmp);
+ counter = atoi(tmp);
+
+ while ((strcmp(tmp,"WMCUBE_LINES") != 0) && (strcmp(tmp,"WMCUBE_PLANES") != 0)) {
+
+ matrix = (float **)realloc(matrix,(i+1)*sizeof(float *)); mem_alloc_error(matrix);
+ matrix[i] = (float *)malloc(3*sizeof(float)); mem_alloc_error(matrix[i]);
+ fscanf(fp,"%f %f %f",&matrix[i][0],&matrix[i][1],&matrix[i][2]);
+ //printf("\n%d: %f %f %f",atoi(tmp), matrix[i][0],matrix[i][1],matrix[i][2]);
+
+ if (atoi(tmp) != (++i)) {
+
+ printf("\nError in objectfile (WMCUBE_COORDINATES section):\n"
+ "the coordinates must be listed in order 1..n\n\n");
+ fclose(fp);
+ exit(0);
+ }
+ fscanf(fp,"%s",tmp);
+
+ if (feof(fp)) {
+ printf("\nError in objectfile: you must have a section WMCUBE_LINES or WMCUBE_PLANES\n\n");
+ fclose(fp);
+ exit(0);
+ }
+ }
+
+ nofcoords = i;
+ i = 0;
+
+ if (strcmp(tmp,"WMCUBE_LINES") == 0) {
+
+ planesORlines = 0;
+ while (1) {
+
+ cline = (int *)realloc(cline,(i+2)*sizeof(int)); mem_alloc_error(cline);
+ fscanf(fp,"%d %d",&cline[i++],&cline[i++]);
+ //printf("\n%d %d",cline[i-2],cline[i-1]);
+ if (feof(fp)) break;
+
+ if (cline[i-2] > nofcoords || cline[i-1] > nofcoords) {
+ printf("\nError in objectfile (WMCUBE_LINES section):\n"
+ "coordinates %d or/and %d doesnt exist\n\n",cline[i-2],cline[i-1]);
+ fclose(fp);
+ exit(0);
+ }
+ }
+ noflines = i-2;
+ }
+ else if (strcmp(tmp,"WMCUBE_PLANES") == 0) {
+
+ planesORlines = 1;
+ while (1) {
+ planes = (int **)realloc(planes,(i+1)*sizeof(int *)); mem_alloc_error(planes);
+ planes[i] = (int *)malloc(3*sizeof(int)); mem_alloc_error(planes[i]);
+ fscanf(fp,"%d %d %d",&planes[i][0],&planes[i][1],&planes[i][2]);
+ //printf("\n%d: %d %d %d",i,planes[i][0],planes[i][1],planes[i][2]);
+
+ planes[i][0]--; planes[i][1]--; planes[i][2]--;
+ //printf("\n%d: %d %d %d\n",i,planes[i][0],planes[i][1],planes[i][2]);
+
+ if (feof(fp)) break;
+
+ if (planes[i][0] > nofcoords || planes[i][1] > nofcoords || planes[i][2] > nofcoords) {
+ printf("\nError in objectfile (WMCUBE_PLANES section):\n"
+ "coordinates %d or/and %d or/and %d doesnt exist\n\n",planes[i][0],planes[i][1],planes[i][2]);
+ fclose(fp);
+ exit(0);
+ }
+ i++;
+ }
+ nofplanes = i;
+ plane_color = (int *)malloc(nofplanes*sizeof(int)); mem_alloc_error(plane_color);
+ zorder = (int *)malloc(nofplanes*sizeof(int)); mem_alloc_error(zorder);
+ for (i = 0; i < nofplanes; i++) zorder[i] = i;
+
+ } else {
+ printf("\nError in objectfile: you must have a section WMCUBE_LINES or WMCUBE_PLANES\n\n");
+ fclose(fp);
+ exit(0);
+ }
+
+ fclose(fp);
+ return 1;
+}
+
+void mem_alloc_error(void *block) {
+ if (block == NULL) {
+ printf("\nError allocating memory!\n\n");
+ exit(0);
+ }
+}
+
+
+/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+ * Begin System Specific Code. If you wish to port wmcube to a new platform,
+ * you'll need to implement the following operations:
+ *
+ * int init_calc_cpu();
+ * Perform feature tests to determine whether wmcube can run, and set up
+ * any files/data structures/etc. to gather statistics.
+ *
+ * int calc_cpu_total();
+ * return an integer reflecting the current CPU load
+ */
+
+#if defined LINUX
+
+/*
+ * init_calc_cpu doesn't have much to do on Linux, but it can check to see if
+ * /proc/stat is available; if the user selected to monitor a particular CPU,
+ * it can check it's existence.
+ */
+int init_calc_cpu()
+{
+ FILE *fp;
+ int i;
+ char cpuid[6];
+ char check_cpu[6];
+
+ sprintf(check_cpu, "cpu%d", which_cpu);
+
+ if ((fp = fopen("/proc/stat","rb")) == NULL) {
+ perror("/proc/stat required for this system");
+ return -1;
+ }
+
+ if (which_cpu == -1)
+ return 0;
+
+ for (i = -2; i < which_cpu; i++) {
+ fscanf(fp, "%s", cpuid);
+ }
+
+ if (strcmp(check_cpu,cpuid) != 0) {
+ fprintf(stderr, "ERROR: could not read cpu-load on %s. Are you "
+ "sure you have an SMP system?\n",check_cpu);
+ return -1;
+ }
+ return (0);
+}
+
+int calc_cpu_total() {
+ int total, used, t=0, i;
+ static int previous_total = 0, previous_used = 0;
+ char cpuid[6];
+ int cpu,nice,system,idle;
+ FILE *fp;
+
+ fp = fopen("/proc/stat","rt");
+
+ for (i = -2; i < which_cpu; i++) {
+ fscanf(fp,"%s %d %d %d %d",cpuid,&cpu,&nice,&system,&idle);
+ }
+
+ fclose(fp);
+
+ used = cpu + system + use_nice*nice;
+ total = used + idle + (1-use_nice)*nice;
+
+ t = 100 * (double)(used - previous_used) / (double)(total - previous_total);
+ previous_total = total;
+ previous_used = used;
+
+ return t;
+}
+
+#elif defined SOLARIS
+#include <sys/types.h>
+#include <sys/sysinfo.h>
+#include <kstat.h>
+
+static kstat_ctl_t *kc;
+static kstat_t **cpu_ksp_list;
+static kstat_t *the_cpu;
+static int ncpus;
+
+/*
+ * The biggest subtlety of the Solaris port is that init_calc_cpu can be called
+ * after the initial program setup. This occurs when a 'kstat state change'
+ * occurs. Usually this means that a CPU has been taken on or off-line using
+ * the psradm command. Another possibility is that on server systems, a new
+ * CPU might have been hot-added to a running system.
+ *
+ * As a result, init_calc_cpu frees any resources it might have setup if needed,
+ * and reinitializes everything.
+ */
+int init_calc_cpu()
+{
+ kstat_t *ksp;
+ int i = 0;
+
+ if (kc == NULL) {
+ if ((kc = kstat_open()) == NULL) {
+ fprintf(stderr, "wmcube: can't open /dev/kstat\n");
+ return -1;
+ }
+ }
+
+ if (which_cpu != -1) {
+ /*
+ * User selected to monitor a particlur CPU. find it...
+ */
+ for (ksp = kc->kc_chain; ksp; ksp = ksp->ks_next) {
+ if ((strcmp(ksp->ks_module, "cpu_stat") == 0) &&
+ (ksp->ks_instance == which_cpu)) {
+ the_cpu = ksp;
+ break;
+ }
+ }
+ if (the_cpu == NULL) {
+ fprintf(stderr, "CPU %d not found\n", which_cpu);
+ return -1;
+ }
+ } else {
+ /*
+ * User selected to monitor all CPUs. First, count them.
+ */
+ for (ksp = kc->kc_chain; ksp; ksp = ksp->ks_next) {
+ if (strcmp(ksp->ks_module, "cpu_stat") == 0)
+ i++;
+ }
+
+ if (cpu_ksp_list) {
+ free(cpu_ksp_list);
+ }
+ cpu_ksp_list = (kstat_t **) calloc(i * sizeof (kstat_t *), 1);
+ ncpus = i;
+
+ /*
+ * stash the ksp for each CPU.
+ */
+ i = 0;
+ for (ksp = kc->kc_chain; ksp; ksp = ksp->ks_next) {
+ if (strcmp(ksp->ks_module, "cpu_stat") == 0) {
+ cpu_ksp_list[i] = ksp;
+ i++;
+ }
+ }
+ }
+ return 0;
+}
+
+int calc_cpu_total()
+{
+ int i;
+ cpu_stat_t stat;
+ static int previous_total = 0, previous_used = 0;
+ int used, total, t, user = 0, wait = 0, kern = 0, idle = 0;
+
+ /*
+ * Read each cpu's data. If the kstat chain has changed (a state change
+ * has happened, maybe a new cpu was added to the system or one went
+ * away), then reinitialize everything with init_calc_cpu(). Finally,
+ * recursively call calc_cpu_total.
+ *
+ * We'll need to do a little better than this in the future, since we
+ * could recurse too much in the pathological case here.
+ */
+ if (which_cpu == -1) {
+ for (i = 0; i < ncpus; i++) {
+ if (kstat_read(kc, cpu_ksp_list[i],
+ (void *)&stat) == -1) {
+ if (init_calc_cpu() != 0) {
+ fprintf(stderr, "failed to "
+ "reinitialize following state "
+ "change\n");
+ return (-1);
+ }
+ return (calc_cpu_total());
+ }
+ user += stat.cpu_sysinfo.cpu[CPU_USER]; /* user */
+ wait += stat.cpu_sysinfo.cpu[CPU_WAIT]; /* io wait */
+ kern += stat.cpu_sysinfo.cpu[CPU_KERNEL]; /* sys */
+ idle += stat.cpu_sysinfo.cpu[CPU_IDLE]; /*idle("free")*/
+ }
+ } else {
+ if (kstat_read(kc, the_cpu, (void *)&stat) == -1) {
+ if (init_calc_cpu() != 0) {
+ fprintf(stderr, "failed to reinitialize "
+ "following state change\n");
+ return (-1);
+ }
+ return (calc_cpu_total());
+ }
+ user += stat.cpu_sysinfo.cpu[CPU_USER]; /* user */
+ wait += stat.cpu_sysinfo.cpu[CPU_WAIT]; /* io wait */
+ kern += stat.cpu_sysinfo.cpu[CPU_KERNEL]; /* sys */
+ idle += stat.cpu_sysinfo.cpu[CPU_IDLE]; /* idle("free") */
+ }
+
+ used = user + wait + kern;
+ total = used + idle;
+ t = 100 * (double)(used - previous_used) /
+ (double)(total - previous_total);
+ previous_total = total;
+ previous_used = used;
+ return (t);
+}
+
+#elif defined FREEBSD
+#include <nlist.h>
+#include <fcntl.h>
+#include <sys/dkstat.h>
+
+int init_calc_cpu()
+{
+
+ if ((kd = kvm_open(NULL, NULL, NULL, O_RDONLY, "kvm_open")) == NULL)
+ {
+ printf("\nError: unable to open kvm\n\n");
+ exit(0);
+ }
+ kvm_nlist(kd, nlst);
+ if (nlst[0].n_type == 0)
+ {
+ printf("\nError: unable to get nlist\n\n");
+ exit(1);
+ }
+
+ return 0;
+}
+
+int calc_cpu_total() {
+ int total, used, t=0;
+ static int previous_total = 0, previous_used = 0;
+ int cpu,nice,system,idle;
+ unsigned long int cpu_time[CPUSTATES];
+
+ if (kvm_read(kd, nlst[0].n_value, &cpu_time, sizeof(cpu_time))
+ != sizeof(cpu_time))
+ {
+ printf("\nError reading kvm\n\n");
+ exit(0);
+ }
+
+ cpu = cpu_time[CP_USER];
+ nice = cpu_time[CP_NICE];
+ system = cpu_time[CP_SYS];
+ idle = cpu_time[CP_IDLE];
+
+ used = cpu + system + use_nice*nice;
+ total = used + idle + (1-use_nice)*nice;
+
+ t = 100 * (double)(used - previous_used) / (double)(total - previous_total);
+ previous_total = total;
+ previous_used = used;
+
+ return t;
+}
+
+#elif defined OPENBSD
+
+int init_calc_cpu()
+{
+ return 0;
+}
+
+int calc_cpu_total() {
+ double avenrun[3];
+
+ (void) getloadavg(avenrun, sizeof(avenrun) / sizeof(avenrun[0]));
+ return(((5.0*avenrun[0] + 0.5) > 50) ? 50 : (5.0*avenrun[0] + 0.5))*2;
+}
+
+
+#elif defined NETBSD /* END OPENBSD */
+#include <sys/sched.h>
+#include <sys/sysctl.h>
+
+int init_calc_cpu ()
+{
+ return 0;
+}
+
+int calc_cpu_total ()
+{
+ static u_int64_t last_cp_time[CPUSTATES] = { 0, 0, 0, 0, 0 };
+ u_int64_t curr_cp_time[CPUSTATES];
+ u_int64_t total_time = 0, idle_time = 0;
+ int mib[2];
+ int i;
+ size_t ssize;
+ const int IDLE_TIME = 4;
+ const int NICE_TIME = 1;
+
+ ssize = sizeof ( curr_cp_time );
+ mib[0] = CTL_KERN;
+ mib[1] = KERN_CP_TIME;
+ if ( sysctl ( mib, 2, curr_cp_time, &ssize, NULL, 0 ) ) {
+ fprintf ( stderr, "wmcube: unable to read CP_TIME from sysctl()\n" );
+ exit ( 0 );
+ }
+ if ( !use_nice )
+ curr_cp_time[NICE_TIME] = 0;
+
+ /* NetBSD gives 5 CPUSTATES -
+ * User, Nice, System, Interrupt, Idle
+ */
+ idle_time = curr_cp_time[IDLE_TIME] - last_cp_time[IDLE_TIME];
+ for ( i = 0; i < CPUSTATES; i++ ) {
+ total_time += ( curr_cp_time[i] - last_cp_time[i] );
+ last_cp_time[i] = curr_cp_time[i];
+ }
+
+ /* Calculate the % CPU usage as the User+Nice+System+Interrupt/Total
+ * for the interval
+ */
+ return ( 100 * (int) ( total_time - idle_time ) / total_time );
+
+}
+
+#else /* END NETBSD */
+
+/*
+ * This is a stub which will compile for platforms other than LINUX or SOLARIS.
+ * Use these to start your port to a new platform.
+ */
+int init_calc_cpu()
+{
+ return 0;
+}
+
+int calc_cpu_total()
+{
+ return 0;
+}
+
+#endif /* OS SPECIFIC CODE */
diff --git a/wmcube/wmcube/wmcube.xpm b/wmcube/wmcube/wmcube.xpm
new file mode 100644
index 000000000000..f72c004ea976
--- /dev/null
+++ b/wmcube/wmcube/wmcube.xpm
@@ -0,0 +1,142 @@
+/* XPM */
+static char * wmcube_xpm[] = {
+"160 100 39 1",
+" c blue",
+". c #202020",
+"X c black",
+"o c #C7C3C7",
+"O c #20B2AE",
+"+ c #007D71",
+"@ c #B60418",
+"# c #00EB00",
+"$ c #283C38",
+"% c #F7F3FF",
+"& c #004941",
+"! c #1A8E8A",
+"A c #20AFAB",
+"B c #1FACA9",
+"C c #1EA9A5",
+"D c #1EA5A1",
+"E c #1DA19E",
+"F c #1C9C99",
+"G c #1B9894",
+"H c #1B928F",
+"I c #1A8E8A",
+"J c #198985",
+"K c #178480",
+"L c #177F7B",
+"M c #167A77",
+"N c #157672",
+"P c #14716E",
+"Q c #136C69",
+"R c #136764",
+"S c #116360",
+"T c #115E5A",
+"U c #115D5B",
+"V c #0F5956",
+"W c #0F5351",
+"Y c #0E4E4D",
+"Z c #0E4E4C",
+"1 c #0D4A48",
+"2 c #0C4644",
+"3 c #0C4240",
+" XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX O!",
+" .............oX......................................................o ",
+" .............oX......................................................o ",
+" .............oX......................................................o ",
+" XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX .............oX......................................................o ",
+" .......................................................o .............oX......................................................o ",
+" .......................................................o .............oX......................................................o..........................",
+" .......................................................o .............oX......................................................o..........................",
+" .......................................................o .............oX......................................................o..........................",
+" .......................................................o .............oX......................................................o..........................",
+" .......................................................o .............oX......................................................o..........................",
+" .......................................................o .............oX......................................................o..........................",
+" .......................................................o .............oX......................................................o..........................",
+" .......................................................o .............oX......................................................o..........................",
+" .......................................................o .............oX......................................................o..........................",
+" .......................................................o .............oX......................................................o..........................",
+" .......................................................o .............oX......................................................o..........................",
+" .......................................................o .............oX......................................................o..........................",
+" .......................................................o .............oX......................................................o..........................",
+" .......................................................o .............oX......................................................o..........................",
+" .......................................................o .............oX......................................................o..........................",
+" .......................................................o .............oX......................................................o..........................",
+" .......................................................o .............oX......................................................o..........................",
+" .......................................................o .............oX......................................................o..........................",
+" .......................................................o .............oX......................................................o..........................",
+" .......................................................o .............oX......................................................o..........................",
+" .......................................................o .............oX......................................................o..........................",
+" .......................................................o .............oX......................................................o..........................",
+" .......................................................o .............oX......................................................o..........................",
+" .......................................................o .............oX......................................................o..........................",
+" .......................................................o .............oX......................................................o..........................",
+" .......................................................o .............oX......................................................o..........................",
+" .......................................................o .............oX......................................................o..........................",
+" .......................................................o .............oX......................................................o..........................",
+" .......................................................o .............oX......................................................o..........................",
+" .......................................................o .............oX......................................................o..........................",
+" .......................................................o .............oX......................................................o..........................",
+" .......................................................o .............oX......................................................o..........................",
+" .......................................................o .............oX......................................................o..........................",
+" .......................................................o .............oX......................................................o..........................",
+" .......................................................o .............oX......................................................o..........................",
+" .......................................................o .............oX......................................................o..........................",
+" .......................................................o .............oX......................................................o..........................",
+" .......................................................o .............oX......................................................o..........................",
+" .......................................................o .............oX......................................................o..........................",
+" .......................................................o .............oX......................................................o..........................",
+" .......................................................o .............oX..............................................&&......o..........................",
+" .......................................................o .............oX..............................................&&......o..........................",
+" .......................................................o .............oX.....&&&&&&.................................&&&&&&....o..........................",
+" .......................................................o .............oX.....&&&&&&.................................&&&&&&....o..........................",
+" .......................................................o .............oX..............................................&&......o..........................",
+" .......................................................o .............oX..............................................&&......o..........................",
+" .......................................................o .............oX......................................................o..........................",
+" .......................................................o .............oX......................................................o..........................",
+" .......................................................o .............oX......................................................o..........................",
+" .......................................................o oooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo..........................",
+" .......................................................o . OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO",
+" .......................................................o . AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA",
+" .......................................................o . BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB",
+" oooooooooooooooooooooooooooooooooooooooooooooooooooooooo . CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC",
+" . EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE",
+" . FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF",
+" . GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGG",
+" . HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHH",
+"............................................................................... IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII",
+"..OOO.....+..+OOO+.+OOO+.+...+.+OOO+.+OOO+.+OOO+.+OOO+.+OOO+................... JJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJ",
+".O...O....O......O.....O.O...O.O.....O.........O.O...O.O...O............O...... KKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKK",
+".O...O....O......O.....O.O...O.O.....O.........O.O...O.O...O............O...... LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLL",
+".+...+....+..+OOO+..OOO+.+OOO+.+OOO+.+OOO+.....+.&OOO&.+OOO+...........O....... MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM",
+".O...O....O..O.........O.....O.....O.O...O.....O.O...O.....O...........O....... NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNN",
+".O...O....O..O.........O.....O.....O.O...O.....O.O...O.....O...O...O..O.....O.. PPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPP",
+"..OOO.....O..+OOO+.+OOO+.....+.+OOO+.+OOO+.....+.+OOO+.+OOO+...+...+..O.....+.. QQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQ",
+"............................................................................... RRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRR",
+" SSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSS",
+"................................................................................................................................................................",
+".&OOO&.+OOO..+OOO+.+OOO..+OOO+.+OOO+.+OOO+.+...+...+.......+.+...+.+.....O...O.+OOO..+OOO+.+OOO+.+OOO+.+OOO+.+OOO+.+OOO+.+...+.+...+.+...+.+...+.+...+..........",
+".O...O.O...O.O.....O...O.O.....O.....O.....O...O...O.......O.O...O.O.....OO.OO.O...O.O...O.O...O.O...O.O...O.O.......O...O...O.O...O.O...O.O...O.O...O.O...O....",
+".O...O.O...O.O.....O...O.O.....O.....O.....O...O...O.......O.O..O..O.....O.O.O.O...O.O...O.O...O.O...O.O...O.O.......O...O...O.O...O.O...O..O.O..O...O....O.....",
+".+OOO+.+OOO..+.....+...+.+OOO..+OOO..+.OO+.+OOO+...+.......+.+OO&..+.....+...+.+...+.+...+.+OOO+.+O..+.+OOO..+OOO+...+...+...+.+...+.+...+..&O&..+OOO+...O......",
+".O...O.O...O.O.....O...O.O.....O.....O...O.O...O...O.......O.O..O..O.....O...O.O...O.O...O.O.....O.O.O.O...O.....O...O...O...O.O+.+O.O.O.O..O.O......O..O.......",
+".O...O.O...O.O.....O...O.O.....O.....O...O.O...O...O.......O.O...O.O.....O...O.O...O.O...O.O.....O..OO.O...O.....O...O...O...O..O+O..OO.OO.O...O.....O.O...O....",
+".+...+.+OOO..+OOO+.OOOO..+OOO+.O.....+OOO+.+...+...O...+OOO+.+...+.+OOO&.+...+.O...O.+OOO+.+.....+OOO+.+...+.+OOO+...+...&OOOO...O...O...O.+...O.+OOO+..........",
+"................................................................................................................................................................",
+" TTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTT",
+"...............O... UUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUU",
+"...++.............. VVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV",
+"...++........&OOO&. WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWW",
+".++++++++++++O...O. YYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYY",
+".++++++++++++O...O. ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ",
+"...++........+OOO+. 11111111111111111111111111111111111111111111111111111111",
+"...++........O...O. 22222222222222222222222222222222222222222222222222222222",
+".............+...+. 33333333333333333333333333333333333333333333333333333333",
+"................... ",
+" ",
+" ",
+" ",
+" ",
+" ",
+" ",
+" "};
diff --git a/wmcube/wmgeneral/list.c b/wmcube/wmgeneral/list.c
new file mode 100644
index 000000000000..f804b2c7abff
--- /dev/null
+++ b/wmcube/wmgeneral/list.c
@@ -0,0 +1,169 @@
+/* Generic single linked list to keep various information
+ Copyright (C) 1993, 1994 Free Software Foundation, Inc.
+
+
+Author: Kresten Krab Thorup
+
+Many modifications by Alfredo K. Kojima
+
+
+This file is part of GNU CC.
+
+GNU CC is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU CC is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU CC; see the file COPYING. If not, write to
+the Free Software Foundation, 59 Temple Place - Suite 330,
+Boston, MA 02111-1307, USA. */
+
+/* As a special exception, if you link this library with files compiled with
+ GCC to produce an executable, this does not cause the resulting executable
+ to be covered by the GNU General Public License. This exception does not
+ however invalidate any other reasons why the executable file might be
+ covered by the GNU General Public License. */
+
+#include "list.h"
+#ifdef HAVE_SYS_TYPES_H
+# include <sys/types.h>
+#endif
+#include <stdlib.h>
+
+/* Return a cons cell produced from (head . tail) */
+
+INLINE LinkedList*
+list_cons(void* head, LinkedList* tail)
+{
+ LinkedList* cell;
+
+ cell = (LinkedList*)malloc(sizeof(LinkedList));
+ cell->head = head;
+ cell->tail = tail;
+ return cell;
+}
+
+/* Return the length of a list, list_length(NULL) returns zero */
+
+INLINE int
+list_length(LinkedList* list)
+{
+ int i = 0;
+ while(list)
+ {
+ i += 1;
+ list = list->tail;
+ }
+ return i;
+}
+
+/* Return the Nth element of LIST, where N count from zero. If N
+ larger than the list length, NULL is returned */
+
+INLINE void*
+list_nth(int index, LinkedList* list)
+{
+ while(index-- != 0)
+ {
+ if(list->tail)
+ list = list->tail;
+ else
+ return 0;
+ }
+ return list->head;
+}
+
+/* Remove the element at the head by replacing it by its successor */
+
+INLINE void
+list_remove_head(LinkedList** list)
+{
+ if (!*list) return;
+ if ((*list)->tail)
+ {
+ LinkedList* tail = (*list)->tail; /* fetch next */
+ *(*list) = *tail; /* copy next to list head */
+ free(tail); /* free next */
+ }
+ else /* only one element in list */
+ {
+ free(*list);
+ (*list) = 0;
+ }
+}
+
+
+/* Remove the element with `car' set to ELEMENT */
+/*
+INLINE void
+list_remove_elem(LinkedList** list, void* elem)
+{
+ while (*list)
+ {
+ if ((*list)->head == elem)
+ list_remove_head(list);
+ *list = (*list ? (*list)->tail : NULL);
+ }
+}*/
+
+INLINE LinkedList *
+list_remove_elem(LinkedList* list, void* elem)
+{
+ LinkedList *tmp;
+
+ if (list) {
+ if (list->head == elem) {
+ tmp = list->tail;
+ free(list);
+ return tmp;
+ }
+ list->tail = list_remove_elem(list->tail, elem);
+ return list;
+ }
+ return NULL;
+}
+
+
+/* Return element that has ELEM as car */
+
+INLINE LinkedList*
+list_find(LinkedList* list, void* elem)
+{
+ while(list)
+ {
+ if (list->head == elem)
+ return list;
+ list = list->tail;
+ }
+ return NULL;
+}
+
+/* Free list (backwards recursive) */
+
+INLINE void
+list_free(LinkedList* list)
+{
+ if(list)
+ {
+ list_free(list->tail);
+ free(list);
+ }
+}
+
+/* Map FUNCTION over all elements in LIST */
+
+INLINE void
+list_mapcar(LinkedList* list, void(*function)(void*))
+{
+ while(list)
+ {
+ (*function)(list->head);
+ list = list->tail;
+ }
+}
diff --git a/wmcube/wmgeneral/list.h b/wmcube/wmgeneral/list.h
new file mode 100644
index 000000000000..af0f22c2a882
--- /dev/null
+++ b/wmcube/wmgeneral/list.h
@@ -0,0 +1,59 @@
+/* Generic single linked list to keep various information
+ Copyright (C) 1993, 1994 Free Software Foundation, Inc.
+
+Author: Kresten Krab Thorup
+
+This file is part of GNU CC.
+
+GNU CC is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU CC is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU CC; see the file COPYING. If not, write to
+the Free Software Foundation, 59 Temple Place - Suite 330,
+Boston, MA 02111-1307, USA. */
+
+/* As a special exception, if you link this library with files compiled with
+ GCC to produce an executable, this does not cause the resulting executable
+ to be covered by the GNU General Public License. This exception does not
+ however invalidate any other reasons why the executable file might be
+ covered by the GNU General Public License. */
+
+#ifndef __LIST_H_
+#define __LIST_H_
+
+#if defined(__GNUC__) && !defined(__STRICT_ANSI__)
+# define INLINE inline
+#else
+# define INLINE
+#endif
+
+typedef struct LinkedList {
+ void *head;
+ struct LinkedList *tail;
+} LinkedList;
+
+INLINE LinkedList* list_cons(void* head, LinkedList* tail);
+
+INLINE int list_length(LinkedList* list);
+
+INLINE void* list_nth(int index, LinkedList* list);
+
+INLINE void list_remove_head(LinkedList** list);
+
+INLINE LinkedList *list_remove_elem(LinkedList* list, void* elem);
+
+INLINE void list_mapcar(LinkedList* list, void(*function)(void*));
+
+INLINE LinkedList*list_find(LinkedList* list, void* elem);
+
+INLINE void list_free(LinkedList* list);
+
+#endif
diff --git a/wmcube/wmgeneral/misc.c b/wmcube/wmgeneral/misc.c
new file mode 100644
index 000000000000..34281e2c089a
--- /dev/null
+++ b/wmcube/wmgeneral/misc.c
@@ -0,0 +1,164 @@
+/* dock.c- built-in Dock module for WindowMaker
+ *
+ * WindowMaker window manager
+ *
+ * Copyright (c) 1997 Alfredo K. Kojima
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+#include <stdlib.h>
+#include <string.h>
+#include "list.h"
+#include "misc.h"
+
+/*
+ *----------------------------------------------------------------------
+ * parse_command--
+ * Divides a command line into a argv/argc pair.
+ *----------------------------------------------------------------------
+ */
+#define PRC_ALPHA 0
+#define PRC_BLANK 1
+#define PRC_ESCAPE 2
+#define PRC_DQUOTE 3
+#define PRC_EOS 4
+#define PRC_SQUOTE 5
+
+typedef struct {
+ short nstate;
+ short output;
+} DFA;
+
+
+static DFA mtable[9][6] = {
+ {{3,1},{0,0},{4,0},{1,0},{8,0},{6,0}},
+ {{1,1},{1,1},{2,0},{3,0},{5,0},{1,1}},
+ {{1,1},{1,1},{1,1},{1,1},{5,0},{1,1}},
+ {{3,1},{5,0},{4,0},{1,0},{5,0},{6,0}},
+ {{3,1},{3,1},{3,1},{3,1},{5,0},{3,1}},
+ {{-1,-1},{0,0},{0,0},{0,0},{0,0},{0,0}}, /* final state */
+ {{6,1},{6,1},{7,0},{6,1},{5,0},{3,0}},
+ {{6,1},{6,1},{6,1},{6,1},{5,0},{6,1}},
+ {{-1,-1},{0,0},{0,0},{0,0},{0,0},{0,0}}, /* final state */
+};
+
+char*
+next_token(char *word, char **next)
+{
+ char *ptr;
+ char *ret, *t;
+ int state, ctype;
+
+ t = ret = malloc(strlen(word)+1);
+ ptr = word;
+
+ state = 0;
+ *t = 0;
+ while (1) {
+ if (*ptr==0)
+ ctype = PRC_EOS;
+ else if (*ptr=='\\')
+ ctype = PRC_ESCAPE;
+ else if (*ptr=='"')
+ ctype = PRC_DQUOTE;
+ else if (*ptr=='\'')
+ ctype = PRC_SQUOTE;
+ else if (*ptr==' ' || *ptr=='\t')
+ ctype = PRC_BLANK;
+ else
+ ctype = PRC_ALPHA;
+
+ if (mtable[state][ctype].output) {
+ *t = *ptr; t++;
+ *t = 0;
+ }
+ state = mtable[state][ctype].nstate;
+ ptr++;
+ if (mtable[state][0].output<0) {
+ break;
+ }
+ }
+
+ if (*ret==0)
+ t = NULL;
+ else
+ t = strdup(ret);
+
+ free(ret);
+
+ if (ctype==PRC_EOS)
+ *next = NULL;
+ else
+ *next = ptr;
+
+ return t;
+}
+
+
+extern void
+parse_command(char *command, char ***argv, int *argc)
+{
+ LinkedList *list = NULL;
+ char *token, *line;
+ int count, i;
+
+ line = command;
+ do {
+ token = next_token(line, &line);
+ if (token) {
+ list = list_cons(token, list);
+ }
+ } while (token!=NULL && line!=NULL);
+
+ count = list_length(list);
+ *argv = malloc(sizeof(char*)*count);
+ i = count;
+ while (list!=NULL) {
+ (*argv)[--i] = list->head;
+ list_remove_head(&list);
+ }
+ *argc = count;
+}
+
+extern pid_t
+execCommand(char *command)
+{
+ pid_t pid;
+ char **argv;
+ int argc;
+
+ parse_command(command, &argv, &argc);
+
+ if (argv==NULL) {
+ return 0;
+ }
+
+ if ((pid=fork())==0) {
+ char **args;
+ int i;
+
+ args = malloc(sizeof(char*)*(argc+1));
+ if (!args)
+ exit(10);
+ for (i=0; i<argc; i++) {
+ args[i] = argv[i];
+ }
+ args[argc] = NULL;
+ execvp(argv[0], args);
+ exit(10);
+ }
+ return pid;
+}
diff --git a/wmcube/wmgeneral/misc.h b/wmcube/wmgeneral/misc.h
new file mode 100644
index 000000000000..602e1b76f6e7
--- /dev/null
+++ b/wmcube/wmgeneral/misc.h
@@ -0,0 +1,9 @@
+#ifndef __MISC_H
+#define __MISC_H
+
+#include <unistd.h>
+
+extern void parse_command(char *, char ***, int *);
+
+extern pid_t execCommand(char *);
+#endif /* __MISC_H */
diff --git a/wmcube/wmgeneral/wmgeneral.c b/wmcube/wmgeneral/wmgeneral.c
new file mode 100644
index 000000000000..56b7bd69f787
--- /dev/null
+++ b/wmcube/wmgeneral/wmgeneral.c
@@ -0,0 +1,481 @@
+/*
+ Best viewed with vim5, using ts=4
+
+ wmgeneral was taken from wmppp.
+
+ It has a lot of routines which most of the wm* programs use.
+
+ ------------------------------------------------------------
+
+ Author: Martijn Pieterse (piet...@xs4all.nl)
+
+ ---
+ CHANGES:
+ ---
+ 14/09/1998 (Dave Clark, cla...@skyia.com)
+ * Updated createXBMfromXPM routine
+ * Now supports >256 colors
+ 11/09/1998 (Martijn Pieterse, piet...@xs4all.nl)
+ * Removed a bug from parse_rcfile. You could
+ not use "start" in a command if a label was
+ also start.
+ * Changed the needed geometry string.
+ We don't use window size, and don't support
+ negative positions.
+ 03/09/1998 (Martijn Pieterse, piet...@xs4all.nl)
+ * Added parse_rcfile2
+ 02/09/1998 (Martijn Pieterse, piet...@xs4all.nl)
+ * Added -geometry support (untested)
+ 28/08/1998 (Martijn Pieterse, piet...@xs4all.nl)
+ * Added createXBMfromXPM routine
+ * Saves a lot of work with changing xpm's.
+ 02/05/1998 (Martijn Pieterse, piet...@xs4all.nl)
+ * changed the read_rc_file to parse_rcfile, as suggested by Marcelo E. Magallon
+ * debugged the parse_rc file.
+ 30/04/1998 (Martijn Pieterse, piet...@xs4all.nl)
+ * Ripped similar code from all the wm* programs,
+ and put them in a single file.
+
+*/
+
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+#include <unistd.h>
+#include <ctype.h>
+#include <stdarg.h>
+
+#include <X11/Xlib.h>
+#include <X11/xpm.h>
+#include <X11/extensions/shape.h>
+
+#include "wmgeneral.h"
+
+ /*****************/
+ /* X11 Variables */
+/*****************/
+
+Window Root;
+int screen;
+int x_fd;
+int d_depth;
+XSizeHints mysizehints;
+XWMHints mywmhints;
+Pixel back_pix, fore_pix;
+char *Geometry = "";
+Window iconwin, win;
+GC NormalGC;
+XpmIcon wmgen;
+Pixmap pixmask;
+
+ /*****************/
+ /* Mouse Regions */
+/*****************/
+
+typedef struct {
+ int enable;
+ int top;
+ int bottom;
+ int left;
+ int right;
+} MOUSE_REGION;
+
+MOUSE_REGION mouse_region[MAX_MOUSE_REGION];
+
+ /***********************/
+ /* Function Prototypes */
+/***********************/
+
+static void GetXPM(XpmIcon *, char **);
+static Pixel GetColor(char *);
+void RedrawWindow(void);
+void AddMouseRegion(int, int, int, int, int);
+int CheckMouseRegion(int, int);
+
+/*******************************************************************************\
+|* parse_rcfile *|
+\*******************************************************************************/
+
+void parse_rcfile(const char *filename, rckeys *keys) {
+
+ char *p,*q;
+ char temp[128];
+ char *tokens = " :\t\n";
+ FILE *fp;
+ int i,key;
+
+ fp = fopen(filename, "r");
+ if (fp) {
+ while (fgets(temp, 128, fp)) {
+ key = 0;
+ q = strdup(temp);
+ q = strtok(q, tokens);
+ while (key >= 0 && keys[key].label) {
+ if ((!strcmp(q, keys[key].label))) {
+ p = strstr(temp, keys[key].label);
+ p += strlen(keys[key].label);
+ p += strspn(p, tokens);
+ if ((i = strcspn(p, "#\n"))) p[i] = 0;
+ free(*keys[key].var);
+ *keys[key].var = strdup(p);
+ key = -1;
+ } else key++;
+ }
+ free(q);
+ }
+ fclose(fp);
+ }
+}
+
+/*******************************************************************************\
+|* parse_rcfile2 *|
+\*******************************************************************************/
+
+void parse_rcfile2(const char *filename, rckeys2 *keys) {
+
+ char *p;
+ char temp[128];
+ char *tokens = " :\t\n";
+ FILE *fp;
+ int i,key;
+ char *family = NULL;
+
+ fp = fopen(filename, "r");
+ if (fp) {
+ while (fgets(temp, 128, fp)) {
+ key = 0;
+ while (key >= 0 && keys[key].label) {
+ if ((p = strstr(temp, keys[key].label))) {
+ p += strlen(keys[key].label);
+ p += strspn(p, tokens);
+ if ((i = strcspn(p, "#\n"))) p[i] = 0;
+ free(*keys[key].var);
+ *keys[key].var = strdup(p);
+ key = -1;
+ } else key++;
+ }
+ }
+ fclose(fp);
+ }
+ free(family);
+}
+
+
+/*******************************************************************************\
+|* GetXPM *|
+\*******************************************************************************/
+
+static void GetXPM(XpmIcon *wmgen, char *pixmap_bytes[]) {
+
+ XWindowAttributes attributes;
+ int err;
+
+ /* For the colormap */
+ XGetWindowAttributes(display, Root, &attributes);
+
+ wmgen->attributes.valuemask |= (XpmReturnPixels | XpmReturnExtensions);
+
+ err = XpmCreatePixmapFromData(display, Root, pixmap_bytes, &(wmgen->pixmap),
+ &(wmgen->mask), &(wmgen->attributes));
+
+ if (err != XpmSuccess) {
+ fprintf(stderr, "Not enough free colorcells.\n");
+ exit(1);
+ }
+}
+
+/*******************************************************************************\
+|* GetColor *|
+\*******************************************************************************/
+
+static Pixel GetColor(char *name) {
+
+ XColor color;
+ XWindowAttributes attributes;
+
+ XGetWindowAttributes(display, Root, &attributes);
+
+ color.pixel = 0;
+ if (!XParseColor(display, attributes.colormap, name, &color)) {
+ fprintf(stderr, "wm.app: can't parse %s.\n", name);
+ } else if (!XAllocColor(display, attributes.colormap, &color)) {
+ fprintf(stderr, "wm.app: can't allocate %s.\n", name);
+ }
+ return color.pixel;
+}
+
+/*******************************************************************************\
+|* flush_expose *|
+\*******************************************************************************/
+
+static int flush_expose(Window w) {
+
+ XEvent dummy;
+ int i=0;
+
+ while (XCheckTypedWindowEvent(display, w, Expose, &dummy))
+ i++;
+
+ return i;
+}
+
+/*******************************************************************************\
+|* RedrawWindow *|
+\*******************************************************************************/
+
+void RedrawWindow(void) {
+
+ flush_expose(iconwin);
+ XCopyArea(display, wmgen.pixmap, iconwin, NormalGC,
+ 0,0, wmgen.attributes.width, wmgen.attributes.height, 0,0);
+ flush_expose(win);
+ XCopyArea(display, wmgen.pixmap, win, NormalGC,
+ 0,0, wmgen.attributes.width, wmgen.attributes.height, 0,0);
+}
+
+/*******************************************************************************\
+|* RedrawWindowXY *|
+\*******************************************************************************/
+
+void RedrawWindowXY(int x, int y) {
+
+ flush_expose(iconwin);
+ XCopyArea(display, wmgen.pixmap, iconwin, NormalGC,
+ x,y, wmgen.attributes.width, wmgen.attributes.height, 0,0);
+ flush_expose(win);
+ XCopyArea(display, wmgen.pixmap, win, NormalGC,
+ x,y, wmgen.attributes.width, wmgen.attributes.height, 0,0);
+}
+
+/*******************************************************************************\
+|* AddMouseRegion *|
+\*******************************************************************************/
+
+void AddMouseRegion(int index, int left, int top, int right, int bottom) {
+
+ if (index < MAX_MOUSE_REGION) {
+ mouse_region[index].enable = 1;
+ mouse_region[index].top = top;
+ mouse_region[index].left = left;
+ mouse_region[index].bottom = bottom;
+ mouse_region[index].right = right;
+ }
+}
+
+/*******************************************************************************\
+|* CheckMouseRegion *|
+\*******************************************************************************/
+
+int CheckMouseRegion(int x, int y) {
+
+ int i;
+ int found;
+
+ found = 0;
+
+ for (i=0; i<MAX_MOUSE_REGION && !found; i++) {
+ if (mouse_region[i].enable &&
+ x <= mouse_region[i].right &&
+ x >= mouse_region[i].left &&
+ y <= mouse_region[i].bottom &&
+ y >= mouse_region[i].top)
+ found = 1;
+ }
+ if (!found) return -1;
+ return (i-1);
+}
+
+/*******************************************************************************\
+|* createXBMfromXPM *|
+\*******************************************************************************/
+void createXBMfromXPM(char *xbm, char **xpm, int sx, int sy) {
+
+ int i,j,k;
+ int width, height, numcol, depth;
+ int zero=0;
+ unsigned char bwrite;
+ int bcount;
+ int curpixel;
+
+ sscanf(*xpm, "%d %d %d %d", &width, &height, &numcol, &depth);
+
+
+ for (k=0; k!=depth; k++)
+ {
+ zero <<=8;
+ zero |= xpm[1][k];
+ }
+
+ for (i=numcol+1; i < numcol+sy+1; i++) {
+ bcount = 0;
+ bwrite = 0;
+ for (j=0; j<sx*depth; j+=depth) {
+ bwrite >>= 1;
+
+ curpixel=0;
+ for (k=0; k!=depth; k++)
+ {
+ curpixel <<=8;
+ curpixel |= xpm[i][j+k];
+ }
+
+ if ( curpixel != zero ) {
+ bwrite += 128;
+ }
+ bcount++;
+ if (bcount == 8) {
+ *xbm = bwrite;
+ xbm++;
+ bcount = 0;
+ bwrite = 0;
+ }
+ }
+ }
+}
+
+/*******************************************************************************\
+|* copyXPMArea *|
+\*******************************************************************************/
+
+void copyXPMArea(int x, int y, int sx, int sy, int dx, int dy) {
+
+ XCopyArea(display, wmgen.pixmap, wmgen.pixmap, NormalGC, x, y, sx, sy, dx, dy);
+
+}
+
+/*******************************************************************************\
+|* copyXBMArea *|
+\*******************************************************************************/
+
+void copyXBMArea(int x, int y, int sx, int sy, int dx, int dy) {
+
+ XCopyArea(display, wmgen.mask, wmgen.pixmap, NormalGC, x, y, sx, sy, dx, dy);
+}
+
+
+/*******************************************************************************\
+|* setMaskXY *|
+\*******************************************************************************/
+
+void setMaskXY(int x, int y) {
+
+ XShapeCombineMask(display, win, ShapeBounding, x, y, pixmask, ShapeSet);
+ XShapeCombineMask(display, iconwin, ShapeBounding, x, y, pixmask, ShapeSet);
+}
+
+/*******************************************************************************\
+|* openXwindow *|
+\*******************************************************************************/
+void openXwindow(int argc, char *argv[], char *pixmap_bytes[], char *pixmask_bits, int pixmask_width, int pixmask_height) {
+
+ unsigned int borderwidth = 1;
+ XClassHint classHint;
+ char *display_name = NULL;
+ char *wname = argv[0];
+ XTextProperty name;
+
+ XGCValues gcv;
+ unsigned long gcm;
+
+ char *geometry = NULL;
+
+ int dummy=0;
+ int i, wx, wy;
+
+ for (i=1; argv[i]; i++) {
+ if (!strcmp(argv[i], "-display")) {
+ display_name = argv[i+1];
+ i++;
+ }
+ if (!strcmp(argv[i], "-geometry")) {
+ geometry = argv[i+1];
+ i++;
+ }
+ }
+
+ if (!(display = XOpenDisplay(display_name))) {
+ fprintf(stderr, "%s: can't open display %s\n",
+ wname, XDisplayName(display_name));
+ exit(1);
+ }
+ screen = DefaultScreen(display);
+ Root = RootWindow(display, screen);
+ d_depth = DefaultDepth(display, screen);
+ x_fd = XConnectionNumber(display);
+
+ /* Convert XPM to XImage */
+ GetXPM(&wmgen, pixmap_bytes);
+
+ /* Create a window to hold the stuff */
+ mysizehints.flags = USSize | USPosition;
+ mysizehints.x = 0;
+ mysizehints.y = 0;
+
+ back_pix = GetColor("white");
+ fore_pix = GetColor("black");
+
+ XWMGeometry(display, screen, Geometry, NULL, borderwidth, &mysizehints,
+ &mysizehints.x, &mysizehints.y,&mysizehints.width,&mysizehints.height, &dummy);
+
+ mysizehints.width = 64;
+ mysizehints.height = 64;
+
+ win = XCreateSimpleWindow(display, Root, mysizehints.x, mysizehints.y,
+ mysizehints.width, mysizehints.height, borderwidth, fore_pix, back_pix);
+
+ iconwin = XCreateSimpleWindow(display, win, mysizehints.x, mysizehints.y,
+ mysizehints.width, mysizehints.height, borderwidth, fore_pix, back_pix);
+
+ /* Activate hints */
+ XSetWMNormalHints(display, win, &mysizehints);
+ classHint.res_name = wname;
+ classHint.res_class = wname;
+ XSetClassHint(display, win, &classHint);
+
+ XSelectInput(display, win, ButtonPressMask | ExposureMask | ButtonReleaseMask | PointerMotionMask | StructureNotifyMask);
+ XSelectInput(display, iconwin, ButtonPressMask | ExposureMask | ButtonReleaseMask | PointerMotionMask | StructureNotifyMask);
+
+ if (XStringListToTextProperty(&wname, 1, &name) == 0) {
+ fprintf(stderr, "%s: can't allocate window name\n", wname);
+ exit(1);
+ }
+
+ XSetWMName(display, win, &name);
+
+ /* Create GC for drawing */
+
+ gcm = GCForeground | GCBackground | GCGraphicsExposures;
+ gcv.foreground = fore_pix;
+ gcv.background = back_pix;
+ gcv.graphics_exposures = 0;
+ NormalGC = XCreateGC(display, Root, gcm, &gcv);
+
+ /* ONLYSHAPE ON */
+
+ pixmask = XCreateBitmapFromData(display, win, pixmask_bits, pixmask_width, pixmask_height);
+
+ XShapeCombineMask(display, win, ShapeBounding, 0, 0, pixmask, ShapeSet);
+ XShapeCombineMask(display, iconwin, ShapeBounding, 0, 0, pixmask, ShapeSet);
+
+ /* ONLYSHAPE OFF */
+
+ mywmhints.initial_state = WithdrawnState;
+ mywmhints.icon_window = iconwin;
+ mywmhints.icon_x = mysizehints.x;
+ mywmhints.icon_y = mysizehints.y;
+ mywmhints.window_group = win;
+ mywmhints.flags = StateHint | IconWindowHint | IconPositionHint | WindowGroupHint;
+
+ XSetWMHints(display, win, &mywmhints);
+
+ XSetCommand(display, win, argv, argc);
+ XMapWindow(display, win);
+
+ if (geometry) {
+ if (sscanf(geometry, "+%d+%d", &wx, &wy) != 2) {
+ fprintf(stderr, "Bad geometry string.\n");
+ exit(1);
+ }
+ XMoveWindow(display, win, wx, wy);
+ }
+}
diff --git a/wmcube/wmgeneral/wmgeneral.h b/wmcube/wmgeneral/wmgeneral.h
new file mode 100644
index 000000000000..e9d6ca646d2c
--- /dev/null
+++ b/wmcube/wmgeneral/wmgeneral.h
@@ -0,0 +1,59 @@
+#ifndef WMGENERAL_H_INCLUDED
+#define WMGENERAL_H_INCLUDED
+
+ /***********/
+ /* Defines */
+/***********/
+
+#define MAX_MOUSE_REGION (16)
+
+ /************/
+ /* Typedefs */
+/************/
+
+typedef struct _rckeys rckeys;
+
+struct _rckeys {
+ const char *label;
+ char **var;
+};
+
+typedef struct _rckeys2 rckeys2;
+
+struct _rckeys2 {
+ const char *family;
+ const char *label;
+ char **var;
+};
+
+typedef struct {
+ Pixmap pixmap;
+ Pixmap mask;
+ XpmAttributes attributes;
+} XpmIcon;
+
+ /*******************/
+ /* Global variable */
+/*******************/
+
+Display *display;
+
+ /***********************/
+ /* Function Prototypes */
+/***********************/
+
+void AddMouseRegion(int index, int left, int top, int right, int bottom);
+int CheckMouseRegion(int x, int y);
+
+void openXwindow(int argc, char *argv[], char **, char *, int, int);
+void RedrawWindow(void);
+void RedrawWindowXY(int x, int y);
+
+void createXBMfromXPM(char *, char **, int, int);
+void copyXPMArea(int, int, int, int, int, int);
+void copyXBMArea(int, int, int, int, int, int);
+void setMaskXY(int, int);
+
+void parse_rcfile(const char *, rckeys *);
+
+#endif
--
2.26.2

Jeremy Sowden

unread,
May 16, 2020, 7:10:25 PM5/16/20
to Window Maker Dev, Doug Torrance
From: Doug Torrance <dtor...@monmouthcollege.edu>

---
wmcube/3dObjects/2planes-solid.wmc | 23 -
wmcube/3dObjects/4d.wmc | 59 -
wmcube/3dObjects/8star-small.wmc | 40 -
wmcube/3dObjects/8star.wmc | 40 -
wmcube/3dObjects/CONTRIBUTE | 51 -
wmcube/3dObjects/README | 54 -
wmcube/3dObjects/ball.wmc | 83 -
wmcube/3dObjects/celtic.wmc | 71 -
wmcube/3dObjects/cross.wmc | 63 -
wmcube/3dObjects/cross2.wmc | 51 -
wmcube/3dObjects/cross3.wmc | 95 --
wmcube/3dObjects/crystal.wmc | 108 --
wmcube/3dObjects/cube.wmc | 24 -
wmcube/3dObjects/diamond.wmc | 66 -
wmcube/3dObjects/e.wmc | 69 -
wmcube/3dObjects/e2.wmc | 160 --
wmcube/3dObjects/foo.wmc | 149 --
wmcube/3dObjects/gnustep.wmc | 110 --
wmcube/3dObjects/hyperpyramid.wmc | 54 -
wmcube/3dObjects/jeep.wmc | 157 --
wmcube/3dObjects/multicube.wmc | 83 -
wmcube/3dObjects/pyramid.wmc | 16 -
wmcube/3dObjects/shield.wmc | 197 ---
wmcube/3dObjects/spaceshuttle.wmc | 382 -----
wmcube/3dObjects/spiral.wmc | 49 -
wmcube/3dObjects/star.wmc | 95 --
wmcube/3dObjects/starcube.wmc | 69 -
wmcube/CHANGES | 22 +-
wmcube/INSTALL | 37 -
wmcube/Makefile | 58 +
wmcube/README | 124 +-
wmcube/TODO | 8 -
wmcube/WmcObject.cc | 619 ++++++++
wmcube/WmcObject.h | 96 ++
wmcube/cpumoncc/README | 70 +
wmcube/cpumoncc/base/BaseCpuMonitor.h | 112 ++
wmcube/cpumoncc/darwin/CpuMonitor.cc | 41 +
wmcube/cpumoncc/darwin/CpuMonitor.h | 39 +
wmcube/cpumoncc/darwin/Makefile | 41 +
wmcube/cpumoncc/freebsd/CpuMonitor.cc | 80 +
wmcube/cpumoncc/freebsd/CpuMonitor.h | 52 +
wmcube/cpumoncc/freebsd/Makefile | 41 +
wmcube/cpumoncc/linux/CpuMonitor.cc | 100 ++
wmcube/cpumoncc/linux/CpuMonitor.h | 45 +
wmcube/cpumoncc/linux/Makefile | 40 +
wmcube/cpumoncc/netbsd/CpuMonitor.cc | 113 ++
wmcube/cpumoncc/netbsd/CpuMonitor.h | 43 +
wmcube/cpumoncc/netbsd/Makefile | 40 +
wmcube/cpumoncc/openbsd/CpuMonitor.cc | 42 +
wmcube/cpumoncc/openbsd/CpuMonitor.h | 38 +
wmcube/cpumoncc/openbsd/Makefile | 40 +
wmcube/cpumoncc/programs/Makefile | 14 +
wmcube/cpumoncc/programs/README | 17 +
wmcube/cpumoncc/programs/cpu.cc | 56 +
wmcube/cpumoncc/programs/cpuload.cc | 60 +
wmcube/cpumoncc/solaris/CpuMonitor.cc | 141 ++
wmcube/cpumoncc/solaris/CpuMonitor.h | 53 +
wmcube/cpumoncc/solaris/Makefile | 40 +
wmcube/{ => wmapp}/COPYING | 11 +-
wmcube/wmapp/Changelog | 82 +
wmcube/wmapp/Changelog.Jason | 154 ++
wmcube/wmapp/FAQ.txt | 278 ++++
wmcube/wmapp/Makefile | 35 +
wmcube/wmapp/README | 66 +
wmcube/wmapp/Widgets.txt | 49 +
wmcube/wmapp/colors.h | 54 +
wmcube/wmapp/example1/Makefile | 13 +
wmcube/wmapp/example1/debian-tiny.xpm | 50 +
wmcube/wmapp/example1/window0.cc | 204 +++
wmcube/wmapp/example1/window1.cc | 86 ++
wmcube/wmapp/example1/wmexample.cc | 39 +
wmcube/wmapp/example2/Makefile | 13 +
wmcube/wmapp/example2/wmairtrafficcontrol.cc | 80 +
wmcube/wmapp/example2/wmradar.cc | 220 +++
wmcube/wmapp/example2/wmradar.h | 44 +
wmcube/wmapp/wmapp.cc | 378 +++++
wmcube/wmapp/wmapp.h | 170 +++
wmcube/wmapp/wmbutton.cc | 59 +
wmcube/wmapp/wmbutton.h | 18 +
wmcube/wmapp/wmcallback.cc | 34 +
wmcube/wmapp/wmcallback.h | 113 ++
wmcube/wmapp/wmcanvas.cc | 160 ++
wmcube/wmapp/wmcanvas.h | 68 +
wmcube/wmapp/wmclickable.h | 21 +
wmcube/wmapp/wmellipse.cc | 58 +
wmcube/wmapp/wmellipse.h | 21 +
wmcube/wmapp/wmframe.cc | 303 ++++
wmcube/wmapp/wmframe.h | 109 ++
wmcube/wmapp/wmhistory.cc | 67 +
wmcube/wmapp/wmhistory.h | 71 +
wmcube/wmapp/wmimage.cc | 91 ++
wmcube/wmapp/wmimage.h | 52 +
wmcube/wmapp/wmled.cc | 12 +
wmcube/wmapp/wmled.h | 34 +
wmcube/wmapp/wmmeter.h | 57 +
wmcube/wmapp/wmmeterbar.cc | 80 +
wmcube/wmapp/wmmeterbar.h | 47 +
wmcube/wmapp/wmslider.cc | 42 +
wmcube/wmapp/wmslider.h | 32 +
wmcube/wmapp/wmtextbar.cc | 63 +
wmcube/wmapp/wmtextbar.h | 57 +
wmcube/wmapp/wmwidget.cc | 99 ++
wmcube/wmapp/wmwidget.h | 367 +++++
wmcube/wmapp/wmwindow.cc | 114 ++
wmcube/wmapp/wmwindow.h | 130 ++
wmcube/wmapp/xpm/charmap-large.xpm | 74 +
wmcube/wmapp/xpm/charmap-medium.xpm | 62 +
wmcube/wmapp/xpm/charmap-small.xpm | 62 +
wmcube/wmapp/xpm/checkbox.xpm | 14 +
wmcube/wmapp/xpm/emptybar.xpm | 62 +
wmcube/wmapp/xpm/fullbar.xpm | 62 +
wmcube/wmapp/xpm/leds.xpm | 14 +
wmcube/wmapp/xpm/tile.xpm | 121 ++
wmcube/wmapp/xpm/xbutton.xpm | 14 +
wmcube/wmapp/xwrapper.cc | 329 ++++
wmcube/wmapp/xwrapper.h | 140 ++
.../ball-solid.wmc => wmc/ball.wmc} | 53 +
wmcube/wmc/cossin.wmc | 362 +++++
wmcube/wmc/coussin.bande.diag.wmc | 124 ++
wmcube/{3dObjects => wmc}/cross2-solid.wmc | 0
wmcube/{3dObjects => wmc}/cross3-solid.wmc | 0
.../cube-solid.wmc => wmc/cube.wmc} | 16 +
wmcube/wmc/diamond.wmc | 107 ++
.../dice-solid.wmc => wmc/dice.wmc} | 45 +
wmcube/wmc/hyp_par.wmc | 70 +
wmcube/wmc/judaspriest.wmc | 239 +++
wmcube/{3dObjects => wmc}/peace.wmc | 2 +
wmcube/{3dObjects => wmc}/radioactive.wmc | 2 +
.../cross4-solid.wmc => wmc/star-solid.wmc} | 48 +-
wmcube/{3dObjects => wmc}/wmlogo.wmc | 2 +
wmcube/wmcube.cc | 695 +++++++++
wmcube/wmcube.h | 118 ++
wmcube/wmcube/Makefile | 39 -
wmcube/wmcube/Makefile.FREEBSD | 38 -
wmcube/wmcube/Makefile.LINUX | 39 -
wmcube/wmcube/Makefile.NETBSD | 36 -
wmcube/wmcube/Makefile.OPENBSD | 37 -
wmcube/wmcube/Makefile.SOLARIS | 38 -
wmcube/wmcube/wmcube.c | 1351 -----------------
wmcube/wmcube/wmcube.xpm | 142 --
wmcube/wmgeneral/list.c | 169 ---
wmcube/wmgeneral/list.h | 59 -
wmcube/wmgeneral/misc.c | 164 --
wmcube/wmgeneral/misc.h | 9 -
wmcube/wmgeneral/wmgeneral.c | 481 ------
wmcube/wmgeneral/wmgeneral.h | 59 -
146 files changed, 9448 insertions(+), 5195 deletions(-)
delete mode 100644 wmcube/3dObjects/2planes-solid.wmc
delete mode 100644 wmcube/3dObjects/4d.wmc
delete mode 100644 wmcube/3dObjects/8star-small.wmc
delete mode 100644 wmcube/3dObjects/8star.wmc
delete mode 100644 wmcube/3dObjects/CONTRIBUTE
delete mode 100644 wmcube/3dObjects/README
delete mode 100644 wmcube/3dObjects/ball.wmc
delete mode 100644 wmcube/3dObjects/celtic.wmc
delete mode 100644 wmcube/3dObjects/cross.wmc
delete mode 100644 wmcube/3dObjects/cross2.wmc
delete mode 100644 wmcube/3dObjects/cross3.wmc
delete mode 100644 wmcube/3dObjects/crystal.wmc
delete mode 100644 wmcube/3dObjects/cube.wmc
delete mode 100644 wmcube/3dObjects/diamond.wmc
delete mode 100644 wmcube/3dObjects/e.wmc
delete mode 100644 wmcube/3dObjects/e2.wmc
delete mode 100644 wmcube/3dObjects/foo.wmc
delete mode 100644 wmcube/3dObjects/gnustep.wmc
delete mode 100644 wmcube/3dObjects/hyperpyramid.wmc
delete mode 100644 wmcube/3dObjects/jeep.wmc
delete mode 100644 wmcube/3dObjects/multicube.wmc
delete mode 100644 wmcube/3dObjects/pyramid.wmc
delete mode 100644 wmcube/3dObjects/shield.wmc
delete mode 100644 wmcube/3dObjects/spaceshuttle.wmc
delete mode 100644 wmcube/3dObjects/spiral.wmc
delete mode 100644 wmcube/3dObjects/star.wmc
delete mode 100644 wmcube/3dObjects/starcube.wmc
delete mode 100644 wmcube/INSTALL
create mode 100644 wmcube/Makefile
delete mode 100644 wmcube/TODO
create mode 100644 wmcube/WmcObject.cc
create mode 100644 wmcube/WmcObject.h
create mode 100644 wmcube/cpumoncc/README
create mode 100644 wmcube/cpumoncc/base/BaseCpuMonitor.h
create mode 100644 wmcube/cpumoncc/darwin/CpuMonitor.cc
create mode 100644 wmcube/cpumoncc/darwin/CpuMonitor.h
create mode 100644 wmcube/cpumoncc/darwin/Makefile
create mode 100644 wmcube/cpumoncc/freebsd/CpuMonitor.cc
create mode 100644 wmcube/cpumoncc/freebsd/CpuMonitor.h
create mode 100644 wmcube/cpumoncc/freebsd/Makefile
create mode 100644 wmcube/cpumoncc/linux/CpuMonitor.cc
create mode 100644 wmcube/cpumoncc/linux/CpuMonitor.h
create mode 100644 wmcube/cpumoncc/linux/Makefile
create mode 100644 wmcube/cpumoncc/netbsd/CpuMonitor.cc
create mode 100644 wmcube/cpumoncc/netbsd/CpuMonitor.h
create mode 100644 wmcube/cpumoncc/netbsd/Makefile
create mode 100644 wmcube/cpumoncc/openbsd/CpuMonitor.cc
create mode 100644 wmcube/cpumoncc/openbsd/CpuMonitor.h
create mode 100644 wmcube/cpumoncc/openbsd/Makefile
create mode 100644 wmcube/cpumoncc/programs/Makefile
create mode 100644 wmcube/cpumoncc/programs/README
create mode 100644 wmcube/cpumoncc/programs/cpu.cc
create mode 100644 wmcube/cpumoncc/programs/cpuload.cc
create mode 100644 wmcube/cpumoncc/solaris/CpuMonitor.cc
create mode 100644 wmcube/cpumoncc/solaris/CpuMonitor.h
create mode 100644 wmcube/cpumoncc/solaris/Makefile
rename wmcube/{ => wmapp}/COPYING (98%)
create mode 100644 wmcube/wmapp/Changelog
create mode 100644 wmcube/wmapp/Changelog.Jason
create mode 100644 wmcube/wmapp/FAQ.txt
create mode 100644 wmcube/wmapp/Makefile
create mode 100644 wmcube/wmapp/README
create mode 100644 wmcube/wmapp/Widgets.txt
create mode 100644 wmcube/wmapp/colors.h
create mode 100644 wmcube/wmapp/example1/Makefile
create mode 100644 wmcube/wmapp/example1/debian-tiny.xpm
create mode 100644 wmcube/wmapp/example1/window0.cc
create mode 100644 wmcube/wmapp/example1/window1.cc
create mode 100644 wmcube/wmapp/example1/wmexample.cc
create mode 100644 wmcube/wmapp/example2/Makefile
create mode 100644 wmcube/wmapp/example2/wmairtrafficcontrol.cc
create mode 100644 wmcube/wmapp/example2/wmradar.cc
create mode 100644 wmcube/wmapp/example2/wmradar.h
create mode 100644 wmcube/wmapp/wmapp.cc
create mode 100644 wmcube/wmapp/wmapp.h
create mode 100644 wmcube/wmapp/wmbutton.cc
create mode 100644 wmcube/wmapp/wmbutton.h
create mode 100644 wmcube/wmapp/wmcallback.cc
create mode 100644 wmcube/wmapp/wmcallback.h
create mode 100644 wmcube/wmapp/wmcanvas.cc
create mode 100644 wmcube/wmapp/wmcanvas.h
create mode 100644 wmcube/wmapp/wmclickable.h
create mode 100644 wmcube/wmapp/wmellipse.cc
create mode 100644 wmcube/wmapp/wmellipse.h
create mode 100644 wmcube/wmapp/wmframe.cc
create mode 100644 wmcube/wmapp/wmframe.h
create mode 100644 wmcube/wmapp/wmhistory.cc
create mode 100644 wmcube/wmapp/wmhistory.h
create mode 100644 wmcube/wmapp/wmimage.cc
create mode 100644 wmcube/wmapp/wmimage.h
create mode 100644 wmcube/wmapp/wmled.cc
create mode 100644 wmcube/wmapp/wmled.h
create mode 100644 wmcube/wmapp/wmmeter.h
create mode 100644 wmcube/wmapp/wmmeterbar.cc
create mode 100644 wmcube/wmapp/wmmeterbar.h
create mode 100644 wmcube/wmapp/wmslider.cc
create mode 100644 wmcube/wmapp/wmslider.h
create mode 100644 wmcube/wmapp/wmtextbar.cc
create mode 100644 wmcube/wmapp/wmtextbar.h
create mode 100644 wmcube/wmapp/wmwidget.cc
create mode 100644 wmcube/wmapp/wmwidget.h
create mode 100644 wmcube/wmapp/wmwindow.cc
create mode 100644 wmcube/wmapp/wmwindow.h
create mode 100644 wmcube/wmapp/xpm/charmap-large.xpm
create mode 100644 wmcube/wmapp/xpm/charmap-medium.xpm
create mode 100644 wmcube/wmapp/xpm/charmap-small.xpm
create mode 100644 wmcube/wmapp/xpm/checkbox.xpm
create mode 100644 wmcube/wmapp/xpm/emptybar.xpm
create mode 100644 wmcube/wmapp/xpm/fullbar.xpm
create mode 100644 wmcube/wmapp/xpm/leds.xpm
create mode 100644 wmcube/wmapp/xpm/tile.xpm
create mode 100644 wmcube/wmapp/xpm/xbutton.xpm
create mode 100644 wmcube/wmapp/xwrapper.cc
create mode 100644 wmcube/wmapp/xwrapper.h
rename wmcube/{3dObjects/ball-solid.wmc => wmc/ball.wmc} (77%)
create mode 100755 wmcube/wmc/cossin.wmc
create mode 100755 wmcube/wmc/coussin.bande.diag.wmc
rename wmcube/{3dObjects => wmc}/cross2-solid.wmc (100%)
rename wmcube/{3dObjects => wmc}/cross3-solid.wmc (100%)
rename wmcube/{3dObjects/cube-solid.wmc => wmc/cube.wmc} (72%)
create mode 100644 wmcube/wmc/diamond.wmc
rename wmcube/{3dObjects/dice-solid.wmc => wmc/dice.wmc} (78%)
create mode 100644 wmcube/wmc/hyp_par.wmc
create mode 100644 wmcube/wmc/judaspriest.wmc
rename wmcube/{3dObjects => wmc}/peace.wmc (98%)
rename wmcube/{3dObjects => wmc}/radioactive.wmc (98%)
rename wmcube/{3dObjects/cross4-solid.wmc => wmc/star-solid.wmc} (60%)
rename wmcube/{3dObjects => wmc}/wmlogo.wmc (92%)
create mode 100644 wmcube/wmcube.cc
create mode 100644 wmcube/wmcube.h
delete mode 100644 wmcube/wmcube/Makefile
delete mode 100644 wmcube/wmcube/Makefile.FREEBSD
delete mode 100644 wmcube/wmcube/Makefile.LINUX
delete mode 100644 wmcube/wmcube/Makefile.NETBSD
delete mode 100644 wmcube/wmcube/Makefile.OPENBSD
delete mode 100644 wmcube/wmcube/Makefile.SOLARIS
delete mode 100644 wmcube/wmcube/wmcube.c
delete mode 100644 wmcube/wmcube/wmcube.xpm
delete mode 100644 wmcube/wmgeneral/list.c
delete mode 100644 wmcube/wmgeneral/list.h
delete mode 100644 wmcube/wmgeneral/misc.c
delete mode 100644 wmcube/wmgeneral/misc.h
delete mode 100644 wmcube/wmgeneral/wmgeneral.c
delete mode 100644 wmcube/wmgeneral/wmgeneral.h

diff --git a/wmcube/3dObjects/2planes-solid.wmc b/wmcube/3dObjects/2planes-solid.wmc
deleted file mode 100644
index b884b3507c4d..000000000000
--- a/wmcube/3dObjects/2planes-solid.wmc
+++ /dev/null
@@ -1,23 +0,0 @@
-WMCUBE_COORDINATES
-1 -180 -180 180
-2 180 -180 180
-3 180 180 80
-4 -180 180 80
-5 -180 -180 -180
-6 180 -180 -180
-7 180 180 -80
-8 -180 180 -80
-
-WMCUBE_PLANES
-1 2 3
-1 3 4
-2 1 4
-2 4 3
-
-5 6 7
-5 7 8
-6 5 7
-7 5 8
-
-
-
diff --git a/wmcube/3dObjects/4d.wmc b/wmcube/3dObjects/4d.wmc
deleted file mode 100644
index 21716d190de1..000000000000
--- a/wmcube/3dObjects/4d.wmc
+++ /dev/null
@@ -1,59 +0,0 @@
-WMCUBE_COORDINATES
- 1 -51 50 0
- 2 0 50 51
- 3 51 50 0
- 4 0 50 -51
-
- 5 74 0 0
- 6 37 0 64
- 7 -37 0 64
- 8 -74 0 0
- 9 -37 0 -64
- 10 37 0 -64
-
- 11 -51 -50 0
- 12 0 -50 51
- 13 51 -50 0
- 14 0 -50 -51
-
-
- 15 0 100 0
- 16 0 -100 0
-
- WMCUBE_LINES
-
- 15 1
- 15 2
- 15 3
- 15 4
-
- 1 5
- 1 6
- 1 7
- 2 5
- 2 8
- 2 9
- 3 6
- 3 8
- 3 10
- 4 7
- 4 9
- 4 10
-
- 5 11
- 5 12
- 6 11
- 6 13
- 7 12
- 7 13
- 8 11
- 8 14
- 9 12
- 9 14
- 10 13
- 10 14
-
- 11 16
- 12 16
- 13 16
- 14 16
diff --git a/wmcube/3dObjects/8star-small.wmc b/wmcube/3dObjects/8star-small.wmc
deleted file mode 100644
index 35dddf59dc53..000000000000
--- a/wmcube/3dObjects/8star-small.wmc
+++ /dev/null
@@ -1,40 +0,0 @@
-WMCUBE_COORDINATES
- 1 -50 -50 0
- 2 50 -50 0
- 3 50 50 0
- 4 -50 50 0
- 5 0 0 71
- 6 0 0 -71
- 7 0 82 58
- 8 82 0 58
- 9 0 -82 58
- 10 -82 0 58
- 11 0 82 -58
- 12 82 0 -58
- 13 0 -82 -58
- 14 -82 0 -58
- WMCUBE_LINES
- 2 8
- 2 9
- 2 12
- 2 13
- 4 7
- 4 10
- 4 11
- 4 14
- 1 9
- 1 10
- 1 13
- 1 14
- 3 7
- 3 8
- 3 11
- 3 12
- 5 7
- 5 8
- 5 9
- 5 10
- 6 11
- 6 12
- 6 13
- 6 14
diff --git a/wmcube/3dObjects/8star.wmc b/wmcube/3dObjects/8star.wmc
deleted file mode 100644
index c04e721f79e5..000000000000
--- a/wmcube/3dObjects/8star.wmc
+++ /dev/null
@@ -1,40 +0,0 @@
-WMCUBE_COORDINATES
- 1 -10 -10 0
- 2 10 -10 0
- 3 10 10 0
- 4 -10 10 0
- 5 0 0 21
- 6 0 0 -21
- 7 0 82 58
- 8 82 0 58
- 9 0 -82 58
- 10 -82 0 58
- 11 0 82 -58
- 12 82 0 -58
- 13 0 -82 -58
- 14 -82 0 -58
- WMCUBE_LINES
- 2 8
- 2 9
- 2 12
- 2 13
- 4 7
- 4 10
- 4 11
- 4 14
- 1 9
- 1 10
- 1 13
- 1 14
- 3 7
- 3 8
- 3 11
- 3 12
- 5 7
- 5 8
- 5 9
- 5 10
- 6 11
- 6 12
- 6 13
- 6 14
diff --git a/wmcube/3dObjects/CONTRIBUTE b/wmcube/3dObjects/CONTRIBUTE
deleted file mode 100644
index 374365519908..000000000000
--- a/wmcube/3dObjects/CONTRIBUTE
+++ /dev/null
@@ -1,51 +0,0 @@
-These are the people who have contributed by making objects for wmCube:
-
-FuzzyBear <fl...@andrew.cmu.edu>
-
- - 4d.wmc
- - crystal.wmc
- - starcube.wmc
-
-Peter Kokles <kok...@bb.telecom.sk>
-
- - celtic.wmc
- - multicube.wmc
- - peace.wmc
- - radioactive.wmc
- - shield.wmc
-
-Jeff Frasca <phae...@thereactor.cleptoscastle.com>
-
- - spiral.wmc
-
-Axel Ahrens <ahr...@ewerk.de>
-
- - hyperpyramid.wmc
-
-Aaron Benner <ben...@mcn.net>
-
- - 8star.wmc
- - 8star-small.wmc
-
-Per Ã…kergren <akep...@student.luth.se>
-
- - e.wmc
- - e2.wmc
-
-Adam Hapworth <ad...@mint.net>
-
- - foo.wmc
- - jeep.wmc
-
-tarzeau <tar...@space.ch>
-
- - spaceshuttle.wmc
-
-Rafael Garcia-Suarez <garcia...@kazibao.net>
-
- - wmlogo.wmc
-
-Nicolas Mieville <n...@altern.org>
-
- - diamond.wmc
- - gnustep.wmc
diff --git a/wmcube/3dObjects/README b/wmcube/3dObjects/README
deleted file mode 100644
index a5cad7589710..000000000000
--- a/wmcube/3dObjects/README
+++ /dev/null
@@ -1,54 +0,0 @@
-The object-files to be used with wmCube has the
-following format:
-
-WMCUBE_COORDINATES
-
-1 50 -40 30
-2 -50 50 -30
-3 -20 70 -20
-^ ^ ^ ^
-| | | \__ Z-coordinate relative the center
-| | \______ Y-coordinate relative the center
-| \___________ X-coordinate relative the center
- \_______________ Coordinate index
-
-
-The indexes must be 1,2,3...n on a object with n coordinates.
-The center of the object is the coordinate the object will
-revolve around (0,0,0);
-
-The next section is either (case sensitive):
-
-* WMCUBE_LINES
-
-1 2
-2 3
-3 1
-
-These are the coordinates wmCube will draw lines
-between.
-
-or
-
-* WMCUBE_PLANES
-
-1 2 3
-2 3 1
-1 3 2
-2 1 3
-
-These are the coordinates wmCube will use as corner-
-coordinates for a plane. The tricky part is that the
-plane will be drawn only if you list the coordinates
-making up the plane in clockwise order. In the example
-above, the first two rows making up planes with coordinates
-1 2 3 and 2 3 1 will NOT be drawn until the object
-has rotated some X degrees but the other two will be
-drawn at once. Its kinda hard to explain, just try and you
-will eventually understand how it works.
-
-
-Done! Save the file with a .wmc suffix (preferably) and try
-running wmCube with the -o option and it will tell you if
-something is wrong with the object. Otherwise enjoy and
-remember to send me all the cool objects you create :-)
diff --git a/wmcube/3dObjects/ball.wmc b/wmcube/3dObjects/ball.wmc
deleted file mode 100644
index 5a0d8be8bf7a..000000000000
--- a/wmcube/3dObjects/ball.wmc
+++ /dev/null
@@ -1,83 +0,0 @@
-WMCUBE_COORDINATES
-1 -100 -100 100
-2 100 -100 100
-3 100 100 100
-4 -100 100 100
-5 -100 -100 -100
-6 100 -100 -100
-7 100 100 -100
-8 -100 100 -100
-9 -50 -150 -50
-10 50 -150 -50
-11 150 -50 -50
-12 150 50 -50
-13 50 150 -50
-14 -50 150 -50
-15 -150 50 -50
-16 -150 -50 -50
-17 -150 -50 50
-18 -50 -150 50
-19 50 -150 50
-20 150 -50 50
-21 150 50 50
-22 50 150 50
-23 -50 150 50
-24 -150 50 50
-25 -50 -50 150
-26 50 -50 150
-27 50 50 150
-28 -50 50 150
-29 -50 -50 -150
-30 50 -50 -150
-31 50 50 -150
-32 -50 50 -150
-
-WMCUBE_LINES
-9 10
-10 6
-6 11
-11 12
-12 7
-7 13
-13 14
-14 8
-8 15
-15 16
-16 5
-5 9
-17 1
-1 18
-18 19
-19 2
-2 20
-20 21
-21 3
-3 22
-22 23
-23 4
-4 24
-24 17
-9 18
-10 19
-11 20
-12 21
-13 22
-14 23
-15 24
-16 17
-25 26
-26 27
-27 28
-28 25
-25 1
-26 2
-27 3
-28 4
-29 30
-30 31
-31 32
-32 29
-5 29
-6 30
-7 31
-8 32
diff --git a/wmcube/3dObjects/celtic.wmc b/wmcube/3dObjects/celtic.wmc
deleted file mode 100644
index 5f4523247642..000000000000
--- a/wmcube/3dObjects/celtic.wmc
+++ /dev/null
@@ -1,71 +0,0 @@
-WMCUBE_COORDINATES
-1 -40 40 40
-2 -40 -40 40
-3 40 -40 40
-4 40 40 40
-5 -60 20 20
-6 -60 -20 20
-7 60 -20 20
-8 60 20 20
-9 -20 60 20
-10 -20 -60 20
-11 20 -60 20
-12 20 60 20
-13 -40 40 -40
-14 -40 -40 -40
-15 40 -40 -40
-16 40 40 -40
-17 -60 20 -20
-18 -60 -20 -20
-19 60 -20 -20
-20 60 20 -20
-21 -20 60 -20
-22 -20 -60 -20
-23 20 -60 -20
-24 20 60 -20
-25 20 20 60
-26 -20 20 60
-27 20 -20 60
-28 -20 -20 60
-29 20 20 -60
-30 -20 20 -60
-31 20 -20 -60
-32 -20 -20 -60
-
-WMCUBE_LINES
-8 18
-20 6
-5 19
-7 17
-8 20
-7 19
-5 17
-6 18
-8 7
-20 19
-5 6
-17 18
-25 26
-26 28
-28 27
-27 25
-29 30
-30 32
-32 31
-31 29
-25 32
-28 29
-26 31
-27 30
-9 23
-11 21
-10 24
-12 22
-24 12
-23 11
-9 21
-10 22
-11 10
-9 12
-23 22
-24 21
diff --git a/wmcube/3dObjects/cross.wmc b/wmcube/3dObjects/cross.wmc
deleted file mode 100644
index 72e9cf6218b2..000000000000
--- a/wmcube/3dObjects/cross.wmc
+++ /dev/null
@@ -1,63 +0,0 @@
-WMCUBE_COORDINATES
-1 -50 -50 50
-2 50 -50 50
-3 50 50 50
-4 -50 50 50
-5 -50 -50 -50
-6 50 -50 -50
-7 50 50 -50
-8 -50 50 -50
-9 -50 -150 -50
-10 50 -150 -50
-11 150 -50 -50
-12 150 50 -50
-13 50 150 -50
-14 -50 150 -50
-15 -150 50 -50
-16 -150 -50 -50
-17 -150 -50 50
-18 -50 -150 50
-19 50 -150 50
-20 150 -50 50
-21 150 50 50
-22 50 150 50
-23 -50 150 50
-24 -150 50 50
-
-WMCUBE_LINES
-1 5
-2 6
-7 3
-8 4
-9 10
-10 6
-6 11
-11 12
-12 7
-7 13
-13 14
-14 8
-8 15
-15 16
-16 5
-5 9
-17 1
-1 18
-18 19
-19 2
-2 20
-20 21
-21 3
-3 22
-22 23
-23 4
-4 24
-24 17
-9 18
-10 19
-11 20
-12 21
-13 22
-14 23
-15 24
-16 17
diff --git a/wmcube/3dObjects/cross2.wmc b/wmcube/3dObjects/cross2.wmc
deleted file mode 100644
index 61b5a39c046c..000000000000
--- a/wmcube/3dObjects/cross2.wmc
+++ /dev/null
@@ -1,51 +0,0 @@
-WMCUBE_COORDINATES
-1 -50 -50 50
-2 50 -50 50
-3 50 50 50
-4 -50 50 50
-5 -50 -50 -50
-6 50 -50 -50
-7 50 50 -50
-8 -50 50 -50
-9 -50 -150 -50
-10 50 -150 -50
-11 150 -50 -50
-12 150 50 -50
-13 50 150 -50
-14 -50 150 -50
-15 -150 50 -50
-16 -150 -50 -50
-17 -150 -50 50
-18 -50 -150 50
-19 50 -150 50
-20 150 -50 50
-21 150 50 50
-22 50 150 50
-23 -50 150 50
-24 -150 50 50
-
-WMCUBE_LINES
-9 10
-10 6
-6 11
-11 12
-12 7
-7 13
-13 14
-14 8
-8 15
-15 16
-16 5
-5 9
-17 1
-1 18
-18 19
-19 2
-2 20
-20 21
-21 3
-3 22
-22 23
-23 4
-4 24
-24 17
diff --git a/wmcube/3dObjects/cross3.wmc b/wmcube/3dObjects/cross3.wmc
deleted file mode 100644
index 6916934c5483..000000000000
--- a/wmcube/3dObjects/cross3.wmc
+++ /dev/null
@@ -1,95 +0,0 @@
-WMCUBE_COORDINATES
-1 -50 -50 50
-2 50 -50 50
-3 50 50 50
-4 -50 50 50
-5 -50 -50 -50
-6 50 -50 -50
-7 50 50 -50
-8 -50 50 -50
-9 -50 -150 -50
-10 50 -150 -50
-11 150 -50 -50
-12 150 50 -50
-13 50 150 -50
-14 -50 150 -50
-15 -150 50 -50
-16 -150 -50 -50
-17 -150 -50 50
-18 -50 -150 50
-19 50 -150 50
-20 150 -50 50
-21 150 50 50
-22 50 150 50
-23 -50 150 50
-24 -150 50 50
-25 -50 -50 150
-26 50 -50 150
-27 50 50 150
-28 -50 50 150
-29 -50 -50 -150
-30 50 -50 -150
-31 50 50 -150
-32 -50 50 -150
-
-WMCUBE_LINES
-1 5
-2 6
-7 3
-8 4
-9 10
-10 6
-6 11
-11 12
-12 7
-7 13
-13 14
-14 8
-8 15
-15 16
-16 5
-5 9
-17 1
-1 18
-18 19
-19 2
-2 20
-20 21
-21 3
-3 22
-22 23
-23 4
-4 24
-24 17
-9 18
-10 19
-11 20
-12 21
-13 22
-14 23
-15 24
-16 17
-25 26
-26 27
-27 28
-28 25
-25 1
-26 2
-27 3
-28 4
-5 6
-6 7
-7 8
-8 5
-29 30
-30 31
-31 32
-32 29
-5 29
-6 30
-7 31
-8 32
-1 2
-2 3
-3 4
-4 1
diff --git a/wmcube/3dObjects/crystal.wmc b/wmcube/3dObjects/crystal.wmc
deleted file mode 100644
index e2341ce53f9b..000000000000
--- a/wmcube/3dObjects/crystal.wmc
+++ /dev/null
@@ -1,108 +0,0 @@
-WMCUBE_COORDINATES
- 1 0 0 0
-
- 2 150 0 0
- 3 0 150 0
- 4 0 0 150
- 5 -150 0 0
- 6 0 -150 0
- 7 0 0 -150
-
- 8 100 -30 -30
- 9 100 -30 30
- 10 100 30 30
- 11 100 30 -30
-
- 12 30 100 -30
- 13 30 100 30
- 14 -30 100 30
- 15 -30 100 -30
-
- 16 -100 -30 -30
- 17 -100 -30 30
- 18 -100 30 30
- 19 -100 30 -30
-
- 20 30 -100 -30
- 21 30 -100 30
- 22 -30 -100 30
- 23 -30 -100 -30
-
- 24 30 -30 100
- 25 30 30 100
- 26 -30 30 100
- 27 -30 -30 100
-
- 28 30 -30 -100
- 29 30 30 -100
- 30 -30 30 -100
- 31 -30 -30 -100
-
- WMCUBE_LINES
-
- 1 11
- 1 8
- 1 9
- 1 10
-
- 1 15
- 1 12
- 1 13
- 1 14
-
- 1 18
- 1 19
- 1 16
- 1 17
-
- 1 20
- 1 21
- 1 22
- 1 23
-
- 1 27
- 1 24
- 1 25
- 1 26
-
- 1 31
- 1 28
- 1 29
- 1 30
-
- 2 8
- 2 9
- 2 10
- 2 11
-
- 3 15
- 3 12
- 3 13
- 3 14
-
- 4 27
- 4 24
- 4 25
- 4 26
-
- 5 16
- 5 17
- 5 18
- 5 19
-
- 6 20
- 6 21
- 6 22
- 6 23
-
- 7 31
- 7 28
- 7 29
- 7 30
-
- 1 2
- 1 3
- 1 4
- 1 5
- 1 6
- 1 7
diff --git a/wmcube/3dObjects/cube.wmc b/wmcube/3dObjects/cube.wmc
deleted file mode 100644
index a55e9755d33d..000000000000
--- a/wmcube/3dObjects/cube.wmc
+++ /dev/null
@@ -1,24 +0,0 @@
-WMCUBE_COORDINATES
-1 -180 -180 180
-2 180 -180 180
-3 180 180 180
-4 -180 180 180
-5 -180 -180 -180
-6 180 -180 -180
-7 180 180 -180
-8 -180 180 -180
-
-WMCUBE_LINES
-1 2
-2 3
-3 4
-4 1
-5 6
-6 7
-7 8
-8 5
-1 5
-2 6
-3 7
-4 8
-
diff --git a/wmcube/3dObjects/diamond.wmc b/wmcube/3dObjects/diamond.wmc
deleted file mode 100644
index b8d391709239..000000000000
--- a/wmcube/3dObjects/diamond.wmc
+++ /dev/null
@@ -1,66 +0,0 @@
-WMCUBE_COORDINATES
-
-1 -50 0 0
-2 -35 0 35
-3 0 0 50
-4 35 0 35
-5 50 0 0
-6 35 0 -35
-7 0 0 -50
-8 -35 0 -35
-
-9 -32 10 13
-10 -13 10 32
-11 13 10 32
-12 32 10 13
-13 32 10 -13
-14 13 10 -32
-15 -13 10 -32
-16 -32 10 -13
-
-17 0 -60 0
-WMCUBE_LINES
-
-1 2
-2 3
-3 4
-4 5
-5 6
-6 7
-7 8
-8 1
-
-9 10
-10 11
-11 12
-12 13
-13 14
-14 15
-15 16
-16 9
-
-1 9
-1 8
-2 10
-2 9
-3 11
-3 10
-4 12
-4 11
-5 13
-5 12
-6 14
-6 13
-7 15
-7 14
-8 16
-8 15
-
-17 1
-17 2
-17 3
-17 4
-17 5
-17 6
-17 7
-17 8
diff --git a/wmcube/3dObjects/e.wmc b/wmcube/3dObjects/e.wmc
deleted file mode 100644
index 7c7807035db4..000000000000
--- a/wmcube/3dObjects/e.wmc
+++ /dev/null
@@ -1,69 +0,0 @@
-WMCUBE_COORDINATES
-1 -60 -120 30
-2 80 -120 30
-3 80 -60 30
-4 0 -60 30
-5 0 -20 30
-6 40 -20 30
-7 40 20 30
-8 0 20 30
-9 0 60 30
-10 80 60 30
-11 80 120 30
-12 -60 120 30
-13 -60 -120 -30
-14 80 -120 -30
-15 80 -60 -30
-16 0 -60 -30
-17 0 -20 -30
-18 40 -20 -30
-19 40 20 -30
-20 0 20 -30
-21 0 60 -30
-22 80 60 -30
-23 80 120 -30
-24 -60 120 -30
-
-
-WMCUBE_LINES
-1 2
-2 3
-3 4
-4 5
-5 6
-6 7
-7 8
-8 9
-9 10
-10 11
-11 12
- 1 12
-13 14
-14 15
-15 16
-16 17
-17 18
-18 19
-19 20
-20 21
-21 22
-22 23
-23 24
-13 24
-
-1 13
-2 14
-3 15
-4 16
-5 17
-6 18
-7 19
-8 20
-9 21
-10 22
-11 23
-12 24
-
-
-
-
diff --git a/wmcube/3dObjects/e2.wmc b/wmcube/3dObjects/e2.wmc
deleted file mode 100644
index cd80bd6b735e..000000000000
--- a/wmcube/3dObjects/e2.wmc
+++ /dev/null
@@ -1,160 +0,0 @@
-WMCUBE_COORDINATES
-1 -60 -120 30
-2 80 -120 30
-3 80 -60 30
-4 0 -60 30
-5 0 -20 30
-6 40 -20 30
-7 40 20 30
-8 0 20 30
-9 0 60 30
-10 80 60 30
-11 80 120 30
-12 -60 120 30
-13 -60 -120 -30
-14 80 -120 -30
-15 80 -60 -30
-16 0 -60 -30
-17 0 -20 -30
-18 40 -20 -30
-19 40 20 -30
-20 0 20 -30
-21 0 60 -30
-22 80 60 -30
-23 80 120 -30
-24 -60 120 -30
-
-25 -60 -10 0
-26 -60 -40 0
-27 -80 -10 0
-28 -80 -40 0
-29 -80 -10 -15
-30 -80 -40 -15
-31 -80 -20 -20
-32 -80 -30 -20
-33 -80 -20 -30
-34 -80 -30 -30
-
-35 -60 -60 0
-36 -60 -90 0
-37 -80 -60 0
-38 -80 -90 0
-39 -80 -60 -15
-40 -80 -90 -15
-41 -80 -70 -20
-42 -80 -80 -20
-43 -80 -70 -30
-44 -80 -80 -30
-
-45 -60 10 0
-46 -60 40 0
-47 -80 10 0
-48 -80 40 0
-49 -80 10 -15
-50 -80 40 -15
-51 -80 20 -20
-52 -80 30 -20
-53 -80 20 -30
-54 -80 30 -30
-
-55 -60 60 0
-56 -60 90 0
-57 -80 60 0
-58 -80 90 0
-59 -80 60 -15
-60 -80 90 -15
-61 -80 70 -20
-62 -80 80 -20
-63 -80 70 -30
-64 -80 80 -30
-WMCUBE_LINES
-1 2
-2 3
-3 4
-4 5
-5 6
-6 7
-7 8
-8 9
-9 10
-10 11
-11 12
- 1 12
-13 14
-14 15
-15 16
-16 17
-17 18
-18 19
-19 20
-20 21
-21 22
-22 23
-23 24
-13 24
-1 13
-2 14
-3 15
-4 16
-5 17
-6 18
-7 19
-8 20
-9 21
-10 22
-11 23
-12 24
-
-25 26
-27 28
-25 27
-26 28
-27 29
-28 30
-29 31
-30 32
-31 33
-32 34
-33 34
-
-
-35 36
-37 38
-35 37
-36 38
-37 39
-38 40
-39 41
-40 42
-41 43
-42 44
-43 44
-
-45 46
-47 48
-45 47
-46 48
-47 49
-48 50
-49 51
-50 52
-51 53
-52 54
-53 54
-
-55 56
-57 58
-55 57
-56 58
-57 59
-58 60
-59 61
-60 62
-61 63
-62 64
-63 64
-
-
-
-
-
diff --git a/wmcube/3dObjects/foo.wmc b/wmcube/3dObjects/foo.wmc
deleted file mode 100644
index 04add8fd031b..000000000000
--- a/wmcube/3dObjects/foo.wmc
+++ /dev/null
@@ -1,149 +0,0 @@
-WMCUBE_COORDINATES
- 1 -190 110 50
- 2 -190 -90 50
- 3 -160 -90 50
- 4 -160 20 50
- 5 -90 20 50
- 6 -90 50 50
- 7 -160 50 50
- 8 -160 80 50
- 9 -90 80 50
- 10 -90 110 50
-
- 11 -190 110 0
- 12 -190 -90 0
- 13 -160 -90 0
- 14 -160 20 0
- 15 -90 20 0
- 16 -90 50 0
- 17 -160 50 0
- 18 -160 80 0
- 19 -90 80 0
- 20 -90 110 0
-
-
- 21 -50 110 50
- 22 60 110 50
- 23 60 -90 50
- 24 -50 -90 50
- 25 -20 -50 50
- 26 40 -50 50
- 27 40 70 50
- 28 -20 70 50
-
- 29 -50 110 0
- 30 60 110 0
- 31 60 -90 0
- 32 -50 -90 0
- 33 -20 -50 0
- 34 20 -50 0
- 35 20 70 0
- 36 -20 70 0
-
-
- 37 110 110 50
- 38 210 110 50
- 39 210 -90 50
- 40 110 -90 50
- 41 130 -50 50
- 42 190 -50 50
- 43 190 70 50
- 44 130 70 50
-
- 45 110 110 0
- 46 210 110 0
- 47 210 -90 0
- 48 110 -90 0
- 49 130 -50 0
- 50 190 -50 0
- 51 190 70 0
- 52 130 70 0
-
-
- WMCUBE_LINES
- 1 2
- 2 3
- 3 4
- 4 5
- 5 6
- 6 7
- 7 8
- 8 9
- 9 10
- 10 1
-
- 11 12
- 12 13
- 13 14
- 14 15
- 15 16
- 16 17
- 17 18
- 18 19
- 19 20
- 20 11
-
- 1 11
- 2 12
- 3 13
- 4 14
- 5 15
- 6 16
- 7 17
- 8 18
- 9 19
- 10 20
-
- 21 22
- 22 23
- 23 24
- 24 21
- 25 26
- 26 27
- 27 28
- 28 25
-
- 29 30
- 30 31
- 31 32
- 32 29
- 33 34
- 34 35
- 35 36
- 36 33
-
- 21 29
- 22 30
- 23 31
- 24 32
- 25 33
- 26 34
- 27 35
- 28 36
-
- 37 38
- 38 39
- 39 40
- 40 37
- 41 42
- 42 43
- 43 44
- 44 41
-
- 45 46
- 46 47
- 47 48
- 48 45
- 49 50
- 50 51
- 51 52
- 52 49
-
- 37 45
- 38 46
- 39 47
- 40 48
- 41 49
- 42 50
- 43 51
- 44 52
diff --git a/wmcube/3dObjects/gnustep.wmc b/wmcube/3dObjects/gnustep.wmc
deleted file mode 100644
index 93893fd1ae27..000000000000
--- a/wmcube/3dObjects/gnustep.wmc
+++ /dev/null
@@ -1,110 +0,0 @@
-WMCUBE_COORDINATES
-
-1 50 0 -10
-2 46 19 -10
-3 35 35 -10
-4 19 46 -10
-5 0 50 -10
-6 -19 46 -10
-7 -35 35 -10
-8 -46 19 -10
-9 -50 0 -10
-10 -46 -19 -10
-11 -35 -35 -10
-12 -19 -46 -10
-13 0 -50 -10
-14 19 -46 -10
-15 35 -35 -10
-16 46 -19 -10
-17 -25 35 -10
-18 -25 0 -10
-19 25 0 -10
-20 25 -35 -10
-
-21 50 0 10
-22 46 19 10
-23 35 35 10
-24 19 46 10
-25 0 50 10
-26 -19 46 10
-27 -35 35 10
-28 -46 19 10
-29 -50 0 10
-30 -46 -19 10
-31 -35 -35 10
-32 -19 -46 10
-33 0 -50 10
-34 19 -46 10
-35 35 -35 10
-36 46 -19 10
-37 -25 35 10
-38 -25 0 10
-39 25 0 10
-40 25 -35 10
-WMCUBE_LINES
-
-1 2
-2 3
-3 4
-4 5
-5 6
-6 7
-7 8
-8 9
-9 10
-10 11
-11 12
-12 13
-13 14
-14 15
-15 16
-16 1
-7 17
-17 18
-18 19
-19 20
-20 15
-
-21 22
-22 23
-23 24
-24 25
-25 26
-26 27
-27 28
-28 29
-29 30
-30 31
-31 32
-32 33
-33 34
-34 35
-35 36
-36 21
-27 37
-37 38
-38 39
-39 40
-40 35
-
-17 37
-18 38
-19 39
-20 40
-
-1 21
-2 22
-3 23
-4 24
-5 25
-6 26
-7 27
-8 28
-9 29
-10 30
-11 31
-12 32
-13 33
-14 34
-15 35
-16 36
diff --git a/wmcube/3dObjects/hyperpyramid.wmc b/wmcube/3dObjects/hyperpyramid.wmc
deleted file mode 100644
index 588d8027b192..000000000000
--- a/wmcube/3dObjects/hyperpyramid.wmc
+++ /dev/null
@@ -1,54 +0,0 @@
-WMCUBE_COORDINATES
-1 300 0 0
-2 -150 260 0
-3 -150 -260 0
-4 50 87 0
-5 -100 0 0
-6 50 -87 0
-7 0 0 90
-8 50 87 -250
-9 -100 0 -250
-10 50 -87 -250
-11 0 0 -90
-12 100 0 -50
-13 -87 100 -50
-14 -87 -100 -50
-
-WMCUBE_LINES
-1 4
-4 2
-2 5
-5 3
-3 6
-6 1
-1 7
-2 7
-3 7
-4 7
-5 7
-6 7
-4 8
-5 9
-6 10
-8 11
-9 11
-10 11
-1 12
-8 12
-10 12
-4 12
-6 12
-11 12
-4 13
-2 13
-5 13
-8 13
-9 13
-11 13
-5 14
-3 14
-6 14
-11 14
-9 14
-10 14
-
diff --git a/wmcube/3dObjects/jeep.wmc b/wmcube/3dObjects/jeep.wmc
deleted file mode 100644
index 5fb8f1d80239..000000000000
--- a/wmcube/3dObjects/jeep.wmc
+++ /dev/null
@@ -1,157 +0,0 @@
-WMCUBE_COORDINATES
- 1 -150 -20 0
- 2 -150 50 0
- 3 -40 50 0
- 4 -40 20 0
- 5 30 20 0
- 6 30 60 0
- 7 20 130 0
- 8 30 50 0
- 9 160 50 0
- 10 160 -20 0
- 11 140 -20 0
- 12 130 0 0
- 13 90 0 0
- 14 80 -20 0
- 15 80 -40 0
- 16 100 -60 0
- 17 110 -60 0
- 18 140 -40 0
- 19 -70 -20 0
- 20 -70 -40 0
- 21 -90 -60 0
- 22 -110 -60 0
- 23 -130 -40 0
- 24 -130 -20 0
- 25 -120 0 0
- 26 -80 0 0
- 27 -150 50 0
- 28 -80 120 0
- 29 -80 50 0
- 30 90 40 0
- 31 170 40 0
- 32 180 30 0
- 33 180 10 0
- 34 160 10 0
- 35 80 -10 0
- 36 -80 -10 0
-
- 37 -150 -20 100
- 38 -150 50 100
- 39 -40 50 100
- 40 -40 20 100
- 41 30 20 100
- 42 30 60 100
- 43 20 130 100
- 44 30 50 100
- 45 160 50 100
- 46 160 -20 100
- 47 140 -20 100
- 48 130 0 100
- 49 90 0 100
- 50 80 -20 100
- 51 80 -40 100
- 52 100 -60 100
- 53 110 -60 100
- 54 140 -40 100
- 55 -70 -20 100
- 56 -70 -40 100
- 57 -90 -60 100
- 58 -110 -60 100
- 59 -130 -40 100
- 60 -130 -20 100
- 61 -120 0 100
- 62 -80 0 100
- 63 -150 50 100
- 64 -80 120 100
- 65 -80 50 100
- 66 90 40 100
- 67 170 40 100
- 68 180 30 100
- 69 180 10 100
- 70 160 10 100
- 71 80 -10 100
- 72 -80 -10 100
-
- WMCUBE_LINES
- 1 2
- 2 3
- 3 4
- 4 5
- 5 6
- 6 7
- 8 9
- 9 10
- 10 11
- 11 12
- 12 13
- 13 14
- 14 15
- 15 16
- 16 17
- 17 18
- 35 36
- 19 20
- 20 21
- 21 22
- 22 23
- 23 24
- 24 1
- 24 25
- 25 26
- 27 28
- 28 29
- 30 31
- 31 32
- 32 33
- 33 34
- 18 11
-
- 37 38
- 38 39
- 39 40
- 40 41
- 41 42
- 42 43
- 44 45
- 45 46
- 46 47
- 47 48
- 48 49
- 49 50
- 50 51
- 51 52
- 52 53
- 53 54
- 71 72
- 55 56
- 56 57
- 57 58
- 58 59
- 59 60
- 60 37
- 60 61
- 61 62
- 63 64
- 64 65
- 66 67
- 67 68
- 68 69
- 69 70
- 54 47
-
- 1 37
- 2 38
- 3 39
- 4 40
- 5 41
- 6 42
- 7 43
- 8 44
- 9 45
- 10 46
- 11 47
- 35 71
- 36 72
- 24 60
- 28 64
diff --git a/wmcube/3dObjects/multicube.wmc b/wmcube/3dObjects/multicube.wmc
deleted file mode 100644
index ba0543929042..000000000000
--- a/wmcube/3dObjects/multicube.wmc
+++ /dev/null
@@ -1,83 +0,0 @@
-WMCUBE_COORDINATES
-1 -40 40 40
-2 -40 -40 40
-3 40 -40 40
-4 40 40 40
-5 -60 20 20
-6 -60 -20 20
-7 60 -20 20
-8 60 20 20
-9 -20 60 20
-10 -20 -60 20
-11 20 -60 20
-12 20 60 20
-13 -40 40 -40
-14 -40 -40 -40
-15 40 -40 -40
-16 40 40 -40
-17 -60 20 -20
-18 -60 -20 -20
-19 60 -20 -20
-20 60 20 -20
-21 -20 60 -20
-22 -20 -60 -20
-23 20 -60 -20
-24 20 60 -20
-25 20 20 60
-26 -20 20 60
-27 20 -20 60
-28 -20 -20 60
-29 20 20 -60
-30 -20 20 -60
-31 20 -20 -60
-32 -20 -20 -60
-
-WMCUBE_LINES
-1 2
-2 3
-3 4
-4 1
-5 6
-6 7
-7 8
-8 5
-9 10
-10 11
-11 12
-12 9
-13 14
-14 15
-15 16
-16 13
-1 13
-2 14
-3 15
-4 16
-17 18
-18 19
-19 20
-20 17
-8 20
-5 17
-6 18
-7 19
-21 22
-22 23
-23 24
-24 21
-12 24
-23 11
-9 21
-10 22
-25 26
-26 28
-27 28
-27 25
-25 29
-26 30
-28 31
-27 32
-29 30
-30 32
-31 32
-31 29
diff --git a/wmcube/3dObjects/pyramid.wmc b/wmcube/3dObjects/pyramid.wmc
deleted file mode 100644
index 99a618cab9b5..000000000000
--- a/wmcube/3dObjects/pyramid.wmc
+++ /dev/null
@@ -1,16 +0,0 @@
-WMCUBE_COORDINATES
-1 -150 -150 -150
-2 150 -150 -150
-3 150 150 -150
-4 -150 150 -150
-5 0 0 250
-WMCUBE_LINES
-1 2
-2 3
-3 4
-4 1
-1 5
-2 5
-3 5
-4 5
-
diff --git a/wmcube/3dObjects/shield.wmc b/wmcube/3dObjects/shield.wmc
deleted file mode 100644
index 3451f45f8a5a..000000000000
--- a/wmcube/3dObjects/shield.wmc
+++ /dev/null
@@ -1,197 +0,0 @@
-WMCUBE_COORDINATES
-1 -76 112 -10
-2 76 112 -10
-3 -10 99 -10
-4 10 99 -10
-5 10 75 -10
-6 33 75 -10
-7 33 55 -10
-8 10 55 -10
-9 -10 55 -10
-10 -33 55 -10
-11 -33 75 -10
-12 -10 75 -10
-13 -55 20 -10
-14 -10 20 -10
-15 10 20 -10
-16 55 20 -10
-17 55 0 -10
-18 10 0 -10
-19 -10 0 -10
-20 -55 0 -10
-21 -76 0 -10
-22 -72 -29 -10
-23 -59 -56 -10
-24 -34 -79 -10
-25 0 -89 -10
-26 35 -79 -10
-27 59 -56 -10
-28 72 -27 -10
-29 76 0 -10
-30 -53 -48 -10
-31 -45 -42 -10
-32 -36 -40 -10
-33 -26 -42 -10
-34 -19 -35 -10
-35 -10 -32 -10
-36 0 -30 -10
-37 10 -32 -10
-38 19 -35 -10
-39 26 -42 -10
-40 36 -40 -10
-41 45 -42 -10
-42 53 -48 -10
-43 -76 112 20
-44 76 112 20
-45 -10 99 20
-46 10 99 20
-47 10 75 20
-48 33 75 20
-49 33 55 20
-50 10 55 20
-51 -10 55 20
-52 -33 55 20
-53 -33 75 20
-54 10 75 20
-55 -55 20 20
-56 -10 20 20
-57 10 20 20
-58 55 20 20
-59 55 0 20
-60 10 0 20
-61 -10 0 20
-62 -55 0 20
-63 -76 0 20
-64 -72 -29 20
-65 -59 -56 20
-66 -34 -79 20
-67 0 -89 20
-68 35 -79 20
-69 59 -56 20
-70 72 -27 20
-71 76 0 20
-72 -53 -48 20
-73 -45 -42 20
-74 -36 -40 20
-75 -26 -42 20
-76 -19 -35 20
-77 -10 -32 20
-78 0 -30 20
-79 10 -32 20
-80 19 -35 20
-81 26 -42 20
-82 36 -40 20
-83 45 -42 20
-84 53 -48 20
-
-
-WMCUBE_LINES
-1 2
-2 29
-29 28
-28 27
-27 26
-26 25
-25 24
-24 23
-23 22
-22 21
-21 1
-3 4
-4 5
-5 6
-6 7
-7 8
-8 15
-15 16
-16 17
-17 18
-18 37
-35 19
-19 20
-20 13
-13 14
-14 9
-9 10
-10 11
-11 12
-12 3
-23 30
-30 31
-31 32
-32 33
-33 34
-34 35
-35 36
-36 37
-37 38
-38 39
-39 40
-40 41
-41 42
-42 27
-43 44
-44 71
-71 70
-70 69
-69 68
-68 67
-67 66
-66 65
-45 46
-46 47
-47 48
-48 49
-49 50
-50 57
-57 58
-58 59
-59 60
-60 79
-35 61
-61 62
-62 55
-55 56
-56 51
-51 52
-52 53
-53 54
-54 45
-65 72
-72 73
-73 74
-74 75
-75 76
-76 77
-77 78
-78 79
-79 80
-80 81
-81 82
-82 83
-83 84
-84 69
-43 63
-63 64
-64 65
-1 43
-2 44
-3 45
-4 46
-5 47
-6 48
-7 49
-8 50
-15 57
-16 58
-17 59
-18 60
-19 61
-20 62
-13 55
-14 56
-9 51
-10 52
-11 53
-12 54
-67 25
diff --git a/wmcube/3dObjects/spaceshuttle.wmc b/wmcube/3dObjects/spaceshuttle.wmc
deleted file mode 100644
index fb4bc1518333..000000000000
--- a/wmcube/3dObjects/spaceshuttle.wmc
+++ /dev/null
@@ -1,382 +0,0 @@
-WMCUBE_COORDINATES
-1 -44 0 14
-2 55 0 15
-3 60 0 10
-4 83 0 0
-5 86 0 -3
-6 85 0 -6
-7 77 0 -10
-8 45 0 -12
-9 -44 0 14
-10 -45 0 19
-11 -45 0 19
-12 -82 0 52
-13 -92 0 52
-14 -94 0 51
-15 -80 0 22
-16 -70 0 18
-17 -68 -16 -13
-18 -61 -58 -9
-19 -54 -58 -9
-20 -42 -56 -10
-21 -13 -26 -12
-22 47 -13 -10
-23 -68 16 -13
-24 -61 58 -9
-25 -54 58 -9
-26 -42 55 -10
-27 -13 27 -12
-28 47 13 -10
-29 45 -13 -14
-30 45 -13 9
-31 45 -9 13
-32 45 -4 15
-33 45 4 15
-34 45 9 13
-35 45 13 9
-36 45 13 -14
-37 -45 -13 -14
-38 -45 -13 9
-39 -45 -9 13
-40 -45 -4 15
-41 -45 4 15
-42 -45 9 13
-43 -45 13 9
-44 -45 13 -14
-45 45 13 -4
-46 48 13 -4
-47 78 7 -4
-48 85 3 -4
-49 86 0 -4
-50 45 -13 -4
-51 48 -13 -4
-52 78 -7 -4
-53 85 -3 -4
-54 86 0 -4
-55 45 13 -12
-56 -42 13 -15
-57 -72 13 -14
-58 45 -13 -12
-59 -42 -13 -15
-60 -72 -13 -14
-61 45 13 -12
-62 45 -13 -12
-63 -72 13 -14
-64 -72 -13 -14
-65 -72 14 -14
-66 -84 14 -13
-67 -72 14 -12
-68 -72 -14 -14
-69 -84 -14 -13
-70 -72 -14 -12
-71 -84 14 -13
-72 -84 -14 -13
-73 -72 16 -12
-74 -70 14 4
-75 -69 2 16
-76 -69 -2 16
-77 -70 -15 4
-78 -72 -16 -12
-79 -56 57 -9
-80 -56 16 -13
-81 -56 -57 -9
-82 -56 -16 -13
-83 -93 0 48
-84 -87 0 48
-85 -70 0 23
-86 -80 0 23
-87 -69 15 4
-88 -69 18 12
-89 -69 10 20
-90 -69 2 16
-91 -69 -15 4
-92 -69 -19 12
-93 -69 -11 20
-94 -69 -2 16
-95 -69 15 4
-96 -44 13 5
-97 -69 2 16
-98 -44 2 14
-99 -69 18 12
-100 -52 18 13
-101 -69 10 20
-102 -52 10 21
-103 -52 18 13
-104 -52 -10 21
-105 -52 18 13
-106 -44 13 5
-107 -52 10 21
-108 -44 2 14
-109 -69 -15 4
-110 -44 -13 5
-111 -69 -2 16
-112 -44 -2 14
-113 -69 -19 12
-114 -52 -19 13
-115 -69 -11 20
-116 -52 -10 21
-117 -52 -19 13
-118 -52 -10 21
-119 -52 -19 13
-120 -44 -13 5
-121 -52 -10 21
-122 -44 -2 14
-123 -80 0 16
-124 -81 3 14
-125 -82 3 8
-126 -83 0 6
-127 -82 -3 8
-128 -81 -3 14
-129 -80 0 16
-130 -80 0 16
-131 -69 0 12
-132 -83 0 6
-133 -70 0 4
-134 -82 3 11
-135 -69 2 8
-136 -82 -3 11
-137 -69 -2 -8
-138 -69 0 12
-139 -69 2 8
-140 -70 0 4
-141 -69 -2 8
-142 -69 0 12
-143 -83 8 2
-144 -84 13 -1
-145 -85 13 -6
-146 -85 8 -9
-147 -85 3 -6
-148 -84 3 -1
-149 -83 8 2
-150 -83 8 2
-151 -72 7 -2
-152 -85 8 -9
-153 -73 7 -9
-154 -84 13 -3
-155 -73 10 -5
-156 -84 3 -3
-157 -73 4 -5
-158 -72 7 -2
-159 -73 10 -5
-160 -73 7 -9
-161 -73 4 -5
-162 -72 7 -2
-163 -83 -8 2
-164 -84 -13 -1
-165 -85 -13 -6
-166 -85 -8 -9
-167 -85 -4 -6
-168 -84 -4 -1
-169 -83 -8 2
-170 -83 -8 2
-171 -72 -7 -2
-172 -85 -8 -9
-173 -73 -7 -9
-174 -84 -13 -3
-175 -73 -10 -5
-176 -84 -4 -3
-177 -73 -4 -5
-178 -72 -7 -2
-179 -73 -10 -5
-180 -73 -7 -9
-181 -73 -4 -5
-182 -72 -7 -2
-183 61 2 10
-184 60 5 10
-185 57 5 13
-186 58 3 13
-187 61 2 10
-188 61 -2 10
-189 60 -5 10
-190 57 -5 13
-191 58 -3 13
-192 61 -2 10
-193 60 5 10
-194 57 9 8
-195 55 7 12
-196 57 5 13
-197 60 -5 10
-198 57 -9 8
-199 55 -7 12
-200 57 -5 13
-201 57 9 8
-202 53 10 9
-203 53 7 12
-204 55 7 12
-205 57 -9 8
-206 53 -10 9
-207 53 -7 12
-208 55 -7 12
-209 45 13 5
-210 -45 13 4
-211 45 -13 5
-212 -45 -13 4
-213 45 13 -12
-214 48 13 -12
-215 78 6 -9
-216 85 3 -5
-217 86 0 -4
-218 45 -13 -12
-219 48 -13 -12
-220 78 -7 -9
-221 85 -3 -5
-222 86 0 -4
-223 0 0 0
-WMCUBE_LINES
-2 1
-3 2
-4 3
-5 4
-6 5
-7 6
-8 7
-10 9
-12 11
-13 12
-14 13
-15 14
-16 15
-18 17
-19 18
-20 19
-21 20
-22 21
-24 23
-25 24
-26 25
-27 26
-28 27
-30 29
-31 30
-32 31
-33 32
-34 33
-35 34
-36 35
-38 37
-39 38
-40 39
-41 40
-42 41
-43 42
-44 43
-46 45
-47 46
-48 47
-49 48
-51 50
-52 51
-53 52
-54 53
-56 55
-57 56
-59 58
-60 59
-62 61
-64 63
-66 65
-67 66
-69 68
-70 69
-72 71
-74 73
-75 74
-76 75
-77 76
-78 77
-80 79
-82 81
-84 83
-85 84
-86 85
-88 87
-89 88
-90 89
-92 91
-93 92
-94 93
-96 95
-98 97
-100 99
-102 101
-104 103
-106 105
-108 107
-110 109
-112 111
-114 113
-116 115
-118 117
-120 119
-122 121
-124 123
-125 124
-126 125
-127 126
-128 127
-129 128
-131 130
-133 132
-135 134
-137 136
-139 138
-140 139
-141 140
-142 141
-144 143
-145 144
-146 145
-147 146
-148 147
-149 148
-151 150
-153 152
-155 154
-157 156
-159 158
-160 159
-161 160
-162 161
-164 163
-165 164
-166 165
-167 166
-168 167
-169 168
-171 170
-173 172
-175 174
-177 176
-179 178
-180 179
-181 180
-182 181
-184 183
-185 184
-186 185
-187 186
-189 188
-190 189
-191 190
-192 191
-194 193
-195 194
-196 195
-198 197
-199 198
-200 199
-202 201
-203 202
-204 203
-206 205
-207 206
-208 207
-210 209
-212 211
-214 213
-215 214
-216 215
-217 216
-219 218
-220 219
-221 220
\ No newline at end of file
diff --git a/wmcube/3dObjects/spiral.wmc b/wmcube/3dObjects/spiral.wmc
deleted file mode 100644
index 0af2d4fb8d14..000000000000
--- a/wmcube/3dObjects/spiral.wmc
+++ /dev/null
@@ -1,49 +0,0 @@
-WMCUBE_COORDINATES
-
-1 80 0 0
-2 0 -90 25
-3 -100 0 50
-4 0 110 75
-5 120 0 100
-6 0 -130 125
-7 -140 0 150
-8 0 150 175
-9 160 0 200
-10 0 70 -25
-11 -60 0 -50
-12 0 -50 -75
-13 40 0 -100
-14 0 30 -125
-15 -20 0 -150
-16 0 -10 -175
-17 0 0 -200
-18 0 -160 200
-19 -160 0 200
-20 0 160 200
-
-WMCUBE_LINES
-
-1 2
-2 3
-3 4
-4 5
-5 6
-6 7
-7 8
-8 9
-1 10
-10 11
-11 12
-12 13
-13 14
-14 15
-15 16
-16 17
-17 9
-17 18
-17 19
-17 20
-9 18
-18 19
-19 20
-20 9
diff --git a/wmcube/3dObjects/star.wmc b/wmcube/3dObjects/star.wmc
deleted file mode 100644
index 1fd0b244a5e4..000000000000
--- a/wmcube/3dObjects/star.wmc
+++ /dev/null
@@ -1,95 +0,0 @@
-WMCUBE_COORDINATES
-1 -90 -90 90
-2 90 -90 90
-3 90 90 90
-4 -90 90 90
-5 -90 -90 -90
-6 90 -90 -90
-7 90 90 -90
-8 -90 90 -90
-9 -10 -350 -10
-10 10 -350 -10
-11 350 -10 -10
-12 350 10 -10
-13 10 350 -10
-14 -10 350 -10
-15 -350 10 -10
-16 -350 -10 -10
-17 -350 -10 10
-18 -10 -350 10
-19 10 -350 10
-20 350 -10 10
-21 350 10 10
-22 10 350 10
-23 -10 350 10
-24 -350 10 10
-25 -10 -10 350
-26 10 -10 350
-27 10 10 350
-28 -10 10 350
-29 -10 -10 -350
-30 10 -10 -350
-31 10 10 -350
-32 -10 10 -350
-
-WMCUBE_LINES
-1 5
-2 6
-7 3
-8 4
-9 10
-10 6
-6 11
-11 12
-12 7
-7 13
-13 14
-14 8
-8 15
-15 16
-16 5
-5 9
-17 1
-1 18
-18 19
-19 2
-2 20
-20 21
-21 3
-3 22
-22 23
-23 4
-4 24
-24 17
-9 18
-10 19
-11 20
-12 21
-13 22
-14 23
-15 24
-16 17
-25 26
-26 27
-27 28
-28 25
-25 1
-26 2
-27 3
-28 4
-5 6
-6 7
-7 8
-8 5
-29 30
-30 31
-31 32
-32 29
-5 29
-6 30
-7 31
-8 32
-1 2
-2 3
-3 4
-4 1
diff --git a/wmcube/3dObjects/starcube.wmc b/wmcube/3dObjects/starcube.wmc
deleted file mode 100644
index a7bc2dfe501a..000000000000
--- a/wmcube/3dObjects/starcube.wmc
+++ /dev/null
@@ -1,69 +0,0 @@
-WMCUBE_COORDINATES
- 1 -100 -100 100
- 2 100 -100 100
- 3 100 100 100
- 4 -100 100 100
- 5 -100 -100 -100
- 6 100 -100 -100
- 7 100 100 -100
- 8 -100 100 -100
-
- 9 75 0 0
- 10 0 75 0
- 11 0 0 75
- 12 -75 0 0
- 13 0 -75 0
- 14 0 0 -75
-
- 15 -75 -75 75
- 16 75 -75 75
- 17 75 75 75
- 18 -75 75 75
- 19 -75 -75 -75
- 20 75 -75 -75
- 21 75 75 -75
- 22 -75 75 -75
-
- WMCUBE_LINES
- 1 2
- 2 3
- 3 4
- 4 1
- 5 6
- 6 7
- 7 8
- 8 5
- 1 5
- 2 6
- 3 7
- 4 8
-
- 9 15
- 9 18
- 9 19
- 9 22
-
- 10 15
- 10 16
- 10 19
- 10 20
-
- 11 19
- 11 20
- 11 21
- 11 22
-
- 12 16
- 12 17
- 12 20
- 12 21
-
- 13 17
- 13 18
- 13 21
- 13 22
-
- 14 15
- 14 16
- 14 17
- 14 18
diff --git a/wmcube/CHANGES b/wmcube/CHANGES
index 5b38c4ee9eee..730b2fae3e0d 100644
--- a/wmcube/CHANGES
+++ b/wmcube/CHANGES
@@ -1,4 +1,24 @@
-wmcube 0.98:
+wmCube 0.99-pre1
+ * Rewrite to C++ using the wmApp toolkit.
+ - Full color depth
+ - User definable for/background colors
+ - User definable shading
+ - New window layout added with cpu meter
+ - Switch to classic (simple) layout with a mouseclick
+ * Uses the CpuMonitorCC library (also in pre-stage)
+ * Place lightsource with mouseclick or have it move around by itself
+ * Solid wireframe mode added
+ * "Reflex" effect
+ * 3- and 5-button mouse (mouse wheel support)
+ * wmc file format updates
+ - Both planes and lines in the same file (preferably even)
+ - No specific order of sections is required
+ - Comments allowed (all lines starting with a #)
+ - Should be fully backwards compatible
+ * If no object(s) defined looks in /usr/share/wmcube
+ * Rewritten scandir function to be POSIX compliant
+
+wmCube 0.98:
* Added solid flat-shading to 3d-engine
* New tag in object-files (WMCUBE_PLANES) for solid objects

diff --git a/wmcube/INSTALL b/wmcube/INSTALL
deleted file mode 100644
index 8cae7e6858ee..000000000000
--- a/wmcube/INSTALL
+++ /dev/null
@@ -1,37 +0,0 @@
-Requirements
---------------------------------------------------------------
-
-- Linux (glibc 2.1) (Tested on various distributions)
- or Solaris 8 Sparc/x86 (should work on Solaris 2.x and 7)
- or OpenBSD
- or FreeBSD 3-stable, 4-stable
- or NetBSD
-
-- root access
-
- To be able to install the application system-wide
- you need root access.
-
-Installation
---------------------------------------------------------------
-1) % tar -zxvf wmcube-0.98.tar.gz
-
-2) % cd wmcube/wmcube
-
-3) % make (if you are running Linux) or
- % make -f Makefile.xxx (where xxx is the OS you running)
-
-Optional
-
-4) % su root
-
-5) % make install
-
-6) % wmcube & (or wmcube -h for command line options).
-
-General Notes
---------------------------------------------------------------
-Note 1: If "make install" fails on your system, please edit
- the Makefile to set the paths according to your setup.
- "make install" defaults to /usr/local/bin, $HOME & /etc.
-
diff --git a/wmcube/Makefile b/wmcube/Makefile
new file mode 100644
index 000000000000..ba39bd903e0d
--- /dev/null
+++ b/wmcube/Makefile
@@ -0,0 +1,58 @@
+#
+# wmCube 0.99-pre1
+#
+# To make wmcube compile on another OS change the following things:
+#
+# CXXFLAGS -D: FREEBSD/NETBSD/SOLARIS/OPENBSD/DARWIN
+# CPUMONCC_OS: freebsd/netbsd/solaris/openbsd/darwin (you will also have
+# to make sure that the makefile in the cpumoncc/$(CPUMONCC_OS) directory
+# is working.
+# LFLAGS: Modify/Add any necessary libraries here.
+#
+#
+CXX= g++
+CXXFLAGS=-O2 -DLINUX
+CPUMONCC_OS=linux
+WMCUBE_LIBS=-Lwmapp -lwmapp -Lcpumoncc/$(CPUMONCC_OS) -lcpumoncc
+LFLAGS=$(WMCUBE_LIBS) -L/usr/X11R6/lib -lXpm -lXext -lX11
+OBJECTS = WmcObject.o
+TARGET = wmcube
+
+$(TARGET): wmcube.cc cpumoncc/$(CPUMONCC_OS)/libcpumoncc.a wmapp/libwmapp.a $(OBJECTS)
+ @@echo "###############################################################"
+ @@echo "#"
+ @@echo "# I am now building the actual wmCube application."
+ @@echo "#"
+ @@echo "###############################################################"
+ $(CXX) $(CXXFLAGS) $(OBJECTS) $< -o $@ $(LFLAGS)
+
+cpumoncc/$(CPUMONCC_OS)/libcpumoncc.a:
+ @@echo "###############################################################"
+ @@echo "# I am now building the cpumoncc library in 'cpumoncc/$(CPUMONCC_OS)'."
+ @@echo "# Please modify/verify the makefile in that directory before"
+ @@echo "# reporting an error as a bug."
+ @@echo "###############################################################"
+ cd cpumoncc/$(CPUMONCC_OS); make; cd ../..
+
+wmapp/libwmapp.a:
+ @@echo "###############################################################"
+ @@echo "# I am now building the wmapp library in 'wmapp'"
+ @@echo "# Please modify/verify the makefile in that directory before"
+ @@echo "# reporting an error as a bug."
+ @@echo "###############################################################"
+ cd wmapp; make; cd ..
+
+install: $(TARGET)
+ cp -Rf wmc /usr/share/wmcube
+ cp wmcube /usr/local/bin
+ chmod 755 /usr/local/bin/wmcube
+ chown root:root /usr/local/bin/wmcube
+
+clean:
+ rm -f *.o *\~ $(TARGET)
+ cd wmapp; make clean; cd ..
+ cd cpumoncc/$(CPUMONCC_OS); make clean; cd ../..
+
+install_clean:
+ rm -fr /usr/share/wmcube
+ rm /usr/local/bin/wmcube
diff --git a/wmcube/README b/wmcube/README
index 9275d458c889..18affb7d7b30 100644
--- a/wmcube/README
+++ b/wmcube/README
@@ -1,41 +1,83 @@
-wmCube 0.98
---------------------------------------------------------------
-Author: Robert Kling
- robk...@student.luth.se
- http://boombox.campus.luth.se
-
-Contributions by:
- Thorsten Jens (th...@et-inf.fho-emden.de)
- Jakob Borg (email-adress goes here)
- Dan Price (d...@rampant.org)
- Brian Joseph Czapiga (r...@godsey.net)
- Tai-hwa Liang (ava...@mmlab.cse.yzu.edu.tw)
- Jared Smolens (jsmo...@andrew.cmu.edu)
-
-Description
---------------------------------------------------------------
-
-wmCube is a dockapp that displays a realtime rotating 3d-object
-and the current CPU load.
-
-Files
---------------------------------------------------------------
-3dObjects/ In here you will find bundled object-files.
-README This file.
-INSTALL Installation instructions.
-CHANGES Description of changes.
-TODO Things I've already planned for wmCube
-COPYING GNU General Public License Version 2.
-
-Bugs
---------------------------------------------------------------
-If you discover any bugs in this software, please send a
-bugreport to robk...@student.luth.se and describe the
-problem as detailed as you can.
-
-Copyright
---------------------------------------------------------------
-wmCube is Copyright (C) 2000/01 by Robert Kling, Lulea SWEDEN
-
-wmCube is licensed through the GNU General Public License.
-Read the COPYING file for the complete GNU license.
+wmCube 0.99-pre1
+(C) Copyright 2003 Robert Kling
+robk...@student.luth.se
+http://kling.mine.nu/wmcube.htm
+
+DESCRIPTION
+wmCube is a dockapp for monitoring the cpu load. A 3D object spins
+faster/slower relative to the load and you can even design your own
+objects for it. Objects can be traditional wireframe or solid shaded or
+a combination of the two.
+
+REQUIREMENTS
+wmCube uses the CpuMonitorCC (cpumoncc) library (spawned from
+previous versions of wmCube) to read the cpu load which supports a
+range of different operating systems. Further, the wmApp toolkit is
+used to do the drawing to the X server. Both cpumoncc and wmApp
+are included in the distribution, versions 0.0.1-pre1 and 0.0.4.1
+respectively.
+
+INSTALL
+THIS PRE-VERSION ONLY WORKS ON LINUX! Please report
+all bugs. Note though that wmCube _should_ compile on all archs
+supported in earlier versions by simply editing the Makefile for
+the particular OS in the cpumoncc directory as well as copying
+and modifying the main makefile. IF YOU GET WMCUBE
+WORKING IN ANOTHER OS THAN LINUX, PLEASE SEND
+ME THE SUCCESSFUL MAKEFILES OR A PATCH! (sorry
+for the shouting)
+
+To install wmCube:
+
+# make
+
+then as root
+
+# make install
+
+This will install wmc-objects into /usr/share/wmcube
+and the binary into /usr/local/bin.
+
+Alternatively you can run wmcube with '-o <directory>' which will
+load objects from the <directory>. More objects will
+be bundled in the stable release.
+
+USAGE
+
+# wmcube -h
+
+will give you a list of all availible command line options. When
+running you control the program by clicking with your mouse on the
+canvas where the object is displayed.
+
+For a 3-button mouse:
+
+First mouse button (left):
+ Upper left corner: Switches between new and classic window mode.
+ Left hand side: Zoom away from the object.
+ Right hand side: Zoom in on the object.
+ Upper edge: Scroll in the next object from below.
+ Lower edge: Scroll in the previous object from above.
+ In the middle (approx): Change 3d mode on object.
+
+Second mouse button (middle button):
+ Changes 3d mode on object.
+
+Third mouse button (right):
+ Sets the position of the lightsource.
+
+For a 5-button mouse (mouse wheel):
+Exactly the same as 3-button mouse except
+that you can also zoom in/out with the wheel
+(button 4 and 5).
+
+CONTRIBUTIONS
+I only test wmCube thoroughly on Linux so anyone running on a
+different OS/architecture please let me now if there are any bugs.
+Suggestions, patches etc. are also very welcome. If you package
+wmCube for a certain distribution/OS and it is not represented on
+this page feel free to send it to me. You can also send me new
+objects (if they're cool) and I will include them in the next release
+alt. put them up on this page. Make sure to put a comment
+(new in 0.99) with your name etc in the wmc-file if you want credit
+for them.
\ No newline at end of file
diff --git a/wmcube/TODO b/wmcube/TODO
deleted file mode 100644
index 01df841af48b..000000000000
--- a/wmcube/TODO
+++ /dev/null
@@ -1,8 +0,0 @@
-TODO list for wmCube future versions
---------------------------------------------------------------
-
-* Ports to more OS's.
-* Goroud shading, texture mapping (hmm.. do I smell overkill?)
-
-If you have any suggestions, ideas, comments of how to make
-this app better please send it to robk...@student.luth.se.
diff --git a/wmcube/WmcObject.cc b/wmcube/WmcObject.cc
new file mode 100644
index 000000000000..e5c5a0f9f8e2
--- /dev/null
+++ b/wmcube/WmcObject.cc
@@ -0,0 +1,619 @@
+#include <stdlib.h>
+#include <string.h>
+#include <math.h>
+#include <iostream>
+#include <stdexcept>
+#include <vector>
+#include "wmapp/wmcanvas.h"
+#include "WmcObject.h"
+
+using namespace std;
+
+#define DEBUG 0
+#define PDEBUG() if (DEBUG)
+
+#define CHECK(a, b, c) (((b) < (a)) || ((b) > (c))) ? true : false
+#define ROUND(a) ((a) - floor((a)) >= 0.5) ? (int)ceil((a)) : (int)floor((a))
+#define PI 3.14159265368979
+#define PI2 6.283185307
+#define invPI 0.318309885
+#define WMC_COMMENT_CHAR '#'
+#define VERTEX_SCALE 200.0
+
+/**********************************
+ Color related stuff
+*/
+
+#define REFLEX 0.04 // Do the reflexy thing if the shading is less than this
+#define REFLEX_COLOR 0xAACEEE
+#define WIRE_COLOR 0x20B2AE
+#define CYAN 0x20B2AE
+#define SHADING 90.0
+
+/*******************************************************************
+
+ WmcObject::WmcObject()
+
+ Creates a new (default)
+
+********************************************************************/
+WmcObject::WmcObject()
+{
+ const char *filename = { "/tmp/default_cube.wmc" };
+ FILE *fp = fopen(filename, "w");
+ fwrite(default_cube, sizeof(unsigned char), strlen(default_cube), fp);
+ fclose(fp);
+
+ load(filename);
+
+ lightsource.x = 0;
+ lightsource.y = -1;
+ lightsource.z = 1;
+
+ xoff = 26;
+ yoff = 20;
+ zoff = 3000;
+
+ color = CYAN;
+ shading = SHADING / 100.0;
+}
+
+/*******************************************************************
+
+ WmcObject::WmcObject(const char *filename)
+
+********************************************************************/
+WmcObject::WmcObject(const char *filename)
+{
+ load(filename);
+
+ lightsource.x = 0;
+ lightsource.y = -1;
+ lightsource.z = 1;
+
+ xoff = 26;
+ yoff = 20;
+ zoff = 3000;
+
+ color = CYAN;
+ shading = SHADING / 100.0;
+}
+
+/*******************************************************************
+
+ WmcObject::~WmcObject()
+
+********************************************************************/
+WmcObject::~WmcObject()
+{
+}
+
+void WmcObject::setColorShading(unsigned icolor, float ishading)
+{
+ color = icolor;
+ shading = ishading / 100.0;;
+}
+
+void WmcObject::setMode(int m)
+{
+ PDEBUG() printf("setting mode %d\n", m);
+ switch (m)
+ {
+ case WIREFRAME:
+ PDEBUG() printf("setting wireframe mode\n", m);
+ if (lines) mode = WIREFRAME;
+ break;
+ case SOLID:
+ PDEBUG() printf("setting solid mode\n", m);
+ if (planes) mode = SOLID;
+ break;
+ case SOLID_WIRE:
+ PDEBUG() printf("setting solid wire mode\n", m);
+ if (planes && lines) mode = SOLID_WIRE;
+ break;
+ default:
+ break;
+ }
+}
+
+void WmcObject::setYOffset(int pixels)
+{
+ yoff = pixels;
+}
+
+void WmcObject::modifyZOffset(int idepth)
+{
+ if (zoff + idepth >= 2 * VERTEX_SCALE)
+ zoff += idepth;
+}
+
+void WmcObject::setLightSource(float xc, float yc, float zc)
+{
+ lightsource.x = xc;
+ lightsource.y = yc;
+ lightsource.z = zc;
+}
+
+
+/*******************************************************************
+
+ int WmcObject::freadline(FILE *fp, int maxlen, char *dest)
+
+ Reads a line of chars of maximum 'maxlen' length from file 'fp'
+ into buffer 'dest'. Discards comments (returns length 0) otherwise
+ return the true length of the row.
+
+********************************************************************/
+int WmcObject::freadline(FILE *fp, int maxlen, char *dest)
+{
+ int cnt = 0;
+ bzero(dest, maxlen);
+ if (feof(fp)) return 0;
+ fread(&dest[cnt++], 1, 1, fp);
+ while ((dest[cnt - 1] != '\n') && (!feof(fp)) && (cnt < maxlen)) fread(&dest[cnt++], 1, 1, fp);
+ dest[cnt - 1] = 0;
+ if (dest[0] == WMC_COMMENT_CHAR) return 0;
+ return cnt - 1;
+}
+
+/*******************************************************************
+
+ bool WmcObject::loadVertices(const char *filename)
+
+********************************************************************/
+bool WmcObject::loadVertices(const char *filename)
+{
+ Vertex vtmp;
+ int n = 0;
+ char tmp[64], tmp2[64];
+ FILE *fp;
+ float max = 0;
+
+ PDEBUG() printf("Loading vertices...\n");
+
+ if ((fp = fopen(filename,"r")) == NULL)
+ throw runtime_error("WmcObject::load: object file not found.");
+
+ do
+ {
+ freadline(fp, 63, tmp);
+ if (feof(fp)) return false;
+ }
+ while (!strstr(tmp,"WMCUBE_COORDINATES"));
+
+ do
+ {
+ int len = freadline(fp, 63, tmp);
+ //printf("\"%s\"\n",tmp);
+
+ if (!strstr(tmp,"WMCUBE_PLANES") && !strstr(tmp,"WMCUBE_LINES") && (len > 5))
+ {
+ if (sizeof(float) == sizeof(double))
+ sscanf(tmp,"%63s %lf %lf %lf", tmp2, &vtmp.x, &vtmp.y, &vtmp.z);
+ else
+ sscanf(tmp,"%63s %f %f %f", tmp2, &vtmp.x, &vtmp.y, &vtmp.z);
+
+ n = atoi(tmp2);
+
+ // Save maximum scalar product for scaling
+ if (sqrt(vtmp.x*vtmp.x + vtmp.y*vtmp.y + vtmp.z*vtmp.z) > max)
+ max = sqrt(vtmp.x * vtmp.x + vtmp.y*vtmp.y + vtmp.z*vtmp.z);
+
+ vertex.push_back(vtmp);
+ //printf("%d: %f %f %f\n", n, vertex.back().x, vertex.back().y, vertex.back().z);
+
+ if (n != vertex.size())
+ {
+ fclose(fp);
+ throw runtime_error("WmcObject::load: Error in objectfile: the"
+ "coordinates must be listed in order 1..n.");
+ }
+ }
+ }
+
+ while (!strstr(tmp,"WMCUBE_LINES") && !strstr(tmp,"WMCUBE_PLANES") && (!feof(fp)));
+
+ // Scale the vertices to 0..200
+ for (int i = 0; i < vertex.size(); i++)
+ {
+ vertex.at(i).x = VERTEX_SCALE / max * vertex.at(i).x;
+ vertex.at(i).y = VERTEX_SCALE / max * vertex.at(i).y;
+ vertex.at(i).z = VERTEX_SCALE / max * vertex.at(i).z;
+ rvertex.push_back(vertex.at(i));
+ }
+
+ fclose(fp);
+
+ return true;
+}
+
+/*******************************************************************
+
+ bool WmcObject::loadLines(const char *filename)
+
+********************************************************************/
+bool WmcObject::loadLines(const char *filename)
+{
+ Line ltmp;
+ char tmp[64];
+ int iltmp[3];
+ FILE *fp;
+
+ if ((fp = fopen(filename,"r")) == NULL)
+ throw runtime_error("WmcObject::load: object file not found.\n");
+
+ do
+ {
+ freadline(fp, 63, tmp);
+ if (feof(fp)) return false;
+ }
+ while (!strstr(tmp,"WMCUBE_LINES"));
+
+ PDEBUG() printf("Loading lines...\n");
+
+ do
+ {
+ int len = freadline(fp, 63, tmp);
+
+ if (!strstr(tmp,"WMCUBE_COORDINATES") && !strstr(tmp,"WMCUBE_PLANES") && (len > 2))
+ {
+ sscanf(tmp, "%d %d", &iltmp[0], &iltmp[1]);
+
+ if (CHECK(0, iltmp[0] - 1, vertex.size()) || CHECK(0, iltmp[1] - 1, vertex.size()))
+ {
+ fclose(fp);
+ throw runtime_error("WmcObject::load: Error in objectfile (WMCUBE_LINES section):"
+ "invalid coordinates.");
+ }
+
+ ltmp.a = &rvertex[iltmp[0] - 1];
+ ltmp.b = &rvertex[iltmp[1] - 1];
+ line.push_back(ltmp);
+ //printf("%d %d\n", iltmp[0], iltmp[1]);
+ }
+ }
+ while (!strstr(tmp,"WMCUBE_COORDINATES") && !strstr(tmp,"WMCUBE_PLANES") && !feof(fp));
+
+ fclose(fp);
+
+ return true;
+}
+
+/*******************************************************************
+
+ bool WmcObject::loadPlanes(const char *filename)
+
+********************************************************************/
+bool WmcObject::loadPlanes(const char *filename)
+{
+ Plane ptmp;
+ char tmp[64];
+ int iptmp[3];
+ FILE *fp;
+
+ if ((fp = fopen(filename,"r")) == NULL)
+ throw runtime_error("WmcObject::load: object file not found.");
+
+ do
+ {
+ freadline(fp, 63, tmp);
+ if (feof(fp)) return false;
+ }
+ while (!strstr(tmp,"WMCUBE_PLANES"));
+
+ PDEBUG() printf("Loading planes...\n");
+
+ do
+ {
+ int len = freadline(fp, 63, tmp);
+
+ if (!strstr(tmp,"WMCUBE_COORDINATES") && !strstr(tmp,"WMCUBE_LINES") && (len > 4))
+ {
+ sscanf(tmp,"%d %d %d", &iptmp[0], &iptmp[1], &iptmp[2]);
+
+ if (CHECK(0, iptmp[0] - 1, rvertex.size())
+ || CHECK(0, iptmp[1] - 1, rvertex.size())
+ || CHECK(0, iptmp[2] - 1, rvertex.size()))
+ {
+ fclose(fp);
+ throw runtime_error("WmcObject::load: Error in objectfile (WMCUBE_PLANES section): "
+ "invalid coordinates.");
+ }
+
+ ptmp.a = &rvertex[iptmp[0] - 1];
+ ptmp.b = &rvertex[iptmp[1] - 1];
+ ptmp.c = &rvertex[iptmp[2] - 1];
+ ptmp.ab = -1;
+ ptmp.bc = -1;
+ ptmp.ac = -1;
+ plane.push_back(ptmp);
+ //printf("%d %d %d\n", iptmp[0], iptmp[1], iptmp[2]); fflush(stdout);
+ }
+ }
+ while (!strstr(tmp,"WMCUBE_LINES") && !strstr(tmp,"WMCUBE_COORDINATES") && !feof(fp));
+
+ fclose(fp);
+
+ if (lines)
+ {
+ // Check which lines to draw for SOLID_WIRE mode
+
+ for (int i = 0; i < plane.size(); i++)
+ for (int j = 0; j < line.size(); j++)
+ {
+ if (verticesBelongToLine(plane[i].a, plane[i].b, line[j])) plane[i].ab = j;
+ if (verticesBelongToLine(plane[i].b, plane[i].c, line[j])) plane[i].bc = j;
+ if (verticesBelongToLine(plane[i].a, plane[i].c, line[j])) plane[i].ac = j;
+ }
+ }
+
+ return true;
+}
+
+bool WmcObject::verticesBelongToLine(Vertex *first, Vertex *second, Line l)
+{
+ if ((first == l.a && second == l.b) || (second == l.a && first == l.b))
+ return true;
+
+ return false;
+}
+
+/*******************************************************************
+
+ bool WmcObject::load(const char *filename)
+
+********************************************************************/
+bool WmcObject::load(const char *filename)
+{
+ try
+ {
+ loadVertices(filename);
+ lines = loadLines(filename);
+ planes = loadPlanes(filename);
+ }
+ catch (exception &e)
+ {
+ cout << e.what() << endl;
+ }
+
+ if (!lines && !planes)
+ throw runtime_error("WmcObject::load: no WMCUBE_PLANES or WMCUBE_LINES section found in file.");
+
+ if (planes && lines)
+ mode = SOLID_WIRE;
+ else if (planes)
+ mode = SOLID;
+ else
+ mode = WIREFRAME;
+
+ return true;
+}
+
+/*******************************************************************
+
+ void WmcObject::rotate(int ixang, int iyang, int izang)
+
+ Rotates the object from it's current configuration by ixang, iyang
+ and izang degrees.
+
+********************************************************************/
+void WmcObject::rotate(float ixang, float iyang, float izang)
+{
+ static float xang = 0;
+ static float yang = 0;
+ static float zang = 0;
+ float tx, ty, tz;
+
+ xang = (xang + ixang > PI2) ? xang + ixang - PI2 : xang + ixang;
+ yang = (yang + iyang > PI2) ? yang + iyang - PI2 : yang + iyang;
+ zang = (zang + izang > PI2) ? zang + izang - PI2 : zang + izang;
+
+ for (int i = 0; i < vertex.size(); i++)
+ {
+ tx = cos(yang) * vertex[i].x - sin(yang) * vertex[i].z;
+ tz = sin(yang) * vertex[i].x + cos(yang) * vertex[i].z;
+ ty = cos(zang) * vertex[i].y - sin(zang) * tx;
+
+ rvertex[i].x = cos(zang) * tx + sin(zang) * vertex[i].y;
+ rvertex[i].y = sin(xang) * tz + cos(xang) * ty;
+ rvertex[i].z = cos(xang) * tz - sin(xang) * ty;
+ }
+
+ // Calculate plane color before distorting it with perspective
+ for (int i = 0; i < plane.size(); i++)
+ plane[i].color = luminate(plane[i]);
+
+ // Add perspective
+ for (int i = 0; i < vertex.size(); i++)
+ {
+ rvertex[i].x = 256 * rvertex[i].x / (2 * rvertex[i].z - zoff) + xoff;
+ rvertex[i].y = 256 * rvertex[i].y / (2 * rvertex[i].z - zoff) + yoff;
+ }
+}
+
+/*******************************************************************
+
+ void WmcObject::draw(WMCanvas *icanvas)
+
+ Draws the WmcObject on the WMCanvas icanvas. Defaults to planes if
+ available, otherwise wireframe is used. Buffered mode is used
+ so canvas->display() must be called at the end.
+
+********************************************************************/
+void WmcObject::draw(WMCanvas *icanvas)
+{
+ canvas = icanvas;
+
+ canvas->setbuffered(true);
+
+ switch (mode)
+ {
+ case WIREFRAME:
+ canvas->setcolor((WMColor::WMColor)WIRE_COLOR);
+ for (int i = 0; i < line.size(); i++)
+ canvas->draw_line((int)(line[i].a->x), (int)(line[i].a->y),(int)(line[i].b->x), (int)(line[i].b->y));
+ break;
+
+ case SOLID:
+ sort(plane);
+ for (int i = 0; i < plane.size(); i++)
+ if (visible(plane[i])) drawTriangle(plane[i]);
+ break;
+
+ case SOLID_WIRE:
+ sort(plane);
+ for (int i = 0; i < plane.size(); i++)
+ if (visible(plane[i])) drawTriangle(plane[i], true);
+ break;
+ }
+
+ canvas->display();
+}
+
+/*******************************************************************
+
+ bool WmcObject::visible(Plane p)
+
+ Returns true if the plane is visible (has positive z-component).
+
+********************************************************************/
+bool WmcObject::visible(Plane p)
+{
+ //return normal(p).z > 0.0; // Also works but no need computing x- and y-components
+ return ((p.a->x - p.c->x) * (p.b->y - p.c->y) - (p.b->x - p.c->x) * (p.a->y - p.c->y)) > 0.0;
+}
+
+/*******************************************************************
+
+ Vertex WmcObject::normal(Plane p)
+
+ Returns plane p's normal.
+
+********************************************************************/
+Vertex WmcObject::normal(Plane p)
+{
+ Vertex ret;
+ float x1 = p.a->x - p.c->x, y1 = p.a->y - p.c->y, z1 = p.a->z - p.c->z;
+ float x2 = p.b->x - p.c->x, y2 = p.b->y - p.c->y, z2 = p.b->z - p.c->z;
+ ret.x = y1 * z2 - y2 * z1;
+ ret.y = x2 * z1 - x1 * z2;
+ ret.z = x1 * y2 - y1 * x2;
+
+ return ret;
+}
+
+/*******************************************************************
+
+ float WmcObject::luminate(Plane p)
+
+ Returns the luminousity _DECREASE_ for plane p in the range 0..1.
+ This is based solely on the angle between the plane's normal and
+ the lightsource vector, i.e the distance between the lightsource
+ and plane is _not_ taken into account (which would be easy to fake).
+
+********************************************************************/
+float WmcObject::luminate(Plane p)
+{
+ Vertex pn = normal(p);
+ float sp_pn = sqrt(pn.x * pn.x + pn.y * pn.y + pn.z * pn.z);
+ float sp_lum = sqrt(lightsource.x * lightsource.x + lightsource.y * lightsource.y
+ + lightsource.z * lightsource.z);
+ float pn_lum = pn.x * lightsource.x + pn.y * lightsource.y + pn.z * lightsource.z;
+
+ return invPI * acos((pn_lum / (sp_pn * sp_lum)));
+}
+
+/*******************************************************************
+
+ void WmcObject::sort(vector<Plane> &plane)
+
+ Insertion-sorts a vector of planes by the sum of their z-components.
+
+********************************************************************/
+void WmcObject::sort(vector<Plane> &plane)
+{
+ int i, j, k;
+ float key;
+ float temparr[plane.size()];
+ Plane ptmp;
+
+ for (i = 0; i < plane.size(); i++)
+ temparr[i] = plane[i].a->z + plane[i].b->z + plane[i].c->z;
+
+ for (j = 1; j < plane.size(); j++)
+ {
+ ptmp = plane[j];
+ key = temparr[j];
+ i = j - 1;
+
+ while ((i > -1) && (temparr[i] > key))
+ {
+ plane[i+1] = plane[i];
+ temparr[i+1] = temparr[i];
+ i--;
+ }
+
+ plane[i+1] = ptmp;
+ temparr[i+1] = key;
+ }
+}
+
+/*******************************************************************
+
+ void WmcObject::drawTriangle(Plane p)
+
+ Draws a filled polygon using the builtin routine from wmapp which
+ in turn uses the builtin routine in X. Sadly enough it is uglier
+ than my own original routine due to some corner pixel that gets
+ plotted sometime. Plane color is computed using the global
+ variables colX and colX_dec and 'p.color'.
+
+********************************************************************/
+void WmcObject::drawTriangle(Plane p, bool wire)
+{
+ X::XPoint xp;
+ vector<X::XPoint> points;
+ unsigned char R = 0, G = 0, B = 0;
+ unsigned composit = 0;
+
+ xp.x = (int)p.a->x;
+ xp.y = (int)p.a->y;
+ points.push_back(xp);
+ xp.x = (int)p.b->x;
+ xp.y = (int)p.b->y;
+ points.push_back(xp);
+ xp.x = (int)p.c->x;
+ xp.y = (int)p.c->y;
+ points.push_back(xp);
+
+ R = (unsigned char)(color >> 16);
+ G = (unsigned char)(color >> 8 );
+ B = (unsigned char)(color );
+
+ R -= (unsigned char)((float)R * p.color * shading);
+ G -= (unsigned char)((float)G * p.color * shading);
+ B -= (unsigned char)((float)B * p.color * shading);
+
+ composit = (R << 16) + (G << 8) + B;
+
+ // If the plane is almost purpendicular to the lightsource fake a 'reflex'
+ if (p.color < REFLEX) composit = REFLEX_COLOR;
+
+ canvas->setcolor((WMColor::WMColor)composit);
+ canvas->fill_polygon(points);
+
+ if (!wire) return;
+
+ canvas->setcolor((WMColor::WMColor)WIRE_COLOR);
+
+ if (p.ab > -1)
+ canvas->draw_line((int)(line[p.ab].a->x), (int)(line[p.ab].a->y),
+ (int)(line[p.ab].b->x), (int)(line[p.ab].b->y));
+ if (p.bc > -1)
+ canvas->draw_line((int)(line[p.bc].a->x), (int)(line[p.bc].a->y),
+ (int)(line[p.bc].b->x), (int)(line[p.bc].b->y));
+ if (p.ac > -1)
+ canvas->draw_line((int)(line[p.ac].a->x), (int)(line[p.ac].a->y),
+ (int)(line[p.ac].b->x), (int)(line[p.ac].b->y));
+
+}
diff --git a/wmcube/WmcObject.h b/wmcube/WmcObject.h
new file mode 100644
index 000000000000..cfb8b1fea1b8
--- /dev/null
+++ b/wmcube/WmcObject.h
@@ -0,0 +1,96 @@
+#ifndef _WMCOBJECT_H_
+#define _WMCOBJECT_H_
+
+#include <vector>
+#include "wmapp/wmcanvas.h"
+
+typedef struct { float x, y, z; } Vertex;
+typedef struct { Vertex *a, *b, *c; float color; int ab, bc, ac; } Plane;
+typedef struct { Vertex *a, *b; } Line;
+typedef enum { WIREFRAME, SOLID, SOLID_WIRE, NUM_MODES };
+
+class WmcObject
+{
+public:
+ WmcObject();
+ WmcObject(const char *);
+ ~WmcObject();
+
+ void setMode(int m);
+ void setColorShading(unsigned color, float shading);
+ void rotate(float xang, float yang, float zang);
+ void draw(WMCanvas *icanvas);
+
+ void setYOffset(int pixels);
+ void modifyZOffset(int idepth);
+ void setLightSource(float xc, float yc, float zc);
+
+private:
+
+ bool load(const char *);
+ bool loadVertices(const char *);
+ bool loadPlanes(const char *);
+ bool loadLines(const char *);
+ int freadline(FILE *fp, int maxlen, char *dest);
+ void sort(vector<Plane> &plane);
+ bool visible(Plane p);
+ float luminate(Plane p);
+ Vertex normal(Plane p);
+ void drawTriangle(Plane p, bool wire = false);
+ bool verticesBelongToLine(Vertex *first, Vertex *second, Line l);
+
+ vector<Vertex> vertex;
+ vector<Vertex> rvertex;
+ vector<Plane> plane;
+ vector<Line> line;
+
+ WMCanvas *canvas;
+ Vertex lightsource;
+ bool lines, planes;
+ int xoff, yoff, zoff;
+ int mode;
+ unsigned int color;
+ float shading;
+};
+
+const char default_cube[] =
+{ ""
+"# The original cube by Robert Kling\n"
+"WMCUBE_COORDINATES\n"
+"1 -180 -180 180\n"
+"2 180 -180 180\n"
+"3 180 180 180\n"
+"4 -180 180 180\n"
+"5 -180 -180 -180\n"
+"6 180 -180 -180\n"
+"7 180 180 -180\n"
+"8 -180 180 -180\n"
+"WMCUBE_LINES\n"
+"1 2\n"
+"2 3\n"
+"3 4\n"
+"4 1\n"
+"5 6\n"
+"6 7\n"
+"7 8\n"
+"8 5\n"
+"1 5\n"
+"2 6\n"
+"3 7\n"
+"4 8\n"
+"WMCUBE_PLANES\n"
+"1 2 3\n"
+"1 3 4\n"
+"2 6 7\n"
+"2 7 3\n"
+"5 1 4\n"
+"5 4 8\n"
+"5 2 1\n"
+"5 6 2\n"
+"4 3 8\n"
+"3 7 8\n"
+"6 5 8\n"
+"6 8 7"
+};
+
+#endif
diff --git a/wmcube/cpumoncc/README b/wmcube/cpumoncc/README
new file mode 100644
index 000000000000..3b3da91dfdbe
--- /dev/null
+++ b/wmcube/cpumoncc/README
@@ -0,0 +1,70 @@
+CpuMonitorCC (cpumoncc)
+Version: 0.0.1-pre1 (aka "Expect Things To Be Broken")
+
+(C) Copyright 2003 Robert Kling
+
+robk...@student.luth.se
+http://kling.mine.nu
+
+DESCRIPTION
+
+This is a small library for reading the instantaneous cpu load
+in many different operating systems. It started out as a part of
+wmCube but as it [wmCube] got ported to more and more OS's it
+seemed tidier to put the OS-specific code into its
+on package. As the name implies it is written in C++.
+
+REQUIREMENTS/FEATURES
+
+Supported systems and their features so far are:
+
+ * Darwin - Basic functionality.
+ * FreeBSD - Basic functionality, discarding of 'nice' processes.
+ * Linux - Multiprocessor support, discarding of 'nice' processes.
+ * NetBSD - Basic functionality, discarding of 'nice' processes.
+ * OpenBSD - Basic functionality.
+ * Solaris - Multiprocessor support.
+
+INSTALLATION
+
+Change to the directory of the OS your building cpumoncc for.
+Type (as root):
+
+make install
+
+To build the programs that come with cpumoncc, go into the directory
+'programs' and type
+
+make
+
+and optionally, as root
+
+make install
+
+CONTRIBUTIONS
+
+Solaris codebase by Dan Price (d...@rampant.org)
+OpenBSD codebase by Brian Joseph Czapiga (r...@godsey.net)
+FreeBSD codebase by Tai-hwa Liang (ava...@mmlab.cse.yzu.edu.tw)
+NetBSD codebase by Jared Smolens <jsmo...@andrew.cmu.edu>
+
+I only test cpumoncc thoroughly on Linux so anyone running on a
+different OS/architecture please let me now if there are any bugs
+or if everything's hunky dory. Suggestions, patches, more ports
+etc. are also very welcome.
+
+LICENSE
+
+cpumoncc is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+cpumoncc is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with cpumoncc; if not, write to the Free Software
+Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
diff --git a/wmcube/cpumoncc/base/BaseCpuMonitor.h b/wmcube/cpumoncc/base/BaseCpuMonitor.h
new file mode 100644
index 000000000000..3577c7d5e169
--- /dev/null
+++ b/wmcube/cpumoncc/base/BaseCpuMonitor.h
@@ -0,0 +1,112 @@
+/*
+
+ Copyright (C) 2003 Robert Kling, robk...@student.luth.se
+
+ This file is part of CpuMonitorCC (cpumoncc)
+
+ cpumoncc is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ cpumoncc is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with cpumoncc; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+*/
+
+/*
+
+ This is the base class which all cpu monitors should inherit
+ from. Best is to use one of the existing monitors as a
+ template when writing a new one. By inheriting this base
+ class it can be as simple as implementing just one function
+ to support a new operating system. This function is
+ getLoad() which should return the (average (in the case of
+ a smp-system)) intermediate cpu-load in the range [0.0, 1.0]
+ multiplied by the inherited protected variable 'range'.
+
+*/
+
+#ifndef _BASECPUMONITOR_H_
+#define _BASECPUMONITOR_H_
+
+#include <stdio.h>
+#include <stdexcept>
+
+#define CPUMONCC_VERSION "0.0.1-pre1"
+#define CPUMONCC_DATE "2003-02-14"
+
+using namespace std;
+
+class BaseCpuMonitor
+{
+public:
+
+ BaseCpuMonitor();
+ virtual float getLoad() = 0;
+ void setRange(float);
+ bool saveInternals(const char *);
+ bool loadInternals(const char *);
+
+protected:
+
+ int which_cpu;
+ bool use_nice;
+ int previous_total;
+ int previous_used;
+ float range;
+};
+
+inline BaseCpuMonitor::BaseCpuMonitor()
+{
+ which_cpu = -1;
+ use_nice = true;
+ previous_total = 0;
+ previous_used = 0;
+ // Set default range to percent
+ range = 100.0;
+}
+
+inline void BaseCpuMonitor::setRange(float irange)
+{
+ range = irange;
+}
+
+inline bool BaseCpuMonitor::saveInternals(const char *filename)
+{
+ int count;
+ FILE *fp = fopen(filename, "w");
+
+ if (fp == 0) return false;
+
+ count = fprintf(fp, "%d %d", previous_used, previous_total);
+ fclose(fp);
+
+ if (count != 2) return false;
+
+ return true;
+}
+
+inline bool BaseCpuMonitor::loadInternals(const char *filename)
+{
+ int count;
+ FILE *fp = fopen(filename, "r");
+
+ if (fp == 0) return false;
+
+ count = fscanf(fp, "%d %d", &previous_used, &previous_total);
+ fclose(fp);
+
+ if (count != 2) return false;
+
+ return true;
+}
+
+
+#endif
diff --git a/wmcube/cpumoncc/darwin/CpuMonitor.cc b/wmcube/cpumoncc/darwin/CpuMonitor.cc
new file mode 100644
index 000000000000..b98a8008f1e6
--- /dev/null
+++ b/wmcube/cpumoncc/darwin/CpuMonitor.cc
@@ -0,0 +1,41 @@
+/*
+
+ Copyright (C) 2003 Robert Kling, robk...@student.luth.se
+
+ This file is part of CpuMonitorCC (cpumoncc)
+
+ cpumoncc is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ cpumoncc is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with cpumoncc; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+*/
+
+// CpuMonitorCC/Darwin
+
+#include "CpuMonitor.h"
+
+CpuMonitor::CpuMonitor() : BaseCpuMonitor()
+{
+}
+
+float CpuMonitor::getLoad()
+{
+ float t;
+ double avenrun[3];
+ getloadavg(avenrun, sizeof(avenrun) / sizeof(avenrun[0]));
+
+ // t = 0..100
+ t = 2 * (((5.0*avenrun[0] + 0.5) > 50) ? 50 : (5.0*avenrun[0] + 0.5));
+
+ return range * t / 100.0;
+}
diff --git a/wmcube/cpumoncc/darwin/CpuMonitor.h b/wmcube/cpumoncc/darwin/CpuMonitor.h
new file mode 100644
index 000000000000..d31782027a50
--- /dev/null
+++ b/wmcube/cpumoncc/darwin/CpuMonitor.h
@@ -0,0 +1,39 @@
+/*
+
+ Copyright (C) 2003 Robert Kling, robk...@student.luth.se
+
+ This file is part of CpuMonitorCC (cpumoncc)
+
+ cpumoncc is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ cpumoncc is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with cpumoncc; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+*/
+
+// CpuMonitorCC/Darwin
+
+#ifndef _CPUMONITOR_H_
+#define _CPUMONITOR_H_
+
+#include <stdlib.h>
+#include "BaseCpuMonitor.h"
+
+class CpuMonitor : public BaseCpuMonitor
+{
+public:
+
+ CpuMonitor();
+ float getLoad();
+};
+
+#endif
diff --git a/wmcube/cpumoncc/darwin/Makefile b/wmcube/cpumoncc/darwin/Makefile
new file mode 100644
index 000000000000..2732a39c0668
--- /dev/null
+++ b/wmcube/cpumoncc/darwin/Makefile
@@ -0,0 +1,41 @@
+#####################################################
+#
+# To compile cpumoncc for a different OS/architecture you
+# will need to modify the variablese below to match your system.
+#
+# For system wide installation type (as root):
+#
+# make install
+#
+# This will install the static library in $(LIBINSTALL) and
+# the header files in $(HINSTALL)/cpumoncc.
+#
+#####################################################
+
+CXX=g++
+CXXFLAGS=
+HINSTALL=/usr/include
+LIBINSTALL=/usr/lib
+
+#####################################################
+
+TARGET=libcpumoncc.a
+
+$(TARGET): CpuMonitor.o
+ ar rcs $(TARGET) $^
+
+CpuMonitor.o: copy_base
+
+copy_base:
+ cp ../base/BaseCpuMonitor.h .
+
+install: $(TARGET)
+ mkdir -p $(HINSTALL)/cpumoncc
+ cp *.h $(HINSTALL)/cpumoncc
+ install -m 644 $(TARGET) $(LIBINSTALL)
+
+clean:
+ rm -f *~ core *.o cpu $(TARGET) BaseCpuMonitor.h
+ rm -fr $(HINSTALL)/cpumoncc
+ rm -f $(LIBINSTALL)/$(TARGET)
+
diff --git a/wmcube/cpumoncc/freebsd/CpuMonitor.cc b/wmcube/cpumoncc/freebsd/CpuMonitor.cc
new file mode 100644
index 000000000000..726d33b7d2e3
--- /dev/null
+++ b/wmcube/cpumoncc/freebsd/CpuMonitor.cc
@@ -0,0 +1,80 @@
+/*
+
+ Copyright (C) 2003 Robert Kling, robk...@student.luth.se
+
+ This file is part of CpuMonitorCC (cpumoncc)
+
+ cpumoncc is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ cpumoncc is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with cpumoncc; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+*/
+
+// CpuMonitorCC/FreeBSD
+
+#include "CpuMonitor.h"
+
+CpuMonitor::CpuMonitor() : BaseCpuMonitor()
+{
+ initialize();
+}
+
+CpuMonitor::CpuMonitor(bool nice) : BaseCpuMonitor()
+{
+ use_nice = nice;
+ initialize();
+}
+
+CpuMonitor::~CpuMonitor()
+{
+ kvm_close(kd);
+}
+
+void CpuMonitor::initialize()
+{
+ nlst[0].n_name = "_cp_time";
+ nlst[1].n_name = NULL;
+
+ if ((kd = kvm_open(NULL, NULL, NULL, O_RDONLY, "kvm_open")) == NULL)
+ throw runtime_error("CpuMonitor: unable to open kvm.");
+
+ kvm_nlist(kd, nlst);
+
+ if (nlst[0].n_type == 0)
+ throw runtime_error("CpuMonitor: unable to get nlist.");
+}
+
+float CpuMonitor::getLoad()
+{
+ int total, used;
+ int cpu,nice,system,idle;
+ unsigned long int cpu_time[CPUSTATES];
+ float t;
+
+ if (kvm_read(kd, nlst[0].n_value, &cpu_time, sizeof(cpu_time)) != sizeof(cpu_time))
+ throw runtime_error("CpuMonitor: error reading kvm.");
+
+ cpu = cpu_time[CP_USER];
+ nice = cpu_time[CP_NICE];
+ system = cpu_time[CP_SYS];
+ idle = cpu_time[CP_IDLE];
+
+ used = cpu + system + use_nice*nice;
+ total = used + idle + (1-use_nice)*nice;
+
+ t = range * (float)(used - previous_used) / (float)(total - previous_total);
+ previous_total = total;
+ previous_used = used;
+
+ return t;
+}
diff --git a/wmcube/cpumoncc/freebsd/CpuMonitor.h b/wmcube/cpumoncc/freebsd/CpuMonitor.h
new file mode 100644
index 000000000000..a03ca3f34095
--- /dev/null
+++ b/wmcube/cpumoncc/freebsd/CpuMonitor.h
@@ -0,0 +1,52 @@
+/*
+
+ Copyright (C) 2003 Robert Kling, robk...@student.luth.se
+
+ This file is part of CpuMonitorCC (cpumoncc)
+
+ cpumoncc is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ cpumoncc is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with cpumoncc; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+*/
+
+// CpuMonitorCC/FreeBSD
+
+#ifndef _CPUMONITOR_H_
+#define _CPUMONITOR_H_
+
+#include <kvm.h>
+#include <nlist.h>
+#include <fcntl.h>
+#include <sys/dkstat.h>
+#include "BaseCpuMonitor.h"
+
+class CpuMonitor : public BaseCpuMonitor
+{
+public:
+
+ CpuMonitor();
+ CpuMonitor(bool nice);
+ ~CpuMonitor();
+
+ float getLoad();
+
+private:
+
+ void initialize();
+
+ kvm_t *kd;
+ struct nlist nlst[2];
+};
+
+#endif
diff --git a/wmcube/cpumoncc/freebsd/Makefile b/wmcube/cpumoncc/freebsd/Makefile
new file mode 100644
index 000000000000..9346f23b76a7
--- /dev/null
+++ b/wmcube/cpumoncc/freebsd/Makefile
@@ -0,0 +1,41 @@
+######################################################
+#
+# To compile cpumoncc for a different OS/architecture you
+# will need to modify the variablese below to match your system.
+#
+# For system wide installation type (as root):
+#
+# make install
+#
+# This will install the static library in $(LIBINSTALL) and
+# the header files in $(HINSTALL)/cpumoncc.
+#
+#####################################################
+
+CXX=g++
+CXXFLAGS=-lkvm
+HINSTALL=/usr/include
+LIBINSTALL=/usr/lib
+
+#####################################################
+
+TARGET=libcpumoncc.a
+
+$(TARGET): CpuMonitor.o
+ ar rcs $(TARGET) $^
+
+CpuMonitor.o: copy_base
+
+copy_base:
+ cp ../base/BaseCpuMonitor.h .
+
+install: $(TARGET)
+ mkdir -p $(HINSTALL)/cpumoncc
+ cp *.h $(HINSTALL)/cpumoncc
+ install -m 644 $(TARGET) $(LIBINSTALL)
+
+clean:
+ rm -f *~ core *.o cpu $(TARGET) BaseCpuMonitor.h
+ rm -fr $(HINSTALL)/cpumoncc
+ rm -f $(LIBINSTALL)/$(TARGET)
+
\ No newline at end of file
diff --git a/wmcube/cpumoncc/linux/CpuMonitor.cc b/wmcube/cpumoncc/linux/CpuMonitor.cc
new file mode 100644
index 000000000000..bd4396b6c578
--- /dev/null
+++ b/wmcube/cpumoncc/linux/CpuMonitor.cc
@@ -0,0 +1,100 @@
+/*
+
+ Copyright (C) 2003 Robert Kling, robk...@student.luth.se
+
+ This file is part of CpuMonitorCC (cpumoncc)
+
+ cpumoncc is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ cpumoncc is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with cpumoncc; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+*/
+
+// CpuMonitorCC/Linux
+
+#include <stdio.h>
+#include "CpuMonitor.h"
+
+CpuMonitor::CpuMonitor() : BaseCpuMonitor()
+{
+ initialize();
+}
+
+CpuMonitor::CpuMonitor(int cpu) : BaseCpuMonitor()
+{
+ which_cpu = cpu;
+ initialize();
+}
+
+CpuMonitor::CpuMonitor(int cpu, bool nice) : BaseCpuMonitor()
+{
+ which_cpu = cpu;
+ use_nice = nice;
+ initialize();
+}
+
+void CpuMonitor::initialize()
+{
+ FILE *fp;
+ int i;
+ char cpuid[6];
+ char check_cpu[6];
+ char tmp[32];
+
+ if ((fp = fopen("/proc/stat","r")) == NULL)
+ throw runtime_error("CpuMonitor: no /proc/stat found.");
+
+ if (which_cpu == -1) return;
+
+ snprintf(check_cpu, 6, "cpu%d", which_cpu);
+ //printf("Monitoring %s (%d)\n", check_cpu, which_cpu);
+
+ for (i = -2; i < which_cpu; i++)
+ {
+ fscanf(fp, "%5s %31s %31s %31s %31s", cpuid, tmp, tmp, tmp, tmp);
+ //fscanf(fp, "%5s" , cpuid); printf("%s ", cpuid);
+ //fscanf(fp, "%31s", tmp ); printf("%s ", tmp);
+ //fscanf(fp, "%31s", tmp ); printf("%s ", tmp);
+ //fscanf(fp, "%31s", tmp ); printf("%s ", tmp);
+ //fscanf(fp, "%31s", tmp ); printf("%s\n", tmp); fflush(stdout);
+ }
+
+ if (strcmp(check_cpu, cpuid) != 0)
+ throw runtime_error("CpuMonitor: could not read cpu-load.");
+}
+
+float CpuMonitor::getLoad()
+{
+ int total, used, i;
+ char cpuid[6];
+ int cpu,nice,system,idle;
+ float t;
+ FILE *fp;
+
+ fp = fopen("/proc/stat","r");
+
+ for (i = -2; i < which_cpu; i++)
+ fscanf(fp,"%5s %d %d %d %d", cpuid, &cpu, &nice, &system, &idle);
+
+ fclose(fp);
+
+ used = cpu + system + use_nice * nice;
+ total = used + idle + (1-use_nice) * nice;
+
+ t = range * (float)(used - previous_used) / (float)(total - previous_total);
+ previous_total = total;
+ previous_used = used;
+
+ return t;
+}
+
diff --git a/wmcube/cpumoncc/linux/CpuMonitor.h b/wmcube/cpumoncc/linux/CpuMonitor.h
new file mode 100644
index 000000000000..82bd910fbbd4
--- /dev/null
+++ b/wmcube/cpumoncc/linux/CpuMonitor.h
@@ -0,0 +1,45 @@
+/*
+
+ Copyright (C) 2003 Robert Kling, robk...@student.luth.se
+
+ This file is part of CpuMonitorCC (cpumoncc)
+
+ cpumoncc is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ cpumoncc is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with cpumoncc; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+*/
+
+// CpuMonitorCC/Linux
+
+#ifndef _CPUMONITOR_H_
+#define _CPUMONITOR_H_
+
+#include "BaseCpuMonitor.h"
+
+class CpuMonitor : public BaseCpuMonitor
+{
+public:
+
+ CpuMonitor();
+ CpuMonitor(int cpu);
+ CpuMonitor(int cpu, bool nice);
+
+ float getLoad();
+
+private:
+
+ void initialize();
+};
+
+#endif
diff --git a/wmcube/cpumoncc/linux/Makefile b/wmcube/cpumoncc/linux/Makefile
new file mode 100644
index 000000000000..ebe980a8a1d5
--- /dev/null
+++ b/wmcube/cpumoncc/linux/Makefile
@@ -0,0 +1,40 @@
+######################################################
+#
+# To compile cpumoncc for a different OS/architecture you
+# will need to modify the variablese below to match your system.
+#
+# For system wide installation type (as root):
+#
+# make install
+#
+# This will install the static library in $(LIBINSTALL) and
+# the header files in $(HINSTALL)/cpumoncc.
+#
+#####################################################
+
+CXX=g++
+CXXFLAGS=
+HINSTALL=/usr/include
+LIBINSTALL=/usr/lib
+
+#####################################################
+
+TARGET=libcpumoncc.a
+
+$(TARGET): CpuMonitor.o
+ ar rcs $(TARGET) $^
+
+CpuMonitor.o: copy_base
+
+copy_base:
+ cp ../base/BaseCpuMonitor.h .
+
+install: $(TARGET)
+ mkdir -p $(HINSTALL)/cpumoncc
+ cp *.h $(HINSTALL)/cpumoncc
+ install -m 644 $(TARGET) $(LIBINSTALL)
+
+clean:
+ rm -f *~ core *.o cpu $(TARGET) BaseCpuMonitor.h
+# rm -fr $(HINSTALL)/cpumoncc
+# rm -f $(LIBINSTALL)/$(TARGET)
diff --git a/wmcube/cpumoncc/netbsd/CpuMonitor.cc b/wmcube/cpumoncc/netbsd/CpuMonitor.cc
new file mode 100644
index 000000000000..33d2fb08a0eb
--- /dev/null
+++ b/wmcube/cpumoncc/netbsd/CpuMonitor.cc
@@ -0,0 +1,113 @@
+/*
+
+ Copyright (C) 2003 Robert Kling, robk...@student.luth.se
+
+ This file is part of CpuMonitorCC (cpumoncc)
+
+ cpumoncc is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ cpumoncc is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with cpumoncc; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+*/
+
+// CpuMonitorCC/NetBSD
+
+#include <stdlib.h>
+#include <sys/sched.h>
+#include <sys/param.h>
+#include <sys/sysctl.h>
+#include "CpuMonitor.h"
+
+CpuMonitor::CpuMonitor() : BaseCpuMonitor()
+{
+ for (int i = i < CPUSTATES; i++) last_cp_time[i] = 0;
+}
+
+CpuMonitor::CpuMonitor(bool nice) : BaseCpuMonitor()
+{
+ use_nice = nice;
+ for (int i = i < CPUSTATES; i++) last_cp_time[i] = 0;
+}
+
+float CpuMonitor::getLoad()
+{
+ u_int64_t curr_cp_time[CPUSTATES];
+ u_int64_t total_time = 0, idle_time = 0;
+ int mib[2];
+ int i;
+ size_t ssize;
+ const int IDLE_TIME = 4;
+ const int NICE_TIME = 1;
+
+ ssize = sizeof ( curr_cp_time );
+ mib[0] = CTL_KERN;
+ mib[1] = KERN_CP_TIME;
+
+ if ( sysctl ( mib, 2, curr_cp_time, &ssize, NULL, 0 ) )
+ throw runtime_error("CpuMonitor: unable to read CP_TIME from sysctl()\n");
+
+ if ( !use_nice )
+ curr_cp_time[NICE_TIME] = 0;
+
+ /* NetBSD gives 5 CPUSTATES -
+ * User, Nice, System, Interrupt, Idle
+ */
+ idle_time = curr_cp_time[IDLE_TIME] - last_cp_time[IDLE_TIME];
+ for ( i = 0; i < CPUSTATES; i++ )
+ {
+ total_time += ( curr_cp_time[i] - last_cp_time[i] );
+ last_cp_time[i] = curr_cp_time[i];
+ }
+
+ /* Calculate the % CPU usage as the User+Nice+System+Interrupt/Total
+ * for the interval
+ */
+ return range * (int) ( total_time - idle_time ) / total_time;
+}
+
+/*
+ * Overloads base class
+ */
+bool CpuMonitor::saveInternals(const char *filename)
+{
+ int count = 0;
+ FILE *fp = fopen(filename, "w");
+
+ if (fp == 0) return false;
+
+ for ( i = 0; i < CPUSTATES; i++ )
+ count += fprintf(fp, "%d", last_cp_time[i]);
+
+ fclose(fp);
+
+ if (count != CPUSTATES) return false;
+
+ return true;
+}
+
+bool CpuMonitor::loadInternals(const char *filename)
+{
+ int count = 0;
+ FILE *fp = fopen(filename, "r");
+
+ if (fp == 0) return false;
+
+ for ( i = 0; i < CPUSTATES; i++ )
+ count += fscanf(fp, "%d", &last_cp_time[i]);
+
+ fclose(fp);
+
+ if (count != CPUSTATES) return false;
+
+ return true;
+}
diff --git a/wmcube/cpumoncc/netbsd/CpuMonitor.h b/wmcube/cpumoncc/netbsd/CpuMonitor.h
new file mode 100644
index 000000000000..1be7fd03774a
--- /dev/null
+++ b/wmcube/cpumoncc/netbsd/CpuMonitor.h
@@ -0,0 +1,43 @@
+/*
+
+ Copyright (C) 2003 Robert Kling, robk...@student.luth.se
+
+ This file is part of CpuMonitorCC (cpumoncc)
+
+ cpumoncc is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ cpumoncc is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with cpumoncc; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+*/
+
+// CpuMonitorCC/NetBSD
+
+#ifndef _CPUMONITOR_H_
+#define _CPUMONITOR_H_
+
+#include "BaseCpuMonitor.h"
+
+class CpuMonitor : public BaseCpuMonitor
+{
+public:
+
+ CpuMonitor();
+ CpuMonitor(bool nice);
+ float getLoad();
+
+private:
+
+ u_int64_t last_cp_time[CPUSTATES];
+};
+
+#endif
diff --git a/wmcube/cpumoncc/netbsd/Makefile b/wmcube/cpumoncc/netbsd/Makefile
new file mode 100644
index 000000000000..ccc3b9349ea0
--- /dev/null
+++ b/wmcube/cpumoncc/netbsd/Makefile
@@ -0,0 +1,40 @@
+######################################################
+#
+# To compile cpumoncc for a different OS/architecture you
+# will need to modify the variablese below to match your system.
+#
+# For system wide installation type (as root):
+#
+# make install
+#
+# This will install the static library in $(LIBINSTALL) and
+# the header files in $(HINSTALL)/cpumoncc.
+#
+#####################################################
+
+CXX=g++
+CXXFLAGS=
+HINSTALL=/usr/include
+LIBINSTALL=/usr/lib
+
+#####################################################
+
+TARGET=libcpumoncc.a
+
+$(TARGET): CpuMonitor.o
+ ar rcs $(TARGET) $^
+
+CpuMonitor.o: copy_base
+
+copy_base:
+ cp ../base/BaseCpuMonitor.h .
+
+install: $(TARGET)
+ mkdir -p $(HINSTALL)/cpumoncc
+ cp *.h $(HINSTALL)/cpumoncc
+ install -m 644 $(TARGET) $(LIBINSTALL)
+
+clean:
+ rm -f *~ core *.o cpu $(TARGET) BaseCpuMonitor.h
+ rm -fr $(HINSTALL)/cpumoncc
+ rm -f $(LIBINSTALL)/$(TARGET)
\ No newline at end of file
diff --git a/wmcube/cpumoncc/openbsd/CpuMonitor.cc b/wmcube/cpumoncc/openbsd/CpuMonitor.cc
new file mode 100644
index 000000000000..0287f4ca1858
--- /dev/null
+++ b/wmcube/cpumoncc/openbsd/CpuMonitor.cc
@@ -0,0 +1,42 @@
+/*
+
+ Copyright (C) 2003 Robert Kling, robk...@student.luth.se
+
+ This file is part of CpuMonitorCC (cpumoncc)
+
+ cpumoncc is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ cpumoncc is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with cpumoncc; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+*/
+
+// CpuMonitorCC/OpenBSD
+
+#include <stdlib.h>
+#include "CpuMonitor.h"
+
+CpuMonitor::CpuMonitor() : BaseCpuMonitor()
+{
+}
+
+float CpuMonitor::getLoad()
+{
+ float t;
+ double avenrun[3];
+ getloadavg(avenrun, sizeof(avenrun) / sizeof(avenrun[0]));
+
+ // t = 0..100
+ t = 2 * (((5.0*avenrun[0] + 0.5) > 50) ? 50 : (5.0*avenrun[0] + 0.5));
+
+ return range * t / 100.0;
+}
diff --git a/wmcube/cpumoncc/openbsd/CpuMonitor.h b/wmcube/cpumoncc/openbsd/CpuMonitor.h
new file mode 100644
index 000000000000..911759230851
--- /dev/null
+++ b/wmcube/cpumoncc/openbsd/CpuMonitor.h
@@ -0,0 +1,38 @@
+/*
+
+ Copyright (C) 2003 Robert Kling, robk...@student.luth.se
+
+ This file is part of CpuMonitorCC (cpumoncc)
+
+ cpumoncc is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ cpumoncc is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with cpumoncc; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+*/
+
+// CpuMonitorCC/OpenBSD
+
+#ifndef _CPUMONITOR_H_
+#define _CPUMONITOR_H_
+
+#include "BaseCpuMonitor.h"
+
+class CpuMonitor : public BaseCpuMonitor
+{
+public:
+
+ CpuMonitor();
+ float getLoad();
+};
+
+#endif
diff --git a/wmcube/cpumoncc/openbsd/Makefile b/wmcube/cpumoncc/openbsd/Makefile
new file mode 100644
index 000000000000..b6334cbd62d5
--- /dev/null
+++ b/wmcube/cpumoncc/openbsd/Makefile
@@ -0,0 +1,40 @@
+######################################################
+#
+# To compile cpumoncc for a different OS/architecture you
+# will need to modify the variablese below to match your system.
+#
+# For system wide installation type (as root):
+#
+# make install
+#
+# This will install the static library in $(LIBINSTALL) and
+# the header files in $(HINSTALL)/cpumoncc.
+#
+#####################################################
+
+CXX=g++
+CXXFLAGS=
+HINSTALL=/usr/include
+LIBINSTALL=/usr/lib
+
+#####################################################
+
+TARGET=libcpumoncc.a
+
+$(TARGET): CpuMonitor.o
+ ar rcs $(TARGET) $^
+
+CpuMonitor.o: copy_base
+
+copy_base:
+ cp ../base/BaseCpuMonitor.h .
+
+install: $(TARGET)
+ mkdir -p $(HINSTALL)/cpumoncc
+ cp *.h $(HINSTALL)/cpumoncc
+ install -m 644 $(TARGET) $(LIBINSTALL)
+
+clean:
+ rm -f *~ core *.o cpu $(TARGET) BaseCpuMonitor.h
+ rm -fr $(HINSTALL)/cpumoncc
+ rm -f $(LIBINSTALL)/$(TARGET)
diff --git a/wmcube/cpumoncc/programs/Makefile b/wmcube/cpumoncc/programs/Makefile
new file mode 100644
index 000000000000..3bff6a41a251
--- /dev/null
+++ b/wmcube/cpumoncc/programs/Makefile
@@ -0,0 +1,14 @@
+CXX=g++
+CXXFLAGS=
+TARGET=cpu
+
+all: cpu.cc cpuload.cc
+ $(CXX) $(CXXFLAGS) -o cpu cpu.cc -lcpumoncc
+ $(CXX) $(CXXFLAGS) -o cpuload cpuload.cc -lcpumoncc
+
+install: all
+ cp cpu /usr/bin
+ cp cpuload /usr/bin
+
+clean:
+ rm -f *~ core *.o cpu cpuload /usr/bin/cpu /usr/bin/cpuload
diff --git a/wmcube/cpumoncc/programs/README b/wmcube/cpumoncc/programs/README
new file mode 100644
index 000000000000..7809f2a4efb8
--- /dev/null
+++ b/wmcube/cpumoncc/programs/README
@@ -0,0 +1,17 @@
+These are two small programs that show how to use the cpumoncc library.
+
+The first one, cpu, is a 'state-ful' cpu monitor that returns the average
+cpu load for the elapsed time between now and the last time you
+ran the program. Useful (in a geeky way) in promts for example:
+
+geoff@rama [CPU: 1%] ~/workspace/cpumoncc > ls
+README base darwin freebsd linux netbsd openbsd programs solaris
+geoff@rama [CPU: 4%] ~/workspace/cpumoncc >
+
+This particular prompt is (in bash):
+PS1='\u@\h [CPU: `cpu`%] \w > '
+
+
+The second program, cpuload, is a simple text mode cpu monitor.
+
+To build these programs type 'make'. To install, type, as root, 'make install'.
\ No newline at end of file
diff --git a/wmcube/cpumoncc/programs/cpu.cc b/wmcube/cpumoncc/programs/cpu.cc
new file mode 100644
index 000000000000..993d3d8f403f
--- /dev/null
+++ b/wmcube/cpumoncc/programs/cpu.cc
@@ -0,0 +1,56 @@
+/*
+
+ cpu.cc v0.0.1
+
+ Copyright (C) 2003 Robert Kling, robk...@student.luth.se
+
+ This file is part of CpuMonitorCC (cpumoncc)
+
+ cpumoncc is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ cpumoncc is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with cpumoncc; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+*/
+
+/*
+ * Note that this program will compile for all on os's supported
+ * by cpumoncc altough it will only function properly on the
+ * os's with a valid implementation of load/saveInternals. With
+ * version 0.0.1-pre1 of cpumoncc they are lacking for OpenBSD
+ * and Darwin. cpumoncc must be installed for this program to
+ * compile.
+ */
+
+#include <stdio.h>
+#include <string.h>
+#include <cpumoncc/CpuMonitor.h>
+
+char filename[256];
+
+FILE *fp;
+CpuMonitor *cpu = new CpuMonitor();
+
+int main()
+{
+ // Necessary monitor internals will be saved in /home/username/.cpu
+ strncpy(filename, getenv("HOME"), 245);
+ strncat(filename, "/.cpu", 6);
+
+ cpu->loadInternals(filename);
+ printf("%.0f", cpu->getLoad());
+ cpu->saveInternals(filename);
+
+ delete cpu;
+
+ return 0;
+}
diff --git a/wmcube/cpumoncc/programs/cpuload.cc b/wmcube/cpumoncc/programs/cpuload.cc
new file mode 100644
index 000000000000..65f4d21f2632
--- /dev/null
+++ b/wmcube/cpumoncc/programs/cpuload.cc
@@ -0,0 +1,60 @@
+/*
+
+ cpuload.cc v0.0.1
+
+ Copyright (C) 2003 Robert Kling, robk...@student.luth.se
+
+ This file is part of CpuMonitorCC (cpumoncc)
+
+ cpumoncc is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ cpumoncc is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with cpumoncc; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+*/
+
+#include <stdio.h>
+#include <string.h>
+#include <unistd.h>
+#include <iostream>
+#include <cpumoncc/CpuMonitor.h>
+
+#define U_POLL_INTERVAL 500000
+
+char filename[256];
+
+FILE *fp;
+CpuMonitor *cpumon = new CpuMonitor();
+
+int prev_used, prev_total;
+
+int main()
+{
+ while (1)
+ {
+ try
+ {
+ printf("\rLoad: %.2f%% ", cpumon->getLoad()); fflush(stdout);
+ }
+ catch (exception e)
+ {
+ cout << e.what();
+ return -1;
+ }
+
+ usleep(U_POLL_INTERVAL);
+ }
+
+ delete cpumon;
+
+ return 0;
+}
diff --git a/wmcube/cpumoncc/solaris/CpuMonitor.cc b/wmcube/cpumoncc/solaris/CpuMonitor.cc
new file mode 100644
index 000000000000..b26cef6c50f9
--- /dev/null
+++ b/wmcube/cpumoncc/solaris/CpuMonitor.cc
@@ -0,0 +1,141 @@
+/*
+
+ Copyright (C) 2003 Robert Kling, robk...@student.luth.se
+
+ This file is part of CpuMonitorCC (cpumoncc)
+
+ cpumoncc is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ cpumoncc is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with cpumoncc; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+*/
+
+// CpuMonitorCC/Solaris
+
+#include "CpuMonitor.h"
+
+CpuMonitor::CpuMonitor() : BaseCpuMonitor()
+{
+ initialize();
+}
+
+CpuMonitor::CpuMonitor(int cpu) : BaseCpuMonitor()
+{
+ which_cpu = cpu;
+ initialize();
+}
+
+void CpuMonitor::initialize()
+{
+ kstat_t *ksp;
+ int i = 0;
+
+ if (kc == NULL)
+ if ((kc = kstat_open()) == NULL)
+ throw runtime_error("CpuMonitor: can't open /dev/kstat.");
+
+ if (which_cpu != -1)
+ {
+ /*
+ * User selected to monitor a particlur CPU. Find it...
+ */
+ for (ksp = kc->kc_chain; ksp; ksp = ksp->ks_next)
+ if ((strcmp(ksp->ks_module, "cpu_stat") == 0) && (ksp->ks_instance == which_cpu))
+ {
+ the_cpu = ksp;
+ break;
+ }
+ if (the_cpu == NULL) throw runtime_error("CpuMonitor: Cpu not found.");
+ }
+ else
+ {
+ /*
+ * User selected to monitor all CPUs. First, count them.
+ */
+ for (ksp = kc->kc_chain; ksp; ksp = ksp->ks_next)
+ if (strcmp(ksp->ks_module, "cpu_stat") == 0) i++;
+
+ if (cpu_ksp_list) free(cpu_ksp_list);
+
+ cpu_ksp_list = (kstat_t **) calloc(i * sizeof (kstat_t *), 1);
+ ncpus = i;
+
+ /*
+ * stash the ksp for each CPU.
+ */
+ i = 0;
+ for (ksp = kc->kc_chain; ksp; ksp = ksp->ks_next)
+ if (strcmp(ksp->ks_module, "cpu_stat") == 0)
+ {
+ cpu_ksp_list[i] = ksp;
+ i++;
+ }
+ }
+}
+
+float CpuMonitor::getLoad()
+{
+ int i;
+ cpu_stat_t stat;
+ int used, total, user = 0, wait = 0, kern = 0, idle = 0;
+ float t;
+
+ /*
+ * Read each cpu's data. If the kstat chain has changed (a state change
+ * has happened, maybe a new cpu was added to the system or one went
+ * away), then reinitialize everything with initialize(). Finally,
+ * recursively call getLoad().
+ *
+ * We'll need to do a little better than this in the future, since we
+ * could recurse too much in the pathological case here.
+ */
+ if (which_cpu == -1)
+ {
+ for (i = 0; i < ncpus; i++)
+ {
+ if (kstat_read(kc, cpu_ksp_list[i], (void *)&stat) == -1)
+ {
+ // Dont try-catch, let the caller of first getLoad() do that
+ initialize();
+
+ return getLoad();
+ }
+ user += stat.cpu_sysinfo.cpu[CPU_USER]; /* user */
+ wait += stat.cpu_sysinfo.cpu[CPU_WAIT]; /* io wait */
+ kern += stat.cpu_sysinfo.cpu[CPU_KERNEL]; /* sys */
+ idle += stat.cpu_sysinfo.cpu[CPU_IDLE]; /*idle("free")*/
+ }
+ }
+ else
+ {
+ if (kstat_read(kc, the_cpu, (void *)&stat) == -1)
+ {
+ // Dont try-catch, let the caller of first getLoad() do that
+ initialize();
+
+ return getLoad();
+ }
+ user += stat.cpu_sysinfo.cpu[CPU_USER]; /* user */
+ wait += stat.cpu_sysinfo.cpu[CPU_WAIT]; /* io wait */
+ kern += stat.cpu_sysinfo.cpu[CPU_KERNEL]; /* sys */
+ idle += stat.cpu_sysinfo.cpu[CPU_IDLE]; /* idle("free") */
+ }
+
+ used = user + wait + kern;
+ total = used + idle;
+ t = range * (float)(used - previous_used) / (float)(total - previous_total);
+ previous_total = total;
+ previous_used = used;
+
+ return t;
+}
diff --git a/wmcube/cpumoncc/solaris/CpuMonitor.h b/wmcube/cpumoncc/solaris/CpuMonitor.h
new file mode 100644
index 000000000000..5a1f00c57478
--- /dev/null
+++ b/wmcube/cpumoncc/solaris/CpuMonitor.h
@@ -0,0 +1,53 @@
+/*
+
+ Copyright (C) 2003 Robert Kling, robk...@student.luth.se
+
+ This file is part of CpuMonitorCC (cpumoncc)
+
+ cpumoncc is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ cpumoncc is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with cpumoncc; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+*/
+
+// CpuMonitorCC/Solaris
+
+#ifndef _CPUMONITOR_H_
+#define _CPUMONITOR_H_
+
+#include <sys/types.h>
+#include <sys/sysinfo.h>
+#include <kstat.h>
+#include "BaseCpuMonitor.h"
+
+class CpuMonitor : public BaseCpuMonitor
+{
+public:
+
+ CpuMonitor();
+ CpuMonitor(int cpu);
+ ~CpuMonitor();
+
+ float getLoad();
+
+private:
+
+ void initialize();
+
+ kstat_ctl_t *kc;
+ kstat_t **cpu_ksp_list;
+ kstat_t *the_cpu;
+ int ncpus;
+};
+
+#endif
diff --git a/wmcube/cpumoncc/solaris/Makefile b/wmcube/cpumoncc/solaris/Makefile
new file mode 100644
index 000000000000..84d09e318a28
--- /dev/null
+++ b/wmcube/cpumoncc/solaris/Makefile
@@ -0,0 +1,40 @@
+######################################################
+#
+# To compile cpumoncc for a different OS/architecture you
+# will need to modify the variablese below to match your system.
+#
+# For system wide installation type (as root):
+#
+# make install
+#
+# This will install the static library in $(LIBINSTALL) and
+# the header files in $(HINSTALL)/cpumoncc.
+#
+#####################################################
+
+CXX=g++
+CXXFLAGS=-L/opt/sfw/lib -L/usr/local/lib -R/opt/sfw/lib -R/usr/local/lib -lkstat
+HINSTALL=/usr/include
+LIBINSTALL=/usr/lib
+
+#####################################################
+
+TARGET=libcpumoncc.a
+
+$(TARGET): CpuMonitor.o
+ ar rcs $(TARGET) $^
+
+CpuMonitor.o: copy_base
+
+copy_base:
+ cp ../base/BaseCpuMonitor.h .
+
+install: $(TARGET)
+ mkdir -p $(HINSTALL)/cpumoncc
+ cp *.h $(HINSTALL)/cpumoncc
+ install -m 644 $(TARGET) $(LIBINSTALL)
+
+clean:
+ rm -f *~ core *.o cpu $(TARGET) BaseCpuMonitor.h
+ rm -fr $(HINSTALL)/cpumoncc
+ rm -f $(LIBINSTALL)/$(TARGET)
\ No newline at end of file
diff --git a/wmcube/COPYING b/wmcube/wmapp/COPYING
similarity index 98%
rename from wmcube/COPYING
rename to wmcube/wmapp/COPYING
index a43ea2126fb6..5197aeee3ac7 100644
--- a/wmcube/COPYING
+++ b/wmcube/wmapp/COPYING
@@ -2,7 +2,7 @@
Version 2, June 1991

Copyright (C) 1989, 1991 Free Software Foundation, Inc.
- 675 Mass Ave, Cambridge, MA 02139, USA
+ 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.

@@ -279,7 +279,7 @@ POSSIBILITY OF SUCH DAMAGES.

END OF TERMS AND CONDITIONS

- Appendix: How to Apply These Terms to Your New Programs
+ How to Apply These Terms to Your New Programs

If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
@@ -291,7 +291,7 @@ convey the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.

<one line to give the program's name and a brief idea of what it does.>
- Copyright (C) 19yy <name of author>
+ Copyright (C) yyyy <name of author>

This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -305,14 +305,15 @@ the "copyright" line and a pointer to where the full notice is found.

You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+

Also add information on how to contact you by electronic and paper mail.

If the program is interactive, make it output a short notice like this
when it starts in an interactive mode:

- Gnomovision version 69, Copyright (C) 19yy name of author
+ Gnomovision version 69, Copyright (C) year name of author
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
diff --git a/wmcube/wmapp/Changelog b/wmcube/wmapp/Changelog
new file mode 100644
index 000000000000..fe9961f60816
--- /dev/null
+++ b/wmcube/wmapp/Changelog
@@ -0,0 +1,82 @@
+Changelog for WMApp
+
+Version Changes
+------- -------
+0.0.4.1 * Bug fixes for 0.0.4:
+ * remove stray inline keyword from wmwidget.cc
+ * fix masking of shaped widgets in a non-transparent frame
+ * fix interpolation in WMEllipse::draw_border()
+ * remove WMCanvas::copy_buffer(); use WMCanvas::display()
+ instead
+ * make planes in example2/wmradar.cc still light up when
+ speed == 0; other cosmetic changes
+ * fix indentation in xwrapper.cc
+
+0.0.4 * this version of WMApp brought to you by Jason (see
+ Changelog.Jason for greater detail)
+ * Improve consistency by changing header #include statements
+ and class inheritance tree in places
+ * Add draw_arc() and fill_arc() functions to XWrapper and
+ WMCanvas classes
+ * Add WMWidget::contains() function and give each pixmap its
+ own GC to make creation of shaped widgets easier
+ * Add WMClickable base class
+ * Add WMEllipse base class: places its contents in an ellipse
+ when inherited from
+ * Replace Color typedef with Color class, adding useful
+ Color::alpha_blend() static function
+ * New example game, wmatc (WM Air Traffic Control), to
+ illustrate integration of several widgets
+ * Fix bug that forced a need for setaspectratios() to always
+ be called, even in case with only one child widget
+
+0.0.3 * Makefile simplification by Jason
+ * Tidy up the internals of WMCallback class, by Jason
+ * Each widget now has its own .h and .cc files for better
+ source code modularity (delete the ones you don't need)
+ * Additions of WMCanvas draw_lines(), fill_polygon() methods
+ by Jason
+ * Addition of buffered drawing mode for WMCanvas
+ * Optimization of WMImage real_display() function
+ * Clean up code for WMCanvas now that WMImage::icon() is
+ the same size as the widget sans border
+
+0.0.2 * Addition of WMMouseClick::relative_to(WMWidget), allowing
+ to more easily find the location of a mouseclick within
+ a widget.
+ * Added b_* functions, giving coordinates of that part of a
+ widget contained inside its border.
+ * Break up the example program into different files for
+ clarity.
+ * Fix problem with WMImage not displaying background color
+ in some circumstances.
+ * Renamed some member functions for greater consistency
+ (setcallback() -> addcallback(), for instance)
+ * Changed API for timed interval functions in WMWindow.
+ * The order in which the two prototypes of callback functions
+ are executed may now be interleaved.
+ * Add a WMCanvas widget for drawing purposes; the wmexample
+ program (file example/window1.cc) shows how it may be used.
+ * Update FAQ.
+
+0.0.1 * New widget: WMSlider
+ * Buttons now depress when clicked upon.
+ * Any widget can now have a border, not just a WMFrame.
+ * Now easy to determine which mouse button was clicked.
+ * Widgets other than WMButton and WMWindow can have
+ callbacks attached; see new FAQ.txt for details.
+ * Changes by Jason: (see Changelog.Jason for details)
+ * Fixed X resource leak
+ * Changed all instances of "NULL" to "0"
+ * Removed redundant constructors
+ * Cleaned up some code formatting
+
+0.0.0.20020502 * Added Changelog, small edits to README
+ * Sample program now called wmexample
+
+0.0.0.20020501 * Merged Jason's additions of WMHistory and WMMeterBar
+
+0.0.0.20011212 * First version of library in a usable form
+
+-Kevin B. McCarty <kmcc...@princeton.edu>
+
diff --git a/wmcube/wmapp/Changelog.Jason b/wmcube/wmapp/Changelog.Jason
new file mode 100644
index 000000000000..dca2522b3122
--- /dev/null
+++ b/wmcube/wmapp/Changelog.Jason
@@ -0,0 +1,154 @@
+2003-01-05
+
+ * example2/wmradar.cc: Make planes still light up when speed == 0 (oops).
+ Other cosmetic changes.
+
+ * wmellipse.cc (draw_border(...)): Fix interpolation.
+
+ * wmwllipse.h: Remove obsolete comment.
+
+ * wmframe.cc: Fix masking when frame isn't transparent.
+
+ * wmframe.h: Add clipping mask data member. Move clip() to wmframe.cc.
+
+ * xwrapper.cc (draw_horizontal_gradient,draw_vertical_gradient):
+ Reformat indentation (it was so ugly!).
+
+ * FAQ.txt: Remove notes about ellipse/frame clipping bugs.
+
+ * wmcanvas.cc: Note that copy_buffer() is just a partial reimplementation
+ of WMImage::real_display(). So wBuffered is really just a class-wide
+ dodisplay setting. As such, replace calls to copy_buffer() with
+ display(). Might want to rename some things in light of this, as well as
+ remove copy_buffer().
+
+Some other days:
+
+ * example2/{wmradar.cc,wmradar.h,wmairtrafficcontrol.cc}: New example game
+ demonstrating the integration of several widgets.
+
+2002-12-28
+
+ * wmclickable.h: New class for clickable widgets.
+
+ * wmwindow.h wmframe.h, wmframe.cc, wmcallback.h: Use WMClickable.
+
+2002-12-21
+
+ * wmapp.cc: WMFrameBorderBright is too dim. Other dockapps look like
+ they use 0xC8C[38]C8.
+
+ * xwrapper.h, xwrapper.cc: Give each pixmap its own GC, and set clipping
+ mask to dest.mask if it's there. Enables me to remove kludgy use_mask().
+
+ * wmimage.cc, wmapp.cc, wmapp.h, wmcanvas.cc: Remove use_mask().
+
+ * wmimage.h, wmimage.cc: New function seticon(bool) to set a blank
+ b_width() by b_height() icon.
+
+ * wmcanvas.h, wmcanvas.cc: New functions draw_arc() and fill_arc().
+
+2002-12-20
+
+ * wmellipse.h, wmellipse.cc: New class WMEllipse, places its contents in
+ an ellipse.
+
+ * wmwidget.h: Add contains() function to WMWidget. This enables the
+ creation of arbitrarily shaped viewports, in the style of WMEllipse.
+
+ * wmapp.h, wmapp.cc: Add use_mask() function, to muck with GC masking.
+ Needed so that WMEllipse is humanly possible.
+ Whenever drawing to the window, call app()->use_mask(true). When
+ drawing on any other pixmap, call use_mask(false). Default setting is
+ true. A better solution would be to have one GC for each window, and a
+ single GC for everything else.
+
+ * wmimage.cc, wmcanvas.cc: Modify to use use_mask.
+
+ * xwrapper.h, xwrapper.cc: New functions draw_arc() and fill_arc().
+
+ * wmwidget.h, various: Put back WMFrame for parent().
+
+ * Widgets.txt: Update.
+
+2002-12-19
+
+ * xwapper.h: Fix header inclusion order problems. Now you can
+ #include "xwrapper.h" anywhere you like.
+
+ * wmframe.h, wmframe.cc: Simplify and improve consistency by inheriting
+ from WMCallback.
+
+ * wmwindow.h: Only inherit from WMFrame.
+
+ * various: Reorder #include statements to include only necessary files.
+ Use WMWidget* instead of WMFrame* for parent().
+
+ * Makefile, example/Makefile: Tweak.
+
+2002-05-08
+
+ * xwrapper.cc:
+ "Fixed" X memory leak caused by repetitive calls to XAllocColor. <rant>
+ Bizarrly, there doesn't appear to be a way to get the colormap index of an
+ RGB color without allocating it. Ideally, you would only allocate each color
+ once, but the only apparent way to do this is to keep your own custom
+ colormap with reference counts, since X won't tell you the index of a color
+ without allocating it. And without reference counts, the only way to keep
+ from allocating repeatedly is to deallocate after each allocation. But this
+ means that you're using colors which haven't been allocated. Realistically,
+ this doesn't matter except in 8 bit mode, where there aren't enough colors
+ for the spectrum-style WMMeterBar. In order to display well in 8 bit mode,
+ it seems that major color management is necessary, as X is far too stupid to
+ do it for us. Maybe I should look at Berlin again. </rant>
+
+2002-05-07
+
+ * wmwidgets.cc, wmwidgets.h, wmapp.h, wmextras.h xwrapper.cc,
+ example/wmexample.cc, FAQ.txt:
+ Removed all pointer comparisons/assignments to NULL. NULL isn't type-safe,
+ and in C++, "if (ptr != NULL)" is the same as "if (ptr)" because "No object
+ is allocated with the address 0" (Stroustrup 88).
+
+ * wmapp.cc, wmwidgets.cc:
+ Removed more redundant constructor calls.
+
+ * wmwidgets.cc, wmwidgets.h:
+ - Slight formatting fix again.
+ - Wrote a destructor for WMWindow to deallocate its pixmaps.
+ - Made initpixmaps() be called only once for each window. This fixes a
+ memory leak in X that occurred when switching windows.
+
+ * wmapp.cc, wmapp.h:
+ - Wrote a short destructor to deallocate windows (probably unnecessary).
+ - delete[]'d character arrays after XSetClassHint().
+
+ * xwrapper.cc, xwrapper.h:
+ Wrote a free_pixmap() function to complement create_pixmap (don't call
+ create_pixmap() on an existing pixmap without freeing it first!).
+
+2002-05-06
+
+ * xwrapper.cc:
+ - Cleaned up get_point() a little.
+ - Added simple deallocation in Xwrapper::~Xwrapper ().
+
+ * wmapp.cc:69
+ Removed redundant assignment to static Xwrapper object after it was
+ already constructed (which caused my previous modification to crash due to
+ the destructor being called twice).
+
+ * wmwidgets.txt:
+ Added WMSlider to the class hierarchy and removed tabs.
+
+ * wmextras.h:
+ Removed redundant calls to base class constructors and members.
+
+2002-05-05
+
+ * wmextras.cc:
+ Merged slider_click() and slider_scroll() into one, simpler/more readable
+ function.
+
+ * wmwidgets.cc:
+ Cleaned up my formatting a little.
diff --git a/wmcube/wmapp/FAQ.txt b/wmcube/wmapp/FAQ.txt
new file mode 100644
index 000000000000..dd87cf893a9d
--- /dev/null
+++ b/wmcube/wmapp/FAQ.txt
@@ -0,0 +1,278 @@
+WMApp DockApp Library -- FAQ
+
+Starred items below are new or significantly updated for the latest release
+of WMApp, 0.0.4, or bug-fix release 0.0.4.1.
+
+1. Widget Layout
+ 1.1. Can I specify widget positions in absolute coordinates?
+ *1.2. Help! My layout is all messed up!
+ 1.3. Widgets that are all supposed to be the same size aren't.
+ 1.4. How do I keep a frame from having transparent padding?
+
+2. Callbacks and timed-execution functions
+ 2.1. How do I write a callback function?
+ 2.2. Can I attach a callback to widgets other than the WMButton?
+ 2.3. Which mouse button was pressed?
+ 2.4. At what location was the widget clicked?
+ 2.5. What is the story with callbacks on a WMWindow? (a.k.a.
+ executing functions at regular intervals)
+
+3. Specific widget questions
+ *3.1. How to use a WMCanvas?
+ *3.2. How to use a WMEllipse?
+ *3.3. How to create other shapes of widget?
+
+4. Memory issues
+ 4.1. Why do I get a (segmentation fault | runtime error saying "pure
+ virtual function called") in my program?
+
+1.1. Can I specify widget positions in absolute coordinates?
+
+Yes, if you really must.
+
+Make sure the widget fits inside its parent widget, or there will probably be
+a mess. The easiest way to do this is probably to set its position relative
+to its parent's:
+
+ widget.setposition(WMRectangle(parent.left()+wleft, parent.top()+wtop,
+ wwidth, wheight));
+
+where wleft, wtop are the desired coordinates of the widget relative to the
+top left corner of its parent. Remember that the 56x56 pixel WMWindow will
+have a different offset in Afterstep vs. WindowMaker mode, so at least
+operate relative to a previously declared WMWindow in all of your coordinates.
+
+If you are using both absolute positioning and automatic layout with
+setaspectratios(), you may get unexpected results. See 1.3 for a better way.
+
+1.2. Help! My layout is all messed up!
+
+Always lay out widgets in the order from parent to child:
+
+ window.addchild(frame1);
+ window.addchild(frame2);
+ window.setaspectratios(2, 3);
+
+ frame1.addchild(textbar);
+ frame1.addchild(led);
+ frame1.addchild(meterbar);
+ textbar.setwidth(24);
+ frame1.setaspectratios(0, 4, 1);
+ // etc.
+
+Always set the border and padding for a frame before calling setaspectratios()
+on it. [As of WMApp 0.0.4, you no longer have to call setaspectratios()
+explicitly when a frame has only one child, or when you want all children of a
+frame to be of equal size.] And don't forget that borders around any widgets
+are included in their dimensions.
+
+1.3. Widgets that are all supposed to be the same size aren't.
+
+This is due to rounding in the process of setting widget aspect ratios.
+All accumulated rounding error ends up on the last widget in the frame.
+(TODO: spread out the rounding error more evenly)
+
+If you are a stickler for accuracy, you can draw your widget layout on
+a 56x56 grid. Use the grid to determine the exact sizes, then in all calls
+to setaspectratios(), use these sizes.
+
+1.4. How do I keep a frame from having transparent padding?
+
+ frame.settransparency(false);
+
+Note: In order for a frame to _have_ transparent padding, its border thickness
+must also be zero.
+
+2.1. How do I write a callback function?
+
+There are two types of callback, with the prototypes
+
+ void callback1(const WMApp *a, void *data)
+ void callback2(const WMApp *a, WMWidget *w, void *data)
+
+First you write a function with one of these prototypes. For instance,
+to exit the application, the callback function is simply
+
+ void halt(const WMApp *a, void *) { a->stop(); }
+
+Any additional data needed by the callback function may be passed as a pointer
+to void. For convenience, you may pass in the address of one WMWidget to the
+second callback prototype without dealing with pointers to void. Dynamic
+casting in the body of the callback function may be necessary; see the example
+program code in example/window0.cc for details.
+
+Given this, you may attach callbacks to a WMButton or other WMCallback object
+as follows:
+
+ button.addcallback(stop, 0 /* no additional data needed */);
+ button.addcallback(another_callback, &other_widget, &some_data);
+
+(Notice that the name changed from setcallback to addcallback!)
+When a WMButton is pressed, all the callbacks will be executed in the order
+in which they were attached.
+
+2.2. Can I attach a callback to widgets other than the WMButton or WMWindow?
+
+Yes! Define a new class that inherits from both the desired widget and from
+WMCallback. For example, the following code lets you clear a WMHistory
+widget by clicking on it.
+
+Note: if you are using a pointer to the inherited class as the "void *"
+argument of a callback function, be sure to first statically cast it to a
+"WMWidget *". Dynamic casts from "void *" aren't guaranteed to work in C++.
+
+ // Define the new class
+ class WMHistoryCallback : public WMCallback, public WMHistory {
+ public: WMHistoryCallback() : WMCallback(), WMHistory() { }
+ };
+
+ // Callback to clear a WMHistory widget when it's clicked on
+ void clearhistory(const WMApp *a, WMWidget *w, void *)
+ {
+ WMHistoryCallback *h = dynamic_cast<WMHistoryCallback *>(w);
+
+ // check that dynamic_cast doesn't return null pointer! maybe you
+ // even want "assert(h)" instead of "if (h)"
+ if (h) h->clear();
+ }
+
+ int main(int argc, char **argv)
+ {
+ WMApp::initialize(argc, argv);
+
+ WMHistoryCallback h;
+ h.addcallback(clearhistory, &h, 0);
+ // ...
+ }
+
+2.3. Which mouse button was pressed?
+
+This can be retrieved from the application class. The following code
+fragment is a callback that will execute only when mouse button 1 is
+released:
+
+ void callback(WMApp *a, void *)
+ {
+ if (a->mouseclick().button != Button1) return;
+ // body of function goes here
+ }
+
+Recall that in most cases (if XFree86 has been set up correctly), the "up" and
+"down" directions of a mouse scroll wheel correspond to Button4 and Button5.
+But don't forget while designing your program interface that not everyone has a
+scroll-wheel mouse!
+
+2.4. At what location was the widget clicked?
+
+Position of the mouse click relative to the _application_ may be retrieved
+within a callback via a->mouseclick().x and a->mouseclick().y . Note that
+these are the coordinates of the cursor when the mouse button is _released_,
+which is when the callbacks are executed. To make these coordinates useful,
+you probably want to use a->mouseclick().relative_to(w).x and .y, where w is a
+pointer to the widget executing the callback. This gives the coordinates
+of the mouseclick relative to the left and top bounds of the widget. You
+can get the coordinates relative only to the part of the widget INSIDE its
+border using the b_relative_to() function.
+
+The most recent mouse button release may also be examined outside any callback
+functions. Keep in mind that this will not necessarily correspond to the
+execution of any callback functions, since the mouse may have been clicked
+over a widget with no callbacks.
+
+2.5. What is the story with callbacks on a WMWindow? (a.k.a. executing
+functions at regular intervals)
+
+In version 0.0.1, there existed a WMWindow::setcallback() method. This
+actually didn't set callbacks, but instead set functions to execute at regular
+intervals (for use in clocks, timing out internet connections, etc.). Since
+the name was confusing, in 0.0.2 I've replaced it by the
+WMWindow::add_timed_function() method.
+
+As with callbacks, there are two types of possible timed-execution functions:
+
+ void timed_function1(WMApp *, WMWidget *);
+ void timed_function2(WMApp *, WMWidget *, void * data);
+
+They should be attached to a window as follows:
+
+ window.add_timed_function(period, timed_function1, &some_data);
+ window.add_timed_function(period, timed_function2, &a_widget, &data);
+
+where "period" is an integer that specifies how often the timed-execution
+function should run, in centiseconds (e.g. to run a function every 5 seconds,
+use a period of 500). You can change this base time interval of 10 millisec
+using the WMWindow::setupdatefreq() member function.
+
+Of course, these regular intervals are not exact, since they do not take into
+account the times needed to redraw widgets, execute callback functions, and
+execute the timed-execution functions themselves. Don't rely on them for
+air traffic control. (Of course, Jason went ahead and did just that --
+see the code in the example2 directory, or just "make wmatc")
+
+For an example use, see the code for the clock in example/window0.cc.
+
+3.1. How to use a WMCanvas?
+
+The canvas widget may be used in two modes: buffered and unbuffered. To
+switch between them: wmcanvas_ptr->setbuffered(true) [or false, whichever].
+In unbuffered mode (the default), any drawings upon the widget will immediately
+be copied to the WMWindow pixmap, and will show up the next time the
+WMApp::repaint() method is called. In buffered mode, changes to the WMCanvas
+will not be copied to the WMWindow's pixmap until the WMCanvas::display()
+method is called. The advantage to buffered mode is that it uses less CPU
+and it lets you make a number of changes that display all at once.
+
+There are a number of drawing functions available. WMCanvas is stateful, so
+you must set the drawing color with WMCanvas::setcolor each time you want to
+draw in a different color. Having set the desired color (if unset, it defaults
+to the traditional WMApp foreground turquoise-ish color), you may use various
+drawing methods. The x and y coordinates in these drawing methods are always
+relative to the INSIDE of the WMCanvas widget (i.e. not including the border).
+
+setcolor(Color c)
+ Set the current drawing color to c.
+draw_point(int x, int y)
+ Draw a [1-pixel wide] point at position (x,y).
+draw_line(int x1, int y1, int x2, int y2)
+ Draw a line from (x1,y1) to (x2,y2).
+draw_lines(const vector<X::XPoint> & points)
+ Draw a set of connected lines (think connect-the-dots) from point to
+ point.
+
+The full list of drawing methods may of course be found in wmcanvas.h.
+For a somewhat trivial example use of a WMCanvas with an attached callback
+function (the world's dumbest paint program), see the code located in
+example1/window1.cc. A more interesting use is prototyped in
+example2/wmradar.h.
+
+3.2. How to use a WMEllipse?
+
+To create an elliptical widget, make a new class that inherits from both the
+desired widget and from the WMEllipse. This will usually work trivially as
+shown in the two example programs.
+
+3.3. How to create other shapes of widget?
+
+Using wmellipse.h and wmellipse.cc as models, you just have to write a
+"contains" method that specifies which points are inside the borders of
+your shape, and a "draw_border" method that tells how to draw a border for
+your shape. Inherit from both your shape and from some WMWidget. Clipping,
+execution of callbacks when the mouse is clicked inside your shape, and so on,
+will be done automagically by the library.
+
+4.1. Why do I get a (segmentation fault | runtime error saying "pure virtual
+function called") in my program?
+
+If you write a function that returns a WMFrame or WMWindow complete with
+all its child widgets set up, the child widgets must have been either declared
+static inside that function, or else allocated on the heap with "new".
+Otherwise they do not exist in memory at the time the WMApp tries to display
+them. This is clearly bad :-)
+
+I presume that the misleading "pure virtual function called" error occurs
+because the run-time type identification of the C++ program sees garbage at a
+memory location which is supposed to be a class inherited from WMWidget. Then,
+having no idea what to make of the garbage, the program casts it to the base
+class WMWidget, resulting in a call to WMWidget::real_display(), a pure virtual
+function. Or something like that.
+
diff --git a/wmcube/wmapp/Makefile b/wmcube/wmapp/Makefile
new file mode 100644
index 000000000000..2b773fb12398
--- /dev/null
+++ b/wmcube/wmapp/Makefile
@@ -0,0 +1,35 @@
+export CXX = g++
+export CFLAGS = -fPIC -g -Wall -pedantic -O2
+export LFLAGS = -L$(CURDIR) -L/usr/X11R6/lib -lXpm -lXext -lX11 -lwmapp
+
+SOURCES = $(wildcard *.cc)
+OBJECTS = $(SOURCES:.cc=.o)
+
+libwmapp.a: $(OBJECTS)
+ ar rcs libwmapp.a $^
+
+%.d: %.cc
+ @set -e; $(CXX) -MM $(CFLAGS) $< | sed 's/\($*\)\.o[ :]*/\1.o $@ : /g' > $@; \
+ [ -s $@ ] || rm -f $@
+
+-include $(SOURCES:.cc=.d)
+
+%.o:
+ $(CXX) $(CFLAGS) -c $< -o $@
+
+wmexample: libwmapp.a
+ $(MAKE) -C example1
+
+wmatc: libwmapp.a
+ $(MAKE) -C example2
+
+clean:
+ -rm -f tags *.o *.d *\~ libwmapp.a
+ $(MAKE) -C example1 clean
+ $(MAKE) -C example2 clean
+
+dist-clean: clean
+ -rm -f libwmapp.a wmexample wmatc
+
+.PHONY: all clean dist-clean wmexample wmatc
+
diff --git a/wmcube/wmapp/README b/wmcube/wmapp/README
new file mode 100644
index 000000000000..71f8a0c342b9
--- /dev/null
+++ b/wmcube/wmapp/README
@@ -0,0 +1,66 @@
+WMApp: version 0.0.4.1
+Copyright (C) 2001-2003 Kevin and Jason McCarty <kmcc...@princeton.edu>
+ and others (see code for details)
+Licensed under the GNU GPL (see COPYING file).
+
+This is WMApp, a C++ graphics library written exclusively for developing
+WindowMaker dockapps. If you like dockapps, but you also like C++ and you
+are tired of trying to work with the code in wmgeneral.c, this library is
+for you!
+
+For an example program based on this library, check out the source code
+in the example directory. This program is long on eyecandy and short
+on usefulness, but it gives an idea of what is possible. "make wmexample"
+to build it.
+
+Features
+--------
+- Dockapp windows are set up automatically for you.
+- State model: a dockapp may be in one of several states ("windows"), which
+ can each look different and have different functionality
+- On-the-fly clipping; no more masking xpms needed!
+- Simple callback model: attach as many callback functions to each button
+ as desired. Callbacks can take arbitrary data as an argument, change
+ the properties of other widgets, and even switch between dockapp states.
+- You may automatically execute a list of functions (different for each window)
+ at set intervals of time. Useful for clocks, CPU load displays, etc.
+- Numerous widgets, all with the familiar dockapp look. The color scheme
+ of many may be changed. Many common WindowMaker dockapps could already
+ be rewritten to use this library.
+
+Widgets
+-------
+- Text box for conveying information; comes with three font sizes.
+- Progress meter to show changes in a quantity, e.g. percent download.
+- History display to show how a quantity changes over time, e.g. CPU load.
+- Buttons (optionally with an image) that can have callback functions set
+ and can be activated and deactivated.
+- Images that may display an XPM icon.
+- Glowing LED-type things that may be in one of four states:
+ off, green, yellow, and red.
+- Frames in which widgets (including other frames) may be nested. Frames
+ may have a border and / or padding between their contents.
+- Sliders that may be moved up and down with the mouse wheel
+ (or by clicking) to set a value.
+- Canvas that may be drawn upon with various drawing functions.
+
+Most of the above widgets may also inherit from one or more of the following
+for additional features:
+
+- Elliptical widget that clips contents to an ellipse
+- Callback widget that can execute actions when clicked upon
+
+Limitations
+-----------
+- Still not guaranteed not to leak memory or X resources
+- API is not guaranteed to be backwards compatible when it changes
+ (note the version number)
+- The executables produced with this library are several times larger
+ than those created using wmgeneral.c.
+- WMApp does not support dynamic widget resizing.
+- Text box fonts do not have lowercase letters. (They can easily be
+ implemented -- just edit the character maps in the xpm directory --
+ but I think they would look quite bad due to the small fonts.)
+- Changing the color of the fonts is not supported at runtime. (You can
+ of course do this at compile time by editing the font XPMs.)
+
diff --git a/wmcube/wmapp/Widgets.txt b/wmcube/wmapp/Widgets.txt
new file mode 100644
index 000000000000..e5722e35997c
--- /dev/null
+++ b/wmcube/wmapp/Widgets.txt
@@ -0,0 +1,49 @@
+WMWidgets Class Hierarchy
+
+Note: * represents widgets which cannot be instantiated, only inherited from
+Only public inheritances are shown in this diagram.
+
+WMWidget* - Base class for all widgets
+ |
+ +--WMEllipse* - Inherited widgets are displayed inside an ellipse
+ |
+ +--WMTextBar - Draw a string of text
+ |
+ +--WMMeter* - Base class for meter widgets
+ | |
+ | +--WMMeterBar - A bar that displays a quantity by ranging from
+ | | empty to full
+ | +--WMSlider - A bar that can be slid up or down to set a value
+ | (also inherits from WMCallback)
+ |
+ +--WMHistory - Show a graph of how a quantity has been varying with time
+ |
+ +--WMImage - Display an XPM on a region of the window
+ | |
+ | +--WMCanvas - Display a region which may be changed by drawing functions
+ | |
+ | +--WMLED - Display an image of an LED in one of four states
+ | |
+ | +--WMButton - A button which, when pressed, executes one or more
+ | ^ callback functions
+ | | - may also have an image on it
+ | |
+ +--WMCallback* - A widget that can execute callback functions when clicked
+ | ^
+ | |
+ | WMClickable* - (does not inherit from WMWidget)
+ | | Inherited widgets must specify what happens when
+ | | a mouse button is pressed or released, by defining
+ | | press() and release() methods.
+ | v
+ +--WMFrame - A widget which contains other widgets and may have an optional
+ | border
+ +--WMWindow - The topmost level widget. All other widgets must be
+ contained (recursively) by this widget in order to be
+ displayed
+
+
+WMApp - Contains one or more WMWindows. Only one WMWindow may be displayed
+ on screen at a time. (WMWindows are still active in the background
+ when not displayed, unless they are set otherwise.)
+
diff --git a/wmcube/wmapp/colors.h b/wmcube/wmapp/colors.h
new file mode 100644
index 000000000000..b7eedceb8c53
--- /dev/null
+++ b/wmcube/wmapp/colors.h
@@ -0,0 +1,54 @@
+#ifndef WM_COLORS_H
+#define WM_COLORS_H
+
+#define SLICE(_int, _bit) (((_int) >> (_bit)) & 0xff)
+
+class Color {
+ unsigned char _R, _G, _B;
+
+ public:
+ Color(unsigned long int li = 0)
+ : _R(SLICE(li, 16)), _G(SLICE(li, 8)), _B(SLICE(li, 0)) { }
+ Color(int R, int G, int B) : _R(R), _G(G), _B(B) { }
+
+ bool operator == (const Color & c) const
+ { return _R == c._R && _G == c._G && _B == c._B; }
+ bool operator != (const Color & c) const
+ { return ! operator==(c); }
+
+ unsigned char r() const { return _R; }
+ unsigned char g() const { return _G; }
+ unsigned char b() const { return _B; }
+
+ static Color alpha_blend(const Color & c1, const Color & c2, double weight1)
+ {
+ double weight2 = 1.0 - weight1;
+ int r = static_cast<int>(c1.r() * weight1 + c2.r() * weight2 + 0.5);
+ int g = static_cast<int>(c1.g() * weight1 + c2.g() * weight2 + 0.5);
+ int b = static_cast<int>(c1.b() * weight1 + c2.b() * weight2 + 0.5);
+ return Color(r, g, b);
+ }
+};
+
+#undef SLICE
+
+#define WMColor(x) (WMApp::colormap[static_cast<int>(WMColor:: x)])
+
+namespace WMColor {
+ enum WMColor {
+ Background, // Background of WMFrames and WMImages
+ Dim, // Dark drawing color
+ Medium, // Medium drawing color
+ Bright, // Light drawing color
+ ButtonFace, // Color of face of buttons
+ ButtonBorderDim, // Colors of borders of WMButtons
+ ButtonBorderMedium,
+ ButtonBorderBright,
+ FrameBorderDim, // Colors of borders of WMFrames
+ FrameBorderMedium,
+ FrameBorderBright
+ };
+ const int numcolors = 11;
+}
+
+#endif
diff --git a/wmcube/wmapp/example1/Makefile b/wmcube/wmapp/example1/Makefile
new file mode 100644
index 000000000000..d6a557545e14
--- /dev/null
+++ b/wmcube/wmapp/example1/Makefile
@@ -0,0 +1,13 @@
+OBJECTS = wmexample.o window0.o window1.o
+
+../wmexample: $(OBJECTS) ../libwmapp.a
+ $(CXX) $(CFLAGS) $(OBJECTS) $(LFLAGS) -o $@
+
+$(OBJECTS): %.o: %.cc ../*.h
+ $(CXX) $(CFLAGS) -c $< -o $@
+
+clean:
+ rm -f *.o *\~
+
+.PHONY: clean
+
diff --git a/wmcube/wmapp/example1/debian-tiny.xpm b/wmcube/wmapp/example1/debian-tiny.xpm
new file mode 100644
index 000000000000..065ed6448c0e
--- /dev/null
+++ b/wmcube/wmapp/example1/debian-tiny.xpm
@@ -0,0 +1,50 @@
+/* XPM */
+static char * debian_tiny_xpm[] = {
+"9 9 38 1",
+" c None",
+". c #AEAAAE",
+"+ c #AB9194",
+"@ c #A87173",
+"# c #AA8487",
+"$ c #AEA5A9",
+"% c #A76568",
+"& c #A23B3D",
+"* c #A9787B",
+"= c #A76C6F",
+"- c #A03132",
+"; c #AC999C",
+"> c #AC9396",
+", c #A65E60",
+"' c #AEA9AD",
+") c #AD9598",
+"! c #AE9DA1",
+"~ c #A97C7F",
+"{ c #A96E70",
+"] c #A76A6C",
+"^ c #ADA0A4",
+"/ c #AD9B9F",
+"( c #AD989C",
+"_ c #AD9B9E",
+": c #A86E70",
+"< c #A86D70",
+"[ c #AEA6AA",
+"} c #AE9DA0",
+"| c #AC8689",
+"1 c #AA797C",
+"2 c #AD9DA1",
+"3 c #AA8689",
+"4 c #A97679",
+"5 c #AD8C8F",
+"6 c #AB8184",
+"7 c #A6585A",
+"8 c #A97476",
+"9 c #AE9EA2",
+"...+@#$..",
+"..%&*=-;.",
+".>,')!~{.",
+".]^/(._:.",
+".<[}|[12.",
+".34.56/..",
+".'7[.....",
+"..^89....",
+"....$...."};
diff --git a/wmcube/wmapp/example1/window0.cc b/wmcube/wmapp/example1/window0.cc
new file mode 100644
index 000000000000..032a74ec2d28
--- /dev/null
+++ b/wmcube/wmapp/example1/window0.cc
@@ -0,0 +1,204 @@
+#include "../wmapp.h"
+#include "../wmframe.h"
+#include "../wmwindow.h"
+#include "../wmtextbar.h"
+#include "../wmslider.h"
+#include "../wmled.h"
+#include "../wmmeterbar.h"
+#include "../wmhistory.h"
+#include "../wmbutton.h"
+#include "../wmellipse.h"
+
+#include "../xpm/checkbox.xpm"
+#include "../xpm/xbutton.xpm"
+#include "debian-tiny.xpm"
+
+// for the clock:
+#include <time.h>
+#include <sys/timeb.h>
+
+// This file defines a window that contains various widgets to demonstrate
+// the WMApp library. Also it is shown how to make a clock widget.
+
+// Callbacks for the buttons -----------------------------------------------
+
+// This one ends the program (always useful) and will be attached to the
+// button with the "X".
+void
+halt(const WMApp *a, void *) { a->stop(); }
+
+// The following three callbacks will be attached to the checkbox button:
+
+// This one changes the state of the middle LED if mousebutton 1 is clicked.
+void
+ledset(const WMApp *a, WMWidget *w, void *)
+{
+ if (a->mouseclick().button != Button1) return;
+
+ WMLed *l = dynamic_cast<WMLed *>(w);
+ if (l) {
+ l->setled(static_cast<WMLed::LedState>((1 + l->led()) % 4));
+ a->repaint();
+ }
+}
+
+// This one toggles the style of the vertical meter if button 2 is clicked.
+void
+togglegraphstyle (const WMApp *a, WMWidget *w, void *)
+{
+ if (a->mouseclick().button != Button2) return;
+
+ WMMeterBar *m = dynamic_cast<WMMeterBar *>(w);
+ if (m) {
+ m->setstyle(static_cast<WMMeterBar::Style>((1 + m->style()) % 3));
+ m->setorientation((m->orientation() == Orientation::Horizontal) ?
+ Orientation::Vertical : Orientation::Horizontal);
+ a->repaint();
+ }
+}
+
+// This one toggles whether the "close" button can be pressed if mouse
+// button 3 is clicked.
+void
+toggleclose(const WMApp *a, WMWidget *w, void *)
+{
+ if (a->mouseclick().button != Button3) return;
+
+ WMButton *b = dynamic_cast<WMButton *>(w);
+ if (b && b->is_active()) b->deactivate();
+ else if (b && !b->is_active()) b->activate();
+}
+
+// This callback will be attached to the Debian button. It switches
+// between windows.
+// Note: if the last statement in a callback function requests
+// a switch to a new window, you don't need a "repaint()".
+void
+switch_to_1(const WMApp *a, void *)
+{ a->switch_to(1); }
+
+// Define a class that will be a WMHistory widget with callbacks
+class WMHistCallback : public WMCallback, public WMHistory, public WMEllipse {
+ public: WMHistCallback() : WMCallback(), WMHistory(), WMEllipse() { }
+};
+
+// Callback to clear this widget when it's clicked on
+void
+clearhistory(const WMApp *a, WMWidget *w, void *)
+{
+ WMHistCallback *h = dynamic_cast<WMHistCallback *>(w);
+ if (h) h->clear();
+}
+
+// Callbacks for the windows -----------------------------------------------
+// Window callbacks are executed every 50 milliseconds (by default; you
+// can set this value) for the currently displayed window.
+
+// This function will update the time on the clock display every 5 seconds.
+void
+displaytime(const WMApp *a, WMWidget *w, void *)
+{
+ struct timeb currenttime;
+ string timestr;
+ WMTextBar *b = dynamic_cast<WMTextBar *>(w);
+
+ if (!b) return;
+ ftime(&currenttime);
+ // extract current time from date-and-time string
+ timestr = string(ctime(&currenttime.time) + 11);
+ b->settext(timestr);
+ a->repaint();
+}
+
+// make random increments to the meterbar and history every 150 ms
+void
+updatehist (const WMApp *a, WMWidget *w1, void *w2)
+{
+ WMMeterBar *b = dynamic_cast<WMMeterBar *>(w1);
+ if (b) {
+ int increment = static_cast<int>(b->value() - 13
+ + 31 * static_cast<float>(rand()) / RAND_MAX) + 307;
+ //I added 307 becuase gcc does bad things to a signed dividend in a modulus,
+ //which makes for *interesting* results
+
+ b->setvalue(increment % 307, 306);
+ }
+
+ WMHistory *h = dynamic_cast<WMHistory *>(static_cast<WMWidget *>(w2));
+ if (b && h) h->setvalue(b->value());
+ a->repaint();
+}
+
+// The function where we lay out all the widgets ---------------------------
+
+void
+makewindow0(WMWindow *w0)
+{
+ // Everything following is GUI boilerplate code.
+ static WMFrame top, mid, bottom, topright, botright;
+ static WMTextBar time("00:00", 0);
+ static WMSlider slider(30, 50);
+ static WMLed l, m, r;
+ static WMMeterBar meterbar;
+ static WMHistCallback history;
+ static WMButton debian, go, stop;
+
+ w0->add_timed_function(500, displaytime, &time, 0);
+ w0->add_timed_function(15, updatehist, &meterbar,
+ dynamic_cast<WMWidget *>(&history));
+ w0->addchild(top);
+ w0->addchild(mid);
+ w0->addchild(bottom);
+ w0->setorientation(Orientation::Vertical);
+ w0->setaspectratios(1, 2, 1);
+
+ top.addchild(time);
+ top.addchild(topright);
+ top.setaspectratios(6, 5);
+
+ mid.addchild(history);
+ mid.addchild(slider);
+ slider.setorientation(Orientation::Vertical);
+ mid.setaspectratios(3, 1);
+
+ bottom.addchild(meterbar);
+ bottom.addchild(botright);
+ bottom.setaspectratios(1, 2);
+
+ topright.addchild(l);
+ topright.addchild(m);
+ topright.addchild(r);
+ topright.setpadding(0);
+ topright.setborder(1);
+
+ botright.addchild(debian);
+ botright.addchild(go);
+ botright.addchild(stop);
+ botright.setpadding(0);
+ botright.setborder(1);
+
+ l.setled(WMLed::Good);
+ r.setled(WMLed::Error);
+
+ // should set initial total of seconds
+ srand(std::time(0));
+ meterbar.setstyle(WMMeterBar::Spectrum);
+ meterbar.setvalue(150, false);
+ meterbar.settotal(306, false);
+ history.settotal(306, false);
+ history.addcallback(clearhistory, &history, 0);
+
+ debian.seticon(debian_tiny_xpm);
+ debian.addcallback(switch_to_1, 0);
+
+ go.seticon(checkbox_xpm);
+ go.addcallback(ledset, &m, 0);
+ go.addcallback(toggleclose, &stop, 0);
+ go.addcallback(togglegraphstyle, &meterbar, 0);
+
+ // Let's start this button out in an inactive state, just for fun.
+ stop.deactivate();
+ stop.seticon(xbutton_xpm);
+ stop.addcallback(halt, 0);
+}
+
diff --git a/wmcube/wmapp/example1/window1.cc b/wmcube/wmapp/example1/window1.cc
new file mode 100644
index 000000000000..644cad57a48a
--- /dev/null
+++ b/wmcube/wmapp/example1/window1.cc
@@ -0,0 +1,86 @@
+#include "../wmapp.h"
+#include "../wmwindow.h"
+#include "../wmframe.h"
+#include "../wmcanvas.h"
+#include "../wmbutton.h"
+#include "../wmellipse.h"
+#include "debian-tiny.xpm"
+
+// This file creates a window with a small, very simple paint program.
+
+// Define a class that will be a WMCanvas widget with callbacks
+class WMPainter : public WMCallback, public WMCanvas, public WMEllipse {
+ public: WMPainter() : WMCallback(), WMCanvas() { }
+};
+
+// Make one of the buttons elliptical.
+class WMEllipticalButton : public WMEllipse, public WMButton {
+ public: WMEllipticalButton() : WMEllipse(), WMButton() { }
+};
+
+// Callback to paint onto this widget when it's clicked on
+void
+paint(const WMApp *a, WMWidget *w, void *)
+{
+ WMMouseClick click = a->mouseclick().b_relative_to(w);
+ WMPainter *p = dynamic_cast<WMPainter *>(w);
+ // draw a 3x3 square at the mouse location clicked upon
+ if (p) p->fill_rectangle(click.x - 2, click.y - 2, 3, 3);
+ a->repaint();
+}
+
+// Callbacks for the buttons -----------------------------------------------
+
+// This callback changes the current paint color of the WMCanvas, depending
+// upon which button was pressed.
+void
+changecolor(const WMApp *a, WMWidget *w, void *color)
+{
+ WMColor::WMColor c = *static_cast<WMColor::WMColor *>(color);
+ WMPainter *wp = dynamic_cast<WMPainter *>(w);
+ if (wp) wp->setcolor(c);
+}
+
+// This callback will be attached to the big button
+// on the second window. It switches between windows.
+// Note: if the last statement in a callback function requests
+// a switch to a new window, you don't need a "repaint()".
+void
+switch_to_0(const WMApp *a, void *)
+{ a->switch_to(0); }
+
+void makewindow1(WMWindow *w1)
+{
+ static WMEllipticalButton debianwin;
+ static WMEllipticalButton colorbutton[4];
+ static WMFrame top, topleft, bottom;
+ static WMPainter drawing;
+ static int colors[4] = { 0x000000, 0xFF0000, 0x00FF00, 0x0000FF };
+
+ w1->addchild(top);
+ w1->addchild(bottom);
+ w1->setorientation(Orientation::Vertical);
+ w1->setaspectratios(1, 3);
+
+ top.addchild(topleft);
+ top.addchild(debianwin);
+ top.setaspectratios(4, 1);
+
+ topleft.setpadding(0);
+ topleft.setborder(1);
+ topleft.settransparency(false);
+
+ for (unsigned int i = 0; i < 4; i++) {
+ colorbutton[i].setbgcolor(colors[i]);
+ colorbutton[i].addcallback(changecolor, &drawing, colors + i);
+ topleft.addchild(colorbutton[i]);
+ }
+
+ debianwin.seticon(debian_tiny_xpm);
+ debianwin.addcallback(switch_to_0, 0);
+
+ drawing.addcallback(paint, &drawing);
+ bottom.addchild(drawing);
+ drawing.setborder(4);
+}
+
diff --git a/wmcube/wmapp/example1/wmexample.cc b/wmcube/wmapp/example1/wmexample.cc
new file mode 100644
index 000000000000..b83b72cc4653
--- /dev/null
+++ b/wmcube/wmapp/example1/wmexample.cc
@@ -0,0 +1,39 @@
+#include "../wmapp.h"
+#include "../wmwindow.h"
+
+// This is an example WindowMaker dockapp program written using the
+// WMApp dockapp library. The first window shows off various widgets
+// and demonstrates how to make a clock. The second window illustrates
+// a miniature paint program.
+
+extern void makewindow0(WMWindow *w0_ptr); // see window0.cc
+extern void makewindow1(WMWindow *w1_ptr); // see window1.cc
+
+// The main() function, where we lay out all the widgets -------------------
+// The files window0.cc and window1.cc are much more interesting.
+
+int main(int argc, char *argv[])
+{
+ // This should always be the very first line in the main() function of
+ // a WMApplication:
+ WMApp::initialize(argc, argv);
+
+ WMApp a;
+ WMWindow w0, w1;
+ makewindow0(&w0);
+ makewindow1(&w1);
+
+ // Attach windows to the application
+ a.addwindow(w0);
+ a.addwindow(w1);
+
+ // This makes everything go.
+ a.run();
+
+ // Any cleanup code after the window closes should go here.
+ // (In this case, none is needed.)
+
+ return 0;
+}
+
+
diff --git a/wmcube/wmapp/example2/Makefile b/wmcube/wmapp/example2/Makefile
new file mode 100644
index 000000000000..b8ed170f65d3
--- /dev/null
+++ b/wmcube/wmapp/example2/Makefile
@@ -0,0 +1,13 @@
+OBJECTS = wmairtrafficcontrol.o wmradar.o
+
+../wmatc: $(OBJECTS) ../libwmapp.a
+ $(CXX) $(CFLAGS) $(OBJECTS) $(LFLAGS) -o $@
+
+$(OBJECTS): %.o: %.cc ../*.h wmradar.h
+ $(CXX) $(CFLAGS) -c $< -o $@
+
+clean:
+ rm -f *.o *\~
+
+.PHONY: clean
+
diff --git a/wmcube/wmapp/example2/wmairtrafficcontrol.cc b/wmcube/wmapp/example2/wmairtrafficcontrol.cc
new file mode 100644
index 000000000000..89df1ce507c0
--- /dev/null
+++ b/wmcube/wmapp/example2/wmairtrafficcontrol.cc
@@ -0,0 +1,80 @@
+#include <ctime>
+#include <cstdlib>
+#include "wmradar.h"
+#include "../wmslider.h"
+#include "../wmcallback.h"
+#include "../wmapp.h"
+#include "../wmwindow.h"
+#include "../wmframe.h"
+#include "../wmbutton.h"
+#include "../xpm/xbutton.xpm"
+
+//WM Air Traffic Control: The FAQ said don't rely on callback timings for
+//air traffic control, so I did.
+//
+//Click on the radar to change the nearest plane's heading towards that point.
+//Move the slider to change the planes' speed.
+//If two planes collide, they will disappear, a red point will appear, and
+//the score will be incremented.
+
+void
+halt(const WMApp *a, void *) { a->stop(); }
+
+void add_plane(const WMApp* a, WMWidget* w, void*)
+{
+ if (!(std::rand() % 3))
+ {
+ WMRadar* r = dynamic_cast<WMRadar*>(w);
+ if (r)
+ r->add_plane();
+ }
+}
+
+void increment_time(const WMApp* a, WMWidget* w, void*)
+{
+ WMRadar* r = dynamic_cast<WMRadar*>(w);
+ if (r)
+ r->increment_time();
+ a->repaint();
+}
+
+int main(int argc, char *argv[])
+{
+ WMApp::initialize(argc, argv);
+
+ WMApp a;
+ WMWindow win;
+
+ WMTextBar score;
+ WMSlider speed;
+ WMRadar radar(&score, &speed);
+ WMFrame left, right;
+ WMButton quit;
+
+ win.add_timed_function(1, increment_time, &radar, 0);
+ win.add_timed_function(80, add_plane, &radar, 0);
+ win.addchild(left);
+ win.addchild(right);
+ win.setaspectratios(50, 15);
+
+ left.addchild(radar);
+ left.addchild(score);
+ left.setorientation(Orientation::Vertical);
+ left.setaspectratios(50, 15);
+
+ right.addchild(speed);
+ right.addchild(quit);
+ right.setorientation(Orientation::Vertical);
+ right.setaspectratios(50, 15);
+
+ quit.seticon(xbutton_xpm);
+ quit.addcallback(halt, 0);
+
+ speed.setorientation(Orientation::Vertical);
+
+ std::srand(std::time(0));
+
+ a.addwindow(win);
+ a.run();
+ return 0;
+}
diff --git a/wmcube/wmapp/example2/wmradar.cc b/wmcube/wmapp/example2/wmradar.cc
new file mode 100644
index 000000000000..8344c1eab3e0
--- /dev/null
+++ b/wmcube/wmapp/example2/wmradar.cc
@@ -0,0 +1,220 @@
+#include <cstdlib>
+#include <cmath>
+#include <sstream>
+#include <iomanip>
+#include "wmradar.h"
+#include "../wmapp.h"
+
+using std::sin;
+using std::cos;
+using std::atan2;
+
+WMRadar::WMRadar(WMTextBar* t, WMSlider* s)
+: angle(0), text_score(t), speed(s)
+{
+ setbuffered(true);
+ text_score->settext(" 0", false);
+ speed->settotal(50, false);
+ speed->setvalue(8, false);
+}
+
+void
+WMRadar::real_display()
+{
+ if (!p_icon())
+ seticon(false);
+ setcolor(WMColor(Background));
+ fill_rectangle(0, 0, b_width(), b_height()); //clear background
+
+ setcolor(WMColor(Dim));
+ for (double i = 0; i < 2 * M_PI; i += M_PI_4)
+ draw_line(b_width() / 2, b_height() / 2, (1 + cos(i)) * b_width() / 2,
+ (1 - sin(i)) * b_height() / 2); //draw radial lines
+
+ draw_arc(b_width() / 3, b_height() / 3, b_width() / 3 - 1, b_height() / 3 - 1,
+ 0, 360 * 64);
+ draw_arc(b_width() / 6, b_height() / 6, 2 * b_width() / 3,
+ 2 * b_height() / 3, 0, 360 * 64); //draw circles
+
+ setcolor(Color(255, 0, 0));
+ for (clist::const_iterator i = collisions.begin(); i != collisions.end(); ++i)
+ fill_arc(i->x - 1, i->y - 1, 3, 3, 0, 360 * 64); //draw collision points
+
+ std::vector<X::XPoint> points(3);
+ for (plist::const_iterator i = planes.begin(); i != planes.end(); ++i)
+ {
+ setcolor(Color(0, 255 * i->brightness, 0)); // achieve a fading effect
+ points[0].x = i->x;
+ points[0].y = i->y;
+ points[1].x = int(i->x) + 7 * cos(i->direction + 5.5 * M_PI / 6);
+ points[1].y = int(i->y) - 7 * sin(i->direction + 5.5 * M_PI / 6);
+ points[2].x = int(i->x) + 7 * cos(i->direction + 6.5 * M_PI / 6);
+ points[2].y = int(i->y) - 7 * sin(i->direction + 6.5 * M_PI / 6);
+ // construct an isoceles triangle pointing in plane's direction of motion
+ fill_polygon(points); // and draw it
+ }
+
+ setcolor(Color(0, 255, 0));
+ draw_line(b_width() / 2, b_height() / 2, (1 + cos(angle)) * b_width() / 2,
+ (1 - sin(angle)) * b_height() / 2); //draw radar line
+
+ WMImage::real_display(); //update window
+}
+
+double rand(double low, double high)
+{
+ return low + std::rand() * (high - low) / RAND_MAX;
+}
+
+void
+WMRadar::add_plane()
+{
+ if (planes.size() > 4)
+ return;
+
+ double theta = rand(0, 2 * M_PI); //put plane somewhere along edge
+ plane p = { (1 + cos(theta)) * b_width() / 2,
+ (1 - sin(theta)) * b_height() / 2,
+ rand(theta + 3 * M_PI_4, theta + 5 * M_PI_4), //direction pointing inwards
+ 0.5 }; //brightness
+
+ planes.push_back(p);
+}
+
+inline double dist2 (double x1, double y1, double x2, double y2)
+{ //return distance squared between points
+ return std::pow(x1 - x2, 2) + std::pow(y1 - y2, 2);
+}
+
+inline double norm_angle(double angle)
+{ //return angle shifted into the range [0, 2pi)
+ return angle - 2 * M_PI * std::floor(angle / (2 * M_PI));
+}
+
+bool
+WMRadar::release(int, int x, int y)
+{
+ if (wPressed)
+ {
+ wPressed = false;
+ if (contains(x, y) && planes.size())
+ {
+ int newx = x - b_left(),
+ newy = y - b_top();
+ plist::iterator closest;
+ double mindist2 = 10000;
+ for (plist::iterator i = planes.begin(); i != planes.end(); ++i)
+ {
+ double d2 = dist2(i->x, i->y, newx, newy);
+ if (d2 < mindist2)
+ {
+ mindist2 = d2;
+ closest = i;
+ }
+ }
+ closest->direction = norm_angle(atan2(double(int(closest->y) - newy),
+ double(newx - int(closest->x))));
+ //change nearest plane's direction towards (x, y)
+ }
+ return true;
+ }
+ else return false;
+}
+
+void
+WMRadar::increment_time()
+{
+ for (plist::iterator i = planes.begin(); i != planes.end();)
+ { //Collision test planes
+ if (!contains(i->x + left(), i->y + top()))
+ ++i;
+ else
+ {
+ plist::iterator j = i;
+ bool collided = false;
+ for (++j; j != planes.end();)
+ if (dist2(i->x, i->y, j->x, j->y) <= 0.75)
+ { //remove each collided plane and increment score
+ j = planes.erase(j);
+ collided = true;
+ increment_score();
+ }
+ else
+ ++j;
+ if (collided)
+ {
+ increment_score();
+ collision c = { i->x, i->y };
+ collisions.push_back(c); //make record of collision location
+ i = planes.erase(i);
+ }
+ else
+ ++i;
+ }
+ }
+
+ const double angleinc = M_PI / 125;
+
+ for (plist::iterator i = planes.begin(); i != planes.end();)
+ {
+ double incx = speed->value() * cos(i->direction) / 100;
+ double incy = -speed->value() * sin(i->direction) / 100;
+ double nextx = i->x + incx;
+ double nexty = i->y + incy;
+
+ //to check if a plane crossed the radar line, approximate the plane's path
+ //as an arc:
+ double& l_start_angle = angle; //make an interval of radar line's angles
+ const double l_end_angle = l_start_angle + angleinc;
+
+ //make an interval of the plane's angles
+ double p_start_angle = norm_angle(atan2(b_height() / 2 - i->y,
+ i->x - b_width() / 2));
+ double p_end_angle = norm_angle(atan2(b_height() / 2 - nexty,
+ nextx - b_width() / 2));
+
+ const double crossp = (b_width() / 2 - i->x) * incy
+ - (b_height() / 2 - i->y) * incx; //test whether plane is moving in
+ //a positive or a negative angle
+ if (crossp < 0.0) //make angle increase counterclockwise
+ {
+ const double temp = p_start_angle;
+ p_start_angle = p_end_angle;
+ p_end_angle = temp;
+ }
+ if (p_end_angle < p_start_angle)
+ p_end_angle += 2 * M_PI; //make sure end is > start
+
+ //intersect radar line interval and plane interval. If result is non-empty,
+ //there was an intersection.
+ if (std::min(p_end_angle, l_end_angle)
+ >= std::max(p_start_angle, l_start_angle))
+ i->brightness = 1.0; //if plane crossed radar line, make it bright
+ else
+ i->brightness *= 0.996; //otherwise decay brightness
+
+
+ i->x = nextx; //update plane's position
+ i->y = nexty;
+ if (!WMWidget::contains(i->x + b_left(), i->y + b_top()))
+ i = planes.erase(i); //cull planes outside of radar
+ else
+ ++i;
+ }
+
+ angle = norm_angle(angle + angleinc); //increment radar direction
+
+ display();
+}
+
+void
+WMRadar::increment_score ()
+{
+ using namespace std;
+ istringstream in(text_score->text()); //get string from textbar
+ int score;
+ in >> score; //extract score
+ ostringstream out;
+ out << setw(6) << setfill(' ') << score + 1; //increment and put in a string
+ text_score->settext(out.str()); //put back in textbar
+}
diff --git a/wmcube/wmapp/example2/wmradar.h b/wmcube/wmapp/example2/wmradar.h
new file mode 100644
index 000000000000..228cdc640453
--- /dev/null
+++ b/wmcube/wmapp/example2/wmradar.h
@@ -0,0 +1,44 @@
+#ifndef _WMRADAR_H
+#define _WMRADAR_H
+
+#include <list>
+#include "../wmellipse.h"
+#include "../wmcanvas.h"
+#include "../wmcallback.h"
+#include "../wmtextbar.h"
+#include "../wmslider.h"
+
+class WMRadar : public WMCanvas, public WMCallback, public WMEllipse {
+private:
+ struct plane
+ {
+ double x, y, direction, brightness;
+ };
+ typedef std::list<plane> plist;
+
+ struct collision
+ { int x, y; };
+ typedef std::list<collision> clist;
+
+ plist planes;
+ clist collisions;
+ double angle;
+
+ WMTextBar* text_score;
+ WMSlider* speed;
+
+protected:
+ void real_display();
+
+public:
+ WMRadar(WMTextBar*, WMSlider*);
+
+ void add_plane();
+ bool release(int button, int x, int y); //change nearest plane's direction
+ void increment_time();
+
+private:
+ void increment_score();
+};
+
+#endif //_WMRADAR_H
diff --git a/wmcube/wmapp/wmapp.cc b/wmcube/wmapp/wmapp.cc
new file mode 100644
index 000000000000..e3353183ee1f
--- /dev/null
+++ b/wmcube/wmapp/wmapp.cc
@@ -0,0 +1,378 @@
+#include <string>
+#include "wmapp.h"
+#include "wmwindow.h"
+
+using std::string;
+
+namespace Unix {
+ extern "C" {
+# include <unistd.h> // for usleep()
+ }
+};
+
+// All the xpms we need:
+namespace Xpms {
+# include "xpm/charmap-small.xpm"
+# include "xpm/charmap-medium.xpm"
+# include "xpm/charmap-large.xpm"
+# include "xpm/checkbox.xpm"
+# include "xpm/xbutton.xpm"
+# include "xpm/leds.xpm"
+# include "xpm/emptybar.xpm"
+# include "xpm/fullbar.xpm"
+# include "xpm/tile.xpm"
+};
+
+// Xlib doesn't seem to work if these are class members.
+// They're declared as extern in xwrapper.h.
+X::Window wActiveWin, wProgramWin;
+X::Atom deleteWin;
+X::Atom _XA_GNUSTEP_WM_FUNC;
+
+// static class members of WMApp declared here:
+
+Xwrapper WMApp::Xw;
+WMPixmap WMApp::char_pixmaps[3];
+WMPixmap WMApp::checkbox_pixmap, WMApp::xbutton_pixmap, WMApp::leds_pixmap[4];
+WMPixmap WMApp::emptybar_pixmap, WMApp::fullbar_pixmap;
+WMPixmap WMApp::tile_pixmap;
+Color WMApp::colormap[WMColor::numcolors];
+
+char ** WMApp::wArgv;
+string WMApp::wName;
+int WMApp::wArgc;
+int WMApp::wWindowSize;
+enum WindowManager::WindowManager WMApp::wManager;
+
+
+// initialize: static function to create pixmaps and set default colors.
+// This should be called as the very first line of a program using this
+// library.
+void
+WMApp::initialize(int argc, char *argv[])
+{
+ static bool inited = false;
+ if (inited) return;
+
+ wArgc = argc;
+ wName = (argc && argv) ? string(argv[0]) : string("WMApplication");
+ wArgv = argv;
+ deleteWin = X::XInternAtom(Xw.xdisplay(), "WM_DELETE_WINDOW", false);
+ _XA_GNUSTEP_WM_FUNC = X::XInternAtom(Xw.xdisplay(),
+ "_GNUSTEP_WM_FUNCTION", false);
+
+ // create all the required pixmaps
+ Xw.create_pixmap(char_pixmaps[0], Xpms::charmap_small_xpm);
+ Xw.create_pixmap(char_pixmaps[1], Xpms::charmap_medium_xpm);
+ Xw.create_pixmap(char_pixmaps[2], Xpms::charmap_large_xpm);
+ Xw.create_pixmap(checkbox_pixmap, Xpms::checkbox_xpm);
+ Xw.create_pixmap(xbutton_pixmap, Xpms::xbutton_xpm);
+ Xw.create_pixmap(fullbar_pixmap, Xpms::fullbar_xpm);
+ Xw.create_pixmap(emptybar_pixmap, Xpms::emptybar_xpm);
+ Xw.create_pixmap(tile_pixmap, Xpms::tile_xpm);
+
+ // create four LED pixmaps
+ WMPixmap all_leds_pixmap;
+ int ledwidth = 4, ledheight = 4;
+
+ Xw.create_pixmap(all_leds_pixmap, Xpms::leds_xpm);
+ for (unsigned int s = 0; s < 4; s++) {
+ leds_pixmap[s].attr.width = ledwidth;
+ leds_pixmap[s].attr.width = ledheight;
+ Xw.create_pixmap(leds_pixmap[s], ledwidth, ledheight);
+ Xw.copy_rectangle(all_leds_pixmap, leds_pixmap[s], ledwidth * s, 0,
+ ledwidth, ledheight, 0, 0);
+ }
+
+# define colormap(x) colormap[static_cast<int>(WMColor:: x)]
+ // create colormap
+ // XXX: eventually, read from RC file
+ colormap(Background) = 0x212121;
+ colormap(Dim) = 0x283C28;
+ colormap(Medium) = 0x188A86;
+ colormap(Bright) = 0x20B2AE;
+ colormap(ButtonFace) = 0xAEAAAE;
+ colormap(ButtonBorderDim) = 0;
+ colormap(ButtonBorderMedium) = 0x86828E;
+ colormap(ButtonBorderBright) = 0xF7F3FF;
+ colormap(FrameBorderDim) = 0;
+ colormap(FrameBorderMedium) = 0;
+ colormap(FrameBorderBright) = 0xC8C8C8; //0xAEAAAE;
+# undef colormap
+
+ inited = true;
+
+ // set the window behavior from command-line options
+ wManager = WindowManager::Other;
+ wWindowSize = 64;
+
+ for (int i = 1; i < wArgc && strcmp(wArgv[i], "--"); i++) {
+ if (strcmp(wArgv[i], "-w") == 0) {
+ wManager = WindowManager::WindowMaker; break;
+ }
+ else if (strcmp(wArgv[i], "-a") == 0) {
+ wManager = WindowManager::Afterstep;
+ wWindowSize = 56;
+ break;
+ }
+ }
+}
+
+// Here begin the magic Xlib incantations required to create a dockapp window.
+// I have no idea how this works, it just does. Code mostly obtained from
+// wmsmixer by Damian Kramer, based in turn upon wmmixer by Sam Hawker.
+
+// simple function to create an XWindow
+void
+WMApp::create_window(X::Window *dest, int left, int top) const
+{
+ X::XClassHint classHint;
+
+ *dest = X::XCreateSimpleWindow(Xw.xdisplay(), Xw.xrootwin(), left, top,
+ wWindowSize, wWindowSize, 0, 0, 0);
+
+ //XXX: May be able to get away without allocating new char arrays, but I don't
+ //trust X not to modify them.
+ classHint.res_name = new char[wName.size() + 1];
+ classHint.res_class = new char[wName.size() + 1];
+ strcpy(classHint.res_name, wName.c_str());
+ strcpy(classHint.res_class, wName.c_str());
+ X::XSetClassHint(Xw.xdisplay(), *dest, &classHint);
+ delete[] classHint.res_name;
+ delete[] classHint.res_class;
+}
+
+// This function sets up the X window.
+// Called from WMApp::run()
+void WMApp::Xsetup()
+{
+ X::Display * display = Xw.xdisplay();
+
+ X::XWMHints wmhints;
+ X::XSizeHints shints;
+ int winsize = wWindowSize;
+ bool pos;
+
+ shints.x = shints.y = shints.flags = 0;
+ pos = (X::XWMGeometry(display, X::XDefaultScreen(display), "" /*geometry*/,
+ 0, 0, &shints, &shints.x, &shints.y, &shints.width, &shints.height,
+ &shints.win_gravity) & X_MACRO(XValue | YValue));
+ shints.min_width = shints.min_height = winsize;
+ shints.max_width = shints.max_height = winsize;
+ shints.base_width = shints.base_height = winsize;
+ shints.flags = X_MACRO(PMinSize | PMaxSize | PBaseSize);
+ create_window(&wProgramWin, shints.x, shints.y);
+
+ if (pos || wManager == WindowManager::WindowMaker
+ || wManager == WindowManager::Afterstep)
+ shints.flags |= X_MACRO(USPosition);
+
+ if (wManager == WindowManager::WindowMaker) {
+ wmhints.initial_state = X_MACRO(WithdrawnState);
+ wmhints.flags = X_MACRO(WindowGroupHint | StateHint | IconWindowHint);
+ create_window(&wActiveWin, shints.x, shints.y);
+ wmhints.icon_window = wActiveWin;
+ }
+ else {
+ wmhints.initial_state = X_MACRO(NormalState);
+ wmhints.flags = X_MACRO(WindowGroupHint | StateHint);
+ wActiveWin = wProgramWin;
+ }
+
+ wmhints.window_group = wProgramWin;
+ X::XSetWMHints(display, wProgramWin, &wmhints);
+ X::XSetWMNormalHints(display, wProgramWin, &shints);
+ if (wArgc > 0)
+ X::XSetCommand(display, wProgramWin, wArgv, wArgc);
+ X::XStoreName(display, wProgramWin, wName.c_str());
+ X::XSetIconName(display, wProgramWin, wName.c_str());
+ X::XSetWMProtocols(display, wActiveWin, &deleteWin, 1);
+}
+
+// This function masks out the "clear" parts of the X window.
+// Called from WMWindow::real_display()
+void
+WMApp::mask() const
+{
+ X::Display * display = Xw.xdisplay();
+ WMPixmap pixmap = current()->pixmap();
+
+ if (wManager == WindowManager::WindowMaker ||
+ wManager == WindowManager::Afterstep)
+ // apply the mask if using a compliant window manager
+ X::XShapeCombineMask(display, wActiveWin, X_MACRO(ShapeBounding),
+ 0, 0, pixmap.mask, X_MACRO(ShapeSet));
+ else
+ // otherwise, create a tile background for the window
+ Xw.copy_rectangle(tile_pixmap, pixmap.pixmap, 0, 0, wWindowSize,
+ wWindowSize);
+
+ Xw.fill_rectangle(pixmap, 0, 0, wWindowSize, wWindowSize,
+ WMColor(Background));
+}
+
+// This function redraws the X window if necessary.
+// Called from WMWindow::real_display()
+void
+WMApp::repaint() const
+{
+ X::XEvent xev;
+
+ Xw.copy_rectangle(current()->pixmap(), wActiveWin,
+ 0, 0, wWindowSize, wWindowSize);
+
+ while (X::XCheckTypedEvent(Xw.xdisplay(), X_MACRO(Expose), &xev))
+ /* loop */;
+ X::XFlush(Xw.xdisplay());
+}
+
+// This function displays the X window.
+// Called from WMWindow::real_activate()
+void
+WMApp::Xshow() const
+{
+ X::Display * display = Xw.xdisplay();
+
+ // request input events and map the window
+ X::XSelectInput(display, wActiveWin,
+ X_MACRO(ExposureMask | ButtonPressMask | ButtonReleaseMask)
+ | X_MACRO(ButtonMotionMask));
+ X::XMapWindow(display, wProgramWin);
+ repaint();
+
+ // loop over X events and callbacks
+ Xwait();
+}
+
+// This function waits for X events, redraws the window when necessary,
+// and calls callbacks of the window.
+void
+WMApp::Xwait() const
+{
+ X::Display * display = Xw.xdisplay();
+ X::XEvent xev;
+
+ while (true) {
+ // sleep for the specified time in milliseconds
+ Unix::usleep(1000 * current()->updatefreq());
+ // execute any timed functions which need it
+ current()->run_timed_functions();
+
+ // execute any pending X events
+ while (XPending(display)) {
+ X::XNextEvent(display, &xev);
+
+ switch (xev.type) {
+ case Expose:
+ repaint();
+ break;
+ case ButtonPress:
+ current()->press(xev.xbutton.button, xev.xbutton.x, xev.xbutton.y);
+ break;
+ case ButtonRelease:
+ wMouseEvent.button = xev.xbutton.button;
+ wMouseEvent.x = xev.xbutton.x;
+ wMouseEvent.y = xev.xbutton.y;
+ current()->release(xev.xbutton.button, xev.xbutton.x, xev.xbutton.y);
+ if (done()) return;
+ break;
+ case ClientMessage:
+ if (static_cast<unsigned int>(xev.xclient.data.l[0]) == deleteWin)
+ { stop(); return; }
+ break;
+ default: break;
+ }
+ }
+ }
+}
+
+// End of magic Xlib incantations.
+
+// The following functions deal with setting the state of the application
+// and running it.
+
+void
+WMApp::switch_to(WMWindow *w) const
+{
+ for (unsigned int i = 0; i < wWindows.size(); i++)
+ if (w == wWindows[i]) {
+ switch_to(i);
+ return;
+ }
+}
+
+void
+WMApp::switch_to(WMWindow &w) const { switch_to(&w); }
+
+// run: This function starts the GUI of the dockapp. Call it as the
+// last line in a program using this library. Calling run() with no
+// argument starts the program on the first window. You can also
+// call run(WMWindow *), run(WMWindow &), or run(unsigned int) in order
+// to start with a different window.
+//
+// So your program in the simplest case should look like this:
+//
+// int main(int argc, char *argv[]) {
+// WMApp::initialize(argc, argv);
+// WMWindow w;
+// WMApp a = WMApp(w);
+// // layout the window and set up callbacks here
+// // ...
+// a.addwindow(w);
+// a.run();
+// return 0;
+// }
+
+void
+WMApp::run(WMWindow *w)
+{
+ for (unsigned int i = 0; i < wWindows.size(); i++)
+ if (w == wWindows[i]) {
+ run(i);
+ return;
+ }
+}
+
+void
+WMApp::run(WMWindow &w) { run(&w); }
+
+void
+WMApp::run(int w) { run(static_cast<unsigned int>(w)); }
+
+void
+WMApp::run(unsigned int w)
+{
+ if (w >= wWindows.size()) return;
+
+ // set up pointers from windows to "this"
+ for (unsigned int i = 0; i < wWindows.size(); i++)
+ wWindows[i]->wApp = this;
+
+ Xsetup();
+ wActiveWindow = wNextWindow = w;
+
+ while (wFinished == false) {
+ // This function does not exit until wNextWindow != wActiveWindow
+ // or wFinished == true. User interaction happens in here.
+ current()->display();
+
+ // To switch to a different window, set a callback on a button within
+ // this window, like this:
+ // void callback1(const WMApp *a, void *) { a->switch_to(5); }
+ // To exit the program, likewise, you need a callback like
+ // void callback2(const WMApp *a, void *) { a->stop(); }
+ // (Alternately you could put the window on a timer by setting one of
+ // these as a callback of the window itself, substituting WMWindow for
+ // WMButton in the function definitions.)
+
+ wActiveWindow = wNextWindow;
+
+ // if we have switched to a different window, continue with that one.
+ }
+
+ // otherwise, exit the WMApp::run() function. (Normally a call like
+ // wm_app->run(); will be the last in a program's main() function,
+ // in which case we also exit the program.)
+ return;
+}
+
diff --git a/wmcube/wmapp/wmapp.h b/wmcube/wmapp/wmapp.h
new file mode 100644
index 000000000000..66c022ffdd94
--- /dev/null
+++ b/wmcube/wmapp/wmapp.h
@@ -0,0 +1,170 @@
+#include <vector>
+#include <string>
+#include "wmwidget.h"
+#include "xwrapper.h"
+#include "colors.h"
+
+#ifndef _WMAPP_H
+#define _WMAPP_H
+
+class WMWindow;
+
+namespace WindowManager {
+ enum WindowManager { WindowMaker, Afterstep, Other };
+};
+
+struct WMMouseClick {
+ int button;
+ int x;
+ int y;
+
+ WMMouseClick(int Button = Button1, int X = 0, int Y = 0);
+ WMMouseClick relative_to(const WMWidget &w) const;
+ WMMouseClick relative_to(const WMWidget *w) const;
+ WMMouseClick b_relative_to(const WMWidget &w) const;
+ WMMouseClick b_relative_to(const WMWidget *w) const;
+};
+
+inline WMMouseClick::WMMouseClick(int Button, int X, int Y)
+: button(Button), x(X), y(Y) { }
+
+inline WMMouseClick
+WMMouseClick::relative_to(const WMWidget &w) const
+{ return WMMouseClick(button, x - w.left(), y - w.top()); }
+
+inline WMMouseClick
+WMMouseClick::relative_to(const WMWidget *w) const
+{ return relative_to(*w); }
+
+inline WMMouseClick
+WMMouseClick::b_relative_to(const WMWidget &w) const
+{ return WMMouseClick(button, x - w.b_left(), y - w.b_top()); }
+
+inline WMMouseClick
+WMMouseClick::b_relative_to(const WMWidget *w) const
+{ return b_relative_to(*w); }
+
+class WMApp {
+ private:
+ static int wWindowSize;
+ static int wArgc;
+ static char ** wArgv;
+ static std::string wName;
+
+ std::vector<WMWindow *> wWindows;
+ mutable int wActiveWindow;
+ mutable int wNextWindow;
+ mutable bool wFinished;
+ mutable WMMouseClick wMouseEvent;
+
+ void create_window(X::Window *dest, int left, int top) const;
+ void Xsetup();
+ void Xwait() const;
+
+ public:
+ static WindowManager::WindowManager wManager;
+ static Xwrapper Xw;
+ static WMPixmap char_pixmaps[3];
+ static WMPixmap checkbox_pixmap, xbutton_pixmap, leds_pixmap[4];
+ static WMPixmap emptybar_pixmap, fullbar_pixmap;
+ static WMPixmap tile_pixmap;
+ static Color colormap[WMColor::numcolors];
+
+ // Always call this function first in main():
+ static void initialize(int argc = 0, char *argv[] = 0);
+ static unsigned int size();
+
+ WMApp();
+ ~WMApp();
+
+ void addwindow(WMWindow *);
+ void addwindow(WMWindow &);
+
+ // Use this call to start the GUI.
+ void run(unsigned int window = 0);
+ void run(int window);
+ void run(WMWindow &);
+ void run(WMWindow *);
+
+ // Use these within callbacks of windows or buttons in order to switch
+ // to a different window, or to exit the GUI.
+ void switch_to(unsigned int window) const;
+ void switch_to(int window) const;
+ void switch_to(WMWindow &) const;
+ void switch_to(WMWindow *) const;
+ void stop() const;
+
+ // Use this within callbacks of windows or buttons in order to play
+ // with other widgets.
+ WMWindow * window(unsigned int) const;
+ WMWindow * current() const;
+ unsigned int currentnum() const;
+
+ // Use this within callbacks to see which mouse button was pressed
+ // and where.
+ const WMMouseClick & mouseclick() const;
+
+ // Windows use this call to see if it's time for them to exit yet.
+ bool done() const;
+
+ // utility functions for windows
+ void mask() const;
+ void repaint() const;
+ void Xshow() const;
+};
+
+inline
+WMApp::WMApp()
+: wActiveWindow(0), wNextWindow(0), wFinished(false) { }
+
+inline
+WMApp::~WMApp()
+{
+ if (wProgramWin == wActiveWin)
+ X::XDestroyWindow(Xw.xdisplay(), wProgramWin);
+ else {
+ X::XDestroyWindow(Xw.xdisplay(), wProgramWin);
+ X::XDestroyWindow(Xw.xdisplay(), wActiveWin);
+ }
+}
+
+inline void
+WMApp::addwindow(WMWindow *w) { wWindows.push_back(w); }
+
+inline void
+WMApp::addwindow(WMWindow &w) { wWindows.push_back(&w); }
+
+inline unsigned int
+WMApp::size() { return wWindowSize; }
+
+inline WMWindow *
+WMApp::window(unsigned int i) const
+{ return i < wWindows.size() ? wWindows[i] : 0; }
+
+inline WMWindow *
+WMApp::current() const { return wWindows[wActiveWindow]; }
+
+inline unsigned int
+WMApp::currentnum() const { return wActiveWindow; }
+
+inline const WMMouseClick &
+WMApp::mouseclick() const { return wMouseEvent; }
+
+inline void
+WMApp::switch_to(unsigned int window) const
+{ if (window < wWindows.size()) wNextWindow = window; }
+
+inline void
+WMApp::switch_to(int window) const
+{
+ if (window >= 0 && window < static_cast<int>(wWindows.size()))
+ wNextWindow = window;
+}
+
+inline void
+WMApp::stop() const { wFinished = true; }
+
+inline bool
+WMApp::done() const { return wFinished || wActiveWindow != wNextWindow; }
+
+#endif
diff --git a/wmcube/wmapp/wmbutton.cc b/wmcube/wmapp/wmbutton.cc
new file mode 100644
index 000000000000..2989a0310f7e
--- /dev/null
+++ b/wmcube/wmapp/wmbutton.cc
@@ -0,0 +1,59 @@
+#include "wmbutton.h"
+#include "wmapp.h"
+#include "wmwindow.h"
+
+// functions for WMButton ------------------------------------------------
+
+WMButton::WMButton()
+{
+ setborder(1);
+ setbgcolor(WMColor(ButtonFace), false);
+ set_top_left_c(WMColor(ButtonBorderBright));
+ set_bottom_right_c(WMColor(ButtonBorderDim));
+}
+
+void
+WMButton::real_display()
+{
+ if (is_active())
+ WMImage::real_display();
+ else
+ // If button is not clickable, don't draw an icon.
+ // Note: If the button has no icon, I recommend that you change its
+ // background color from the default; otherwise the button will always
+ // look as if it is disabled.
+ WMApp::Xw.fill_rectangle(window()->pixmap(), b_position(),
+ WMColor(ButtonFace));
+}
+
+bool
+WMButton::press(int button, int x, int y)
+{
+ if (contains(x, y)) {
+ if (is_active()) {
+ wPressed = true;
+ set_top_left_c(WMColor(ButtonBorderDim));
+ set_bottom_right_c(WMColor(ButtonBorderBright));
+ draw_border();
+ app()->repaint();
+ }
+ return true;
+ }
+ else return false;
+}
+
+bool
+WMButton::release(int button, int x, int y)
+{
+ if (wPressed) {
+ wPressed = false;
+ set_top_left_c(WMColor(ButtonBorderBright));
+ set_bottom_right_c(WMColor(ButtonBorderDim));
+ draw_border();
+ app()->repaint();
+ if (contains(x, y))
+ execute();
+ return true;
+ }
+ else return false;
+}
diff --git a/wmcube/wmapp/wmbutton.h b/wmcube/wmapp/wmbutton.h
new file mode 100644
index 000000000000..83fa1d90f4af
--- /dev/null
+++ b/wmcube/wmapp/wmbutton.h
@@ -0,0 +1,18 @@
+#include "wmimage.h"
+#include "wmcallback.h"
+
+#ifndef _WMBUTTON_H
+#define _WMBUTTON_H
+
+// WMButton: An image that can execute callback functions when clicked upon
+class WMButton : public WMCallback, public WMImage {
+ private:
+ void real_display();
+
+ public:
+ WMButton();
+ bool press(int button, int x, int y);
+ bool release(int button, int x, int y);
+};
+
+#endif
diff --git a/wmcube/wmapp/wmcallback.cc b/wmcube/wmapp/wmcallback.cc
new file mode 100644
index 000000000000..9fb2a9468f5a
--- /dev/null
+++ b/wmcube/wmapp/wmcallback.cc
@@ -0,0 +1,34 @@
+#include "wmcallback.h"
+
+// functions for WMCallback ----------------------------------------------
+
+void
+WMCallback::execute()
+{
+ // execute all callbacks for this object, in order
+ for (unsigned int i = 0; i < numcallbacks(); i++)
+ runcallback(i);
+}
+
+bool
+WMCallback::press(int button, int x, int y)
+{
+ if (contains(x, y)) {
+ wPressed = true;
+ return true;
+ }
+ else return false;
+}
+
+bool
+WMCallback::release(int button, int x, int y)
+{
+ if (wPressed) {
+ wPressed = false;
+ if (contains(x,y))
+ execute();
+ return true;
+ }
+ else return false;
+}
+
diff --git a/wmcube/wmapp/wmcallback.h b/wmcube/wmapp/wmcallback.h
new file mode 100644
index 000000000000..de9aab471b56
--- /dev/null
+++ b/wmcube/wmapp/wmcallback.h
@@ -0,0 +1,113 @@
+#include <vector>
+#include "wmwidget.h"
+#include "wmclickable.h"
+
+#ifndef _WMCALLBACK_H
+#define _WMCALLBACK_H
+
+using std::vector;
+
+// WMCallback: A class capable of setting and executing callback functions.
+class WMCallback : public virtual WMWidget, public virtual WMClickable {
+ public:
+ typedef void (* data_func)(const WMApp *, void *);
+ typedef void (* widget_func)(const WMApp *, WMWidget *, void *);
+
+ private:
+ class callback {
+ public: virtual void execute(const WMApp *) = 0;
+ };
+
+ class data_callback : public callback {
+ data_func func;
+ void * data;
+ public:
+ data_callback(data_func, void *);
+ void execute(const WMApp *);
+ };
+
+ class widget_callback : public callback {
+ widget_func func;
+ WMWidget * widget;
+ void * data;
+ public:
+ widget_callback(widget_func, WMWidget *, void *);
+ void execute(const WMApp *);
+ };
+
+ vector<callback*> wCallback;
+
+ public:
+ WMCallback();
+ WMCallback(data_func, void * = 0);
+ WMCallback(widget_func, WMWidget *, void * = 0);
+ virtual ~WMCallback() { clearcallbacks(); }
+
+ unsigned int numcallbacks() const;
+ void addcallback(data_func, void * = 0);
+ void addcallback(widget_func, WMWidget *, void * = 0);
+ void runcallback(unsigned int i);
+ void clearcallbacks();
+
+ // check to see if a mouse click hit the widget; if so, run callbacks
+ virtual bool press(int button, int x, int y);
+ virtual bool release(int button, int x, int y);
+ virtual void execute();
+};
+
+// inline functions for WMCallback ---------------------------------------
+
+inline
+WMCallback::data_callback::data_callback(data_func f, void *datap)
+: func(f), data(datap) { }
+
+inline void
+WMCallback::data_callback::execute(const WMApp *app)
+{ (func)(app, data); }
+
+inline
+WMCallback::widget_callback::widget_callback
+(widget_func f, WMWidget *w, void *datap)
+: func(f), widget(w), data(datap) { }
+
+inline void
+WMCallback::widget_callback::execute(const WMApp *app)
+{ (func)(app, widget, data); }
+
+inline
+WMCallback::WMCallback()
+{ }
+
+inline
+WMCallback::WMCallback(data_func f, void *data)
+{ addcallback(f, data); }
+
+inline
+WMCallback::WMCallback(widget_func f, WMWidget *w, void *data)
+{ addcallback(f, w, data); }
+
+inline void
+WMCallback::addcallback(data_func f, void *data)
+{ wCallback.push_back(new data_callback(f, data)); }
+
+inline void
+WMCallback::addcallback(widget_func f, WMWidget *w, void *data)
+{ wCallback.push_back(new widget_callback(f, w, data)); }
+
+inline void
+WMCallback::runcallback(unsigned int i)
+{ wCallback[i]->execute(app()); }
+
+inline unsigned int
+WMCallback::numcallbacks() const { return wCallback.size(); }
+
+inline void
+WMCallback::clearcallbacks()
+{
+ for (vector<callback *>::iterator i = wCallback.begin();
+ i != wCallback.end(); ++i)
+ delete *i;
+ wCallback.clear();
+}
+
+#endif
diff --git a/wmcube/wmapp/wmcanvas.cc b/wmcube/wmapp/wmcanvas.cc
new file mode 100644
index 000000000000..e1cf273c39f1
--- /dev/null
+++ b/wmcube/wmapp/wmcanvas.cc
@@ -0,0 +1,160 @@
+#include <vector>
+#include "wmcanvas.h"
+#include "wmwindow.h"
+#include "wmapp.h"
+
+// functions for WMCanvas ------------------------------------------------
+
+WMCanvas::WMCanvas(const WMPixmap * pm)
+: WMImage(pm), wCurrentColor(WMColor(Bright)), wBuffered(false) { }
+
+WMCanvas::WMCanvas(const WMPixmap & pm)
+: WMImage(pm), wCurrentColor(WMColor(Bright)), wBuffered(false) { }
+
+WMCanvas::WMCanvas(char *xpm[])
+: WMImage(xpm), wCurrentColor(WMColor(Bright)), wBuffered(false) { }
+
+// these are all variants of the drawing functions in xwrapper.h.
+// Unlike there, they are relative to the borders of the widget.
+// Note that icon() should return an XPM which is the dimension of
+// the WMCanvas _minus_ the border thickness.
+
+/*void
+WMCanvas::copy_buffer()
+{
+ WMApp::Xw.copy_rectangle(*icon(), window()->pixmap(), 0, 0,
+ b_width(), b_height(), b_left(), b_top());
+// draw_border();
+}*/
+
+// don't use this macro in your programs, it's just to make my life easier in
+// the WMCanvas method definitions
+#define COPY_BUFFER() if (! buffered()) { display() /*copy_buffer()*/; }
+
+Color
+WMCanvas::get_point(int rel_x, int rel_y) const
+{ return WMApp::Xw.get_point(*icon(), rel_x, rel_y); }
+
+void
+WMCanvas::draw_point(int rel_x, int rel_y)
+{
+ WMApp::Xw.draw_point(*p_icon(), rel_x, rel_y, color());
+ COPY_BUFFER();
+}
+
+void
+WMCanvas::draw_line(int rel_x1, int rel_y1, int rel_x2, int rel_y2)
+{
+ WMApp::Xw.draw_line(*p_icon(), rel_x1, rel_y1, rel_x2, rel_y2, color());
+ COPY_BUFFER();
+}
+
+void
+WMCanvas::draw_arc(int x, int y, int width, int height, int angle1, int angle2)
+{
+ WMApp::Xw.draw_arc(*p_icon(), x, y, width, height, angle1, angle2, color());
+ COPY_BUFFER();
+}
+
+void
+WMCanvas::draw_lines(const vector<X::XPoint>& points)
+{
+ X::XPoint *p = new X::XPoint[points.size()];
+ for (size_t i = 0; i < points.size(); ++i)
+ {
+ p[i].x = points[i].x;
+ p[i].y = points[i].y;
+ }
+ WMApp::Xw.draw_lines(*p_icon(), p, points.size(), color());
+ delete[] p;
+ COPY_BUFFER();
+}
+
+void
+WMCanvas::draw_horizontal_gradient(int rel_x1, int rel_y1, int rel_x2,
+ int rel_y2, Color c1, Color c2, double amt)
+{
+ WMApp::Xw.draw_horizontal_gradient(*p_icon(), rel_x1, rel_y1, rel_x2, rel_y2,
+ c1, c2, amt);
+ COPY_BUFFER();
+}
+
+void
+WMCanvas::draw_vertical_gradient(int rel_x1, int rel_y1, int rel_x2,
+ int rel_y2, Color c1, Color c2, double amt)
+{
+ WMApp::Xw.draw_vertical_gradient(*p_icon(), rel_x1, rel_y1, rel_x2, rel_y2,
+ c1, c2, amt);
+ COPY_BUFFER();
+}
+
+void
+WMCanvas::empty_rectangle(int rel_x, int rel_y, int w, int h, int thickness)
+{
+ WMApp::Xw.draw_border(*p_icon(), rel_x, rel_y, w, h, thickness,
+ color(), color(), color());
+ COPY_BUFFER();
+}
+
+void
+WMCanvas::empty_rectangle(const WMRectangle & rel_posn, int thickness)
+{
+ WMApp::Xw.draw_border(*p_icon(), rel_posn, thickness,
+ color(), color(), color());
+ COPY_BUFFER();
+}
+
+void
+WMCanvas::fill_rectangle(int rel_x, int rel_y, int w, int h)
+{
+ WMApp::Xw.fill_rectangle(*p_icon(), rel_x, rel_y, w, h, color());
+ COPY_BUFFER();
+}
+
+void
+WMCanvas::fill_rectangle(const WMRectangle & rel_posn)
+{
+ WMApp::Xw.fill_rectangle(*p_icon(), rel_posn, color());
+ COPY_BUFFER();
+}
+
+void
+WMCanvas::fill_arc(int x, int y, int width, int height, int angle1, int angle2)
+{
+ WMApp::Xw.fill_arc(*p_icon(), x, y, width, height, angle1, angle2, color());
+ COPY_BUFFER();
+}
+
+void
+WMCanvas::fill_polygon(const vector<X::XPoint>& points, Xwrapper::XShape shape)
+{
+ X::XPoint *p = new X::XPoint[points.size()];
+ for (size_t i = 0; i < points.size(); ++i)
+ {
+ p[i].x = points[i].x;
+ p[i].y = points[i].y;
+ }
+ WMApp::Xw.fill_polygon(*p_icon(), p, points.size(), color(), shape);
+ delete[] p;
+ COPY_BUFFER();
+}
+
+void
+WMCanvas::copy_rectangle(const WMPixmap & source, int source_x, int source_y,
+ int source_w, int source_h, int dest_x, int dest_y)
+{
+ WMApp::Xw.copy_rectangle(source, *p_icon(), source_x, source_y,
+ source_w, source_h, dest_x, dest_y);
+ COPY_BUFFER();
+}
+
+void
+WMCanvas::copy_rectangle(const WMPixmap & source, const WMRectangle & posn,
+ int dest_x, int dest_y)
+{
+ WMApp::Xw.copy_rectangle(source, *p_icon(), posn, dest_x, dest_y);
+ COPY_BUFFER();
+}
+
+#undef COPY_BUFFER
+
diff --git a/wmcube/wmapp/wmcanvas.h b/wmcube/wmapp/wmcanvas.h
new file mode 100644
index 000000000000..aa596fc4f5b1
--- /dev/null
+++ b/wmcube/wmapp/wmcanvas.h
@@ -0,0 +1,68 @@
+#include <vector>
+#include "wmimage.h"
+
+#ifndef _WMCANVAS_H
+#define _WMCANVAS_H
+
+using std::vector;
+
+// WMCanvas: a widget inheriting from WMImage that allows you to change the
+// image using drawing functions
+class WMCanvas : public virtual WMImage {
+ Color wCurrentColor;
+ bool wBuffered;
+ public:
+ WMCanvas(const WMPixmap * pm = 0);
+ WMCanvas(const WMPixmap & pm);
+ WMCanvas(char *xpm[]);
+
+ void setcolor(Color);
+ void setbuffered(bool);
+ Color color() const;
+ bool buffered() const;
+
+ // these are all variants of the drawing functions in xwrapper.h.
+ // Unlike there, they are relative to the borders of the widget.
+ Color get_point(int rel_x, int rel_y) const;
+ void draw_point(int rel_x, int rel_y);
+ void draw_line(int rel_x1, int rel_y1, int rel_x2, int rel_y2);
+ void draw_arc(int x, int y, int width, int height, int angle1, int angle2);
+ //angles are in units of degrees * 64
+ void draw_lines(const vector<X::XPoint>& points);
+ //X::XPoint is simply a struct { short x, y };
+ void draw_horizontal_gradient(int rel_x1, int rel_y1, int rel_x2, int rel_y2,
+ Color c1, Color c2, double amount = 1.0);
+ void draw_vertical_gradient(int rel_x1, int rel_y1, int rel_x2, int rel_y2,
+ Color c1, Color c2, double amount = 1.0);
+ void empty_rectangle(int rel_x, int rel_y, int width, int height,
+ int thickness);
+ void empty_rectangle(const WMRectangle & rel_posn, int thickness);
+ void fill_rectangle(int rel_x, int rel_y, int width, int height);
+ void fill_rectangle(const WMRectangle & rel_posn);
+ void fill_arc(int x, int y, int width, int height, int angle1, int angle2);
+ //angles are in units of degrees * 64
+ void fill_polygon(const vector<X::XPoint>& points,
+ Xwrapper::XShape shape = Xwrapper::complex);
+ //see xwrapper.h for the meaning of shape
+ void copy_rectangle(const WMPixmap & source, int source_x, int source_y,
+ int source_w, int source_h,
+ int dest_x = 0, int dest_y = 0);
+ void copy_rectangle(const WMPixmap & source, const WMRectangle & posn,
+ int dest_x = 0, int dest_y = 0);
+};
+
+// inline functions for WMCanvas -----------------------------------------
+
+inline void
+WMCanvas::setcolor(Color c) { wCurrentColor = c; }
+
+inline void
+WMCanvas::setbuffered(bool b) { wBuffered = b; }
+
+inline Color
+WMCanvas::color() const { return wCurrentColor; }
+
+inline bool
+WMCanvas::buffered() const { return wBuffered; }
+
+#endif
diff --git a/wmcube/wmapp/wmclickable.h b/wmcube/wmapp/wmclickable.h
new file mode 100644
index 000000000000..419386af1e01
--- /dev/null
+++ b/wmcube/wmapp/wmclickable.h
@@ -0,0 +1,21 @@
+#ifndef _WMCLICKABLE_H
+#define _WMCLICKABLE_H
+
+// WMClickable: Widgets that are clickable should inherit from this class.
+class WMClickable {
+ protected:
+ bool wPressed;
+ public:
+ WMClickable();
+ virtual ~WMClickable() { }
+
+ virtual bool press(int button, int x, int y) = 0;
+ virtual bool release(int button, int x, int y) = 0;
+};
+
+// inline functions for WMClickable --------------------------------------
+
+inline WMClickable::WMClickable()
+: wPressed(false) { }
+
+#endif
diff --git a/wmcube/wmapp/wmellipse.cc b/wmcube/wmapp/wmellipse.cc
new file mode 100644
index 000000000000..4bbe1c73c928
--- /dev/null
+++ b/wmcube/wmapp/wmellipse.cc
@@ -0,0 +1,58 @@
+#include <cmath>
+#include "wmellipse.h"
+#include "wmwindow.h"
+#include "wmapp.h"
+
+// functions for WMEllipse -----------------------------------------------
+
+void
+WMEllipse::draw_border()
+{ WMEllipse::draw_border(top_left_c(), bottom_right_c(), 5 /* steps */); }
+
+void
+WMEllipse::draw_border(Color c1, Color c2, int steps)
+{
+ if (border()) {
+ X::XGCValues gcv;
+ gcv.line_width = border();
+ X::XChangeGC(WMApp::Xw.xdisplay(), window()->pixmap().gc,
+ X_MACRO(GCLineWidth), &gcv);
+
+ // These dimensions are all experimentally determined :)
+ int l = left() + (border() - 1) / 2,
+ t = top() + (border() - 1) / 2,
+ w = width() - border() + (1 - border() % 2),
+ h = height() - border() + (1 - border() % 2);
+
+ const double weight_inc = 1.0 / (steps + 1);
+ const double angle_inc = 45 / steps;
+ for (double weight = weight_inc, angle = 0; angle < 44;
+ weight += weight_inc, angle += angle_inc)
+ {
+ Color c = Color::alpha_blend(c1, c2, weight);
+ WMApp::Xw.draw_arc(window()->pixmap(), l, t, w, h, (int)(angle * 64),
+ (int)(angle_inc * 64), c);
+ WMApp::Xw.draw_arc(window()->pixmap(), l, t, w, h, (int)((270 - angle) * 64),
+ (int)(-angle_inc * 64), c);
+ }
+
+ WMApp::Xw.draw_arc(window()->pixmap(), l, t, w, h, 45 * 64, 180 * 64, c1);
+ WMApp::Xw.draw_arc(window()->pixmap(), l, t, w, h, 270 * 64, 90 * 64, c2);
+
+ gcv.line_width = 0;
+ X::XChangeGC(WMApp::Xw.xdisplay(), window()->pixmap().gc,
+ X_MACRO(GCLineWidth), &gcv);
+ }
+}
+
+bool
+WMEllipse::contains(int x, int y) const
+{
+ double h_axis = std::ldexp(double(width()), -1);
+ double v_axis = std::ldexp(double(height()), -1);
+ double xc = (h_axis + left() - 0.5 - x) / h_axis;
+ xc *= xc;
+ double yc = (v_axis + top() - 0.5 - y) / v_axis;
+ yc *= yc;
+ return ((xc + yc) <= 1.0);
+}
diff --git a/wmcube/wmapp/wmellipse.h b/wmcube/wmapp/wmellipse.h
new file mode 100644
index 000000000000..b26000e03382
--- /dev/null
+++ b/wmcube/wmapp/wmellipse.h
@@ -0,0 +1,21 @@
+#include "wmwidget.h"
+
+#ifndef _WMELLIPSE_H
+#define _WMELLIPSE_H
+
+// WMEllipse: Widgets inherited from this class will be displayed within an
+// elliptical border. Simply inherit from WMEllipse and the desired widget.
+// Note: In order to get a circle, you must make the widget's width the same
+// as its height, for example by placing it inside a WMFrame with padding.
+class WMEllipse : public virtual WMWidget {
+ protected:
+ virtual void draw_border(Color c1, Color c2, int nsteps);
+ virtual void draw_border();
+
+ public:
+ bool contains(int x, int y) const;
+
+ virtual ~WMEllipse() { }
+};
+
+#endif
diff --git a/wmcube/wmapp/wmframe.cc b/wmcube/wmapp/wmframe.cc
new file mode 100644
index 000000000000..197e744480df
--- /dev/null
+++ b/wmcube/wmapp/wmframe.cc
@@ -0,0 +1,303 @@
+#include <iostream>
+#include <cstdarg>
+#include "wmframe.h"
+#include "wmclickable.h"
+#include "wmwindow.h"
+#include "wmapp.h"
+
+using std::cerr;
+using std::endl;
+
+// functions for WMFrame -------------------------------------------------
+
+WMFrame::~WMFrame()
+{
+ if (wClipMask) {
+ WMApp::Xw.free_pixmap(*wClipMask);
+ delete wClipMask;
+ }
+}
+
+void
+WMFrame::real_display()
+{
+ if (border() || !transparency())
+ // fill frame with background color before adding children
+ WMApp::Xw.fill_rectangle(window()->pixmap(), b_position(),
+ WMColor(Background));
+}
+
+void
+WMFrame::display()
+{
+ if (!(parent() && parent()->is_displayed())) return;
+ real_display();
+ setdisplayed(true);
+
+ X::GC old_gc = 0;
+ if (wClipMask) {
+ // keep children from drawing where they shouldn't
+ old_gc = window()->pixmap().gc;
+ window()->pixmap().gc = wClipMask->gc;
+ }
+ for (unsigned int i = 0; i < numchildren(); i++)
+ child(i)->display();
+ if (wClipMask)
+ window()->pixmap().gc = old_gc;
+
+ draw_border();
+}
+
+void
+WMFrame::hide()
+{
+ if (!is_displayed()) return;
+ for (unsigned int i = 0; i < numchildren(); i++)
+ child(i)->hide();
+ real_hide();
+ setdisplayed(false);
+}
+
+void
+WMFrame::activate()
+{
+ if (is_active()) return;
+ setactive(true);
+ for (unsigned int i = 0; i < numchildren(); i++)
+ child(i)->activate();
+ real_activate();
+ if (app()->done()) return;
+ if (is_displayed()) display();
+}
+
+void
+WMFrame::deactivate()
+{
+ if (!is_active()) return;
+ real_deactivate();
+ for (unsigned int i = 0; i < numchildren(); i++)
+ child(i)->deactivate();
+ setactive(false);
+ if (is_displayed()) display();
+}
+
+bool
+WMFrame::addchild(WMWidget *w)
+{
+ if (is_displayed()) return false;
+
+ // child cannot already have a parent
+ if (w->parent()) {
+ cerr << "WMError: Reparenting child widget " << w << " to " << this
+ << " not allowed" << endl;
+ return false;
+ }
+
+ // child cannot recursively contain "this"
+ const WMWidget *test = this;
+ while ((test = test->parent()))
+ if (test == w) {
+ cerr << "WMError: Widget " << w << " cannot be its own ancestor" << endl;
+ return false;
+ }
+
+ w->setparent(this);
+ wChildren.push_back(w);
+ return true;
+}
+
+bool
+WMFrame::removechild(WMWidget *w)
+{
+ if (is_displayed()) return false;
+ for (unsigned int i = 0; i < numchildren(); i++)
+ if (w == child(i)) {
+ child(i)->setparent(0);
+ wChildren.erase(wChildren.begin() + i);
+ return true;
+ }
+ cerr << "WMError: Widget " << w << " is not a child of " << this << endl;
+ return false;
+}
+
+void
+WMFrame::clip(char *xpm_array[65])
+{
+ if (! is_displayed()) setaspectratios();
+ for (unsigned int i = 0; i < numchildren(); i++)
+ child(i)->clip(xpm_array);
+
+ if (! transparency() || border()) { // create a mask for drawing children
+ if (!wClipMask) {
+ wClipMask = new WMPixmap;
+ WMApp::Xw.create_pixmap(*wClipMask, xpm_array);
+ X::XFreePixmap(WMApp::Xw.xdisplay(), wClipMask->pixmap);
+ // free unused pixmap
+ wClipMask->pixmap = wClipMask->mask;
+ wClipMask->mask = 0; // muck around so xwrapper::free_pixmap works right
+ X::XSetClipMask(WMApp::Xw.xdisplay(), wClipMask->gc, wClipMask->pixmap);
+ }
+
+ for (int col = left(); col < right(); col++)
+ for (int row = top(); row < bottom(); row++)
+ xpm_array[row + 3][col] = contains(col, row) ? 'X' : ' ';
+ // clip in the whole frame on the window's mask, but don't let widgets
+ // draw outside the frame
+ }
+}
+
+bool
+WMFrame::press(int button, int x, int y)
+{
+ WMClickable *c;
+
+ if (!contains(x, y)) {
+ return false; // button pressed is not within this frame
+ }
+
+ for (unsigned int i = 0; i < numchildren(); i++)
+ if ((c = dynamic_cast<WMClickable *>(child(i))))
+ if (c->press(button, x, y)) return true;
+ return false;
+}
+
+// If the mouse button is released over the WMWidget on which it was
+// initially pressed, that widget's callbacks should be executed.
+bool
+WMFrame::release(int button, int x, int y)
+{
+ WMClickable *c;
+
+ for (unsigned int i = 0; i < numchildren(); i++)
+ if ((c = dynamic_cast<WMClickable *>(child(i))))
+ if (c->release(button, x, y)) return true;
+ return false;
+}
+
+// This function needs to be fixed to take care of leftover space if the
+// integer division wipes out a remainder.
+bool
+WMFrame::setaspectratios(vector<int> r)
+{
+ int totalspace = 0, availablespace;
+ if (wRatiosSet || numchildren() == 0) return true; // nothing to do
+
+ // if insufficient space to display any children, return an error
+ if (width() < 2 * border() || height() < 2 * border())
+ { cerr << "WMError: Frame " << this << " too small" << endl; return false; }
+
+ if (r.size() > 0) {
+ // Widgets that do not already have a size, for whom there is no
+ // corresponding element in the vector of size ratios, will be
+ // made size zero
+ while (r.size() < numchildren())
+ r.push_back(0);
+ }
+
+ // calculate total space consumed by widgets with known sizes
+ for (unsigned int i = 0; i < numchildren(); i++)
+ totalspace += child(i)->par_to_parent();
+ availablespace = b_parallel() - totalspace - (numchildren() - 1) * padding();
+
+ // If widgets of known size take up more space than the frame has,
+ // rescale them in proportion and do not display the other widgets.
+ if (availablespace < 1) {
+ int numgoodchildren = 0;
+ for (unsigned int i = 0; i < numchildren(); i++) {
+ if (child(i)->par_to_parent() > 0)
+ numgoodchildren++;
+ }
+ availablespace = b_parallel() - (numgoodchildren - 1) * padding();
+ if (availablespace < 1 || numgoodchildren == 0) {
+ // not enough space, even for only the known-size widgets
+ cerr << "WMError: Frame " << this << " too small" << endl;
+ return false;
+ }
+
+ for (unsigned int i = 0; i < numchildren(); i++) {
+ if (child(i)->par_to_parent() > 0) {
+ double ratio = child(i)->par_to_parent() / totalspace;
+ child(i)->set_par_to_parent(static_cast<int>
+ (ratio * availablespace));
+ }
+ }
+ }
+
+ else { // Otherwise, scale the unknown-sized widgets appropriately.
+ double ratiosum = 0;
+ for (unsigned int i = 0; i < numchildren(); i++) {
+ if (child(i)->par_to_parent() == 0)
+ ratiosum += ((r.size() > 0) ? r[i] : 1.0);
+ }
+ for (unsigned int i = 0; i < numchildren(); i++)
+ if (child(i)->par_to_parent() == 0) {
+ double ratio = (r.size() ? r[i] : 1.0) / ratiosum;
+ child(i)->set_par_to_parent(static_cast<int>
+ (ratio * availablespace));
+ }
+ }
+
+ // Scale widgets in the perpendicular direction if necessary
+ for (unsigned int i = 0; i < numchildren(); i++)
+ if (child(i)->perp_to_parent() <= 0
+ || child(i)->perp_to_parent() > b_perpend())
+ child(i)->set_perp_to_parent(b_perpend());
+
+ // Finally, set the location of all these child widgets.
+ int posn = 0;
+ for (unsigned int i = 0; i < numchildren(); i++) {
+ if (child(i)->width() && child(i)->height()) {
+ if (orientation() == Orientation::Horizontal) {
+ child(i)->setleft(b_left() + posn);
+ child(i)->settop(b_top());
+ }
+ else {
+ child(i)->setleft(b_left());
+ child(i)->settop(b_top() + posn);
+ }
+ posn += child(i)->par_to_parent() + padding();
+ }
+ }
+
+ // Deal with rounding errors: if the last widget doesn't reach all the
+ // way to the end of the parent, force it to. This isn't the best way
+ // to do this, but it's the easiest :)
+ if (child(numchildren() - 1)->par_to_parent()) {
+ WMWidget *lastchild = child(numchildren() - 1);
+ if (orientation() == Orientation::Horizontal)
+ lastchild->setwidth(right() - border() - lastchild->left());
+ else
+ lastchild->setheight(bottom() - border() - lastchild->top());
+ }
+
+ wRatiosSet = true;
+ return true;
+}
+
+// varargs version for people too lazy to create an std::vector.
+// Use with caution: the number of arguments MUST equal the number
+// of children, since we can't check the number of arguments of a
+// varargs function within the function. I'm not sure what happens
+// if you try to provide this function with fewer arguments than
+// the widget has children, but I imagine it's bad.
+bool
+WMFrame::setaspectratios(int ratio, ...)
+{
+ if (numchildren() < 1)
+ // nothing to do, return OK
+ return true;
+
+ std::va_list args;
+ vector<int> v = vector<int>();
+ v.push_back(ratio);
+
+ va_start(args, ratio);
+ for (unsigned int i = 1; i < numchildren(); i++) {
+ ratio = va_arg(args, int);
+ v.push_back(ratio);
+ }
+ va_end(args);
+
+ return setaspectratios(v);
+}
+
diff --git a/wmcube/wmapp/wmframe.h b/wmcube/wmapp/wmframe.h
new file mode 100644
index 000000000000..977268bcdf6d
--- /dev/null
+++ b/wmcube/wmapp/wmframe.h
@@ -0,0 +1,109 @@
+#include <vector>
+#include "wmwidget.h"
+#include "wmclickable.h"
+#include "xwrapper.h"
+
+#ifndef _WMFRAME_H
+#define _WMFRAME_H
+
+using std::vector;
+
+// WMFrame: A widget that can contain other widgets
+class WMFrame : public virtual WMClickable, public virtual WMWidget {
+ private:
+ int wPadding;
+ bool wRatiosSet;
+ bool wTransparentPadding;
+ WMPixmap *wClipMask;
+
+ protected:
+ vector<WMWidget *> wChildren;
+ virtual void real_display();
+
+ public:
+ WMFrame();
+ virtual ~WMFrame();
+
+ WMWidget * child(int i) const;
+ unsigned int numchildren() const;
+ bool addchild(WMWidget &child);
+ bool addchild(WMWidget *child);
+ bool removechild(WMWidget &child);
+ bool removechild(WMWidget *child);
+
+ void clip(char *xpm_array[65]);
+ virtual void display();
+ virtual void hide();
+ virtual void activate();
+ virtual void deactivate();
+
+ int padding() const;
+ bool transparency() const;
+
+ void setpadding(int);
+ void settransparency(bool);
+
+ // what to do if a mouse button is pressed?
+ bool press(int button, int x, int y);
+ bool release(int button, int x, int y);
+
+ // NOTE: The setaspectratios() function must be called on frames / windows
+ // in order from Parent to Child widgets!
+ //
+ // if passed no argument, this function allots equal space to
+ // all child widgets that do not already have a declared size.
+ // Otherwise, it uses the vector or va_list it's passed as a list of how
+ // the widgets should be sized relative to each other. Note that even though
+ // widgets with non-zero sizes are not resized, the vector of sizes must
+ // contain dummy place-holder arguments for them anyway.
+ //
+ // For example, if the frame contains 4 widgets a,b,c,d, of which b already
+ // has a known (non-zero) size, and you call this function with argument
+ // being the vector (5,4,3), then widget a will be allotted 5/(5+3) = 5/8
+ // and widget c will be allotted 3/(5+3) = 3/8 of the space not already
+ // allotted to widget b. Widget d will not be displayed. On the other hand,
+ // if you call this function with no argument, then a, c, and d will EACH be
+ // allocated 1/3 of the space not already taken by widget b.
+ //
+ // This function, however it is called, will scale widgets to the
+ // perpendicular size of the frame if their perpendicular dimension is not
+ // known. If the perpendicular size of the widget IS known, it will be
+ // rescaled only if the widget is larger than the frame in that dimension.
+ bool setaspectratios(vector<int> ratiolist = vector<int>());
+
+ // a va_list version for people too lazy to create an std::vector:
+ bool setaspectratios(int ratio1, ...);
+};
+
+// inline functions for WMFrame ------------------------------------------
+
+inline WMFrame::WMFrame()
+: wPadding(2), wRatiosSet(false), wTransparentPadding(true), wClipMask(0),
+ wChildren() { setborder(0); }
+
+inline unsigned int
+WMFrame::numchildren() const { return wChildren.size(); }
+
+inline WMWidget *
+WMFrame::child(int i) const { return wChildren[i]; }
+
+inline bool
+WMFrame::addchild(WMWidget &child) { return addchild(&child); }
+
+inline bool
+WMFrame::removechild(WMWidget &child) { return removechild(&child); }
+
+inline int
+WMFrame::padding() const { return wPadding; }
+
+inline bool
+WMFrame::transparency() const { return wTransparentPadding; }
+
+inline void
+WMFrame::setpadding(int p) { if (!is_displayed()) wPadding = p; }
+
+inline void
+WMFrame::settransparency(bool b)
+{ if (!is_displayed()) wTransparentPadding = b; }
+
+#endif
diff --git a/wmcube/wmapp/wmhistory.cc b/wmcube/wmapp/wmhistory.cc
new file mode 100644
index 000000000000..5900069d0f1c
--- /dev/null
+++ b/wmcube/wmapp/wmhistory.cc
@@ -0,0 +1,67 @@
+#include <iostream>
+#include "wmhistory.h"
+#include "wmwindow.h"
+#include "wmapp.h"
+
+using std::cerr;
+using std::endl;
+
+// functions for WMHistory -----------------------------------------------
+// added by Jason
+
+void WMHistory::setvalue (int value, int index, bool dodisplay)
+{
+ if (index == -1)
+ {
+ wValues.pop_back();
+ wValues.push_front(value);
+ }
+ else
+ wValues[index] = value;
+ if (dodisplay)
+ display();
+}
+
+void WMHistory::setvalues (const vector<int>& values, bool dodisplay)
+{
+ vector<int>::const_iterator src = values.begin();
+ deque<int>::iterator dest = wValues.begin();
+ while (src != values.end() && dest != wValues.end())
+ *dest++ = *src++;
+ while (dest != wValues.end())
+ *dest++ = 0;
+ if (dodisplay)
+ display();
+}
+
+void WMHistory::clear(bool dodisplay)
+{ setvalues(vector<int>(0), dodisplay); }
+
+void WMHistory::real_display ()
+// XXX: Currently no vertical style, since it doesn't make a lot of sense
+{
+ WMApp::Xw.fill_rectangle(window()->pixmap(), b_position(),
+ WMColor(Background));
+ if (!wTotal)
+ return;
+ if (width() < 2 * border() || height() < 2 * border())
+ { cerr << "WMError: History " << this << " too small" << endl; return; }
+
+ for (int x = 0; x < b_width(); x++)
+ {
+ int h = static_cast<int> (fraction(x) * b_height());
+ if (h < 1)
+ continue;
+ else if (h == 1)
+ WMApp::Xw.draw_point(window()->pixmap(), b_right() - 1 - x, b_bottom() - 1
+ , WMColor(Bright));
+ else
+ {
+ WMApp::Xw.draw_line(window()->pixmap(), b_right() - 1 - x, b_bottom() - h,
+ b_right() - 1 - x, b_bottom() - h + 1, WMColor(Bright));
+ if (h > 2)
+ WMApp::Xw.draw_line(window()->pixmap(), b_right() - 1 - x, b_bottom() - h + 2, b_right() - 1 - x, b_bottom() - 1, WMColor(Medium));
+ }
+ }
+}
+
diff --git a/wmcube/wmapp/wmhistory.h b/wmcube/wmapp/wmhistory.h
new file mode 100644
index 000000000000..cd7c4ccc2478
--- /dev/null
+++ b/wmcube/wmapp/wmhistory.h
@@ -0,0 +1,71 @@
+#include <vector>
+#include <deque>
+#include "wmwidget.h"
+
+#ifndef _WMHISTORY_H
+#define _WMHISTORY_H
+
+using std::vector;
+using std::deque;
+
+// WMHistory: a progress / load meter showing a history
+// added by Jason
+// XXX: Should we have an option to rescale the graph automatically?
+class WMHistory : public virtual WMWidget {
+ private:
+ static const int size = 64; //Number of values that we keep around
+ deque<int> wValues;
+ int wTotal;
+ void real_display();
+
+ public:
+ WMHistory();
+ WMHistory(int total);
+ WMHistory(const vector<int>& values, int total);
+ // XXX: Too lazy to make any other constructors.
+
+ // All indexed functions refer to the element added that many units ago.
+ // An index of -1 therefore appends a new value to the graph.
+ void setvalue(int value, int index = -1, bool dodisplay = true);
+
+ //setvalues zeros the history before copying the given values in.
+ void setvalues(const vector<int>& values, bool dodisplay = true);
+ void setvalues(const vector<int>& values, int total, bool dodisplay = true);
+ void clear(bool dodisplay = true);
+
+ void settotal(int total, bool dodisplay = true);
+
+ int value(int index = 0) const;
+ int total() const;
+ double fraction(int index = 0) const;
+};
+
+// inline functions for WMHistory ----------------------------------------
+
+inline WMHistory::WMHistory ()
+: wValues(WMHistory::size, 0), wTotal(0) { }
+
+inline WMHistory::WMHistory (int total)
+: wValues(WMHistory::size, 0), wTotal(total) { }
+
+inline WMHistory::WMHistory (const vector<int>& values, int total)
+: wValues(size), wTotal(total)
+{ setvalues(values, false); }
+
+inline void WMHistory::setvalues(const vector<int>& values, int total,
+ bool dodisplay)
+{ wTotal = total; setvalues(values, dodisplay); }
+
+inline void WMHistory::settotal (int total, bool dodisplay)
+{ wTotal = total; if (dodisplay) display(); }
+
+inline int WMHistory::value (int index) const
+{ return wValues[index]; }
+
+inline int WMHistory::total () const
+{ return wTotal; }
+
+inline double WMHistory::fraction (int index) const
+{ return static_cast<double>(wValues[index]) / wTotal; }
+
+#endif
diff --git a/wmcube/wmapp/wmimage.cc b/wmcube/wmapp/wmimage.cc
new file mode 100644
index 000000000000..9d2b115e6f76
--- /dev/null
+++ b/wmcube/wmapp/wmimage.cc
@@ -0,0 +1,91 @@
+#include <iostream>
+#include "wmimage.h"
+#include "wmwindow.h"
+#include "wmapp.h"
+
+using std::cerr;
+using std::endl;
+
+// functions for WMImage -------------------------------------------------
+
+WMImage::WMImage(const WMPixmap *pm)
+: wBGColor(WMColor(Background)) { seticon(pm); }
+
+WMImage::WMImage(const WMPixmap &pm)
+: wBGColor(WMColor(Background)) { seticon(pm); }
+
+WMImage::WMImage(char *xpm[])
+: wBGColor(WMColor(Background)) { seticon(xpm); }
+
+WMImage::~WMImage()
+{ if (icon()) WMApp::Xw.free_pixmap(wIcon); }
+
+void
+WMImage::seticon(bool dodisplay)
+{
+ if (icon()) WMApp::Xw.free_pixmap(wIcon);
+ if(WMApp::Xw.create_pixmap(wIcon, b_width(), b_height()))
+ {
+ WMApp::Xw.fill_rectangle(wIcon, 0, 0, b_width(), b_height(), bgcolor());
+ wIconPtr = &wIcon;
+ if (dodisplay) display();
+ }
+ else wIconPtr = 0;
+}
+
+void
+WMImage::seticon(const WMPixmap &pm, bool dodisplay)
+{
+ if (icon()) WMApp::Xw.free_pixmap(wIcon);
+ if (WMApp::Xw.create_pixmap(wIcon, pm))
+ { wIconPtr = &wIcon; if (dodisplay) display(); }
+ else wIconPtr = 0;
+}
+
+void
+WMImage::seticon(char *xpm[], bool dodisplay)
+{
+ if (icon()) WMApp::Xw.free_pixmap(wIcon);
+ if (WMApp::Xw.create_pixmap(wIcon, xpm))
+ { wIconPtr = &wIcon; if (dodisplay) display(); }
+ else wIconPtr = 0;
+}
+
+void
+WMImage::real_display()
+{
+ const int imgwidth = icon() ? icon()->attr.width : 0;
+ const int imgheight = icon() ? icon()->attr.height : 0;
+
+ // if no icon, create an icon that consists only of the background color
+ if (! icon())
+ seticon(false);
+
+ // if widget is not big enough to hold icon, complain about it
+ else if (imgwidth > b_width() || imgheight > b_height()) {
+ cerr << "WMError: Image " << this << " too small for icon" << endl;
+ return;
+ }
+
+ // if icon is smaller than widget, color in the rest with background color
+ else if (imgwidth < b_width() || imgheight < b_height()) {
+ WMPixmap temp;
+
+ // Blit background color onto rectangle
+ WMApp::Xw.create_pixmap(temp, b_width(), b_height());
+ WMApp::Xw.fill_rectangle(temp, 0, 0, b_width(), b_height(), bgcolor());
+ // center icon onto background
+ WMApp::Xw.copy_rectangle(*icon(), temp, 0, 0, imgwidth, imgheight,
+ (b_width() - imgwidth) / 2, (b_height() - imgheight) / 2);
+ // swap pixmaps
+ WMApp::Xw.free_pixmap(wIcon);
+ WMApp::Xw.create_pixmap(wIcon, temp);
+ WMApp::Xw.free_pixmap(temp);
+ }
+
+ // if we get here, widget (minus border) and icon are the same size -
+ // hallelujah!
+ WMApp::Xw.copy_rectangle(*icon(), window()->pixmap(), 0, 0,
+ b_width(), b_height(), b_left(), b_top());
+}
+
diff --git a/wmcube/wmapp/wmimage.h b/wmcube/wmapp/wmimage.h
new file mode 100644
index 000000000000..899c31fbd671
--- /dev/null
+++ b/wmcube/wmapp/wmimage.h
@@ -0,0 +1,52 @@
+#include "wmwidget.h"
+#include "xwrapper.h"
+
+#ifndef _WMIMAGE_H
+#define _WMIMAGE_H
+
+// WMImage: a widget that displays a picture in Xpm format
+class WMImage : public virtual WMWidget {
+ private:
+ WMPixmap wIcon;
+ WMPixmap * wIconPtr;
+
+ protected:
+ Color wBGColor;
+ virtual void real_display();
+ WMPixmap * p_icon();
+
+ public:
+ WMImage(const WMPixmap * pm = 0);
+ WMImage(const WMPixmap & pm);
+ WMImage(char *xpm[]);
+ virtual ~WMImage();
+
+ void seticon(bool dodisplay = true); //make an empty icon
+ void seticon(const WMPixmap *, bool dodisplay = true);
+ void seticon(const WMPixmap &, bool dodisplay = true);
+ void seticon(char *xpm[], bool dodisplay = true);
+ void setbgcolor(Color, bool dodisplay = true);
+ Color bgcolor() const;
+ const WMPixmap * icon() const;
+};
+
+// inline functions for WMImage ------------------------------------------
+
+inline void
+WMImage::seticon(const WMPixmap *pm, bool dodisplay)
+{ if (pm) seticon(*pm, dodisplay); else wIconPtr = 0; }
+
+inline void
+WMImage::setbgcolor(Color c, bool dodisplay)
+{ wBGColor = c; if (dodisplay) display(); }
+
+inline Color
+WMImage::bgcolor() const { return wBGColor; }
+
+inline WMPixmap *
+WMImage::p_icon() { return wIconPtr; }
+
+inline const WMPixmap *
+WMImage::icon() const { return wIconPtr; }
+
+#endif
diff --git a/wmcube/wmapp/wmled.cc b/wmcube/wmapp/wmled.cc
new file mode 100644
index 000000000000..4c08b2a9438b
--- /dev/null
+++ b/wmcube/wmapp/wmled.cc
@@ -0,0 +1,12 @@
+#include "wmled.h"
+#include "wmapp.h"
+
+// functions for WMLed ---------------------------------------------------
+
+void
+WMLed::real_display()
+{
+ seticon(WMApp::leds_pixmap[static_cast<int>(led())], false);
+ if (icon()) WMImage::real_display();
+}
+
diff --git a/wmcube/wmapp/wmled.h b/wmcube/wmapp/wmled.h
new file mode 100644
index 000000000000..5cf71deccba8
--- /dev/null
+++ b/wmcube/wmapp/wmled.h
@@ -0,0 +1,34 @@
+#include "wmimage.h"
+
+#ifndef _WMLED_H
+#define _WMLED_H
+
+// WMLed: displays a round LED-type thing with a different color depending on
+// its status.
+class WMLed : public virtual WMImage {
+ public:
+ enum LedState { Off, Good, Warning, Error };
+
+ private:
+ enum LedState wState;
+ void real_display();
+
+ public:
+ WMLed(LedState s = Off);
+ void setled(enum LedState s, bool dodisplay = true);
+ enum LedState led() const;
+};
+
+// inline functions for WMLed --------------------------------------------
+
+inline WMLed::WMLed(enum LedState s)
+: wState(s) { setborder(0); }
+
+inline void
+WMLed::setled(enum LedState s, bool dodisplay)
+{ wState = s; if (dodisplay) display(); }
+
+inline enum WMLed::LedState
+WMLed::led() const { return wState; }
+
+#endif
diff --git a/wmcube/wmapp/wmmeter.h b/wmcube/wmapp/wmmeter.h
new file mode 100644
index 000000000000..023978128579
--- /dev/null
+++ b/wmcube/wmapp/wmmeter.h
@@ -0,0 +1,57 @@
+#include "wmwidget.h"
+
+#ifndef _WMMETER_H
+#define _WMMETER_H
+
+// WMMeter: Base class for widgets that display a state of progress or load.
+// Cannot be instantiated (inherits the pure virtual function real_display).
+class WMMeter : public virtual WMWidget {
+ private:
+ int wValue, wTotal;
+
+ public:
+ WMMeter();
+ WMMeter(int total);
+ WMMeter(int value, int total);
+
+ virtual void setvalue(int value, bool dodisplay = true);
+ virtual void settotal(int total, bool dodisplay = true);
+
+ int value() const;
+ int total() const;
+ double fraction() const;
+};
+
+// inline functions for WMMeter ------------------------------------------
+
+inline WMMeter::WMMeter()
+: wValue(0), wTotal(0) { }
+
+inline WMMeter::WMMeter(int total)
+: wValue(0), wTotal(total) { }
+
+inline WMMeter::WMMeter(int val, int total)
+: wValue(val), wTotal(total) { }
+
+inline void
+WMMeter::setvalue(int val, bool dodisplay)
+{ wValue = val; if (dodisplay) display(); }
+
+inline void
+WMMeter::settotal(int total, bool dodisplay)
+{ wTotal = total; if (dodisplay) display(); }
+
+inline int
+WMMeter::value() const { return wValue; }
+
+inline int
+WMMeter::total() const { return wTotal; }
+
+inline double
+WMMeter::fraction() const
+{
+ if (wTotal == 0) return 0;
+ else return static_cast<double>(wValue) / wTotal;
+}
+
+#endif
diff --git a/wmcube/wmapp/wmmeterbar.cc b/wmcube/wmapp/wmmeterbar.cc
new file mode 100644
index 000000000000..2ec6dfd5fbcf
--- /dev/null
+++ b/wmcube/wmapp/wmmeterbar.cc
@@ -0,0 +1,80 @@
+#include <iostream>
+#include <algorithm> // for max()
+#include "wmmeterbar.h"
+#include "wmwindow.h"
+#include "wmapp.h"
+
+using std::cerr;
+using std::endl;
+
+// functions for WMMeterBar ----------------------------------------------
+// added by Jason
+
+void
+WMMeterBar::real_display()
+{
+ if ((orientation() == Orientation::Horizontal && width() < 2 * border())
+ || (orientation() == Orientation::Vertical && height() < 2 * border()))
+ { cerr << "WMError: Meter Bar " << this << " too small" << endl; return; }
+
+ //first draw desired background
+ switch (style())
+ {
+ case Spectrum:
+ if (orientation() == Orientation::Horizontal)
+ WMApp::Xw.draw_horizontal_gradient(window()->pixmap(),
+ b_left(), b_top(), b_right(), b_bottom(), 0x5C00, 0x5C0000);
+ else
+ WMApp::Xw.draw_vertical_gradient(window()->pixmap(),
+ b_left(), b_top(), b_right(), b_bottom(), 0x5C0000, 0x5C00);
+ break;
+ case Spec_No_BG:
+ WMApp::Xw.fill_rectangle(window()->pixmap(), b_position(),
+ WMColor(Background));
+ break;
+ case Blue:
+ WMApp::Xw.fill_rectangle(window()->pixmap(), b_position(),
+ WMColor(Background));
+ if (orientation() == Orientation::Horizontal)
+ for (int x = 0; x < b_width(); x += 2)
+ WMApp::Xw.draw_line(window()->pixmap(), x + b_left(), b_top(),
+ x + b_left(), b_bottom(), 0x004941);
+ else
+ for (int y = 0; y < b_height(); y += 2)
+ WMApp::Xw.draw_line(window()->pixmap(), b_left(),
+ b_bottom() - y, b_right(), b_bottom() - y, 0x004941);
+ break;
+ }
+
+ //then draw the progress bar
+ if (total() && value())
+ switch (style())
+ {
+ case Spectrum:
+ case Spec_No_BG:
+ if (orientation() == Orientation::Horizontal)
+ WMApp::Xw.draw_horizontal_gradient(window()->pixmap(),
+ b_left(), b_top(), b_right(), b_bottom(),
+ 0xFF00, 0xFF0000, fraction());
+ else
+ WMApp::Xw.draw_vertical_gradient(window()->pixmap(),
+ b_left(), b_bottom(), b_right(), b_top(),
+ 0xFF00, 0xFF0000, fraction());
+ break;
+ case Blue:
+ if (orientation() == Orientation::Horizontal)
+ for (int x = 0;
+ x < static_cast<int>(std::min(1.0, fraction()) * b_width());
+ x += 2)
+ WMApp::Xw.draw_line(window()->pixmap(), x + b_left(), b_top(),
+ x + b_left(), b_bottom(), WMColor(Bright));
+ else
+ for (int y = 0;
+ y < static_cast<int>(std::min(1.0, fraction()) * b_height());
+ y += 2)
+ WMApp::Xw.draw_line(window()->pixmap(), b_left(), b_bottom() - y,
+ b_right(), b_bottom() - y, WMColor(Bright));
+ break;
+ }
+}
+
diff --git a/wmcube/wmapp/wmmeterbar.h b/wmcube/wmapp/wmmeterbar.h
new file mode 100644
index 000000000000..00a4c0e3d7c0
--- /dev/null
+++ b/wmcube/wmapp/wmmeterbar.h
@@ -0,0 +1,47 @@
+#include "wmmeter.h"
+
+#ifndef _WMMETERBAR_H
+#define _WMMETERBAR_H
+
+// WMMeterBar: a progress bar showing the instantaneous progress or load
+// added by Jason
+class WMMeterBar : public virtual WMMeter {
+ public:
+ // The styles correspond to those in wmmon, wmtop, and wmsmixer respectively:
+ // green-to-red bar on dark green-to-red background; likewise on dark
+ // colorless background; and turquoise hashmarks on dark background.
+ enum Style { Spectrum, Spec_No_BG, Blue };
+
+ private:
+ enum Style wStyle;
+
+ protected:
+ void real_display();
+
+ public:
+ WMMeterBar();
+ WMMeterBar(int total);
+ WMMeterBar(int value, int total);
+
+ void setstyle(enum Style, bool dodisplay = true);
+ enum Style style() const;
+};
+
+// inline functions for WMMeterBar ---------------------------------------
+
+inline WMMeterBar::WMMeterBar() : WMMeter() { }
+
+inline WMMeterBar::WMMeterBar(int total) : WMMeter()
+{ settotal(total); }
+
+inline WMMeterBar::WMMeterBar(int val, int total) : WMMeter()
+{ settotal(total); setvalue(val); }
+
+inline void
+WMMeterBar::setstyle(enum Style s, bool dodisplay)
+{ wStyle = s; if (dodisplay) display(); }
+
+inline enum WMMeterBar::Style
+WMMeterBar::style() const { return wStyle; }
+
+#endif
diff --git a/wmcube/wmapp/wmslider.cc b/wmcube/wmapp/wmslider.cc
new file mode 100644
index 000000000000..e73fd1e4c3d9
--- /dev/null
+++ b/wmcube/wmapp/wmslider.cc
@@ -0,0 +1,42 @@
+#include <algorithm> // for max, min
+#include "wmslider.h"
+#include "wmapp.h"
+
+void slider_click(const WMApp *a, WMWidget *w, void *)
+{
+ WMSlider *s;
+ if (!(s = dynamic_cast<WMSlider *>(w))) return;
+
+ const WMMouseClick click = a->mouseclick().b_relative_to(w);
+ int newval;
+
+ if (click.button > Button3) {
+ const int increment = s->total() / 10;
+ newval = s->value() + (click.button == Button4 ? increment : -increment);
+ }
+ else {
+ const int xrel = click.x;
+ // the messy definition of yrel is due to widget layout using a downward-
+ // going y-axis, but WMMeterBars using an upward-going y-axis
+ const int yrel = s->b_height() - click.y;
+ const int rel = (s->orientation() == Orientation::Horizontal) ? xrel : yrel;
+ newval = (rel * s->total()) / s->b_parallel();
+ }
+
+ s->setvalue(std::max(0, std::min(s->total(), newval)));
+ a->repaint();
+}
+
+void
+WMSlider::attach_callbacks()
+{
+ addcallback(slider_click, this, 0);
+}
+
+// clearcallbacks() shouldn't delete the main callback function of this class
+void
+WMSlider::clearcallbacks()
+{
+ WMCallback::clearcallbacks();
+ WMSlider::attach_callbacks();
+}
diff --git a/wmcube/wmapp/wmslider.h b/wmcube/wmapp/wmslider.h
new file mode 100644
index 000000000000..a706f1c06936
--- /dev/null
+++ b/wmcube/wmapp/wmslider.h
@@ -0,0 +1,32 @@
+#include "wmcallback.h"
+#include "wmmeterbar.h"
+
+#ifndef _WMSLIDER_H
+#define _WMSLIDER_H
+
+// WMSlider: a bar that can be slid up or down to set a value.
+// Derived from WMMeterBar and WMCallback.
+class WMSlider : public WMCallback, public WMMeterBar {
+ private:
+ void attach_callbacks();
+
+ public:
+ WMSlider();
+ WMSlider(int total);
+ WMSlider(int value, int total);
+
+ void clearcallbacks();
+};
+
+inline WMSlider::WMSlider()
+{ setstyle(Blue, false); attach_callbacks(); }
+
+inline WMSlider::WMSlider(int total)
+: WMMeterBar(total)
+{ setstyle(Blue, false); attach_callbacks(); }
+
+inline WMSlider::WMSlider(int value, int total)
+: WMMeterBar(value, total)
+{ setstyle(Blue, false); attach_callbacks(); }
+
+#endif
diff --git a/wmcube/wmapp/wmtextbar.cc b/wmcube/wmapp/wmtextbar.cc
new file mode 100644
index 000000000000..7cb9ec347a61
--- /dev/null
+++ b/wmcube/wmapp/wmtextbar.cc
@@ -0,0 +1,63 @@
+#include <iostream>
+#include "wmtextbar.h"
+#include "wmwindow.h"
+#include "wmapp.h"
+
+using std::cerr;
+using std::endl;
+
+// functions for WMTextBar -----------------------------------------------
+
+void
+WMTextBar::real_display()
+{
+ int charwidth, charheight, xbase, ybase;
+
+ // Blit background color onto rectangle
+ WMApp::Xw.fill_rectangle(window()->pixmap(), b_position(),
+ WMColor(Background));
+
+ switch (fontsize()) {
+ case 0: charwidth = 5, charheight = 9; break;
+ case 1: charwidth = 6, charheight = 9; break;
+ case 2: charwidth = 7, charheight = 11; break;
+ default:
+ cerr << "WMError: Text bar " << this << " has bad font size "
+ << fontsize() << endl;
+ return;
+ }
+
+ if (b_width() < charwidth || b_height() < charheight)
+ { cerr << "WMError: Text bar " << this << " too small" << endl; return; }
+
+ xbase = b_left(), ybase = b_top();
+ // center the characters in the direction perpendicular to their orientation
+ if (orientation() == Orientation::Horizontal)
+ ybase += (b_height() - charheight) / 2;
+ else
+ xbase += (b_width() - charwidth) / 2;
+
+ // plot characters onto X display
+ for (unsigned int i = 0; xbase + charwidth < b_right()
+ && ybase + charheight < b_bottom(); i++) {
+ unsigned char c = text(i);
+ if (c > ' ' && c <= 127) // 7-bit printable ASCII
+ // note: for a degree character, use ASCII 127 (DEL)
+ WMApp::Xw.copy_rectangle(app()->char_pixmaps[fontsize()],
+ window()->pixmap(),
+ /* source X-Y coords */ charwidth * (c % 16), charheight * (c / 16 - 2),
+ /* source width/height*/ charwidth, charheight,
+ /* destination coords */ xbase, ybase);
+ else
+ // no pixmap for this character; display a blank.
+ WMApp::Xw.copy_rectangle(app()->char_pixmaps[fontsize()],
+ window()->pixmap(), 0, 0,
+ charwidth, charheight, xbase, ybase);
+
+ if (orientation() == Orientation::Horizontal)
+ xbase += charwidth;
+ else
+ ybase += charheight;
+ }
+}
+
diff --git a/wmcube/wmapp/wmtextbar.h b/wmcube/wmapp/wmtextbar.h
new file mode 100644
index 000000000000..9e0307bbee71
--- /dev/null
+++ b/wmcube/wmapp/wmtextbar.h
@@ -0,0 +1,57 @@
+#include "wmwidget.h"
+#include <string>
+
+#ifndef _WMTEXTBAR_H
+#define _WMTEXTBAR_H
+
+using std::string;
+
+// WMTextBar: a place to draw text in.
+class WMTextBar : public virtual WMWidget {
+ private:
+ string wText;
+ int wFontsize;
+ void real_display();
+
+ public:
+ WMTextBar(const string & text = "", int fontsize = 1);
+ ~WMTextBar();
+
+ void settext(const string & text, bool dodisplay = true);
+ void setfont(int fontsize, bool dodisplay = true);
+ const string & text() const;
+ char text(unsigned int) const;
+ int fontsize() const;
+ int size() const;
+};
+
+// inline functions for WMTextBar ----------------------------------------
+
+inline WMTextBar::WMTextBar(const string &text, int fontsize)
+: wText(text), wFontsize(fontsize)
+{ }
+
+inline WMTextBar::~WMTextBar() { }
+
+inline void
+WMTextBar::settext(const string &text, bool dodisplay)
+{ wText = text; if (dodisplay) display(); }
+
+inline void
+WMTextBar::setfont(int fontsize, bool dodisplay)
+{ wFontsize = fontsize; if (dodisplay) display(); }
+
+inline const string &
+WMTextBar::text() const { return wText; }
+
+inline char
+WMTextBar::text(unsigned int posn) const
+{ return (posn >= wText.size()) ? ' ' : wText[posn]; }
+
+inline int
+WMTextBar::fontsize() const { return wFontsize; }
+
+inline int
+WMTextBar::size() const { return wText.size(); }
+
+#endif
diff --git a/wmcube/wmapp/wmwidget.cc b/wmcube/wmapp/wmwidget.cc
new file mode 100644
index 000000000000..14c8bc3289ab
--- /dev/null
+++ b/wmcube/wmapp/wmwidget.cc
@@ -0,0 +1,99 @@
+#include "wmwidget.h"
+#include "wmwindow.h"
+#include "wmapp.h"
+
+// functions for WMWidget ------------------------------------------------
+
+WMWidget::WMWidget(const WMRectangle &posn, Orientation::Orientation o)
+: wOrientation(o), wPosition(posn), wBorder(1),
+ wTopLeft(WMColor(FrameBorderDim)), wBottomRight(WMColor(FrameBorderBright)),
+ wParent(0), wDisplayed(false), wActive(true)
+{ }
+
+int
+WMWidget::par_to_parent() const
+{
+ if (!parent()) return -1;
+ return (parent()->orientation() == Orientation::Horizontal) ?
+ position().width() : position().height();
+}
+
+int
+WMWidget::perp_to_parent() const
+{
+ if (!parent()) return -1;
+ return (parent()->orientation() == Orientation::Horizontal) ?
+ position().height() : position().width();
+}
+
+void
+WMWidget::set_par_to_parent(int p)
+{
+ if (wParent && !wDisplayed)
+ ((wParent->wOrientation == Orientation::Horizontal) ?
+ wPosition.setwidth(p) : wPosition.setheight(p));
+}
+
+void
+WMWidget::set_perp_to_parent(int p)
+{
+ if (wParent && !wDisplayed)
+ ((wParent->wOrientation == Orientation::Horizontal) ?
+ wPosition.setheight(p) : wPosition.setwidth(p));
+}
+
+const WMWindow *
+WMWidget::window() const { return wParent ? wParent->window() : 0; }
+
+WMApp *
+WMWidget::app() const { return wParent ? wParent->app() : 0; }
+
+void
+WMWidget::display()
+{
+ if (!(parent() && parent()->is_displayed())) return;
+ real_display();
+ draw_border();
+ setdisplayed(true);
+}
+
+void
+WMWidget::draw_border()
+{
+ if (border() && 2 * border() < width() && 2 * border() < height())
+ WMApp::Xw.draw_border(window()->pixmap(), position(), border(),
+ top_left_c(), bottom_right_c(),
+ Color::alpha_blend(top_left_c(), bottom_right_c(),
+ 0.5));
+}
+
+void
+WMWidget::hide()
+{
+ if (!is_displayed()) return;
+ real_hide();
+ setdisplayed(false);
+}
+
+void
+WMWidget::activate()
+{
+ if (is_active()) return;
+ real_activate();
+ setactive(true);
+ if (is_displayed()) display();
+}
+
+void
+WMWidget::deactivate()
+{
+ if (!is_active()) return;
+ real_deactivate();
+ setactive(false);
+ if (is_displayed()) display();
+}
+
+void
+WMWidget::real_hide()
+{ if (window()) WMApp::Xw.clear_rectangle(window()->pixmap(), position()); }
+
diff --git a/wmcube/wmapp/wmwidget.h b/wmcube/wmapp/wmwidget.h
new file mode 100644
index 000000000000..38213e0c1cce
--- /dev/null
+++ b/wmcube/wmapp/wmwidget.h
@@ -0,0 +1,367 @@
+#include "colors.h"
+
+#ifndef _WMWIDGET_H
+#define _WMWIDGET_H
+
+// needed forward declarations
+class WMApp;
+class WMWindow;
+class WMFrame;
+
+// Classes for writing complicated WindowMaker Dockapp programs! Yaay!
+// Note: I'm lazy, so ALL LAYOUT has to be done statically before the
+// WMApp starts to run.
+
+namespace Orientation {
+ enum Orientation { Horizontal, Vertical };
+};
+
+class WMRectangle {
+ private:
+ int wLeft, wTop, wWidth, wHeight;
+ public:
+ WMRectangle(int Left = 0, int Top = 0, int Width = 0, int Height = 0);
+ WMRectangle(const WMRectangle &r);
+ WMRectangle & operator = (const WMRectangle &r);
+ ~WMRectangle();
+
+ int left() const;
+ int right() const;
+ int top() const;
+ int bottom() const;
+ int width() const;
+ int height() const;
+ bool contains(int x, int y) const;
+
+ void setleft(int);
+ void settop(int);
+ void setwidth(int);
+ void setheight(int);
+};
+
+// WMWidget: the base class for all Dockapp widgets. Cannot be instantiated.
+class WMWidget {
+ private:
+ enum Orientation::Orientation wOrientation;
+ WMRectangle wPosition;
+ int wBorder;
+ Color wTopLeft, wBottomRight;
+ const WMFrame * wParent;
+ bool wDisplayed;
+ bool wActive;
+
+ protected:
+ // these functions do the actual work of displaying a widget.
+ virtual void real_display() = 0;
+ virtual void draw_border();
+ virtual void real_hide();
+
+ // colors for border of widget
+ Color top_left_c() const;
+ Color bottom_right_c() const;
+ void set_top_left_c(const Color & c);
+ void set_bottom_right_c(const Color & c);
+
+ virtual void real_activate() { } // these will be no-ops except
+ virtual void real_deactivate() { } // for clickable widgets
+
+ void setactive(bool);
+ void setdisplayed(bool);
+
+ public:
+ WMWidget(const WMRectangle &layout = WMRectangle(0, 0, 0, 0),
+ Orientation::Orientation o = Orientation::Horizontal);
+ virtual ~WMWidget();
+
+ virtual WMApp *app() const;
+ virtual const WMWindow *window() const;
+ virtual const WMFrame *parent() const;
+ virtual void setparent(const WMFrame *); // should be protected, but then
+ virtual void setparent(const WMFrame &); // WMFrame can't use on children
+ virtual void clip(char *xpm_array[65]);
+
+ virtual void setposition(const WMRectangle &posn);
+ void setorientation(Orientation::Orientation o);
+
+ // these functions do all the busywork of displaying a widget.
+ virtual void display(); // over-ridden by WMFrame
+ virtual void hide(); // in order to act recursively
+ virtual void activate(); // on all child widgets
+ virtual void deactivate(); //
+
+ const WMRectangle & position() const;
+ enum Orientation::Orientation orientation() const;
+ virtual bool contains(int x, int y) const;
+
+ int top() const;
+ int left() const;
+ int bottom() const;
+ int right() const;
+ int border() const;
+
+ int width() const;
+ int height() const;
+ int parallel() const; // dimension parallel to orientation
+ int perpend() const; // dimension perpendicular to orientation
+ int par_to_parent() const; // dimension parallel to parent's orientation
+ int perp_to_parent() const; // dimension perp. to parent's orientation
+
+ // like above, but only considering the part of the widget INSIDE its border
+ WMRectangle b_position() const;
+ int b_top() const;
+ int b_left() const;
+ int b_bottom() const;
+ int b_right() const;
+ int b_width() const;
+ int b_height() const;
+ int b_parallel() const;
+ int b_perpend() const;
+ int b_par_to_parent() const;
+ int b_perp_to_parent() const;
+
+ // "set" accessor functions
+ void settop(int);
+ void setleft(int);
+ void setborder(int);
+
+ void setwidth(int);
+ void setheight(int);
+ void setparallel(int);
+ void setperpend(int);
+ void set_par_to_parent(int);
+ void set_perp_to_parent(int);
+
+ bool is_displayed() const;
+ bool is_active() const;
+};
+
+
+// inline functions for WMRectangle --------------------------------------
+
+inline WMRectangle::WMRectangle(int Left, int Top, int Width, int Height)
+: wLeft(Left), wTop(Top), wWidth(Width), wHeight(Height)
+{ }
+
+inline WMRectangle::WMRectangle(const WMRectangle &r)
+: wLeft(r.wLeft), wTop(r.wTop), wWidth(r.wWidth), wHeight(r.wHeight)
+{ }
+
+inline WMRectangle::~WMRectangle() { }
+
+inline WMRectangle &
+WMRectangle::operator = (const WMRectangle &r)
+{
+ wLeft = r.wLeft, wTop = r.wTop, wWidth = r.wWidth, wHeight = r.wHeight;
+ return *this;
+}
+
+inline int
+WMRectangle::left() const { return wLeft; }
+
+inline int
+WMRectangle::right() const { return wLeft + wWidth; }
+
+inline int
+WMRectangle::top() const { return wTop; }
+
+inline int
+WMRectangle::bottom() const { return wTop + wHeight; }
+
+inline int
+WMRectangle::width() const { return wWidth; }
+
+inline int
+WMRectangle::height() const { return wHeight; }
+
+inline void
+WMRectangle::setleft(int l) { wLeft = l; }
+
+inline void
+WMRectangle::settop(int t) { wTop = t; }
+
+inline void
+WMRectangle::setwidth(int w) { wWidth = w; }
+
+inline void
+WMRectangle::setheight(int h) { wHeight = h; }
+
+inline bool
+WMRectangle::contains(int x, int y) const
+{ return x >= left() && x < right() && y >= top() && y < bottom(); }
+
+// inline functions for WMWidget -----------------------------------------
+
+inline WMWidget::~WMWidget() { }
+
+inline const WMFrame *
+WMWidget::parent() const { return wParent; }
+
+inline void
+WMWidget::clip(char *xpm_array[65])
+{
+ for (int col = left(); col < right(); col++)
+ for (int row = top(); row < bottom(); row++)
+ if (contains(col, row))
+ xpm_array[row + 3][col] = 'X';
+}
+
+inline void
+WMWidget::setparent(const WMFrame *f) { wParent = f; }
+
+inline void
+WMWidget::setparent(const WMFrame &f) { wParent = &f; }
+
+inline void
+WMWidget::setactive(bool b) { wActive = b; }
+
+inline void
+WMWidget::setdisplayed(bool b) { wDisplayed = b; }
+
+inline Color
+WMWidget::top_left_c() const { return wTopLeft; }
+
+inline Color
+WMWidget::bottom_right_c() const { return wBottomRight; }
+
+inline void
+WMWidget::set_top_left_c(const Color & c) { wTopLeft = c; }
+
+inline void
+WMWidget::set_bottom_right_c(const Color & c) { wBottomRight = c; }
+
+inline void
+WMWidget::setposition(const WMRectangle &posn)
+{ if (!wDisplayed) wPosition = posn; }
+
+inline void
+WMWidget::setorientation(Orientation::Orientation o)
+{ if (!wDisplayed) wOrientation = o; }
+
+inline const WMRectangle &
+WMWidget::position() const { return wPosition; }
+
+inline enum Orientation::Orientation
+WMWidget::orientation() const { return wOrientation; }
+
+inline bool
+WMWidget::contains(int x, int y) const { return position().contains(x, y); }
+
+inline int
+WMWidget::top() const { return position().top(); }
+
+inline int
+WMWidget::left() const { return position().left(); }
+
+inline int
+WMWidget::bottom() const { return position().bottom(); }
+
+inline int
+WMWidget::right() const { return position().right(); }
+
+inline int
+WMWidget::border() const { return wBorder; }
+
+inline int
+WMWidget::width() const { return position().width(); }
+
+inline int
+WMWidget::height() const { return position().height(); }
+
+inline int
+WMWidget::parallel() const
+{
+ return (orientation() == Orientation::Horizontal) ?
+ position().width() : position().height();
+}
+
+inline int
+WMWidget::perpend() const
+{
+ return (orientation() == Orientation::Horizontal) ?
+ position().height() : position().width();
+}
+
+// like above, but only considering the part of the widget INSIDE its border:
+
+inline WMRectangle
+WMWidget::b_position() const
+{
+ return WMRectangle(left() + border(), top() + border(),
+ width() - 2 * border(), height() - 2 * border());
+}
+
+inline int
+WMWidget::b_top() const { return top() + border(); }
+
+inline int
+WMWidget::b_left() const { return left() + border(); }
+
+inline int
+WMWidget::b_bottom() const { return bottom() - border(); }
+
+inline int
+WMWidget::b_right() const { return right() - border(); }
+
+inline int
+WMWidget::b_width() const { return width() - 2 * border(); }
+
+inline int
+WMWidget::b_height() const { return height() - 2 * border(); }
+
+inline int
+WMWidget::b_parallel() const { return parallel() - 2 * border(); }
+
+inline int
+WMWidget::b_perpend() const { return perpend() - 2 * border(); }
+
+inline int
+WMWidget::b_par_to_parent() const { return par_to_parent() - 2 * border(); }
+
+inline int
+WMWidget::b_perp_to_parent() const { return perp_to_parent() - 2 * border(); }
+
+// "set" accessor functions:
+
+inline void
+WMWidget::setwidth(int w)
+{ if (!wDisplayed) wPosition.setwidth(w); }
+
+inline void
+WMWidget::setheight(int h)
+{ if (!wDisplayed) wPosition.setheight(h); }
+
+inline void
+WMWidget::settop(int t)
+{ if (!wDisplayed) wPosition.settop(t); }
+
+inline void
+WMWidget::setleft(int l)
+{ if (!wDisplayed) wPosition.setleft(l); }
+
+inline void
+WMWidget::setborder(int b)
+{ if (!wDisplayed) wBorder = b; }
+
+inline void
+WMWidget::setparallel(int p)
+{
+ if (!wDisplayed)
+ ((wOrientation == Orientation::Horizontal) ?
+ wPosition.setwidth(p) : wPosition.setheight(p));
+}
+
+inline void
+WMWidget::setperpend(int p)
+{
+ if (!wDisplayed)
+ ((wOrientation == Orientation::Horizontal) ?
+ wPosition.setheight(p) : wPosition.setwidth(p));
+}
+
+inline bool
+WMWidget::is_displayed() const { return wDisplayed; }
+
+inline bool
+WMWidget::is_active() const { return wActive; }
+
+#endif
diff --git a/wmcube/wmapp/wmwindow.cc b/wmcube/wmapp/wmwindow.cc
new file mode 100644
index 000000000000..71a7e98e2d68
--- /dev/null
+++ b/wmcube/wmapp/wmwindow.cc
@@ -0,0 +1,114 @@
+#include <iostream>
+#include "wmwindow.h"
+#include "wmapp.h"
+
+using std::cerr;
+using std::endl;
+
+// functions for WMWindow ------------------------------------------------
+
+// this is here instead of inlined due to dependency on WMApp
+WMWindow::WMWindow()
+: WMFrame(), wApp(0), wUpdateFreq(10 /* milliseconds */),
+ wCounter(0), wFuncPeriod()
+{
+ setpadding(2);
+ setborder(0);
+
+ pixmap().pixmap = 0;
+ //use this as a flag determining whether the pixmaps are initialized
+
+ int offset = WMApp::size() / 2 - 28;
+ setposition(WMRectangle(offset, offset, 56, 56));
+}
+
+WMWindow::~WMWindow ()
+{
+ if (pixmap().pixmap) { //only free if it was actually allocated
+ WMApp::Xw.free_pixmap(pixmap());
+ }
+}
+
+void
+WMWindow::run_timed_functions()
+{
+ for (unsigned int i = 0; i < numcallbacks(); i++)
+ if (! (wCounter % wFuncPeriod[i])) {
+ runcallback(i);
+ }
+ wCounter++;
+}
+
+void
+WMWindow::initpixmaps()
+{
+ // Xlib has no facility to create a mask on the fly from an xpm (at least
+ // not that I know about), so we have to do it the hard way, initializing a
+ // mask from a char* array:
+
+ char *mask_xpm[67];
+ for (unsigned int i = 0; i < 67; i++)
+ mask_xpm[i] = new char[65];
+
+ strcpy(mask_xpm[0], "64 64 2 1"); // width, height, #colors, (?)
+ strcpy(mask_xpm[1], " c None"); // transparent
+ strcpy(mask_xpm[2], "X c #000000"); // black
+ for (unsigned int i = 3; i < 67; i++)
+ strcpy(mask_xpm[i], // string with 64 spaces --v
+ " ");
+ // 0123456789012345678901234567890123456789012345678901234567890123
+ // 1 2 3 4 5 6
+
+ // now mask out where we want to display things
+ for (unsigned int i = 0; i < numchildren(); i++)
+ child(i)->clip(mask_xpm);
+
+ // finally, create the pixmap and mask
+ WMApp::Xw.create_pixmap(pixmap(), mask_xpm);
+ WMApp::Xw.fill_rectangle(pixmap(), 0, 0, 64, 64, 0xFFFFFF /*white*/);
+
+ // clean up
+ for (unsigned int i = 0; i < 67; i++)
+ delete [] mask_xpm[i];
+}
+
+void
+WMWindow::display()
+{
+ // obviously, we replace the check for existence of a parent
+ // with check for existence of an app
+ if (!app()) {
+ cerr << "WMError: Window " << this << "has no parent application" << endl;
+ return;
+ }
+
+ real_display();
+ setdisplayed(true);
+ for (unsigned int i = 0; i < numchildren(); i++)
+ child(i)->display();
+
+ // show the window and start running the GUI and callbacks
+ app()->Xshow();
+
+ // don't get here until the GUI has been requested to switch to
+ // a different window (via a callback), or to exit
+ return;
+}
+
+void
+WMWindow::real_display()
+{
+ if (!wPixmap.pixmap)
+ initpixmaps(); //call this function only once
+
+ // apply the mask to the application window so that areas not included
+ // in any widget are clear to the icon tile below
+ app()->mask();
+}
+
+void
+WMWindow::real_activate() { display(); }
+
+void
+WMWindow::real_deactivate() { hide(); }
+
diff --git a/wmcube/wmapp/wmwindow.h b/wmcube/wmapp/wmwindow.h
new file mode 100644
index 000000000000..20a4ef5a02eb
--- /dev/null
+++ b/wmcube/wmapp/wmwindow.h
@@ -0,0 +1,130 @@
+#include "wmframe.h"
+#include "wmcallback.h"
+#include "xwrapper.h"
+
+#ifndef _WMWINDOW_H
+#define _WMWINDOW_H
+
+class WMApp;
+
+// WMWindow: A 64x64 pixel square containing a number of widgets. You can
+// set it to run callback functions at regular intervals. Only one WMWindow
+// may be displayed at once. This is controlled by the WMApp containing a
+// vector of WMWindows.
+class WMWindow : private WMCallback, public WMFrame {
+ friend class WMApp;
+
+ private:
+ WMApp * wApp;
+ mutable WMPixmap wPixmap;
+
+ // how often to execute callbacks and update display, in milliseconds
+ int wUpdateFreq;
+ int wCounter;
+ // list of periods of individual callbacks (in units of wUpdateFreq)
+ vector<int> wFuncPeriod;
+
+ void initpixmaps();
+ void real_display();
+ void real_activate();
+ void real_deactivate();
+
+ // should be called only by a WMApp.
+ void display();
+ void hide();
+ void activate();
+ void deactivate();
+ void run_timed_functions();
+
+ public:
+ WMWindow();
+ ~WMWindow();
+
+ const WMWindow * window() const; // returns "this"
+
+ // override these to make them no-ops; windows have no parents
+ WMFrame *parent();
+ void setparent(const WMFrame *);
+ void setparent(const WMFrame &);
+
+ WMApp * app() const;
+ int updatefreq() const;
+ WMPixmap & pixmap() const;
+
+ void setapp(WMApp *);
+
+ void setupdatefreq(int milliseconds);
+ void add_timed_function(int period, data_func d, void * = 0);
+ void add_timed_function(int period, widget_func w, WMWidget *, void * = 0);
+ void clear_timed_functions();
+
+ bool press(int button, int x, int y);
+ bool release(int button, int x, int y);
+};
+
+// inline functions for WMWindow -----------------------------------------
+
+inline void
+WMWindow::activate() { WMFrame::activate(); }
+
+inline void
+WMWindow::deactivate() { WMFrame::deactivate(); }
+
+inline void
+WMWindow::hide() { WMFrame::hide(); }
+
+inline const WMWindow *
+WMWindow::window() const { return this; }
+
+inline WMFrame *
+WMWindow::parent() { return 0; }
+
+inline void
+WMWindow::setparent(const WMFrame *) { }
+
+inline void
+WMWindow::setparent(const WMFrame &) { }
+
+inline WMApp *
+WMWindow::app() const { return wApp; }
+
+inline int
+WMWindow::updatefreq() const { return wUpdateFreq; }
+
+inline void
+WMWindow::setupdatefreq(int milliseconds) { wUpdateFreq = milliseconds; }
+
+inline void
+WMWindow::add_timed_function(int period, data_func f, void *datap)
+{
+ WMCallback::addcallback(f, datap);
+ wFuncPeriod.push_back(period);
+}
+
+inline void
+WMWindow::add_timed_function(int period, widget_func f, WMWidget *w,
+ void *datap)
+{
+ WMCallback::addcallback(f, w, datap);
+ wFuncPeriod.push_back(period);
+}
+
+inline void
+WMWindow::clear_timed_functions()
+{
+ WMCallback::clearcallbacks();
+ wFuncPeriod.clear();
+}
+
+inline WMPixmap &
+WMWindow::pixmap() const { return wPixmap; }
+
+inline bool
+WMWindow::press(int button, int x, int y)
+{ return WMFrame::press(button, x, y); }
+
+inline bool
+WMWindow::release(int button, int x, int y)
+{ return WMFrame::release(button, x, y); }
+
+#endif
diff --git a/wmcube/wmapp/xpm/charmap-large.xpm b/wmcube/wmapp/xpm/charmap-large.xpm
new file mode 100644
index 000000000000..037ca2f1e2e7
--- /dev/null
+++ b/wmcube/wmapp/xpm/charmap-large.xpm
@@ -0,0 +1,74 @@
+/* XPM */
+static char * charmap_large_xpm[] = {
+"112 66 5 1",
+" c None",
+". c #282828",
+"+ c #004941",
+"@ c #20B2AE",
+"# c #188A86",
+"................................................................................................................",
+"..++++...++++...++++...++++...++++...++++...++++...++++...++++...++++...++++...++++...++++...++++...++++...++++.",
+".+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+",
+".+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+",
+".+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+",
+"..++++...++++...++++...++++...++++...++++...++++...++++...++++...++++...++++...++++...++++...++++...++++...++++.",
+".+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+",
+".+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+",
+".+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+",
+"..++++...++++...++++...++++...++++...++++...++++...++++...++++...++++...++++...++++...++++...++++...++++...++++.",
+"................................................................................................................",
+"................................................................................................................",
+"..@@@@...++++#.#@@@@#.#@@@@#.#++++#.#@@@@#.#@@@@#.#@@@@#.#@@@@#.#@@@@#.........++++...++++...++++...++++...++++.",
+".@....@.+....@.+....@.+....@.@....@.@....+.@....+.+....@.@....@.@....@...@....+....+.+....+.+....+.+....+.+....+",
+".@....@.+....@.+....@.+....@.@....@.@....+.@....+.+....@.@....@.@....@...@....+....+.+....+.+....+.+....+.+....+",
+".@....@.+....@.+....@.+....@.@....@.@....+.@....+.+....@.@....@.@....@........+....+.+....+.+....+.+....+.+....+",
+".#++++#..++++#.#@@@@#.#@@@@#.#@@@@#.#@@@@#.#@@@@#..++++#.#@@@@#.#@@@@#.........++++...++++...++++...++++...++++.",
+".@....@.+....@.@....+.+....@.+....@.+....@.@....@.+....@.@....@.+....@........+....+.+....+.+....+.+....+.+....+",
+".@....@.+....@.@....+.+....@.+....@.+....@.@....@.+....@.@....@.+....@...@....+....+.+....+.+....+.+....+.+....+",
+".@....@.+....@.@....+.+....@.+....@.+....@.@....@.+....@.@....@.+....@...@....+....+.+....+.+....+.+....+.+....+",
+"..@@@@...++++#.#@@@@#.#@@@@#..++++#.#@@@@#.#@@@@#..++++#.#@@@@#.#@@@@#.........++++...++++...++++...++++...++++.",
+"................................................................................................................",
+"................................................................................................................",
+"..++++...++++...++++...++++...++++...++++...++++...++++...++++...++++...++++...++++...++++...++++...++++...++++.",
+".+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+",
+".+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+",
+".+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+",
+"..++++...++++...++++...++++...++++...++++...++++...++++...++++...++++...++++...++++...++++...++++...++++...++++.",
+".+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+",
+".+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+",
+".+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+",
+"..++++...++++...++++...++++...++++...++++...++++...++++...++++...++++...++++...++++...++++...++++...++++...++++.",
+"................................................................................................................",
+"................................................................................................................",
+"..++++...++++...++++...++++...++++...++++...++++...++++...++++...++++...++++...++++...++++...++++...++++...++++.",
+".+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+",
+".+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+",
+".+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+",
+"..++++...++++...++++...++++...++++...++++...++++...++++...++++...++++...++++...++++...++++...++++...++++...++++.",
+".+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+",
+".+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+",
+".+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+",
+"..++++...++++...++++...++++...++++...++++...++++...++++...++++...++++...++++...++++...++++...++++...++++...++++.",
+"................................................................................................................",
+"................................................................................................................",
+"..++++...++++...++++...++++...++++...++++...++++...++++...++++...++++...++++...++++...++++...++++...++++...++++.",
+".+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+",
+".+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+",
+".+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+",
+"..++++...++++...++++...++++...++++...++++...++++...++++...++++...++++...++++...++++...++++...++++...++++...++++.",
+".+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+",
+".+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+",
+".+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+",
+"..++++...++++...++++...++++...++++...++++...++++...++++...++++...++++...++++...++++...++++...++++...++++...++++.",
+"................................................................................................................",
+"................................................................................................................",
+"..++++...++++...++++...++++...++++...++++...++++...++++...++++...++++...++++...++++...++++...++++...++++...++++.",
+".+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+",
+".+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+",
+".+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+",
+"..++++...++++...++++...++++...++++...++++...++++...++++...++++...++++...++++...++++...++++...++++...++++...++++.",
+".+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+",
+".+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+",
+".+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+",
+"..++++...++++...++++...++++...++++...++++...++++...++++...++++...++++...++++...++++...++++...++++...++++...++++.",
+"................................................................................................................"};
diff --git a/wmcube/wmapp/xpm/charmap-medium.xpm b/wmcube/wmapp/xpm/charmap-medium.xpm
new file mode 100644
index 000000000000..99a87a7cd1bb
--- /dev/null
+++ b/wmcube/wmapp/xpm/charmap-medium.xpm
@@ -0,0 +1,62 @@
+/* XPM */
+static char * charmap_medium_xpm[] = {
+"96 54 5 1",
+" c None",
+". c #282828",
+"+ c #004941",
+"@ c #20B2AE",
+"# c #188A86",
+"................................................................................................",
+"..+++...+++...+++...+++...+++...+++...+++...+++...@++...++@...+++...+++.........+++.........++##",
+".+...+.+...+.+...+.+...+.+...+.+...+.+...+.+...+.@...+.+...@.+...+.+.@.+.......+...+.......+..@+",
+".+...+.+...+.+...+.+...+.+...+.+...+.+...+.+...+.@...+.+...@.+...+.+.@.+.......+...+.......+.##+",
+"..+++...+++...+++...+++...+++...+++...+++...+++..#+++...+++#..+++..#@@@#........#@@.........+@+.",
+".+...+.+...+.+...+.+...+.+...+.+...+.+...+.+...+.@...+.+...@.+...+.+.@.+.......+...+.......+##.+",
+".+...+.+...+.+...+.+...+.+...+.+...+.+...+.+...+.@...+.+...@.+...+.+.@.+....@..+...+.......+@..+",
+"..+++...+++...+++...+++...+++...+++...+++...+++...@++...++@...+++...+++....##...+++...#@...##++.",
+"................................................................................................",
+"................................................................................................",
+"..@@@...+++#.#@@@#.#@@@#.@+++@.#@@@#.#@@@#.#@@@#.#@@@#.#@@@#..............+++...+++...+++...+++.",
+".@...@.+...@.+...@.+...@.@...@.@...+.@...+.+...@.@...@.@...@.............+...+.+...+.+...+.+...+",
+".@...@.+...@.+...@.+...@.@...@.@...+.@...+.+...@.@...@.@...@..#@....#@...+...+.+...+.+...+.+...+",
+".#+++#..+++#.#@@@#..@@@#.#@@@#.@@@@#.#@@@#..+++#.#@@@#.#@@@#..............+++...+++...+++...+++.",
+".@...@.+...@.@...+.+...@.+...@.+...@.@...@.+...@.@...@.+...@.............+...+.+...+.+...+.+...+",
+".@...@.+...@.@...+.+...@.+...@.+...@.@...@.+...@.@...@.+...@..#@.....@...+...+.+...+.+...+.+...+",
+"..@@@...+++@.#@@@#.#@@@#..+++#.#@@@#.#@@@#..+++@.#@@@#.#@@@#........##....+++...+++...+++...+++.",
+"................................................................................................",
+"................................................................................................",
+".+@@@+.+@@@+.#@@@...@@@#.#@@@..#@@@#.#@@@#.#@@@#.#+++#..@@@...+++#.#+++#.#+++..@+++@.#@@@..#@@@#",
+".@...@.@...@.@...@.@...+.@...@.@...+.@...+.@...+.@...@.+.@.+.+...@.@...@.@...+.@@.@@.@...@.@...@",
+".@...@.@...@.@...@.@...+.@...@.@...+.@...+.@...+.@...@.+.@.+.+...@.@..@..@...+.@.@.@.@...@.@...@",
+".#+@@#.#@@@#.#@@@..#+++..#+++#.#@@@..#@@@..#+#@#.#@@@#..+#+...+++#.#@@...#+++..#+++#.#+++#.#+++#",
+".@.@@+.@...@.@...@.@...+.@...@.@...+.@...+.@...@.@...@.+.@.+.+...@.@..@..@...+.@...@.@...@.@...@",
+".@...+.@...@.@...@.@...+.@...@.@...+.@...+.@...@.@...@.+.@.+.@...@.@...@.@...+.@...@.@...@.@...@",
+".#@@@#.#+++#.#@@@...@@@#.#@@@..#@@@#.#+++..#@@@#.#+++#..@@@..#@@@#.#+++#.#@@@#.#+++#.#+++#.#@@@#",
+"................................................................................................",
+"................................................................................................",
+".#@@@#.#@@@#.#@@@#.#@@@#.#@@@#.#+++#.#+++#.#+++#.#+++#.#+++#.#@@@#.#@++..##++...++@#..+++...+++.",
+".@...@.@...@.@...@.@...+.+.@.+.@...@.@...@.@...@.@...@.@...@.+...@.@...+.+@..+.+...@.+...+.+...+",
+".@...@.@...@.@...@.@...+.+.@.+.@...@.@...@.@...@..@.@..@...@.+..@+.@...+.+##.+.+...@.+...+.+...+",
+".#@@@#.#@++#.#@@@..#@@@#..+#+..#+++#.#+++#.#+++#...@...#@@@#..+@+..#+++...+@+...+++#..+++...+++.",
+".@...+.@.@.@.@...@.+...@.+.@.+.@...@.@...@.@.@.@..@.@..+...@.+@..+.@...+.+.##+.+...@.+...+.+...+",
+".@...+.@..@@.@...@.+...@.+.@.+.@...@.@...@.@@.@@.@...@.+...@.@...+.@...+.+..@+.+...@.+...+.+...+",
+".#+++..#@@@#.#+++#.#@@@#..+#+..#@@@#..#@#..#+++#.#+++#.#@@@#.#@@@#.#@++...++##..++@#..+++..#@@@#",
+"................................................................................................",
+"................................................................................................",
+"..+++..+@@@+.#@@@...@@@#.#@@@..#@@@#.#@@@#.#@@@#.#+++#..@@@...+++#.#+++#.#+++..@+++@.#@@@..#@@@#",
+".+...+.@...@.@...@.@...+.@...@.@...+.@...+.@...+.@...@.+.@.+.+...@.@...@.@...+.@@.@@.@...@.@...@",
+".+...+.@...@.@...@.@...+.@...@.@...+.@...+.@...+.@...@.+.@.+.+...@.@..@..@...+.@.@.@.@...@.@...@",
+"..+++..#@@@#.#@@@..#+++..#+++#.#@@@..#@@@..#+#@#.#@@@#..+#+...+++#.#@@...#+++..#+++#.#+++#.#+++#",
+".+...+.@...@.@...@.@...+.@...@.@...+.@...+.@...@.@...@.+.@.+.+...@.@..@..@...+.@...@.@...@.@...@",
+".+...+.@...@.@...@.@...+.@...@.@...+.@...+.@...@.@...@.+.@.+.@...@.@...@.@...+.@...@.@...@.@...@",
+"..+++..#+++#.#@@@...@@@#.#@@@..#@@@#.#+++..#@@@#.#+++#..@@@..#@@@#.#+++#.#@@@#.#+++#.#+++#.#@@@#",
+"................................................................................................",
+"................................................................................................",
+".#@@@#.#@@@#.#@@@#.#@@@#.#@@@#.#+++#.#+++#.#+++#.#+++#.#+++#.#@@@#..++@...+#+...@++...+++..+@+..",
+".@...@.@...@.@...@.@...+.+.@.+.@...@.@...@.@...@.@...@.@...@.+...@.+.@.+.+.@.+.+.@.+.+...+.@.@..",
+".@...@.@...@.@...@.@...+.+.@.+.@...@.@...@.@...@..@.@..@...@.+..@+.+.@.+.+.@.+.+.@.+.+...+.+@+..",
+".#@@@#.#@++#.#@@@..#@@@#..+#+..#+++#.#+++#.#+++#...@...#@@@#..+@+...@#+...+#+...+#@...+++.......",
+".@...+.@.@.@.@...@.+...@.+.@.+.@...@.@...@.@.@.@..@.@..+...@.+@..+.+.@.+.+.@.+.+.@.+.+...+......",
+".@...+.@..@@.@...@.+...@.+.@.+.@...@.@...@.@@.@@.@...@.+...@.@...+.+.@.+.+.@.+.+.@.+.+...+......",
+".#+++..#@@@#.#+++#.#@@@#..+#+..#@@@#..#@#..#+++#.#+++#.#@@@#.#@@@#..++@...+#+...@++...+++.......",
+"................................................................................................"};
diff --git a/wmcube/wmapp/xpm/charmap-small.xpm b/wmcube/wmapp/xpm/charmap-small.xpm
new file mode 100644
index 000000000000..13ff70292386
--- /dev/null
+++ b/wmcube/wmapp/xpm/charmap-small.xpm
@@ -0,0 +1,62 @@
+/* XPM */
+static char * charmap_small_xpm[] = {
+"80 54 5 1",
+" c None",
+". c #282828",
+"+ c #004941",
+"@ c #20B2AE",
+"# c #188A86",
+"................................................................................",
+"..++...++...++...++...++...++...++...++...@+...+@...++.............++........++.",
+".+..+.+..+.+..+.+..+.+..+.+..+.+..+.+..+.@..+.+..@.+..+..@........+..+......+.@+",
+".+..+.+..+.+..+.+..+.+..+.+..+.+..+.+..+.@..+.+..@.+..+..@........+..+......+##+",
+"..++...++...++...++...++...++...++...++..#++...++#..++..@@@.......#@@........@+.",
+".+..+.+..+.+..+.+..+.+..+.+..+.+..+.+..+.@..+.+..@.+..+..@........+..+......##.+",
+".+..+.+..+.+..+.+..+.+..+.+..+.+..+.+..+.@..+.+..@.+..+..@.....@..+..+......@..+",
+"..++...++...++...++...++...++...++...++...@+...+@...++........##...++...#@...++.",
+"................................................................................",
+"................................................................................",
+"..@@...++#.#@@#.#@@#.#++#.#@@#.#@@#.#@@#.#@@#.#@@#............++...++...++...++.",
+".@..@.+..@.+..@.+..@.@..@.@..+.@..+.+..@.@..@.@..@...........+..+.+..+.+..+.+..+",
+".@..@.+..@.+..@.+..@.@..@.@..+.@..+.+..@.@..@.@..@..#@...#@..+..+.+..+.+..+.+..+",
+".#++#..++#.#@@#.#@@#.#@@#.@@@#.#@@#..++#.#@@#.#@@#............++...++...++...++.",
+".@..@.+..@.@..+.+..@.+..@.+..@.@..@.+..@.@..@.+..@...........+..+.+..+.+..+.+..+",
+".@..@.+..@.@..+.+..@.+..@.+..@.@..@.+..@.@..@.+..@..#@....@..+..+.+..+.+..+.+..+",
+"..@@...++@.#@@#.#@@#..++#.#@@#.#@@#..++#.#@@#.#@@#.......##...++...++...++...++.",
+"................................................................................",
+"................................................................................",
+".+@@+.+@@+.#@@...@@#.#@@..#@@#.#@@#.#@@#.#++#.@@@...++#.#++#.#++..@..@.#@@..#@@#",
+".@..@.@..@.@..@.@..+.@..@.@..+.@..+.@..+.@..@.+@.+.+..@.@..@.@..+.@@@@.@..@.@..@",
+".@..@.@..@.@..@.@..+.@..@.@..+.@..+.@..+.@..@.+@.+.+..@.@.@..@..+.@##@.@..@.@..@",
+".#+@@.#@@#.#@@..#+++.#++#.#@@..#@@..#+@#.#@@#..#+...++#.#@...#++..#++#.#++#.#++#",
+".@.@#.@..@.@..@.@..+.@..@.@..+.@..+.@..@.@..@.+@.+.+..@.@.@..@..+.@..@.@..@.@..@",
+".@..+.@..@.@..@.@..+.@..@.@..+.@..+.@..@.@..@.+@.+.@..@.@..@.@..+.@..@.@..@.@..@",
+".#@@..#++#.#@@...@@#.#@@..#@@#.#++..#@@#.#++#.@@@..#@@#.#++#.#@@#.#++#.#++#.#@@#",
+"................................................................................",
+"................................................................................",
+".#@@#.#@@#.#@@#.#@@#.@@@#.#++#.#++#.#++#.#++#.#++#.#@@#.@@+...++...+@@..++...++.",
+".@..@.@..@.@..@.@..+.+@.+.@..@.@..@.@..@.@..@.@..@.+..@.@..+.@..+.+..@.+..+.+..+",
+".@..@.@..@.@..@.@..+.+@.+.@..@.@..@.@..@.@..@.@..@.+.@+.@..+.##.+.+..@.+..+.+..+",
+".#@@#.#++#.#@@..#@@#..#+..#++#.#++#.#++#..@@...@@#..##..#++...@+...++#..++...++.",
+".@..+.@##@.@..@.+..@.+@.+.@..@.@..@.@##@.@..@.+..@.+@.+.@..+.+##+.+..@.+..+.+..+",
+".@..+.@.@@.@..@.+..@.+@.+.@..@.@..@.@@@@.@..@.+..@.@..+.@..+.+.@+.+..@.+..+.+..+",
+".#++..#@@#.#++#.#@@#..#+..#@@#..#@..@..@.#++#.#@@#.#@@#.@@+...++...+@@..++..#@@#",
+"................................................................................",
+"................................................................................",
+"..++..+@@+.#@@...@@#.#@@..#@@#.#@@#.#@@#.#++#.@@@...++#.#++#.#++..@..@.#@@..#@@#",
+".+..+.@..@.@..@.@..+.@..@.@..+.@..+.@..+.@..@.+@.+.+..@.@..@.@..+.@@@@.@..@.@..@",
+".+..+.@..@.@..@.@..+.@..@.@..+.@..+.@..+.@..@.+@.+.+..@.@.@..@..+.@##@.@..@.@..@",
+"..++..#@@#.#@@..#+++.#++#.#@@..#@@..#+@#.#@@#..#+...++#.#@...#++..#++#.#++#.#++#",
+".+..+.@..@.@..@.@..+.@..@.@..+.@..+.@..@.@..@.+@.+.+..@.@.@..@..+.@..@.@..@.@..@",
+".+..+.@..@.@..@.@..+.@..@.@..+.@..+.@..@.@..@.+@.+.@..@.@..@.@..+.@..@.@..@.@..@",
+"..++..#++#.#@@...@@#.#@@..#@@#.#++..#@@#.#++#.@@@..#@@#.#++#.#@@#.#++#.#++#.#@@#",
+"................................................................................",
+"................................................................................",
+".#@@#.#@@#.#@@#.#@@#.@@@#.#++#.#++#.#++#.#++#.#++#.#@@#..#@...#+...@#...++..+@+.",
+".@..@.@..@.@..@.@..+.+@.+.@..@.@..@.@..@.@..@.@..@.+..@.+@.+.+@.+.+.@+.+..+.@.@.",
+".@..@.@..@.@..@.@..+.+@.+.@..@.@..@.@..@.@..@.@..@.+.@+.+@.+.+@.+.+.@+.+..+.+@+.",
+".#@@#.#++#.#@@..#@@#..#+..#++#.#++#.#++#..@@...@@#..##..@#+...#+...+#@..++......",
+".@..+.@##@.@..@.+..@.+@.+.@..@.@..@.@##@.@..@.+..@.+@.+.+@.+.+@.+.+.@+.+..+.....",
+".@..+.@.@@.@..@.+..@.+@.+.@..@.@..@.@@@@.@..@.+..@.@..+.+@.+.+@.+.+.@+.+..+.....",
+".#++..#@@#.#++#.#@@#..#+..#@@#..#@..@..@.#++#.#@@#.#@@#..#@...#+...@#...++......",
+"................................................................................"};
diff --git a/wmcube/wmapp/xpm/checkbox.xpm b/wmcube/wmapp/xpm/checkbox.xpm
new file mode 100644
index 000000000000..7b4b0e90df13
--- /dev/null
+++ b/wmcube/wmapp/xpm/checkbox.xpm
@@ -0,0 +1,14 @@
+/* XPM */
+static char * checkbox_xpm[] = {
+"9 9 2 1",
+". c #AEAAAE",
+"+ c #000000",
+".........",
+"......++.",
+".....+++.",
+".++.+++..",
+".+++++...",
+".++++....",
+".+++.....",
+".++......",
+"........."};
diff --git a/wmcube/wmapp/xpm/emptybar.xpm b/wmcube/wmapp/xpm/emptybar.xpm
new file mode 100644
index 000000000000..e36963175232
--- /dev/null
+++ b/wmcube/wmapp/xpm/emptybar.xpm
@@ -0,0 +1,62 @@
+/* XPM for empty bar - taken from wmtop's progress bar, dimmed with GIMP */
+static char * emptybar_xpm[] = {
+"58 1 58 1",
+" c None",
+". c #007007",
+"+ c #026D07",
+"@ c #046C07",
+"# c #066A07",
+"$ c #086706",
+"% c #0A6506",
+"& c #0C6406",
+"* c #0E6206",
+"= c #105F06",
+"- c #115E06",
+"; c #145C06",
+"> c #165905",
+", c #185705",
+"' c #1A5605",
+") c #1C5405",
+"! c #1E5105",
+"~ c #1F5005",
+"{ c #224E05",
+"] c #244C04",
+"^ c #264904",
+"/ c #284804",
+"( c #2A4604",
+"_ c #2C4304",
+": c #2D4204",
+"< c #304004",
+"[ c #323E03",
+"} c #343B03",
+"| c #353A03",
+"1 c #383803",
+"2 c #3A3503",
+"3 c #3B3403",
+"4 c #3E3203",
+"5 c #403003",
+"6 c #422D03",
+"7 c #432C03",
+"8 c #462A03",
+"9 c #482803",
+"0 c #492603",
+"a c #4C2403",
+"b c #4E2202",
+"c c #501F02",
+"d c #511E02",
+"e c #541C02",
+"f c #561A02",
+"g c #571802",
+"h c #591602",
+"i c #5C1401",
+"j c #5E1101",
+"k c #5F1001",
+"l c #620E01",
+"m c #640C01",
+"n c #650A01",
+"o c #670801",
+"p c #6A0600",
+"q c #6C0400",
+"r c #6D0200",
+"s c #700000",
+"..+@#$%&*=-;>,')!~{]^/(_:<[}|1234567890abcdefghijklmnopqrs"};
diff --git a/wmcube/wmapp/xpm/fullbar.xpm b/wmcube/wmapp/xpm/fullbar.xpm
new file mode 100644
index 000000000000..f5c3986dc9c7
--- /dev/null
+++ b/wmcube/wmapp/xpm/fullbar.xpm
@@ -0,0 +1,62 @@
+/* XPM for full progress bar - taken from wmtop */
+static char * fullbar_xpm[] = {
+"58 1 58 1",
+" c None",
+". c #00FF0F",
+"+ c #04FA0F",
+"@ c #09F50F",
+"# c #0DF10F",
+"$ c #12EC0E",
+"% c #16E80E",
+"& c #1BE30E",
+"* c #1FDF0D",
+"= c #24DA0D",
+"- c #28D60D",
+"; c #2DD10D",
+"> c #32CC0C",
+", c #36C80C",
+"' c #3BC30C",
+") c #3FBF0B",
+"! c #44BA0B",
+"~ c #48B60B",
+"{ c #4DB10B",
+"] c #51AD0A",
+"^ c #56A80A",
+"/ c #5BA30A",
+"( c #5F9F09",
+"_ c #649A09",
+": c #689609",
+"< c #6D9109",
+"[ c #718D08",
+"} c #768808",
+"| c #7A8408",
+"1 c #7F7F07",
+"2 c #847A07",
+"3 c #887607",
+"4 c #8D7107",
+"5 c #916D06",
+"6 c #966806",
+"7 c #9A6406",
+"8 c #9F5F05",
+"9 c #A35B05",
+"0 c #A85605",
+"a c #AD5105",
+"b c #B14D04",
+"c c #B64804",
+"d c #BA4404",
+"e c #BF3F03",
+"f c #C33B03",
+"g c #C83603",
+"h c #CC3203",
+"i c #D12D02",
+"j c #D62802",
+"k c #DA2402",
+"l c #DF1F01",
+"m c #E31B01",
+"n c #E81601",
+"o c #EC1201",
+"p c #F10D00",
+"q c #F50900",
+"r c #FA0400",
+"s c #FF0000",
+"..+@#$%&*=-;>,')!~{]^/(_:<[}|1234567890abcdefghijklmnopqrs"};
diff --git a/wmcube/wmapp/xpm/leds.xpm b/wmcube/wmapp/xpm/leds.xpm
new file mode 100644
index 000000000000..a9d1fa56ac6e
--- /dev/null
+++ b/wmcube/wmapp/xpm/leds.xpm
@@ -0,0 +1,14 @@
+/* XPM for LED lights - taken from wmppp */
+static char * leds_xpm[] = {
+"16 4 7 1",
+" c None",
+". c #202020",
+"+ c #283C38",
+"@ c #00EB00",
+"# c #E7C308",
+"$ c #B60418",
+"% c #F7F3FF",
+".++..@@..##..$$.",
+"++++@%@@#%##$%$$",
+"++++@@@@####$$$$",
+".++..@@..##..$$."};
diff --git a/wmcube/wmapp/xpm/tile.xpm b/wmcube/wmapp/xpm/tile.xpm
new file mode 100644
index 000000000000..e65c234c7a7f
--- /dev/null
+++ b/wmcube/wmapp/xpm/tile.xpm
@@ -0,0 +1,121 @@
+/* XPM */
+static char *tile_xpm[] = {
+"64 64 54 1",
+" c #F3CEF3CEF3CE",
+". c #000000000000",
+"X c #514461856185",
+"o c #A289A289B2CA",
+"O c #A289A289A289",
+"+ c #A2899248B2CA",
+"@ c #9248A289A289",
+"# c #A2899248A289",
+"$ c #92489248A289",
+"% c #924892489248",
+"& c #92488207A289",
+"* c #820792489248",
+"= c #924882079248",
+"- c #820782079248",
+"; c #820782078207",
+": c #820771C69248",
+"> c #618551446185",
+", c #9248A289B2CA",
+"< c #92489248B2CA",
+"1 c #82079248A289",
+"2 c #82078207A289",
+"3 c #71C682079248",
+"4 c #71C682078207",
+"5 c #514451446185",
+"6 c #514451445144",
+"7 c #820771C68207",
+"8 c #410351445144",
+"9 c #514441035144",
+"0 c #71C671C69248",
+"q c #71C671C68207",
+"w c #71C671C671C6",
+"e c #410341035144",
+"r c #71C661858207",
+"t c #618571C68207",
+"y c #410351444103",
+"u c #410341034103",
+"i c #618571C671C6",
+"p c #410330C24103",
+"a c #30C241034103",
+"s c #71C6618571C6",
+"d c #6185618571C6",
+"f c #618561858207",
+"g c #30C230C230C2",
+"h c #618561856185",
+"j c #30C230C24103",
+"k c #5144618571C6",
+"l c #30C2410330C2",
+"z c #6185514471C6",
+"x c #208130C230C2",
+"c c #30C2208130C2",
+"v c #5144514471C6",
+"b c #2081208130C2",
+"n c #208120812081",
+"m c #410330C25144",
+" .",
+" X.",
+" oOoO+O+O+O+@#$+@#$#$#$$$#$$%&%&%&%&*&*&*=-=*=-=-=--;---;:;:;>.",
+" oo@o,o@o@o@+@+@<@$@$@$@$@$1$$$*$*$*&*&*2*&*2*-*-*-----3-3-4-X.",
+" oO+OoO#O+@#@#@#$#@#$#%#$$%$%$%&%&*=%&*=*=*=-=-=--;-;-;:;:;:;5.",
+" ,ooo@+@+@+@+@<@#@<@$$$$$$$$$*$1$*&*&*&*&*2*---*-----3---4:4:6.",
+" +O+O+O+@#$#@#$#$#$$%$$$%&%&%&%&*=*&*=-=*=---=--;---;:;:4:;:45.",
+" @o@o@o@+@+@<@$@$@$$$@$1$1$*$*$*&*&*2*=*2*-*-*-----4-3-4:4-4:6.",
+" +O#O+@#@#@#$#$#$#%#%$%&%$%&%&*=*&*=*=*=-=-=--;-;-;:;:;:;:4745.",
+" @+@+@+@+@<@#@$@$$$$$$$$$*$*$*&*&*&*&*2*---*-----3---4:4:4:4:8.",
+" #O+@#$#@#$#$#$$%$$$%&%&%&%&*=*&*=-=-=---=--;:;-;:;:4:4:474:49.",
+" @o@<@+@<@$@$@$$$$$1$1$*$*$*&*&*2*=*2*-*-*-----4-4-4:4:4:4:408.",
+" +@#@#@#$#$#$$%#%$%&%$%&%&*=*&*=*=*=-=-=--;-;-;:;:;:;:474747q9.",
+" @+@+@<@$$$@$$$$$1$$$*&*$*&*&*&*&*2*---------3-3-4:4:4:4:404q8.",
+" #$#@#$#$#$$%$$$%&%&%&%&*=-&*=-=-=---=--;:;:;:;:4:4:474:47q7q9.",
+" @#@<@$@$@$$$$$*$1$*$*$*&*&*2*-*2*-*-*-3---4-4-4:4:4:4:404q4q8.",
+" #@#$#$#$$%$%$%&%$%&%&*=*=*=-=*=-=;=--;-;-;:;:47;:474747q7q7q9.",
+" @<@$$$@$$$$$1$$$*&*&*&*&*&*=*2*---------4-3-4:4:4:4:404qq04q8.",
+" #$#$#$$%$%$%&%&%&%&*=-&*=-=-=------;:;:;:;:4:4:47q747qqq7qqq9.",
+" @$@$@$$$$$*$1$*$*$*&*&*2*-*-*---*-3-3-4-4-4:4:4:4:404q4q4qqq8.",
+" #$#$$%$%$%&%&%&%&*=*=*=-=-=-=;=--;:;-;:;:474:474747q7q7qqwqw9.",
+" $$@$$$$$*$$$*&*&*&*&*2*=*2*---------4-3-4:4:4:4:404qqq4qqqqqe.",
+" #$$%$%$%&%&*&%&*=-&*=-=-=------;:;:;:;:4:4:47q7q7qqq7qqwrqqw9.",
+" @$$$$$*$1$*&*$*2*&*2*-*-*-----3-3-4-4-4:4:404:404q4q4qqqqqtqy.",
+" $%$%$%&%&%=%&*=*=*=-=-=--;=--;:;-;:;:474:474747q7q7qqwqwqwrwe.",
+" $$$$*$1$*&*&*&*&*2*--2*-----3---4:3-4:4:4:4:404qqqqqqqqqtqtqu.",
+" &%$%&%&*&*&*=-=*=-=-=--;---;:;:;:;:4:4:47q7q7qqq7qqwrqrwrwrip.",
+" $$*$*$*&*&*2*&*2*-*-*-----3-3-4-4-4:4:404q404q4q4qtqqqiqtqiru.",
+" $%&%&*=%&*=*=*=-=-=--;-;-;:;-;:;:474:47q747q7q7qqwqwqwrwrirwu.",
+" *$1$*&*&*&*&*2*---*-----3---4:4:4:4:4:4:404qqqqqqqqqtqtqirira.",
+" &%&*=*&*=-=*=-=-=--;---;:;:;:;:4:4:47q7q7qqqqqqwrqrwrwriririp.",
+" *$*&*&*2*&*2*-*-*-----3-3-4-4-4:4:404q4q4qqq4qtqtqiqiqiriqira.",
+" &*=*&*=*=*=-=-=--;-;-;:;:;:;:474:47q7q7q7q7qqwrwqwrwrirwrisip.",
+" *&*&*&*&*2*---*-----3---4:4:4:4:404:404qqqqqqqqqtqtqiriririra.",
+" =*&*=-=*=---=--;---;:;:4:;:474:47q7q7qqqqqqwrwrwrwriririsdrdp.",
+" *&*2*=*2*-*-*-----4-3-4:4-4:4:404q4q4qqqqqtqtqiqiqiriqifirifa.",
+" &*=*=*=-=-=--;-;-;:;:;:;:474747q7q7qqq7qqwrwqwrwrirwrisisisdp.",
+" *&*&*2*---*-----3-3-4:4:4:4:404qq04qqqqqtqqqirtqiririririfida.",
+" =-=-=---=--;:;-;:;:4:4:474:47q7q7qqqqqqwrwrwrwriririsdrdsdddp.",
+" *=*2*-*-*-----4-4-4:4:4:4:404q4q4qqqqqtqtqiqiqiriqifififidida.",
+" =*=-=-=--;-;-;:;:4:;:474747q7q7qqwqwqwrwqwrwrirwrisdsisdsdsdp.",
+" *2*---------4-3-4:4:4:4:404qq04qqqqqtqqqiririririririfidddddg.",
+" =---=--;:;:;:;:4:4:474:47q7q7qqqqqqwrwrwrwriririsdsdsddddddhj.",
+" *---*-3---4-4-4:4:4:4:404q4q4qqqqqtqtqiqiqiririfififidddidkdl.",
+" =;=--;:;-;:;:474:474747q7q7qqwqwqwrwrwrwrirwrisdsdsdsdsddhzhj.",
+" --------4-3-4:4:4:4:404qq04qqqqqtqqqiririririfirifidddddddddx.",
+" ---;:;:;:;:4:4:47q747qqq7qqwqqqwrwrirwriririsdsdsddddddhzhzhc.",
+" --3-3-4-4-4:4:4:4:404q4q4qqqqqtqtqiriqiririfififidddddkdkdXdx.",
+" -;:;-;:;:474:474747q7q7qqwqwqwrwrwrwrisisisdsdsdddsddhzhdhzhg.",
+" ----4-3-4:4:4:4:404qqq4qqqqqtqtqiriririrififdfidddddkdddkzkdx.",
+" :;:;:;:4:4:47q7q7qqq7qqwrqqwrwriririririsdsdsddddddhzhzhzhzXc.",
+" 3-4-4-4:4:404:404q4q4qqqqqtqtqiriqiririfidididddddkdkdXdXdXzx.",
+" -;:;:474:47q747q7q7qqwqwqwrwrirwrisisisdsdsddddddhzhdhzhzXzhc.",
+" 4:4-4:4:4:4:404qqqqqqqqqtqtqiriririrififdfidddddkdddkzkdXzXzx.",
+" :;:4:4:47q7q7qqq7qqwrqrwrwriririsirisdsdsddddddhzhzhzhzXzXzXc.",
+" 4-4:4:404q404qqq4qtqqqiqtqiriqiririfidididddddkdkdXdXdXzXzXvx.",
+" :474:47q7q7q7q7qqwrwqwrwrirwrisisisdsdsddddddhzhzhzhzXzhzX>5c.",
+" 4:4:4:4:404qqqqqqqqqtqtqiririririfiddfidddddkdddXzkdXzXzXvXzx.",
+" :4:47q7q7qqqqqqwrwrwrwriririsdrisdddsddddddhzhzXzhzXzXzX>5>5c.",
+" 4:404q4q4qqqqqtqtqiqiqiriqiririfidididddddkdkdXzXdXzXzXvXvXvx.",
+" :47q7q7q7q7qqwrwqwrwrirwrisisisdsdsddhdddhzhzhzhzXzXzX>5>5>5b.",
+" 404:404qqqqqqqqqiqtqiririririfidddidddddkdkdXzkzXzXzXvXv5vX5n.",
+" >65656569698989y9e9u9ueumueupupapaplpgjgjgjgcgcgcgcxcbcncnbnb.",
+" ..............................................................."};
diff --git a/wmcube/wmapp/xpm/xbutton.xpm b/wmcube/wmapp/xpm/xbutton.xpm
new file mode 100644
index 000000000000..ba8e5e95d824
--- /dev/null
+++ b/wmcube/wmapp/xpm/xbutton.xpm
@@ -0,0 +1,14 @@
+/* XPM */
+static char * xbutton_xpm[] = {
+"9 9 2 1",
+". c #AEAAAE",
+"+ c #000000",
+".........",
+".++...++.",
+".+++.+++.",
+"..+++++..",
+"...+++...",
+"..+++++..",
+".+++.+++.",
+".++...++.",
+"........."};
diff --git a/wmcube/wmapp/xwrapper.cc b/wmcube/wmapp/xwrapper.cc
new file mode 100644
index 000000000000..44000e25c15e
--- /dev/null
+++ b/wmcube/wmapp/xwrapper.cc
@@ -0,0 +1,329 @@
+#include <iostream>
+#include "xwrapper.h"
+#include "wmwidget.h"
+using std::cerr;
+using std::endl;
+
+// This class includes most of the crap normally required to do X stuff.
+
+Xwrapper::Xwrapper()
+{
+ xDisplay = X::XOpenDisplay(0);
+ if (!xDisplay) { cerr << "Xwrapper: Could not open X display!" << endl; }
+ xRootWindow = DefaultRootWindow(xDisplay);
+ X::XGetWindowAttributes(xDisplay, xRootWindow, &xAttributes);
+
+ X::XGCValues gcv;
+ gcv.graphics_exposures = false;
+ xGC = X::XCreateGC(xDisplay, xRootWindow,
+ X_MACRO(GCGraphicsExposures), &gcv);
+}
+
+Xwrapper::~Xwrapper()
+{
+ //XXX: This is only the beginning...
+ X::XFreeGC(xDisplay, xGC);
+ X::XCloseDisplay(xDisplay);
+}
+
+void
+Xwrapper::set_GC(X::GC gc, Color c) const
+{
+ X::XSetForeground(xDisplay, gc, color_to_xcolor(c));
+ X::XSetFillStyle(xDisplay, gc, X_MACRO(FillSolid));
+}
+
+unsigned long
+Xwrapper::color_to_xcolor(Color c) const
+{
+ X::XColor xcolor;
+
+ xcolor.pixel = 0;
+ xcolor.flags = X_MACRO(DoRed | DoGreen | DoBlue);
+ // map the range 0 -> 0xff to the range 0 -> 0xffff
+ // (X insists on using "short" for color values)
+ xcolor.red = c.r() * 0x0101;
+ xcolor.green = c.g() * 0x0101;
+ xcolor.blue = c.b() * 0x0101;
+
+ if (X::XAllocColor(xDisplay, xAttributes.colormap, &xcolor))
+ X::XFreeColors(xDisplay, xAttributes.colormap, &xcolor.pixel, 1, 0);
+ //XXX: This is an incredibly stupid solution, but it works above 8-bit
+ //color. It appears that decent color management is a shortcoming of X.
+ return xcolor.pixel;
+}
+
+Color
+Xwrapper::get_point(const WMPixmap& src, int x, int y) const
+{
+ //magic incantaions to read a pixel from a pixmap
+ X::XGCValues gcvalues;
+ X::XGetGCValues(xDisplay, src.gc, GCPlaneMask, &gcvalues);
+
+ // XXX: Surely there's a better way than allocating an image every time
+ X::XImage* dest = XGetImage(xDisplay, src.pixmap, 0, 0, src.attr.width, src.attr.height, gcvalues.plane_mask, XYPixmap);
+
+ Color color = XGetPixel(dest, x, y);
+ XDestroyImage(dest);
+ return color;
+}
+
+bool
+Xwrapper::create_pixmap(WMPixmap & dest, char * pixmap_bytes[]) const
+{
+ dest.attr.exactColors = false;
+ dest.attr.closeness = 40000;
+ dest.attr.valuemask = X_MACRO(XpmExactColors | XpmCloseness |
+ XpmReturnPixels | XpmReturnExtensions);
+ int error = X::XpmCreatePixmapFromData(xDisplay, xRootWindow, pixmap_bytes,
+ &dest.pixmap, &dest.mask, &dest.attr);
+ if (error == X_MACRO(XpmSuccess)) {
+ X::XGCValues gcv;
+ gcv.clip_mask = dest.mask;
+ dest.gc = X::XCreateGC(xDisplay, dest.pixmap, X_MACRO(GCClipMask), &gcv);
+ return true;
+ }
+ else return false;
+}
+
+bool
+Xwrapper::create_pixmap(WMPixmap & dest, const WMPixmap & source) const
+{
+ create_pixmap(dest, source.attr.width, source.attr.height);
+ copy_rectangle(source, dest, 0, 0, source.attr.width, source.attr.height,
+ 0, 0);
+ return true;
+}
+
+bool
+Xwrapper::create_pixmap(WMPixmap & dest, const WMPixmap * source) const
+{ return source ? create_pixmap(dest, *source) : false; }
+
+bool
+Xwrapper::create_pixmap(WMPixmap & dest, int width, int height) const
+{
+ dest.attr.width = width;
+ dest.attr.height = height;
+ dest.pixmap = X::XCreatePixmap(xDisplay, xRootWindow, width, height,
+ DefaultDepth(xDisplay,
+ DefaultScreen(xDisplay)));
+ dest.mask = 0; //hope XCreateFoo never returns 0
+ X::XGCValues gcv;
+ dest.gc = X::XCreateGC(xDisplay, dest.pixmap, X_MACRO(None), &gcv);
+ return true;
+}
+
+bool
+Xwrapper::create_pixmap(WMPixmap & dest, int width, int height, int depth) const
+{
+ dest.attr.width = width;
+ dest.attr.height = height;
+ dest.pixmap = X::XCreatePixmap(xDisplay, xRootWindow, width, height, depth);
+ dest.mask = 0; //hope XCreateFoo never returns 0
+ X::XGCValues gcv;
+ dest.gc = X::XCreateGC(xDisplay, dest.pixmap, X_MACRO(None), &gcv);
+ return true;
+}
+
+void
+Xwrapper::free_pixmap(WMPixmap & dest) const
+{
+ X::XFreeGC(xDisplay, dest.gc);
+ X::XFreePixmap(xDisplay, dest.pixmap);
+ if (dest.mask) X::XFreePixmap(xDisplay, dest.mask);
+}
+
+void
+Xwrapper::draw_point(WMPixmap & dest, int x, int y, Color c) const
+{
+ set_GC(dest.gc, c);
+ X::XDrawPoint(xDisplay, dest.pixmap, dest.gc, x, y);
+}
+
+void
+Xwrapper::draw_line(WMPixmap & dest, int x1, int y1, int x2, int y2,
+ Color c) const
+{
+ set_GC(dest.gc, c);
+ X::XDrawLine(xDisplay, dest.pixmap, dest.gc, x1, y1, x2, y2);
+}
+
+void
+Xwrapper::draw_arc(WMPixmap & dest, int x, int y, int width, int height,
+ int angle1, int angle2, Color c)
+{
+ set_GC(dest.gc, c);
+ X::XDrawArc(xDisplay, dest.pixmap, dest.gc, x, y, width, height, angle1,
+ angle2);
+}
+
+void
+Xwrapper::draw_lines(WMPixmap & dest, const X::XPoint* points, int npoints,
+ Color c) const
+{
+ set_GC(dest.gc, c);
+ X::XDrawLines(xDisplay, dest.pixmap, dest.gc, const_cast<X::XPoint*>(points),
+ npoints, X_MACRO(CoordModeOrigin));
+}
+
+void
+Xwrapper::draw_horizontal_gradient(WMPixmap & dest, int x1, int y1, int x2,
+ int y2, Color c1, Color c2, double amount)
+{
+ if (!(x2 - x1) || !amount)
+ return; //gradient isn't wide enough, or none of it is to be drawn
+ if (x1 > x2) //put x1 on left while keeping colors straight
+ {
+ int tempx = x2; x2 = x1; x1 = tempx;
+ Color tempc = c2; c2 = c1; c1 = tempc;
+ }
+
+ int glinesm1 = x2 - x1;
+ int glines = glinesm1 + 1; //number of lines in the full gradient
+ double dlines = glines * amount; //number of lines that we want to show
+ int tdlines = static_cast<int> (dlines); //number of lines truncated to int
+ double residue = dlines - tdlines; //amount left over from integer truncation
+ for (int x = 0; x < tdlines; x++)
+ draw_line(dest, x1 + x, y1, x1 + x, y2, Color::alpha_blend(c2, c1,
+ 1.0 * x / glinesm1));
+ if (tdlines < glines) //correct undrawn line by using alpha blending
+ {
+ Color backcolor = get_point(dest, x1 + tdlines, y1);
+ Color forecolor = Color::alpha_blend(c2, c1, 1.0 * tdlines / glinesm1);
+ Color color = Color::alpha_blend(forecolor, backcolor, residue);
+ draw_line(dest, x1 + tdlines, y1, x1 + tdlines, y2, color);
+ }
+}
+
+void
+Xwrapper::draw_vertical_gradient(WMPixmap & dest, int x1, int y1, int x2,
+ int y2, Color c1, Color c2, double amount)
+{
+ if (!(y2 - y1) || !amount)
+ return; //gradient isn't high enough, or none of it is to be drawn
+ if (y1 > y2) //put y1 on left while keeping colors straight
+ {
+ int tempy = y2; y2 = y1; y1 = tempy;
+ Color tempc = c2; c2 = c1; c1 = tempc;
+ }
+
+ int glinesm1 = y2 - y1;
+ int glines = glinesm1 + 1; //number of lines in the full gradient
+ double dlines = glines * amount; //number of lines that we want to show
+ int tdlines = static_cast<int> (dlines); //number of lines truncated to int
+ double residue = dlines - tdlines; //amount left over from integer truncation
+ for (int y = 0; y < tdlines; y++)
+ draw_line(dest, x1, y1 + y, x2, y1 + y, Color::alpha_blend(c2, c1,
+ 1.0 * y / glinesm1));
+ if (tdlines < glines) //correct undrawn line by using alpha blending
+ {
+ Color backcolor = get_point(dest, x1, y1 + tdlines);
+ Color forecolor = Color::alpha_blend(c2, c1, 1.0 * tdlines / glinesm1);
+ Color color = Color::alpha_blend(forecolor, backcolor, residue);
+ draw_line(dest, x1, y1 + tdlines, x2, y1 + tdlines, color);
+ }
+}
+
+void
+Xwrapper::draw_border(WMPixmap & dest, int x, int y, int width, int height,
+ int thickness, Color topleft, Color botright,
+ Color corner) const
+{
+ if (width / 2 < thickness || height / 2 < thickness) return;
+
+ fill_rectangle(dest, x, y, width, thickness, topleft);
+ fill_rectangle(dest, x, y, thickness, height, topleft);
+ fill_rectangle(dest, x, y + height - thickness, width, thickness, botright);
+ fill_rectangle(dest, x + width - thickness, y, thickness, height, botright);
+ fill_rectangle(dest, x, y + height - thickness, thickness, thickness, corner);
+ fill_rectangle(dest, x + width - thickness, y, thickness, thickness, corner);
+}
+
+void
+Xwrapper::draw_border(WMPixmap & dest, const WMRectangle & r, int thickness,
+ Color topleft, Color botright, Color corner) const
+{
+ draw_border(dest, r.left(), r.top(), r.width(), r.height(), thickness,
+ topleft, botright, corner);
+}
+
+void
+Xwrapper::fill_rectangle(WMPixmap & dest, int x, int y,
+ int width, int height, Color c) const
+{
+ set_GC(dest.gc, c);
+ X::XFillRectangle(xDisplay, dest.pixmap, dest.gc, x, y, width, height);
+}
+
+void
+Xwrapper::fill_rectangle(WMPixmap & dest, const WMRectangle & r, Color c)
+const
+{ fill_rectangle(dest, r.left(), r.top(), r.width(), r.height(), c); }
+
+void
+Xwrapper::fill_arc(WMPixmap & dest, int x, int y, int width, int height,
+ int angle1, int angle2, Color c)
+{
+ set_GC(dest.gc, c);
+ X::XFillArc(xDisplay, dest.pixmap, dest.gc, x, y, width, height, angle1,
+ angle2);
+}
+
+void
+Xwrapper::fill_polygon(WMPixmap & dest, const X::XPoint* points, int npoints,
+ Color c, XShape shape) const
+{
+ set_GC(dest.gc, c);
+ X::XFillPolygon(xDisplay, dest.pixmap, dest.gc,
+ const_cast<X::XPoint*>(points), npoints, shape,
+ X_MACRO(CoordModeOrigin));
+}
+
+void
+Xwrapper::clear_rectangle(WMPixmap & dest, int x, int y,
+ int width, int height) const
+{
+ X::XClearArea(xDisplay, dest.pixmap, x, y, width, height,
+ /* don't generate expose events */ false);
+}
+
+void
+Xwrapper::clear_rectangle(WMPixmap & dest, const WMRectangle & r) const
+{ clear_rectangle(dest, r.left(), r.top(), r.width(), r.height()); }
+
+void
+Xwrapper::copy_rectangle(const WMPixmap & source, WMPixmap & dest,
+ int source_x, int source_y,
+ int source_w, int source_h,
+ int dest_x, int dest_y) const
+{
+ X::XCopyArea(xDisplay, source.pixmap, dest.pixmap, dest.gc, source_x,
+ source_y, source_w, source_h, dest_x, dest_y);
+}
+
+void
+Xwrapper::copy_rectangle(const WMPixmap & source, WMPixmap & dest,
+ const WMRectangle & r, int dest_x, int dest_y) const
+{
+ copy_rectangle(source, dest, r.left(), r.top(), r.width(), r.height(),
+ dest_x, dest_y);
+}
+
+void
+Xwrapper::copy_rectangle(const WMPixmap & source, X::Drawable & dest,
+ int source_x, int source_y,
+ int source_w, int source_h,
+ int dest_x, int dest_y) const
+{
+ X::XCopyArea(xDisplay, source.pixmap, dest, xGC, source_x, source_y,
+ source_w, source_h, dest_x, dest_y);
+}
+
+void
+Xwrapper::copy_rectangle(const WMPixmap & source, X::Drawable & dest,
+ const WMRectangle & r, int dest_x, int dest_y) const
+{
+ copy_rectangle(source, dest, r.left(), r.top(), r.width(), r.height(),
+ dest_x, dest_y);
+}
+
diff --git a/wmcube/wmapp/xwrapper.h b/wmcube/wmapp/xwrapper.h
new file mode 100644
index 000000000000..4f1b03877fdc
--- /dev/null
+++ b/wmcube/wmapp/xwrapper.h
@@ -0,0 +1,140 @@
+#include "colors.h"
+
+#ifndef _MY_XWRAPPER_H
+#define _MY_XWRAPPER_H
+
+//These must be included here so that important types and functions aren't
+//dragged into the X namespace, but left undefined in the global namespace.
+extern "C" {
+# include <stddef.h>
+# include <stdlib.h>
+# include <sys/types.h>
+# include <malloc.h>
+}
+namespace X {
+ // Unfortunately, many common X calls are actually macros and the X::
+ // prefix must be avoided when using them. Still, it is nice to use
+ // a separate namespace whenever possible.
+
+ // the next line ensures that X macros are expanded correctly into functions
+ // in the X namespace, since _XPrivDisplay appears to be the only
+ // real X object used by all X macros:
+# define _XPrivDisplay X::_XPrivDisplay
+
+ // this is just so I can easily see which identifiers are macros from Xlib
+ // that can't be prefixed by "X::"
+# define X_MACRO(x) (x)
+
+ extern "C" {
+# include <X11/X.h>
+# include <X11/Xlib.h>
+# include <X11/xpm.h>
+# include <X11/extensions/shape.h>
+ }
+};
+
+// forward declaration for rectangle
+struct WMRectangle;
+
+struct WMPixmap {
+ X::Pixmap pixmap;
+ X::Pixmap mask;
+ X::GC gc;
+ X::XpmAttributes attr;
+};
+
+// global X thingies
+extern X::Window wActiveWin, wProgramWin;
+extern X::Atom deleteWin, _XA_GNUSTEP_WM_FUNC;
+
+class Xwrapper {
+ private:
+ X::Display * xDisplay;
+ X::Window xRootWindow;
+ X::XWindowAttributes xAttributes;
+ mutable X::GC xGC;
+
+ unsigned long color_to_xcolor(Color) const;
+ void set_GC(X::GC, Color) const;
+
+ public:
+ Xwrapper();
+ ~Xwrapper();
+
+ X::Display * xdisplay() const;
+ const X::Window xrootwin() const;
+ X::GC get_GC() const;
+
+ bool create_pixmap(WMPixmap & dest, char * pixmap_bytes[]) const;
+ bool create_pixmap(WMPixmap & dest, const WMPixmap & source) const;
+ bool create_pixmap(WMPixmap & dest, const WMPixmap * source) const;
+ bool create_pixmap(WMPixmap & dest, int width, int height) const;
+ bool create_pixmap(WMPixmap & dest, int width, int height, int depth) const;
+
+ void free_pixmap(WMPixmap & dest) const;
+
+ Color get_point(const WMPixmap & src, int x, int y) const;
+
+ void draw_point(WMPixmap & dest, int x, int y, Color c) const;
+ void draw_line(WMPixmap & dest, int x1, int y1, int x2, int y2, Color c)
+ const;
+ void draw_arc(WMPixmap & dest, int x, int y, int width, int height,
+ int angle1, int angle2, Color c); //angles are in units of degrees * 64
+ void draw_lines(WMPixmap & dest, const X::XPoint* points, int npoints,
+ Color c) const; //X::XPoint is simply a struct { short x, y };
+
+ // draws a color gradient from left to right or bottom to top from color1
+ // to color2. amount is the proportion of the gradient to draw i.e. 0.5
+ // draws half the gradient. It should always be at least 2 pixels wide.
+ void draw_horizontal_gradient(WMPixmap & dest, int x1, int y1, int x2, int y2, Color c1, Color c2, double amount = 1.0);
+ void draw_vertical_gradient(WMPixmap & dest, int x1, int y1, int x2, int y2, Color c1, Color c2, double amount = 1.0);
+
+ void draw_border(WMPixmap & dest, int x, int y, int width, int height,
+ int thickness, Color topleft, Color botright, Color corner)
+ const;
+ void draw_border(WMPixmap & dest, const WMRectangle & posn, int thickness,
+ Color topleft, Color botright, Color corner) const;
+
+ void fill_rectangle(WMPixmap & dest, int x, int y, int width, int height,
+ Color c) const;
+ void fill_rectangle(WMPixmap & dest, const WMRectangle & posn, Color c)
+ const;
+
+ void fill_arc(WMPixmap & dest, int x, int y, int width, int height,
+ int angle1, int angle2, Color c); //angles are in units of degrees * 64
+
+ enum XShape { complex = X_MACRO(Complex), convex = X_MACRO(Convex),
+ nonconvex = X_MACRO(Nonconvex) };
+ void fill_polygon(WMPixmap & dest, const X::XPoint* points, int npoints,
+ Color c, XShape shape = complex) const;
+ //shape is simply a hint to the X server about what type of shape is
+ //being drawn. See XFillPolygon(3) for a complete description.
+
+ void clear_rectangle(WMPixmap & dest, int x, int y, int width, int height)
+ const;
+ void clear_rectangle(WMPixmap & dest, const WMRectangle & posn) const;
+
+ void copy_rectangle(const WMPixmap & source, WMPixmap & dest,
+ int source_x, int source_y, int source_w, int source_h,
+ int dest_x = 0, int dest_y = 0) const;
+ void copy_rectangle(const WMPixmap & source, WMPixmap & dest,
+ const WMRectangle & posn, int dest_x = 0, int dest_y = 0)
+ const;
+ void copy_rectangle(const WMPixmap & source, X::Drawable & dest,
+ int source_x, int source_y, int source_w, int source_h,
+ int dest_x = 0, int dest_y = 0) const;
+ void copy_rectangle(const WMPixmap & source, X::Drawable & dest,
+ const WMRectangle & posn, int dest_x = 0, int dest_y = 0)
+ const;
+};
+
+inline X::Display *
+Xwrapper::xdisplay() const { return xDisplay; }
+
+inline const X::Window
+Xwrapper::xrootwin() const { return xRootWindow; }
+
+inline X::GC
+Xwrapper::get_GC() const { return xGC; }
+
+#endif
diff --git a/wmcube/3dObjects/ball-solid.wmc b/wmcube/wmc/ball.wmc
similarity index 77%
rename from wmcube/3dObjects/ball-solid.wmc
rename to wmcube/wmc/ball.wmc
index fa6f2ff2d289..79b795fadfb4 100644
--- a/wmcube/3dObjects/ball-solid.wmc
+++ b/wmcube/wmc/ball.wmc
@@ -1,3 +1,5 @@
+# By wmCube author Robert Kling
+
WMCUBE_COORDINATES
1 -100 -100 100
2 100 -100 100
@@ -31,6 +33,57 @@ WMCUBE_COORDINATES
30 50 -50 -150
31 50 50 -150
+
WMCUBE_PLANES
1 18 19
1 19 2
diff --git a/wmcube/wmc/cossin.wmc b/wmcube/wmc/cossin.wmc
new file mode 100755
index 000000000000..93dd0a14f6d4
--- /dev/null
+++ b/wmcube/wmc/cossin.wmc
@@ -0,0 +1,362 @@
+WMCUBE_COORDINATES
+1 100 0 0
+2 54.030230586814 84.1470984807897 45.4648713412841
+3 -41.6146836547142 90.9297426825682 -37.8401247653964
+4 -98.9992496600445 14.1120008059867 -13.9707749099463
+5 -65.3643620863612 -75.6802495307928 49.4679123311691
+6 28.3662185463226 -95.8924274663138 -27.2010555444685
+7 96.0170286650366 -27.9415498198926 -26.8286459000217
+8 75.3902254343305 65.6986598718789 49.5303677847435
+9 -14.5500033808614 98.9358246623382 -14.3951658332533
+10 -91.1130261884677 41.2118485241757 -37.5493623385838
+11 -83.9071529076452 -54.402111088937 45.6472625363814
+12 0.442569798805079 -99.9990206550704 -0.442565464520194
+13 84.3853958732492 -53.6572918000435 -45.2789181003312
+14 90.7446781450196 42.0167036826641 38.1279225239801
+15 13.6737218207834 99.060735569487 13.5452894153935
+16 -75.9687912858821 65.0287840157117 -49.4015812046431
+17 -95.7659480323385 -28.7903316665065 27.5713340620845
+18 -27.5163338051597 -96.1397491879557 26.4541343060012
+19 66.031670824408 -75.0987246771676 -49.5889426721558
+20 98.8704618186669 14.9877209662952 14.8184289354693
+21 40.8082061813392 91.2945250727628 37.2556580239674
+22 -54.7729260224268 83.6655638536056 -45.8260773957817
+23 -99.9960826394637 -0.885130929040388 0.885096255270679
+24 -53.2833020333398 -84.6220404175171 45.0894173824405
+25 42.4179007336997 -90.5578362006624 -38.4127330661833
+26 99.1202811863474 -13.2351750097773 -13.1187426851964
+27 64.691932232864 76.2558450479603 49.3313796020243
+28 -29.2138808733836 95.6375928404503 -27.9394524425808
+29 -96.2605866313567 27.0905788307869 -26.0775501043456
+30 -74.8057529689 -66.3633884212967 49.6436324042268
+31 15.4251449887584 -98.8031624092862 -15.2405310551108
+32 91.4742357804531 -40.4037645323065 -36.9590348324611
+33 83.422336050651 55.1426681241691 46.0013019098395
+34 -1.32767472230595 99.9911860107267 -1.32755770119834
+35 -84.8570274784605 52.9082686120024 -44.8963840344646
+36 -90.3692205091507 -42.8182669496151 38.6945340778945
+37 -12.7963689627405 -99.1778853443116 12.6911681381018
+38 76.5414051945343 -64.3538133357 -49.2573130234124
+39 95.5073644047295 29.6368578709385 28.305381844909
+40 26.6642932359937 96.3795386284088 25.6989227993768
+41 -66.6938061652262 74.5113160479349 -49.6944326961688
+42 -98.7339277523826 -15.8622668804709 15.6614391216543
+43 -39.9985314988351 -91.6521547915634 36.6595160036646
+44 55.5113301520626 -83.1774742628598 -46.172922350203
+45 99.9843308647691 1.77019251054136 1.76991513668303
+46 52.532198881773 85.0903524534118 44.6998331800279
+47 -43.2177944884778 90.1788347648809 -38.9733034807902
+48 -99.2335469150929 12.3573122745224 -12.2625992733827
+49 -64.01443394692 -76.8254661323667 49.1793872717172
+50 30.0592543743637 -95.3752652759472 -28.6690935995211
+51 96.4966028492113 -26.2374853703929 -25.3182820554879
+52 74.2154196813783 67.0229175843375 49.7413395679203
+53 -16.2990780795705 98.6627592040485 -16.0811201581265
+54 -91.8282786212119 39.5925150181834 -36.3571250040426
+55 -82.930983286315 -55.8789048851616 46.3409252708893
+56 2.21267562619557 -99.975517335862 -2.21213390425355
+57 85.3220107722584 -52.1551002086912 -44.4997802183417
+58 89.9866826969194 43.6164755247825 39.2490194340655
+59 11.9180135448819 99.2872648084537 11.8330696682143
+60 -77.1080222975845 63.6738007139138 -49.0976084522042
+61 -95.2412980415156 -30.4810621102217 29.0305592106157
+62 -25.8101635938267 -96.6117770008393 24.9356576948197
+63 67.3507162323586 -73.9180696649223 -49.784349344459
+64 98.589658158255 16.7355700302807 16.4995412836891
+65 39.185723042955 92.0026038196791 36.0518855250866
+66 -56.2453851238172 82.6828679490103 -46.5052975093381
+67 -99.964745596635 -2.65511540239668 2.65417935730291
+68 -51.7769799789505 -85.5519978975322 44.2962408229974
+69 44.0143022496041 -89.7927680689291 -39.5216603361444
+70 99.3390379722272 -11.4784813783187 -11.4026129750431
+71 63.33192030863 77.3890681557889 49.0119829720156
+72 -30.9022728166071 95.1054653254375 -29.3897503583703
+73 -96.7250588273882 25.3823362762036 -24.5510796949235
+74 -73.6192718227316 -67.6771956887308 49.8234586560887
+75 17.1717341830778 -98.5146260468247 -16.9166697162138
+76 92.1751269724749 -38.778163540943 -35.7438214814582
+77 82.4331331107558 56.610763689818 46.6660261874431
+78 -3.09750317312165 99.9520158580731 -3.09601686280287
+79 -85.7803093244988 51.3978455987535 -44.089230940739
+80 -89.5970946790963 -44.4112668707508 39.7912048263728
+81 -11.0387243839048 -99.3888653923375 10.9712629189502
+82 77.6685982021631 -62.9887994274454 -48.922517539669
+83 94.9677697882543 31.3228782433085 29.7466389011604
+84 24.9540117973338 96.8364461100185 24.1645781864128
+85 -68.0023495587339 73.3190320073292 -49.858664438704
+86 -98.4376643394042 -17.6075619948587 17.3324727748515
+87 -38.3698444949742 -92.345844700406 35.4329570091161
+88 56.9750334265312 -82.1817836630823 -46.8230987125607
+89 99.9373283695125 3.53983027336607 3.53761180401726
+90 51.0177044941669 86.0069405812453 43.8787667902134
+91 -44.807361612917 89.3996663600558 -40.0576317866915
+92 -99.4367460928201 10.5987511751157 -10.5390532950096
+93 -62.6444447910339 -77.9466069615805 48.8292191645315
+94 31.7428701519702 -94.8282141269947 -30.1011968777642
+95 96.9459366669988 -24.5251985467654 -23.7761834506029
+96 73.017356099482 68.3261714736121 49.88996393403
+97 -18.0430449291084 98.3587745434345 -17.7469178825923
+98 -92.5147536596414 37.9607739027522 -35.1193164634246
+99 -81.9288245291459 -57.3381871990423 46.9765027784966
+100 3.98208803931389 -99.9206834186354 -3.97892958321418
+101 86.2318872287684 -50.6365641109759 -43.6648648606997
+102 89.200486978816 45.2025787178351 40.3209203432915
+103 10.1585703696621 99.4826791358406 10.1060179656396
+104 -78.2230889887116 62.2988631442349 -48.7320951562705
+105 -94.6868010751213 -32.1622403162531 30.453396509553
+106 -24.0959049236201 -97.0535283537485 23.3859259171379
+107 68.6486550906984 -72.7142500080853 -49.9173546898386
+108 98.2779582041221 18.4781744560667 18.159972568818
+109 37.5509597767012 92.6818505417785 34.8029244172456
+110 -57.7002178942952 81.6742606636317 -47.1262263664701
+111 -99.9020813314648 -4.4242678085071 4.41993562437658
+112 -50.2544319145385 -86.4551448610608 43.4475419108175
+113 45.5969104444276 -88.9995604366833 -40.5810498682487
+114 99.5266636217131 -9.7181905893209 -9.67219085795039
+115 61.952061255921 78.498038868131 48.6311531242812
+116 -32.5809805219964 94.543533402477 -30.8032102026682
+117 -97.1592190628802 23.6661393364286 -22.9938361616071
+118 -72.4097196700474 -68.9697940935389 49.9408345601404
+119 18.9129420528958 -98.1952169044084 -18.5716044718461
+120 92.8471320739076 -37.140410143809 -34.4838056590133
+121 81.4180970526562 58.0611184212314 47.2722577460558
+122 -4.86636092001539 99.881522472358 -4.86059537591122
+123 -86.676709105198 49.8713153896394 -43.2268149672136
+124 -88.7968906691855 -45.9903490689591 40.8379999811404
+125 -9.27762045976609 -99.5686986889179 9.2376059610859
+126 78.7714512144235 -61.6040459188656 -48.5264009770903
+127 94.3984139152314 32.9990825673782 31.1506105501826
+128 23.2359102029658 97.2630067242408 22.5999449031492
+129 -69.2895821920165 72.1037710501732 -49.9604017053531
+130 -98.1105522649388 -19.3473392038468 18.9817813414652
+131 -36.7291330454696 -93.0105950186762 34.1619851907925
+132 58.4208817109289 -81.16033871367 -47.4145854761024
+133 99.8590072439991 5.30835871460582 5.30087431335569
+134 49.487222040343 86.8965756214236 43.0027013232285
+135 -46.3828868851872 88.5924816459948 -41.091750550642
+136 -99.6087835141185 8.83686861040014 -8.80229732356057
+137 -61.25482394961 -79.0433206722889 48.4178469217362
+138 33.4165382630761 -94.2514454558251 -31.4955703342481
+139 97.3648893049518 -22.8052259500861 -22.2042830020455
+140 71.7964101410472 69.6080131224741 49.9760545924455
+141 -19.7813574004268 98.0239659440312 -19.3904710414615
+142 -93.172236174352 36.3171365373259 -33.8374882263192
+143 -80.9009906953598 -58.7795007167406 47.5531984056293
+144 5.75025253491242 -99.8345360873918 -5.7407379420833
+145 87.1147401032343 -49.1021593898469 -42.775218537541
+146 88.38633737085 46.7745162045133 41.3422816961041
+147 8.39594367418485 99.6469173121774 8.36629905059196
+148 -79.3136419166478 60.9044021883292 -48.3054994631265
+149 -94.1026309029144 -33.8333394324276 31.8380625282276
+150 -22.3740950135584 -97.4648648094495 21.8068814573024
+151 69.9250806478375 -71.4876429629165 -49.9877919950575
+152 97.9354596376429 20.2149881415654 19.797641552137
+153 35.9044286891116 93.3320523748862 33.5103401890253
+154 -59.1369684144325 80.6400580775486 -47.6880856746999
+155 -99.80810948185 -6.19203372560573 6.18015180000565
+156 -48.7161349803341 -87.3311982774648 42.544384432793
+157 47.1652293561339 -88.1784618814781 -41.5895737891102
+158 99.6830993361718 -7.95485428747221 -7.92964530142864
+159 60.552787498699 79.5824096527455 48.1893674033711
+160 -34.2494779115907 93.9519731713148 -32.1780602988131
+161 -97.5629312795237 21.9425258379005 -21.4077714042226
+162 -71.1774755635724 -70.2407785577371 49.9956129935963
+163 20.6482229337811 -97.845035079338 -20.203260972818
+164 93.490040489975 -35.4910175844935 -33.1805667100472
+165 80.3775459710974 59.4932778023209 47.8192367152731
+166 -6.63369363356237 99.7797279449891 -6.6190814602726
+167 -87.5459459043705 48.3291563728257 -42.3102170941926
+168 -87.9688592495152 -47.5550186871899 41.8336074550147
+169 -7.51360908983532 -99.717328877408 7.49237028667391
+170 79.8496186162556 -60.1999867677605 -48.069459841093
+171 93.7994752119442 34.664945549703 32.5155370081276
+172 21.5105268762141 97.6590867943566 21.0069841119653
+173 -70.55510066863 70.8659140182323 -49.9995169753086
+174 -97.7526940402531 -21.0810532913481 20.6072975243543
+175 -35.0769113209131 -93.6461974251213 32.848193626217
+176 59.84842190141 -80.1134595178041 -47.9466412520307
+177 99.7493920327152 7.07522360803452 7.05749253396957
+178 47.9412311470322 87.7589787777116 42.0727348680976
+179 -47.9438765629173 87.7575335804269 -42.0743635744605
+180 -99.7496052654355 7.07221672389912 -7.05450826560549
+181 -59.8460069057858 -80.115263573383 47.9457861707153
+
+WMCUBE_PLANES
+1 2 3
+2 3 4
+3 4 5
+4 5 6
+5 6 7
+6 7 8
+7 8 9
+8 9 10
+9 10 11
+10 11 12
+11 12 13
+12 13 14
+13 14 15
+14 15 16
+15 16 17
+16 17 18
+17 18 19
+18 19 20
+19 20 21
+20 21 22
+21 22 23
+22 23 24
+23 24 25
+24 25 26
+25 26 27
+26 27 28
+27 28 29
+28 29 30
+29 30 31
+30 31 32
+31 32 33
+32 33 34
+33 34 35
+34 35 36
+35 36 37
+36 37 38
+37 38 39
+38 39 40
+39 40 41
+40 41 42
+41 42 43
+42 43 44
+43 44 45
+44 45 46
+45 46 47
+46 47 48
+47 48 49
+48 49 50
+49 50 51
+50 51 52
+51 52 53
+52 53 54
+53 54 55
+54 55 56
+55 56 57
+56 57 58
+57 58 59
+58 59 60
+59 60 61
+60 61 62
+61 62 63
+62 63 64
+63 64 65
+64 65 66
+65 66 67
+66 67 68
+67 68 69
+68 69 70
+69 70 71
+70 71 72
+71 72 73
+72 73 74
+73 74 75
+74 75 76
+75 76 77
+76 77 78
+77 78 79
+78 79 80
+79 80 81
+80 81 82
+81 82 83
+82 83 84
+83 84 85
+84 85 86
+85 86 87
+86 87 88
+87 88 89
+88 89 90
+89 90 91
+90 91 92
+91 92 93
+92 93 94
+93 94 95
+94 95 96
+95 96 97
+96 97 98
+97 98 99
+98 99 100
+99 100 101
+100 101 102
+101 102 103
+102 103 104
+103 104 105
+104 105 106
+105 106 107
+106 107 108
+107 108 109
+108 109 110
+109 110 111
+110 111 112
+111 112 113
+112 113 114
+113 114 115
+114 115 116
+115 116 117
+116 117 118
+117 118 119
+118 119 120
+119 120 121
+120 121 122
+121 122 123
+122 123 124
+123 124 125
+124 125 126
+125 126 127
+126 127 128
+127 128 129
+128 129 130
+129 130 131
+130 131 132
+131 132 133
+132 133 134
+133 134 135
+134 135 136
+135 136 137
+136 137 138
+137 138 139
+138 139 140
+139 140 141
+140 141 142
+141 142 143
+142 143 144
+143 144 145
+144 145 146
+145 146 147
+146 147 148
+147 148 149
+148 149 150
+149 150 151
+150 151 152
+151 152 153
+152 153 154
+153 154 155
+154 155 156
+155 156 157
+156 157 158
+157 158 159
+158 159 160
+159 160 161
+160 161 162
+161 162 163
+162 163 164
+163 164 165
+164 165 166
+165 166 167
+166 167 168
+167 168 169
+168 169 170
+169 170 171
+170 171 172
+171 172 173
+172 173 174
+173 174 175
+174 175 176
+175 176 177
+176 177 178
+177 178 179
+178 179 180
diff --git a/wmcube/wmc/coussin.bande.diag.wmc b/wmcube/wmc/coussin.bande.diag.wmc
new file mode 100755
index 000000000000..7287b32f162c
--- /dev/null
+++ b/wmcube/wmc/coussin.bande.diag.wmc
@@ -0,0 +1,124 @@
+WMCUBE_COORDINATES
+1 -3 -3 -0.989992496600445
+2 -3 -2 -0.923561053656561
+3 -3 -1 -0.875844530679003
+4 -3 0 -0.858525596664594
+5 -3 1 -0.875844530679003
+6 -3 2 -0.923561053656561
+7 -3 3 -0.989992496600445
+8 -2 -3 -0.923561053656561
+9 -2 -2 -0.416146836547142
+10 -2 -1 -0.0516802364419242
+11 -2 0 0.0806046117362795
+12 -2 1 -0.0516802364419242
+13 -2 2 -0.416146836547142
+14 -2 3 -0.923561053656561
+15 -1 -3 -0.875844530679003
+16 -1 -2 -0.0516802364419242
+17 -1 -1 0.54030230586814
+18 -1 0 0.755165123780746
+19 -1 1 0.54030230586814
+20 -1 2 -0.0516802364419242
+21 -1 3 -0.875844530679003
+22 0 -3 -0.858525596664594
+23 0 -2 0.0806046117362795
+24 0 -1 0.755165123780746
+25 0 0 1
+26 0 1 0.755165123780746
+27 0 2 0.0806046117362795
+28 0 3 -0.858525596664594
+29 1 -3 -0.875844530679003
+30 1 -2 -0.0516802364419242
+31 1 -1 0.54030230586814
+32 1 0 0.755165123780746
+33 1 1 0.54030230586814
+34 1 2 -0.0516802364419242
+35 1 3 -0.875844530679003
+36 2 -3 -0.923561053656561
+37 2 -2 -0.416146836547142
+38 2 -1 -0.0516802364419242
+39 2 0 0.0806046117362795
+40 2 1 -0.0516802364419242
+41 2 2 -0.416146836547142
+42 2 3 -0.923561053656561
+43 3 -3 -0.989992496600445
+44 3 -2 -0.923561053656561
+45 3 -1 -0.875844530679003
+46 3 0 -0.858525596664594
+47 3 1 -0.875844530679003
+48 3 2 -0.923561053656561
+49 3 3 -0.989992496600445
+
+WMCUBE_PLANES
+1 8 2
+8 2 9
+2 3 9
+9 10 3
+3 10 4
+10 4 11
+4 5 11
+11 12 5
+5 12 6
+12 6 13
+6 7 13
+13 14 7
+8 9 15
+15 16 9
+9 16 10
+16 10 17
+10 11 17
+17 18 11
+11 18 12
+18 12 19
+12 13 19
+19 20 13
+13 20 14
+20 14 21
+15 22 16
+22 16 23
+16 17 23
+23 24 17
+17 24 18
+24 18 25
+18 19 25
+25 26 19
+19 26 20
+26 20 27
+20 21 27
+27 28 21
+22 23 29
+29 30 23
+23 30 24
+30 24 31
+24 25 31
+31 32 25
+25 32 26
+32 26 33
+26 27 33
+33 34 27
+27 34 28
+34 28 35
+29 36 30
+36 30 37
+30 31 37
+37 38 31
+31 38 32
+38 32 39
+32 33 39
+39 40 33
+33 40 34
+40 34 41
+34 35 41
+41 42 35
+36 37 43
+43 44 37
+37 44 38
+44 38 45
+38 39 45
+45 46 39
+39 46 40
+46 40 47
+40 41 47
+47 48 41
+41 48 42
+48 42 49
diff --git a/wmcube/3dObjects/cross2-solid.wmc b/wmcube/wmc/cross2-solid.wmc
similarity index 100%
rename from wmcube/3dObjects/cross2-solid.wmc
rename to wmcube/wmc/cross2-solid.wmc
diff --git a/wmcube/3dObjects/cross3-solid.wmc b/wmcube/wmc/cross3-solid.wmc
similarity index 100%
rename from wmcube/3dObjects/cross3-solid.wmc
rename to wmcube/wmc/cross3-solid.wmc
diff --git a/wmcube/3dObjects/cube-solid.wmc b/wmcube/wmc/cube.wmc
similarity index 72%
rename from wmcube/3dObjects/cube-solid.wmc
rename to wmcube/wmc/cube.wmc
index 31d6a7ba2a6a..58219d06e7d1 100644
--- a/wmcube/3dObjects/cube-solid.wmc
+++ b/wmcube/wmc/cube.wmc
@@ -1,3 +1,5 @@
+# By wmCube author Robert Kling
+
WMCUBE_COORDINATES
1 -180 -180 180
2 180 -180 180
@@ -8,6 +10,20 @@ WMCUBE_COORDINATES
7 180 180 -180
8 -180 180 -180

+WMCUBE_LINES
+1 2
+2 3
+3 4
+4 1
+5 6
+6 7
+7 8
+8 5
+1 5
+2 6
+3 7
+4 8
+
WMCUBE_PLANES
1 2 3
1 3 4
diff --git a/wmcube/wmc/diamond.wmc b/wmcube/wmc/diamond.wmc
new file mode 100644
index 000000000000..98214554826f
--- /dev/null
+++ b/wmcube/wmc/diamond.wmc
@@ -0,0 +1,107 @@
+# This object is somewhat broken
+# Originally by Nicolas Mieville <n...@altern.org>
+
+WMCUBE_COORDINATES
+
+1 -50 0 0
+2 -35 0 35
+3 0 0 50
+4 35 0 35
+5 50 0 0
+6 35 0 -35
+7 0 0 -50
+8 -35 0 -35
+9 -32 17 13
+10 -13 17 32
+11 13 17 32
+12 32 17 13
+13 32 17 -13
+14 13 17 -32
+15 -13 17 -32
+16 -32 17 -13
+17 0 -60 0
+18 0 17 0
+
+WMCUBE_LINES
+
+1 2
+2 3
+3 4
+4 5
+5 6
+6 7
+7 8
+
+WMCUBE_PLANES
+
+17 1 2
+17 2 3
+17 3 4
+17 4 5
+17 5 6
+17 6 7
+17 7 8
+17 8 1
+
+2 1 9
+2 9 10
+3 2 10
+3 10 11
+4 3 11
+4 11 12
+5 4 12
+5 12 13
+6 5 13
+6 13 14
+7 6 14
+7 14 15
+8 7 15
+8 15 16
+9 8 16
+9 1 16
+1 8 16
+
+9 18 10
+10 18 11
+11 18 12
+12 18 13
+13 18 14
+14 18 15
+15 18 16
+16 18 9
diff --git a/wmcube/3dObjects/dice-solid.wmc b/wmcube/wmc/dice.wmc
similarity index 78%
rename from wmcube/3dObjects/dice-solid.wmc
rename to wmcube/wmc/dice.wmc
index cd561df21923..2de71393649d 100644
--- a/wmcube/3dObjects/dice-solid.wmc
+++ b/wmcube/wmc/dice.wmc
@@ -1,3 +1,5 @@
+# By Robert Kling
+
WMCUBE_COORDINATES
1 -70 -120 120
2 70 -120 120
@@ -26,6 +28,49 @@ WMCUBE_COORDINATES
23 120 120 -70
24 -120 120 -70

+WMCUBE_LINES
+
+1 2
+2 3
+3 4
+4 5
+5 6
+6 7
+7 8
+8 1
+
+9 10
+10 11
+11 12
+12 13
+13 14
+14 15
+15 16
+16 9
+
+1 17
+2 18
+3 18
+4 19
+5 19
+6 20
+7 20
+8 17
+
+9 21
+10 22
+11 22
+12 23
+13 23
+14 24
+15 24
+16 21
+
+17 21
+18 22
+19 23
+20 24
+
WMCUBE_PLANES

17 1 8
diff --git a/wmcube/wmc/hyp_par.wmc b/wmcube/wmc/hyp_par.wmc
new file mode 100644
index 000000000000..67e5083f009b
--- /dev/null
+++ b/wmcube/wmc/hyp_par.wmc
@@ -0,0 +1,70 @@
+WMCUBE_COORDINATES
+1 50 50 50
+2 -50 50 50
+3 -50 -50 50
+4 50 -50 50
+5 50 50 -50
+6 -50 50 -50
+7 -50 -50 -50
+8 50 -50 -50
+9 50 40 40
+10 -50 -40 40
+11 50 30 30
+12 -50 -30 30
+13 50 20 20
+14 -50 -20 20
+15 50 10 10
+16 -50 -10 10
+17 50 0 0
+18 -50 0 0
+19 50 -10 -10
+20 -50 10 -10
+21 50 -20 -20
+22 -50 20 -20
+23 50 -30 -30
+24 -50 30 -30
+25 50 -40 -40
+26 -50 40 -40
+27 -40 -40 50
+28 -40 40 -50
+29 -30 -30 50
+30 -30 30 -50
+31 -20 -20 50
+32 -20 20 -50
+
+33 -10 -10 50
+34 -10 10 -50
+35 0 0 50
+36 0 0 -50
+37 10 10 50
+38 10 -10 -50
+39 20 20 50
+40 20 -20 -50
+41 30 30 50
+42 30 -30 -50
+43 40 40 50
+44 40 -40 -50
+
+WMCUBE_LINES
+9 10
+11 12
+13 14
+15 16
+17 18
+19 20
+21 22
+23 24
+25 26
+27 28
+29 30
+31 32
+33 34
+35 36
+37 38
+39 40
+41 42
+43 44
+1 8
+8 6
+6 3
+3 1
diff --git a/wmcube/wmc/judaspriest.wmc b/wmcube/wmc/judaspriest.wmc
new file mode 100644
index 000000000000..7a8d6d285168
--- /dev/null
+++ b/wmcube/wmc/judaspriest.wmc
@@ -0,0 +1,239 @@
+WMCUBE_COORDINATES
+1 -66 100 35
+2 -27 17 35
+3 -106 17 35
+4 -130 55 35
+5 -162 21 35
+6 -117 -62 35
+7 -68 -108 35
+8 -7 -108 35
+9 -28 -60 35
+10 -64 -60 35
+11 -90 -24 35
+12 -8 -24 35
+13 37 -118 35
+14 83 -118 35
+15 37 -24 35
+16 120 -24 35
+17 114 -68 35
+18 101 -68 35
+19 122 -115 35
+20 146 -115 35
+21 164 -44 35
+22 132 27 35
+23 84 52 35
+24 101 17 35
+25 18 17 35
+26 -11 74 35
+
+27 -66 100 -35
+28 -27 17 -35
+29 -106 17 -35
+30 -130 55 -35
+31 -162 21 -35
+32 -117 -62 -35
+33 -68 -108 -35
+34 -7 -108 -35
+35 -28 -60 -35
+36 -64 -60 -35
+37 -90 -24 -35
+38 -8 -24 -35
+39 37 -118 -35
+40 83 -118 -35
+41 37 -24 -35
+42 120 -24 -35
+43 114 -68 -35
+44 101 -68 -35
+45 122 -115 -35
+46 146 -115 -35
+47 164 -44 -35
+48 132 27 -35
+49 84 52 -35
+50 101 17 -35
+51 18 17 -35
+52 -11 74 -35
+
+
+WMCUBE_LINES
+1 2
+2 3
+3 4
+4 5
+5 6
+6 7
+7 8
+8 9
+9 10
+10 11
+11 12
+12 13
+13 14
+14 15
+15 16
+16 17
+17 18
+18 19
+19 20
+20 21
+21 22
+22 23
+23 24
+24 25
+25 26
+26 1
+
+27 28
+28 29
+29 30
+30 31
+31 32
+32 33
+33 34
+34 35
+35 36
+36 37
+37 38
+38 39
+39 40
+40 41
+41 42
+42 43
+43 44
+44 45
+45 46
+46 47
+47 48
+48 49
+49 50
+50 51
+51 52
+52 27
+
+1 27
+2 28
+3 29
+4 30
+5 31
+6 32
+7 33
+8 34
+9 35
+10 36
+11 37
+12 38
+13 39
+14 40
+15 41
+16 42
+17 43
+18 44
+19 45
+20 46
+21 47
+22 48
+23 49
+24 50
+25 51
+26 52
+
+WMCUBE_PLANES
+1 2 26
+26 2 25
+26 2 15
+24 3 11
+24 11 16
+15 12 13
+15 2 13
+15 13 14
+23 24 22
+22 24 16
+22 16 21
+21 16 17
+21 17 20
+17 19 20
+17 18 19
+4 5 3
+3 5 6
+3 6 11
+11 6 10
+10 6 7
+9 10 7
+9 7 8
+
+52 28 27
+51 28 52
+41 28 52
+37 29 50
+42 37 50
+39 38 41
+39 28 41
+40 39 41
+48 50 49
+42 50 48
+47 42 48
+43 42 47
+46 43 47
+46 45 43
+45 44 43
+29 31 30
+32 31 29
+37 32 29
+36 32 37
+33 32 36
+33 36 35
+34 33 35
+
+13 1 27
+27 39 13
+28 29 3
+28 3 2
+29 24 50
+24 29 3
+30 4 29
+29 4 3
+31 4 30
+4 31 5
+32 6 5
+5 31 32
+7 6 32
+7 32 33
+33 34 7
+7 34 8
+8 35 9
+35 8 34
+36 9 35
+9 36 10
+10 37 11
+37 10 36
+12 37 38
+37 12 11
+13 40 14
+13 39 40
+14 41 15
+41 14 40
+16 41 42
+41 16 15
+42 16 37
+11 37 16
+17 16 42
+43 17 42
+17 43 44
+18 17 44
+44 19 18
+19 44 45
+20 45 46
+45 20 19
+20 47 21
+47 20 46
+21 48 22
+48 21 47
+22 49 23
+49 22 48
+23 49 24
+50 24 49
+51 24 50
+24 51 25
+25 52 26
+52 25 51
+27 1 52
+1 26 52
\ No newline at end of file
diff --git a/wmcube/3dObjects/peace.wmc b/wmcube/wmc/peace.wmc
similarity index 98%
rename from wmcube/3dObjects/peace.wmc
rename to wmcube/wmc/peace.wmc
index 22b57cbcf7c8..ff28e65e03e0 100644
--- a/wmcube/3dObjects/peace.wmc
+++ b/wmcube/wmc/peace.wmc
@@ -1,3 +1,5 @@
+#By Peter Kokles <kok...@bb.telecom.sk>
+
WMCUBE_COORDINATES
1 0 -120 10
2 -46 -111 10
diff --git a/wmcube/3dObjects/radioactive.wmc b/wmcube/wmc/radioactive.wmc
similarity index 98%
rename from wmcube/3dObjects/radioactive.wmc
rename to wmcube/wmc/radioactive.wmc
index 675ee081eeb5..87f49f5b2880 100644
--- a/wmcube/3dObjects/radioactive.wmc
+++ b/wmcube/wmc/radioactive.wmc
@@ -1,3 +1,5 @@
+#By Peter Kokles <kok...@bb.telecom.sk>
+
WMCUBE_COORDINATES
1 0 0 0
2 5 -19 0
diff --git a/wmcube/3dObjects/cross4-solid.wmc b/wmcube/wmc/star-solid.wmc
similarity index 60%
rename from wmcube/3dObjects/cross4-solid.wmc
rename to wmcube/wmc/star-solid.wmc
index 371d57e7a525..a52f95f12be1 100644
--- a/wmcube/3dObjects/cross4-solid.wmc
+++ b/wmcube/wmc/star-solid.wmc
@@ -7,30 +7,30 @@ WMCUBE_COORDINATES
6 50 -50 -50
7 50 50 -50
8 -50 50 -50
-9 -50 -300 -50
-10 50 -300 -50
-11 300 -50 -50
-12 300 50 -50
-13 50 300 -50
-14 -50 300 -50
-15 -300 50 -50
-16 -300 -50 -50
-17 -300 -50 50
-18 -50 -300 50
-19 50 -300 50
-20 300 -50 50
-21 300 50 50
-22 50 300 50
-23 -50 300 50
-24 -300 50 50
-25 -50 -50 300
-26 50 -50 300
-27 50 50 300
-28 -50 50 300
-29 -50 -50 -300
-30 50 -50 -300
-31 50 50 -300
-32 -50 50 -300
+9 -10 -150 -10
+10 10 -150 -10
+11 150 -10 -10
+12 150 10 -10
+13 10 150 -10
+14 -10 150 -10
+15 -150 10 -10
+16 -150 -10 -10
+17 -150 -10 10
+18 -10 -150 10
+19 10 -150 10
+20 150 -10 10
+21 150 10 10
+22 10 150 10
+23 -10 150 10
+24 -150 10 10
+25 -10 -10 150
+26 10 -10 150
+27 10 10 150
+28 -10 10 150
+29 -10 -10 -150
+30 10 -10 -150
+31 10 10 -150
+32 -10 10 -150

WMCUBE_PLANES
1 18 19
diff --git a/wmcube/3dObjects/wmlogo.wmc b/wmcube/wmc/wmlogo.wmc
similarity index 92%
rename from wmcube/3dObjects/wmlogo.wmc
rename to wmcube/wmc/wmlogo.wmc
index 8051cee32c57..9378f68e75ad 100644
--- a/wmcube/3dObjects/wmlogo.wmc
+++ b/wmcube/wmc/wmlogo.wmc
@@ -1,3 +1,5 @@
+# By Rafael Garcia-Suarez <garcia...@kazibao.net>
+
WMCUBE_COORDINATES
1 30 -30 10
2 -30 -30 10
diff --git a/wmcube/wmcube.cc b/wmcube/wmcube.cc
new file mode 100644
index 000000000000..d529026a125d
--- /dev/null
+++ b/wmcube/wmcube.cc
@@ -0,0 +1,695 @@
+#include <stdio.h>
+#include <stdexcept>
+#include <sys/types.h>
+#include <dirent.h>
+#include <iostream>
+#include <vector>
+#include <math.h>
+#include <unistd.h>
+
+#include "WmcObject.h"
+#include "wmcube.h"
+
+using namespace std;
+
+/**************************************************
+
+ Defines
+
+**************************************************/
+
+#define DEFAULT_WMC_PATH "/usr/share/wmcube"
+#define WMC_REDRAW 2 // centiseconds (= 50 fps)
+#define CANVAS_BGCOLOR 0x202020
+#define CYAN 0x20B2AE
+
+#define WINDOW_NEW 0
+#define WINDOW_CLASSIC 1
+
+// Rotation speed (in radians) for each screen update
+#define ROT_SPEED_X (float)clopt_rspeed * (0.005 + (float)cpu_load / 3000.0)
+#define ROT_SPEED_Y (float)clopt_rspeed * (0.005 + (float)cpu_load / 3500.0)
+#define ROT_SPEED_Z (float)clopt_rspeed * (0.005 + (float)cpu_load / 4000.0)
+
+// Placement for the objects in new/classic mode
+#define XOFF_NEW 27
+#define YOFF_NEW 20
+#define ZOFF_NEW 400
+#define XOFF_CLASSIC XOFF_NEW
+#define YOFF_CLASSIC 27
+#define ZOFF_CLASSIC -ZOFF_NEW
+
+/**************************************************
+
+ Function predeclaration
+
+**************************************************/
+
+// Timer and widget callbacks
+void gatherStatistics(const WMApp *a, void *);
+void displayWmcObject(const WMApp *a, WMWidget *w, void *);
+void displayCpuText(const WMApp *a, WMWidget *w, void *);
+void displayCpuMeter(const WMApp *a, WMWidget *w, void *);
+void canvasClicked(const WMApp *a, WMWidget *w, void *);
+
+// Other funcs
+void switchWindow(WmcObject *currentwmc);
+void scanWmcDirectory(const char *dirname);
+char *nextObject();
+char *prevObject();
+void clearCanvas(WMCanvas *canvas);
+bool checkMouseRegion(const WMCanvas *c, int button, int ulx, int uly, int lrx, int lry);
+
+/**************************************************
+
+ Global variables
+
+**************************************************/
+
+// "Main" variables
+WMApp wmcube;
+CpuMonitor *cpumon = 0;
+WmcObject *wmc, *wmcnew, *wmcold;
+int cpu_load = 0;
+int switching = 0;
+int xoff = XOFF_NEW, yoff = YOFF_NEW, zoff = ZOFF_NEW;
+
+// A list of available object's filenames and an iterator
+vector <char *> objects;
+vector <char *>::const_iterator obj_iterator;
+
+// Variables for command line options (set to their defaults)
+char *clopt_object = 0;
+int clopt_cpu = -1;
+int clopt_update = 50;
+int clopt_window = WINDOW_NEW;
+float clopt_rspeed = 3;
+bool clopt_nice = true;
+unsigned clopt_fgcolor = CYAN;
+float clopt_shade = 90.0;
+unsigned clopt_bgcolor = CANVAS_BGCOLOR;
+int clopt_invert = false;
+int clopt_mode = SOLID;
+bool clopt_lsource = false;
+bool clopt_wheel = false;
+bool clopt_help = false;
+
+/**************************************************
+
+ Main
+
+**************************************************/
+int main(int argc, char *argv[])
+{
+ WMApp::initialize(argc, argv);
+
+ /**************************************************
+
+ Parse command line parameters
+
+ ***************************************************/
+ int c = 0;
+ char clstr[64] = "";
+
+ for (int i = 0; i < NUM_CL_OPT; i++)
+ {
+ clstr[c++] = CL_OPT[i].c;
+ if (strlen(CL_OPT[i].parms) > 0) clstr[c++] = ':';
+ }
+
+ clstr[c] = 0;
+
+ while ((c = getopt (argc, argv, clstr)) != -1)
+ {
+ switch (c)
+ {
+ case CL_OPT_OBJECT_INT:
+ clopt_object = strndup(optarg, 256);
+ break;
+ case CL_OPT_CPU_INT:
+ clopt_cpu = atoi(optarg);
+ break;
+ case CL_OPT_UPDATE_INT:
+ clopt_update = atoi(optarg);
+ break;
+ case CL_OPT_WINDOW_INT:
+ clopt_window = WINDOW_CLASSIC;
+ break;
+ case CL_OPT_RSPEED_INT:
+ clopt_rspeed = atoi(optarg);
+ break;
+ case CL_OPT_NICE_INT:
+ clopt_nice = false;
+ break;
+ case CL_OPT_FGCOLOR_INT:
+ sscanf(optarg, "%x", &clopt_fgcolor);
+ //printf("FGCOLOR = 0x%X shade = %.3f\n", clopt_fgcolor, clopt_shade);
+ break;
+ case CL_OPT_SHADE_INT:
+ clopt_shade = atoi(optarg);
+ break;
+ case CL_OPT_BGCOLOR_INT:
+ sscanf(optarg, "%x", &clopt_bgcolor);
+ //printf("BGCOLOR = 0x%X\n", clopt_bgcolor);
+ break;
+ case CL_OPT_INVERT_INT:
+ clopt_invert = true;
+ break;
+ case CL_OPT_MODE_INT:
+ clopt_mode = atoi(optarg);
+ break;
+ case CL_OPT_LSOURCE_INT:
+ clopt_lsource = true;
+ break;
+ case CL_OPT_WHEEL_INT:
+ clopt_wheel = true;
+ break;
+ case CL_OPT_HELP_INT:
+ clopt_help = true;
+ printUsage();
+ break;
+ default:
+ clopt_help = true;
+ printUsage();
+ break;
+ }
+ }
+
+
+ /**************************************************
+
+ Set up cpu monitor
+
+ ***************************************************/
+
+ try
+ {
+
+#ifdef DARWIN
+ cpumon = new CpuMonitor();
+#endif
+
+#ifdef FREEBSD
+ cpumon = new CpuMonitor(clopt_nice);
+#endif
+
+#ifdef LINUX
+ cpumon = new CpuMonitor(clopt_cpu, clopt_nice);
+#endif
+
+#ifdef NETBSD
+ cpumon = new CpuMonitor(clopt_nice);
+#endif
+
+#ifdef OPENBSD
+ cpumon = new CpuMonitor();
+#endif
+
+#ifdef SOLARIS
+ cpumon = new CpuMonitor(clopt_cpu);
+#endif
+
+ }
+ catch (exception &e)
+ {
+ cout << e.what() << endl;
+ return -1;
+ }
+
+ cpumon->setRange(99); // Only two digits fits in text area
+
+ /**************************************************
+
+ Scan wmc-directory and load (initial) object
+
+ **************************************************/
+ try
+ {
+ if (clopt_object == 0)
+ {
+ scanWmcDirectory(DEFAULT_WMC_PATH);
+ wmc = (objects.size() > 0) ? new WmcObject(nextObject()) : new WmcObject();
+ }
+ else
+ {
+ scanWmcDirectory(clopt_object);
+ wmc = (objects.size() > 0) ? new WmcObject(nextObject()) : new WmcObject(clopt_object);
+ }
+ }
+ catch (exception &e)
+ {
+ cout << e.what() << endl;
+ return -1;
+ }
+
+ wmc->setColorShading(clopt_fgcolor, clopt_shade);
+ wmc->setMode(clopt_mode);
+
+ printf("Objects in %s: %d\n", DEFAULT_WMC_PATH, objects.size());
+
+ /***********************************************************************
+
+ Set up the new style window
+
+ ***********************************************************************/
+
+ WMWindow nw;
+ WMFrame nmain, bottom, botleft, botright;
+ WMCanvasCallback ncanvas;
+ WMTextBar cpu("00", 0);
+ WMMeterBar meter(0, 100);
+
+ nw.setpadding(1);
+ nw.addchild(nmain);
+ nw.addchild(bottom);
+ nw.setorientation(Orientation::Vertical);
+ nw.setaspectratios(80, 21);
+ nw.add_timed_function(clopt_update, gatherStatistics, 0);
+ nw.add_timed_function(clopt_update, displayCpuText, &cpu, 0);
+ nw.add_timed_function(clopt_update, displayCpuMeter, &meter, 0);
+ nw.add_timed_function(WMC_REDRAW, displayWmcObject, &ncanvas, wmc);
+
+ ncanvas.addcallback(canvasClicked, &ncanvas, 0);
+
+ ncanvas.setbuffered(true);
+ meter.setstyle(WMMeterBar::Blue);
+
+ //bottom.setpadding(2);
+ //bottom.setborder(0);
+ nmain.addchild(ncanvas);
+ bottom.addchild(botleft);
+ bottom.addchild(botright);
+ bottom.setorientation(Orientation::Horizontal);
+ bottom.setaspectratios(4, 11);
+
+ meter.setorientation(Orientation::Horizontal);
+
+ botleft.addchild(cpu);
+ botright.setorientation(Orientation::Vertical);
+ botright.setpadding(2);
+ botright.addchild(meter);
+
+ /***********************************************************************
+
+ Set up the classic style window
+
+ ***********************************************************************/
+
+ WMWindow cw;
+ WMCanvasCallback ccanvas;
+
+ cw.setpadding(1);
+ cw.addchild(ccanvas);
+ cw.setaspectratios(1, 1);
+ cw.add_timed_function(clopt_update, gatherStatistics, 0);
+ cw.add_timed_function(WMC_REDRAW, displayWmcObject, &ccanvas, wmc);
+
+ ccanvas.addcallback(canvasClicked, &ccanvas, 0);
+ ccanvas.setbuffered(true);
+
+ /***********************************************************************
+
+ Ok we're more or less set to go..
+
+ ***********************************************************************/
+
+ wmcube.addwindow(nw);
+ wmcube.addwindow(cw);
+
+ // If the user selected to start in classic mode...
+ if (clopt_window == WINDOW_CLASSIC)
+ {
+ // .. we need to tell switchWindow that we currently are in new mode.
+ clopt_window = WINDOW_NEW;
+ switchWindow(wmc);
+ wmcube.run(cw);
+ }
+ else
+ wmcube.run(nw);
+
+ delete cpumon;
+ delete wmc;
+
+ return 0;
+}
+
+/********************************************************************************
+
+ void switchWindow(WmcObject *currentwmc)
+
+ Switch between new/classic mode.
+
+********************************************************************************/
+void switchWindow(WmcObject *currentwmc)
+{
+ //printf("switching windows\n"); fflush(stdout);
+
+ if (clopt_window == WINDOW_CLASSIC)
+ {
+ clopt_window = WINDOW_NEW;
+ xoff = XOFF_NEW;
+ yoff = YOFF_NEW;
+ zoff = ZOFF_NEW;
+ }
+ else
+ {
+ clopt_window = WINDOW_CLASSIC;
+ xoff = XOFF_CLASSIC;
+ yoff = YOFF_CLASSIC;
+ zoff = ZOFF_CLASSIC;
+ }
+
+ wmcube.switch_to(clopt_window);
+
+ // Zoom/translate object to fit current canvas size
+ currentwmc->modifyZOffset(zoff);
+ currentwmc->setYOffset(yoff);
+}
+
+/********************************************************************************
+
+ void canvasClicked(const WMApp *a, WMWidget *w, void *)
+
+ Event callback for everything that has to do with the canvas that the object(s)
+ are being drawn in.
+
+********************************************************************************/
+#define ZOOM_STEP 100
+#define LSOURCE_Z_OFF 10
+
+void canvasClicked(const WMApp *a, WMWidget *w, void *)
+{
+ WMCanvas *c = dynamic_cast<WMCanvas *>(w);
+ WmcObject *current;
+
+ if (!c) return;
+
+ current = switching ? wmcnew : wmc;
+
+ /*
+ Mouse-wheel zoom in and out (unless clopt_wheel == true).
+ */
+ if (((a->mouseclick().button == Button4) && (!clopt_wheel)) ||
+ checkMouseRegion(c, Button1, 47, 12, 65, 48))
+ {
+ current->modifyZOffset(-ZOOM_STEP);
+ return;
+ }
+ if (((a->mouseclick().button == Button5) && (!clopt_wheel)) ||
+ checkMouseRegion(c, Button1, 0, 12, 16, 48))
+ {
+ current->modifyZOffset( ZOOM_STEP);
+ return;
+ }
+
+ /*
+ Switch window mode
+ */
+ if (checkMouseRegion(c, Button1, 0, 0, 13, 13))
+ {
+ switchWindow(current);
+ return;
+ }
+
+ /*
+ Switch 3d mode
+ */
+ if ((a->mouseclick().button == Button2) || checkMouseRegion(c, Button1, 15, yoff-10, 48, yoff+10))
+ {
+ current->setMode(++clopt_mode % NUM_MODES);
+ return;
+ }
+
+ /*
+ Change lightsource position with right mouse button
+ */
+ if (a->mouseclick().button == Button3)
+ {
+ current->setLightSource(xoff - a->mouseclick().relative_to(c).x,
+ yoff - a->mouseclick().relative_to(c).y,
+ LSOURCE_Z_OFF);
+ return;
+ }
+
+ /*
+ Switch objects (if not already doing so)
+ */
+ if ((switching == 0) && (objects.size() > 0))
+ {
+ // Store a pointer to the old object so we can delete it later
+ wmcold = wmc;
+
+ // Switch object with mousewheel instead of zooming
+ if ((a->mouseclick().button == Button4) && clopt_wheel)
+ {
+ // Scrolling object up with mousewheel
+ switching = 1;
+ wmcnew = new WmcObject(nextObject());
+ }
+ else if ((a->mouseclick().button == Button5) && clopt_wheel)
+ {
+ // Scrolling object down with mousewheel
+ switching = -1;
+ wmcnew = new WmcObject(prevObject());
+ }
+ // Switch objects by clicking
+ else if (checkMouseRegion(c, Button1, 12, 0, 60, yoff - 5))
+ {
+ // Scrolling object up by clicking top of canvas
+ switching = 1;
+ wmcnew = new WmcObject(nextObject());
+ }
+ else if (checkMouseRegion(c, Button1, 12, yoff + 5, 60, 60))
+ {
+ // Scrolling object down by clicking bottom of canvas
+ switching = -1;
+ wmcnew = new WmcObject(prevObject());
+ }
+
+ if (clopt_window == WINDOW_CLASSIC) wmcnew->modifyZOffset(ZOFF_CLASSIC);
+ wmcnew->setColorShading(clopt_fgcolor, clopt_shade);
+ wmcnew->setMode(clopt_mode % NUM_MODES);
+
+ return;
+ }
+}
+
+/********************************************************************************
+
+ bool checkMouseRegion(const WMCanvas *c, int button, int ulx, int uly, int lrx, int lry)
+
+ ulx = upper left x, go figure on the rest..
+
+********************************************************************************/
+
+bool checkMouseRegion(const WMCanvas *c, int button, int ulx, int uly, int lrx, int lry)
+{
+ if ((c->app())->mouseclick().button != button) return false;
+ if (((c->app())->mouseclick().relative_to(c).y > lry) ||
+ ((c->app())->mouseclick().relative_to(c).y < uly)) return false;
+ if (((c->app())->mouseclick().relative_to(c).x < ulx) ||
+ ((c->app())->mouseclick().relative_to(c).x > lrx)) return false;
+
+ return true;
+}
+
+/********************************************************************************
+
+ void displayWmcObject(const WMApp *a, WMWidget *w, void *)
+
+ Timer-callback for drawing the object(s) in the canvas that is passed in w.
+
+ Defines are for the scroll-in/out-speed of the objects (SCROLL_SPEED) as well
+ as the initial displacement from the center for the new object (INITIAL_DISP).
+
+ Variable 'switching' take on values -1 (scrolling down), 0 (not switching)
+ and 1 (scrolling up).
+
+********************************************************************************/
+#define SCROLL_SPEED 2.0
+#define INITIAL_DISP switching * 2 * yoff
+
+void displayWmcObject(const WMApp *a, WMWidget *w, void *)
+{
+ static float yd = 0.0;
+ int local_yoff;
+ static float mlight = 0.0;
+ WMCanvas *c = dynamic_cast<WMCanvas *>(w);
+
+ if (!c) return;
+
+ clearCanvas(c);
+
+ if (switching != 0)
+ {
+ /*
+ We're currently switching objects - do alot of magic.
+ Basically we're scrolling 'wmcnew' in from top/bottom
+ while simultanously scrolling 'wmc' out.
+ */
+ yd += SCROLL_SPEED;
+ local_yoff = yoff - switching * (int)yd;
+
+ wmc->rotate(ROT_SPEED_X, ROT_SPEED_Y, ROT_SPEED_Z);
+ wmc->setYOffset(local_yoff);
+ wmc->draw(c);
+
+ wmcnew->setYOffset(yoff + INITIAL_DISP - switching * (int)yd);
+ wmcnew->rotate(ROT_SPEED_X, ROT_SPEED_Y, ROT_SPEED_Z);
+ wmcnew->draw(c);
+
+ if (yd >= switching * INITIAL_DISP)
+ {
+ // Finished switching, delete the old object
+ switching = 0;
+ yd = 0.0;
+ mlight = 0.0;
+ wmc = wmcnew;
+ delete wmcold;
+ }
+ }
+ else
+ {
+ wmc->rotate(ROT_SPEED_X, ROT_SPEED_Y, ROT_SPEED_Z);
+
+ if (clopt_lsource)
+ {
+ wmc->setLightSource(55.0 * cos(mlight*0.002), 50.0 * sin(mlight*0.040), LSOURCE_Z_OFF);
+ mlight += 1.0;
+ }
+
+ wmc->draw(c);
+ }
+
+ a->repaint();
+}
+
+/********************************************************************************
+
+ void gatherStatistics(const WMApp *a, void *)
+
+ Store the polled cpu-load in variable 'cpu_load'
+
+********************************************************************************/
+void gatherStatistics(const WMApp *a, void *)
+{
+ cpu_load = (int)cpumon->getLoad();
+}
+
+/********************************************************************************
+
+ void displayCpuText(const WMApp *a, WMWidget *w, void *)'
+
+ Display the cpu-load in the textbar passed in w.
+
+********************************************************************************/
+void displayCpuText(const WMApp *a, WMWidget *w, void *)
+{
+ char tmp[6];
+ WMTextBar *b = dynamic_cast<WMTextBar*>(w);
+
+ if (!b) return;
+
+ sprintf(tmp, "%2d", cpu_load);
+ b->settext(tmp);
+ a->repaint();
+}
+
+/********************************************************************************
+
+ void displayCpuMeter(const WMApp *a, WMWidget *w, void *)
+
+ Display the cpu-load in the meterbar passed in w.
+
+********************************************************************************/
+void displayCpuMeter(const WMApp *a, WMWidget *w, void *)
+{
+ WMMeterBar *m = dynamic_cast<WMMeterBar *>(w);
+
+ if (!m) return;
+
+ m->setvalue(cpu_load, true);
+ a->repaint();
+}
+
+/********************************************************************************
+
+ char *nextObject()
+
+ Returns the next objects' filename
+
+********************************************************************************/
+char *nextObject()
+{
+ if (obj_iterator == objects.end() - 1)
+ obj_iterator = objects.begin();
+ else
+ obj_iterator++;
+
+ //printf("returning next Object = %s\n", *obj_iterator); fflush(stdout);
+
+ return *obj_iterator;
+}
+
+/********************************************************************************
+
+ char *prevObject()
+
+ Returns the previous objects' filename
+
+********************************************************************************/
+char *prevObject()
+{
+ if (obj_iterator == objects.begin())
+ obj_iterator = objects.end() - 1;
+ else
+ obj_iterator--;
+
+ //printf("returning previous Object = %s\n", *obj_iterator); fflush(stdout);
+
+ return *obj_iterator;
+}
+
+/********************************************************************************
+
+ int scanWmcDirectory(const char *dirname)
+
+ Scans the directory 'dirname' and stores the full pathname of all found
+ wmc-files in the global vector 'objects'. This code should be POSIX compliant
+ which the old code was not (didnt work on Solaris for example). Objects are
+ listed in some seemingly random order (creation time?).
+
+********************************************************************************/
+void scanWmcDirectory(const char *dirname)
+{
+ DIR *dir_stream = opendir(dirname);
+ struct dirent *dirp;
+ char *strp;
+
+ if (dir_stream == NULL)
+ return; //throw runtime_error("scanWmcDirectory: Could not open directory.");
+
+ for (dirp = readdir(dir_stream); dirp != NULL; dirp = readdir(dir_stream))
+ {
+ if (strstr(dirp->d_name, ".wmc"))
+ {
+ // Make sure there's space for the dirname, a slash, filename and terminating zero
+ strp = new char[strlen(dirname) + strlen(dirp->d_name) + 2];
+ strcpy(strp, dirname);
+ strcat(strp, "/");
+ strcat(strp, dirp->d_name);
+ objects.push_back(strp);
+ //printf("%s\n", objects[objects.size() - 1]);
+ }
+ }
+
+ obj_iterator = objects.begin();
+ closedir(dir_stream);
+}
+
+void clearCanvas(WMCanvas *canvas)
+{
+ canvas->setcolor((WMColor::WMColor)clopt_bgcolor);
+ canvas->fill_rectangle(0, 0, 54, 54);
+ //canvas->draw_vertical_gradient(0,0,53,40, 0x000000, 0x555555);
+}
diff --git a/wmcube/wmcube.h b/wmcube/wmcube.h
new file mode 100644
index 000000000000..d9052b535524
--- /dev/null
+++ b/wmcube/wmcube.h
@@ -0,0 +1,118 @@
+#ifndef _WMCUBE_HPP_
+#define _WMCUBE_HPP_
+
+#include "wmapp/wmwidget.h"
+#include "wmapp/wmapp.h"
+#include "wmapp/wmwindow.h"
+#include "wmapp/wmframe.h"
+#include "wmapp/wmcanvas.h"
+#include "wmapp/wmmeterbar.h"
+#include "wmapp/wmtextbar.h"
+#include "wmapp/wmcallback.h"
+
+#ifdef DARWIN
+#include "cpumoncc/darwin/CpuMonitor.h"
+#endif
+#ifdef FREEBSD
+#include "cpumoncc/freebsd/CpuMonitor.h"
+#endif
+#ifdef LINUX
+#include "cpumoncc/linux/CpuMonitor.h"
+#endif
+#ifdef NETBSD
+#include "cpumoncc/netbsd/CpuMonitor.h"
+#endif
+#ifdef OPENBSD
+#include "cpumoncc/openbsd/CpuMonitor.h"
+#endif
+#ifdef SOLARIS
+#include "cpumoncc/solaris/CpuMonitor.h"
+#endif
+
+#define WMCUBE_VERSION "0.99-pre1"
+#define WMCUBE_RELDATE "2003-02-28"
+
+typedef struct
+{
+ const int c;
+ const char *parms;
+ const char *desc;
+}
+cl_opt;
+
+#define CL_OPT_OBJECT_INT (int)'o'
+#define CL_OPT_CPU_INT (int)'c'
+#define CL_OPT_UPDATE_INT (int)'u'
+#define CL_OPT_WINDOW_INT (int)'k'
+#define CL_OPT_RSPEED_INT (int)'r'
+#define CL_OPT_NICE_INT (int)'n'
+#define CL_OPT_FGCOLOR_INT (int)'f'
+#define CL_OPT_SHADE_INT (int)'s'
+#define CL_OPT_BGCOLOR_INT (int)'b'
+#define CL_OPT_INVERT_INT (int)'i'
+#define CL_OPT_MODE_INT (int)'m'
+#define CL_OPT_LSOURCE_INT (int)'l'
+#define CL_OPT_WHEEL_INT (int)'w'
+#define CL_OPT_HELP_INT (int)'h'
+
+const cl_opt CL_OPT_OBJECT = { CL_OPT_OBJECT_INT,"filename/directory","load wmc-object or scan a directory for objects"};
+const cl_opt CL_OPT_CPU = { CL_OPT_CPU_INT ,"X","monitor cpu X (starts with 0, default average over all)" };
+const cl_opt CL_OPT_UPDATE = { CL_OPT_UPDATE_INT ,"X","read cpu load every X centiseconds (default 50)" };
+const cl_opt CL_OPT_WINDOW = { CL_OPT_WINDOW_INT,"","start in classic mode" };
+const cl_opt CL_OPT_RSPEED = { CL_OPT_RSPEED_INT ,"X","rotating speed 0-9 (default 3)" };
+const cl_opt CL_OPT_NICE = { CL_OPT_NICE_INT, "","exclude nice processes" };
+const cl_opt CL_OPT_FGCOLOR = { CL_OPT_FGCOLOR_INT,"0xXXXXXX","solid/wireframe color (default CYANish color)" };
+const cl_opt CL_OPT_SHADE = { CL_OPT_SHADE_INT,"X","amount of shading on solid objects 0-100 (default 80)" };
+const cl_opt CL_OPT_BGCOLOR = { CL_OPT_BGCOLOR_INT,"0xXXXXXX","background color (default 0x202020)" };
+const cl_opt CL_OPT_INVERT = { CL_OPT_INVERT_INT, "","invert rotating speed/cpu load relationship" };
+const cl_opt CL_OPT_MODE = { CL_OPT_MODE_INT,"wire/solid/solidwire","default mode for objects with multiple modes" };
+const cl_opt CL_OPT_LSOURCE = { CL_OPT_LSOURCE_INT,"","moving light source (default clickable light source)" };
+const cl_opt CL_OPT_WHEEL = { CL_OPT_WHEEL_INT,"","switch object with mouse wheel (default zoom)" };
+const cl_opt CL_OPT_HELP = { CL_OPT_HELP_INT,"","print help" };
+
+#define NUM_CL_OPT 11
+
+const cl_opt CL_OPT[NUM_CL_OPT] =
+{
+ CL_OPT_OBJECT,
+ CL_OPT_CPU,
+ CL_OPT_UPDATE,
+ CL_OPT_WINDOW,
+ CL_OPT_RSPEED,
+ CL_OPT_NICE,
+ CL_OPT_FGCOLOR,
+ CL_OPT_SHADE,
+ CL_OPT_BGCOLOR,
+ //CL_OPT_INVERT,
+ //CL_OPT_MODE,
+ CL_OPT_LSOURCE,
+ //CL_OPT_WHEEL,
+ CL_OPT_HELP
+};
+
+void printUsage()
+{
+ printf("wmCube %s (%s) (C) Robert Kling 2003\n\n", WMCUBE_VERSION, WMCUBE_RELDATE);
+ printf("Usage: wmcube [options]\n\n");
+
+ for (int i = 0; i < NUM_CL_OPT; i++)
+ {
+
+ printf(" -%c %s", CL_OPT[i].c, CL_OPT[i].parms);
+ for (int j = 0; j < 22 - strlen(CL_OPT[i].parms); j++) printf(" ");
+ printf("%s\n", CL_OPT[i].desc);
+ }
+
+// printf("\nThe -c option is only availible on Linux and Solaris.");
+// printf("\nThe -n option is only availible on FreeBSD, Linux and NetBSD.\n\n");
+ fflush(stdout);
+}
+
+class WMCanvasCallback : public WMCallback, public WMCanvas
+{
+public:
+ WMCanvasCallback() : WMCallback(), WMCanvas() { }
+};
+
+
+#endif
diff --git a/wmcube/wmcube/Makefile b/wmcube/wmcube/Makefile
deleted file mode 100644
index 1410b29139bb..000000000000
--- a/wmcube/wmcube/Makefile
+++ /dev/null
@@ -1,39 +0,0 @@
-CC = gcc
-OS = -DLINUX
-
-LIBDIR = -L/usr/X11R6/lib
-LIBDIR = -L/usr/X11R6/lib
-INCDIR = -I/usr/X11R6/share/include
-
-# Edit OSLIBS as appropriate to include OS specific libraries.
-
-OSLIBS =
-LIBS = -lXpm -lXext -lX11 -lm $(OSLIBS)
-CFLAGS = -Wall -O2 $(OS)
-
-OBJS = wmcube.o \
- ../wmgeneral/wmgeneral.o \
- ../wmgeneral/misc.o \
- ../wmgeneral/list.o
-
-.c.o:
- $(CC) $(CFLAGS) $(INCDIR) -c $< -o $*.o
-
-wmcube: $(OBJS)
- $(CC) -o wmcube $^ -lXext $(LIBDIR) $(LIBS)
-
-
-all:: wmcube
-
-clean::
- for i in $(OBJS) ; do \
- rm -f $$i ; \
- done
- rm -f wmcube
- rm -f *~
-
-install:: wmcube
- cp -f wmcube /usr/local/bin/
- chmod 755 /usr/local/bin/wmcube
- chown root:root /usr/local/bin/wmcube
- @echo "wmCube installation finished..."
diff --git a/wmcube/wmcube/Makefile.FREEBSD b/wmcube/wmcube/Makefile.FREEBSD
deleted file mode 100644
index 815e32dbc96a..000000000000
--- a/wmcube/wmcube/Makefile.FREEBSD
+++ /dev/null
@@ -1,38 +0,0 @@
-CC = gcc
-OS = -DFREEBSD
-
-LIBDIR = -L/usr/X11R6/lib
-LIBDIR = -L/usr/X11R6/lib
-INCDIR = -I/usr/X11R6/include
-
-# Edit OSLIBS as appropriate to include OS specific libraries.
-
-OSLIBS = -lkvm
-LIBS = -lXpm -lXext -lX11 -lm $(OSLIBS)
-CFLAGS = -Wall -O2 $(OS)
-
-OBJS = wmcube.o \
- ../wmgeneral/wmgeneral.o \
- ../wmgeneral/misc.o \
- ../wmgeneral/list.o
-
-.c.o:
- $(CC) $(CFLAGS) $(INCDIR) -c $< -o $*.o
-
-wmcube: $(OBJS)
- $(CC) -o wmcube $(OBJS) -lXext $(LIBDIR) $(LIBS)
-
-all:: wmcube
-
-clean::
- for i in $(OBJS) ; do \
- rm -f $$i ; \
- done
- rm -f wmcube
- rm -f *~
-
-install:: wmcube
- cp -f wmcube /usr/local/bin/
- chmod g+s /usr/local/bin/wmcube
- chown root.kmem /usr/local/bin/wmcube
- @echo "wmCube installation finished..."
diff --git a/wmcube/wmcube/Makefile.LINUX b/wmcube/wmcube/Makefile.LINUX
deleted file mode 100644
index 1410b29139bb..000000000000
--- a/wmcube/wmcube/Makefile.LINUX
+++ /dev/null
@@ -1,39 +0,0 @@
-CC = gcc
-OS = -DLINUX
-
-LIBDIR = -L/usr/X11R6/lib
-LIBDIR = -L/usr/X11R6/lib
-INCDIR = -I/usr/X11R6/share/include
-
-# Edit OSLIBS as appropriate to include OS specific libraries.
-
-OSLIBS =
-LIBS = -lXpm -lXext -lX11 -lm $(OSLIBS)
-CFLAGS = -Wall -O2 $(OS)
-
-OBJS = wmcube.o \
- ../wmgeneral/wmgeneral.o \
- ../wmgeneral/misc.o \
- ../wmgeneral/list.o
-
-.c.o:
- $(CC) $(CFLAGS) $(INCDIR) -c $< -o $*.o
-
-wmcube: $(OBJS)
- $(CC) -o wmcube $^ -lXext $(LIBDIR) $(LIBS)
-
-
-all:: wmcube
-
-clean::
- for i in $(OBJS) ; do \
- rm -f $$i ; \
- done
- rm -f wmcube
- rm -f *~
-
-install:: wmcube
- cp -f wmcube /usr/local/bin/
- chmod 755 /usr/local/bin/wmcube
- chown root:root /usr/local/bin/wmcube
- @echo "wmCube installation finished..."
diff --git a/wmcube/wmcube/Makefile.NETBSD b/wmcube/wmcube/Makefile.NETBSD
deleted file mode 100644
index 26fe59920933..000000000000
--- a/wmcube/wmcube/Makefile.NETBSD
+++ /dev/null
@@ -1,36 +0,0 @@
-CC = gcc
-OS = -DNETBSD
-
-LIBDIR = -L/usr/X11R6/lib -L./libdocapp/
-
-# Edit OSLIBS as appropriate to include OS specific libraries.
-
-OSLIBS =
-LIBS = -lXpm -lXext -lX11 -lm $(OSLIBS)
-CFLAGS = -Wall -I/usr/X11R6/include -O2 $(OS)
-
-OBJS = wmcube.o \
- ../wmgeneral/wmgeneral.o \
- ../wmgeneral/misc.o \
- ../wmgeneral/list.o
-
-.c.o:
- $(CC) $(CFLAGS) $(INCDIR) -c $< -o $*.o
-
-wmcube: $(OBJS)
- $(CC) -o wmcube -lXext $(LIBDIR) $(LIBS) $(OBJS)
-
-all:: wmcube
-
-clean::
- for i in $(OBJS) ; do \
- rm -f $$i ; \
- done
- rm -f wmcube
- rm -f *~
-
-install:: wmcube
- cp -f wmcube /usr/local/bin/
- chmod 755 /usr/local/bin/wmcube
- chown root:root /usr/local/bin/wmcube
- @echo "wmCube installation finished..."
diff --git a/wmcube/wmcube/Makefile.OPENBSD b/wmcube/wmcube/Makefile.OPENBSD
deleted file mode 100644
index abe1d13dffc7..000000000000
--- a/wmcube/wmcube/Makefile.OPENBSD
+++ /dev/null
@@ -1,37 +0,0 @@
-CC = gcc
-OS = -DOPENBSD
-
-LIBDIR = -L/usr/X11R6/lib -L./libdocapp/
-
-# Edit OSLIBS as appropriate to include OS specific libraries.
-
-OSLIBS =
-LIBS = -lXpm -lXext -lX11 -lm $(OSLIBS)
-INCLUDES = -I/usr/X11R6/include
-CFLAGS = -Wall -O2 $(OS) $(INCLUDES)
-
-OBJS = wmcube.o \
- ../wmgeneral/wmgeneral.o \
- ../wmgeneral/misc.o \
- ../wmgeneral/list.o
-
-.c.o:
- $(CC) $(CFLAGS) $(INCDIR) -c $< -o $*.o
-
-wmcube: $(OBJS)
- $(CC) -o wmcube $^ -lXext $(LIBDIR) $(LIBS) $>
-
-all:: wmcube
-
-clean::
- for i in $(OBJS) ; do \
- rm -f $$i ; \
- done
- rm -f wmcube
- rm -f *~
-
-install:: wmcube
- cp -f wmcube /usr/local/bin/
- chmod 755 /usr/local/bin/wmcube
- chown root:root /usr/local/bin/wmcube
- @echo "wmCube installation finished..."
diff --git a/wmcube/wmcube/Makefile.SOLARIS b/wmcube/wmcube/Makefile.SOLARIS
deleted file mode 100644
index 5ebc89366664..000000000000
--- a/wmcube/wmcube/Makefile.SOLARIS
+++ /dev/null
@@ -1,38 +0,0 @@
-CC = gcc
-OS = -DSOLARIS
-
-LIBDIR = -L/usr/X11R6/lib
-LIBDIR = -L/usr/openwin/lib -L/opt/sfw/lib -L/usr/local/lib -R/usr/openwin/lib -R/opt/sfw/lib -R/usr/local/lib
-INCDIR = -I/usr/openwin/include -I/opt/sfw/include -I/usr/local/include
-
-# Edit OSLIBS as appropriate to include OS specific libraries.
-
-OSLIBS = -lkstat
-LIBS = -lXpm -lXext -lX11 -lm $(OSLIBS)
-CFLAGS = -Wall -O2 $(OS)
-
-OBJS = wmcube.o \
- ../wmgeneral/wmgeneral.o \
- ../wmgeneral/misc.o \
- ../wmgeneral/list.o
-
-.c.o:
- $(CC) $(CFLAGS) $(INCDIR) -c $< -o $*.o
-
-wmcube: $(OBJS)
- $(CC) -o wmcube $^ -lXext $(LIBDIR) $(LIBS)
-
-all:: wmcube
-
-clean::
- for i in $(OBJS) ; do \
- rm -f $$i ; \
- done
- rm -f wmcube
- rm -f *~
-
-install:: wmcube
- cp -f wmcube /usr/local/bin/
- chmod 755 /usr/local/bin/wmcube
- chown root:root /usr/local/bin/wmcube
- @echo "wmCube installation finished..."
diff --git a/wmcube/wmcube/wmcube.c b/wmcube/wmcube/wmcube.c
deleted file mode 100644
index a586b55387a0..000000000000
--- a/wmcube/wmcube/wmcube.c
+++ /dev/null
@@ -1,1351 +0,0 @@
-/*
-
- wmcube.c
- Version 0.98 (2000-10-20)
-
- Robert Kling (robk...@student.luth.se)
- http://boombox.campus.luth.se/projects.php
-
- Contributions:
- -n option patch by Thorsten Jens (th...@et-inf.fho-emden.de) (2000-05-12)
- Various bugfixes and optimizations by Jakob Borg (2000-05-13)
- Solaris Port by Dan Price (d...@rampant.org) (2000-07-16)
- OpenBSD Port by Brian Joseph Czapiga (r...@godsey.net) (2000-07-19)
- FreeBSD Port by Tai-hwa Liang (ava...@mmlab.cse.yzu.edu.tw) (2000-07-20)
- NetBSD Port by Jared Smolens <jsmo...@andrew.cmu.edu> (2000-09-23)
-
- This software is licensed through the GNU General Public Licence.
-
- See http://www.BenSinclair.com/dockapp/ for more wm dock apps.
-
- If you want to port wmcube to another OS the system specific code is
- sectioned the bottom of this file. See instructions there.
-
-*/
-
-#define WMCUBE_VERSION "0.98"
-#define REV_DATE "2000-10-23"
-
-#include <stdlib.h>
-#include <stdio.h>
-#include <time.h>
-#include <string.h>
-#include <fcntl.h>
-#include <unistd.h>
-#include <ctype.h>
-#include <math.h>
-
-#include <sys/wait.h>
-#include <sys/stat.h>
-#include <sys/param.h>
-#include <sys/types.h>
-#include <sys/ioctl.h>
-#include <sys/socket.h>
-
-#include <utmp.h>
-#include <dirent.h>
-
-#include <X11/Xlib.h>
-#include <X11/xpm.h>
-#include <X11/extensions/shape.h>
-
-#ifdef FREEBSD
-#include <kvm.h>
-#endif
-
-#include "../wmgeneral/wmgeneral.h"
-#include "../wmgeneral/misc.h"
-
-#include "wmcube.xpm"
-char wmcube_mask_bits[64*64];
-int wmcube_mask_width = 64;
-int wmcube_mask_height = 64;
-
-#define CHAR_WIDTH 5
-#define CHAR_HEIGHT 7
-#define PI 3.1415926535
-
-//**** Graphics ***********************************
-
-void putpixel(int x, int y, int c);
-void line(int x1, int y1, int x2, int y2, int c);
-void hline(int x1, int x2, int y, int c);
-void triangle(int x1, int y1, int x2, int y2, int x3, int y3, int c);
-void BlitString(char *name, int x, int y);
-void BlitNum(int num, int x, int y);
-void clearscr();
-void draw();
-void startup_seq();
-
-//**** 3d specific ********************************
-
-void setupobj(char *filename) ;
-void setUpAngles();
-void rotate(int xang, int yang, int zang);
-int normal(float p1[], float p2[], float p3[]);
-int luminate(float p1[], float p2[], float p3[]);
-void sortz(int nofelements);
-
-//**** Application Management, I/O etc. ***********
-
-void print_help();
-int loadobj(char *filename);
-void mem_alloc_error(void *block);
-int scan4objects(char *dir);
-int next_object();
-void die();
-
-//**** System specific functions ******************
-
-int init_calc_cpu();
-int calc_cpu_total();
-
-//**** Global variables ***************************
-
-int xcenter, ycenter, zoff;
-double cost[361], sint[361];
-double acost[100];
-float **matrix;
-float **rmatrix;
-int **planes;
-int *plane_color;
-int *zorder;
-int *cline;
-int nofcoords, noflines, nofplanes;
-char *objects[1000];
-int nof_objects = 0;
-int show_load = 1;
-int use_nice = 1;
-int which_cpu = -1;
-int planesORlines = 1;
-char *pname;
-
-float lum_vector[3] = { 0, 0, 100 }; // Lightsource vector
-
-#ifdef FREEBSD
-static kvm_t *kd;
-static struct nlist nlst[] = { {"_cp_time"}, {0} };
-#endif
-
-int main(int argc, char **argv)
-{
- int j, i = 0, rot_speed = 0, cpu_usage = 0, rot_step = 1;
- long screen_speed = 10000; // microseconds between screen updates (approx.)
- long cpu_update = 490000; // microseconds between cpu update (approx.)
- int but_stat = -1;
- int loop = 0;
- XEvent Event;
-
- char *rotdiv = {"25"};
- char *rotstep = {"1"};
- char *obj_filename = {""};
- int rot;
- int cube_color = 1;
- int c = 0;
- int invert_speed = 0;
-
- pname = strrchr(argv[0], '/');
- if (pname == NULL) pname = argv[0];
-
- srand((unsigned)time(NULL));
- opterr = 0;
-
- while ((c = getopt (argc, argv, "d:nhpbir:o:c:")) != -1) {
- switch (c)
- {
- case 'c':
- which_cpu = atoi(optarg);
- break;
- case 'd':
- rotstep = optarg;
- break;
- case 'h':
- print_help();
- return 1;
- case 'i':
- invert_speed = 1;
- break;
- case 'p':
- show_load = 0;
- break;
- case 'b':
- cube_color = 2;
- break;
- case 'r':
- rotdiv = optarg;
- break;
- case 'o':
- obj_filename = optarg;
- break;
- case 'n':
- use_nice = 0;
- break;
- case '?':
- print_help();
- return 1;
- default:
- abort();
- }
- }
-
- /*
- * Validate that wmcube can run on this system given the parameters,
- * then setup the statistics gathering subsystem.
- */
-
- if (init_calc_cpu() != 0) die();
-
- /*
- * Scan directory for .wmc files and choose one randomly. If the user
- * specified a particular file, load that one.
- */
-
-#ifndef SOLARIS // scan4objects doesnt work on Solaris, load object immediatly
- scan4objects(obj_filename);
-
- if (nof_objects != 0)
- next_object();
- else
-#endif
- setupobj(obj_filename);
-
- /*
- * Various initializion stuff for the 3d-engine etc.
- */
-
- setUpAngles();
-
- rot = atoi(rotdiv);
- if ((rot >= 1) && (rot <=100)) ; else rot = 25;
-
- rot_step = atoi(rotstep);
- if (rot_step < 0) rot_step = -rot_step;
-
- if (calc_cpu_total() == -1) die();
-
- cpu_update /= screen_speed;
-
- createXBMfromXPM(wmcube_mask_bits, wmcube_xpm, wmcube_mask_width, wmcube_mask_height);
- openXwindow(argc, argv, wmcube_xpm, wmcube_mask_bits, wmcube_mask_width, wmcube_mask_height);
-
- startup_seq();
-
- if (calc_cpu_total() == -1) die();
-
- // index, left, top, right, bottom
- AddMouseRegion(1, 45, 45, 58, 58); // + Zoom In
- AddMouseRegion(5, 5, 45, 20, 58); // - Zoom Out
- AddMouseRegion(3, 21, 45, 45, 58); // Show cpu-load
- AddMouseRegion(2, 5, 5, 55, 45); // Everywhere else (almost) to change object
-
- /*
- * Main loop begins here
- */
-
- while (1)
- {
- i = (i+rot_speed+rot_step) % 360;
-
- clearscr();
- rotate(i,i,i);
-
- draw(cube_color);
-
- if (show_load) {
- BlitNum(cpu_usage,24,49);
- BlitString("Z",38,49);
- }
-
- RedrawWindow();
-
- if (loop++ == cpu_update) {
- loop = 0;
-
- /*
- * call calc_cpu_total to update statistics. If some
- * sort of bad event occurs, calc_cpu_total will return
- * -1, and we exit.
- */
-
- if ((cpu_usage = calc_cpu_total()) == -1) {
- die();
- }
- rot_speed = abs( invert_speed*(100 / rot) - cpu_usage / rot);
- }
-
- // X Events
-
- while (XPending(display))
- {
- XNextEvent(display, &Event);
- switch (Event.type)
- {
- case Expose:
- RedrawWindow();
- break;
- case DestroyNotify:
- XCloseDisplay(display);
- exit(0);
- break;
- case ButtonPress:
- j = CheckMouseRegion(Event.xbutton.x, Event.xbutton.y);
- but_stat = j;
-
- break;
- case ButtonRelease:
- j = CheckMouseRegion(Event.xbutton.x, Event.xbutton.y);
-
- switch(j)
- {
- case 1:
- if (zoff > 750) {
- BlitString("ö",48,48);
- RedrawWindow();
- zoff -= 150;
- }
- break;
-
- case 2:
- next_object();
- break;
-
- case 3:
- if (show_load == 1) show_load = 0; else show_load = 1;
- ycenter = 15 - 2*show_load;
- break;
-
- case 5:
- BlitString("ä",11,49);
- RedrawWindow();
- zoff += 150;
- break;
- }
- }
- break;
- }
- usleep(screen_speed);
- }
-
- /*
- * Free up memory used by the object (dirty...)
- */
-
- free(matrix);
- free(rmatrix);
- free(cline);
-
- return 1;
-}
-
-
-//**** Graphics ***********************************
-//*************************************************
-
-void startup_seq()
-{
- char *tmp = malloc(32);
- int oldzoff = 3600;
-
- sprintf(tmp,"V%s",WMCUBE_VERSION);
-
- RedrawWindow();
- BlitString("WMCUBE",13,22);
- BlitString(tmp,15,31);
- RedrawWindow();
- RedrawWindow();
- usleep(3000000);
- RedrawWindow();
-
- zoff = 1200;
-
- for (;zoff < oldzoff; zoff += 35)
- {
- rotate((zoff-1200)/8,0,0);
- clearscr();
- BlitString("WMCUBE",13,22);
- BlitString(tmp,15,31);
- draw(1);
- RedrawWindow();
- usleep(9000);
- }
-
- zoff = 3600;
-}
-
-void draw(int color)
-{
- int i;
-
- if (planesORlines) {
-
- sortz(nofplanes);
- for (i = 0; i < nofplanes; i++) {
- if (normal(rmatrix[planes[zorder[i]][0]], rmatrix[planes[zorder[i]][1]], rmatrix[planes[zorder[i]][2]]) > 0) {
-
- triangle(xcenter+rmatrix[planes[zorder[i]][0]][0], ycenter+rmatrix[planes[zorder[i]][0]][1],
- xcenter+rmatrix[planes[zorder[i]][1]][0], ycenter+rmatrix[planes[zorder[i]][1]][1],
- xcenter+rmatrix[planes[zorder[i]][2]][0], ycenter+rmatrix[planes[zorder[i]][2]][1], plane_color[zorder[i]]);
- }
- }
-
- } else {
- for (i = 0; i < noflines; i += 2)
- line(xcenter+rmatrix[cline[i ]-1][0], ycenter+rmatrix[cline[i ]-1][1],
- xcenter+rmatrix[cline[i+1]-1][0], ycenter+rmatrix[cline[i+1]-1][1],color);
- }
-}
-
-void putpixel(int x, int y,int c)
-{
- if ((x > 4) && (x < 59) && (y > 4) && (y < 59))
- copyXPMArea(160-c,0,1,1,x,y);
-}
-
-void hline(int x1, int x2, int y, int c)
-{
- if ((y > 4) && (y < 59)) {
- if (x1 <= 4) x1 = 5; else if (x1 > 57) return;
- if (x2 > 57) x2 = 57; else if (x2 <= 4) return;
-
- copyXPMArea(105, 56+c + 9*(c/18), x2-x1, 1, x1, y);
- }
-}
-
-void triangle(int x1, int y1, int x2, int y2, int x3, int y3, int c) // Draws a filled triangle
-{
- int k,k2,x,x_2,i, tmp1;
-
- int x1t, x2t;
-
- if (y3<y2)
- {
- tmp1=y2;
- y2=y3;
- y3=tmp1;
- tmp1=x2;
- x2=x3;
- x3=tmp1;
- }
-
- if (y2<y1)
- {
- tmp1=y1;
- y1=y2;
- y2=tmp1;
- tmp1=x1;
- x1=x2;
- x2=tmp1;
- }
-
- if (y3<y2)
- {
- tmp1=y2;
- y2=y3;
- y3=tmp1;
- tmp1=x2;
- x2=x3;
- x3=tmp1;
- }
-
- if (y1!=y3) k=((x1-x3) << 6) / (y1-y3);
- else k=(x1-x3) << 6;
-
- if (y1!=y2) k2=((x1-x2) << 6) / (y1-y2);
- else k2=(x1-x2) << 6;
-
- x=x1 << 6;
- x_2=x;
- i=y1;
-
- if (i!=y2)
- do
- {
- x+=k;
- x_2+=k2;
- i++;
-
- if ((x1t = x >> 6) > (x2t = x_2 >> 6))
- hline(x2t, x1t, i, c);
- else
- hline(x1t, x2t, i, c);
- }
- while (i!=y2);
-
- if (i==y3) return;
-
- if (y2!=y3) k2=((x2-x3) << 6) / (y2-y3);
- else k2=((x2-x3) << 6);
-
- x_2=x2 << 6;
- i=y2;
- do
- {
- x+=k;
- x_2+=k2;
- i++;
-
- if ((x1t = x >> 6) > (x2t = x_2 >> 6))
- hline(x2t, x1t, i, c);
- else
- hline(x1t, x2t, i, c);
- }
- while (i!=y3);
-}
-
-void clearscr()
-{
- copyXPMArea(78,0,56,56,4,4);
-}
-
-// Blits a string at given co-ordinates
-void BlitString(char *name, int x, int y)
-{
- int i;
- int c;
- int k;
-
- k = x;
-
- copyXPMArea(73,64,1,8,k-1,y);
-
- for (i=0; name[i]; i++)
- {
- c = toupper(name[i]);
- //printf("%c",c);
-
- if (c >= 'A' && c <= 'Z')
- { // its a letter
- c -= 'A';
- if ( k > -2) copyXPMArea(c * 6, 74, 6, 8, k, y);
- k += 6;
- } else
- if (c >= '0' && c<= ':')
- { // its a number or symbol
- c -= '0';
- if ( k > -2) copyXPMArea(c * 6, 64, 6, 8, k, y);
- k += 6;
- } else
- if (c == 246) {
- if ( k > -2) copyXPMArea(0, 84, 6, 9, k, y);
- k += 6;
- } else
- if (c == 228) {
- if ( k > -2) copyXPMArea(6, 84, 6, 9, k, y);
- k += 6;
- } else
- if (c == 229) {
- if ( k > -2) copyXPMArea(12, 84, 6, 9, k, y);
- k += 6;
- } else
- { // its a blank or something else
- if ( k > -2) copyXPMArea(73,64,6,8,k,y);
- k += 6;
- }
- if (k >= 58) break;
- }
- copyXPMArea(73,64,1,8,k,y);
-
-}
-
-// Blits number to given coordinates.. two 0's, right justified
-
-void BlitNum(int num, int x, int y)
-{
- char buf[1024];
- int newx=x;
-
- if (num > 99)
- {
- newx -= CHAR_WIDTH;
- }
-
- if (num > 999)
- {
- newx -= CHAR_WIDTH;
- }
-
- sprintf(buf, "%02i", num);
-
- BlitString(buf, newx, y);
-}
-
-void line(int x1, int y1, int x2, int y2, int c)
-{
- int i, deltax, deltay, numpixels,
- d, dinc1, dinc2,
- x, xinc1, xinc2,
- y, yinc1, yinc2;
-
- deltax = abs(x2 - x1);
- deltay = abs(y2 - y1);
- if (deltax >= deltay)
- {
- numpixels = deltax + 1;
- d = (deltay << 1) - deltax;
- dinc1 = deltay << 1;
- dinc2 = (deltay - deltax) << 1;
- xinc1 = 1;
- xinc2 = 1;
- yinc1 = 0;
- yinc2 = 1;
- }
- else
- {
- numpixels = deltay + 1;
- d = (deltax << 1) - deltay;
- dinc1 = deltax << 1;
- dinc2 = (deltax - deltay) << 1;
- xinc1 = 0;
- xinc2 = 1;
- yinc1 = 1;
- yinc2 = 1;
- }
- if (x1 > x2)
- {
- xinc1 = - xinc1;
- xinc2 = - xinc2;
- }
- if (y1 > y2)
- {
- yinc1 = - yinc1;
- yinc2 = - yinc2;
- }
- x = x1;
- y = y1;
- for (i=1; i<numpixels; i++)
- {
- putpixel(x, y, c);
- if (d < 0)
- {
- d = d + dinc1;
- x = x + xinc1;
- y = y + yinc1;
- }
- else
- {
- d = d + dinc2;
- x = x + xinc2;
- y = y + yinc2;
- }
- }
-}
-
-
-//**** 3d specific ********************************
-//*************************************************
-
-void rotate(int xang, int yang, int zang)
-{
- float tx, ty, tz;
- int i;
-
- for (i = 0; i < nofcoords; i++)
- {
- tx = cost[yang]*matrix[i][0]-sint[yang]*matrix[i][2];
- tz = sint[yang]*matrix[i][0]+cost[yang]*matrix[i][2];
- ty = cost[zang]*matrix[i][1]-sint[zang]*tx;
-
- rmatrix[i][0] = (cost[zang]*tx+sint[zang]*matrix[i][1]);
- rmatrix[i][1] = (sint[xang]*tz+cost[xang]*ty);
- rmatrix[i][2] = (cost[xang]*tz-sint[xang]*ty);
- }
-
- if (planesORlines)
- for (i = 0; i < nofplanes; i++)
- if (normal(rmatrix[planes[i][0]], rmatrix[planes[i][1]], rmatrix[planes[i][2]]) > 0)
- plane_color[i] = luminate(rmatrix[planes[i][0]], rmatrix[planes[i][1]], rmatrix[planes[i][2]]);
-
- for (i = 0; i < nofcoords; i++) {
- // Perspective correcting lines...
- rmatrix[i][0] = (rmatrix[i][0] *256) / (2*rmatrix[i][2] - zoff) + xcenter;
- rmatrix[i][1] = (rmatrix[i][1] *256) / (2*rmatrix[i][2] - zoff) + ycenter;
- }
-}
-
-void sortz(int nofelements) { // Insertion-sort the planes in increasing z-distance
-
- int i, j, k;
- float key;
- float temparr[nofelements];
-
- for (i = 0; i < nofelements; i++)
- {
- zorder[i] = i;
- temparr[i] = rmatrix[planes[i][0]][2]+rmatrix[planes[i][1]][2]+rmatrix[planes[i][2]][2];
- }
-
- for (j = 1; j < nofelements; j++) {
-
- key = temparr[j];
- k = zorder[j];
- i = j - 1;
-
- while ((i > -1) && (temparr[i] > key)) {
- temparr[i+1] = temparr[i];
- zorder[i+1] = zorder[i--];
- }
-
- zorder[i+1] = k;
- temparr[i+1] = key;
- }
-}
-
-int normal(float p1[], float p2[], float p3[])
-{
- return ((p1[0]-p3[0])*(p2[1]-p3[1])-(p2[0]-p3[0])*(p1[1]-p3[1]));
-}
-
-int luminate(float p1[], float p2[], float p3[])
-{
- double x1 = (float)(p1[0]-p3[0]), y1 = (float)(p1[1]-p3[1]), z1 = (float)(p1[2]-p3[2]);
- double x2 = (float)(p2[0]-p3[0]), y2 = (float)(p2[1]-p3[1]), z2 = (float)(p2[2]-p3[2]);
- double nx = y1*z2-y2*z1, ny =-(x1*z2-x2*z1),nz = x1*y2-y1*x2;
-
- return (int)(53 * (acost[(int)(50 + 50*(nx*lum_vector[0]+ny*lum_vector[1]+nz*lum_vector[2])/
- (sqrt(nx*nx+ny*ny+nz*nz)*
- sqrt(lum_vector[0]*lum_vector[0]+lum_vector[1]*lum_vector[1]+
- lum_vector[2]*lum_vector[2])))] / PI));
-
- // Do I smell optimization? :-)
-}
-
-void setUpAngles()
-{
- int i;
- for (i = 0; i < 361; i++) {
- cost[i] = cos((double)i*(2*PI/(double)360));
- sint[i] = sin((double)i*(2*PI/(double)360));
- }
-
- for (i = 0; i < 100; i++) acost[i] = acos((double)(-50+i)/50);
-}
-
-void setupobj(char *filename)
-{
- int i, j = 0;
- int biggest = 0;
- float scale = 1;
-
- xcenter = 16;
- ycenter = 15 - 2*show_load;
-
- if (strcmp(filename,"") != 0)
- loadobj(filename);
- else
- {
- nofcoords = 8;
- noflines = 24;
- nofplanes = 12;
- planesORlines = 1;
-
- matrix = (float **)malloc(nofcoords*sizeof(float *)); mem_alloc_error(matrix);
- planes = (int **)malloc(nofplanes*sizeof(int *)); mem_alloc_error(planes);
- plane_color = (int *)malloc(nofplanes*sizeof(int)); mem_alloc_error(plane_color);
- zorder = (int *)malloc(nofplanes*sizeof(int)); mem_alloc_error(zorder);
-
- for (i = 0; i < nofplanes; i++) zorder[i] = i;
-
- for (i = 0; i < nofcoords; i++) {
- matrix[i] = (float *)malloc(3*sizeof(float));
- mem_alloc_error(matrix[i]);
- }
-
- for (i = 0; i < nofplanes; i++) {
- planes[i] = (int *)malloc(3*sizeof(int));
- mem_alloc_error(planes[i]);
- }
-
- cline = (int *)malloc((noflines+1)*sizeof(int)); mem_alloc_error(cline);
-
- matrix[0][0] = -180; matrix[0][1] = -180; matrix[0][2] = 180; // 0
- matrix[1][0] = 180; matrix[1][1] = -180; matrix[1][2] = 180; // 1
- matrix[2][0] = 180; matrix[2][1] = 180; matrix[2][2] = 180; // 2
- matrix[3][0] = -180; matrix[3][1] = 180; matrix[3][2] = 180; // 3
- matrix[4][0] = -180; matrix[4][1] = -180; matrix[4][2] = -180; // 4
- matrix[5][0] = 180; matrix[5][1] = -180; matrix[5][2] = -180; // 5
- matrix[6][0] = 180; matrix[6][1] = 180; matrix[6][2] = -180; // 6
- matrix[7][0] = -180; matrix[7][1] = 180; matrix[7][2] = -180; // 7
-
- cline[0] = 1; cline[1] = 2;
- cline[2] = 2; cline[3] = 3;
- cline[4] = 3; cline[5] = 4;
- cline[6] = 4; cline[7] = 1;
- cline[8] = 5; cline[9] = 6;
- cline[10] = 6; cline[11] = 7;
- cline[12] = 7; cline[13] = 8;
- cline[14] = 8; cline[15] = 5;
- cline[16] = 1; cline[17] = 5;
- cline[18] = 2; cline[19] = 6;
- cline[20] = 3; cline[21] = 7;
- cline[22] = 4; cline[23] = 8;
-
- planes[0][0] = 0; planes[0][1] = 1; planes[0][2] = 3;
- planes[1][0] = 1; planes[1][1] = 2; planes[1][2] = 3;
- planes[2][0] = 1; planes[2][1] = 5; planes[2][2] = 6;
- planes[3][0] = 1; planes[3][1] = 6; planes[3][2] = 2;
-
- planes[4][0] = 4; planes[4][1] = 0; planes[4][2] = 3;
- planes[5][0] = 4; planes[5][1] = 3; planes[5][2] = 7;
- planes[6][0] = 3; planes[6][1] = 2; planes[6][2] = 7;
- planes[7][0] = 7; planes[7][1] = 2; planes[7][2] = 6;
-
- planes[8][0] = 4; planes[8][1] = 1; planes[8][2] = 0;
- planes[9][0] = 4; planes[9][1] = 5; planes[9][2] = 1;
- planes[10][0] = 5; planes[10][1] = 4; planes[10][2] = 7;
- planes[11][0] = 5; planes[11][1] = 7; planes[11][2] = 6;
- }
-
- rmatrix = (float **)realloc(rmatrix,nofcoords*sizeof(float *)); mem_alloc_error(rmatrix);
- for (i = 0; i < nofcoords; i++) {
- rmatrix[i] = (float *)malloc(3*sizeof(float));
- mem_alloc_error(rmatrix[i]);
- }
-
- /*
- * Find the longest discance between all coordinates relative to the origin
- */
-
- for (i = 0; i < nofcoords; i++) {
- j = (int)sqrt((pow(matrix[i][0],2)+pow(matrix[i][1],2)+pow(matrix[i][2],2)));
- if (j > biggest) biggest = j;
- }
-
- /*
- * Scale every coordinate using the calculated factor
- */
-
- scale = 280 / (float)biggest;
-
- for (i = 0; i < nofcoords; i++) {
- matrix[i][0] *= scale;
- matrix[i][1] *= scale;
- matrix[i][2] *= scale;
- }
-}
-
-
-
-
-//**** Application Management, I/O etc. ***********
-//*************************************************
-
-void print_help() {
- printf("\nwmCube %s (%s)\n\n", WMCUBE_VERSION, REV_DATE);
-
-#ifndef SOLARIS
- printf(" -o <filename or directory>: load external 3d-object(s).\n\n");
-#else
- printf(" -o <filename>: load external 3d-object.\n\n");
-#endif
-
- printf(" -d x: rotate x degrees/step when the cpu is idle. (default 1)\n");
- printf(" -r x: rotate 1 degree faster every x percent of cpu-usage. (default 25)\n");
-
-#ifdef LINUX
- printf(" -c x: which cpu (0,1,2..) to monitor. (default average over all)\n");
- printf(" -n : exclude \"nice\" processes. (default OFF)\n");
-#endif
-
-#ifdef SOLARIS
- printf(" -c x: which cpu (0,1,2..) to monitor. (default average over all)\n");
-#endif
-
-#ifdef FREEBSD
- printf(" -n : exclude \"nice\" processes. (default OFF)\n");
-#endif
-
-#ifdef NETBSD
- printf(" -n : exclude \"nice\" processes. (default OFF)\n");
-#endif
-
- printf(" -b : draw the cube in a brighter color. (default OFF)\n");
- printf(" -i : invert cube speed. (default OFF)\n");
- printf(" -p : do not display cpu-load (default OFF)\n");
- printf(" -h : display this helptext.\n\n");
-}
-
-void die()
-{
- fprintf(stderr, "%s: exiting", pname);
- exit (1);
-}
-
-#ifndef SOLARIS // scan4objects doesnt work on Solaris because of alphasort
-int scan4objects(char *dir)
-{
- struct dirent **names;
- int n;
-
- n = scandir(dir,&names,0,alphasort);
-
- while (n-- > 0)
- if (strstr(names[n]->d_name,".wmc") != NULL)
- {
- objects[nof_objects] = (char *)malloc(strlen(dir)+strlen(names[n]->d_name)+2);
- strcpy(objects[nof_objects],dir);
- if (dir[strlen(dir)] != '/') strcat(objects[nof_objects],"/");
- strcat(objects[nof_objects++],names[n]->d_name);
- }
-
- return nof_objects;
-}
-#endif
-
-int next_object()
-{
- if (nof_objects == 0) return -1;
- setupobj(objects[rand() % (nof_objects )]);
-
- return 0;
-}
-
-
-int loadobj(char *filename) {
-
- FILE *fp;
- char tmp[64] = {""};
- int i = 0, counter = 1;
-
- //printf("\nLoading file %s...",filename); fflush(stdout);
-
- if ((fp = fopen(filename,"rt")) == NULL) {
- printf("\nERROR: wmCube object-file not found (%s).\n\n",filename);
- exit(0);
- }
-
- fscanf(fp,"%s",tmp);
-
- if (strcmp(tmp,"WMCUBE_COORDINATES") != 0) {
- printf("\nError in objectfile: it must start with WMCUBE_COORDINATES\n\n");
- fclose(fp);
- exit(0);
- }
-
- fscanf(fp,"%s",tmp);
- counter = atoi(tmp);
-
- while ((strcmp(tmp,"WMCUBE_LINES") != 0) && (strcmp(tmp,"WMCUBE_PLANES") != 0)) {
-
- matrix = (float **)realloc(matrix,(i+1)*sizeof(float *)); mem_alloc_error(matrix);
- matrix[i] = (float *)malloc(3*sizeof(float)); mem_alloc_error(matrix[i]);
- fscanf(fp,"%f %f %f",&matrix[i][0],&matrix[i][1],&matrix[i][2]);
- //printf("\n%d: %f %f %f",atoi(tmp), matrix[i][0],matrix[i][1],matrix[i][2]);
-
- if (atoi(tmp) != (++i)) {
-
- printf("\nError in objectfile (WMCUBE_COORDINATES section):\n"
- "the coordinates must be listed in order 1..n\n\n");
- fclose(fp);
- exit(0);
- }
- fscanf(fp,"%s",tmp);
-
- if (feof(fp)) {
- printf("\nError in objectfile: you must have a section WMCUBE_LINES or WMCUBE_PLANES\n\n");
- fclose(fp);
- exit(0);
- }
- }
-
- nofcoords = i;
- i = 0;
-
- if (strcmp(tmp,"WMCUBE_LINES") == 0) {
-
- planesORlines = 0;
- while (1) {
-
- cline = (int *)realloc(cline,(i+2)*sizeof(int)); mem_alloc_error(cline);
- fscanf(fp,"%d %d",&cline[i++],&cline[i++]);
- //printf("\n%d %d",cline[i-2],cline[i-1]);
- if (feof(fp)) break;
-
- if (cline[i-2] > nofcoords || cline[i-1] > nofcoords) {
- printf("\nError in objectfile (WMCUBE_LINES section):\n"
- "coordinates %d or/and %d doesnt exist\n\n",cline[i-2],cline[i-1]);
- fclose(fp);
- exit(0);
- }
- }
- noflines = i-2;
- }
- else if (strcmp(tmp,"WMCUBE_PLANES") == 0) {
-
- planesORlines = 1;
- while (1) {
- planes = (int **)realloc(planes,(i+1)*sizeof(int *)); mem_alloc_error(planes);
- planes[i] = (int *)malloc(3*sizeof(int)); mem_alloc_error(planes[i]);
- fscanf(fp,"%d %d %d",&planes[i][0],&planes[i][1],&planes[i][2]);
- //printf("\n%d: %d %d %d",i,planes[i][0],planes[i][1],planes[i][2]);
-
- planes[i][0]--; planes[i][1]--; planes[i][2]--;
- //printf("\n%d: %d %d %d\n",i,planes[i][0],planes[i][1],planes[i][2]);
-
- if (feof(fp)) break;
-
- if (planes[i][0] > nofcoords || planes[i][1] > nofcoords || planes[i][2] > nofcoords) {
- printf("\nError in objectfile (WMCUBE_PLANES section):\n"
- "coordinates %d or/and %d or/and %d doesnt exist\n\n",planes[i][0],planes[i][1],planes[i][2]);
- fclose(fp);
- exit(0);
- }
- i++;
- }
- nofplanes = i;
- plane_color = (int *)malloc(nofplanes*sizeof(int)); mem_alloc_error(plane_color);
- zorder = (int *)malloc(nofplanes*sizeof(int)); mem_alloc_error(zorder);
- for (i = 0; i < nofplanes; i++) zorder[i] = i;
-
- } else {
- printf("\nError in objectfile: you must have a section WMCUBE_LINES or WMCUBE_PLANES\n\n");
- fclose(fp);
- exit(0);
- }
-
- fclose(fp);
- return 1;
-}
-
-void mem_alloc_error(void *block) {
- if (block == NULL) {
- printf("\nError allocating memory!\n\n");
- exit(0);
- }
-}
-
-
-/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
- * Begin System Specific Code. If you wish to port wmcube to a new platform,
- * you'll need to implement the following operations:
- *
- * int init_calc_cpu();
- * Perform feature tests to determine whether wmcube can run, and set up
- * any files/data structures/etc. to gather statistics.
- *
- * int calc_cpu_total();
- * return an integer reflecting the current CPU load
- */
-
-#if defined LINUX
-
-/*
- * init_calc_cpu doesn't have much to do on Linux, but it can check to see if
- * /proc/stat is available; if the user selected to monitor a particular CPU,
- * it can check it's existence.
- */
-int init_calc_cpu()
-{
- FILE *fp;
- int i;
- char cpuid[6];
- char check_cpu[6];
-
- sprintf(check_cpu, "cpu%d", which_cpu);
-
- if ((fp = fopen("/proc/stat","rb")) == NULL) {
- perror("/proc/stat required for this system");
- return -1;
- }
-
- if (which_cpu == -1)
- return 0;
-
- for (i = -2; i < which_cpu; i++) {
- fscanf(fp, "%s", cpuid);
- }
-
- if (strcmp(check_cpu,cpuid) != 0) {
- fprintf(stderr, "ERROR: could not read cpu-load on %s. Are you "
- "sure you have an SMP system?\n",check_cpu);
- return -1;
- }
- return (0);
-}
-
-int calc_cpu_total() {
- int total, used, t=0, i;
- static int previous_total = 0, previous_used = 0;
- char cpuid[6];
- int cpu,nice,system,idle;
- FILE *fp;
-
- fp = fopen("/proc/stat","rt");
-
- for (i = -2; i < which_cpu; i++) {
- fscanf(fp,"%s %d %d %d %d",cpuid,&cpu,&nice,&system,&idle);
- }
-
- fclose(fp);
-
- used = cpu + system + use_nice*nice;
- total = used + idle + (1-use_nice)*nice;
-
- t = 100 * (double)(used - previous_used) / (double)(total - previous_total);
- previous_total = total;
- previous_used = used;
-
- return t;
-}
-
-#elif defined SOLARIS
-#include <sys/types.h>
-#include <sys/sysinfo.h>
-#include <kstat.h>
-
-static kstat_ctl_t *kc;
-static kstat_t **cpu_ksp_list;
-static kstat_t *the_cpu;
-static int ncpus;
-
-/*
- * The biggest subtlety of the Solaris port is that init_calc_cpu can be called
- * after the initial program setup. This occurs when a 'kstat state change'
- * occurs. Usually this means that a CPU has been taken on or off-line using
- * the psradm command. Another possibility is that on server systems, a new
- * CPU might have been hot-added to a running system.
- *
- * As a result, init_calc_cpu frees any resources it might have setup if needed,
- * and reinitializes everything.
- */
-int init_calc_cpu()
-{
- kstat_t *ksp;
- int i = 0;
-
- if (kc == NULL) {
- if ((kc = kstat_open()) == NULL) {
- fprintf(stderr, "wmcube: can't open /dev/kstat\n");
- return -1;
- }
- }
-
- if (which_cpu != -1) {
- /*
- * User selected to monitor a particlur CPU. find it...
- */
- for (ksp = kc->kc_chain; ksp; ksp = ksp->ks_next) {
- if ((strcmp(ksp->ks_module, "cpu_stat") == 0) &&
- (ksp->ks_instance == which_cpu)) {
- the_cpu = ksp;
- break;
- }
- }
- if (the_cpu == NULL) {
- fprintf(stderr, "CPU %d not found\n", which_cpu);
- return -1;
- }
- } else {
- /*
- * User selected to monitor all CPUs. First, count them.
- */
- for (ksp = kc->kc_chain; ksp; ksp = ksp->ks_next) {
- if (strcmp(ksp->ks_module, "cpu_stat") == 0)
- i++;
- }
-
- if (cpu_ksp_list) {
- free(cpu_ksp_list);
- }
- cpu_ksp_list = (kstat_t **) calloc(i * sizeof (kstat_t *), 1);
- ncpus = i;
-
- /*
- * stash the ksp for each CPU.
- */
- i = 0;
- for (ksp = kc->kc_chain; ksp; ksp = ksp->ks_next) {
- if (strcmp(ksp->ks_module, "cpu_stat") == 0) {
- cpu_ksp_list[i] = ksp;
- i++;
- }
- }
- }
- return 0;
-}
-
-int calc_cpu_total()
-{
- int i;
- cpu_stat_t stat;
- static int previous_total = 0, previous_used = 0;
- int used, total, t, user = 0, wait = 0, kern = 0, idle = 0;
-
- /*
- * Read each cpu's data. If the kstat chain has changed (a state change
- * has happened, maybe a new cpu was added to the system or one went
- * away), then reinitialize everything with init_calc_cpu(). Finally,
- * recursively call calc_cpu_total.
- *
- * We'll need to do a little better than this in the future, since we
- * could recurse too much in the pathological case here.
- */
- if (which_cpu == -1) {
- for (i = 0; i < ncpus; i++) {
- if (kstat_read(kc, cpu_ksp_list[i],
- (void *)&stat) == -1) {
- if (init_calc_cpu() != 0) {
- fprintf(stderr, "failed to "
- "reinitialize following state "
- "change\n");
- return (-1);
- }
- return (calc_cpu_total());
- }
- user += stat.cpu_sysinfo.cpu[CPU_USER]; /* user */
- wait += stat.cpu_sysinfo.cpu[CPU_WAIT]; /* io wait */
- kern += stat.cpu_sysinfo.cpu[CPU_KERNEL]; /* sys */
- idle += stat.cpu_sysinfo.cpu[CPU_IDLE]; /*idle("free")*/
- }
- } else {
- if (kstat_read(kc, the_cpu, (void *)&stat) == -1) {
- if (init_calc_cpu() != 0) {
- fprintf(stderr, "failed to reinitialize "
- "following state change\n");
- return (-1);
- }
- return (calc_cpu_total());
- }
- user += stat.cpu_sysinfo.cpu[CPU_USER]; /* user */
- wait += stat.cpu_sysinfo.cpu[CPU_WAIT]; /* io wait */
- kern += stat.cpu_sysinfo.cpu[CPU_KERNEL]; /* sys */
- idle += stat.cpu_sysinfo.cpu[CPU_IDLE]; /* idle("free") */
- }
-
- used = user + wait + kern;
- total = used + idle;
- t = 100 * (double)(used - previous_used) /
- (double)(total - previous_total);
- previous_total = total;
- previous_used = used;
- return (t);
-}
-
-#elif defined FREEBSD
-#include <nlist.h>
-#include <fcntl.h>
-#include <sys/dkstat.h>
-
-int init_calc_cpu()
-{
-
- if ((kd = kvm_open(NULL, NULL, NULL, O_RDONLY, "kvm_open")) == NULL)
- {
- printf("\nError: unable to open kvm\n\n");
- exit(0);
- }
- kvm_nlist(kd, nlst);
- if (nlst[0].n_type == 0)
- {
- printf("\nError: unable to get nlist\n\n");
- exit(1);
- }
-
- return 0;
-}
-
-int calc_cpu_total() {
- int total, used, t=0;
- static int previous_total = 0, previous_used = 0;
- int cpu,nice,system,idle;
- unsigned long int cpu_time[CPUSTATES];
-
- if (kvm_read(kd, nlst[0].n_value, &cpu_time, sizeof(cpu_time))
- != sizeof(cpu_time))
- {
- printf("\nError reading kvm\n\n");
- exit(0);
- }
-
- cpu = cpu_time[CP_USER];
- nice = cpu_time[CP_NICE];
- system = cpu_time[CP_SYS];
- idle = cpu_time[CP_IDLE];
-
- used = cpu + system + use_nice*nice;
- total = used + idle + (1-use_nice)*nice;
-
- t = 100 * (double)(used - previous_used) / (double)(total - previous_total);
- previous_total = total;
- previous_used = used;
-
- return t;
-}
-
-#elif defined OPENBSD
-
-int init_calc_cpu()
-{
- return 0;
-}
-
-int calc_cpu_total() {
- double avenrun[3];
-
- (void) getloadavg(avenrun, sizeof(avenrun) / sizeof(avenrun[0]));
- return(((5.0*avenrun[0] + 0.5) > 50) ? 50 : (5.0*avenrun[0] + 0.5))*2;
-}
-
-
-#elif defined NETBSD /* END OPENBSD */
-#include <sys/sched.h>
-#include <sys/sysctl.h>
-
-int init_calc_cpu ()
-{
- return 0;
-}
-
-int calc_cpu_total ()
-{
- static u_int64_t last_cp_time[CPUSTATES] = { 0, 0, 0, 0, 0 };
- u_int64_t curr_cp_time[CPUSTATES];
- u_int64_t total_time = 0, idle_time = 0;
- int mib[2];
- int i;
- size_t ssize;
- const int IDLE_TIME = 4;
- const int NICE_TIME = 1;
-
- ssize = sizeof ( curr_cp_time );
- mib[0] = CTL_KERN;
- mib[1] = KERN_CP_TIME;
- if ( sysctl ( mib, 2, curr_cp_time, &ssize, NULL, 0 ) ) {
- fprintf ( stderr, "wmcube: unable to read CP_TIME from sysctl()\n" );
- exit ( 0 );
- }
- if ( !use_nice )
- curr_cp_time[NICE_TIME] = 0;
-
- /* NetBSD gives 5 CPUSTATES -
- * User, Nice, System, Interrupt, Idle
- */
- idle_time = curr_cp_time[IDLE_TIME] - last_cp_time[IDLE_TIME];
- for ( i = 0; i < CPUSTATES; i++ ) {
- total_time += ( curr_cp_time[i] - last_cp_time[i] );
- last_cp_time[i] = curr_cp_time[i];
- }
-
- /* Calculate the % CPU usage as the User+Nice+System+Interrupt/Total
- * for the interval
- */
- return ( 100 * (int) ( total_time - idle_time ) / total_time );
-
-}
-
-#else /* END NETBSD */
-
-/*
- * This is a stub which will compile for platforms other than LINUX or SOLARIS.
- * Use these to start your port to a new platform.
- */
-int init_calc_cpu()
-{
- return 0;
-}
-
-int calc_cpu_total()
-{
- return 0;
-}
-
-#endif /* OS SPECIFIC CODE */
diff --git a/wmcube/wmcube/wmcube.xpm b/wmcube/wmcube/wmcube.xpm
deleted file mode 100644
index f72c004ea976..000000000000
--- a/wmcube/wmcube/wmcube.xpm
+++ /dev/null
@@ -1,142 +0,0 @@
-/* XPM */
-static char * wmcube_xpm[] = {
-"160 100 39 1",
-" c blue",
-". c #202020",
-"X c black",
-"o c #C7C3C7",
-"O c #20B2AE",
-"+ c #007D71",
-"@ c #B60418",
-"# c #00EB00",
-"$ c #283C38",
-"% c #F7F3FF",
-"& c #004941",
-"! c #1A8E8A",
-"A c #20AFAB",
-"B c #1FACA9",
-"C c #1EA9A5",
-"D c #1EA5A1",
-"E c #1DA19E",
-"F c #1C9C99",
-"G c #1B9894",
-"H c #1B928F",
-"I c #1A8E8A",
-"J c #198985",
-"K c #178480",
-"L c #177F7B",
-"M c #167A77",
-"N c #157672",
-"P c #14716E",
-"Q c #136C69",
-"R c #136764",
-"S c #116360",
-"T c #115E5A",
-"U c #115D5B",
-"V c #0F5956",
-"W c #0F5351",
-"Y c #0E4E4D",
-"Z c #0E4E4C",
-"1 c #0D4A48",
-"2 c #0C4644",
-"3 c #0C4240",
-" XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX O!",
-" .............oX......................................................o ",
-" .............oX......................................................o ",
-" .............oX......................................................o ",
-" XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX .............oX......................................................o ",
-" .......................................................o .............oX......................................................o ",
-" .......................................................o .............oX......................................................o..........................",
-" .......................................................o .............oX......................................................o..........................",
-" .......................................................o .............oX......................................................o..........................",
-" .......................................................o .............oX......................................................o..........................",
-" .......................................................o .............oX......................................................o..........................",
-" .......................................................o .............oX......................................................o..........................",
-" .......................................................o .............oX......................................................o..........................",
-" .......................................................o .............oX......................................................o..........................",
-" .......................................................o .............oX......................................................o..........................",
-" .......................................................o .............oX......................................................o..........................",
-" .......................................................o .............oX......................................................o..........................",
-" .......................................................o .............oX......................................................o..........................",
-" .......................................................o .............oX......................................................o..........................",
-" .......................................................o .............oX......................................................o..........................",
-" .......................................................o .............oX......................................................o..........................",
-" .......................................................o .............oX......................................................o..........................",
-" .......................................................o .............oX......................................................o..........................",
-" .......................................................o .............oX......................................................o..........................",
-" .......................................................o .............oX......................................................o..........................",
-" .......................................................o .............oX......................................................o..........................",
-" .......................................................o .............oX......................................................o..........................",
-" .......................................................o .............oX......................................................o..........................",
-" .......................................................o .............oX......................................................o..........................",
-" .......................................................o .............oX......................................................o..........................",
-" .......................................................o .............oX......................................................o..........................",
-" .......................................................o .............oX......................................................o..........................",
-" .......................................................o .............oX......................................................o..........................",
-" .......................................................o .............oX......................................................o..........................",
-" .......................................................o .............oX......................................................o..........................",
-" .......................................................o .............oX......................................................o..........................",
-" .......................................................o .............oX......................................................o..........................",
-" .......................................................o .............oX......................................................o..........................",
-" .......................................................o .............oX......................................................o..........................",
-" .......................................................o .............oX......................................................o..........................",
-" .......................................................o .............oX......................................................o..........................",
-" .......................................................o .............oX......................................................o..........................",
-" .......................................................o .............oX......................................................o..........................",
-" .......................................................o .............oX......................................................o..........................",
-" .......................................................o .............oX......................................................o..........................",
-" .......................................................o .............oX......................................................o..........................",
-" .......................................................o .............oX..............................................&&......o..........................",
-" .......................................................o .............oX..............................................&&......o..........................",
-" .......................................................o .............oX.....&&&&&&.................................&&&&&&....o..........................",
-" .......................................................o .............oX.....&&&&&&.................................&&&&&&....o..........................",
-" .......................................................o .............oX..............................................&&......o..........................",
-" .......................................................o .............oX..............................................&&......o..........................",
-" .......................................................o .............oX......................................................o..........................",
-" .......................................................o .............oX......................................................o..........................",
-" .......................................................o .............oX......................................................o..........................",
-" .......................................................o oooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo..........................",
-" .......................................................o . OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO",
-" .......................................................o . AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA",
-" .......................................................o . BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB",
-" oooooooooooooooooooooooooooooooooooooooooooooooooooooooo . CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC",
-" . EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE",
-" . FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF",
-" . GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGG",
-" . HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHH",
-"............................................................................... IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII",
-"..OOO.....+..+OOO+.+OOO+.+...+.+OOO+.+OOO+.+OOO+.+OOO+.+OOO+................... JJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJ",
-".O...O....O......O.....O.O...O.O.....O.........O.O...O.O...O............O...... KKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKK",
-".O...O....O......O.....O.O...O.O.....O.........O.O...O.O...O............O...... LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLL",
-".+...+....+..+OOO+..OOO+.+OOO+.+OOO+.+OOO+.....+.&OOO&.+OOO+...........O....... MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM",
-".O...O....O..O.........O.....O.....O.O...O.....O.O...O.....O...........O....... NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNN",
-".O...O....O..O.........O.....O.....O.O...O.....O.O...O.....O...O...O..O.....O.. PPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPP",
-"..OOO.....O..+OOO+.+OOO+.....+.+OOO+.+OOO+.....+.+OOO+.+OOO+...+...+..O.....+.. QQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQ",
-"............................................................................... RRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRR",
-" SSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSS",
-"................................................................................................................................................................",
-".&OOO&.+OOO..+OOO+.+OOO..+OOO+.+OOO+.+OOO+.+...+...+.......+.+...+.+.....O...O.+OOO..+OOO+.+OOO+.+OOO+.+OOO+.+OOO+.+OOO+.+...+.+...+.+...+.+...+.+...+..........",
-".O...O.O...O.O.....O...O.O.....O.....O.....O...O...O.......O.O...O.O.....OO.OO.O...O.O...O.O...O.O...O.O...O.O.......O...O...O.O...O.O...O.O...O.O...O.O...O....",
-".O...O.O...O.O.....O...O.O.....O.....O.....O...O...O.......O.O..O..O.....O.O.O.O...O.O...O.O...O.O...O.O...O.O.......O...O...O.O...O.O...O..O.O..O...O....O.....",
-".+OOO+.+OOO..+.....+...+.+OOO..+OOO..+.OO+.+OOO+...+.......+.+OO&..+.....+...+.+...+.+...+.+OOO+.+O..+.+OOO..+OOO+...+...+...+.+...+.+...+..&O&..+OOO+...O......",
-".O...O.O...O.O.....O...O.O.....O.....O...O.O...O...O.......O.O..O..O.....O...O.O...O.O...O.O.....O.O.O.O...O.....O...O...O...O.O+.+O.O.O.O..O.O......O..O.......",
-".O...O.O...O.O.....O...O.O.....O.....O...O.O...O...O.......O.O...O.O.....O...O.O...O.O...O.O.....O..OO.O...O.....O...O...O...O..O+O..OO.OO.O...O.....O.O...O....",
-".+...+.+OOO..+OOO+.OOOO..+OOO+.O.....+OOO+.+...+...O...+OOO+.+...+.+OOO&.+...+.O...O.+OOO+.+.....+OOO+.+...+.+OOO+...+...&OOOO...O...O...O.+...O.+OOO+..........",
-"................................................................................................................................................................",
-" TTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTT",
-"...............O... UUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUU",
-"...++.............. VVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV",
-"...++........&OOO&. WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWW",
-".++++++++++++O...O. YYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYY",
-".++++++++++++O...O. ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ",
-"...++........+OOO+. 11111111111111111111111111111111111111111111111111111111",
-"...++........O...O. 22222222222222222222222222222222222222222222222222222222",
-".............+...+. 33333333333333333333333333333333333333333333333333333333",
-"................... ",
-" ",
-" ",
-" ",
-" ",
-" ",
-" ",
-" "};
diff --git a/wmcube/wmgeneral/list.c b/wmcube/wmgeneral/list.c
deleted file mode 100644
index f804b2c7abff..000000000000
--- a/wmcube/wmgeneral/list.c
+++ /dev/null
@@ -1,169 +0,0 @@
-/* Generic single linked list to keep various information
- Copyright (C) 1993, 1994 Free Software Foundation, Inc.
-
-
-Author: Kresten Krab Thorup
-
-Many modifications by Alfredo K. Kojima
-
-
-This file is part of GNU CC.
-
-GNU CC is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2, or (at your option)
-any later version.
-
-GNU CC is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with GNU CC; see the file COPYING. If not, write to
-the Free Software Foundation, 59 Temple Place - Suite 330,
-Boston, MA 02111-1307, USA. */
-
-/* As a special exception, if you link this library with files compiled with
- GCC to produce an executable, this does not cause the resulting executable
- to be covered by the GNU General Public License. This exception does not
- however invalidate any other reasons why the executable file might be
- covered by the GNU General Public License. */
-
-#include "list.h"
-#ifdef HAVE_SYS_TYPES_H
-# include <sys/types.h>
-#endif
-#include <stdlib.h>
-
-/* Return a cons cell produced from (head . tail) */
-
-INLINE LinkedList*
-list_cons(void* head, LinkedList* tail)
-{
- LinkedList* cell;
-
- cell = (LinkedList*)malloc(sizeof(LinkedList));
- cell->head = head;
- cell->tail = tail;
- return cell;
-}
-
-/* Return the length of a list, list_length(NULL) returns zero */
-
-INLINE int
-list_length(LinkedList* list)
-{
- int i = 0;
- while(list)
- {
- i += 1;
- list = list->tail;
- }
- return i;
-}
-
-/* Return the Nth element of LIST, where N count from zero. If N
- larger than the list length, NULL is returned */
-
-INLINE void*
-list_nth(int index, LinkedList* list)
-{
- while(index-- != 0)
- {
- if(list->tail)
- list = list->tail;
- else
- return 0;
- }
- return list->head;
-}
-
-/* Remove the element at the head by replacing it by its successor */
-
-INLINE void
-list_remove_head(LinkedList** list)
-{
- if (!*list) return;
- if ((*list)->tail)
- {
- LinkedList* tail = (*list)->tail; /* fetch next */
- *(*list) = *tail; /* copy next to list head */
- free(tail); /* free next */
- }
- else /* only one element in list */
- {
- free(*list);
- (*list) = 0;
- }
-}
-
-
-/* Remove the element with `car' set to ELEMENT */
-/*
-INLINE void
-list_remove_elem(LinkedList** list, void* elem)
-{
- while (*list)
- {
- if ((*list)->head == elem)
- list_remove_head(list);
- *list = (*list ? (*list)->tail : NULL);
- }
-}*/
-
-INLINE LinkedList *
-list_remove_elem(LinkedList* list, void* elem)
-{
- LinkedList *tmp;
-
- if (list) {
- if (list->head == elem) {
- tmp = list->tail;
- free(list);
- return tmp;
- }
- list->tail = list_remove_elem(list->tail, elem);
- return list;
- }
- return NULL;
-}
-
-
-/* Return element that has ELEM as car */
-
-INLINE LinkedList*
-list_find(LinkedList* list, void* elem)
-{
- while(list)
- {
- if (list->head == elem)
- return list;
- list = list->tail;
- }
- return NULL;
-}
-
-/* Free list (backwards recursive) */
-
-INLINE void
-list_free(LinkedList* list)
-{
- if(list)
- {
- list_free(list->tail);
- free(list);
- }
-}
-
-/* Map FUNCTION over all elements in LIST */
-
-INLINE void
-list_mapcar(LinkedList* list, void(*function)(void*))
-{
- while(list)
- {
- (*function)(list->head);
- list = list->tail;
- }
-}
diff --git a/wmcube/wmgeneral/list.h b/wmcube/wmgeneral/list.h
deleted file mode 100644
index af0f22c2a882..000000000000
--- a/wmcube/wmgeneral/list.h
+++ /dev/null
@@ -1,59 +0,0 @@
-/* Generic single linked list to keep various information
- Copyright (C) 1993, 1994 Free Software Foundation, Inc.
-
-Author: Kresten Krab Thorup
-
-This file is part of GNU CC.
-
-GNU CC is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2, or (at your option)
-any later version.
-
-GNU CC is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with GNU CC; see the file COPYING. If not, write to
-the Free Software Foundation, 59 Temple Place - Suite 330,
-Boston, MA 02111-1307, USA. */
-
-/* As a special exception, if you link this library with files compiled with
- GCC to produce an executable, this does not cause the resulting executable
- to be covered by the GNU General Public License. This exception does not
- however invalidate any other reasons why the executable file might be
- covered by the GNU General Public License. */
-
-#ifndef __LIST_H_
-#define __LIST_H_
-
-#if defined(__GNUC__) && !defined(__STRICT_ANSI__)
-# define INLINE inline
-#else
-# define INLINE
-#endif
-
-typedef struct LinkedList {
- void *head;
- struct LinkedList *tail;
-} LinkedList;
-
-INLINE LinkedList* list_cons(void* head, LinkedList* tail);
-
-INLINE int list_length(LinkedList* list);
-
-INLINE void* list_nth(int index, LinkedList* list);
-
-INLINE void list_remove_head(LinkedList** list);
-
-INLINE LinkedList *list_remove_elem(LinkedList* list, void* elem);
-
-INLINE void list_mapcar(LinkedList* list, void(*function)(void*));
-
-INLINE LinkedList*list_find(LinkedList* list, void* elem);
-
-INLINE void list_free(LinkedList* list);
-
-#endif
diff --git a/wmcube/wmgeneral/misc.c b/wmcube/wmgeneral/misc.c
deleted file mode 100644
index 34281e2c089a..000000000000
--- a/wmcube/wmgeneral/misc.c
+++ /dev/null
@@ -1,164 +0,0 @@
-/* dock.c- built-in Dock module for WindowMaker
- *
- * WindowMaker window manager
- *
- * Copyright (c) 1997 Alfredo K. Kojima
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- */
-
-#include <stdlib.h>
-#include <string.h>
-#include "list.h"
-#include "misc.h"
-
-/*
- *----------------------------------------------------------------------
- * parse_command--
- * Divides a command line into a argv/argc pair.
- *----------------------------------------------------------------------
- */
-#define PRC_ALPHA 0
-#define PRC_BLANK 1
-#define PRC_ESCAPE 2
-#define PRC_DQUOTE 3
-#define PRC_EOS 4
-#define PRC_SQUOTE 5
-
-typedef struct {
- short nstate;
- short output;
-} DFA;
-
-
-static DFA mtable[9][6] = {
- {{3,1},{0,0},{4,0},{1,0},{8,0},{6,0}},
- {{1,1},{1,1},{2,0},{3,0},{5,0},{1,1}},
- {{1,1},{1,1},{1,1},{1,1},{5,0},{1,1}},
- {{3,1},{5,0},{4,0},{1,0},{5,0},{6,0}},
- {{3,1},{3,1},{3,1},{3,1},{5,0},{3,1}},
- {{-1,-1},{0,0},{0,0},{0,0},{0,0},{0,0}}, /* final state */
- {{6,1},{6,1},{7,0},{6,1},{5,0},{3,0}},
- {{6,1},{6,1},{6,1},{6,1},{5,0},{6,1}},
- {{-1,-1},{0,0},{0,0},{0,0},{0,0},{0,0}}, /* final state */
-};
-
-char*
-next_token(char *word, char **next)
-{
- char *ptr;
- char *ret, *t;
- int state, ctype;
-
- t = ret = malloc(strlen(word)+1);
- ptr = word;
-
- state = 0;
- *t = 0;
- while (1) {
- if (*ptr==0)
- ctype = PRC_EOS;
- else if (*ptr=='\\')
- ctype = PRC_ESCAPE;
- else if (*ptr=='"')
- ctype = PRC_DQUOTE;
- else if (*ptr=='\'')
- ctype = PRC_SQUOTE;
- else if (*ptr==' ' || *ptr=='\t')
- ctype = PRC_BLANK;
- else
- ctype = PRC_ALPHA;
-
- if (mtable[state][ctype].output) {
- *t = *ptr; t++;
- *t = 0;
- }
- state = mtable[state][ctype].nstate;
- ptr++;
- if (mtable[state][0].output<0) {
- break;
- }
- }
-
- if (*ret==0)
- t = NULL;
- else
- t = strdup(ret);
-
- free(ret);
-
- if (ctype==PRC_EOS)
- *next = NULL;
- else
- *next = ptr;
-
- return t;
-}
-
-
-extern void
-parse_command(char *command, char ***argv, int *argc)
-{
- LinkedList *list = NULL;
- char *token, *line;
- int count, i;
-
- line = command;
- do {
- token = next_token(line, &line);
- if (token) {
- list = list_cons(token, list);
- }
- } while (token!=NULL && line!=NULL);
-
- count = list_length(list);
- *argv = malloc(sizeof(char*)*count);
- i = count;
- while (list!=NULL) {
- (*argv)[--i] = list->head;
- list_remove_head(&list);
- }
- *argc = count;
-}
-
-extern pid_t
-execCommand(char *command)
-{
- pid_t pid;
- char **argv;
- int argc;
-
- parse_command(command, &argv, &argc);
-
- if (argv==NULL) {
- return 0;
- }
-
- if ((pid=fork())==0) {
- char **args;
- int i;
-
- args = malloc(sizeof(char*)*(argc+1));
- if (!args)
- exit(10);
- for (i=0; i<argc; i++) {
- args[i] = argv[i];
- }
- args[argc] = NULL;
- execvp(argv[0], args);
- exit(10);
- }
- return pid;
-}
diff --git a/wmcube/wmgeneral/misc.h b/wmcube/wmgeneral/misc.h
deleted file mode 100644
index 602e1b76f6e7..000000000000
--- a/wmcube/wmgeneral/misc.h
+++ /dev/null
@@ -1,9 +0,0 @@
-#ifndef __MISC_H
-#define __MISC_H
-
-#include <unistd.h>
-
-extern void parse_command(char *, char ***, int *);
-
-extern pid_t execCommand(char *);
-#endif /* __MISC_H */
diff --git a/wmcube/wmgeneral/wmgeneral.c b/wmcube/wmgeneral/wmgeneral.c
deleted file mode 100644
index 56b7bd69f787..000000000000
--- a/wmcube/wmgeneral/wmgeneral.c
+++ /dev/null
@@ -1,481 +0,0 @@
-/*
- Best viewed with vim5, using ts=4
-
- wmgeneral was taken from wmppp.
-
- It has a lot of routines which most of the wm* programs use.
-
- ------------------------------------------------------------
-
- Author: Martijn Pieterse (piet...@xs4all.nl)
-
- ---
- CHANGES:
- ---
- 14/09/1998 (Dave Clark, cla...@skyia.com)
- * Updated createXBMfromXPM routine
- * Now supports >256 colors
- 11/09/1998 (Martijn Pieterse, piet...@xs4all.nl)
- * Removed a bug from parse_rcfile. You could
- not use "start" in a command if a label was
- also start.
- * Changed the needed geometry string.
- We don't use window size, and don't support
- negative positions.
- 03/09/1998 (Martijn Pieterse, piet...@xs4all.nl)
- * Added parse_rcfile2
- 02/09/1998 (Martijn Pieterse, piet...@xs4all.nl)
- * Added -geometry support (untested)
- 28/08/1998 (Martijn Pieterse, piet...@xs4all.nl)
- * Added createXBMfromXPM routine
- * Saves a lot of work with changing xpm's.
- 02/05/1998 (Martijn Pieterse, piet...@xs4all.nl)
- * changed the read_rc_file to parse_rcfile, as suggested by Marcelo E. Magallon
- * debugged the parse_rc file.
- 30/04/1998 (Martijn Pieterse, piet...@xs4all.nl)
- * Ripped similar code from all the wm* programs,
- and put them in a single file.
-
-*/
-
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-#include <unistd.h>
-#include <ctype.h>
-#include <stdarg.h>
-
-#include <X11/Xlib.h>
-#include <X11/xpm.h>
-#include <X11/extensions/shape.h>
-
-#include "wmgeneral.h"
-
- /*****************/
- /* X11 Variables */
-/*****************/
-
-Window Root;
-int screen;
-int x_fd;
-int d_depth;
-XSizeHints mysizehints;
-XWMHints mywmhints;
-Pixel back_pix, fore_pix;
-char *Geometry = "";
-Window iconwin, win;
-GC NormalGC;
-XpmIcon wmgen;
-Pixmap pixmask;
-
- /*****************/
- /* Mouse Regions */
-/*****************/
-
-typedef struct {
- int enable;
- int top;
- int bottom;
- int left;
- int right;
-} MOUSE_REGION;
-
-MOUSE_REGION mouse_region[MAX_MOUSE_REGION];
-
- /***********************/
- /* Function Prototypes */
-/***********************/
-
-static void GetXPM(XpmIcon *, char **);
-static Pixel GetColor(char *);
-void RedrawWindow(void);
-void AddMouseRegion(int, int, int, int, int);
-int CheckMouseRegion(int, int);
-
-/*******************************************************************************\
-|* parse_rcfile *|
-\*******************************************************************************/
-
-void parse_rcfile(const char *filename, rckeys *keys) {
-
- char *p,*q;
- char temp[128];
- char *tokens = " :\t\n";
- FILE *fp;
- int i,key;
-
- fp = fopen(filename, "r");
- if (fp) {
- while (fgets(temp, 128, fp)) {
- key = 0;
- q = strdup(temp);
- q = strtok(q, tokens);
- while (key >= 0 && keys[key].label) {
- if ((!strcmp(q, keys[key].label))) {
- p = strstr(temp, keys[key].label);
- p += strlen(keys[key].label);
- p += strspn(p, tokens);
- if ((i = strcspn(p, "#\n"))) p[i] = 0;
- free(*keys[key].var);
- *keys[key].var = strdup(p);
- key = -1;
- } else key++;
- }
- free(q);
- }
- fclose(fp);
- }
-}
-
-/*******************************************************************************\
-|* parse_rcfile2 *|
-\*******************************************************************************/
-
-void parse_rcfile2(const char *filename, rckeys2 *keys) {
-
- char *p;
- char temp[128];
- char *tokens = " :\t\n";
- FILE *fp;
- int i,key;
- char *family = NULL;
-
- fp = fopen(filename, "r");
- if (fp) {
- while (fgets(temp, 128, fp)) {
- key = 0;
- while (key >= 0 && keys[key].label) {
- if ((p = strstr(temp, keys[key].label))) {
- p += strlen(keys[key].label);
- p += strspn(p, tokens);
- if ((i = strcspn(p, "#\n"))) p[i] = 0;
- free(*keys[key].var);
- *keys[key].var = strdup(p);
- key = -1;
- } else key++;
- }
- }
- fclose(fp);
- }
- free(family);
-}
-
-
-/*******************************************************************************\
-|* GetXPM *|
-\*******************************************************************************/
-
-static void GetXPM(XpmIcon *wmgen, char *pixmap_bytes[]) {
-
- XWindowAttributes attributes;
- int err;
-
- /* For the colormap */
- XGetWindowAttributes(display, Root, &attributes);
-
- wmgen->attributes.valuemask |= (XpmReturnPixels | XpmReturnExtensions);
-
- err = XpmCreatePixmapFromData(display, Root, pixmap_bytes, &(wmgen->pixmap),
- &(wmgen->mask), &(wmgen->attributes));
-
- if (err != XpmSuccess) {
- fprintf(stderr, "Not enough free colorcells.\n");
- exit(1);
- }
-}
-
-/*******************************************************************************\
-|* GetColor *|
-\*******************************************************************************/
-
-static Pixel GetColor(char *name) {
-
- XColor color;
- XWindowAttributes attributes;
-
- XGetWindowAttributes(display, Root, &attributes);
-
- color.pixel = 0;
- if (!XParseColor(display, attributes.colormap, name, &color)) {
- fprintf(stderr, "wm.app: can't parse %s.\n", name);
- } else if (!XAllocColor(display, attributes.colormap, &color)) {
- fprintf(stderr, "wm.app: can't allocate %s.\n", name);
- }
- return color.pixel;
-}
-
-/*******************************************************************************\
-|* flush_expose *|
-\*******************************************************************************/
-
-static int flush_expose(Window w) {
-
- XEvent dummy;
- int i=0;
-
- while (XCheckTypedWindowEvent(display, w, Expose, &dummy))
- i++;
-
- return i;
-}
-
-/*******************************************************************************\
-|* RedrawWindow *|
-\*******************************************************************************/
-
-void RedrawWindow(void) {
-
- flush_expose(iconwin);
- XCopyArea(display, wmgen.pixmap, iconwin, NormalGC,
- 0,0, wmgen.attributes.width, wmgen.attributes.height, 0,0);
- flush_expose(win);
- XCopyArea(display, wmgen.pixmap, win, NormalGC,
- 0,0, wmgen.attributes.width, wmgen.attributes.height, 0,0);
-}
-
-/*******************************************************************************\
-|* RedrawWindowXY *|
-\*******************************************************************************/
-
-void RedrawWindowXY(int x, int y) {
-
- flush_expose(iconwin);
- XCopyArea(display, wmgen.pixmap, iconwin, NormalGC,
- x,y, wmgen.attributes.width, wmgen.attributes.height, 0,0);
- flush_expose(win);
- XCopyArea(display, wmgen.pixmap, win, NormalGC,
- x,y, wmgen.attributes.width, wmgen.attributes.height, 0,0);
-}
-
-/*******************************************************************************\
-|* AddMouseRegion *|
-\*******************************************************************************/
-
-void AddMouseRegion(int index, int left, int top, int right, int bottom) {
-
- if (index < MAX_MOUSE_REGION) {
- mouse_region[index].enable = 1;
- mouse_region[index].top = top;
- mouse_region[index].left = left;
- mouse_region[index].bottom = bottom;
- mouse_region[index].right = right;
- }
-}
-
-/*******************************************************************************\
-|* CheckMouseRegion *|
-\*******************************************************************************/
-
-int CheckMouseRegion(int x, int y) {
-
- int i;
- int found;
-
- found = 0;
-
- for (i=0; i<MAX_MOUSE_REGION && !found; i++) {
- if (mouse_region[i].enable &&
- x <= mouse_region[i].right &&
- x >= mouse_region[i].left &&
- y <= mouse_region[i].bottom &&
- y >= mouse_region[i].top)
- found = 1;
- }
- if (!found) return -1;
- return (i-1);
-}
-
-/*******************************************************************************\
-|* createXBMfromXPM *|
-\*******************************************************************************/
-void createXBMfromXPM(char *xbm, char **xpm, int sx, int sy) {
-
- int i,j,k;
- int width, height, numcol, depth;
- int zero=0;
- unsigned char bwrite;
- int bcount;
- int curpixel;
-
- sscanf(*xpm, "%d %d %d %d", &width, &height, &numcol, &depth);
-
-
- for (k=0; k!=depth; k++)
- {
- zero <<=8;
- zero |= xpm[1][k];
- }
-
- for (i=numcol+1; i < numcol+sy+1; i++) {
- bcount = 0;
- bwrite = 0;
- for (j=0; j<sx*depth; j+=depth) {
- bwrite >>= 1;
-
- curpixel=0;
- for (k=0; k!=depth; k++)
- {
- curpixel <<=8;
- curpixel |= xpm[i][j+k];
- }
-
- if ( curpixel != zero ) {
- bwrite += 128;
- }
- bcount++;
- if (bcount == 8) {
- *xbm = bwrite;
- xbm++;
- bcount = 0;
- bwrite = 0;
- }
- }
- }
-}
-
-/*******************************************************************************\
-|* copyXPMArea *|
-\*******************************************************************************/
-
-void copyXPMArea(int x, int y, int sx, int sy, int dx, int dy) {
-
- XCopyArea(display, wmgen.pixmap, wmgen.pixmap, NormalGC, x, y, sx, sy, dx, dy);
-
-}
-
-/*******************************************************************************\
-|* copyXBMArea *|
-\*******************************************************************************/
-
-void copyXBMArea(int x, int y, int sx, int sy, int dx, int dy) {
-
- XCopyArea(display, wmgen.mask, wmgen.pixmap, NormalGC, x, y, sx, sy, dx, dy);
-}
-
-
-/*******************************************************************************\
-|* setMaskXY *|
-\*******************************************************************************/
-
-void setMaskXY(int x, int y) {
-
- XShapeCombineMask(display, win, ShapeBounding, x, y, pixmask, ShapeSet);
- XShapeCombineMask(display, iconwin, ShapeBounding, x, y, pixmask, ShapeSet);
-}
-
-/*******************************************************************************\
-|* openXwindow *|
-\*******************************************************************************/
-void openXwindow(int argc, char *argv[], char *pixmap_bytes[], char *pixmask_bits, int pixmask_width, int pixmask_height) {
-
- unsigned int borderwidth = 1;
- XClassHint classHint;
- char *display_name = NULL;
- char *wname = argv[0];
- XTextProperty name;
-
- XGCValues gcv;
- unsigned long gcm;
-
- char *geometry = NULL;
-
- int dummy=0;
- int i, wx, wy;
-
- for (i=1; argv[i]; i++) {
- if (!strcmp(argv[i], "-display")) {
- display_name = argv[i+1];
- i++;
- }
- if (!strcmp(argv[i], "-geometry")) {
- geometry = argv[i+1];
- i++;
- }
- }
-
- if (!(display = XOpenDisplay(display_name))) {
- fprintf(stderr, "%s: can't open display %s\n",
- wname, XDisplayName(display_name));
- exit(1);
- }
- screen = DefaultScreen(display);
- Root = RootWindow(display, screen);
- d_depth = DefaultDepth(display, screen);
- x_fd = XConnectionNumber(display);
-
- /* Convert XPM to XImage */
- GetXPM(&wmgen, pixmap_bytes);
-
- /* Create a window to hold the stuff */
- mysizehints.flags = USSize | USPosition;
- mysizehints.x = 0;
- mysizehints.y = 0;
-
- back_pix = GetColor("white");
- fore_pix = GetColor("black");
-
- XWMGeometry(display, screen, Geometry, NULL, borderwidth, &mysizehints,
- &mysizehints.x, &mysizehints.y,&mysizehints.width,&mysizehints.height, &dummy);
-
- mysizehints.width = 64;
- mysizehints.height = 64;
-
- win = XCreateSimpleWindow(display, Root, mysizehints.x, mysizehints.y,
- mysizehints.width, mysizehints.height, borderwidth, fore_pix, back_pix);
-
- iconwin = XCreateSimpleWindow(display, win, mysizehints.x, mysizehints.y,
- mysizehints.width, mysizehints.height, borderwidth, fore_pix, back_pix);
-
- /* Activate hints */
- XSetWMNormalHints(display, win, &mysizehints);
- classHint.res_name = wname;
- classHint.res_class = wname;
- XSetClassHint(display, win, &classHint);
-
- XSelectInput(display, win, ButtonPressMask | ExposureMask | ButtonReleaseMask | PointerMotionMask | StructureNotifyMask);
- XSelectInput(display, iconwin, ButtonPressMask | ExposureMask | ButtonReleaseMask | PointerMotionMask | StructureNotifyMask);
-
- if (XStringListToTextProperty(&wname, 1, &name) == 0) {
- fprintf(stderr, "%s: can't allocate window name\n", wname);
- exit(1);
- }
-
- XSetWMName(display, win, &name);
-
- /* Create GC for drawing */
-
- gcm = GCForeground | GCBackground | GCGraphicsExposures;
- gcv.foreground = fore_pix;
- gcv.background = back_pix;
- gcv.graphics_exposures = 0;
- NormalGC = XCreateGC(display, Root, gcm, &gcv);
-
- /* ONLYSHAPE ON */
-
- pixmask = XCreateBitmapFromData(display, win, pixmask_bits, pixmask_width, pixmask_height);
-
- XShapeCombineMask(display, win, ShapeBounding, 0, 0, pixmask, ShapeSet);
- XShapeCombineMask(display, iconwin, ShapeBounding, 0, 0, pixmask, ShapeSet);
-
- /* ONLYSHAPE OFF */
-
- mywmhints.initial_state = WithdrawnState;
- mywmhints.icon_window = iconwin;
- mywmhints.icon_x = mysizehints.x;
- mywmhints.icon_y = mysizehints.y;
- mywmhints.window_group = win;
- mywmhints.flags = StateHint | IconWindowHint | IconPositionHint | WindowGroupHint;
-
- XSetWMHints(display, win, &mywmhints);
-
- XSetCommand(display, win, argv, argc);
- XMapWindow(display, win);
-
- if (geometry) {
- if (sscanf(geometry, "+%d+%d", &wx, &wy) != 2) {
- fprintf(stderr, "Bad geometry string.\n");
- exit(1);
- }
- XMoveWindow(display, win, wx, wy);
- }
-}
diff --git a/wmcube/wmgeneral/wmgeneral.h b/wmcube/wmgeneral/wmgeneral.h
deleted file mode 100644
index e9d6ca646d2c..000000000000
--- a/wmcube/wmgeneral/wmgeneral.h
+++ /dev/null
@@ -1,59 +0,0 @@
-#ifndef WMGENERAL_H_INCLUDED
-#define WMGENERAL_H_INCLUDED
-
- /***********/
- /* Defines */
-/***********/
-
-#define MAX_MOUSE_REGION (16)
-
- /************/
- /* Typedefs */
-/************/
-
-typedef struct _rckeys rckeys;
-
-struct _rckeys {
- const char *label;
- char **var;
-};
-
-typedef struct _rckeys2 rckeys2;
-
-struct _rckeys2 {
- const char *family;
- const char *label;
- char **var;
-};
-
-typedef struct {
- Pixmap pixmap;
- Pixmap mask;
- XpmAttributes attributes;
-} XpmIcon;
-
- /*******************/
- /* Global variable */
-/*******************/
-
-Display *display;
-
- /***********************/
- /* Function Prototypes */
-/***********************/
-
-void AddMouseRegion(int index, int left, int top, int right, int bottom);
-int CheckMouseRegion(int x, int y);
-
-void openXwindow(int argc, char *argv[], char **, char *, int, int);
-void RedrawWindow(void);
-void RedrawWindowXY(int x, int y);
-
-void createXBMfromXPM(char *, char **, int, int);
-void copyXPMArea(int, int, int, int, int, int);
-void copyXBMArea(int, int, int, int, int, int);
-void setMaskXY(int, int);
-
-void parse_rcfile(const char *, rckeys *);
-
-#endif
--
2.26.2

Jeremy Sowden

unread,
May 16, 2020, 7:10:25 PM5/16/20
to Window Maker Dev, Doug Torrance
From: Doug Torrance <dtor...@monmouthcollege.edu>

Obtained from http://linux-bsd-unix.strefa.pl/wmcube-1.0.0.tar.gz.
---
wmcube/3D-objects/2planes-solid.wmc | 23 +
wmcube/3D-objects/4d.wmc | 59 +
wmcube/3D-objects/8star-small.wmc | 40 +
wmcube/3D-objects/8star.wmc | 40 +
wmcube/3D-objects/CONTRIBUTE | 60 +
wmcube/3D-objects/README | 54 +
.../ball.wmc => 3D-objects/ball-solid.wmc} | 53 -
wmcube/3D-objects/ball.wmc | 83 +
wmcube/3D-objects/celtic.wmc | 71 +
wmcube/3D-objects/cross.wmc | 63 +
wmcube/{wmc => 3D-objects}/cross2-solid.wmc | 0
wmcube/3D-objects/cross2.wmc | 51 +
wmcube/{wmc => 3D-objects}/cross3-solid.wmc | 0
wmcube/3D-objects/cross3.wmc | 95 ++
.../cross4-solid.wmc} | 48 +-
wmcube/3D-objects/crystal.wmc | 108 ++
.../cube.wmc => 3D-objects/cube-solid.wmc} | 16 -
wmcube/3D-objects/cube.wmc | 24 +
wmcube/3D-objects/diamond.wmc | 66 +
.../dice.wmc => 3D-objects/dice-solid.wmc} | 45 -
wmcube/3D-objects/e.wmc | 69 +
wmcube/3D-objects/e2.wmc | 160 ++
wmcube/3D-objects/foo.wmc | 149 ++
wmcube/3D-objects/gnustep.wmc | 110 ++
wmcube/3D-objects/hyperpyramid.wmc | 54 +
wmcube/3D-objects/jeep.wmc | 157 ++
wmcube/3D-objects/multicube.wmc | 83 +
wmcube/{wmc => 3D-objects}/peace.wmc | 2 -
wmcube/3D-objects/pyramid.wmc | 16 +
wmcube/{wmc => 3D-objects}/radioactive.wmc | 2 -
wmcube/3D-objects/shield.wmc | 197 +++
wmcube/3D-objects/slackware1.wmc | 130 ++
wmcube/3D-objects/slackware2.wmc | 256 +++
wmcube/3D-objects/slackware3.wmc | 319 ++++
wmcube/3D-objects/spaceshuttle.wmc | 382 +++++
wmcube/3D-objects/spiral.wmc | 49 +
wmcube/3D-objects/star.wmc | 95 ++
wmcube/3D-objects/starcube.wmc | 69 +
wmcube/{wmc => 3D-objects}/wmlogo.wmc | 2 -
wmcube/CHANGES | 83 +-
wmcube/COPYING | 674 ++++++++
wmcube/INSTALL | 31 +
wmcube/Makefile | 58 -
wmcube/README | 167 +-
wmcube/WmcObject.cc | 619 -------
wmcube/WmcObject.h | 96 --
wmcube/cpumoncc/README | 70 -
wmcube/cpumoncc/base/BaseCpuMonitor.h | 112 --
wmcube/cpumoncc/darwin/CpuMonitor.cc | 41 -
wmcube/cpumoncc/darwin/CpuMonitor.h | 39 -
wmcube/cpumoncc/darwin/Makefile | 41 -
wmcube/cpumoncc/freebsd/CpuMonitor.cc | 80 -
wmcube/cpumoncc/freebsd/CpuMonitor.h | 52 -
wmcube/cpumoncc/freebsd/Makefile | 41 -
wmcube/cpumoncc/linux/CpuMonitor.cc | 100 --
wmcube/cpumoncc/linux/CpuMonitor.h | 45 -
wmcube/cpumoncc/linux/Makefile | 40 -
wmcube/cpumoncc/netbsd/CpuMonitor.cc | 113 --
wmcube/cpumoncc/netbsd/CpuMonitor.h | 43 -
wmcube/cpumoncc/netbsd/Makefile | 40 -
wmcube/cpumoncc/openbsd/CpuMonitor.cc | 42 -
wmcube/cpumoncc/openbsd/CpuMonitor.h | 38 -
wmcube/cpumoncc/openbsd/Makefile | 40 -
wmcube/cpumoncc/programs/Makefile | 14 -
wmcube/cpumoncc/programs/README | 17 -
wmcube/cpumoncc/programs/cpu.cc | 56 -
wmcube/cpumoncc/programs/cpuload.cc | 60 -
wmcube/cpumoncc/solaris/CpuMonitor.cc | 141 --
wmcube/cpumoncc/solaris/CpuMonitor.h | 53 -
wmcube/cpumoncc/solaris/Makefile | 40 -
wmcube/wmapp/COPYING | 340 ----
wmcube/wmapp/Changelog | 82 -
wmcube/wmapp/Changelog.Jason | 154 --
wmcube/wmapp/FAQ.txt | 278 ----
wmcube/wmapp/Makefile | 35 -
wmcube/wmapp/README | 66 -
wmcube/wmapp/Widgets.txt | 49 -
wmcube/wmapp/colors.h | 54 -
wmcube/wmapp/example1/Makefile | 13 -
wmcube/wmapp/example1/debian-tiny.xpm | 50 -
wmcube/wmapp/example1/window0.cc | 204 ---
wmcube/wmapp/example1/window1.cc | 86 -
wmcube/wmapp/example1/wmexample.cc | 39 -
wmcube/wmapp/example2/Makefile | 13 -
wmcube/wmapp/example2/wmairtrafficcontrol.cc | 80 -
wmcube/wmapp/example2/wmradar.cc | 220 ---
wmcube/wmapp/example2/wmradar.h | 44 -
wmcube/wmapp/wmapp.cc | 378 -----
wmcube/wmapp/wmapp.h | 170 --
wmcube/wmapp/wmbutton.cc | 59 -
wmcube/wmapp/wmbutton.h | 18 -
wmcube/wmapp/wmcallback.cc | 34 -
wmcube/wmapp/wmcallback.h | 113 --
wmcube/wmapp/wmcanvas.cc | 160 --
wmcube/wmapp/wmcanvas.h | 68 -
wmcube/wmapp/wmclickable.h | 21 -
wmcube/wmapp/wmellipse.cc | 58 -
wmcube/wmapp/wmellipse.h | 21 -
wmcube/wmapp/wmframe.cc | 303 ----
wmcube/wmapp/wmframe.h | 109 --
wmcube/wmapp/wmhistory.cc | 67 -
wmcube/wmapp/wmhistory.h | 71 -
wmcube/wmapp/wmimage.cc | 91 --
wmcube/wmapp/wmimage.h | 52 -
wmcube/wmapp/wmled.cc | 12 -
wmcube/wmapp/wmled.h | 34 -
wmcube/wmapp/wmmeter.h | 57 -
wmcube/wmapp/wmmeterbar.cc | 80 -
wmcube/wmapp/wmmeterbar.h | 47 -
wmcube/wmapp/wmslider.cc | 42 -
wmcube/wmapp/wmslider.h | 32 -
wmcube/wmapp/wmtextbar.cc | 63 -
wmcube/wmapp/wmtextbar.h | 57 -
wmcube/wmapp/wmwidget.cc | 99 --
wmcube/wmapp/wmwidget.h | 367 -----
wmcube/wmapp/wmwindow.cc | 114 --
wmcube/wmapp/wmwindow.h | 130 --
wmcube/wmapp/xpm/charmap-large.xpm | 74 -
wmcube/wmapp/xpm/charmap-medium.xpm | 62 -
wmcube/wmapp/xpm/charmap-small.xpm | 62 -
wmcube/wmapp/xpm/checkbox.xpm | 14 -
wmcube/wmapp/xpm/emptybar.xpm | 62 -
wmcube/wmapp/xpm/fullbar.xpm | 62 -
wmcube/wmapp/xpm/leds.xpm | 14 -
wmcube/wmapp/xpm/tile.xpm | 121 --
wmcube/wmapp/xpm/xbutton.xpm | 14 -
wmcube/wmapp/xwrapper.cc | 329 ----
wmcube/wmapp/xwrapper.h | 140 --
wmcube/wmc/cossin.wmc | 362 -----
wmcube/wmc/coussin.bande.diag.wmc | 124 --
wmcube/wmc/diamond.wmc | 107 --
wmcube/wmc/hyp_par.wmc | 70 -
wmcube/wmc/judaspriest.wmc | 239 ---
wmcube/wmcube.cc | 695 --------
wmcube/wmcube.h | 118 --
wmcube/wmcube/Makefile | 57 +
wmcube/wmcube/Makefile.FREEBSD | 57 +
wmcube/wmcube/Makefile.LINUX | 57 +
wmcube/wmcube/Makefile.NETBSD | 55 +
wmcube/wmcube/Makefile.OPENBSD | 56 +
wmcube/wmcube/Makefile.SOLARIS | 57 +
wmcube/wmcube/wmcube.c | 1430 +++++++++++++++++
wmcube/wmcube/wmcube.xpm | 174 ++
wmcube/wmcube/wmcubeblue.xpm | 168 ++
wmcube/wmcube/wmcubecyan.xpm | 168 ++
wmcube/wmcube/wmcubegreen.xpm | 168 ++
wmcube/wmcube/wmcubemagenta.xpm | 168 ++
wmcube/wmcube/wmcubered.xpm | 168 ++
wmcube/wmcube/wmcubeyellow.xpm | 168 ++
wmcube/wmgeneral/list.c | 169 ++
wmcube/wmgeneral/list.h | 59 +
wmcube/wmgeneral/misc.c | 164 ++
wmcube/wmgeneral/misc.h | 9 +
wmcube/wmgeneral/wmgeneral.c | 481 ++++++
wmcube/wmgeneral/wmgeneral.h | 59 +
155 files changed, 7876 insertions(+), 9805 deletions(-)
create mode 100644 wmcube/3D-objects/2planes-solid.wmc
create mode 100644 wmcube/3D-objects/4d.wmc
create mode 100644 wmcube/3D-objects/8star-small.wmc
create mode 100644 wmcube/3D-objects/8star.wmc
create mode 100644 wmcube/3D-objects/CONTRIBUTE
create mode 100644 wmcube/3D-objects/README
rename wmcube/{wmc/ball.wmc => 3D-objects/ball-solid.wmc} (77%)
create mode 100644 wmcube/3D-objects/ball.wmc
create mode 100644 wmcube/3D-objects/celtic.wmc
create mode 100644 wmcube/3D-objects/cross.wmc
rename wmcube/{wmc => 3D-objects}/cross2-solid.wmc (100%)
create mode 100644 wmcube/3D-objects/cross2.wmc
rename wmcube/{wmc => 3D-objects}/cross3-solid.wmc (100%)
create mode 100644 wmcube/3D-objects/cross3.wmc
rename wmcube/{wmc/star-solid.wmc => 3D-objects/cross4-solid.wmc} (60%)
create mode 100644 wmcube/3D-objects/crystal.wmc
rename wmcube/{wmc/cube.wmc => 3D-objects/cube-solid.wmc} (72%)
create mode 100644 wmcube/3D-objects/cube.wmc
create mode 100644 wmcube/3D-objects/diamond.wmc
rename wmcube/{wmc/dice.wmc => 3D-objects/dice-solid.wmc} (78%)
create mode 100644 wmcube/3D-objects/e.wmc
create mode 100644 wmcube/3D-objects/e2.wmc
create mode 100644 wmcube/3D-objects/foo.wmc
create mode 100644 wmcube/3D-objects/gnustep.wmc
create mode 100644 wmcube/3D-objects/hyperpyramid.wmc
create mode 100644 wmcube/3D-objects/jeep.wmc
create mode 100644 wmcube/3D-objects/multicube.wmc
rename wmcube/{wmc => 3D-objects}/peace.wmc (98%)
create mode 100644 wmcube/3D-objects/pyramid.wmc
rename wmcube/{wmc => 3D-objects}/radioactive.wmc (98%)
create mode 100644 wmcube/3D-objects/shield.wmc
create mode 100644 wmcube/3D-objects/slackware1.wmc
create mode 100644 wmcube/3D-objects/slackware2.wmc
create mode 100644 wmcube/3D-objects/slackware3.wmc
create mode 100644 wmcube/3D-objects/spaceshuttle.wmc
create mode 100644 wmcube/3D-objects/spiral.wmc
create mode 100644 wmcube/3D-objects/star.wmc
create mode 100644 wmcube/3D-objects/starcube.wmc
rename wmcube/{wmc => 3D-objects}/wmlogo.wmc (92%)
create mode 100644 wmcube/COPYING
create mode 100644 wmcube/INSTALL
delete mode 100644 wmcube/Makefile
delete mode 100644 wmcube/WmcObject.cc
delete mode 100644 wmcube/WmcObject.h
delete mode 100644 wmcube/cpumoncc/README
delete mode 100644 wmcube/cpumoncc/base/BaseCpuMonitor.h
delete mode 100644 wmcube/cpumoncc/darwin/CpuMonitor.cc
delete mode 100644 wmcube/cpumoncc/darwin/CpuMonitor.h
delete mode 100644 wmcube/cpumoncc/darwin/Makefile
delete mode 100644 wmcube/cpumoncc/freebsd/CpuMonitor.cc
delete mode 100644 wmcube/cpumoncc/freebsd/CpuMonitor.h
delete mode 100644 wmcube/cpumoncc/freebsd/Makefile
delete mode 100644 wmcube/cpumoncc/linux/CpuMonitor.cc
delete mode 100644 wmcube/cpumoncc/linux/CpuMonitor.h
delete mode 100644 wmcube/cpumoncc/linux/Makefile
delete mode 100644 wmcube/cpumoncc/netbsd/CpuMonitor.cc
delete mode 100644 wmcube/cpumoncc/netbsd/CpuMonitor.h
delete mode 100644 wmcube/cpumoncc/netbsd/Makefile
delete mode 100644 wmcube/cpumoncc/openbsd/CpuMonitor.cc
delete mode 100644 wmcube/cpumoncc/openbsd/CpuMonitor.h
delete mode 100644 wmcube/cpumoncc/openbsd/Makefile
delete mode 100644 wmcube/cpumoncc/programs/Makefile
delete mode 100644 wmcube/cpumoncc/programs/README
delete mode 100644 wmcube/cpumoncc/programs/cpu.cc
delete mode 100644 wmcube/cpumoncc/programs/cpuload.cc
delete mode 100644 wmcube/cpumoncc/solaris/CpuMonitor.cc
delete mode 100644 wmcube/cpumoncc/solaris/CpuMonitor.h
delete mode 100644 wmcube/cpumoncc/solaris/Makefile
delete mode 100644 wmcube/wmapp/COPYING
delete mode 100644 wmcube/wmapp/Changelog
delete mode 100644 wmcube/wmapp/Changelog.Jason
delete mode 100644 wmcube/wmapp/FAQ.txt
delete mode 100644 wmcube/wmapp/Makefile
delete mode 100644 wmcube/wmapp/README
delete mode 100644 wmcube/wmapp/Widgets.txt
delete mode 100644 wmcube/wmapp/colors.h
delete mode 100644 wmcube/wmapp/example1/Makefile
delete mode 100644 wmcube/wmapp/example1/debian-tiny.xpm
delete mode 100644 wmcube/wmapp/example1/window0.cc
delete mode 100644 wmcube/wmapp/example1/window1.cc
delete mode 100644 wmcube/wmapp/example1/wmexample.cc
delete mode 100644 wmcube/wmapp/example2/Makefile
delete mode 100644 wmcube/wmapp/example2/wmairtrafficcontrol.cc
delete mode 100644 wmcube/wmapp/example2/wmradar.cc
delete mode 100644 wmcube/wmapp/example2/wmradar.h
delete mode 100644 wmcube/wmapp/wmapp.cc
delete mode 100644 wmcube/wmapp/wmapp.h
delete mode 100644 wmcube/wmapp/wmbutton.cc
delete mode 100644 wmcube/wmapp/wmbutton.h
delete mode 100644 wmcube/wmapp/wmcallback.cc
delete mode 100644 wmcube/wmapp/wmcallback.h
delete mode 100644 wmcube/wmapp/wmcanvas.cc
delete mode 100644 wmcube/wmapp/wmcanvas.h
delete mode 100644 wmcube/wmapp/wmclickable.h
delete mode 100644 wmcube/wmapp/wmellipse.cc
delete mode 100644 wmcube/wmapp/wmellipse.h
delete mode 100644 wmcube/wmapp/wmframe.cc
delete mode 100644 wmcube/wmapp/wmframe.h
delete mode 100644 wmcube/wmapp/wmhistory.cc
delete mode 100644 wmcube/wmapp/wmhistory.h
delete mode 100644 wmcube/wmapp/wmimage.cc
delete mode 100644 wmcube/wmapp/wmimage.h
delete mode 100644 wmcube/wmapp/wmled.cc
delete mode 100644 wmcube/wmapp/wmled.h
delete mode 100644 wmcube/wmapp/wmmeter.h
delete mode 100644 wmcube/wmapp/wmmeterbar.cc
delete mode 100644 wmcube/wmapp/wmmeterbar.h
delete mode 100644 wmcube/wmapp/wmslider.cc
delete mode 100644 wmcube/wmapp/wmslider.h
delete mode 100644 wmcube/wmapp/wmtextbar.cc
delete mode 100644 wmcube/wmapp/wmtextbar.h
delete mode 100644 wmcube/wmapp/wmwidget.cc
delete mode 100644 wmcube/wmapp/wmwidget.h
delete mode 100644 wmcube/wmapp/wmwindow.cc
delete mode 100644 wmcube/wmapp/wmwindow.h
delete mode 100644 wmcube/wmapp/xpm/charmap-large.xpm
delete mode 100644 wmcube/wmapp/xpm/charmap-medium.xpm
delete mode 100644 wmcube/wmapp/xpm/charmap-small.xpm
delete mode 100644 wmcube/wmapp/xpm/checkbox.xpm
delete mode 100644 wmcube/wmapp/xpm/emptybar.xpm
delete mode 100644 wmcube/wmapp/xpm/fullbar.xpm
delete mode 100644 wmcube/wmapp/xpm/leds.xpm
delete mode 100644 wmcube/wmapp/xpm/tile.xpm
delete mode 100644 wmcube/wmapp/xpm/xbutton.xpm
delete mode 100644 wmcube/wmapp/xwrapper.cc
delete mode 100644 wmcube/wmapp/xwrapper.h
delete mode 100755 wmcube/wmc/cossin.wmc
delete mode 100755 wmcube/wmc/coussin.bande.diag.wmc
delete mode 100644 wmcube/wmc/diamond.wmc
delete mode 100644 wmcube/wmc/hyp_par.wmc
delete mode 100644 wmcube/wmc/judaspriest.wmc
delete mode 100644 wmcube/wmcube.cc
delete mode 100644 wmcube/wmcube.h
create mode 100644 wmcube/wmcube/Makefile
create mode 100644 wmcube/wmcube/Makefile.FREEBSD
create mode 100644 wmcube/wmcube/Makefile.LINUX
create mode 100644 wmcube/wmcube/Makefile.NETBSD
create mode 100644 wmcube/wmcube/Makefile.OPENBSD
create mode 100644 wmcube/wmcube/Makefile.SOLARIS
create mode 100644 wmcube/wmcube/wmcube.c
create mode 100644 wmcube/wmcube/wmcube.xpm
create mode 100644 wmcube/wmcube/wmcubeblue.xpm
create mode 100644 wmcube/wmcube/wmcubecyan.xpm
create mode 100644 wmcube/wmcube/wmcubegreen.xpm
create mode 100644 wmcube/wmcube/wmcubemagenta.xpm
create mode 100644 wmcube/wmcube/wmcubered.xpm
create mode 100644 wmcube/wmcube/wmcubeyellow.xpm
create mode 100644 wmcube/wmgeneral/list.c
create mode 100644 wmcube/wmgeneral/list.h
create mode 100644 wmcube/wmgeneral/misc.c
create mode 100644 wmcube/wmgeneral/misc.h
create mode 100644 wmcube/wmgeneral/wmgeneral.c
create mode 100644 wmcube/wmgeneral/wmgeneral.h

diff --git a/wmcube/3D-objects/2planes-solid.wmc b/wmcube/3D-objects/2planes-solid.wmc
new file mode 100644
index 000000000000..b884b3507c4d
--- /dev/null
+++ b/wmcube/3D-objects/2planes-solid.wmc
@@ -0,0 +1,23 @@
+WMCUBE_COORDINATES
+1 -180 -180 180
+2 180 -180 180
+3 180 180 80
+4 -180 180 80
+5 -180 -180 -180
+6 180 -180 -180
+7 180 180 -80
+8 -180 180 -80
+
+WMCUBE_PLANES
+1 2 3
+1 3 4
+2 1 4
+2 4 3
+
+5 6 7
+5 7 8
+6 5 7
+7 5 8
+
+
+
diff --git a/wmcube/3D-objects/4d.wmc b/wmcube/3D-objects/4d.wmc
new file mode 100644
index 000000000000..21716d190de1
--- /dev/null
+++ b/wmcube/3D-objects/4d.wmc
+ 5 12
+ 6 11
+ 6 13
+ 7 12
+ 7 13
+ 8 11
+ 8 14
+ 9 12
+ 9 14
+ 10 13
+ 10 14
+
+ 11 16
+ 12 16
+ 13 16
+ 14 16
diff --git a/wmcube/3D-objects/8star-small.wmc b/wmcube/3D-objects/8star-small.wmc
new file mode 100644
index 000000000000..35dddf59dc53
--- /dev/null
+++ b/wmcube/3D-objects/8star-small.wmc
diff --git a/wmcube/3D-objects/8star.wmc b/wmcube/3D-objects/8star.wmc
new file mode 100644
index 000000000000..c04e721f79e5
--- /dev/null
+++ b/wmcube/3D-objects/8star.wmc
@@ -0,0 +1,40 @@
+WMCUBE_COORDINATES
+ 1 -10 -10 0
+ 2 10 -10 0
+ 3 10 10 0
+ 4 -10 10 0
+ 5 0 0 21
+ 6 0 0 -21
+ 7 0 82 58
+ 8 82 0 58
+ 9 0 -82 58
+ 10 -82 0 58
diff --git a/wmcube/3D-objects/CONTRIBUTE b/wmcube/3D-objects/CONTRIBUTE
new file mode 100644
index 000000000000..1636ed257888
--- /dev/null
+++ b/wmcube/3D-objects/CONTRIBUTE
@@ -0,0 +1,60 @@
+These are the people who have contributed by making objects for wmcube:
+Per Ĺkergren <akep...@student.luth.se>
+
+ - e.wmc
+ - e2.wmc
+
+Adam Hapworth <ad...@mint.net>
+
+ - foo.wmc
+ - jeep.wmc
+
+tarzeau <tar...@space.ch>
+
+ - spaceshuttle.wmc
+
+Rafael Garcia-Suarez <garcia...@kazibao.net>
+
+ - wmlogo.wmc
+
+Nicolas Mieville <n...@altern.org>
+
+ - diamond.wmc
+ - gnustep.wmc
+
+Cezary M. Kruk <c.k...@bigfoot.com>
+
+ - slackware1.wmc
+ - slackware2.wmc
+ - slackware3.wmc
+
diff --git a/wmcube/3D-objects/README b/wmcube/3D-objects/README
new file mode 100644
index 000000000000..4b1e9af5683f
--- /dev/null
+++ b/wmcube/3D-objects/README
@@ -0,0 +1,54 @@
+The object-files to be used with wmcube has the
+following format:
+
+WMCUBE_COORDINATES
+
+1 50 -40 30
+2 -50 50 -30
+3 -20 70 -20
+^ ^ ^ ^
+| | | \__ Z-coordinate relative the center
+| | \______ Y-coordinate relative the center
+| \___________ X-coordinate relative the center
+ \_______________ Coordinate index
+
+
+The indexes must be 1,2,3...n on a object with n coordinates.
+The center of the object is the coordinate the object will
+revolve around (0,0,0);
+
+The next section is either (case sensitive):
+
+* WMCUBE_LINES
+
+1 2
+2 3
+3 1
+
+These are the coordinates wmcube will draw lines
+between.
+
+or
+
+* WMCUBE_PLANES
+
+1 2 3
+2 3 1
+1 3 2
+2 1 3
+
+These are the coordinates wmcube will use as corner-
+coordinates for a plane. The tricky part is that the
+plane will be drawn only if you list the coordinates
+making up the plane in clockwise order. In the example
+above, the first two rows making up planes with coordinates
+1 2 3 and 2 3 1 will NOT be drawn until the object
+has rotated some X degrees but the other two will be
+drawn at once. Its kinda hard to explain, just try and you
+will eventually understand how it works.
+
+
+Done! Save the file with a .wmc suffix (preferably) and try
+running wmcube with the -o option and it will tell you if
+something is wrong with the object. Otherwise enjoy and
+remember to send me all the cool objects you create :-)
diff --git a/wmcube/wmc/ball.wmc b/wmcube/3D-objects/ball-solid.wmc
similarity index 77%
rename from wmcube/wmc/ball.wmc
rename to wmcube/3D-objects/ball-solid.wmc
index 79b795fadfb4..fa6f2ff2d289 100644
--- a/wmcube/wmc/ball.wmc
+++ b/wmcube/3D-objects/ball-solid.wmc
@@ -1,5 +1,3 @@
-# By wmCube author Robert Kling
-
WMCUBE_COORDINATES
1 -100 -100 100
2 100 -100 100
@@ -33,57 +31,6 @@ WMCUBE_COORDINATES
30 50 -50 -150
31 50 50 -150
32 -50 50 -150
-
WMCUBE_PLANES
1 18 19
1 19 2
diff --git a/wmcube/3D-objects/ball.wmc b/wmcube/3D-objects/ball.wmc
new file mode 100644
index 000000000000..5a0d8be8bf7a
--- /dev/null
+++ b/wmcube/3D-objects/ball.wmc
@@ -0,0 +1,83 @@
+WMCUBE_COORDINATES
+1 -100 -100 100
+2 100 -100 100
+3 100 100 100
+4 -100 100 100
+5 -100 -100 -100
+6 100 -100 -100
+7 100 100 -100
+8 -100 100 -100
+9 -50 -150 -50
+10 50 -150 -50
+11 150 -50 -50
+12 150 50 -50
+13 50 150 -50
+14 -50 150 -50
+15 -150 50 -50
+16 -150 -50 -50
+17 -150 -50 50
+18 -50 -150 50
+19 50 -150 50
+20 150 -50 50
+21 150 50 50
+22 50 150 50
+23 -50 150 50
+24 -150 50 50
+25 -50 -50 150
+26 50 -50 150
+27 50 50 150
+28 -50 50 150
+29 -50 -50 -150
+30 50 -50 -150
+31 50 50 -150
+32 -50 50 -150
diff --git a/wmcube/3D-objects/celtic.wmc b/wmcube/3D-objects/celtic.wmc
new file mode 100644
index 000000000000..5f4523247642
--- /dev/null
+++ b/wmcube/3D-objects/celtic.wmc
+5 17
+6 18
+8 7
+20 19
+5 6
+17 18
+25 26
+26 28
+28 27
+27 25
+29 30
+30 32
+32 31
+31 29
+25 32
+28 29
+26 31
+27 30
+9 23
+11 21
+10 24
+12 22
+24 12
+23 11
+9 21
+10 22
+11 10
+9 12
+23 22
+24 21
diff --git a/wmcube/3D-objects/cross.wmc b/wmcube/3D-objects/cross.wmc
new file mode 100644
index 000000000000..72e9cf6218b2
--- /dev/null
+++ b/wmcube/3D-objects/cross.wmc
@@ -0,0 +1,63 @@
+WMCUBE_COORDINATES
+1 -50 -50 50
+2 50 -50 50
+3 50 50 50
+4 -50 50 50
+5 -50 -50 -50
+6 50 -50 -50
+7 50 50 -50
+8 -50 50 -50
+9 -50 -150 -50
+10 50 -150 -50
+11 150 -50 -50
+12 150 50 -50
+13 50 150 -50
+14 -50 150 -50
+15 -150 50 -50
+16 -150 -50 -50
+17 -150 -50 50
+18 -50 -150 50
+19 50 -150 50
+20 150 -50 50
+21 150 50 50
+22 50 150 50
+23 -50 150 50
+24 -150 50 50
+
+WMCUBE_LINES
+1 5
+2 6
+7 3
+8 4
diff --git a/wmcube/wmc/cross2-solid.wmc b/wmcube/3D-objects/cross2-solid.wmc
similarity index 100%
rename from wmcube/wmc/cross2-solid.wmc
rename to wmcube/3D-objects/cross2-solid.wmc
diff --git a/wmcube/3D-objects/cross2.wmc b/wmcube/3D-objects/cross2.wmc
new file mode 100644
index 000000000000..61b5a39c046c
--- /dev/null
+++ b/wmcube/3D-objects/cross2.wmc
@@ -0,0 +1,51 @@
+WMCUBE_COORDINATES
+1 -50 -50 50
+2 50 -50 50
+3 50 50 50
+4 -50 50 50
+5 -50 -50 -50
+6 50 -50 -50
+7 50 50 -50
+8 -50 50 -50
+9 -50 -150 -50
+10 50 -150 -50
+11 150 -50 -50
+12 150 50 -50
+13 50 150 -50
+14 -50 150 -50
+15 -150 50 -50
+16 -150 -50 -50
+17 -150 -50 50
+18 -50 -150 50
+19 50 -150 50
+20 150 -50 50
+21 150 50 50
+22 50 150 50
+23 -50 150 50
+24 -150 50 50
diff --git a/wmcube/wmc/cross3-solid.wmc b/wmcube/3D-objects/cross3-solid.wmc
similarity index 100%
rename from wmcube/wmc/cross3-solid.wmc
rename to wmcube/3D-objects/cross3-solid.wmc
diff --git a/wmcube/3D-objects/cross3.wmc b/wmcube/3D-objects/cross3.wmc
new file mode 100644
index 000000000000..6916934c5483
--- /dev/null
+++ b/wmcube/3D-objects/cross3.wmc
@@ -0,0 +1,95 @@
+WMCUBE_COORDINATES
+1 -50 -50 50
+2 50 -50 50
+3 50 50 50
+4 -50 50 50
+5 -50 -50 -50
+6 50 -50 -50
+7 50 50 -50
+8 -50 50 -50
+9 -50 -150 -50
+10 50 -150 -50
+11 150 -50 -50
+12 150 50 -50
+13 50 150 -50
+14 -50 150 -50
+15 -150 50 -50
+16 -150 -50 -50
+17 -150 -50 50
+18 -50 -150 50
+19 50 -150 50
+20 150 -50 50
+21 150 50 50
+22 50 150 50
+23 -50 150 50
+24 -150 50 50
+25 -50 -50 150
+26 50 -50 150
+27 50 50 150
+28 -50 50 150
+29 -50 -50 -150
+30 50 -50 -150
+31 50 50 -150
+32 -50 50 -150
+
+WMCUBE_LINES
+1 5
+2 6
+7 3
+8 4
+5 6
+6 7
+7 8
+8 5
+29 30
+30 31
+31 32
+32 29
+5 29
+6 30
+7 31
+8 32
+1 2
+2 3
+3 4
+4 1
diff --git a/wmcube/wmc/star-solid.wmc b/wmcube/3D-objects/cross4-solid.wmc
similarity index 60%
rename from wmcube/wmc/star-solid.wmc
rename to wmcube/3D-objects/cross4-solid.wmc
index a52f95f12be1..371d57e7a525 100644
--- a/wmcube/wmc/star-solid.wmc
+++ b/wmcube/3D-objects/cross4-solid.wmc
@@ -7,30 +7,30 @@ WMCUBE_COORDINATES
6 50 -50 -50
7 50 50 -50
8 -50 50 -50
-9 -10 -150 -10
-10 10 -150 -10
-11 150 -10 -10
-12 150 10 -10
-13 10 150 -10
-14 -10 150 -10
-15 -150 10 -10
-16 -150 -10 -10
-17 -150 -10 10
-18 -10 -150 10
-19 10 -150 10
-20 150 -10 10
-21 150 10 10
-22 10 150 10
-23 -10 150 10
-24 -150 10 10
-25 -10 -10 150
-26 10 -10 150
-27 10 10 150
-28 -10 10 150
-29 -10 -10 -150
-30 10 -10 -150
-31 10 10 -150
-32 -10 10 -150
+9 -50 -300 -50
+10 50 -300 -50
+11 300 -50 -50
+12 300 50 -50
+13 50 300 -50
+14 -50 300 -50
+15 -300 50 -50
+16 -300 -50 -50
+17 -300 -50 50
+18 -50 -300 50
+19 50 -300 50
+20 300 -50 50
+21 300 50 50
+22 50 300 50
+23 -50 300 50
+24 -300 50 50
+25 -50 -50 300
+26 50 -50 300
+27 50 50 300
+28 -50 50 300
+29 -50 -50 -300
+30 50 -50 -300
+31 50 50 -300
+32 -50 50 -300

WMCUBE_PLANES
1 18 19
diff --git a/wmcube/3D-objects/crystal.wmc b/wmcube/3D-objects/crystal.wmc
new file mode 100644
index 000000000000..e2341ce53f9b
--- /dev/null
+++ b/wmcube/3D-objects/crystal.wmc
+ 1 11
+ 1 8
+ 1 9
+ 4 27
+ 4 24
+ 4 25
+ 4 26
+
+ 5 16
+ 5 17
+ 5 18
+ 5 19
+
+ 6 20
+ 6 21
+ 6 22
+ 6 23
+
+ 7 31
+ 7 28
+ 7 29
+ 7 30
+
+ 1 2
+ 1 3
+ 1 4
+ 1 5
+ 1 6
+ 1 7
diff --git a/wmcube/wmc/cube.wmc b/wmcube/3D-objects/cube-solid.wmc
similarity index 72%
rename from wmcube/wmc/cube.wmc
rename to wmcube/3D-objects/cube-solid.wmc
index 58219d06e7d1..31d6a7ba2a6a 100644
--- a/wmcube/wmc/cube.wmc
+++ b/wmcube/3D-objects/cube-solid.wmc
@@ -1,5 +1,3 @@
-# By wmCube author Robert Kling
-
WMCUBE_COORDINATES
1 -180 -180 180
2 180 -180 180
@@ -10,20 +8,6 @@ WMCUBE_COORDINATES
7 180 180 -180
8 -180 180 -180

-WMCUBE_LINES
-1 2
-2 3
-3 4
-4 1
-5 6
-6 7
-7 8
-8 5
-1 5
-2 6
-3 7
-4 8
-
WMCUBE_PLANES
1 2 3
1 3 4
diff --git a/wmcube/3D-objects/cube.wmc b/wmcube/3D-objects/cube.wmc
new file mode 100644
index 000000000000..a55e9755d33d
--- /dev/null
+++ b/wmcube/3D-objects/cube.wmc
@@ -0,0 +1,24 @@
+WMCUBE_COORDINATES
+1 -180 -180 180
+2 180 -180 180
+3 180 180 180
+4 -180 180 180
+5 -180 -180 -180
+6 180 -180 -180
+7 180 180 -180
+8 -180 180 -180
+
+WMCUBE_LINES
+1 2
+2 3
+3 4
+4 1
+5 6
+6 7
+7 8
+8 5
+1 5
+2 6
+3 7
+4 8
+
diff --git a/wmcube/3D-objects/diamond.wmc b/wmcube/3D-objects/diamond.wmc
new file mode 100644
index 000000000000..b8d391709239
--- /dev/null
+++ b/wmcube/3D-objects/diamond.wmc
@@ -0,0 +1,66 @@
+WMCUBE_COORDINATES
+
+1 -50 0 0
+2 -35 0 35
+3 0 0 50
+4 35 0 35
+5 50 0 0
+6 35 0 -35
+7 0 0 -50
+8 -35 0 -35
+
+9 -32 10 13
+10 -13 10 32
+11 13 10 32
+12 32 10 13
+13 32 10 -13
+14 13 10 -32
+15 -13 10 -32
+16 -32 10 -13
+
+17 0 -60 0
diff --git a/wmcube/wmc/dice.wmc b/wmcube/3D-objects/dice-solid.wmc
similarity index 78%
rename from wmcube/wmc/dice.wmc
rename to wmcube/3D-objects/dice-solid.wmc
index 2de71393649d..cd561df21923 100644
--- a/wmcube/wmc/dice.wmc
+++ b/wmcube/3D-objects/dice-solid.wmc
@@ -1,5 +1,3 @@
-# By Robert Kling
-
WMCUBE_COORDINATES
1 -70 -120 120
2 70 -120 120
@@ -28,49 +26,6 @@ WMCUBE_COORDINATES
23 120 120 -70
24 -120 120 -70

-WMCUBE_LINES
-
-1 2
-2 3
-3 4
-4 5
-5 6
-6 7
-7 8
-8 1
-
-9 10
-10 11
-11 12
-12 13
-13 14
-14 15
-15 16
-16 9
-
-1 17
-2 18
-3 18
-4 19
-5 19
-6 20
-7 20
-8 17
-
-9 21
-10 22
-11 22
-12 23
-13 23
-14 24
-15 24
-16 21
-
-17 21
-18 22
-19 23
-20 24
-
WMCUBE_PLANES

17 1 8
diff --git a/wmcube/3D-objects/e.wmc b/wmcube/3D-objects/e.wmc
new file mode 100644
index 000000000000..7c7807035db4
--- /dev/null
+++ b/wmcube/3D-objects/e.wmc
@@ -0,0 +1,69 @@
+WMCUBE_COORDINATES
+1 -60 -120 30
+2 80 -120 30
+3 80 -60 30
+4 0 -60 30
+5 0 -20 30
+6 40 -20 30
+7 40 20 30
+8 0 20 30
+9 0 60 30
+10 80 60 30
+11 80 120 30
+12 -60 120 30
+13 -60 -120 -30
+14 80 -120 -30
+15 80 -60 -30
+16 0 -60 -30
+17 0 -20 -30
+18 40 -20 -30
+19 40 20 -30
+20 0 20 -30
+21 0 60 -30
+22 80 60 -30
+23 80 120 -30
+24 -60 120 -30
+
+
+WMCUBE_LINES
+1 2
+2 3
+3 4
+4 5
+5 6
+6 7
+7 8
+8 9
+9 10
+10 11
+11 12
+ 1 12
+13 14
+14 15
+15 16
+16 17
+17 18
+18 19
+19 20
+20 21
+21 22
+22 23
+23 24
+13 24
+
+1 13
+2 14
+3 15
+4 16
+5 17
+6 18
+7 19
+8 20
+9 21
+10 22
+11 23
+12 24
+
+
+
+
diff --git a/wmcube/3D-objects/e2.wmc b/wmcube/3D-objects/e2.wmc
new file mode 100644
index 000000000000..cd80bd6b735e
--- /dev/null
+++ b/wmcube/3D-objects/e2.wmc
@@ -0,0 +1,160 @@
+WMCUBE_COORDINATES
+1 -60 -120 30
+2 80 -120 30
+3 80 -60 30
+4 0 -60 30
+5 0 -20 30
+6 40 -20 30
+7 40 20 30
+8 0 20 30
+9 0 60 30
+10 80 60 30
+11 80 120 30
+12 -60 120 30
+13 -60 -120 -30
+14 80 -120 -30
+15 80 -60 -30
+16 0 -60 -30
+17 0 -20 -30
+18 40 -20 -30
+19 40 20 -30
+20 0 20 -30
+21 0 60 -30
+22 80 60 -30
+23 80 120 -30
+24 -60 120 -30
+
+25 -60 -10 0
+26 -60 -40 0
+27 -80 -10 0
+28 -80 -40 0
+29 -80 -10 -15
+30 -80 -40 -15
+31 -80 -20 -20
+32 -80 -30 -20
+33 -80 -20 -30
+34 -80 -30 -30
+
+35 -60 -60 0
+WMCUBE_LINES
+1 2
+2 3
+3 4
+4 5
+5 6
+6 7
+7 8
+8 9
+9 10
+10 11
+11 12
+ 1 12
+13 14
+14 15
+15 16
+16 17
+17 18
+18 19
+19 20
+20 21
+21 22
+22 23
+23 24
+13 24
+1 13
+2 14
+3 15
+4 16
+5 17
+6 18
+7 19
+8 20
+9 21
+10 22
+11 23
+12 24
+
+25 26
+27 28
+25 27
+26 28
+27 29
+28 30
+29 31
+30 32
+31 33
+32 34
+33 34
+
+
+35 36
+37 38
+35 37
+36 38
+37 39
+38 40
+39 41
+40 42
+41 43
+42 44
+43 44
+
+45 46
+47 48
+45 47
+46 48
+47 49
+48 50
+49 51
+50 52
+51 53
+52 54
+53 54
+
+55 56
+57 58
+55 57
+56 58
+57 59
+58 60
+59 61
+60 62
+61 63
+62 64
+63 64
+
+
+
+
+
diff --git a/wmcube/3D-objects/foo.wmc b/wmcube/3D-objects/foo.wmc
new file mode 100644
index 000000000000..04add8fd031b
--- /dev/null
+++ b/wmcube/3D-objects/foo.wmc
+ 24 -50 -90 50
+ 25 -20 -50 50
+ 26 40 -50 50
+ 27 40 70 50
+ 28 -20 70 50
+
+ 13 14
+ 14 15
+ 15 16
+ 16 17
+ 17 18
+ 18 19
+ 19 20
+ 20 11
+
+ 1 11
+ 2 12
+ 3 13
+ 4 14
+ 5 15
+ 6 16
+ 7 17
+ 8 18
+ 9 19
+ 10 20
+
+ 21 22
+ 22 23
+ 23 24
+ 24 21
+ 25 26
+ 26 27
+ 27 28
+ 28 25
+
+ 29 30
+ 30 31
+ 31 32
+ 32 29
+ 33 34
+ 34 35
+ 35 36
+ 36 33
+
+ 21 29
+ 22 30
+ 23 31
+ 24 32
+ 25 33
+ 26 34
+ 27 35
+ 28 36
+
+ 37 38
+ 38 39
+ 39 40
+ 40 37
+ 41 42
+ 42 43
+ 43 44
+ 44 41
+
+ 45 46
+ 46 47
+ 47 48
+ 48 45
+ 49 50
+ 50 51
+ 51 52
+ 52 49
+
+ 37 45
+ 38 46
+ 39 47
+ 40 48
+ 41 49
+ 42 50
+ 43 51
+ 44 52
diff --git a/wmcube/3D-objects/gnustep.wmc b/wmcube/3D-objects/gnustep.wmc
new file mode 100644
index 000000000000..93893fd1ae27
--- /dev/null
+++ b/wmcube/3D-objects/gnustep.wmc
+36 46 -19 10
+37 -25 35 10
+38 -25 0 10
+39 25 0 10
+40 25 -35 10
+WMCUBE_LINES
+
+1 2
+2 3
+3 4
+4 5
+5 6
+6 7
+7 8
+8 9
+9 10
+10 11
+11 12
+12 13
+13 14
+14 15
+15 16
+16 1
+7 17
+17 18
+18 19
+19 20
+20 15
+
+21 22
+22 23
+23 24
+24 25
+25 26
+26 27
+27 28
+28 29
+29 30
+30 31
+31 32
+32 33
+33 34
+34 35
+35 36
+36 21
+27 37
+37 38
+38 39
+39 40
+40 35
+
+17 37
+18 38
+19 39
+20 40
+
+1 21
+2 22
+3 23
+4 24
+5 25
+6 26
+7 27
+8 28
+9 29
+10 30
+11 31
+12 32
+13 33
+14 34
+15 35
+16 36
diff --git a/wmcube/3D-objects/hyperpyramid.wmc b/wmcube/3D-objects/hyperpyramid.wmc
new file mode 100644
index 000000000000..588d8027b192
--- /dev/null
+++ b/wmcube/3D-objects/hyperpyramid.wmc
@@ -0,0 +1,54 @@
+WMCUBE_COORDINATES
+1 300 0 0
+2 -150 260 0
+3 -150 -260 0
+4 50 87 0
+5 -100 0 0
+6 50 -87 0
+7 0 0 90
+8 50 87 -250
+9 -100 0 -250
+10 50 -87 -250
+11 0 0 -90
+12 100 0 -50
+13 -87 100 -50
+14 -87 -100 -50
+
+WMCUBE_LINES
+1 4
+4 2
+2 5
+5 3
+3 6
+6 1
+1 7
+2 7
+3 7
+4 7
+5 7
+6 7
+4 8
+5 9
+6 10
+8 11
+9 11
+10 11
+1 12
+8 12
+10 12
+4 12
+6 12
+11 12
+4 13
+2 13
+5 13
+8 13
+9 13
+11 13
+5 14
+3 14
+6 14
+11 14
+9 14
+10 14
+
diff --git a/wmcube/3D-objects/jeep.wmc b/wmcube/3D-objects/jeep.wmc
new file mode 100644
index 000000000000..5fb8f1d80239
--- /dev/null
+++ b/wmcube/3D-objects/jeep.wmc
@@ -0,0 +1,157 @@
+WMCUBE_COORDINATES
+ 1 -150 -20 0
+ 2 -150 50 0
+ 3 -40 50 0
+ 4 -40 20 0
+ 5 30 20 0
+ 6 30 60 0
+ 7 20 130 0
+ 8 30 50 0
+ 9 160 50 0
+ 10 160 -20 0
+ 11 140 -20 0
+ 12 130 0 0
+ 13 90 0 0
+ 14 80 -20 0
+ 15 80 -40 0
+ 16 100 -60 0
+ 17 110 -60 0
+ 18 140 -40 0
+ 19 -70 -20 0
+ 51 80 -40 100
+ 52 100 -60 100
+ 53 110 -60 100
+ 54 140 -40 100
+ 10 11
+ 11 12
+ 12 13
+ 13 14
+ 14 15
+ 15 16
+ 16 17
+ 17 18
+ 35 36
+ 19 20
+ 20 21
+ 21 22
+ 22 23
+ 23 24
+ 24 1
+ 24 25
+ 25 26
+ 27 28
+ 28 29
+ 30 31
+ 31 32
+ 32 33
+ 33 34
+ 18 11
+
+ 37 38
+ 38 39
+ 39 40
+ 40 41
+ 41 42
+ 42 43
+ 44 45
+ 45 46
+ 46 47
+ 47 48
+ 48 49
+ 49 50
+ 50 51
+ 51 52
+ 52 53
+ 53 54
+ 71 72
+ 55 56
+ 56 57
+ 57 58
+ 58 59
+ 59 60
+ 60 37
+ 60 61
+ 61 62
+ 63 64
+ 64 65
+ 66 67
+ 67 68
+ 68 69
+ 69 70
+ 54 47
+
+ 1 37
+ 2 38
+ 3 39
+ 4 40
+ 5 41
+ 6 42
+ 7 43
+ 8 44
+ 9 45
+ 10 46
+ 11 47
+ 35 71
+ 36 72
+ 24 60
+ 28 64
diff --git a/wmcube/3D-objects/multicube.wmc b/wmcube/3D-objects/multicube.wmc
new file mode 100644
index 000000000000..ba0543929042
--- /dev/null
+++ b/wmcube/3D-objects/multicube.wmc
@@ -0,0 +1,83 @@
+WMCUBE_COORDINATES
+1 -40 40 40
+28 -20 -20 60
+29 20 20 -60
+30 -20 20 -60
+31 20 -20 -60
+32 -20 -20 -60
+
+WMCUBE_LINES
+1 2
+2 3
+3 4
+4 1
+5 6
+6 7
+7 8
+8 5
+9 10
+10 11
+11 12
+12 9
+13 14
+14 15
+15 16
+16 13
+1 13
+2 14
+3 15
+4 16
+17 18
+18 19
+19 20
+20 17
+8 20
+5 17
+6 18
+7 19
+21 22
+22 23
+23 24
+24 21
+12 24
+23 11
+9 21
+10 22
+25 26
+26 28
+27 28
+27 25
+25 29
+26 30
+28 31
+27 32
+29 30
+30 32
+31 32
+31 29
diff --git a/wmcube/wmc/peace.wmc b/wmcube/3D-objects/peace.wmc
similarity index 98%
rename from wmcube/wmc/peace.wmc
rename to wmcube/3D-objects/peace.wmc
index ff28e65e03e0..22b57cbcf7c8 100644
--- a/wmcube/wmc/peace.wmc
+++ b/wmcube/3D-objects/peace.wmc
@@ -1,5 +1,3 @@
-#By Peter Kokles <kok...@bb.telecom.sk>
-
WMCUBE_COORDINATES
1 0 -120 10
2 -46 -111 10
diff --git a/wmcube/3D-objects/pyramid.wmc b/wmcube/3D-objects/pyramid.wmc
new file mode 100644
index 000000000000..99a618cab9b5
--- /dev/null
+++ b/wmcube/3D-objects/pyramid.wmc
@@ -0,0 +1,16 @@
+WMCUBE_COORDINATES
+1 -150 -150 -150
+2 150 -150 -150
+3 150 150 -150
+4 -150 150 -150
+5 0 0 250
+WMCUBE_LINES
+1 2
+2 3
+3 4
+4 1
+1 5
+2 5
+3 5
+4 5
+
diff --git a/wmcube/wmc/radioactive.wmc b/wmcube/3D-objects/radioactive.wmc
similarity index 98%
rename from wmcube/wmc/radioactive.wmc
rename to wmcube/3D-objects/radioactive.wmc
index 87f49f5b2880..675ee081eeb5 100644
--- a/wmcube/wmc/radioactive.wmc
+++ b/wmcube/3D-objects/radioactive.wmc
@@ -1,5 +1,3 @@
-#By Peter Kokles <kok...@bb.telecom.sk>
-
WMCUBE_COORDINATES
1 0 0 0
2 5 -19 0
diff --git a/wmcube/3D-objects/shield.wmc b/wmcube/3D-objects/shield.wmc
new file mode 100644
index 000000000000..3451f45f8a5a
--- /dev/null
+++ b/wmcube/3D-objects/shield.wmc
@@ -0,0 +1,197 @@
+WMCUBE_COORDINATES
+1 -76 112 -10
+2 76 112 -10
+3 -10 99 -10
+4 10 99 -10
+5 10 75 -10
+6 33 75 -10
+7 33 55 -10
+8 10 55 -10
+9 -10 55 -10
+10 -33 55 -10
+45 -10 99 20
+46 10 99 20
+47 10 75 20
+48 33 75 20
+49 33 55 20
+50 10 55 20
+51 -10 55 20
+52 -33 55 20
+53 -33 75 20
+54 10 75 20
+55 -55 20 20
+56 -10 20 20
+57 10 20 20
+58 55 20 20
+59 55 0 20
+60 10 0 20
+61 -10 0 20
+62 -55 0 20
+63 -76 0 20
+64 -72 -29 20
+65 -59 -56 20
+66 -34 -79 20
+67 0 -89 20
+68 35 -79 20
+69 59 -56 20
+70 72 -27 20
+71 76 0 20
+72 -53 -48 20
+73 -45 -42 20
+74 -36 -40 20
+75 -26 -42 20
+76 -19 -35 20
+77 -10 -32 20
+78 0 -30 20
+79 10 -32 20
+80 19 -35 20
+81 26 -42 20
+82 36 -40 20
+83 45 -42 20
+84 53 -48 20
+
+
+WMCUBE_LINES
+1 2
+2 29
+29 28
+28 27
+27 26
+26 25
+25 24
+24 23
+23 22
+22 21
+21 1
+3 4
+4 5
+5 6
+6 7
+7 8
+8 15
+15 16
+16 17
+17 18
+18 37
+35 19
+19 20
+20 13
+13 14
+14 9
+9 10
+10 11
+11 12
+12 3
+23 30
+30 31
+31 32
+32 33
+33 34
+34 35
+35 36
+36 37
+37 38
+38 39
+39 40
+40 41
+41 42
+42 27
+43 44
+44 71
+71 70
+70 69
+69 68
+68 67
+67 66
+66 65
+45 46
+46 47
+47 48
+48 49
+49 50
+50 57
+57 58
+58 59
+59 60
+60 79
+35 61
+61 62
+62 55
+55 56
+56 51
+51 52
+52 53
+53 54
+54 45
+65 72
+72 73
+73 74
+74 75
+75 76
+76 77
+77 78
+78 79
+79 80
+80 81
+81 82
+82 83
+83 84
+84 69
+43 63
+63 64
+64 65
+1 43
+2 44
+3 45
+4 46
+5 47
+6 48
+7 49
+8 50
+15 57
+16 58
+17 59
+18 60
+19 61
+20 62
+13 55
+14 56
+9 51
+10 52
+11 53
+12 54
+67 25
diff --git a/wmcube/3D-objects/slackware1.wmc b/wmcube/3D-objects/slackware1.wmc
new file mode 100644
index 000000000000..9bc3ce34914f
--- /dev/null
+++ b/wmcube/3D-objects/slackware1.wmc
@@ -0,0 +1,130 @@
+WMCUBE_COORDINATES
+
+1 -14 -11 0
+2 -6 -11 0
+3 -5 -10 0
+4 -5 -8 0
+5 -7 -7 0
+6 -9 -5 0
+7 -10 -3 0
+8 -11 0 0
+9 -11 5 0
+10 -10 9 0
+11 -8 10 0
+12 -7 11 0
+13 -5 10 0
+14 -3 8 0
+15 -2 5 0
+16 -2 -3 0
+17 -1 -6 0
+18 0 -8 0
+19 2 -10 0
+20 5 -11 0
+21 8 -11 0
+22 10 -10 0
+23 12 -8 0
+24 14 -5 0
+25 15 -1 0
+26 15 4 0
+27 14 8 0
+28 14 9 0
+29 15 11 0
+30 15 12 0
+31 13 14 0
+32 6 14 0
+33 5 13 0
+34 5 11 0
+35 8 8 0
+36 10 5 0
+37 11 2 0
+38 11 -2 0
+39 10 -4 0
+40 8 -6 0
+41 5 -6 0
+42 4 -5 0
+43 3 -3 0
+44 3 0 0
+45 2 8 0
+46 1 12 0
+47 -2 15 0
+48 -6 16 0
+49 -10 15 0
+50 -13 13 0
+51 -15 8 0
+52 -15 0 0
+53 -14 -6 0
+54 -15 -8 0
+55 -15 -10 0
+
+56 -21 -16 0
+57 -13 -16 0
+58 -13 -14 0
+59 -19 -14 0
+60 -19 20 0
+61 -21 20 0
+
+WMCUBE_LINES
+
+1 2
+2 3
+3 4
+4 5
+5 6
+6 7
+7 8
+8 9
+9 10
+10 11
+11 12
+12 13
+13 14
+14 15
+15 16
+16 17
+17 18
+18 19
+19 20
+20 21
+21 22
+22 23
+23 24
+24 25
+25 26
+26 27
+52 53
+53 54
+54 55
+55 1
+
+56 57
+57 58
+58 59
+59 60
+60 61
+61 56
+
diff --git a/wmcube/3D-objects/slackware2.wmc b/wmcube/3D-objects/slackware2.wmc
new file mode 100644
index 000000000000..2c7a6900e0a2
--- /dev/null
+++ b/wmcube/3D-objects/slackware2.wmc
@@ -0,0 +1,256 @@
+WMCUBE_COORDINATES
+
+1 -14 -11 5
+2 -6 -11 5
+3 -5 -10 5
+4 -5 -8 5
+5 -7 -7 5
+6 -9 -5 5
+7 -10 -3 5
+8 -11 0 5
+9 -11 5 5
+10 -10 9 5
+11 -8 10 5
+12 -7 11 5
+13 -5 10 5
+14 -3 8 5
+15 -2 5 5
+16 -2 -3 5
+17 -1 -6 5
+18 0 -8 5
+19 2 -10 5
+20 5 -11 5
+21 8 -11 5
+22 10 -10 5
+23 12 -8 5
+24 14 -5 5
+25 15 -1 5
+26 15 4 5
+27 14 8 5
+28 14 9 5
+29 15 11 5
+30 15 12 5
+31 13 14 5
+32 6 14 5
+33 5 13 5
+34 5 11 5
+35 8 8 5
+36 10 5 5
+37 11 2 5
+38 11 -2 5
+39 10 -4 5
+40 8 -6 5
+41 5 -6 5
+42 4 -5 5
+43 3 -3 5
+44 3 0 5
+45 2 8 5
+46 1 12 5
+47 -2 15 5
+48 -6 16 5
+49 -10 15 5
+50 -13 13 5
+51 -15 8 5
+52 -15 0 5
+53 -14 -6 5
+54 -15 -8 5
+55 -15 -10 5
+
+56 -21 -16 5
+57 -13 -16 5
+58 -13 -14 5
+59 -19 -14 5
+60 -19 20 5
+61 -21 20 5
+
+62 -14 -11 -5
+63 -6 -11 -5
+64 -5 -10 -5
+65 -5 -8 -5
+66 -7 -7 -5
+67 -9 -5 -5
+68 -10 -3 -5
+69 -11 0 -5
+70 -11 5 -5
+71 -10 9 -5
+72 -8 10 -5
+73 -7 11 -5
+74 -5 10 -5
+75 -3 8 -5
+76 -2 5 -5
+77 -2 -3 -5
+78 -1 -6 -5
+79 0 -8 -5
+80 2 -10 -5
+81 5 -11 -5
+82 8 -11 -5
+83 10 -10 -5
+84 12 -8 -5
+85 14 -5 -5
+86 15 -1 -5
+87 15 4 -5
+88 14 8 -5
+89 14 9 -5
+90 15 11 -5
+91 15 12 -5
+92 13 14 -5
+93 6 14 -5
+94 5 13 -5
+95 5 11 -5
+96 8 8 -5
+97 10 5 -5
+98 11 2 -5
+99 11 -2 -5
+100 10 -4 -5
+101 8 -6 -5
+102 5 -6 -5
+103 4 -5 -5
+104 3 -3 -5
+105 3 0 -5
+106 2 8 -5
+107 1 12 -5
+108 -2 15 -5
+109 -6 16 -5
+110 -10 15 -5
+111 -13 13 -5
+112 -15 8 -5
+113 -15 0 -5
+114 -14 -6 -5
+115 -15 -8 -5
+116 -15 -10 -5
+
+117 -21 -16 -5
+118 -13 -16 -5
+119 -13 -14 -5
+120 -19 -14 -5
+121 -19 20 -5
+122 -21 20 -5
+
+WMCUBE_LINES
+
+1 2
+2 3
+3 4
+4 5
+5 6
+6 7
+7 8
+8 9
+9 10
+10 11
+11 12
+12 13
+13 14
+14 15
+15 16
+16 17
+17 18
+18 19
+19 20
+20 21
+21 22
+22 23
+23 24
+24 25
+25 26
+26 27
+52 53
+53 54
+54 55
+55 1
+
+56 57
+57 58
+58 59
+59 60
+60 61
+61 56
+
+62 63
+63 64
+64 65
+65 66
+66 67
+67 68
+68 69
+69 70
+70 71
+71 72
+72 73
+73 74
+74 75
+75 76
+76 77
+77 78
+78 79
+79 80
+80 81
+81 82
+82 83
+83 84
+84 85
+85 86
+86 87
+87 88
+88 89
+89 90
+90 91
+91 92
+92 93
+93 94
+94 95
+95 96
+96 97
+97 98
+98 99
+99 100
+100 101
+101 102
+102 103
+103 104
+104 105
+105 106
+106 107
+107 108
+108 109
+109 110
+110 111
+111 112
+112 113
+113 114
+114 115
+115 116
+116 1
+
+117 118
+118 119
+119 120
+120 121
+121 122
+122 117
+
diff --git a/wmcube/3D-objects/slackware3.wmc b/wmcube/3D-objects/slackware3.wmc
new file mode 100644
index 000000000000..287107b15faf
--- /dev/null
+++ b/wmcube/3D-objects/slackware3.wmc
@@ -0,0 +1,319 @@
+WMCUBE_COORDINATES
+
+1 -14 -11 5
+2 -6 -11 5
+3 -5 -10 5
+4 -5 -8 5
+5 -7 -7 5
+6 -9 -5 5
+7 -10 -3 5
+8 -11 0 5
+9 -11 5 5
+10 -10 9 5
+11 -8 10 5
+12 -7 11 5
+13 -5 10 5
+14 -3 8 5
+15 -2 5 5
+16 -2 -3 5
+17 -1 -6 5
+18 0 -8 5
+19 2 -10 5
+20 5 -11 5
+21 8 -11 5
+22 10 -10 5
+23 12 -8 5
+24 14 -5 5
+25 15 -1 5
+26 15 4 5
+27 14 8 5
+28 14 9 5
+29 15 11 5
+30 15 12 5
+31 13 14 5
+32 6 14 5
+33 5 13 5
+34 5 11 5
+35 8 8 5
+36 10 5 5
+37 11 2 5
+38 11 -2 5
+39 10 -4 5
+40 8 -6 5
+41 5 -6 5
+42 4 -5 5
+43 3 -3 5
+44 3 0 5
+45 2 8 5
+46 1 12 5
+47 -2 15 5
+48 -6 16 5
+49 -10 15 5
+50 -13 13 5
+51 -15 8 5
+52 -15 0 5
+53 -14 -6 5
+54 -15 -8 5
+55 -15 -10 5
+
+56 -21 -16 5
+57 -13 -16 5
+58 -13 -14 5
+59 -19 -14 5
+60 -19 20 5
+61 -21 20 5
+
+62 -14 -11 -5
+63 -6 -11 -5
+64 -5 -10 -5
+65 -5 -8 -5
+66 -7 -7 -5
+67 -9 -5 -5
+68 -10 -3 -5
+69 -11 0 -5
+70 -11 5 -5
+71 -10 9 -5
+72 -8 10 -5
+73 -7 11 -5
+74 -5 10 -5
+75 -3 8 -5
+76 -2 5 -5
+77 -2 -3 -5
+78 -1 -6 -5
+79 0 -8 -5
+80 2 -10 -5
+81 5 -11 -5
+82 8 -11 -5
+83 10 -10 -5
+84 12 -8 -5
+85 14 -5 -5
+86 15 -1 -5
+87 15 4 -5
+88 14 8 -5
+89 14 9 -5
+90 15 11 -5
+91 15 12 -5
+92 13 14 -5
+93 6 14 -5
+94 5 13 -5
+95 5 11 -5
+96 8 8 -5
+97 10 5 -5
+98 11 2 -5
+99 11 -2 -5
+100 10 -4 -5
+101 8 -6 -5
+102 5 -6 -5
+103 4 -5 -5
+104 3 -3 -5
+105 3 0 -5
+106 2 8 -5
+107 1 12 -5
+108 -2 15 -5
+109 -6 16 -5
+110 -10 15 -5
+111 -13 13 -5
+112 -15 8 -5
+113 -15 0 -5
+114 -14 -6 -5
+115 -15 -8 -5
+116 -15 -10 -5
+
+117 -21 -16 -5
+118 -13 -16 -5
+119 -13 -14 -5
+120 -19 -14 -5
+121 -19 20 -5
+122 -21 20 -5
+
+WMCUBE_LINES
+
+1 2
+2 3
+3 4
+4 5
+5 6
+6 7
+7 8
+8 9
+9 10
+10 11
+11 12
+12 13
+13 14
+14 15
+15 16
+16 17
+17 18
+18 19
+19 20
+20 21
+21 22
+22 23
+23 24
+24 25
+25 26
+26 27
+52 53
+53 54
+54 55
+55 1
+
+56 57
+57 58
+58 59
+59 60
+60 61
+61 56
+
+62 63
+63 64
+64 65
+65 66
+66 67
+67 68
+68 69
+69 70
+70 71
+71 72
+72 73
+73 74
+74 75
+75 76
+76 77
+77 78
+78 79
+79 80
+80 81
+81 82
+82 83
+83 84
+84 85
+85 86
+86 87
+87 88
+88 89
+89 90
+90 91
+91 92
+92 93
+93 94
+94 95
+95 96
+96 97
+97 98
+98 99
+99 100
+100 101
+101 102
+102 103
+103 104
+104 105
+105 106
+106 107
+107 108
+108 109
+109 110
+110 111
+111 112
+112 113
+113 114
+114 115
+115 116
+116 1
+
+117 118
+118 119
+119 120
+120 121
+121 122
+122 117
+
+1 62
+2 63
+3 64
+4 65
+5 66
+6 67
+7 68
+8 69
+9 70
+10 71
+11 72
+12 73
+13 74
+14 75
+15 76
+16 77
+17 78
+18 79
+19 80
+20 81
+21 82
+22 83
+23 84
+24 85
+25 86
+26 87
+27 88
+28 89
+29 90
+30 91
+31 92
+32 93
+33 94
+34 95
+35 96
+36 97
+37 98
+38 99
+39 100
+40 101
+41 102
+42 103
+43 104
+44 105
+45 106
+46 107
+47 108
+48 109
+49 110
+50 111
+51 112
+52 113
+53 114
+54 115
+55 116
+56 117
+
+57 118
+58 119
+59 120
+60 121
+61 122
+
diff --git a/wmcube/3D-objects/spaceshuttle.wmc b/wmcube/3D-objects/spaceshuttle.wmc
new file mode 100644
index 000000000000..fb4bc1518333
--- /dev/null
+++ b/wmcube/3D-objects/spaceshuttle.wmc
+105 -52 18 13
+10 9
+12 11
+13 12
+14 13
+15 14
+16 15
+18 17
+19 18
+20 19
+21 20
+22 21
+24 23
+25 24
+26 25
+27 26
+28 27
+30 29
+31 30
+32 31
+33 32
+34 33
+35 34
+36 35
+38 37
+39 38
+40 39
+41 40
+42 41
+43 42
+44 43
+46 45
+47 46
+48 47
+49 48
+51 50
+52 51
+53 52
+54 53
+56 55
+57 56
+59 58
+60 59
+62 61
+64 63
+66 65
+67 66
+69 68
+70 69
+72 71
+74 73
+75 74
+76 75
+77 76
+78 77
+80 79
+142 141
+144 143
+208 207
+210 209
+212 211
+214 213
+215 214
+216 215
+217 216
+219 218
+220 219
+221 220
\ No newline at end of file
diff --git a/wmcube/3D-objects/spiral.wmc b/wmcube/3D-objects/spiral.wmc
new file mode 100644
index 000000000000..0af2d4fb8d14
--- /dev/null
+++ b/wmcube/3D-objects/spiral.wmc
@@ -0,0 +1,49 @@
+WMCUBE_COORDINATES
+
+1 80 0 0
+2 0 -90 25
+3 -100 0 50
+4 0 110 75
+5 120 0 100
+6 0 -130 125
+7 -140 0 150
+8 0 150 175
+9 160 0 200
+10 0 70 -25
+11 -60 0 -50
+12 0 -50 -75
+13 40 0 -100
+14 0 30 -125
+15 -20 0 -150
+16 0 -10 -175
+17 0 0 -200
+18 0 -160 200
+19 -160 0 200
+20 0 160 200
+
+WMCUBE_LINES
+
+1 2
+2 3
+3 4
+4 5
+5 6
+6 7
+7 8
+8 9
+1 10
+10 11
+11 12
+12 13
+13 14
+14 15
+15 16
+16 17
+17 9
+17 18
+17 19
+17 20
+9 18
+18 19
+19 20
+20 9
diff --git a/wmcube/3D-objects/star.wmc b/wmcube/3D-objects/star.wmc
new file mode 100644
index 000000000000..1fd0b244a5e4
--- /dev/null
+++ b/wmcube/3D-objects/star.wmc
@@ -0,0 +1,95 @@
+WMCUBE_COORDINATES
+5 6
+6 7
+7 8
+8 5
+29 30
+30 31
+31 32
+32 29
+5 29
+6 30
+7 31
+8 32
+1 2
+2 3
+3 4
+4 1
diff --git a/wmcube/3D-objects/starcube.wmc b/wmcube/3D-objects/starcube.wmc
new file mode 100644
index 000000000000..a7bc2dfe501a
--- /dev/null
+++ b/wmcube/3D-objects/starcube.wmc
@@ -0,0 +1,69 @@
+WMCUBE_COORDINATES
+ 1 -100 -100 100
+ 2 100 -100 100
+ 3 100 100 100
+ 4 -100 100 100
+ 5 -100 -100 -100
+ 6 100 -100 -100
+ 7 100 100 -100
+ 8 -100 100 -100
+
+ 9 75 0 0
+ 10 0 75 0
+ 11 0 0 75
+ 12 -75 0 0
+ 13 0 -75 0
+ 14 0 0 -75
+
+ 15 -75 -75 75
+ 16 75 -75 75
+ 17 75 75 75
+ 18 -75 75 75
+ 19 -75 -75 -75
+ 20 75 -75 -75
+ 21 75 75 -75
+ 22 -75 75 -75
+
+ WMCUBE_LINES
+ 1 2
+ 2 3
+ 3 4
+ 4 1
+ 5 6
+ 6 7
+ 7 8
+ 8 5
+ 1 5
+ 2 6
+ 3 7
+ 4 8
+
+ 9 15
+ 9 18
+ 9 19
+ 9 22
+
+ 10 15
+ 10 16
+ 10 19
+ 10 20
+
+ 11 19
+ 11 20
+ 11 21
+ 11 22
+
+ 12 16
+ 12 17
+ 12 20
+ 12 21
+
+ 13 17
+ 13 18
+ 13 21
+ 13 22
+
+ 14 15
+ 14 16
+ 14 17
+ 14 18
diff --git a/wmcube/wmc/wmlogo.wmc b/wmcube/3D-objects/wmlogo.wmc
similarity index 92%
rename from wmcube/wmc/wmlogo.wmc
rename to wmcube/3D-objects/wmlogo.wmc
index 9378f68e75ad..8051cee32c57 100644
--- a/wmcube/wmc/wmlogo.wmc
+++ b/wmcube/3D-objects/wmlogo.wmc
@@ -1,5 +1,3 @@
-# By Rafael Garcia-Suarez <garcia...@kazibao.net>
-
WMCUBE_COORDINATES
1 30 -30 10
2 -30 -30 10
diff --git a/wmcube/CHANGES b/wmcube/CHANGES
index 730b2fae3e0d..63d172a0eaf9 100644
--- a/wmcube/CHANGES
+++ b/wmcube/CHANGES
@@ -1,54 +1,49 @@
-wmCube 0.99-pre1
- * Rewrite to C++ using the wmApp toolkit.
- - Full color depth
- - User definable for/background colors
- - User definable shading
- - New window layout added with cpu meter
- - Switch to classic (simple) layout with a mouseclick
- * Uses the CpuMonitorCC library (also in pre-stage)
- * Place lightsource with mouseclick or have it move around by itself
- * Solid wireframe mode added
- * "Reflex" effect
- * 3- and 5-button mouse (mouse wheel support)
- * wmc file format updates
- - Both planes and lines in the same file (preferably even)
- - No specific order of sections is required
- - Comments allowed (all lines starting with a #)
- - Should be fully backwards compatible
- * If no object(s) defined looks in /usr/share/wmcube
- * Rewritten scandir function to be POSIX compliant
+wmcube 1.0.0:
+ * Default color scheme changed to the gray one.
+ * Added red, green, and blue color schemes (you may combine them
+ in order to get cyan, magenta, and yellow ones).
+ * Added smooth font.
+ * Program installs the plugins in /usr/share/wmcube directory.
+ * Added the recognition of the plugins directory.
+ * Added three versions of Slackware Linux logo.
+ * Updated Makefiles.
+ * Updated the documentation.
+ * The name of the program changed from wmCube to wmcube.
+ * Licence changed to GNU GPL v. 3.
+ * The program since this version is maintained by Cezary M. Kruk.

-wmCube 0.98:
- * Added solid flat-shading to 3d-engine
- * New tag in object-files (WMCUBE_PLANES) for solid objects
+wmcube 0.98:
+ * Added solid flat-shading to 3d-engine.
+ * New tag in object-files (WMCUBE_PLANES) for solid objects.

wmCube 0.97:
- * NetBSD support
- * New improved automatic scaling of objects
- * Click cpu-load to hide/reveal usage
- * More bundled objects
- * Bugfixes in object-loading
- * Bugfixes in intro-sequence
- * Bugfixes in Linux SMP
- * Removed scanning directory for objects in Solaris (doesnt work)
+ * NetBSD support.
+ * New improved automatic scaling of objects.
+ * Click cpu-load to hide/reveal usage.
+ * More bundled objects.
+ * Bugfixes in object-loading.
+ * Bugfixes in intro-sequence.
+ * Bugfixes in Linux SMP.
+ * Removed scanning directory for objects in Solaris (doesnt work).

wmCube 0.96:
- * Solaris (Sparc/x86) support
- * OpenBSD support
- * FreeBSD support
- * More bundled objects
+ * Solaris (Sparc/x86) support.
+ * OpenBSD support.
+ * FreeBSD support.
+ * More bundled objects.
* Possibility to change object at run-time by clicking the app
- (Scans the specified directory for objects)
+ (Scans the specified directory for objects).

-wmCube 0.95:
- * You can now design and use other objects than the default cube
- * SMP-support: Commandline option to choose which cpu to monitor
+wmCube 0.95:
+ * You can now design and use other objects than the default cube.
+ * SMP-support: Commandline option to choose which cpu to monitor.
* Commandline option to leave out "nice" processes when calculating
- cpu-load (Thanks Thorsten Jens)
+ cpu-load (Thanks Thorsten Jens).
* Commandline option to invert the relationship between rotation-
- speed and cpu-load
- * Commandline option not to display cpu-load
- * Improvements in the cpu-load calculation (Thanks Jakob Borg)
+ speed and cpu-load.
+ * Commandline option not to display cpu-load.
+ * Improvements in the cpu-load calculation (Thanks Jakob Borg).
+
+wmCube 0.90:
+ * Initial release.

-wmCube 0.90:
- * Initial release
diff --git a/wmcube/COPYING b/wmcube/COPYING
new file mode 100644
index 000000000000..94a9ed024d38
--- /dev/null
+++ b/wmcube/COPYING
@@ -0,0 +1,674 @@
+ GNU GENERAL PUBLIC LICENSE
+ Version 3, 29 June 2007
+
+ Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+ Preamble
+
+ The GNU General Public License is a free, copyleft license for
+software and other kinds of works.
+
+ The licenses for most software and other practical works are designed
+to take away your freedom to share and change the works. By contrast,
+the GNU General Public License is intended to guarantee your freedom to
+share and change all versions of a program--to make sure it remains free
+software for all its users. We, the Free Software Foundation, use the
+GNU General Public License for most of our software; it applies also to
+any other work released this way by its authors. You can apply it to
+your programs, too.
+
+ When we speak of free software, we are referring to freedom, not
+price. Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+them if you wish), that you receive source code or can get it if you
+want it, that you can change the software or use pieces of it in new
+free programs, and that you know you can do these things.
+
+ To protect your rights, we need to prevent others from denying you
+these rights or asking you to surrender the rights. Therefore, you have
+certain responsibilities if you distribute copies of the software, or if
+you modify it: responsibilities to respect the freedom of others.
+
+ For example, if you distribute copies of such a program, whether
+gratis or for a fee, you must pass on to the recipients the same
+freedoms that you received. You must make sure that they, too, receive
+or can get the source code. And you must show them these terms so they
+know their rights.
+
+ Developers that use the GNU GPL protect your rights with two steps:
+(1) assert copyright on the software, and (2) offer you this License
+giving you legal permission to copy, distribute and/or modify it.
+
+ For the developers' and authors' protection, the GPL clearly explains
+that there is no warranty for this free software. For both users' and
+authors' sake, the GPL requires that modified versions be marked as
+changed, so that their problems will not be attributed erroneously to
+authors of previous versions.
+
+ Some devices are designed to deny users access to install or run
+modified versions of the software inside them, although the manufacturer
+can do so. This is fundamentally incompatible with the aim of
+protecting users' freedom to change the software. The systematic
+pattern of such abuse occurs in the area of products for individuals to
+use, which is precisely where it is most unacceptable. Therefore, we
+have designed this version of the GPL to prohibit the practice for those
+products. If such problems arise substantially in other domains, we
+stand ready to extend this provision to those domains in future versions
+of the GPL, as needed to protect the freedom of users.
+
+ Finally, every program is threatened constantly by software patents.
+States should not allow patents to restrict development and use of
+software on general-purpose computers, but in those that do, we wish to
+avoid the special danger that patents applied to a free program could
+make it effectively proprietary. To prevent this, the GPL assures that
+patents cannot be used to render the program non-free.
+
+ The precise terms and conditions for copying, distribution and
+modification follow.
+
+ TERMS AND CONDITIONS
+
+ 0. Definitions.
+
+ "This License" refers to version 3 of the GNU General Public License.
+
+ "Copyright" also means copyright-like laws that apply to other kinds of
+works, such as semiconductor masks.
+
+ "The Program" refers to any copyrightable work licensed under this
+License. Each licensee is addressed as "you". "Licensees" and
+"recipients" may be individuals or organizations.
+
+ To "modify" a work means to copy from or adapt all or part of the work
+in a fashion requiring copyright permission, other than the making of an
+exact copy. The resulting work is called a "modified version" of the
+earlier work or a work "based on" the earlier work.
+
+ A "covered work" means either the unmodified Program or a work based
+on the Program.
+
+ To "propagate" a work means to do anything with it that, without
+permission, would make you directly or secondarily liable for
+infringement under applicable copyright law, except executing it on a
+computer or modifying a private copy. Propagation includes copying,
+distribution (with or without modification), making available to the
+public, and in some countries other activities as well.
+
+ To "convey" a work means any kind of propagation that enables other
+parties to make or receive copies. Mere interaction with a user through
+a computer network, with no transfer of a copy, is not conveying.
+
+ An interactive user interface displays "Appropriate Legal Notices"
+to the extent that it includes a convenient and prominently visible
+feature that (1) displays an appropriate copyright notice, and (2)
+tells the user that there is no warranty for the work (except to the
+extent that warranties are provided), that licensees may convey the
+work under this License, and how to view a copy of this License. If
+the interface presents a list of user commands or options, such as a
+menu, a prominent item in the list meets this criterion.
+
+ 1. Source Code.
+
+ The "source code" for a work means the preferred form of the work
+for making modifications to it. "Object code" means any non-source
+form of a work.
+
+ A "Standard Interface" means an interface that either is an official
+standard defined by a recognized standards body, or, in the case of
+interfaces specified for a particular programming language, one that
+is widely used among developers working in that language.
+
+ The "System Libraries" of an executable work include anything, other
+than the work as a whole, that (a) is included in the normal form of
+packaging a Major Component, but which is not part of that Major
+Component, and (b) serves only to enable use of the work with that
+Major Component, or to implement a Standard Interface for which an
+implementation is available to the public in source code form. A
+"Major Component", in this context, means a major essential component
+(kernel, window system, and so on) of the specific operating system
+(if any) on which the executable work runs, or a compiler used to
+produce the work, or an object code interpreter used to run it.
+
+ The "Corresponding Source" for a work in object code form means all
+the source code needed to generate, install, and (for an executable
+work) run the object code and to modify the work, including scripts to
+control those activities. However, it does not include the work's
+System Libraries, or general-purpose tools or generally available free
+programs which are used unmodified in performing those activities but
+which are not part of the work. For example, Corresponding Source
+includes interface definition files associated with source files for
+the work, and the source code for shared libraries and dynamically
+linked subprograms that the work is specifically designed to require,
+such as by intimate data communication or control flow between those
+subprograms and other parts of the work.
+
+ The Corresponding Source need not include anything that users
+can regenerate automatically from other parts of the Corresponding
+Source.
+
+ The Corresponding Source for a work in source code form is that
+same work.
+
+ 2. Basic Permissions.
+
+ All rights granted under this License are granted for the term of
+copyright on the Program, and are irrevocable provided the stated
+conditions are met. This License explicitly affirms your unlimited
+permission to run the unmodified Program. The output from running a
+covered work is covered by this License only if the output, given its
+content, constitutes a covered work. This License acknowledges your
+rights of fair use or other equivalent, as provided by copyright law.
+
+ You may make, run and propagate covered works that you do not
+convey, without conditions so long as your license otherwise remains
+in force. You may convey covered works to others for the sole purpose
+of having them make modifications exclusively for you, or provide you
+with facilities for running those works, provided that you comply with
+the terms of this License in conveying all material for which you do
+not control copyright. Those thus making or running the covered works
+for you must do so exclusively on your behalf, under your direction
+and control, on terms that prohibit them from making any copies of
+your copyrighted material outside their relationship with you.
+
+ Conveying under any other circumstances is permitted solely under
+the conditions stated below. Sublicensing is not allowed; section 10
+makes it unnecessary.
+
+ 3. Protecting Users' Legal Rights From Anti-Circumvention Law.
+
+ No covered work shall be deemed part of an effective technological
+measure under any applicable law fulfilling obligations under article
+11 of the WIPO copyright treaty adopted on 20 December 1996, or
+similar laws prohibiting or restricting circumvention of such
+measures.
+
+ When you convey a covered work, you waive any legal power to forbid
+circumvention of technological measures to the extent such circumvention
+is effected by exercising rights under this License with respect to
+the covered work, and you disclaim any intention to limit operation or
+modification of the work as a means of enforcing, against the work's
+users, your or third parties' legal rights to forbid circumvention of
+technological measures.
+
+ 4. Conveying Verbatim Copies.
+
+ You may convey verbatim copies of the Program's source code as you
+receive it, in any medium, provided that you conspicuously and
+appropriately publish on each copy an appropriate copyright notice;
+keep intact all notices stating that this License and any
+non-permissive terms added in accord with section 7 apply to the code;
+keep intact all notices of the absence of any warranty; and give all
+recipients a copy of this License along with the Program.
+
+ You may charge any price or no price for each copy that you convey,
+and you may offer support or warranty protection for a fee.
+
+ 5. Conveying Modified Source Versions.
+
+ You may convey a work based on the Program, or the modifications to
+produce it from the Program, in the form of source code under the
+terms of section 4, provided that you also meet all of these conditions:
+
+ a) The work must carry prominent notices stating that you modified
+ it, and giving a relevant date.
+
+ b) The work must carry prominent notices stating that it is
+ released under this License and any conditions added under section
+ 7. This requirement modifies the requirement in section 4 to
+ "keep intact all notices".
+
+ c) You must license the entire work, as a whole, under this
+ License to anyone who comes into possession of a copy. This
+ License will therefore apply, along with any applicable section 7
+ additional terms, to the whole of the work, and all its parts,
+ regardless of how they are packaged. This License gives no
+ permission to license the work in any other way, but it does not
+ invalidate such permission if you have separately received it.
+
+ d) If the work has interactive user interfaces, each must display
+ Appropriate Legal Notices; however, if the Program has interactive
+ interfaces that do not display Appropriate Legal Notices, your
+ work need not make them do so.
+
+ A compilation of a covered work with other separate and independent
+works, which are not by their nature extensions of the covered work,
+and which are not combined with it such as to form a larger program,
+in or on a volume of a storage or distribution medium, is called an
+"aggregate" if the compilation and its resulting copyright are not
+used to limit the access or legal rights of the compilation's users
+beyond what the individual works permit. Inclusion of a covered work
+in an aggregate does not cause this License to apply to the other
+parts of the aggregate.
+
+ 6. Conveying Non-Source Forms.
+
+ You may convey a covered work in object code form under the terms
+of sections 4 and 5, provided that you also convey the
+machine-readable Corresponding Source under the terms of this License,
+in one of these ways:
+
+ a) Convey the object code in, or embodied in, a physical product
+ (including a physical distribution medium), accompanied by the
+ Corresponding Source fixed on a durable physical medium
+ customarily used for software interchange.
+
+ b) Convey the object code in, or embodied in, a physical product
+ (including a physical distribution medium), accompanied by a
+ written offer, valid for at least three years and valid for as
+ long as you offer spare parts or customer support for that product
+ model, to give anyone who possesses the object code either (1) a
+ copy of the Corresponding Source for all the software in the
+ product that is covered by this License, on a durable physical
+ medium customarily used for software interchange, for a price no
+ more than your reasonable cost of physically performing this
+ conveying of source, or (2) access to copy the
+ Corresponding Source from a network server at no charge.
+
+ c) Convey individual copies of the object code with a copy of the
+ written offer to provide the Corresponding Source. This
+ alternative is allowed only occasionally and noncommercially, and
+ only if you received the object code with such an offer, in accord
+ with subsection 6b.
+
+ d) Convey the object code by offering access from a designated
+ place (gratis or for a charge), and offer equivalent access to the
+ Corresponding Source in the same way through the same place at no
+ further charge. You need not require recipients to copy the
+ Corresponding Source along with the object code. If the place to
+ copy the object code is a network server, the Corresponding Source
+ may be on a different server (operated by you or a third party)
+ that supports equivalent copying facilities, provided you maintain
+ clear directions next to the object code saying where to find the
+ Corresponding Source. Regardless of what server hosts the
+ Corresponding Source, you remain obligated to ensure that it is
+ available for as long as needed to satisfy these requirements.
+
+ e) Convey the object code using peer-to-peer transmission, provided
+ you inform other peers where the object code and Corresponding
+ Source of the work are being offered to the general public at no
+ charge under subsection 6d.
+
+ A separable portion of the object code, whose source code is excluded
+from the Corresponding Source as a System Library, need not be
+included in conveying the object code work.
+
+ A "User Product" is either (1) a "consumer product", which means any
+tangible personal property which is normally used for personal, family,
+or household purposes, or (2) anything designed or sold for incorporation
+into a dwelling. In determining whether a product is a consumer product,
+doubtful cases shall be resolved in favor of coverage. For a particular
+product received by a particular user, "normally used" refers to a
+typical or common use of that class of product, regardless of the status
+of the particular user or of the way in which the particular user
+actually uses, or expects or is expected to use, the product. A product
+is a consumer product regardless of whether the product has substantial
+commercial, industrial or non-consumer uses, unless such uses represent
+the only significant mode of use of the product.
+
+ "Installation Information" for a User Product means any methods,
+procedures, authorization keys, or other information required to install
+and execute modified versions of a covered work in that User Product from
+a modified version of its Corresponding Source. The information must
+suffice to ensure that the continued functioning of the modified object
+code is in no case prevented or interfered with solely because
+modification has been made.
+
+ If you convey an object code work under this section in, or with, or
+specifically for use in, a User Product, and the conveying occurs as
+part of a transaction in which the right of possession and use of the
+User Product is transferred to the recipient in perpetuity or for a
+fixed term (regardless of how the transaction is characterized), the
+Corresponding Source conveyed under this section must be accompanied
+by the Installation Information. But this requirement does not apply
+if neither you nor any third party retains the ability to install
+modified object code on the User Product (for example, the work has
+been installed in ROM).
+
+ The requirement to provide Installation Information does not include a
+requirement to continue to provide support service, warranty, or updates
+for a work that has been modified or installed by the recipient, or for
+the User Product in which it has been modified or installed. Access to a
+network may be denied when the modification itself materially and
+adversely affects the operation of the network or violates the rules and
+protocols for communication across the network.
+
+ Corresponding Source conveyed, and Installation Information provided,
+in accord with this section must be in a format that is publicly
+documented (and with an implementation available to the public in
+source code form), and must require no special password or key for
+unpacking, reading or copying.
+
+ 7. Additional Terms.
+
+ "Additional permissions" are terms that supplement the terms of this
+License by making exceptions from one or more of its conditions.
+Additional permissions that are applicable to the entire Program shall
+be treated as though they were included in this License, to the extent
+that they are valid under applicable law. If additional permissions
+apply only to part of the Program, that part may be used separately
+under those permissions, but the entire Program remains governed by
+this License without regard to the additional permissions.
+
+ When you convey a copy of a covered work, you may at your option
+remove any additional permissions from that copy, or from any part of
+it. (Additional permissions may be written to require their own
+removal in certain cases when you modify the work.) You may place
+additional permissions on material, added by you to a covered work,
+for which you have or can give appropriate copyright permission.
+
+ Notwithstanding any other provision of this License, for material you
+add to a covered work, you may (if authorized by the copyright holders of
+that material) supplement the terms of this License with terms:
+
+ a) Disclaiming warranty or limiting liability differently from the
+ terms of sections 15 and 16 of this License; or
+
+ b) Requiring preservation of specified reasonable legal notices or
+ author attributions in that material or in the Appropriate Legal
+ Notices displayed by works containing it; or
+
+ c) Prohibiting misrepresentation of the origin of that material, or
+ requiring that modified versions of such material be marked in
+ reasonable ways as different from the original version; or
+
+ d) Limiting the use for publicity purposes of names of licensors or
+ authors of the material; or
+
+ e) Declining to grant rights under trademark law for use of some
+ trade names, trademarks, or service marks; or
+
+ f) Requiring indemnification of licensors and authors of that
+ material by anyone who conveys the material (or modified versions of
+ it) with contractual assumptions of liability to the recipient, for
+ any liability that these contractual assumptions directly impose on
+ those licensors and authors.
+
+ All other non-permissive additional terms are considered "further
+restrictions" within the meaning of section 10. If the Program as you
+received it, or any part of it, contains a notice stating that it is
+governed by this License along with a term that is a further
+restriction, you may remove that term. If a license document contains
+a further restriction but permits relicensing or conveying under this
+License, you may add to a covered work material governed by the terms
+of that license document, provided that the further restriction does
+not survive such relicensing or conveying.
+
+ If you add terms to a covered work in accord with this section, you
+must place, in the relevant source files, a statement of the
+additional terms that apply to those files, or a notice indicating
+where to find the applicable terms.
+
+ Additional terms, permissive or non-permissive, may be stated in the
+form of a separately written license, or stated as exceptions;
+the above requirements apply either way.
+
+ 8. Termination.
+
+ You may not propagate or modify a covered work except as expressly
+provided under this License. Any attempt otherwise to propagate or
+modify it is void, and will automatically terminate your rights under
+this License (including any patent licenses granted under the third
+paragraph of section 11).
+
+ However, if you cease all violation of this License, then your
+license from a particular copyright holder is reinstated (a)
+provisionally, unless and until the copyright holder explicitly and
+finally terminates your license, and (b) permanently, if the copyright
+holder fails to notify you of the violation by some reasonable means
+prior to 60 days after the cessation.
+
+ Moreover, your license from a particular copyright holder is
+reinstated permanently if the copyright holder notifies you of the
+violation by some reasonable means, this is the first time you have
+received notice of violation of this License (for any work) from that
+copyright holder, and you cure the violation prior to 30 days after
+your receipt of the notice.
+
+ Termination of your rights under this section does not terminate the
+licenses of parties who have received copies or rights from you under
+this License. If your rights have been terminated and not permanently
+reinstated, you do not qualify to receive new licenses for the same
+material under section 10.
+
+ 9. Acceptance Not Required for Having Copies.
+
+ You are not required to accept this License in order to receive or
+run a copy of the Program. Ancillary propagation of a covered work
+occurring solely as a consequence of using peer-to-peer transmission
+to receive a copy likewise does not require acceptance. However,
+nothing other than this License grants you permission to propagate or
+modify any covered work. These actions infringe copyright if you do
+not accept this License. Therefore, by modifying or propagating a
+covered work, you indicate your acceptance of this License to do so.
+
+ 10. Automatic Licensing of Downstream Recipients.
+
+ Each time you convey a covered work, the recipient automatically
+receives a license from the original licensors, to run, modify and
+propagate that work, subject to this License. You are not responsible
+for enforcing compliance by third parties with this License.
+
+ An "entity transaction" is a transaction transferring control of an
+organization, or substantially all assets of one, or subdividing an
+organization, or merging organizations. If propagation of a covered
+work results from an entity transaction, each party to that
+transaction who receives a copy of the work also receives whatever
+licenses to the work the party's predecessor in interest had or could
+give under the previous paragraph, plus a right to possession of the
+Corresponding Source of the work from the predecessor in interest, if
+the predecessor has it or can get it with reasonable efforts.
+
+ You may not impose any further restrictions on the exercise of the
+rights granted or affirmed under this License. For example, you may
+not impose a license fee, royalty, or other charge for exercise of
+rights granted under this License, and you may not initiate litigation
+(including a cross-claim or counterclaim in a lawsuit) alleging that
+any patent claim is infringed by making, using, selling, offering for
+sale, or importing the Program or any portion of it.
+
+ 11. Patents.
+
+ A "contributor" is a copyright holder who authorizes use under this
+License of the Program or a work on which the Program is based. The
+work thus licensed is called the contributor's "contributor version".
+
+ A contributor's "essential patent claims" are all patent claims
+owned or controlled by the contributor, whether already acquired or
+hereafter acquired, that would be infringed by some manner, permitted
+by this License, of making, using, or selling its contributor version,
+but do not include claims that would be infringed only as a
+consequence of further modification of the contributor version. For
+purposes of this definition, "control" includes the right to grant
+patent sublicenses in a manner consistent with the requirements of
+this License.
+
+ Each contributor grants you a non-exclusive, worldwide, royalty-free
+patent license under the contributor's essential patent claims, to
+make, use, sell, offer for sale, import and otherwise run, modify and
+propagate the contents of its contributor version.
+
+ In the following three paragraphs, a "patent license" is any express
+agreement or commitment, however denominated, not to enforce a patent
+(such as an express permission to practice a patent or covenant not to
+sue for patent infringement). To "grant" such a patent license to a
+party means to make such an agreement or commitment not to enforce a
+patent against the party.
+
+ If you convey a covered work, knowingly relying on a patent license,
+and the Corresponding Source of the work is not available for anyone
+to copy, free of charge and under the terms of this License, through a
+publicly available network server or other readily accessible means,
+then you must either (1) cause the Corresponding Source to be so
+available, or (2) arrange to deprive yourself of the benefit of the
+patent license for this particular work, or (3) arrange, in a manner
+consistent with the requirements of this License, to extend the patent
+license to downstream recipients. "Knowingly relying" means you have
+actual knowledge that, but for the patent license, your conveying the
+covered work in a country, or your recipient's use of the covered work
+in a country, would infringe one or more identifiable patents in that
+country that you have reason to believe are valid.
+
+ If, pursuant to or in connection with a single transaction or
+arrangement, you convey, or propagate by procuring conveyance of, a
+covered work, and grant a patent license to some of the parties
+receiving the covered work authorizing them to use, propagate, modify
+or convey a specific copy of the covered work, then the patent license
+you grant is automatically extended to all recipients of the covered
+work and works based on it.
+
+ A patent license is "discriminatory" if it does not include within
+the scope of its coverage, prohibits the exercise of, or is
+conditioned on the non-exercise of one or more of the rights that are
+specifically granted under this License. You may not convey a covered
+work if you are a party to an arrangement with a third party that is
+in the business of distributing software, under which you make payment
+to the third party based on the extent of your activity of conveying
+the work, and under which the third party grants, to any of the
+parties who would receive the covered work from you, a discriminatory
+patent license (a) in connection with copies of the covered work
+conveyed by you (or copies made from those copies), or (b) primarily
+for and in connection with specific products or compilations that
+contain the covered work, unless you entered into that arrangement,
+or that patent license was granted, prior to 28 March 2007.
+
+ Nothing in this License shall be construed as excluding or limiting
+any implied license or other defenses to infringement that may
+otherwise be available to you under applicable patent law.
+
+ 12. No Surrender of Others' Freedom.
+
+ If conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License. If you cannot convey a
+covered work so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you may
+not convey it at all. For example, if you agree to terms that obligate you
+to collect a royalty for further conveying from those to whom you convey
+the Program, the only way you could satisfy both those terms and this
+License would be to refrain entirely from conveying the Program.
+
+ 13. Use with the GNU Affero General Public License.
+
+ Notwithstanding any other provision of this License, you have
+permission to link or combine any covered work with a work licensed
+under version 3 of the GNU Affero General Public License into a single
+combined work, and to convey the resulting work. The terms of this
+License will continue to apply to the part which is the covered work,
+but the special requirements of the GNU Affero General Public License,
+section 13, concerning interaction through a network will apply to the
+combination as such.
+
+ 14. Revised Versions of this License.
+
+ The Free Software Foundation may publish revised and/or new versions of
+the GNU General Public License from time to time. Such new versions will
+be similar in spirit to the present version, but may differ in detail to
+address new problems or concerns.
+
+ Each version is given a distinguishing version number. If the
+Program specifies that a certain numbered version of the GNU General
+Public License "or any later version" applies to it, you have the
+option of following the terms and conditions either of that numbered
+version or of any later version published by the Free Software
+Foundation. If the Program does not specify a version number of the
+GNU General Public License, you may choose any version ever published
+by the Free Software Foundation.
+
+ If the Program specifies that a proxy can decide which future
+versions of the GNU General Public License can be used, that proxy's
+public statement of acceptance of a version permanently authorizes you
+to choose that version for the Program.
+
+ Later license versions may give you additional or different
+permissions. However, no additional obligations are imposed on any
+author or copyright holder as a result of your choosing to follow a
+later version.
+
+ 15. Disclaimer of Warranty.
+
+ THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
+APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
+HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
+OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
+THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
+IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
+ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
+
+ 16. Limitation of Liability.
+
+ IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
+THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
+GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
+USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
+DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
+PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
+EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
+SUCH DAMAGES.
+
+ 17. Interpretation of Sections 15 and 16.
+
+ If the disclaimer of warranty and limitation of liability provided
+above cannot be given local legal effect according to their terms,
+reviewing courts shall apply local law that most closely approximates
+an absolute waiver of all civil liability in connection with the
+Program, unless a warranty or assumption of liability accompanies a
+copy of the Program in return for a fee.
+
+ END OF TERMS AND CONDITIONS
+
+ How to Apply These Terms to Your New Programs
+
+ If you develop a new program, and you want it to be of the greatest
+possible use to the public, the best way to achieve this is to make it
+free software which everyone can redistribute and change under these terms.
+
+ To do so, attach the following notices to the program. It is safest
+to attach them to the start of each source file to most effectively
+state the exclusion of warranty; and each file should have at least
+the "copyright" line and a pointer to where the full notice is found.
+
+ <one line to give the program's name and a brief idea of what it does.>
+ Copyright (C) <year> <name of author>
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+Also add information on how to contact you by electronic and paper mail.
+
+ If the program does terminal interaction, make it output a short
+notice like this when it starts in an interactive mode:
+
+ <program> Copyright (C) <year> <name of author>
+ This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
+ This is free software, and you are welcome to redistribute it
+ under certain conditions; type `show c' for details.
+
+The hypothetical commands `show w' and `show c' should show the appropriate
+parts of the General Public License. Of course, your program's commands
+might be different; for a GUI interface, you would use an "about box".
+
+ You should also get your employer (if you work as a programmer) or school,
+if any, to sign a "copyright disclaimer" for the program, if necessary.
+For more information on this, and how to apply and follow the GNU GPL, see
+<http://www.gnu.org/licenses/>.
+
+ The GNU General Public License does not permit incorporating your program
+into proprietary programs. If your program is a subroutine library, you
+may consider it more useful to permit linking proprietary applications with
+the library. If this is what you want to do, use the GNU Lesser General
+Public License instead of this License. But first, please read
+<http://www.gnu.org/philosophy/why-not-lgpl.html>.
diff --git a/wmcube/INSTALL b/wmcube/INSTALL
new file mode 100644
index 000000000000..cef21b973404
--- /dev/null
+++ b/wmcube/INSTALL
@@ -0,0 +1,31 @@
+Requirements
+--------------------------------------------------------------
+
+- Linux (glibc at least 2.1) tested on various distributions
+ or Solaris 8 Sparc/x86 (should work on Solaris 2.x and 7),
+ or OpenBSD,
+ or FreeBSD 3-stable, 4-stable,
+ or NetBSD
+
+- root access
+
+ To be able to install the application system-wide you need
+ the root access.
+
+Installation
+--------------------------------------------------------------
+1) $ tar -zxf wmcube-1.0.0.tar.gz
+
+2) $ cd wmcube-1.0.0/wmcube
+
+3) $ make # if you run Linux
+ $ make -f Makefile.XXX # for XXX OS running
+
+Optional:
+
+4) $ su -
+
+5) # make install
+
+6) # exit
+
diff --git a/wmcube/Makefile b/wmcube/Makefile
deleted file mode 100644
index ba39bd903e0d..000000000000
--- a/wmcube/Makefile
+++ /dev/null
@@ -1,58 +0,0 @@
-#
-# wmCube 0.99-pre1
-#
-# To make wmcube compile on another OS change the following things:
-#
-# CXXFLAGS -D: FREEBSD/NETBSD/SOLARIS/OPENBSD/DARWIN
-# CPUMONCC_OS: freebsd/netbsd/solaris/openbsd/darwin (you will also have
-# to make sure that the makefile in the cpumoncc/$(CPUMONCC_OS) directory
-# is working.
-# LFLAGS: Modify/Add any necessary libraries here.
-#
-#
-CXX= g++
-CXXFLAGS=-O2 -DLINUX
-CPUMONCC_OS=linux
-WMCUBE_LIBS=-Lwmapp -lwmapp -Lcpumoncc/$(CPUMONCC_OS) -lcpumoncc
-LFLAGS=$(WMCUBE_LIBS) -L/usr/X11R6/lib -lXpm -lXext -lX11
-OBJECTS = WmcObject.o
-TARGET = wmcube
-
-$(TARGET): wmcube.cc cpumoncc/$(CPUMONCC_OS)/libcpumoncc.a wmapp/libwmapp.a $(OBJECTS)
- @@echo "###############################################################"
- @@echo "#"
- @@echo "# I am now building the actual wmCube application."
- @@echo "#"
- @@echo "###############################################################"
- $(CXX) $(CXXFLAGS) $(OBJECTS) $< -o $@ $(LFLAGS)
-
-cpumoncc/$(CPUMONCC_OS)/libcpumoncc.a:
- @@echo "###############################################################"
- @@echo "# I am now building the cpumoncc library in 'cpumoncc/$(CPUMONCC_OS)'."
- @@echo "# Please modify/verify the makefile in that directory before"
- @@echo "# reporting an error as a bug."
- @@echo "###############################################################"
- cd cpumoncc/$(CPUMONCC_OS); make; cd ../..
-
-wmapp/libwmapp.a:
- @@echo "###############################################################"
- @@echo "# I am now building the wmapp library in 'wmapp'"
- @@echo "# Please modify/verify the makefile in that directory before"
- @@echo "# reporting an error as a bug."
- @@echo "###############################################################"
- cd wmapp; make; cd ..
-
-install: $(TARGET)
- cp -Rf wmc /usr/share/wmcube
- cp wmcube /usr/local/bin
- chmod 755 /usr/local/bin/wmcube
- chown root:root /usr/local/bin/wmcube
-
-clean:
- rm -f *.o *\~ $(TARGET)
- cd wmapp; make clean; cd ..
- cd cpumoncc/$(CPUMONCC_OS); make clean; cd ../..
-
-install_clean:
- rm -fr /usr/share/wmcube
- rm /usr/local/bin/wmcube
diff --git a/wmcube/README b/wmcube/README
index 18affb7d7b30..44ddcf0cc383 100644
--- a/wmcube/README
+++ b/wmcube/README
@@ -1,83 +1,84 @@
-wmCube 0.99-pre1
-(C) Copyright 2003 Robert Kling
-robk...@student.luth.se
-http://kling.mine.nu/wmcube.htm
-
-DESCRIPTION
-wmCube is a dockapp for monitoring the cpu load. A 3D object spins
-faster/slower relative to the load and you can even design your own
-objects for it. Objects can be traditional wireframe or solid shaded or
-a combination of the two.
-
-REQUIREMENTS
-wmCube uses the CpuMonitorCC (cpumoncc) library (spawned from
-previous versions of wmCube) to read the cpu load which supports a
-range of different operating systems. Further, the wmApp toolkit is
-used to do the drawing to the X server. Both cpumoncc and wmApp
-are included in the distribution, versions 0.0.1-pre1 and 0.0.4.1
-respectively.
-
-INSTALL
-THIS PRE-VERSION ONLY WORKS ON LINUX! Please report
-all bugs. Note though that wmCube _should_ compile on all archs
-supported in earlier versions by simply editing the Makefile for
-the particular OS in the cpumoncc directory as well as copying
-and modifying the main makefile. IF YOU GET WMCUBE
-WORKING IN ANOTHER OS THAN LINUX, PLEASE SEND
-ME THE SUCCESSFUL MAKEFILES OR A PATCH! (sorry
-for the shouting)
-
-To install wmCube:
-
-# make
-
-then as root
-
-# make install
-
-This will install wmc-objects into /usr/share/wmcube
-and the binary into /usr/local/bin.
-
-Alternatively you can run wmcube with '-o <directory>' which will
-load objects from the <directory>. More objects will
-be bundled in the stable release.
-
-USAGE
-
-# wmcube -h
-
-will give you a list of all availible command line options. When
-running you control the program by clicking with your mouse on the
-canvas where the object is displayed.
-
-For a 3-button mouse:
-
-First mouse button (left):
- Upper left corner: Switches between new and classic window mode.
- Left hand side: Zoom away from the object.
- Right hand side: Zoom in on the object.
- Upper edge: Scroll in the next object from below.
- Lower edge: Scroll in the previous object from above.
- In the middle (approx): Change 3d mode on object.
-
-Second mouse button (middle button):
- Changes 3d mode on object.
-
-Third mouse button (right):
- Sets the position of the lightsource.
-
-For a 5-button mouse (mouse wheel):
-Exactly the same as 3-button mouse except
-that you can also zoom in/out with the wheel
-(button 4 and 5).
-
-CONTRIBUTIONS
-I only test wmCube thoroughly on Linux so anyone running on a
-different OS/architecture please let me now if there are any bugs.
-Suggestions, patches etc. are also very welcome. If you package
-wmCube for a certain distribution/OS and it is not represented on
-this page feel free to send it to me. You can also send me new
-objects (if they're cool) and I will include them in the next release
-alt. put them up on this page. Make sure to put a comment
-(new in 0.99) with your name etc in the wmc-file if you want credit
-for them.
\ No newline at end of file
+wmcube 1.0.0
+---------------------------------------------------------------
+Author: Cezary M. Kruk
+ c.k...@bigfoot.com
+ http://linux-bsd-unix.strefa.pl
+
+wmCube 0.98
+---------------------------------------------------------------
+Contributors:
+ Thorsten Jens (th...@et-inf.fho-emden.de)
+ Jakob Borg (email-adress goes here)
+ Dan Price (d...@rampant.org)
+ Brian Joseph Czapiga (r...@godsey.net)
+ Tai-hwa Liang (ava...@mmlab.cse.yzu.edu.tw)
+ Jared Smolens (jsmo...@andrew.cmu.edu)
+
+Description
+---------------------------------------------------------------
+wmcube is a dockapp displaying a realtime rotating 3D object
+(plugin) together with the current CPU load. The speed of the
+rotation depends on the CPU load.
+
+Commands
+---------------------------------------------------------------
+Display help:
+
+ $ wmcube -h
+
+Run cube.wmc plugin from the current or default directory:
+
+ $ wmcube -o cube.wmc &
+
+Run random plugin from the default directory:
+
+ $ wmcube &
+
+Run random plugin from the current directory:
+
+ $ wmcube -o . &
+
+Run sample.wmc plugin from the selected directory:
+
+ $ wmcube -o ~/myplugins/sample.wmc &
+
+(The default directory is set to /usr/share/wmcube).
+
+Mouse actions
+---------------------------------------------------------------
+Display the next plugin (works with the directories including
+the plugins):
+
+ click the center of the dockapp
+
+Zoom the plugin out or in:
+
+ click - or +
+
+Hide or show CPU usage:
+
+ click XX%
+
+Files
+---------------------------------------------------------------
+3D-objects 3D object files (plugins)
+COPYING GNU General Public License Version 3
+CHANGES Description of the changes
+INSTALL Installation instructions
+README This file
+
+Bugs
+---------------------------------------------------------------
+If you discover any bugs in this software, please send a
+bugreport to c.k...@bigfoot.com and describe the problem as
+detailed as you can.
+
+Copyright
+---------------------------------------------------------------
+wmcube (C) 2014 by Cezary M. Kruk, Wrocław, Poland
+wmCube (C) 2000-2001 by Robert Kling, Lulea, Sweden
+
diff --git a/wmcube/WmcObject.cc b/wmcube/WmcObject.cc
deleted file mode 100644
index e5c5a0f9f8e2..000000000000
--- a/wmcube/WmcObject.cc
+++ /dev/null
@@ -1,619 +0,0 @@
-#include <stdlib.h>
-#include <string.h>
-#include <math.h>
-#include <iostream>
-#include <stdexcept>
-#include <vector>
-#include "wmapp/wmcanvas.h"
-#include "WmcObject.h"
-
-using namespace std;
-
-#define DEBUG 0
-#define PDEBUG() if (DEBUG)
-
-#define CHECK(a, b, c) (((b) < (a)) || ((b) > (c))) ? true : false
-#define ROUND(a) ((a) - floor((a)) >= 0.5) ? (int)ceil((a)) : (int)floor((a))
-#define PI 3.14159265368979
-#define PI2 6.283185307
-#define invPI 0.318309885
-#define WMC_COMMENT_CHAR '#'
-#define VERTEX_SCALE 200.0
-
-/**********************************
- Color related stuff
-*/
-
-#define REFLEX 0.04 // Do the reflexy thing if the shading is less than this
-#define REFLEX_COLOR 0xAACEEE
-#define WIRE_COLOR 0x20B2AE
-#define CYAN 0x20B2AE
-#define SHADING 90.0
-
-/*******************************************************************
-
- WmcObject::WmcObject()
-
- Creates a new (default)
-
-********************************************************************/
-WmcObject::WmcObject()
-{
- const char *filename = { "/tmp/default_cube.wmc" };
- FILE *fp = fopen(filename, "w");
- fwrite(default_cube, sizeof(unsigned char), strlen(default_cube), fp);
- fclose(fp);
-
- load(filename);
-
- lightsource.x = 0;
- lightsource.y = -1;
- lightsource.z = 1;
-
- xoff = 26;
- yoff = 20;
- zoff = 3000;
-
- color = CYAN;
- shading = SHADING / 100.0;
-}
-
-/*******************************************************************
-
- WmcObject::WmcObject(const char *filename)
-
-********************************************************************/
-WmcObject::WmcObject(const char *filename)
-{
- load(filename);
-
- lightsource.x = 0;
- lightsource.y = -1;
- lightsource.z = 1;
-
- xoff = 26;
- yoff = 20;
- zoff = 3000;
-
- color = CYAN;
- shading = SHADING / 100.0;
-}
-
-/*******************************************************************
-
- WmcObject::~WmcObject()
-
-********************************************************************/
-WmcObject::~WmcObject()
-{
-}
-
-void WmcObject::setColorShading(unsigned icolor, float ishading)
-{
- color = icolor;
- shading = ishading / 100.0;;
-}
-
-void WmcObject::setMode(int m)
-{
- PDEBUG() printf("setting mode %d\n", m);
- switch (m)
- {
- case WIREFRAME:
- PDEBUG() printf("setting wireframe mode\n", m);
- if (lines) mode = WIREFRAME;
- break;
- case SOLID:
- PDEBUG() printf("setting solid mode\n", m);
- if (planes) mode = SOLID;
- break;
- case SOLID_WIRE:
- PDEBUG() printf("setting solid wire mode\n", m);
- if (planes && lines) mode = SOLID_WIRE;
- break;
- default:
- break;
- }
-}
-
-void WmcObject::setYOffset(int pixels)
-{
- yoff = pixels;
-}
-
-void WmcObject::modifyZOffset(int idepth)
-{
- if (zoff + idepth >= 2 * VERTEX_SCALE)
- zoff += idepth;
-}
-
-void WmcObject::setLightSource(float xc, float yc, float zc)
-{
- lightsource.x = xc;
- lightsource.y = yc;
- lightsource.z = zc;
-}
-
-
-/*******************************************************************
-
- int WmcObject::freadline(FILE *fp, int maxlen, char *dest)
-
- Reads a line of chars of maximum 'maxlen' length from file 'fp'
- into buffer 'dest'. Discards comments (returns length 0) otherwise
- return the true length of the row.
-
-********************************************************************/
-int WmcObject::freadline(FILE *fp, int maxlen, char *dest)
-{
- int cnt = 0;
- bzero(dest, maxlen);
- if (feof(fp)) return 0;
- fread(&dest[cnt++], 1, 1, fp);
- while ((dest[cnt - 1] != '\n') && (!feof(fp)) && (cnt < maxlen)) fread(&dest[cnt++], 1, 1, fp);
- dest[cnt - 1] = 0;
- if (dest[0] == WMC_COMMENT_CHAR) return 0;
- return cnt - 1;
-}
-
-/*******************************************************************
-
- bool WmcObject::loadVertices(const char *filename)
-
-********************************************************************/
-bool WmcObject::loadVertices(const char *filename)
-{
- Vertex vtmp;
- int n = 0;
- char tmp[64], tmp2[64];
- FILE *fp;
- float max = 0;
-
- PDEBUG() printf("Loading vertices...\n");
-
- if ((fp = fopen(filename,"r")) == NULL)
- throw runtime_error("WmcObject::load: object file not found.");
-
- do
- {
- freadline(fp, 63, tmp);
- if (feof(fp)) return false;
- }
- while (!strstr(tmp,"WMCUBE_COORDINATES"));
-
- do
- {
- int len = freadline(fp, 63, tmp);
- //printf("\"%s\"\n",tmp);
-
- if (!strstr(tmp,"WMCUBE_PLANES") && !strstr(tmp,"WMCUBE_LINES") && (len > 5))
- {
- if (sizeof(float) == sizeof(double))
- sscanf(tmp,"%63s %lf %lf %lf", tmp2, &vtmp.x, &vtmp.y, &vtmp.z);
- else
- sscanf(tmp,"%63s %f %f %f", tmp2, &vtmp.x, &vtmp.y, &vtmp.z);
-
- n = atoi(tmp2);
-
- // Save maximum scalar product for scaling
- if (sqrt(vtmp.x*vtmp.x + vtmp.y*vtmp.y + vtmp.z*vtmp.z) > max)
- max = sqrt(vtmp.x * vtmp.x + vtmp.y*vtmp.y + vtmp.z*vtmp.z);
-
- vertex.push_back(vtmp);
- //printf("%d: %f %f %f\n", n, vertex.back().x, vertex.back().y, vertex.back().z);
-
- if (n != vertex.size())
- {
- fclose(fp);
- throw runtime_error("WmcObject::load: Error in objectfile: the"
- "coordinates must be listed in order 1..n.");
- }
- }
- }
-
- while (!strstr(tmp,"WMCUBE_LINES") && !strstr(tmp,"WMCUBE_PLANES") && (!feof(fp)));
-
- // Scale the vertices to 0..200
- for (int i = 0; i < vertex.size(); i++)
- {
- vertex.at(i).x = VERTEX_SCALE / max * vertex.at(i).x;
- vertex.at(i).y = VERTEX_SCALE / max * vertex.at(i).y;
- vertex.at(i).z = VERTEX_SCALE / max * vertex.at(i).z;
- rvertex.push_back(vertex.at(i));
- }
-
- fclose(fp);
-
- return true;
-}
-
-/*******************************************************************
-
- bool WmcObject::loadLines(const char *filename)
-
-********************************************************************/
-bool WmcObject::loadLines(const char *filename)
-{
- Line ltmp;
- char tmp[64];
- int iltmp[3];
- FILE *fp;
-
- if ((fp = fopen(filename,"r")) == NULL)
- throw runtime_error("WmcObject::load: object file not found.\n");
-
- do
- {
- freadline(fp, 63, tmp);
- if (feof(fp)) return false;
- }
- while (!strstr(tmp,"WMCUBE_LINES"));
-
- PDEBUG() printf("Loading lines...\n");
-
- do
- {
- int len = freadline(fp, 63, tmp);
-
- if (!strstr(tmp,"WMCUBE_COORDINATES") && !strstr(tmp,"WMCUBE_PLANES") && (len > 2))
- {
- sscanf(tmp, "%d %d", &iltmp[0], &iltmp[1]);
-
- if (CHECK(0, iltmp[0] - 1, vertex.size()) || CHECK(0, iltmp[1] - 1, vertex.size()))
- {
- fclose(fp);
- throw runtime_error("WmcObject::load: Error in objectfile (WMCUBE_LINES section):"
- "invalid coordinates.");
- }
-
- ltmp.a = &rvertex[iltmp[0] - 1];
- ltmp.b = &rvertex[iltmp[1] - 1];
- line.push_back(ltmp);
- //printf("%d %d\n", iltmp[0], iltmp[1]);
- }
- }
- while (!strstr(tmp,"WMCUBE_COORDINATES") && !strstr(tmp,"WMCUBE_PLANES") && !feof(fp));
-
- fclose(fp);
-
- return true;
-}
-
-/*******************************************************************
-
- bool WmcObject::loadPlanes(const char *filename)
-
-********************************************************************/
-bool WmcObject::loadPlanes(const char *filename)
-{
- Plane ptmp;
- char tmp[64];
- int iptmp[3];
- FILE *fp;
-
- if ((fp = fopen(filename,"r")) == NULL)
- throw runtime_error("WmcObject::load: object file not found.");
-
- do
- {
- freadline(fp, 63, tmp);
- if (feof(fp)) return false;
- }
- while (!strstr(tmp,"WMCUBE_PLANES"));
-
- PDEBUG() printf("Loading planes...\n");
-
- do
- {
- int len = freadline(fp, 63, tmp);
-
- if (!strstr(tmp,"WMCUBE_COORDINATES") && !strstr(tmp,"WMCUBE_LINES") && (len > 4))
- {
- sscanf(tmp,"%d %d %d", &iptmp[0], &iptmp[1], &iptmp[2]);
-
- if (CHECK(0, iptmp[0] - 1, rvertex.size())
- || CHECK(0, iptmp[1] - 1, rvertex.size())
- || CHECK(0, iptmp[2] - 1, rvertex.size()))
- {
- fclose(fp);
- throw runtime_error("WmcObject::load: Error in objectfile (WMCUBE_PLANES section): "
- "invalid coordinates.");
- }
-
- ptmp.a = &rvertex[iptmp[0] - 1];
- ptmp.b = &rvertex[iptmp[1] - 1];
- ptmp.c = &rvertex[iptmp[2] - 1];
- ptmp.ab = -1;
- ptmp.bc = -1;
- ptmp.ac = -1;
- plane.push_back(ptmp);
- //printf("%d %d %d\n", iptmp[0], iptmp[1], iptmp[2]); fflush(stdout);
- }
- }
- while (!strstr(tmp,"WMCUBE_LINES") && !strstr(tmp,"WMCUBE_COORDINATES") && !feof(fp));
-
- fclose(fp);
-
- if (lines)
- {
- // Check which lines to draw for SOLID_WIRE mode
-
- for (int i = 0; i < plane.size(); i++)
- for (int j = 0; j < line.size(); j++)
- {
- if (verticesBelongToLine(plane[i].a, plane[i].b, line[j])) plane[i].ab = j;
- if (verticesBelongToLine(plane[i].b, plane[i].c, line[j])) plane[i].bc = j;
- if (verticesBelongToLine(plane[i].a, plane[i].c, line[j])) plane[i].ac = j;
- }
- }
-
- return true;
-}
-
-bool WmcObject::verticesBelongToLine(Vertex *first, Vertex *second, Line l)
-{
- if ((first == l.a && second == l.b) || (second == l.a && first == l.b))
- return true;
-
- return false;
-}
-
-/*******************************************************************
-
- bool WmcObject::load(const char *filename)
-
-********************************************************************/
-bool WmcObject::load(const char *filename)
-{
- try
- {
- loadVertices(filename);
- lines = loadLines(filename);
- planes = loadPlanes(filename);
- }
- catch (exception &e)
- {
- cout << e.what() << endl;
- }
-
- if (!lines && !planes)
- throw runtime_error("WmcObject::load: no WMCUBE_PLANES or WMCUBE_LINES section found in file.");
-
- if (planes && lines)
- mode = SOLID_WIRE;
- else if (planes)
- mode = SOLID;
- else
- mode = WIREFRAME;
-
- return true;
-}
-
-/*******************************************************************
-
- void WmcObject::rotate(int ixang, int iyang, int izang)
-
- Rotates the object from it's current configuration by ixang, iyang
- and izang degrees.
-
-********************************************************************/
-void WmcObject::rotate(float ixang, float iyang, float izang)
-{
- static float xang = 0;
- static float yang = 0;
- static float zang = 0;
- float tx, ty, tz;
-
- xang = (xang + ixang > PI2) ? xang + ixang - PI2 : xang + ixang;
- yang = (yang + iyang > PI2) ? yang + iyang - PI2 : yang + iyang;
- zang = (zang + izang > PI2) ? zang + izang - PI2 : zang + izang;
-
- for (int i = 0; i < vertex.size(); i++)
- {
- tx = cos(yang) * vertex[i].x - sin(yang) * vertex[i].z;
- tz = sin(yang) * vertex[i].x + cos(yang) * vertex[i].z;
- ty = cos(zang) * vertex[i].y - sin(zang) * tx;
-
- rvertex[i].x = cos(zang) * tx + sin(zang) * vertex[i].y;
- rvertex[i].y = sin(xang) * tz + cos(xang) * ty;
- rvertex[i].z = cos(xang) * tz - sin(xang) * ty;
- }
-
- // Calculate plane color before distorting it with perspective
- for (int i = 0; i < plane.size(); i++)
- plane[i].color = luminate(plane[i]);
-
- // Add perspective
- for (int i = 0; i < vertex.size(); i++)
- {
- rvertex[i].x = 256 * rvertex[i].x / (2 * rvertex[i].z - zoff) + xoff;
- rvertex[i].y = 256 * rvertex[i].y / (2 * rvertex[i].z - zoff) + yoff;
- }
-}
-
-/*******************************************************************
-
- void WmcObject::draw(WMCanvas *icanvas)
-
- Draws the WmcObject on the WMCanvas icanvas. Defaults to planes if
- available, otherwise wireframe is used. Buffered mode is used
- so canvas->display() must be called at the end.
-
-********************************************************************/
-void WmcObject::draw(WMCanvas *icanvas)
-{
- canvas = icanvas;
-
- canvas->setbuffered(true);
-
- switch (mode)
- {
- case WIREFRAME:
- canvas->setcolor((WMColor::WMColor)WIRE_COLOR);
- for (int i = 0; i < line.size(); i++)
- canvas->draw_line((int)(line[i].a->x), (int)(line[i].a->y),(int)(line[i].b->x), (int)(line[i].b->y));
- break;
-
- case SOLID:
- sort(plane);
- for (int i = 0; i < plane.size(); i++)
- if (visible(plane[i])) drawTriangle(plane[i]);
- break;
-
- case SOLID_WIRE:
- sort(plane);
- for (int i = 0; i < plane.size(); i++)
- if (visible(plane[i])) drawTriangle(plane[i], true);
- break;
- }
-
- canvas->display();
-}
-
-/*******************************************************************
-
- bool WmcObject::visible(Plane p)
-
- Returns true if the plane is visible (has positive z-component).
-
-********************************************************************/
-bool WmcObject::visible(Plane p)
-{
- //return normal(p).z > 0.0; // Also works but no need computing x- and y-components
- return ((p.a->x - p.c->x) * (p.b->y - p.c->y) - (p.b->x - p.c->x) * (p.a->y - p.c->y)) > 0.0;
-}
-
-/*******************************************************************
-
- Vertex WmcObject::normal(Plane p)
-
- Returns plane p's normal.
-
-********************************************************************/
-Vertex WmcObject::normal(Plane p)
-{
- Vertex ret;
- float x1 = p.a->x - p.c->x, y1 = p.a->y - p.c->y, z1 = p.a->z - p.c->z;
- float x2 = p.b->x - p.c->x, y2 = p.b->y - p.c->y, z2 = p.b->z - p.c->z;
- ret.x = y1 * z2 - y2 * z1;
- ret.y = x2 * z1 - x1 * z2;
- ret.z = x1 * y2 - y1 * x2;
-
- return ret;
-}
-
-/*******************************************************************
-
- float WmcObject::luminate(Plane p)
-
- Returns the luminousity _DECREASE_ for plane p in the range 0..1.
- This is based solely on the angle between the plane's normal and
- the lightsource vector, i.e the distance between the lightsource
- and plane is _not_ taken into account (which would be easy to fake).
-
-********************************************************************/
-float WmcObject::luminate(Plane p)
-{
- Vertex pn = normal(p);
- float sp_pn = sqrt(pn.x * pn.x + pn.y * pn.y + pn.z * pn.z);
- float sp_lum = sqrt(lightsource.x * lightsource.x + lightsource.y * lightsource.y
- + lightsource.z * lightsource.z);
- float pn_lum = pn.x * lightsource.x + pn.y * lightsource.y + pn.z * lightsource.z;
-
- return invPI * acos((pn_lum / (sp_pn * sp_lum)));
-}
-
-/*******************************************************************
-
- void WmcObject::sort(vector<Plane> &plane)
-
- Insertion-sorts a vector of planes by the sum of their z-components.
-
-********************************************************************/
-void WmcObject::sort(vector<Plane> &plane)
-{
- int i, j, k;
- float key;
- float temparr[plane.size()];
- Plane ptmp;
-
- for (i = 0; i < plane.size(); i++)
- temparr[i] = plane[i].a->z + plane[i].b->z + plane[i].c->z;
-
- for (j = 1; j < plane.size(); j++)
- {
- ptmp = plane[j];
- key = temparr[j];
- i = j - 1;
-
- while ((i > -1) && (temparr[i] > key))
- {
- plane[i+1] = plane[i];
- temparr[i+1] = temparr[i];
- i--;
- }
-
- plane[i+1] = ptmp;
- temparr[i+1] = key;
- }
-}
-
-/*******************************************************************
-
- void WmcObject::drawTriangle(Plane p)
-
- Draws a filled polygon using the builtin routine from wmapp which
- in turn uses the builtin routine in X. Sadly enough it is uglier
- than my own original routine due to some corner pixel that gets
- plotted sometime. Plane color is computed using the global
- variables colX and colX_dec and 'p.color'.
-
-********************************************************************/
-void WmcObject::drawTriangle(Plane p, bool wire)
-{
- X::XPoint xp;
- vector<X::XPoint> points;
- unsigned char R = 0, G = 0, B = 0;
- unsigned composit = 0;
-
- xp.x = (int)p.a->x;
- xp.y = (int)p.a->y;
- points.push_back(xp);
- xp.x = (int)p.b->x;
- xp.y = (int)p.b->y;
- points.push_back(xp);
- xp.x = (int)p.c->x;
- xp.y = (int)p.c->y;
- points.push_back(xp);
-
- R = (unsigned char)(color >> 16);
- G = (unsigned char)(color >> 8 );
- B = (unsigned char)(color );
-
- R -= (unsigned char)((float)R * p.color * shading);
- G -= (unsigned char)((float)G * p.color * shading);
- B -= (unsigned char)((float)B * p.color * shading);
-
- composit = (R << 16) + (G << 8) + B;
-
- // If the plane is almost purpendicular to the lightsource fake a 'reflex'
- if (p.color < REFLEX) composit = REFLEX_COLOR;
-
- canvas->setcolor((WMColor::WMColor)composit);
- canvas->fill_polygon(points);
-
- if (!wire) return;
-
- canvas->setcolor((WMColor::WMColor)WIRE_COLOR);
-
- if (p.ab > -1)
- canvas->draw_line((int)(line[p.ab].a->x), (int)(line[p.ab].a->y),
- (int)(line[p.ab].b->x), (int)(line[p.ab].b->y));
- if (p.bc > -1)
- canvas->draw_line((int)(line[p.bc].a->x), (int)(line[p.bc].a->y),
- (int)(line[p.bc].b->x), (int)(line[p.bc].b->y));
- if (p.ac > -1)
- canvas->draw_line((int)(line[p.ac].a->x), (int)(line[p.ac].a->y),
- (int)(line[p.ac].b->x), (int)(line[p.ac].b->y));
-
-}
diff --git a/wmcube/WmcObject.h b/wmcube/WmcObject.h
deleted file mode 100644
index cfb8b1fea1b8..000000000000
--- a/wmcube/WmcObject.h
+++ /dev/null
@@ -1,96 +0,0 @@
-#ifndef _WMCOBJECT_H_
-#define _WMCOBJECT_H_
-
-#include <vector>
-#include "wmapp/wmcanvas.h"
-
-typedef struct { float x, y, z; } Vertex;
-typedef struct { Vertex *a, *b, *c; float color; int ab, bc, ac; } Plane;
-typedef struct { Vertex *a, *b; } Line;
-typedef enum { WIREFRAME, SOLID, SOLID_WIRE, NUM_MODES };
-
-class WmcObject
-{
-public:
- WmcObject();
- WmcObject(const char *);
- ~WmcObject();
-
- void setMode(int m);
- void setColorShading(unsigned color, float shading);
- void rotate(float xang, float yang, float zang);
- void draw(WMCanvas *icanvas);
-
- void setYOffset(int pixels);
- void modifyZOffset(int idepth);
- void setLightSource(float xc, float yc, float zc);
-
-private:
-
- bool load(const char *);
- bool loadVertices(const char *);
- bool loadPlanes(const char *);
- bool loadLines(const char *);
- int freadline(FILE *fp, int maxlen, char *dest);
- void sort(vector<Plane> &plane);
- bool visible(Plane p);
- float luminate(Plane p);
- Vertex normal(Plane p);
- void drawTriangle(Plane p, bool wire = false);
- bool verticesBelongToLine(Vertex *first, Vertex *second, Line l);
-
- vector<Vertex> vertex;
- vector<Vertex> rvertex;
- vector<Plane> plane;
- vector<Line> line;
-
- WMCanvas *canvas;
- Vertex lightsource;
- bool lines, planes;
- int xoff, yoff, zoff;
- int mode;
- unsigned int color;
- float shading;
-};
-
-const char default_cube[] =
-{ ""
-"# The original cube by Robert Kling\n"
-"WMCUBE_COORDINATES\n"
-"1 -180 -180 180\n"
-"2 180 -180 180\n"
-"3 180 180 180\n"
-"4 -180 180 180\n"
-"5 -180 -180 -180\n"
-"6 180 -180 -180\n"
-"7 180 180 -180\n"
-"8 -180 180 -180\n"
-"WMCUBE_LINES\n"
-"1 2\n"
-"2 3\n"
-"3 4\n"
-"4 1\n"
-"5 6\n"
-"6 7\n"
-"7 8\n"
-"8 5\n"
-"1 5\n"
-"2 6\n"
-"3 7\n"
-"4 8\n"
-"WMCUBE_PLANES\n"
-"1 2 3\n"
-"1 3 4\n"
-"2 6 7\n"
-"2 7 3\n"
-"5 1 4\n"
-"5 4 8\n"
-"5 2 1\n"
-"5 6 2\n"
-"4 3 8\n"
-"3 7 8\n"
-"6 5 8\n"
-"6 8 7"
-};
-
-#endif
diff --git a/wmcube/cpumoncc/README b/wmcube/cpumoncc/README
deleted file mode 100644
index 3b3da91dfdbe..000000000000
--- a/wmcube/cpumoncc/README
+++ /dev/null
@@ -1,70 +0,0 @@
-CpuMonitorCC (cpumoncc)
-Version: 0.0.1-pre1 (aka "Expect Things To Be Broken")
-
-(C) Copyright 2003 Robert Kling
-
-robk...@student.luth.se
-http://kling.mine.nu
-
-DESCRIPTION
-
-This is a small library for reading the instantaneous cpu load
-in many different operating systems. It started out as a part of
-wmCube but as it [wmCube] got ported to more and more OS's it
-seemed tidier to put the OS-specific code into its
-on package. As the name implies it is written in C++.
-
-REQUIREMENTS/FEATURES
-
-Supported systems and their features so far are:
-
- * Darwin - Basic functionality.
- * FreeBSD - Basic functionality, discarding of 'nice' processes.
- * Linux - Multiprocessor support, discarding of 'nice' processes.
- * NetBSD - Basic functionality, discarding of 'nice' processes.
- * OpenBSD - Basic functionality.
- * Solaris - Multiprocessor support.
-
-INSTALLATION
-
-Change to the directory of the OS your building cpumoncc for.
-Type (as root):
-
-make install
-
-To build the programs that come with cpumoncc, go into the directory
-'programs' and type
-
-make
-
-and optionally, as root
-
-make install
-
-CONTRIBUTIONS
-
-Solaris codebase by Dan Price (d...@rampant.org)
-OpenBSD codebase by Brian Joseph Czapiga (r...@godsey.net)
-FreeBSD codebase by Tai-hwa Liang (ava...@mmlab.cse.yzu.edu.tw)
-NetBSD codebase by Jared Smolens <jsmo...@andrew.cmu.edu>
-
-I only test cpumoncc thoroughly on Linux so anyone running on a
-different OS/architecture please let me now if there are any bugs
-or if everything's hunky dory. Suggestions, patches, more ports
-etc. are also very welcome.
-
-LICENSE
-
-cpumoncc is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
-
-cpumoncc is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with cpumoncc; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
diff --git a/wmcube/cpumoncc/base/BaseCpuMonitor.h b/wmcube/cpumoncc/base/BaseCpuMonitor.h
deleted file mode 100644
index 3577c7d5e169..000000000000
--- a/wmcube/cpumoncc/base/BaseCpuMonitor.h
+++ /dev/null
@@ -1,112 +0,0 @@
-/*
-
- Copyright (C) 2003 Robert Kling, robk...@student.luth.se
-
- This file is part of CpuMonitorCC (cpumoncc)
-
- cpumoncc is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- cpumoncc is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with cpumoncc; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-
-*/
-
-/*
-
- This is the base class which all cpu monitors should inherit
- from. Best is to use one of the existing monitors as a
- template when writing a new one. By inheriting this base
- class it can be as simple as implementing just one function
- to support a new operating system. This function is
- getLoad() which should return the (average (in the case of
- a smp-system)) intermediate cpu-load in the range [0.0, 1.0]
- multiplied by the inherited protected variable 'range'.
-
-*/
-
-#ifndef _BASECPUMONITOR_H_
-#define _BASECPUMONITOR_H_
-
-#include <stdio.h>
-#include <stdexcept>
-
-#define CPUMONCC_VERSION "0.0.1-pre1"
-#define CPUMONCC_DATE "2003-02-14"
-
-using namespace std;
-
-class BaseCpuMonitor
-{
-public:
-
- BaseCpuMonitor();
- virtual float getLoad() = 0;
- void setRange(float);
- bool saveInternals(const char *);
- bool loadInternals(const char *);
-
-protected:
-
- int which_cpu;
- bool use_nice;
- int previous_total;
- int previous_used;
- float range;
-};
-
-inline BaseCpuMonitor::BaseCpuMonitor()
-{
- which_cpu = -1;
- use_nice = true;
- previous_total = 0;
- previous_used = 0;
- // Set default range to percent
- range = 100.0;
-}
-
-inline void BaseCpuMonitor::setRange(float irange)
-{
- range = irange;
-}
-
-inline bool BaseCpuMonitor::saveInternals(const char *filename)
-{
- int count;
- FILE *fp = fopen(filename, "w");
-
- if (fp == 0) return false;
-
- count = fprintf(fp, "%d %d", previous_used, previous_total);
- fclose(fp);
-
- if (count != 2) return false;
-
- return true;
-}
-
-inline bool BaseCpuMonitor::loadInternals(const char *filename)
-{
- int count;
- FILE *fp = fopen(filename, "r");
-
- if (fp == 0) return false;
-
- count = fscanf(fp, "%d %d", &previous_used, &previous_total);
- fclose(fp);
-
- if (count != 2) return false;
-
- return true;
-}
-
-
-#endif
diff --git a/wmcube/cpumoncc/darwin/CpuMonitor.cc b/wmcube/cpumoncc/darwin/CpuMonitor.cc
deleted file mode 100644
index b98a8008f1e6..000000000000
--- a/wmcube/cpumoncc/darwin/CpuMonitor.cc
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
-
- Copyright (C) 2003 Robert Kling, robk...@student.luth.se
-
- This file is part of CpuMonitorCC (cpumoncc)
-
- cpumoncc is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- cpumoncc is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with cpumoncc; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-
-*/
-
-// CpuMonitorCC/Darwin
-
-#include "CpuMonitor.h"
-
-CpuMonitor::CpuMonitor() : BaseCpuMonitor()
-{
-}
-
-float CpuMonitor::getLoad()
-{
- float t;
- double avenrun[3];
- getloadavg(avenrun, sizeof(avenrun) / sizeof(avenrun[0]));
-
- // t = 0..100
- t = 2 * (((5.0*avenrun[0] + 0.5) > 50) ? 50 : (5.0*avenrun[0] + 0.5));
-
- return range * t / 100.0;
-}
diff --git a/wmcube/cpumoncc/darwin/CpuMonitor.h b/wmcube/cpumoncc/darwin/CpuMonitor.h
deleted file mode 100644
index d31782027a50..000000000000
--- a/wmcube/cpumoncc/darwin/CpuMonitor.h
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
-
- Copyright (C) 2003 Robert Kling, robk...@student.luth.se
-
- This file is part of CpuMonitorCC (cpumoncc)
-
- cpumoncc is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- cpumoncc is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with cpumoncc; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-
-*/
-
-// CpuMonitorCC/Darwin
-
-#ifndef _CPUMONITOR_H_
-#define _CPUMONITOR_H_
-
-#include <stdlib.h>
-#include "BaseCpuMonitor.h"
-
-class CpuMonitor : public BaseCpuMonitor
-{
-public:
-
- CpuMonitor();
- float getLoad();
-};
-
-#endif
diff --git a/wmcube/cpumoncc/darwin/Makefile b/wmcube/cpumoncc/darwin/Makefile
deleted file mode 100644
index 2732a39c0668..000000000000
--- a/wmcube/cpumoncc/darwin/Makefile
+++ /dev/null
@@ -1,41 +0,0 @@
-#####################################################
-#
-# To compile cpumoncc for a different OS/architecture you
-# will need to modify the variablese below to match your system.
-#
-# For system wide installation type (as root):
-#
-# make install
-#
-# This will install the static library in $(LIBINSTALL) and
-# the header files in $(HINSTALL)/cpumoncc.
-#
-#####################################################
-
-CXX=g++
-CXXFLAGS=
-HINSTALL=/usr/include
-LIBINSTALL=/usr/lib
-
-#####################################################
-
-TARGET=libcpumoncc.a
-
-$(TARGET): CpuMonitor.o
- ar rcs $(TARGET) $^
-
-CpuMonitor.o: copy_base
-
-copy_base:
- cp ../base/BaseCpuMonitor.h .
-
-install: $(TARGET)
- mkdir -p $(HINSTALL)/cpumoncc
- cp *.h $(HINSTALL)/cpumoncc
- install -m 644 $(TARGET) $(LIBINSTALL)
-
-clean:
- rm -f *~ core *.o cpu $(TARGET) BaseCpuMonitor.h
- rm -fr $(HINSTALL)/cpumoncc
- rm -f $(LIBINSTALL)/$(TARGET)
-
diff --git a/wmcube/cpumoncc/freebsd/CpuMonitor.cc b/wmcube/cpumoncc/freebsd/CpuMonitor.cc
deleted file mode 100644
index 726d33b7d2e3..000000000000
--- a/wmcube/cpumoncc/freebsd/CpuMonitor.cc
+++ /dev/null
@@ -1,80 +0,0 @@
-/*
-
- Copyright (C) 2003 Robert Kling, robk...@student.luth.se
-
- This file is part of CpuMonitorCC (cpumoncc)
-
- cpumoncc is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- cpumoncc is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with cpumoncc; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-
-*/
-
-// CpuMonitorCC/FreeBSD
-
-#include "CpuMonitor.h"
-
-CpuMonitor::CpuMonitor() : BaseCpuMonitor()
-{
- initialize();
-}
-
-CpuMonitor::CpuMonitor(bool nice) : BaseCpuMonitor()
-{
- use_nice = nice;
- initialize();
-}
-
-CpuMonitor::~CpuMonitor()
-{
- kvm_close(kd);
-}
-
-void CpuMonitor::initialize()
-{
- nlst[0].n_name = "_cp_time";
- nlst[1].n_name = NULL;
-
- if ((kd = kvm_open(NULL, NULL, NULL, O_RDONLY, "kvm_open")) == NULL)
- throw runtime_error("CpuMonitor: unable to open kvm.");
-
- kvm_nlist(kd, nlst);
-
- if (nlst[0].n_type == 0)
- throw runtime_error("CpuMonitor: unable to get nlist.");
-}
-
-float CpuMonitor::getLoad()
-{
- int total, used;
- int cpu,nice,system,idle;
- unsigned long int cpu_time[CPUSTATES];
- float t;
-
- if (kvm_read(kd, nlst[0].n_value, &cpu_time, sizeof(cpu_time)) != sizeof(cpu_time))
- throw runtime_error("CpuMonitor: error reading kvm.");
-
- cpu = cpu_time[CP_USER];
- nice = cpu_time[CP_NICE];
- system = cpu_time[CP_SYS];
- idle = cpu_time[CP_IDLE];
-
- used = cpu + system + use_nice*nice;
- total = used + idle + (1-use_nice)*nice;
-
- t = range * (float)(used - previous_used) / (float)(total - previous_total);
- previous_total = total;
- previous_used = used;
-
- return t;
-}
diff --git a/wmcube/cpumoncc/freebsd/CpuMonitor.h b/wmcube/cpumoncc/freebsd/CpuMonitor.h
deleted file mode 100644
index a03ca3f34095..000000000000
--- a/wmcube/cpumoncc/freebsd/CpuMonitor.h
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
-
- Copyright (C) 2003 Robert Kling, robk...@student.luth.se
-
- This file is part of CpuMonitorCC (cpumoncc)
-
- cpumoncc is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- cpumoncc is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with cpumoncc; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-
-*/
-
-// CpuMonitorCC/FreeBSD
-
-#ifndef _CPUMONITOR_H_
-#define _CPUMONITOR_H_
-
-#include <kvm.h>
-#include <nlist.h>
-#include <fcntl.h>
-#include <sys/dkstat.h>
-#include "BaseCpuMonitor.h"
-
-class CpuMonitor : public BaseCpuMonitor
-{
-public:
-
- CpuMonitor();
- CpuMonitor(bool nice);
- ~CpuMonitor();
-
- float getLoad();
-
-private:
-
- void initialize();
-
- kvm_t *kd;
- struct nlist nlst[2];
-};
-
-#endif
diff --git a/wmcube/cpumoncc/freebsd/Makefile b/wmcube/cpumoncc/freebsd/Makefile
deleted file mode 100644
index 9346f23b76a7..000000000000
--- a/wmcube/cpumoncc/freebsd/Makefile
+++ /dev/null
@@ -1,41 +0,0 @@
-######################################################
-#
-# To compile cpumoncc for a different OS/architecture you
-# will need to modify the variablese below to match your system.
-#
-# For system wide installation type (as root):
-#
-# make install
-#
-# This will install the static library in $(LIBINSTALL) and
-# the header files in $(HINSTALL)/cpumoncc.
-#
-#####################################################
-
-CXX=g++
-CXXFLAGS=-lkvm
-HINSTALL=/usr/include
-LIBINSTALL=/usr/lib
-
-#####################################################
-
-TARGET=libcpumoncc.a
-
-$(TARGET): CpuMonitor.o
- ar rcs $(TARGET) $^
-
-CpuMonitor.o: copy_base
-
-copy_base:
- cp ../base/BaseCpuMonitor.h .
-
-install: $(TARGET)
- mkdir -p $(HINSTALL)/cpumoncc
- cp *.h $(HINSTALL)/cpumoncc
- install -m 644 $(TARGET) $(LIBINSTALL)
-
-clean:
- rm -f *~ core *.o cpu $(TARGET) BaseCpuMonitor.h
- rm -fr $(HINSTALL)/cpumoncc
- rm -f $(LIBINSTALL)/$(TARGET)
-
\ No newline at end of file
diff --git a/wmcube/cpumoncc/linux/CpuMonitor.cc b/wmcube/cpumoncc/linux/CpuMonitor.cc
deleted file mode 100644
index bd4396b6c578..000000000000
--- a/wmcube/cpumoncc/linux/CpuMonitor.cc
+++ /dev/null
@@ -1,100 +0,0 @@
-/*
-
- Copyright (C) 2003 Robert Kling, robk...@student.luth.se
-
- This file is part of CpuMonitorCC (cpumoncc)
-
- cpumoncc is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- cpumoncc is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with cpumoncc; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-
-*/
-
-// CpuMonitorCC/Linux
-
-#include <stdio.h>
-#include "CpuMonitor.h"
-
-CpuMonitor::CpuMonitor() : BaseCpuMonitor()
-{
- initialize();
-}
-
-CpuMonitor::CpuMonitor(int cpu) : BaseCpuMonitor()
-{
- which_cpu = cpu;
- initialize();
-}
-
-CpuMonitor::CpuMonitor(int cpu, bool nice) : BaseCpuMonitor()
-{
- which_cpu = cpu;
- use_nice = nice;
- initialize();
-}
-
-void CpuMonitor::initialize()
-{
- FILE *fp;
- int i;
- char cpuid[6];
- char check_cpu[6];
- char tmp[32];
-
- if ((fp = fopen("/proc/stat","r")) == NULL)
- throw runtime_error("CpuMonitor: no /proc/stat found.");
-
- if (which_cpu == -1) return;
-
- snprintf(check_cpu, 6, "cpu%d", which_cpu);
- //printf("Monitoring %s (%d)\n", check_cpu, which_cpu);
-
- for (i = -2; i < which_cpu; i++)
- {
- fscanf(fp, "%5s %31s %31s %31s %31s", cpuid, tmp, tmp, tmp, tmp);
- //fscanf(fp, "%5s" , cpuid); printf("%s ", cpuid);
- //fscanf(fp, "%31s", tmp ); printf("%s ", tmp);
- //fscanf(fp, "%31s", tmp ); printf("%s ", tmp);
- //fscanf(fp, "%31s", tmp ); printf("%s ", tmp);
- //fscanf(fp, "%31s", tmp ); printf("%s\n", tmp); fflush(stdout);
- }
-
- if (strcmp(check_cpu, cpuid) != 0)
- throw runtime_error("CpuMonitor: could not read cpu-load.");
-}
-
-float CpuMonitor::getLoad()
-{
- int total, used, i;
- char cpuid[6];
- int cpu,nice,system,idle;
- float t;
- FILE *fp;
-
- fp = fopen("/proc/stat","r");
-
- for (i = -2; i < which_cpu; i++)
- fscanf(fp,"%5s %d %d %d %d", cpuid, &cpu, &nice, &system, &idle);
-
- fclose(fp);
-
- used = cpu + system + use_nice * nice;
- total = used + idle + (1-use_nice) * nice;
-
- t = range * (float)(used - previous_used) / (float)(total - previous_total);
- previous_total = total;
- previous_used = used;
-
- return t;
-}
-
diff --git a/wmcube/cpumoncc/linux/CpuMonitor.h b/wmcube/cpumoncc/linux/CpuMonitor.h
deleted file mode 100644
index 82bd910fbbd4..000000000000
--- a/wmcube/cpumoncc/linux/CpuMonitor.h
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
-
- Copyright (C) 2003 Robert Kling, robk...@student.luth.se
-
- This file is part of CpuMonitorCC (cpumoncc)
-
- cpumoncc is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- cpumoncc is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with cpumoncc; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-
-*/
-
-// CpuMonitorCC/Linux
-
-#ifndef _CPUMONITOR_H_
-#define _CPUMONITOR_H_
-
-#include "BaseCpuMonitor.h"
-
-class CpuMonitor : public BaseCpuMonitor
-{
-public:
-
- CpuMonitor();
- CpuMonitor(int cpu);
- CpuMonitor(int cpu, bool nice);
-
- float getLoad();
-
-private:
-
- void initialize();
-};
-
-#endif
diff --git a/wmcube/cpumoncc/linux/Makefile b/wmcube/cpumoncc/linux/Makefile
deleted file mode 100644
index ebe980a8a1d5..000000000000
--- a/wmcube/cpumoncc/linux/Makefile
+++ /dev/null
@@ -1,40 +0,0 @@
-######################################################
-#
-# To compile cpumoncc for a different OS/architecture you
-# will need to modify the variablese below to match your system.
-#
-# For system wide installation type (as root):
-#
-# make install
-#
-# This will install the static library in $(LIBINSTALL) and
-# the header files in $(HINSTALL)/cpumoncc.
-#
-#####################################################
-
-CXX=g++
-CXXFLAGS=
-HINSTALL=/usr/include
-LIBINSTALL=/usr/lib
-
-#####################################################
-
-TARGET=libcpumoncc.a
-
-$(TARGET): CpuMonitor.o
- ar rcs $(TARGET) $^
-
-CpuMonitor.o: copy_base
-
-copy_base:
- cp ../base/BaseCpuMonitor.h .
-
-install: $(TARGET)
- mkdir -p $(HINSTALL)/cpumoncc
- cp *.h $(HINSTALL)/cpumoncc
- install -m 644 $(TARGET) $(LIBINSTALL)
-
-clean:
- rm -f *~ core *.o cpu $(TARGET) BaseCpuMonitor.h
-# rm -fr $(HINSTALL)/cpumoncc
-# rm -f $(LIBINSTALL)/$(TARGET)
diff --git a/wmcube/cpumoncc/netbsd/CpuMonitor.cc b/wmcube/cpumoncc/netbsd/CpuMonitor.cc
deleted file mode 100644
index 33d2fb08a0eb..000000000000
--- a/wmcube/cpumoncc/netbsd/CpuMonitor.cc
+++ /dev/null
@@ -1,113 +0,0 @@
-/*
-
- Copyright (C) 2003 Robert Kling, robk...@student.luth.se
-
- This file is part of CpuMonitorCC (cpumoncc)
-
- cpumoncc is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- cpumoncc is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with cpumoncc; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-
-*/
-
-// CpuMonitorCC/NetBSD
-
-#include <stdlib.h>
-#include <sys/sched.h>
-#include <sys/param.h>
-#include <sys/sysctl.h>
-#include "CpuMonitor.h"
-
-CpuMonitor::CpuMonitor() : BaseCpuMonitor()
-{
- for (int i = i < CPUSTATES; i++) last_cp_time[i] = 0;
-}
-
-CpuMonitor::CpuMonitor(bool nice) : BaseCpuMonitor()
-{
- use_nice = nice;
- for (int i = i < CPUSTATES; i++) last_cp_time[i] = 0;
-}
-
-float CpuMonitor::getLoad()
-{
- u_int64_t curr_cp_time[CPUSTATES];
- u_int64_t total_time = 0, idle_time = 0;
- int mib[2];
- int i;
- size_t ssize;
- const int IDLE_TIME = 4;
- const int NICE_TIME = 1;
-
- ssize = sizeof ( curr_cp_time );
- mib[0] = CTL_KERN;
- mib[1] = KERN_CP_TIME;
-
- if ( sysctl ( mib, 2, curr_cp_time, &ssize, NULL, 0 ) )
- throw runtime_error("CpuMonitor: unable to read CP_TIME from sysctl()\n");
-
- if ( !use_nice )
- curr_cp_time[NICE_TIME] = 0;
-
- /* NetBSD gives 5 CPUSTATES -
- * User, Nice, System, Interrupt, Idle
- */
- idle_time = curr_cp_time[IDLE_TIME] - last_cp_time[IDLE_TIME];
- for ( i = 0; i < CPUSTATES; i++ )
- {
- total_time += ( curr_cp_time[i] - last_cp_time[i] );
- last_cp_time[i] = curr_cp_time[i];
- }
-
- /* Calculate the % CPU usage as the User+Nice+System+Interrupt/Total
- * for the interval
- */
- return range * (int) ( total_time - idle_time ) / total_time;
-}
-
-/*
- * Overloads base class
- */
-bool CpuMonitor::saveInternals(const char *filename)
-{
- int count = 0;
- FILE *fp = fopen(filename, "w");
-
- if (fp == 0) return false;
-
- for ( i = 0; i < CPUSTATES; i++ )
- count += fprintf(fp, "%d", last_cp_time[i]);
-
- fclose(fp);
-
- if (count != CPUSTATES) return false;
-
- return true;
-}
-
-bool CpuMonitor::loadInternals(const char *filename)
-{
- int count = 0;
- FILE *fp = fopen(filename, "r");
-
- if (fp == 0) return false;
-
- for ( i = 0; i < CPUSTATES; i++ )
- count += fscanf(fp, "%d", &last_cp_time[i]);
-
- fclose(fp);
-
- if (count != CPUSTATES) return false;
-
- return true;
-}
diff --git a/wmcube/cpumoncc/netbsd/CpuMonitor.h b/wmcube/cpumoncc/netbsd/CpuMonitor.h
deleted file mode 100644
index 1be7fd03774a..000000000000
--- a/wmcube/cpumoncc/netbsd/CpuMonitor.h
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
-
- Copyright (C) 2003 Robert Kling, robk...@student.luth.se
-
- This file is part of CpuMonitorCC (cpumoncc)
-
- cpumoncc is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- cpumoncc is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with cpumoncc; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-
-*/
-
-// CpuMonitorCC/NetBSD
-
-#ifndef _CPUMONITOR_H_
-#define _CPUMONITOR_H_
-
-#include "BaseCpuMonitor.h"
-
-class CpuMonitor : public BaseCpuMonitor
-{
-public:
-
- CpuMonitor();
- CpuMonitor(bool nice);
- float getLoad();
-
-private:
-
- u_int64_t last_cp_time[CPUSTATES];
-};
-
-#endif
diff --git a/wmcube/cpumoncc/netbsd/Makefile b/wmcube/cpumoncc/netbsd/Makefile
deleted file mode 100644
index ccc3b9349ea0..000000000000
--- a/wmcube/cpumoncc/netbsd/Makefile
+++ /dev/null
@@ -1,40 +0,0 @@
-######################################################
-#
-# To compile cpumoncc for a different OS/architecture you
-# will need to modify the variablese below to match your system.
-#
-# For system wide installation type (as root):
-#
-# make install
-#
-# This will install the static library in $(LIBINSTALL) and
-# the header files in $(HINSTALL)/cpumoncc.
-#
-#####################################################
-
-CXX=g++
-CXXFLAGS=
-HINSTALL=/usr/include
-LIBINSTALL=/usr/lib
-
-#####################################################
-
-TARGET=libcpumoncc.a
-
-$(TARGET): CpuMonitor.o
- ar rcs $(TARGET) $^
-
-CpuMonitor.o: copy_base
-
-copy_base:
- cp ../base/BaseCpuMonitor.h .
-
-install: $(TARGET)
- mkdir -p $(HINSTALL)/cpumoncc
- cp *.h $(HINSTALL)/cpumoncc
- install -m 644 $(TARGET) $(LIBINSTALL)
-
-clean:
- rm -f *~ core *.o cpu $(TARGET) BaseCpuMonitor.h
- rm -fr $(HINSTALL)/cpumoncc
- rm -f $(LIBINSTALL)/$(TARGET)
\ No newline at end of file
diff --git a/wmcube/cpumoncc/openbsd/CpuMonitor.cc b/wmcube/cpumoncc/openbsd/CpuMonitor.cc
deleted file mode 100644
index 0287f4ca1858..000000000000
--- a/wmcube/cpumoncc/openbsd/CpuMonitor.cc
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
-
- Copyright (C) 2003 Robert Kling, robk...@student.luth.se
-
- This file is part of CpuMonitorCC (cpumoncc)
-
- cpumoncc is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- cpumoncc is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with cpumoncc; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-
-*/
-
-// CpuMonitorCC/OpenBSD
-
-#include <stdlib.h>
-#include "CpuMonitor.h"
-
-CpuMonitor::CpuMonitor() : BaseCpuMonitor()
-{
-}
-
-float CpuMonitor::getLoad()
-{
- float t;
- double avenrun[3];
- getloadavg(avenrun, sizeof(avenrun) / sizeof(avenrun[0]));
-
- // t = 0..100
- t = 2 * (((5.0*avenrun[0] + 0.5) > 50) ? 50 : (5.0*avenrun[0] + 0.5));
-
- return range * t / 100.0;
-}
diff --git a/wmcube/cpumoncc/openbsd/CpuMonitor.h b/wmcube/cpumoncc/openbsd/CpuMonitor.h
deleted file mode 100644
index 911759230851..000000000000
--- a/wmcube/cpumoncc/openbsd/CpuMonitor.h
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
-
- Copyright (C) 2003 Robert Kling, robk...@student.luth.se
-
- This file is part of CpuMonitorCC (cpumoncc)
-
- cpumoncc is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- cpumoncc is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with cpumoncc; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-
-*/
-
-// CpuMonitorCC/OpenBSD
-
-#ifndef _CPUMONITOR_H_
-#define _CPUMONITOR_H_
-
-#include "BaseCpuMonitor.h"
-
-class CpuMonitor : public BaseCpuMonitor
-{
-public:
-
- CpuMonitor();
- float getLoad();
-};
-
-#endif
diff --git a/wmcube/cpumoncc/openbsd/Makefile b/wmcube/cpumoncc/openbsd/Makefile
deleted file mode 100644
index b6334cbd62d5..000000000000
--- a/wmcube/cpumoncc/openbsd/Makefile
+++ /dev/null
@@ -1,40 +0,0 @@
-######################################################
-#
-# To compile cpumoncc for a different OS/architecture you
-# will need to modify the variablese below to match your system.
-#
-# For system wide installation type (as root):
-#
-# make install
-#
-# This will install the static library in $(LIBINSTALL) and
-# the header files in $(HINSTALL)/cpumoncc.
-#
-#####################################################
-
-CXX=g++
-CXXFLAGS=
-HINSTALL=/usr/include
-LIBINSTALL=/usr/lib
-
-#####################################################
-
-TARGET=libcpumoncc.a
-
-$(TARGET): CpuMonitor.o
- ar rcs $(TARGET) $^
-
-CpuMonitor.o: copy_base
-
-copy_base:
- cp ../base/BaseCpuMonitor.h .
-
-install: $(TARGET)
- mkdir -p $(HINSTALL)/cpumoncc
- cp *.h $(HINSTALL)/cpumoncc
- install -m 644 $(TARGET) $(LIBINSTALL)
-
-clean:
- rm -f *~ core *.o cpu $(TARGET) BaseCpuMonitor.h
- rm -fr $(HINSTALL)/cpumoncc
- rm -f $(LIBINSTALL)/$(TARGET)
diff --git a/wmcube/cpumoncc/programs/Makefile b/wmcube/cpumoncc/programs/Makefile
deleted file mode 100644
index 3bff6a41a251..000000000000
--- a/wmcube/cpumoncc/programs/Makefile
+++ /dev/null
@@ -1,14 +0,0 @@
-CXX=g++
-CXXFLAGS=
-TARGET=cpu
-
-all: cpu.cc cpuload.cc
- $(CXX) $(CXXFLAGS) -o cpu cpu.cc -lcpumoncc
- $(CXX) $(CXXFLAGS) -o cpuload cpuload.cc -lcpumoncc
-
-install: all
- cp cpu /usr/bin
- cp cpuload /usr/bin
-
-clean:
- rm -f *~ core *.o cpu cpuload /usr/bin/cpu /usr/bin/cpuload
diff --git a/wmcube/cpumoncc/programs/README b/wmcube/cpumoncc/programs/README
deleted file mode 100644
index 7809f2a4efb8..000000000000
--- a/wmcube/cpumoncc/programs/README
+++ /dev/null
@@ -1,17 +0,0 @@
-These are two small programs that show how to use the cpumoncc library.
-
-The first one, cpu, is a 'state-ful' cpu monitor that returns the average
-cpu load for the elapsed time between now and the last time you
-ran the program. Useful (in a geeky way) in promts for example:
-
-geoff@rama [CPU: 1%] ~/workspace/cpumoncc > ls
-README base darwin freebsd linux netbsd openbsd programs solaris
-geoff@rama [CPU: 4%] ~/workspace/cpumoncc >
-
-This particular prompt is (in bash):
-PS1='\u@\h [CPU: `cpu`%] \w > '
-
-
-The second program, cpuload, is a simple text mode cpu monitor.
-
-To build these programs type 'make'. To install, type, as root, 'make install'.
\ No newline at end of file
diff --git a/wmcube/cpumoncc/programs/cpu.cc b/wmcube/cpumoncc/programs/cpu.cc
deleted file mode 100644
index 993d3d8f403f..000000000000
--- a/wmcube/cpumoncc/programs/cpu.cc
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
-
- cpu.cc v0.0.1
-
- Copyright (C) 2003 Robert Kling, robk...@student.luth.se
-
- This file is part of CpuMonitorCC (cpumoncc)
-
- cpumoncc is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- cpumoncc is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with cpumoncc; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-
-*/
-
-/*
- * Note that this program will compile for all on os's supported
- * by cpumoncc altough it will only function properly on the
- * os's with a valid implementation of load/saveInternals. With
- * version 0.0.1-pre1 of cpumoncc they are lacking for OpenBSD
- * and Darwin. cpumoncc must be installed for this program to
- * compile.
- */
-
-#include <stdio.h>
-#include <string.h>
-#include <cpumoncc/CpuMonitor.h>
-
-char filename[256];
-
-FILE *fp;
-CpuMonitor *cpu = new CpuMonitor();
-
-int main()
-{
- // Necessary monitor internals will be saved in /home/username/.cpu
- strncpy(filename, getenv("HOME"), 245);
- strncat(filename, "/.cpu", 6);
-
- cpu->loadInternals(filename);
- printf("%.0f", cpu->getLoad());
- cpu->saveInternals(filename);
-
- delete cpu;
-
- return 0;
-}
diff --git a/wmcube/cpumoncc/programs/cpuload.cc b/wmcube/cpumoncc/programs/cpuload.cc
deleted file mode 100644
index 65f4d21f2632..000000000000
--- a/wmcube/cpumoncc/programs/cpuload.cc
+++ /dev/null
@@ -1,60 +0,0 @@
-/*
-
- cpuload.cc v0.0.1
-
- Copyright (C) 2003 Robert Kling, robk...@student.luth.se
-
- This file is part of CpuMonitorCC (cpumoncc)
-
- cpumoncc is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- cpumoncc is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with cpumoncc; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-
-*/
-
-#include <stdio.h>
-#include <string.h>
-#include <unistd.h>
-#include <iostream>
-#include <cpumoncc/CpuMonitor.h>
-
-#define U_POLL_INTERVAL 500000
-
-char filename[256];
-
-FILE *fp;
-CpuMonitor *cpumon = new CpuMonitor();
-
-int prev_used, prev_total;
-
-int main()
-{
- while (1)
- {
- try
- {
- printf("\rLoad: %.2f%% ", cpumon->getLoad()); fflush(stdout);
- }
- catch (exception e)
- {
- cout << e.what();
- return -1;
- }
-
- usleep(U_POLL_INTERVAL);
- }
-
- delete cpumon;
-
- return 0;
-}
diff --git a/wmcube/cpumoncc/solaris/CpuMonitor.cc b/wmcube/cpumoncc/solaris/CpuMonitor.cc
deleted file mode 100644
index b26cef6c50f9..000000000000
--- a/wmcube/cpumoncc/solaris/CpuMonitor.cc
+++ /dev/null
@@ -1,141 +0,0 @@
-/*
-
- Copyright (C) 2003 Robert Kling, robk...@student.luth.se
-
- This file is part of CpuMonitorCC (cpumoncc)
-
- cpumoncc is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- cpumoncc is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with cpumoncc; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-
-*/
-
-// CpuMonitorCC/Solaris
-
-#include "CpuMonitor.h"
-
-CpuMonitor::CpuMonitor() : BaseCpuMonitor()
-{
- initialize();
-}
-
-CpuMonitor::CpuMonitor(int cpu) : BaseCpuMonitor()
-{
- which_cpu = cpu;
- initialize();
-}
-
-void CpuMonitor::initialize()
-{
- kstat_t *ksp;
- int i = 0;
-
- if (kc == NULL)
- if ((kc = kstat_open()) == NULL)
- throw runtime_error("CpuMonitor: can't open /dev/kstat.");
-
- if (which_cpu != -1)
- {
- /*
- * User selected to monitor a particlur CPU. Find it...
- */
- for (ksp = kc->kc_chain; ksp; ksp = ksp->ks_next)
- if ((strcmp(ksp->ks_module, "cpu_stat") == 0) && (ksp->ks_instance == which_cpu))
- {
- the_cpu = ksp;
- break;
- }
- if (the_cpu == NULL) throw runtime_error("CpuMonitor: Cpu not found.");
- }
- else
- {
- /*
- * User selected to monitor all CPUs. First, count them.
- */
- for (ksp = kc->kc_chain; ksp; ksp = ksp->ks_next)
- if (strcmp(ksp->ks_module, "cpu_stat") == 0) i++;
-
- if (cpu_ksp_list) free(cpu_ksp_list);
-
- cpu_ksp_list = (kstat_t **) calloc(i * sizeof (kstat_t *), 1);
- ncpus = i;
-
- /*
- * stash the ksp for each CPU.
- */
- i = 0;
- for (ksp = kc->kc_chain; ksp; ksp = ksp->ks_next)
- if (strcmp(ksp->ks_module, "cpu_stat") == 0)
- {
- cpu_ksp_list[i] = ksp;
- i++;
- }
- }
-}
-
-float CpuMonitor::getLoad()
-{
- int i;
- cpu_stat_t stat;
- int used, total, user = 0, wait = 0, kern = 0, idle = 0;
- float t;
-
- /*
- * Read each cpu's data. If the kstat chain has changed (a state change
- * has happened, maybe a new cpu was added to the system or one went
- * away), then reinitialize everything with initialize(). Finally,
- * recursively call getLoad().
- *
- * We'll need to do a little better than this in the future, since we
- * could recurse too much in the pathological case here.
- */
- if (which_cpu == -1)
- {
- for (i = 0; i < ncpus; i++)
- {
- if (kstat_read(kc, cpu_ksp_list[i], (void *)&stat) == -1)
- {
- // Dont try-catch, let the caller of first getLoad() do that
- initialize();
-
- return getLoad();
- }
- user += stat.cpu_sysinfo.cpu[CPU_USER]; /* user */
- wait += stat.cpu_sysinfo.cpu[CPU_WAIT]; /* io wait */
- kern += stat.cpu_sysinfo.cpu[CPU_KERNEL]; /* sys */
- idle += stat.cpu_sysinfo.cpu[CPU_IDLE]; /*idle("free")*/
- }
- }
- else
- {
- if (kstat_read(kc, the_cpu, (void *)&stat) == -1)
- {
- // Dont try-catch, let the caller of first getLoad() do that
- initialize();
-
- return getLoad();
- }
- user += stat.cpu_sysinfo.cpu[CPU_USER]; /* user */
- wait += stat.cpu_sysinfo.cpu[CPU_WAIT]; /* io wait */
- kern += stat.cpu_sysinfo.cpu[CPU_KERNEL]; /* sys */
- idle += stat.cpu_sysinfo.cpu[CPU_IDLE]; /* idle("free") */
- }
-
- used = user + wait + kern;
- total = used + idle;
- t = range * (float)(used - previous_used) / (float)(total - previous_total);
- previous_total = total;
- previous_used = used;
-
- return t;
-}
diff --git a/wmcube/cpumoncc/solaris/CpuMonitor.h b/wmcube/cpumoncc/solaris/CpuMonitor.h
deleted file mode 100644
index 5a1f00c57478..000000000000
--- a/wmcube/cpumoncc/solaris/CpuMonitor.h
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
-
- Copyright (C) 2003 Robert Kling, robk...@student.luth.se
-
- This file is part of CpuMonitorCC (cpumoncc)
-
- cpumoncc is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- cpumoncc is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with cpumoncc; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-
-*/
-
-// CpuMonitorCC/Solaris
-
-#ifndef _CPUMONITOR_H_
-#define _CPUMONITOR_H_
-
-#include <sys/types.h>
-#include <sys/sysinfo.h>
-#include <kstat.h>
-#include "BaseCpuMonitor.h"
-
-class CpuMonitor : public BaseCpuMonitor
-{
-public:
-
- CpuMonitor();
- CpuMonitor(int cpu);
- ~CpuMonitor();
-
- float getLoad();
-
-private:
-
- void initialize();
-
- kstat_ctl_t *kc;
- kstat_t **cpu_ksp_list;
- kstat_t *the_cpu;
- int ncpus;
-};
-
-#endif
diff --git a/wmcube/cpumoncc/solaris/Makefile b/wmcube/cpumoncc/solaris/Makefile
deleted file mode 100644
index 84d09e318a28..000000000000
--- a/wmcube/cpumoncc/solaris/Makefile
+++ /dev/null
@@ -1,40 +0,0 @@
-######################################################
-#
-# To compile cpumoncc for a different OS/architecture you
-# will need to modify the variablese below to match your system.
-#
-# For system wide installation type (as root):
-#
-# make install
-#
-# This will install the static library in $(LIBINSTALL) and
-# the header files in $(HINSTALL)/cpumoncc.
-#
-#####################################################
-
-CXX=g++
-CXXFLAGS=-L/opt/sfw/lib -L/usr/local/lib -R/opt/sfw/lib -R/usr/local/lib -lkstat
-HINSTALL=/usr/include
-LIBINSTALL=/usr/lib
-
-#####################################################
-
-TARGET=libcpumoncc.a
-
-$(TARGET): CpuMonitor.o
- ar rcs $(TARGET) $^
-
-CpuMonitor.o: copy_base
-
-copy_base:
- cp ../base/BaseCpuMonitor.h .
-
-install: $(TARGET)
- mkdir -p $(HINSTALL)/cpumoncc
- cp *.h $(HINSTALL)/cpumoncc
- install -m 644 $(TARGET) $(LIBINSTALL)
-
-clean:
- rm -f *~ core *.o cpu $(TARGET) BaseCpuMonitor.h
- rm -fr $(HINSTALL)/cpumoncc
- rm -f $(LIBINSTALL)/$(TARGET)
\ No newline at end of file
diff --git a/wmcube/wmapp/COPYING b/wmcube/wmapp/COPYING
deleted file mode 100644
index 5197aeee3ac7..000000000000
--- a/wmcube/wmapp/COPYING
+++ /dev/null
@@ -1,340 +0,0 @@
- GNU GENERAL PUBLIC LICENSE
- Version 2, June 1991
-
- Copyright (C) 1989, 1991 Free Software Foundation, Inc.
- 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- Everyone is permitted to copy and distribute verbatim copies
- of this license document, but changing it is not allowed.
-
- Preamble
-
- The licenses for most software are designed to take away your
-freedom to share and change it. By contrast, the GNU General Public
-License is intended to guarantee your freedom to share and change free
-software--to make sure the software is free for all its users. This
-General Public License applies to most of the Free Software
-Foundation's software and to any other program whose authors commit to
-using it. (Some other Free Software Foundation software is covered by
-the GNU Library General Public License instead.) You can apply it to
-your programs, too.
-
- When we speak of free software, we are referring to freedom, not
-price. Our General Public Licenses are designed to make sure that you
-have the freedom to distribute copies of free software (and charge for
-this service if you wish), that you receive source code or can get it
-if you want it, that you can change the software or use pieces of it
-in new free programs; and that you know you can do these things.
-
- To protect your rights, we need to make restrictions that forbid
-anyone to deny you these rights or to ask you to surrender the rights.
-These restrictions translate to certain responsibilities for you if you
-distribute copies of the software, or if you modify it.
-
- For example, if you distribute copies of such a program, whether
-gratis or for a fee, you must give the recipients all the rights that
-you have. You must make sure that they, too, receive or can get the
-source code. And you must show them these terms so they know their
-rights.
-
- We protect your rights with two steps: (1) copyright the software, and
-(2) offer you this license which gives you legal permission to copy,
-distribute and/or modify the software.
-
- Also, for each author's protection and ours, we want to make certain
-that everyone understands that there is no warranty for this free
-software. If the software is modified by someone else and passed on, we
-want its recipients to know that what they have is not the original, so
-that any problems introduced by others will not reflect on the original
-authors' reputations.
-
- Finally, any free program is threatened constantly by software
-patents. We wish to avoid the danger that redistributors of a free
-program will individually obtain patent licenses, in effect making the
-program proprietary. To prevent this, we have made it clear that any
-patent must be licensed for everyone's free use or not licensed at all.
-
- The precise terms and conditions for copying, distribution and
-modification follow.
-
- GNU GENERAL PUBLIC LICENSE
- TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
-
- 0. This License applies to any program or other work which contains
-a notice placed by the copyright holder saying it may be distributed
-under the terms of this General Public License. The "Program", below,
-refers to any such program or work, and a "work based on the Program"
-means either the Program or any derivative work under copyright law:
-that is to say, a work containing the Program or a portion of it,
-either verbatim or with modifications and/or translated into another
-language. (Hereinafter, translation is included without limitation in
-the term "modification".) Each licensee is addressed as "you".
-
-Activities other than copying, distribution and modification are not
-covered by this License; they are outside its scope. The act of
-running the Program is not restricted, and the output from the Program
-is covered only if its contents constitute a work based on the
-Program (independent of having been made by running the Program).
-Whether that is true depends on what the Program does.
-
- 1. You may copy and distribute verbatim copies of the Program's
-source code as you receive it, in any medium, provided that you
-conspicuously and appropriately publish on each copy an appropriate
-copyright notice and disclaimer of warranty; keep intact all the
-notices that refer to this License and to the absence of any warranty;
-and give any other recipients of the Program a copy of this License
-along with the Program.
-
-You may charge a fee for the physical act of transferring a copy, and
-you may at your option offer warranty protection in exchange for a fee.
-
- 2. You may modify your copy or copies of the Program or any portion
-of it, thus forming a work based on the Program, and copy and
-distribute such modifications or work under the terms of Section 1
-above, provided that you also meet all of these conditions:
-
- a) You must cause the modified files to carry prominent notices
- stating that you changed the files and the date of any change.
-
- b) You must cause any work that you distribute or publish, that in
- whole or in part contains or is derived from the Program or any
- part thereof, to be licensed as a whole at no charge to all third
- parties under the terms of this License.
-
- c) If the modified program normally reads commands interactively
- when run, you must cause it, when started running for such
- interactive use in the most ordinary way, to print or display an
- announcement including an appropriate copyright notice and a
- notice that there is no warranty (or else, saying that you provide
- a warranty) and that users may redistribute the program under
- these conditions, and telling the user how to view a copy of this
- License. (Exception: if the Program itself is interactive but
- does not normally print such an announcement, your work based on
- the Program is not required to print an announcement.)
-
-These requirements apply to the modified work as a whole. If
-identifiable sections of that work are not derived from the Program,
-and can be reasonably considered independent and separate works in
-themselves, then this License, and its terms, do not apply to those
-sections when you distribute them as separate works. But when you
-distribute the same sections as part of a whole which is a work based
-on the Program, the distribution of the whole must be on the terms of
-this License, whose permissions for other licensees extend to the
-entire whole, and thus to each and every part regardless of who wrote it.
-
-Thus, it is not the intent of this section to claim rights or contest
-your rights to work written entirely by you; rather, the intent is to
-exercise the right to control the distribution of derivative or
-collective works based on the Program.
-
-In addition, mere aggregation of another work not based on the Program
-with the Program (or with a work based on the Program) on a volume of
-a storage or distribution medium does not bring the other work under
-the scope of this License.
-
- 3. You may copy and distribute the Program (or a work based on it,
-under Section 2) in object code or executable form under the terms of
-Sections 1 and 2 above provided that you also do one of the following:
-
- a) Accompany it with the complete corresponding machine-readable
- source code, which must be distributed under the terms of Sections
- 1 and 2 above on a medium customarily used for software interchange; or,
-
- b) Accompany it with a written offer, valid for at least three
- years, to give any third party, for a charge no more than your
- cost of physically performing source distribution, a complete
- machine-readable copy of the corresponding source code, to be
- distributed under the terms of Sections 1 and 2 above on a medium
- customarily used for software interchange; or,
-
- c) Accompany it with the information you received as to the offer
- to distribute corresponding source code. (This alternative is
- allowed only for noncommercial distribution and only if you
- received the program in object code or executable form with such
- an offer, in accord with Subsection b above.)
-
-The source code for a work means the preferred form of the work for
-making modifications to it. For an executable work, complete source
-code means all the source code for all modules it contains, plus any
-associated interface definition files, plus the scripts used to
-control compilation and installation of the executable. However, as a
-special exception, the source code distributed need not include
-anything that is normally distributed (in either source or binary
-form) with the major components (compiler, kernel, and so on) of the
-operating system on which the executable runs, unless that component
-itself accompanies the executable.
-
-If distribution of executable or object code is made by offering
-access to copy from a designated place, then offering equivalent
-access to copy the source code from the same place counts as
-distribution of the source code, even though third parties are not
-compelled to copy the source along with the object code.
-
- 4. You may not copy, modify, sublicense, or distribute the Program
-except as expressly provided under this License. Any attempt
-otherwise to copy, modify, sublicense or distribute the Program is
-void, and will automatically terminate your rights under this License.
-However, parties who have received copies, or rights, from you under
-this License will not have their licenses terminated so long as such
-parties remain in full compliance.
-
- 5. You are not required to accept this License, since you have not
-signed it. However, nothing else grants you permission to modify or
-distribute the Program or its derivative works. These actions are
-prohibited by law if you do not accept this License. Therefore, by
-modifying or distributing the Program (or any work based on the
-Program), you indicate your acceptance of this License to do so, and
-all its terms and conditions for copying, distributing or modifying
-the Program or works based on it.
-
- 6. Each time you redistribute the Program (or any work based on the
-Program), the recipient automatically receives a license from the
-original licensor to copy, distribute or modify the Program subject to
-these terms and conditions. You may not impose any further
-restrictions on the recipients' exercise of the rights granted herein.
-You are not responsible for enforcing compliance by third parties to
-this License.
-
- 7. If, as a consequence of a court judgment or allegation of patent
-infringement or for any other reason (not limited to patent issues),
-conditions are imposed on you (whether by court order, agreement or
-otherwise) that contradict the conditions of this License, they do not
-excuse you from the conditions of this License. If you cannot
-distribute so as to satisfy simultaneously your obligations under this
-License and any other pertinent obligations, then as a consequence you
-may not distribute the Program at all. For example, if a patent
-license would not permit royalty-free redistribution of the Program by
-all those who receive copies directly or indirectly through you, then
-the only way you could satisfy both it and this License would be to
-refrain entirely from distribution of the Program.
-
-If any portion of this section is held invalid or unenforceable under
-any particular circumstance, the balance of the section is intended to
-apply and the section as a whole is intended to apply in other
-circumstances.
-
-It is not the purpose of this section to induce you to infringe any
-patents or other property right claims or to contest validity of any
-such claims; this section has the sole purpose of protecting the
-integrity of the free software distribution system, which is
-implemented by public license practices. Many people have made
-generous contributions to the wide range of software distributed
-through that system in reliance on consistent application of that
-system; it is up to the author/donor to decide if he or she is willing
-to distribute software through any other system and a licensee cannot
-impose that choice.
-
-This section is intended to make thoroughly clear what is believed to
-be a consequence of the rest of this License.
-
- 8. If the distribution and/or use of the Program is restricted in
-certain countries either by patents or by copyrighted interfaces, the
-original copyright holder who places the Program under this License
-may add an explicit geographical distribution limitation excluding
-those countries, so that distribution is permitted only in or among
-countries not thus excluded. In such case, this License incorporates
-the limitation as if written in the body of this License.
-
- 9. The Free Software Foundation may publish revised and/or new versions
-of the General Public License from time to time. Such new versions will
-be similar in spirit to the present version, but may differ in detail to
-address new problems or concerns.
-
-Each version is given a distinguishing version number. If the Program
-specifies a version number of this License which applies to it and "any
-later version", you have the option of following the terms and conditions
-either of that version or of any later version published by the Free
-Software Foundation. If the Program does not specify a version number of
-this License, you may choose any version ever published by the Free Software
-Foundation.
-
- 10. If you wish to incorporate parts of the Program into other free
-programs whose distribution conditions are different, write to the author
-to ask for permission. For software which is copyrighted by the Free
-Software Foundation, write to the Free Software Foundation; we sometimes
-make exceptions for this. Our decision will be guided by the two goals
-of preserving the free status of all derivatives of our free software and
-of promoting the sharing and reuse of software generally.
-
- NO WARRANTY
-
- 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
-FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
-OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
-PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
-OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
-MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
-TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
-PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
-REPAIR OR CORRECTION.
-
- 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
-WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
-REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
-INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
-OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
-TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
-YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
-PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
-POSSIBILITY OF SUCH DAMAGES.
-
- END OF TERMS AND CONDITIONS
-
- How to Apply These Terms to Your New Programs
-
- If you develop a new program, and you want it to be of the greatest
-possible use to the public, the best way to achieve this is to make it
-free software which everyone can redistribute and change under these terms.
-
- To do so, attach the following notices to the program. It is safest
-to attach them to the start of each source file to most effectively
-convey the exclusion of warranty; and each file should have at least
-the "copyright" line and a pointer to where the full notice is found.
-
- <one line to give the program's name and a brief idea of what it does.>
- Copyright (C) yyyy <name of author>
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-
-
-Also add information on how to contact you by electronic and paper mail.
-
-If the program is interactive, make it output a short notice like this
-when it starts in an interactive mode:
-
- Gnomovision version 69, Copyright (C) year name of author
- Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
- This is free software, and you are welcome to redistribute it
- under certain conditions; type `show c' for details.
-
-The hypothetical commands `show w' and `show c' should show the appropriate
-parts of the General Public License. Of course, the commands you use may
-be called something other than `show w' and `show c'; they could even be
-mouse-clicks or menu items--whatever suits your program.
-
-You should also get your employer (if you work as a programmer) or your
-school, if any, to sign a "copyright disclaimer" for the program, if
-necessary. Here is a sample; alter the names:
-
- Yoyodyne, Inc., hereby disclaims all copyright interest in the program
- `Gnomovision' (which makes passes at compilers) written by James Hacker.
-
- <signature of Ty Coon>, 1 April 1989
- Ty Coon, President of Vice
-
-This General Public License does not permit incorporating your program into
-proprietary programs. If your program is a subroutine library, you may
-consider it more useful to permit linking proprietary applications with the
-library. If this is what you want to do, use the GNU Library General
-Public License instead of this License.
diff --git a/wmcube/wmapp/Changelog b/wmcube/wmapp/Changelog
deleted file mode 100644
index fe9961f60816..000000000000
--- a/wmcube/wmapp/Changelog
+++ /dev/null
@@ -1,82 +0,0 @@
-Changelog for WMApp
-
-Version Changes
-------- -------
-0.0.4.1 * Bug fixes for 0.0.4:
- * remove stray inline keyword from wmwidget.cc
- * fix masking of shaped widgets in a non-transparent frame
- * fix interpolation in WMEllipse::draw_border()
- * remove WMCanvas::copy_buffer(); use WMCanvas::display()
- instead
- * make planes in example2/wmradar.cc still light up when
- speed == 0; other cosmetic changes
- * fix indentation in xwrapper.cc
-
-0.0.4 * this version of WMApp brought to you by Jason (see
- Changelog.Jason for greater detail)
- * Improve consistency by changing header #include statements
- and class inheritance tree in places
- * Add draw_arc() and fill_arc() functions to XWrapper and
- WMCanvas classes
- * Add WMWidget::contains() function and give each pixmap its
- own GC to make creation of shaped widgets easier
- * Add WMClickable base class
- * Add WMEllipse base class: places its contents in an ellipse
- when inherited from
- * Replace Color typedef with Color class, adding useful
- Color::alpha_blend() static function
- * New example game, wmatc (WM Air Traffic Control), to
- illustrate integration of several widgets
- * Fix bug that forced a need for setaspectratios() to always
- be called, even in case with only one child widget
-
-0.0.3 * Makefile simplification by Jason
- * Tidy up the internals of WMCallback class, by Jason
- * Each widget now has its own .h and .cc files for better
- source code modularity (delete the ones you don't need)
- * Additions of WMCanvas draw_lines(), fill_polygon() methods
- by Jason
- * Addition of buffered drawing mode for WMCanvas
- * Optimization of WMImage real_display() function
- * Clean up code for WMCanvas now that WMImage::icon() is
- the same size as the widget sans border
-
-0.0.2 * Addition of WMMouseClick::relative_to(WMWidget), allowing
- to more easily find the location of a mouseclick within
- a widget.
- * Added b_* functions, giving coordinates of that part of a
- widget contained inside its border.
- * Break up the example program into different files for
- clarity.
- * Fix problem with WMImage not displaying background color
- in some circumstances.
- * Renamed some member functions for greater consistency
- (setcallback() -> addcallback(), for instance)
- * Changed API for timed interval functions in WMWindow.
- * The order in which the two prototypes of callback functions
- are executed may now be interleaved.
- * Add a WMCanvas widget for drawing purposes; the wmexample
- program (file example/window1.cc) shows how it may be used.
- * Update FAQ.
-
-0.0.1 * New widget: WMSlider
- * Buttons now depress when clicked upon.
- * Any widget can now have a border, not just a WMFrame.
- * Now easy to determine which mouse button was clicked.
- * Widgets other than WMButton and WMWindow can have
- callbacks attached; see new FAQ.txt for details.
- * Changes by Jason: (see Changelog.Jason for details)
- * Fixed X resource leak
- * Changed all instances of "NULL" to "0"
- * Removed redundant constructors
- * Cleaned up some code formatting
-
-0.0.0.20020502 * Added Changelog, small edits to README
- * Sample program now called wmexample
-
-0.0.0.20020501 * Merged Jason's additions of WMHistory and WMMeterBar
-
-0.0.0.20011212 * First version of library in a usable form
-
--Kevin B. McCarty <kmcc...@princeton.edu>
-
diff --git a/wmcube/wmapp/Changelog.Jason b/wmcube/wmapp/Changelog.Jason
deleted file mode 100644
index dca2522b3122..000000000000
--- a/wmcube/wmapp/Changelog.Jason
+++ /dev/null
@@ -1,154 +0,0 @@
-2003-01-05
-
- * example2/wmradar.cc: Make planes still light up when speed == 0 (oops).
- Other cosmetic changes.
-
- * wmellipse.cc (draw_border(...)): Fix interpolation.
-
- * wmwllipse.h: Remove obsolete comment.
-
- * wmframe.cc: Fix masking when frame isn't transparent.
-
- * wmframe.h: Add clipping mask data member. Move clip() to wmframe.cc.
-
- * xwrapper.cc (draw_horizontal_gradient,draw_vertical_gradient):
- Reformat indentation (it was so ugly!).
-
- * FAQ.txt: Remove notes about ellipse/frame clipping bugs.
-
- * wmcanvas.cc: Note that copy_buffer() is just a partial reimplementation
- of WMImage::real_display(). So wBuffered is really just a class-wide
- dodisplay setting. As such, replace calls to copy_buffer() with
- display(). Might want to rename some things in light of this, as well as
- remove copy_buffer().
-
-Some other days:
-
- * example2/{wmradar.cc,wmradar.h,wmairtrafficcontrol.cc}: New example game
- demonstrating the integration of several widgets.
-
-2002-12-28
-
- * wmclickable.h: New class for clickable widgets.
-
- * wmwindow.h wmframe.h, wmframe.cc, wmcallback.h: Use WMClickable.
-
-2002-12-21
-
- * wmapp.cc: WMFrameBorderBright is too dim. Other dockapps look like
- they use 0xC8C[38]C8.
-
- * xwrapper.h, xwrapper.cc: Give each pixmap its own GC, and set clipping
- mask to dest.mask if it's there. Enables me to remove kludgy use_mask().
-
- * wmimage.cc, wmapp.cc, wmapp.h, wmcanvas.cc: Remove use_mask().
-
- * wmimage.h, wmimage.cc: New function seticon(bool) to set a blank
- b_width() by b_height() icon.
-
- * wmcanvas.h, wmcanvas.cc: New functions draw_arc() and fill_arc().
-
-2002-12-20
-
- * wmellipse.h, wmellipse.cc: New class WMEllipse, places its contents in
- an ellipse.
-
- * wmwidget.h: Add contains() function to WMWidget. This enables the
- creation of arbitrarily shaped viewports, in the style of WMEllipse.
-
- * wmapp.h, wmapp.cc: Add use_mask() function, to muck with GC masking.
- Needed so that WMEllipse is humanly possible.
- Whenever drawing to the window, call app()->use_mask(true). When
- drawing on any other pixmap, call use_mask(false). Default setting is
- true. A better solution would be to have one GC for each window, and a
- single GC for everything else.
-
- * wmimage.cc, wmcanvas.cc: Modify to use use_mask.
-
- * xwrapper.h, xwrapper.cc: New functions draw_arc() and fill_arc().
-
- * wmwidget.h, various: Put back WMFrame for parent().
-
- * Widgets.txt: Update.
-
-2002-12-19
-
- * xwapper.h: Fix header inclusion order problems. Now you can
- #include "xwrapper.h" anywhere you like.
-
- * wmframe.h, wmframe.cc: Simplify and improve consistency by inheriting
- from WMCallback.
-
- * wmwindow.h: Only inherit from WMFrame.
-
- * various: Reorder #include statements to include only necessary files.
- Use WMWidget* instead of WMFrame* for parent().
-
- * Makefile, example/Makefile: Tweak.
-
-2002-05-08
-
- * xwrapper.cc:
- "Fixed" X memory leak caused by repetitive calls to XAllocColor. <rant>
- Bizarrly, there doesn't appear to be a way to get the colormap index of an
- RGB color without allocating it. Ideally, you would only allocate each color
- once, but the only apparent way to do this is to keep your own custom
- colormap with reference counts, since X won't tell you the index of a color
- without allocating it. And without reference counts, the only way to keep
- from allocating repeatedly is to deallocate after each allocation. But this
- means that you're using colors which haven't been allocated. Realistically,
- this doesn't matter except in 8 bit mode, where there aren't enough colors
- for the spectrum-style WMMeterBar. In order to display well in 8 bit mode,
- it seems that major color management is necessary, as X is far too stupid to
- do it for us. Maybe I should look at Berlin again. </rant>
-
-2002-05-07
-
- * wmwidgets.cc, wmwidgets.h, wmapp.h, wmextras.h xwrapper.cc,
- example/wmexample.cc, FAQ.txt:
- Removed all pointer comparisons/assignments to NULL. NULL isn't type-safe,
- and in C++, "if (ptr != NULL)" is the same as "if (ptr)" because "No object
- is allocated with the address 0" (Stroustrup 88).
-
- * wmapp.cc, wmwidgets.cc:
- Removed more redundant constructor calls.
-
- * wmwidgets.cc, wmwidgets.h:
- - Slight formatting fix again.
- - Wrote a destructor for WMWindow to deallocate its pixmaps.
- - Made initpixmaps() be called only once for each window. This fixes a
- memory leak in X that occurred when switching windows.
-
- * wmapp.cc, wmapp.h:
- - Wrote a short destructor to deallocate windows (probably unnecessary).
- - delete[]'d character arrays after XSetClassHint().
-
- * xwrapper.cc, xwrapper.h:
- Wrote a free_pixmap() function to complement create_pixmap (don't call
- create_pixmap() on an existing pixmap without freeing it first!).
-
-2002-05-06
-
- * xwrapper.cc:
- - Cleaned up get_point() a little.
- - Added simple deallocation in Xwrapper::~Xwrapper ().
-
- * wmapp.cc:69
- Removed redundant assignment to static Xwrapper object after it was
- already constructed (which caused my previous modification to crash due to
- the destructor being called twice).
-
- * wmwidgets.txt:
- Added WMSlider to the class hierarchy and removed tabs.
-
- * wmextras.h:
- Removed redundant calls to base class constructors and members.
-
-2002-05-05
-
- * wmextras.cc:
- Merged slider_click() and slider_scroll() into one, simpler/more readable
- function.
-
- * wmwidgets.cc:
- Cleaned up my formatting a little.
diff --git a/wmcube/wmapp/FAQ.txt b/wmcube/wmapp/FAQ.txt
deleted file mode 100644
index dd87cf893a9d..000000000000
--- a/wmcube/wmapp/FAQ.txt
+++ /dev/null
@@ -1,278 +0,0 @@
-WMApp DockApp Library -- FAQ
-
-Starred items below are new or significantly updated for the latest release
-of WMApp, 0.0.4, or bug-fix release 0.0.4.1.
-
-1. Widget Layout
- 1.1. Can I specify widget positions in absolute coordinates?
- *1.2. Help! My layout is all messed up!
- 1.3. Widgets that are all supposed to be the same size aren't.
- 1.4. How do I keep a frame from having transparent padding?
-
-2. Callbacks and timed-execution functions
- 2.1. How do I write a callback function?
- 2.2. Can I attach a callback to widgets other than the WMButton?
- 2.3. Which mouse button was pressed?
- 2.4. At what location was the widget clicked?
- 2.5. What is the story with callbacks on a WMWindow? (a.k.a.
- executing functions at regular intervals)
-
-3. Specific widget questions
- *3.1. How to use a WMCanvas?
- *3.2. How to use a WMEllipse?
- *3.3. How to create other shapes of widget?
-
-4. Memory issues
- 4.1. Why do I get a (segmentation fault | runtime error saying "pure
- virtual function called") in my program?
-
-1.1. Can I specify widget positions in absolute coordinates?
-
-Yes, if you really must.
-
-Make sure the widget fits inside its parent widget, or there will probably be
-a mess. The easiest way to do this is probably to set its position relative
-to its parent's:
-
- widget.setposition(WMRectangle(parent.left()+wleft, parent.top()+wtop,
- wwidth, wheight));
-
-where wleft, wtop are the desired coordinates of the widget relative to the
-top left corner of its parent. Remember that the 56x56 pixel WMWindow will
-have a different offset in Afterstep vs. WindowMaker mode, so at least
-operate relative to a previously declared WMWindow in all of your coordinates.
-
-If you are using both absolute positioning and automatic layout with
-setaspectratios(), you may get unexpected results. See 1.3 for a better way.
-
-1.2. Help! My layout is all messed up!
-
-Always lay out widgets in the order from parent to child:
-
- window.addchild(frame1);
- window.addchild(frame2);
- window.setaspectratios(2, 3);
-
- frame1.addchild(textbar);
- frame1.addchild(led);
- frame1.addchild(meterbar);
- textbar.setwidth(24);
- frame1.setaspectratios(0, 4, 1);
- // etc.
-
-Always set the border and padding for a frame before calling setaspectratios()
-on it. [As of WMApp 0.0.4, you no longer have to call setaspectratios()
-explicitly when a frame has only one child, or when you want all children of a
-frame to be of equal size.] And don't forget that borders around any widgets
-are included in their dimensions.
-
-1.3. Widgets that are all supposed to be the same size aren't.
-
-This is due to rounding in the process of setting widget aspect ratios.
-All accumulated rounding error ends up on the last widget in the frame.
-(TODO: spread out the rounding error more evenly)
-
-If you are a stickler for accuracy, you can draw your widget layout on
-a 56x56 grid. Use the grid to determine the exact sizes, then in all calls
-to setaspectratios(), use these sizes.
-
-1.4. How do I keep a frame from having transparent padding?
-
- frame.settransparency(false);
-
-Note: In order for a frame to _have_ transparent padding, its border thickness
-must also be zero.
-
-2.1. How do I write a callback function?
-
-There are two types of callback, with the prototypes
-
- void callback1(const WMApp *a, void *data)
- void callback2(const WMApp *a, WMWidget *w, void *data)
-
-First you write a function with one of these prototypes. For instance,
-to exit the application, the callback function is simply
-
- void halt(const WMApp *a, void *) { a->stop(); }
-
-Any additional data needed by the callback function may be passed as a pointer
-to void. For convenience, you may pass in the address of one WMWidget to the
-second callback prototype without dealing with pointers to void. Dynamic
-casting in the body of the callback function may be necessary; see the example
-program code in example/window0.cc for details.
-
-Given this, you may attach callbacks to a WMButton or other WMCallback object
-as follows:
-
- button.addcallback(stop, 0 /* no additional data needed */);
- button.addcallback(another_callback, &other_widget, &some_data);
-
-(Notice that the name changed from setcallback to addcallback!)
-When a WMButton is pressed, all the callbacks will be executed in the order
-in which they were attached.
-
-2.2. Can I attach a callback to widgets other than the WMButton or WMWindow?
-
-Yes! Define a new class that inherits from both the desired widget and from
-WMCallback. For example, the following code lets you clear a WMHistory
-widget by clicking on it.
-
-Note: if you are using a pointer to the inherited class as the "void *"
-argument of a callback function, be sure to first statically cast it to a
-"WMWidget *". Dynamic casts from "void *" aren't guaranteed to work in C++.
-
- // Define the new class
- class WMHistoryCallback : public WMCallback, public WMHistory {
- public: WMHistoryCallback() : WMCallback(), WMHistory() { }
- };
-
- // Callback to clear a WMHistory widget when it's clicked on
- void clearhistory(const WMApp *a, WMWidget *w, void *)
- {
- WMHistoryCallback *h = dynamic_cast<WMHistoryCallback *>(w);
-
- // check that dynamic_cast doesn't return null pointer! maybe you
- // even want "assert(h)" instead of "if (h)"
- if (h) h->clear();
- }
-
- int main(int argc, char **argv)
- {
- WMApp::initialize(argc, argv);
-
- WMHistoryCallback h;
- h.addcallback(clearhistory, &h, 0);
- // ...
- }
-
-2.3. Which mouse button was pressed?
-
-This can be retrieved from the application class. The following code
-fragment is a callback that will execute only when mouse button 1 is
-released:
-
- void callback(WMApp *a, void *)
- {
- if (a->mouseclick().button != Button1) return;
- // body of function goes here
- }
-
-Recall that in most cases (if XFree86 has been set up correctly), the "up" and
-"down" directions of a mouse scroll wheel correspond to Button4 and Button5.
-But don't forget while designing your program interface that not everyone has a
-scroll-wheel mouse!
-
-2.4. At what location was the widget clicked?
-
-Position of the mouse click relative to the _application_ may be retrieved
-within a callback via a->mouseclick().x and a->mouseclick().y . Note that
-these are the coordinates of the cursor when the mouse button is _released_,
-which is when the callbacks are executed. To make these coordinates useful,
-you probably want to use a->mouseclick().relative_to(w).x and .y, where w is a
-pointer to the widget executing the callback. This gives the coordinates
-of the mouseclick relative to the left and top bounds of the widget. You
-can get the coordinates relative only to the part of the widget INSIDE its
-border using the b_relative_to() function.
-
-The most recent mouse button release may also be examined outside any callback
-functions. Keep in mind that this will not necessarily correspond to the
-execution of any callback functions, since the mouse may have been clicked
-over a widget with no callbacks.
-
-2.5. What is the story with callbacks on a WMWindow? (a.k.a. executing
-functions at regular intervals)
-
-In version 0.0.1, there existed a WMWindow::setcallback() method. This
-actually didn't set callbacks, but instead set functions to execute at regular
-intervals (for use in clocks, timing out internet connections, etc.). Since
-the name was confusing, in 0.0.2 I've replaced it by the
-WMWindow::add_timed_function() method.
-
-As with callbacks, there are two types of possible timed-execution functions:
-
- void timed_function1(WMApp *, WMWidget *);
- void timed_function2(WMApp *, WMWidget *, void * data);
-
-They should be attached to a window as follows:
-
- window.add_timed_function(period, timed_function1, &some_data);
- window.add_timed_function(period, timed_function2, &a_widget, &data);
-
-where "period" is an integer that specifies how often the timed-execution
-function should run, in centiseconds (e.g. to run a function every 5 seconds,
-use a period of 500). You can change this base time interval of 10 millisec
-using the WMWindow::setupdatefreq() member function.
-
-Of course, these regular intervals are not exact, since they do not take into
-account the times needed to redraw widgets, execute callback functions, and
-execute the timed-execution functions themselves. Don't rely on them for
-air traffic control. (Of course, Jason went ahead and did just that --
-see the code in the example2 directory, or just "make wmatc")
-
-For an example use, see the code for the clock in example/window0.cc.
-
-3.1. How to use a WMCanvas?
-
-The canvas widget may be used in two modes: buffered and unbuffered. To
-switch between them: wmcanvas_ptr->setbuffered(true) [or false, whichever].
-In unbuffered mode (the default), any drawings upon the widget will immediately
-be copied to the WMWindow pixmap, and will show up the next time the
-WMApp::repaint() method is called. In buffered mode, changes to the WMCanvas
-will not be copied to the WMWindow's pixmap until the WMCanvas::display()
-method is called. The advantage to buffered mode is that it uses less CPU
-and it lets you make a number of changes that display all at once.
-
-There are a number of drawing functions available. WMCanvas is stateful, so
-you must set the drawing color with WMCanvas::setcolor each time you want to
-draw in a different color. Having set the desired color (if unset, it defaults
-to the traditional WMApp foreground turquoise-ish color), you may use various
-drawing methods. The x and y coordinates in these drawing methods are always
-relative to the INSIDE of the WMCanvas widget (i.e. not including the border).
-
-setcolor(Color c)
- Set the current drawing color to c.
-draw_point(int x, int y)
- Draw a [1-pixel wide] point at position (x,y).
-draw_line(int x1, int y1, int x2, int y2)
- Draw a line from (x1,y1) to (x2,y2).
-draw_lines(const vector<X::XPoint> & points)
- Draw a set of connected lines (think connect-the-dots) from point to
- point.
-
-The full list of drawing methods may of course be found in wmcanvas.h.
-For a somewhat trivial example use of a WMCanvas with an attached callback
-function (the world's dumbest paint program), see the code located in
-example1/window1.cc. A more interesting use is prototyped in
-example2/wmradar.h.
-
-3.2. How to use a WMEllipse?
-
-To create an elliptical widget, make a new class that inherits from both the
-desired widget and from the WMEllipse. This will usually work trivially as
-shown in the two example programs.
-
-3.3. How to create other shapes of widget?
-
-Using wmellipse.h and wmellipse.cc as models, you just have to write a
-"contains" method that specifies which points are inside the borders of
-your shape, and a "draw_border" method that tells how to draw a border for
-your shape. Inherit from both your shape and from some WMWidget. Clipping,
-execution of callbacks when the mouse is clicked inside your shape, and so on,
-will be done automagically by the library.
-
-4.1. Why do I get a (segmentation fault | runtime error saying "pure virtual
-function called") in my program?
-
-If you write a function that returns a WMFrame or WMWindow complete with
-all its child widgets set up, the child widgets must have been either declared
-static inside that function, or else allocated on the heap with "new".
-Otherwise they do not exist in memory at the time the WMApp tries to display
-them. This is clearly bad :-)
-
-I presume that the misleading "pure virtual function called" error occurs
-because the run-time type identification of the C++ program sees garbage at a
-memory location which is supposed to be a class inherited from WMWidget. Then,
-having no idea what to make of the garbage, the program casts it to the base
-class WMWidget, resulting in a call to WMWidget::real_display(), a pure virtual
-function. Or something like that.
-
diff --git a/wmcube/wmapp/Makefile b/wmcube/wmapp/Makefile
deleted file mode 100644
index 2b773fb12398..000000000000
--- a/wmcube/wmapp/Makefile
+++ /dev/null
@@ -1,35 +0,0 @@
-export CXX = g++
-export CFLAGS = -fPIC -g -Wall -pedantic -O2
-export LFLAGS = -L$(CURDIR) -L/usr/X11R6/lib -lXpm -lXext -lX11 -lwmapp
-
-SOURCES = $(wildcard *.cc)
-OBJECTS = $(SOURCES:.cc=.o)
-
-libwmapp.a: $(OBJECTS)
- ar rcs libwmapp.a $^
-
-%.d: %.cc
- @set -e; $(CXX) -MM $(CFLAGS) $< | sed 's/\($*\)\.o[ :]*/\1.o $@ : /g' > $@; \
- [ -s $@ ] || rm -f $@
-
--include $(SOURCES:.cc=.d)
-
-%.o:
- $(CXX) $(CFLAGS) -c $< -o $@
-
-wmexample: libwmapp.a
- $(MAKE) -C example1
-
-wmatc: libwmapp.a
- $(MAKE) -C example2
-
-clean:
- -rm -f tags *.o *.d *\~ libwmapp.a
- $(MAKE) -C example1 clean
- $(MAKE) -C example2 clean
-
-dist-clean: clean
- -rm -f libwmapp.a wmexample wmatc
-
-.PHONY: all clean dist-clean wmexample wmatc
-
diff --git a/wmcube/wmapp/README b/wmcube/wmapp/README
deleted file mode 100644
index 71f8a0c342b9..000000000000
--- a/wmcube/wmapp/README
+++ /dev/null
@@ -1,66 +0,0 @@
-WMApp: version 0.0.4.1
-Copyright (C) 2001-2003 Kevin and Jason McCarty <kmcc...@princeton.edu>
- and others (see code for details)
-Licensed under the GNU GPL (see COPYING file).
-
-This is WMApp, a C++ graphics library written exclusively for developing
-WindowMaker dockapps. If you like dockapps, but you also like C++ and you
-are tired of trying to work with the code in wmgeneral.c, this library is
-for you!
-
-For an example program based on this library, check out the source code
-in the example directory. This program is long on eyecandy and short
-on usefulness, but it gives an idea of what is possible. "make wmexample"
-to build it.
-
-Features
---------
-- Dockapp windows are set up automatically for you.
-- State model: a dockapp may be in one of several states ("windows"), which
- can each look different and have different functionality
-- On-the-fly clipping; no more masking xpms needed!
-- Simple callback model: attach as many callback functions to each button
- as desired. Callbacks can take arbitrary data as an argument, change
- the properties of other widgets, and even switch between dockapp states.
-- You may automatically execute a list of functions (different for each window)
- at set intervals of time. Useful for clocks, CPU load displays, etc.
-- Numerous widgets, all with the familiar dockapp look. The color scheme
- of many may be changed. Many common WindowMaker dockapps could already
- be rewritten to use this library.
-
-Widgets
--------
-- Text box for conveying information; comes with three font sizes.
-- Progress meter to show changes in a quantity, e.g. percent download.
-- History display to show how a quantity changes over time, e.g. CPU load.
-- Buttons (optionally with an image) that can have callback functions set
- and can be activated and deactivated.
-- Images that may display an XPM icon.
-- Glowing LED-type things that may be in one of four states:
- off, green, yellow, and red.
-- Frames in which widgets (including other frames) may be nested. Frames
- may have a border and / or padding between their contents.
-- Sliders that may be moved up and down with the mouse wheel
- (or by clicking) to set a value.
-- Canvas that may be drawn upon with various drawing functions.
-
-Most of the above widgets may also inherit from one or more of the following
-for additional features:
-
-- Elliptical widget that clips contents to an ellipse
-- Callback widget that can execute actions when clicked upon
-
-Limitations
------------
-- Still not guaranteed not to leak memory or X resources
-- API is not guaranteed to be backwards compatible when it changes
- (note the version number)
-- The executables produced with this library are several times larger
- than those created using wmgeneral.c.
-- WMApp does not support dynamic widget resizing.
-- Text box fonts do not have lowercase letters. (They can easily be
- implemented -- just edit the character maps in the xpm directory --
- but I think they would look quite bad due to the small fonts.)
-- Changing the color of the fonts is not supported at runtime. (You can
- of course do this at compile time by editing the font XPMs.)
-
diff --git a/wmcube/wmapp/Widgets.txt b/wmcube/wmapp/Widgets.txt
deleted file mode 100644
index e5722e35997c..000000000000
--- a/wmcube/wmapp/Widgets.txt
+++ /dev/null
@@ -1,49 +0,0 @@
-WMWidgets Class Hierarchy
-
-Note: * represents widgets which cannot be instantiated, only inherited from
-Only public inheritances are shown in this diagram.
-
-WMWidget* - Base class for all widgets
- |
- +--WMEllipse* - Inherited widgets are displayed inside an ellipse
- |
- +--WMTextBar - Draw a string of text
- |
- +--WMMeter* - Base class for meter widgets
- | |
- | +--WMMeterBar - A bar that displays a quantity by ranging from
- | | empty to full
- | +--WMSlider - A bar that can be slid up or down to set a value
- | (also inherits from WMCallback)
- |
- +--WMHistory - Show a graph of how a quantity has been varying with time
- |
- +--WMImage - Display an XPM on a region of the window
- | |
- | +--WMCanvas - Display a region which may be changed by drawing functions
- | |
- | +--WMLED - Display an image of an LED in one of four states
- | |
- | +--WMButton - A button which, when pressed, executes one or more
- | ^ callback functions
- | | - may also have an image on it
- | |
- +--WMCallback* - A widget that can execute callback functions when clicked
- | ^
- | |
- | WMClickable* - (does not inherit from WMWidget)
- | | Inherited widgets must specify what happens when
- | | a mouse button is pressed or released, by defining
- | | press() and release() methods.
- | v
- +--WMFrame - A widget which contains other widgets and may have an optional
- | border
- +--WMWindow - The topmost level widget. All other widgets must be
- contained (recursively) by this widget in order to be
- displayed
-
-
-WMApp - Contains one or more WMWindows. Only one WMWindow may be displayed
- on screen at a time. (WMWindows are still active in the background
- when not displayed, unless they are set otherwise.)
-
diff --git a/wmcube/wmapp/colors.h b/wmcube/wmapp/colors.h
deleted file mode 100644
index b7eedceb8c53..000000000000
--- a/wmcube/wmapp/colors.h
+++ /dev/null
@@ -1,54 +0,0 @@
-#ifndef WM_COLORS_H
-#define WM_COLORS_H
-
-#define SLICE(_int, _bit) (((_int) >> (_bit)) & 0xff)
-
-class Color {
- unsigned char _R, _G, _B;
-
- public:
- Color(unsigned long int li = 0)
- : _R(SLICE(li, 16)), _G(SLICE(li, 8)), _B(SLICE(li, 0)) { }
- Color(int R, int G, int B) : _R(R), _G(G), _B(B) { }
-
- bool operator == (const Color & c) const
- { return _R == c._R && _G == c._G && _B == c._B; }
- bool operator != (const Color & c) const
- { return ! operator==(c); }
-
- unsigned char r() const { return _R; }
- unsigned char g() const { return _G; }
- unsigned char b() const { return _B; }
-
- static Color alpha_blend(const Color & c1, const Color & c2, double weight1)
- {
- double weight2 = 1.0 - weight1;
- int r = static_cast<int>(c1.r() * weight1 + c2.r() * weight2 + 0.5);
- int g = static_cast<int>(c1.g() * weight1 + c2.g() * weight2 + 0.5);
- int b = static_cast<int>(c1.b() * weight1 + c2.b() * weight2 + 0.5);
- return Color(r, g, b);
- }
-};
-
-#undef SLICE
-
-#define WMColor(x) (WMApp::colormap[static_cast<int>(WMColor:: x)])
-
-namespace WMColor {
- enum WMColor {
- Background, // Background of WMFrames and WMImages
- Dim, // Dark drawing color
- Medium, // Medium drawing color
- Bright, // Light drawing color
- ButtonFace, // Color of face of buttons
- ButtonBorderDim, // Colors of borders of WMButtons
- ButtonBorderMedium,
- ButtonBorderBright,
- FrameBorderDim, // Colors of borders of WMFrames
- FrameBorderMedium,
- FrameBorderBright
- };
- const int numcolors = 11;
-}
-
-#endif
diff --git a/wmcube/wmapp/example1/Makefile b/wmcube/wmapp/example1/Makefile
deleted file mode 100644
index d6a557545e14..000000000000
--- a/wmcube/wmapp/example1/Makefile
+++ /dev/null
@@ -1,13 +0,0 @@
-OBJECTS = wmexample.o window0.o window1.o
-
-../wmexample: $(OBJECTS) ../libwmapp.a
- $(CXX) $(CFLAGS) $(OBJECTS) $(LFLAGS) -o $@
-
-$(OBJECTS): %.o: %.cc ../*.h
- $(CXX) $(CFLAGS) -c $< -o $@
-
-clean:
- rm -f *.o *\~
-
-.PHONY: clean
-
diff --git a/wmcube/wmapp/example1/debian-tiny.xpm b/wmcube/wmapp/example1/debian-tiny.xpm
deleted file mode 100644
index 065ed6448c0e..000000000000
--- a/wmcube/wmapp/example1/debian-tiny.xpm
+++ /dev/null
@@ -1,50 +0,0 @@
-/* XPM */
-static char * debian_tiny_xpm[] = {
-"9 9 38 1",
-" c None",
-". c #AEAAAE",
-"+ c #AB9194",
-"@ c #A87173",
-"# c #AA8487",
-"$ c #AEA5A9",
-"% c #A76568",
-"& c #A23B3D",
-"* c #A9787B",
-"= c #A76C6F",
-"- c #A03132",
-"; c #AC999C",
-"> c #AC9396",
-", c #A65E60",
-"' c #AEA9AD",
-") c #AD9598",
-"! c #AE9DA1",
-"~ c #A97C7F",
-"{ c #A96E70",
-"] c #A76A6C",
-"^ c #ADA0A4",
-"/ c #AD9B9F",
-"( c #AD989C",
-"_ c #AD9B9E",
-": c #A86E70",
-"< c #A86D70",
-"[ c #AEA6AA",
-"} c #AE9DA0",
-"| c #AC8689",
-"1 c #AA797C",
-"2 c #AD9DA1",
-"3 c #AA8689",
-"4 c #A97679",
-"5 c #AD8C8F",
-"6 c #AB8184",
-"7 c #A6585A",
-"8 c #A97476",
-"9 c #AE9EA2",
-"...+@#$..",
-"..%&*=-;.",
-".>,')!~{.",
-".]^/(._:.",
-".<[}|[12.",
-".34.56/..",
-".'7[.....",
-"..^89....",
-"....$...."};
diff --git a/wmcube/wmapp/example1/window0.cc b/wmcube/wmapp/example1/window0.cc
deleted file mode 100644
index 032a74ec2d28..000000000000
--- a/wmcube/wmapp/example1/window0.cc
+++ /dev/null
@@ -1,204 +0,0 @@
-#include "../wmapp.h"
-#include "../wmframe.h"
-#include "../wmwindow.h"
-#include "../wmtextbar.h"
-#include "../wmslider.h"
-#include "../wmled.h"
-#include "../wmmeterbar.h"
-#include "../wmhistory.h"
-#include "../wmbutton.h"
-#include "../wmellipse.h"
-
-#include "../xpm/checkbox.xpm"
-#include "../xpm/xbutton.xpm"
-#include "debian-tiny.xpm"
-
-// for the clock:
-#include <time.h>
-#include <sys/timeb.h>
-
-// This file defines a window that contains various widgets to demonstrate
-// the WMApp library. Also it is shown how to make a clock widget.
-
-// Callbacks for the buttons -----------------------------------------------
-
-// This one ends the program (always useful) and will be attached to the
-// button with the "X".
-void
-halt(const WMApp *a, void *) { a->stop(); }
-
-// The following three callbacks will be attached to the checkbox button:
-
-// This one changes the state of the middle LED if mousebutton 1 is clicked.
-void
-ledset(const WMApp *a, WMWidget *w, void *)
-{
- if (a->mouseclick().button != Button1) return;
-
- WMLed *l = dynamic_cast<WMLed *>(w);
- if (l) {
- l->setled(static_cast<WMLed::LedState>((1 + l->led()) % 4));
- a->repaint();
- }
-}
-
-// This one toggles the style of the vertical meter if button 2 is clicked.
-void
-togglegraphstyle (const WMApp *a, WMWidget *w, void *)
-{
- if (a->mouseclick().button != Button2) return;
-
- WMMeterBar *m = dynamic_cast<WMMeterBar *>(w);
- if (m) {
- m->setstyle(static_cast<WMMeterBar::Style>((1 + m->style()) % 3));
- m->setorientation((m->orientation() == Orientation::Horizontal) ?
- Orientation::Vertical : Orientation::Horizontal);
- a->repaint();
- }
-}
-
-// This one toggles whether the "close" button can be pressed if mouse
-// button 3 is clicked.
-void
-toggleclose(const WMApp *a, WMWidget *w, void *)
-{
- if (a->mouseclick().button != Button3) return;
-
- WMButton *b = dynamic_cast<WMButton *>(w);
- if (b && b->is_active()) b->deactivate();
- else if (b && !b->is_active()) b->activate();
-}
-
-// This callback will be attached to the Debian button. It switches
-// between windows.
-// Note: if the last statement in a callback function requests
-// a switch to a new window, you don't need a "repaint()".
-void
-switch_to_1(const WMApp *a, void *)
-{ a->switch_to(1); }
-
-// Define a class that will be a WMHistory widget with callbacks
-class WMHistCallback : public WMCallback, public WMHistory, public WMEllipse {
- public: WMHistCallback() : WMCallback(), WMHistory(), WMEllipse() { }
-};
-
-// Callback to clear this widget when it's clicked on
-void
-clearhistory(const WMApp *a, WMWidget *w, void *)
-{
- WMHistCallback *h = dynamic_cast<WMHistCallback *>(w);
- if (h) h->clear();
-}
-
-// Callbacks for the windows -----------------------------------------------
-// Window callbacks are executed every 50 milliseconds (by default; you
-// can set this value) for the currently displayed window.
-
-// This function will update the time on the clock display every 5 seconds.
-void
-displaytime(const WMApp *a, WMWidget *w, void *)
-{
- struct timeb currenttime;
- string timestr;
- WMTextBar *b = dynamic_cast<WMTextBar *>(w);
-
- if (!b) return;
- ftime(&currenttime);
- // extract current time from date-and-time string
- timestr = string(ctime(&currenttime.time) + 11);
- b->settext(timestr);
- a->repaint();
-}
-
-// make random increments to the meterbar and history every 150 ms
-void
-updatehist (const WMApp *a, WMWidget *w1, void *w2)
-{
- WMMeterBar *b = dynamic_cast<WMMeterBar *>(w1);
- if (b) {
- int increment = static_cast<int>(b->value() - 13
- + 31 * static_cast<float>(rand()) / RAND_MAX) + 307;
- //I added 307 becuase gcc does bad things to a signed dividend in a modulus,
- //which makes for *interesting* results
-
- b->setvalue(increment % 307, 306);
- }
-
- WMHistory *h = dynamic_cast<WMHistory *>(static_cast<WMWidget *>(w2));
- if (b && h) h->setvalue(b->value());
- a->repaint();
-}
-
-// The function where we lay out all the widgets ---------------------------
-
-void
-makewindow0(WMWindow *w0)
-{
- // Everything following is GUI boilerplate code.
- static WMFrame top, mid, bottom, topright, botright;
- static WMTextBar time("00:00", 0);
- static WMSlider slider(30, 50);
- static WMLed l, m, r;
- static WMMeterBar meterbar;
- static WMHistCallback history;
- static WMButton debian, go, stop;
-
- w0->add_timed_function(500, displaytime, &time, 0);
- w0->add_timed_function(15, updatehist, &meterbar,
- dynamic_cast<WMWidget *>(&history));
- w0->addchild(top);
- w0->addchild(mid);
- w0->addchild(bottom);
- w0->setorientation(Orientation::Vertical);
- w0->setaspectratios(1, 2, 1);
-
- top.addchild(time);
- top.addchild(topright);
- top.setaspectratios(6, 5);
-
- mid.addchild(history);
- mid.addchild(slider);
- slider.setorientation(Orientation::Vertical);
- mid.setaspectratios(3, 1);
-
- bottom.addchild(meterbar);
- bottom.addchild(botright);
- bottom.setaspectratios(1, 2);
-
- topright.addchild(l);
- topright.addchild(m);
- topright.addchild(r);
- topright.setpadding(0);
- topright.setborder(1);
-
- botright.addchild(debian);
- botright.addchild(go);
- botright.addchild(stop);
- botright.setpadding(0);
- botright.setborder(1);
-
- l.setled(WMLed::Good);
- r.setled(WMLed::Error);
-
- // should set initial total of seconds
- srand(std::time(0));
- meterbar.setstyle(WMMeterBar::Spectrum);
- meterbar.setvalue(150, false);
- meterbar.settotal(306, false);
- history.settotal(306, false);
- history.addcallback(clearhistory, &history, 0);
-
- debian.seticon(debian_tiny_xpm);
- debian.addcallback(switch_to_1, 0);
-
- go.seticon(checkbox_xpm);
- go.addcallback(ledset, &m, 0);
- go.addcallback(toggleclose, &stop, 0);
- go.addcallback(togglegraphstyle, &meterbar, 0);
-
- // Let's start this button out in an inactive state, just for fun.
- stop.deactivate();
- stop.seticon(xbutton_xpm);
- stop.addcallback(halt, 0);
-}
-
diff --git a/wmcube/wmapp/example1/window1.cc b/wmcube/wmapp/example1/window1.cc
deleted file mode 100644
index 644cad57a48a..000000000000
--- a/wmcube/wmapp/example1/window1.cc
+++ /dev/null
@@ -1,86 +0,0 @@
-#include "../wmapp.h"
-#include "../wmwindow.h"
-#include "../wmframe.h"
-#include "../wmcanvas.h"
-#include "../wmbutton.h"
-#include "../wmellipse.h"
-#include "debian-tiny.xpm"
-
-// This file creates a window with a small, very simple paint program.
-
-// Define a class that will be a WMCanvas widget with callbacks
-class WMPainter : public WMCallback, public WMCanvas, public WMEllipse {
- public: WMPainter() : WMCallback(), WMCanvas() { }
-};
-
-// Make one of the buttons elliptical.
-class WMEllipticalButton : public WMEllipse, public WMButton {
- public: WMEllipticalButton() : WMEllipse(), WMButton() { }
-};
-
-// Callback to paint onto this widget when it's clicked on
-void
-paint(const WMApp *a, WMWidget *w, void *)
-{
- WMMouseClick click = a->mouseclick().b_relative_to(w);
- WMPainter *p = dynamic_cast<WMPainter *>(w);
- // draw a 3x3 square at the mouse location clicked upon
- if (p) p->fill_rectangle(click.x - 2, click.y - 2, 3, 3);
- a->repaint();
-}
-
-// Callbacks for the buttons -----------------------------------------------
-
-// This callback changes the current paint color of the WMCanvas, depending
-// upon which button was pressed.
-void
-changecolor(const WMApp *a, WMWidget *w, void *color)
-{
- WMColor::WMColor c = *static_cast<WMColor::WMColor *>(color);
- WMPainter *wp = dynamic_cast<WMPainter *>(w);
- if (wp) wp->setcolor(c);
-}
-
-// This callback will be attached to the big button
-// on the second window. It switches between windows.
-// Note: if the last statement in a callback function requests
-// a switch to a new window, you don't need a "repaint()".
-void
-switch_to_0(const WMApp *a, void *)
-{ a->switch_to(0); }
-
-void makewindow1(WMWindow *w1)
-{
- static WMEllipticalButton debianwin;
- static WMEllipticalButton colorbutton[4];
- static WMFrame top, topleft, bottom;
- static WMPainter drawing;
- static int colors[4] = { 0x000000, 0xFF0000, 0x00FF00, 0x0000FF };
-
- w1->addchild(top);
- w1->addchild(bottom);
- w1->setorientation(Orientation::Vertical);
- w1->setaspectratios(1, 3);
-
- top.addchild(topleft);
- top.addchild(debianwin);
- top.setaspectratios(4, 1);
-
- topleft.setpadding(0);
- topleft.setborder(1);
- topleft.settransparency(false);
-
- for (unsigned int i = 0; i < 4; i++) {
- colorbutton[i].setbgcolor(colors[i]);
- colorbutton[i].addcallback(changecolor, &drawing, colors + i);
- topleft.addchild(colorbutton[i]);
- }
-
- debianwin.seticon(debian_tiny_xpm);
- debianwin.addcallback(switch_to_0, 0);
-
- drawing.addcallback(paint, &drawing);
- bottom.addchild(drawing);
- drawing.setborder(4);
-}
-
diff --git a/wmcube/wmapp/example1/wmexample.cc b/wmcube/wmapp/example1/wmexample.cc
deleted file mode 100644
index b83b72cc4653..000000000000
--- a/wmcube/wmapp/example1/wmexample.cc
+++ /dev/null
@@ -1,39 +0,0 @@
-#include "../wmapp.h"
-#include "../wmwindow.h"
-
-// This is an example WindowMaker dockapp program written using the
-// WMApp dockapp library. The first window shows off various widgets
-// and demonstrates how to make a clock. The second window illustrates
-// a miniature paint program.
-
-extern void makewindow0(WMWindow *w0_ptr); // see window0.cc
-extern void makewindow1(WMWindow *w1_ptr); // see window1.cc
-
-// The main() function, where we lay out all the widgets -------------------
-// The files window0.cc and window1.cc are much more interesting.
-
-int main(int argc, char *argv[])
-{
- // This should always be the very first line in the main() function of
- // a WMApplication:
- WMApp::initialize(argc, argv);
-
- WMApp a;
- WMWindow w0, w1;
- makewindow0(&w0);
- makewindow1(&w1);
-
- // Attach windows to the application
- a.addwindow(w0);
- a.addwindow(w1);
-
- // This makes everything go.
- a.run();
-
- // Any cleanup code after the window closes should go here.
- // (In this case, none is needed.)
-
- return 0;
-}
-
-
diff --git a/wmcube/wmapp/example2/Makefile b/wmcube/wmapp/example2/Makefile
deleted file mode 100644
index b8ed170f65d3..000000000000
--- a/wmcube/wmapp/example2/Makefile
+++ /dev/null
@@ -1,13 +0,0 @@
-OBJECTS = wmairtrafficcontrol.o wmradar.o
-
-../wmatc: $(OBJECTS) ../libwmapp.a
- $(CXX) $(CFLAGS) $(OBJECTS) $(LFLAGS) -o $@
-
-$(OBJECTS): %.o: %.cc ../*.h wmradar.h
- $(CXX) $(CFLAGS) -c $< -o $@
-
-clean:
- rm -f *.o *\~
-
-.PHONY: clean
-
diff --git a/wmcube/wmapp/example2/wmairtrafficcontrol.cc b/wmcube/wmapp/example2/wmairtrafficcontrol.cc
deleted file mode 100644
index 89df1ce507c0..000000000000
--- a/wmcube/wmapp/example2/wmairtrafficcontrol.cc
+++ /dev/null
@@ -1,80 +0,0 @@
-#include <ctime>
-#include <cstdlib>
-#include "wmradar.h"
-#include "../wmslider.h"
-#include "../wmcallback.h"
-#include "../wmapp.h"
-#include "../wmwindow.h"
-#include "../wmframe.h"
-#include "../wmbutton.h"
-#include "../xpm/xbutton.xpm"
-
-//WM Air Traffic Control: The FAQ said don't rely on callback timings for
-//air traffic control, so I did.
-//
-//Click on the radar to change the nearest plane's heading towards that point.
-//Move the slider to change the planes' speed.
-//If two planes collide, they will disappear, a red point will appear, and
-//the score will be incremented.
-
-void
-halt(const WMApp *a, void *) { a->stop(); }
-
-void add_plane(const WMApp* a, WMWidget* w, void*)
-{
- if (!(std::rand() % 3))
- {
- WMRadar* r = dynamic_cast<WMRadar*>(w);
- if (r)
- r->add_plane();
- }
-}
-
-void increment_time(const WMApp* a, WMWidget* w, void*)
-{
- WMRadar* r = dynamic_cast<WMRadar*>(w);
- if (r)
- r->increment_time();
- a->repaint();
-}
-
-int main(int argc, char *argv[])
-{
- WMApp::initialize(argc, argv);
-
- WMApp a;
- WMWindow win;
-
- WMTextBar score;
- WMSlider speed;
- WMRadar radar(&score, &speed);
- WMFrame left, right;
- WMButton quit;
-
- win.add_timed_function(1, increment_time, &radar, 0);
- win.add_timed_function(80, add_plane, &radar, 0);
- win.addchild(left);
- win.addchild(right);
- win.setaspectratios(50, 15);
-
- left.addchild(radar);
- left.addchild(score);
- left.setorientation(Orientation::Vertical);
- left.setaspectratios(50, 15);
-
- right.addchild(speed);
- right.addchild(quit);
- right.setorientation(Orientation::Vertical);
- right.setaspectratios(50, 15);
-
- quit.seticon(xbutton_xpm);
- quit.addcallback(halt, 0);
-
- speed.setorientation(Orientation::Vertical);
-
- std::srand(std::time(0));
-
- a.addwindow(win);
- a.run();
- return 0;
-}
diff --git a/wmcube/wmapp/example2/wmradar.cc b/wmcube/wmapp/example2/wmradar.cc
deleted file mode 100644
index 8344c1eab3e0..000000000000
--- a/wmcube/wmapp/example2/wmradar.cc
+++ /dev/null
@@ -1,220 +0,0 @@
-#include <cstdlib>
-#include <cmath>
-#include <sstream>
-#include <iomanip>
-#include "wmradar.h"
-#include "../wmapp.h"
-
-using std::sin;
-using std::cos;
-using std::atan2;
-
-WMRadar::WMRadar(WMTextBar* t, WMSlider* s)
-: angle(0), text_score(t), speed(s)
-{
- setbuffered(true);
- text_score->settext(" 0", false);
- speed->settotal(50, false);
- speed->setvalue(8, false);
-}
-
-void
-WMRadar::real_display()
-{
- if (!p_icon())
- seticon(false);
- setcolor(WMColor(Background));
- fill_rectangle(0, 0, b_width(), b_height()); //clear background
-
- setcolor(WMColor(Dim));
- for (double i = 0; i < 2 * M_PI; i += M_PI_4)
- draw_line(b_width() / 2, b_height() / 2, (1 + cos(i)) * b_width() / 2,
- (1 - sin(i)) * b_height() / 2); //draw radial lines
-
- draw_arc(b_width() / 3, b_height() / 3, b_width() / 3 - 1, b_height() / 3 - 1,
- 0, 360 * 64);
- draw_arc(b_width() / 6, b_height() / 6, 2 * b_width() / 3,
- 2 * b_height() / 3, 0, 360 * 64); //draw circles
-
- setcolor(Color(255, 0, 0));
- for (clist::const_iterator i = collisions.begin(); i != collisions.end(); ++i)
- fill_arc(i->x - 1, i->y - 1, 3, 3, 0, 360 * 64); //draw collision points
-
- std::vector<X::XPoint> points(3);
- for (plist::const_iterator i = planes.begin(); i != planes.end(); ++i)
- {
- setcolor(Color(0, 255 * i->brightness, 0)); // achieve a fading effect
- points[0].x = i->x;
- points[0].y = i->y;
- points[1].x = int(i->x) + 7 * cos(i->direction + 5.5 * M_PI / 6);
- points[1].y = int(i->y) - 7 * sin(i->direction + 5.5 * M_PI / 6);
- points[2].x = int(i->x) + 7 * cos(i->direction + 6.5 * M_PI / 6);
- points[2].y = int(i->y) - 7 * sin(i->direction + 6.5 * M_PI / 6);
- // construct an isoceles triangle pointing in plane's direction of motion
- fill_polygon(points); // and draw it
- }
-
- setcolor(Color(0, 255, 0));
- draw_line(b_width() / 2, b_height() / 2, (1 + cos(angle)) * b_width() / 2,
- (1 - sin(angle)) * b_height() / 2); //draw radar line
-
- WMImage::real_display(); //update window
-}
-
-double rand(double low, double high)
-{
- return low + std::rand() * (high - low) / RAND_MAX;
-}
-
-void
-WMRadar::add_plane()
-{
- if (planes.size() > 4)
- return;
-
- double theta = rand(0, 2 * M_PI); //put plane somewhere along edge
- plane p = { (1 + cos(theta)) * b_width() / 2,
- (1 - sin(theta)) * b_height() / 2,
- rand(theta + 3 * M_PI_4, theta + 5 * M_PI_4), //direction pointing inwards
- 0.5 }; //brightness
-
- planes.push_back(p);
-}
-
-inline double dist2 (double x1, double y1, double x2, double y2)
-{ //return distance squared between points
- return std::pow(x1 - x2, 2) + std::pow(y1 - y2, 2);
-}
-
-inline double norm_angle(double angle)
-{ //return angle shifted into the range [0, 2pi)
- return angle - 2 * M_PI * std::floor(angle / (2 * M_PI));
-}
-
-bool
-WMRadar::release(int, int x, int y)
-{
- if (wPressed)
- {
- wPressed = false;
- if (contains(x, y) && planes.size())
- {
- int newx = x - b_left(),
- newy = y - b_top();
- plist::iterator closest;
- double mindist2 = 10000;
- for (plist::iterator i = planes.begin(); i != planes.end(); ++i)
- {
- double d2 = dist2(i->x, i->y, newx, newy);
- if (d2 < mindist2)
- {
- mindist2 = d2;
- closest = i;
- }
- }
- closest->direction = norm_angle(atan2(double(int(closest->y) - newy),
- double(newx - int(closest->x))));
- //change nearest plane's direction towards (x, y)
- }
- return true;
- }
- else return false;
-}
-
-void
-WMRadar::increment_time()
-{
- for (plist::iterator i = planes.begin(); i != planes.end();)
- { //Collision test planes
- if (!contains(i->x + left(), i->y + top()))
- ++i;
- else
- {
- plist::iterator j = i;
- bool collided = false;
- for (++j; j != planes.end();)
- if (dist2(i->x, i->y, j->x, j->y) <= 0.75)
- { //remove each collided plane and increment score
- j = planes.erase(j);
- collided = true;
- increment_score();
- }
- else
- ++j;
- if (collided)
- {
- increment_score();
- collision c = { i->x, i->y };
- collisions.push_back(c); //make record of collision location
- i = planes.erase(i);
- }
- else
- ++i;
- }
- }
-
- const double angleinc = M_PI / 125;
-
- for (plist::iterator i = planes.begin(); i != planes.end();)
- {
- double incx = speed->value() * cos(i->direction) / 100;
- double incy = -speed->value() * sin(i->direction) / 100;
- double nextx = i->x + incx;
- double nexty = i->y + incy;
-
- //to check if a plane crossed the radar line, approximate the plane's path
- //as an arc:
- double& l_start_angle = angle; //make an interval of radar line's angles
- const double l_end_angle = l_start_angle + angleinc;
-
- //make an interval of the plane's angles
- double p_start_angle = norm_angle(atan2(b_height() / 2 - i->y,
- i->x - b_width() / 2));
- double p_end_angle = norm_angle(atan2(b_height() / 2 - nexty,
- nextx - b_width() / 2));
-
- const double crossp = (b_width() / 2 - i->x) * incy
- - (b_height() / 2 - i->y) * incx; //test whether plane is moving in
- //a positive or a negative angle
- if (crossp < 0.0) //make angle increase counterclockwise
- {
- const double temp = p_start_angle;
- p_start_angle = p_end_angle;
- p_end_angle = temp;
- }
- if (p_end_angle < p_start_angle)
- p_end_angle += 2 * M_PI; //make sure end is > start
-
- //intersect radar line interval and plane interval. If result is non-empty,
- //there was an intersection.
- if (std::min(p_end_angle, l_end_angle)
- >= std::max(p_start_angle, l_start_angle))
- i->brightness = 1.0; //if plane crossed radar line, make it bright
- else
- i->brightness *= 0.996; //otherwise decay brightness
-
-
- i->x = nextx; //update plane's position
- i->y = nexty;
- if (!WMWidget::contains(i->x + b_left(), i->y + b_top()))
- i = planes.erase(i); //cull planes outside of radar
- else
- ++i;
- }
-
- angle = norm_angle(angle + angleinc); //increment radar direction
-
- display();
-}
-
-void
-WMRadar::increment_score ()
-{
- using namespace std;
- istringstream in(text_score->text()); //get string from textbar
- int score;
- in >> score; //extract score
- ostringstream out;
- out << setw(6) << setfill(' ') << score + 1; //increment and put in a string
- text_score->settext(out.str()); //put back in textbar
-}
diff --git a/wmcube/wmapp/example2/wmradar.h b/wmcube/wmapp/example2/wmradar.h
deleted file mode 100644
index 228cdc640453..000000000000
--- a/wmcube/wmapp/example2/wmradar.h
+++ /dev/null
@@ -1,44 +0,0 @@
-#ifndef _WMRADAR_H
-#define _WMRADAR_H
-
-#include <list>
-#include "../wmellipse.h"
-#include "../wmcanvas.h"
-#include "../wmcallback.h"
-#include "../wmtextbar.h"
-#include "../wmslider.h"
-
-class WMRadar : public WMCanvas, public WMCallback, public WMEllipse {
-private:
- struct plane
- {
- double x, y, direction, brightness;
- };
- typedef std::list<plane> plist;
-
- struct collision
- { int x, y; };
- typedef std::list<collision> clist;
-
- plist planes;
- clist collisions;
- double angle;
-
- WMTextBar* text_score;
- WMSlider* speed;
-
-protected:
- void real_display();
-
-public:
- WMRadar(WMTextBar*, WMSlider*);
-
- void add_plane();
- bool release(int button, int x, int y); //change nearest plane's direction
- void increment_time();
-
-private:
- void increment_score();
-};
-
-#endif //_WMRADAR_H
diff --git a/wmcube/wmapp/wmapp.cc b/wmcube/wmapp/wmapp.cc
deleted file mode 100644
index e3353183ee1f..000000000000
--- a/wmcube/wmapp/wmapp.cc
+++ /dev/null
@@ -1,378 +0,0 @@
-#include <string>
-#include "wmapp.h"
-#include "wmwindow.h"
-
-using std::string;
-
-namespace Unix {
- extern "C" {
-# include <unistd.h> // for usleep()
- }
-};
-
-// All the xpms we need:
-namespace Xpms {
-# include "xpm/charmap-small.xpm"
-# include "xpm/charmap-medium.xpm"
-# include "xpm/charmap-large.xpm"
-# include "xpm/checkbox.xpm"
-# include "xpm/xbutton.xpm"
-# include "xpm/leds.xpm"
-# include "xpm/emptybar.xpm"
-# include "xpm/fullbar.xpm"
-# include "xpm/tile.xpm"
-};
-
-// Xlib doesn't seem to work if these are class members.
-// They're declared as extern in xwrapper.h.
-X::Window wActiveWin, wProgramWin;
-X::Atom deleteWin;
-X::Atom _XA_GNUSTEP_WM_FUNC;
-
-// static class members of WMApp declared here:
-
-Xwrapper WMApp::Xw;
-WMPixmap WMApp::char_pixmaps[3];
-WMPixmap WMApp::checkbox_pixmap, WMApp::xbutton_pixmap, WMApp::leds_pixmap[4];
-WMPixmap WMApp::emptybar_pixmap, WMApp::fullbar_pixmap;
-WMPixmap WMApp::tile_pixmap;
-Color WMApp::colormap[WMColor::numcolors];
-
-char ** WMApp::wArgv;
-string WMApp::wName;
-int WMApp::wArgc;
-int WMApp::wWindowSize;
-enum WindowManager::WindowManager WMApp::wManager;
-
-
-// initialize: static function to create pixmaps and set default colors.
-// This should be called as the very first line of a program using this
-// library.
-void
-WMApp::initialize(int argc, char *argv[])
-{
- static bool inited = false;
- if (inited) return;
-
- wArgc = argc;
- wName = (argc && argv) ? string(argv[0]) : string("WMApplication");
- wArgv = argv;
- deleteWin = X::XInternAtom(Xw.xdisplay(), "WM_DELETE_WINDOW", false);
- _XA_GNUSTEP_WM_FUNC = X::XInternAtom(Xw.xdisplay(),
- "_GNUSTEP_WM_FUNCTION", false);
-
- // create all the required pixmaps
- Xw.create_pixmap(char_pixmaps[0], Xpms::charmap_small_xpm);
- Xw.create_pixmap(char_pixmaps[1], Xpms::charmap_medium_xpm);
- Xw.create_pixmap(char_pixmaps[2], Xpms::charmap_large_xpm);
- Xw.create_pixmap(checkbox_pixmap, Xpms::checkbox_xpm);
- Xw.create_pixmap(xbutton_pixmap, Xpms::xbutton_xpm);
- Xw.create_pixmap(fullbar_pixmap, Xpms::fullbar_xpm);
- Xw.create_pixmap(emptybar_pixmap, Xpms::emptybar_xpm);
- Xw.create_pixmap(tile_pixmap, Xpms::tile_xpm);
-
- // create four LED pixmaps
- WMPixmap all_leds_pixmap;
- int ledwidth = 4, ledheight = 4;
-
- Xw.create_pixmap(all_leds_pixmap, Xpms::leds_xpm);
- for (unsigned int s = 0; s < 4; s++) {
- leds_pixmap[s].attr.width = ledwidth;
- leds_pixmap[s].attr.width = ledheight;
- Xw.create_pixmap(leds_pixmap[s], ledwidth, ledheight);
- Xw.copy_rectangle(all_leds_pixmap, leds_pixmap[s], ledwidth * s, 0,
- ledwidth, ledheight, 0, 0);
- }
-
-# define colormap(x) colormap[static_cast<int>(WMColor:: x)]
- // create colormap
- // XXX: eventually, read from RC file
- colormap(Background) = 0x212121;
- colormap(Dim) = 0x283C28;
- colormap(Medium) = 0x188A86;
- colormap(Bright) = 0x20B2AE;
- colormap(ButtonFace) = 0xAEAAAE;
- colormap(ButtonBorderDim) = 0;
- colormap(ButtonBorderMedium) = 0x86828E;
- colormap(ButtonBorderBright) = 0xF7F3FF;
- colormap(FrameBorderDim) = 0;
- colormap(FrameBorderMedium) = 0;
- colormap(FrameBorderBright) = 0xC8C8C8; //0xAEAAAE;
-# undef colormap
-
- inited = true;
-
- // set the window behavior from command-line options
- wManager = WindowManager::Other;
- wWindowSize = 64;
-
- for (int i = 1; i < wArgc && strcmp(wArgv[i], "--"); i++) {
- if (strcmp(wArgv[i], "-w") == 0) {
- wManager = WindowManager::WindowMaker; break;
- }
- else if (strcmp(wArgv[i], "-a") == 0) {
- wManager = WindowManager::Afterstep;
- wWindowSize = 56;
- break;
- }
- }
-}
-
-// Here begin the magic Xlib incantations required to create a dockapp window.
-// I have no idea how this works, it just does. Code mostly obtained from
-// wmsmixer by Damian Kramer, based in turn upon wmmixer by Sam Hawker.
-
-// simple function to create an XWindow
-void
-WMApp::create_window(X::Window *dest, int left, int top) const
-{
- X::XClassHint classHint;
-
- *dest = X::XCreateSimpleWindow(Xw.xdisplay(), Xw.xrootwin(), left, top,
- wWindowSize, wWindowSize, 0, 0, 0);
-
- //XXX: May be able to get away without allocating new char arrays, but I don't
- //trust X not to modify them.
- classHint.res_name = new char[wName.size() + 1];
- classHint.res_class = new char[wName.size() + 1];
- strcpy(classHint.res_name, wName.c_str());
- strcpy(classHint.res_class, wName.c_str());
- X::XSetClassHint(Xw.xdisplay(), *dest, &classHint);
- delete[] classHint.res_name;
- delete[] classHint.res_class;
-}
-
-// This function sets up the X window.
-// Called from WMApp::run()
-void WMApp::Xsetup()
-{
- X::Display * display = Xw.xdisplay();
-
- X::XWMHints wmhints;
- X::XSizeHints shints;
- int winsize = wWindowSize;
- bool pos;
-
- shints.x = shints.y = shints.flags = 0;
- pos = (X::XWMGeometry(display, X::XDefaultScreen(display), "" /*geometry*/,
- 0, 0, &shints, &shints.x, &shints.y, &shints.width, &shints.height,
- &shints.win_gravity) & X_MACRO(XValue | YValue));
- shints.min_width = shints.min_height = winsize;
- shints.max_width = shints.max_height = winsize;
- shints.base_width = shints.base_height = winsize;
- shints.flags = X_MACRO(PMinSize | PMaxSize | PBaseSize);
- create_window(&wProgramWin, shints.x, shints.y);
-
- if (pos || wManager == WindowManager::WindowMaker
- || wManager == WindowManager::Afterstep)
- shints.flags |= X_MACRO(USPosition);
-
- if (wManager == WindowManager::WindowMaker) {
- wmhints.initial_state = X_MACRO(WithdrawnState);
- wmhints.flags = X_MACRO(WindowGroupHint | StateHint | IconWindowHint);
- create_window(&wActiveWin, shints.x, shints.y);
- wmhints.icon_window = wActiveWin;
- }
- else {
- wmhints.initial_state = X_MACRO(NormalState);
- wmhints.flags = X_MACRO(WindowGroupHint | StateHint);
- wActiveWin = wProgramWin;
- }
-
- wmhints.window_group = wProgramWin;
- X::XSetWMHints(display, wProgramWin, &wmhints);
- X::XSetWMNormalHints(display, wProgramWin, &shints);
- if (wArgc > 0)
- X::XSetCommand(display, wProgramWin, wArgv, wArgc);
- X::XStoreName(display, wProgramWin, wName.c_str());
- X::XSetIconName(display, wProgramWin, wName.c_str());
- X::XSetWMProtocols(display, wActiveWin, &deleteWin, 1);
-}
-
-// This function masks out the "clear" parts of the X window.
-// Called from WMWindow::real_display()
-void
-WMApp::mask() const
-{
- X::Display * display = Xw.xdisplay();
- WMPixmap pixmap = current()->pixmap();
-
- if (wManager == WindowManager::WindowMaker ||
- wManager == WindowManager::Afterstep)
- // apply the mask if using a compliant window manager
- X::XShapeCombineMask(display, wActiveWin, X_MACRO(ShapeBounding),
- 0, 0, pixmap.mask, X_MACRO(ShapeSet));
- else
- // otherwise, create a tile background for the window
- Xw.copy_rectangle(tile_pixmap, pixmap.pixmap, 0, 0, wWindowSize,
- wWindowSize);
-
- Xw.fill_rectangle(pixmap, 0, 0, wWindowSize, wWindowSize,
- WMColor(Background));
-}
-
-// This function redraws the X window if necessary.
-// Called from WMWindow::real_display()
-void
-WMApp::repaint() const
-{
- X::XEvent xev;
-
- Xw.copy_rectangle(current()->pixmap(), wActiveWin,
- 0, 0, wWindowSize, wWindowSize);
-
- while (X::XCheckTypedEvent(Xw.xdisplay(), X_MACRO(Expose), &xev))
- /* loop */;
- X::XFlush(Xw.xdisplay());
-}
-
-// This function displays the X window.
-// Called from WMWindow::real_activate()
-void
-WMApp::Xshow() const
-{
- X::Display * display = Xw.xdisplay();
-
- // request input events and map the window
- X::XSelectInput(display, wActiveWin,
- X_MACRO(ExposureMask | ButtonPressMask | ButtonReleaseMask)
- | X_MACRO(ButtonMotionMask));
- X::XMapWindow(display, wProgramWin);
- repaint();
-
- // loop over X events and callbacks
- Xwait();
-}
-
-// This function waits for X events, redraws the window when necessary,
-// and calls callbacks of the window.
-void
-WMApp::Xwait() const
-{
- X::Display * display = Xw.xdisplay();
- X::XEvent xev;
-
- while (true) {
- // sleep for the specified time in milliseconds
- Unix::usleep(1000 * current()->updatefreq());
- // execute any timed functions which need it
- current()->run_timed_functions();
-
- // execute any pending X events
- while (XPending(display)) {
- X::XNextEvent(display, &xev);
-
- switch (xev.type) {
- case Expose:
- repaint();
- break;
- case ButtonPress:
- current()->press(xev.xbutton.button, xev.xbutton.x, xev.xbutton.y);
- break;
- case ButtonRelease:
- wMouseEvent.button = xev.xbutton.button;
- wMouseEvent.x = xev.xbutton.x;
- wMouseEvent.y = xev.xbutton.y;
- current()->release(xev.xbutton.button, xev.xbutton.x, xev.xbutton.y);
- if (done()) return;
- break;
- case ClientMessage:
- if (static_cast<unsigned int>(xev.xclient.data.l[0]) == deleteWin)
- { stop(); return; }
- break;
- default: break;
- }
- }
- }
-}
-
-// End of magic Xlib incantations.
-
-// The following functions deal with setting the state of the application
-// and running it.
-
-void
-WMApp::switch_to(WMWindow *w) const
-{
- for (unsigned int i = 0; i < wWindows.size(); i++)
- if (w == wWindows[i]) {
- switch_to(i);
- return;
- }
-}
-
-void
-WMApp::switch_to(WMWindow &w) const { switch_to(&w); }
-
-// run: This function starts the GUI of the dockapp. Call it as the
-// last line in a program using this library. Calling run() with no
-// argument starts the program on the first window. You can also
-// call run(WMWindow *), run(WMWindow &), or run(unsigned int) in order
-// to start with a different window.
-//
-// So your program in the simplest case should look like this:
-//
-// int main(int argc, char *argv[]) {
-// WMApp::initialize(argc, argv);
-// WMWindow w;
-// WMApp a = WMApp(w);
-// // layout the window and set up callbacks here
-// // ...
-// a.addwindow(w);
-// a.run();
-// return 0;
-// }
-
-void
-WMApp::run(WMWindow *w)
-{
- for (unsigned int i = 0; i < wWindows.size(); i++)
- if (w == wWindows[i]) {
- run(i);
- return;
- }
-}
-
-void
-WMApp::run(WMWindow &w) { run(&w); }
-
-void
-WMApp::run(int w) { run(static_cast<unsigned int>(w)); }
-
-void
-WMApp::run(unsigned int w)
-{
- if (w >= wWindows.size()) return;
-
- // set up pointers from windows to "this"
- for (unsigned int i = 0; i < wWindows.size(); i++)
- wWindows[i]->wApp = this;
-
- Xsetup();
- wActiveWindow = wNextWindow = w;
-
- while (wFinished == false) {
- // This function does not exit until wNextWindow != wActiveWindow
- // or wFinished == true. User interaction happens in here.
- current()->display();
-
- // To switch to a different window, set a callback on a button within
- // this window, like this:
- // void callback1(const WMApp *a, void *) { a->switch_to(5); }
- // To exit the program, likewise, you need a callback like
- // void callback2(const WMApp *a, void *) { a->stop(); }
- // (Alternately you could put the window on a timer by setting one of
- // these as a callback of the window itself, substituting WMWindow for
- // WMButton in the function definitions.)
-
- wActiveWindow = wNextWindow;
-
- // if we have switched to a different window, continue with that one.
- }
-
- // otherwise, exit the WMApp::run() function. (Normally a call like
- // wm_app->run(); will be the last in a program's main() function,
- // in which case we also exit the program.)
- return;
-}
-
diff --git a/wmcube/wmapp/wmapp.h b/wmcube/wmapp/wmapp.h
deleted file mode 100644
index 66c022ffdd94..000000000000
--- a/wmcube/wmapp/wmapp.h
+++ /dev/null
@@ -1,170 +0,0 @@
-#include <vector>
-#include <string>
-#include "wmwidget.h"
-#include "xwrapper.h"
-#include "colors.h"
-
-#ifndef _WMAPP_H
-#define _WMAPP_H
-
-class WMWindow;
-
-namespace WindowManager {
- enum WindowManager { WindowMaker, Afterstep, Other };
-};
-
-struct WMMouseClick {
- int button;
- int x;
- int y;
-
- WMMouseClick(int Button = Button1, int X = 0, int Y = 0);
- WMMouseClick relative_to(const WMWidget &w) const;
- WMMouseClick relative_to(const WMWidget *w) const;
- WMMouseClick b_relative_to(const WMWidget &w) const;
- WMMouseClick b_relative_to(const WMWidget *w) const;
-};
-
-inline WMMouseClick::WMMouseClick(int Button, int X, int Y)
-: button(Button), x(X), y(Y) { }
-
-inline WMMouseClick
-WMMouseClick::relative_to(const WMWidget &w) const
-{ return WMMouseClick(button, x - w.left(), y - w.top()); }
-
-inline WMMouseClick
-WMMouseClick::relative_to(const WMWidget *w) const
-{ return relative_to(*w); }
-
-inline WMMouseClick
-WMMouseClick::b_relative_to(const WMWidget &w) const
-{ return WMMouseClick(button, x - w.b_left(), y - w.b_top()); }
-
-inline WMMouseClick
-WMMouseClick::b_relative_to(const WMWidget *w) const
-{ return b_relative_to(*w); }
-
-class WMApp {
- private:
- static int wWindowSize;
- static int wArgc;
- static char ** wArgv;
- static std::string wName;
-
- std::vector<WMWindow *> wWindows;
- mutable int wActiveWindow;
- mutable int wNextWindow;
- mutable bool wFinished;
- mutable WMMouseClick wMouseEvent;
-
- void create_window(X::Window *dest, int left, int top) const;
- void Xsetup();
- void Xwait() const;
-
- public:
- static WindowManager::WindowManager wManager;
- static Xwrapper Xw;
- static WMPixmap char_pixmaps[3];
- static WMPixmap checkbox_pixmap, xbutton_pixmap, leds_pixmap[4];
- static WMPixmap emptybar_pixmap, fullbar_pixmap;
- static WMPixmap tile_pixmap;
- static Color colormap[WMColor::numcolors];
-
- // Always call this function first in main():
- static void initialize(int argc = 0, char *argv[] = 0);
- static unsigned int size();
-
- WMApp();
- ~WMApp();
-
- void addwindow(WMWindow *);
- void addwindow(WMWindow &);
-
- // Use this call to start the GUI.
- void run(unsigned int window = 0);
- void run(int window);
- void run(WMWindow &);
- void run(WMWindow *);
-
- // Use these within callbacks of windows or buttons in order to switch
- // to a different window, or to exit the GUI.
- void switch_to(unsigned int window) const;
- void switch_to(int window) const;
- void switch_to(WMWindow &) const;
- void switch_to(WMWindow *) const;
- void stop() const;
-
- // Use this within callbacks of windows or buttons in order to play
- // with other widgets.
- WMWindow * window(unsigned int) const;
- WMWindow * current() const;
- unsigned int currentnum() const;
-
- // Use this within callbacks to see which mouse button was pressed
- // and where.
- const WMMouseClick & mouseclick() const;
-
- // Windows use this call to see if it's time for them to exit yet.
- bool done() const;
-
- // utility functions for windows
- void mask() const;
- void repaint() const;
- void Xshow() const;
-};
-
-inline
-WMApp::WMApp()
-: wActiveWindow(0), wNextWindow(0), wFinished(false) { }
-
-inline
-WMApp::~WMApp()
-{
- if (wProgramWin == wActiveWin)
- X::XDestroyWindow(Xw.xdisplay(), wProgramWin);
- else {
- X::XDestroyWindow(Xw.xdisplay(), wProgramWin);
- X::XDestroyWindow(Xw.xdisplay(), wActiveWin);
- }
-}
-
-inline void
-WMApp::addwindow(WMWindow *w) { wWindows.push_back(w); }
-
-inline void
-WMApp::addwindow(WMWindow &w) { wWindows.push_back(&w); }
-
-inline unsigned int
-WMApp::size() { return wWindowSize; }
-
-inline WMWindow *
-WMApp::window(unsigned int i) const
-{ return i < wWindows.size() ? wWindows[i] : 0; }
-
-inline WMWindow *
-WMApp::current() const { return wWindows[wActiveWindow]; }
-
-inline unsigned int
-WMApp::currentnum() const { return wActiveWindow; }
-
-inline const WMMouseClick &
-WMApp::mouseclick() const { return wMouseEvent; }
-
-inline void
-WMApp::switch_to(unsigned int window) const
-{ if (window < wWindows.size()) wNextWindow = window; }
-
-inline void
-WMApp::switch_to(int window) const
-{
- if (window >= 0 && window < static_cast<int>(wWindows.size()))
- wNextWindow = window;
-}
-
-inline void
-WMApp::stop() const { wFinished = true; }
-
-inline bool
-WMApp::done() const { return wFinished || wActiveWindow != wNextWindow; }
-
-#endif
diff --git a/wmcube/wmapp/wmbutton.cc b/wmcube/wmapp/wmbutton.cc
deleted file mode 100644
index 2989a0310f7e..000000000000
--- a/wmcube/wmapp/wmbutton.cc
+++ /dev/null
@@ -1,59 +0,0 @@
-#include "wmbutton.h"
-#include "wmapp.h"
-#include "wmwindow.h"
-
-// functions for WMButton ------------------------------------------------
-
-WMButton::WMButton()
-{
- setborder(1);
- setbgcolor(WMColor(ButtonFace), false);
- set_top_left_c(WMColor(ButtonBorderBright));
- set_bottom_right_c(WMColor(ButtonBorderDim));
-}
-
-void
-WMButton::real_display()
-{
- if (is_active())
- WMImage::real_display();
- else
- // If button is not clickable, don't draw an icon.
- // Note: If the button has no icon, I recommend that you change its
- // background color from the default; otherwise the button will always
- // look as if it is disabled.
- WMApp::Xw.fill_rectangle(window()->pixmap(), b_position(),
- WMColor(ButtonFace));
-}
-
-bool
-WMButton::press(int button, int x, int y)
-{
- if (contains(x, y)) {
- if (is_active()) {
- wPressed = true;
- set_top_left_c(WMColor(ButtonBorderDim));
- set_bottom_right_c(WMColor(ButtonBorderBright));
- draw_border();
- app()->repaint();
- }
- return true;
- }
- else return false;
-}
-
-bool
-WMButton::release(int button, int x, int y)
-{
- if (wPressed) {
- wPressed = false;
- set_top_left_c(WMColor(ButtonBorderBright));
- set_bottom_right_c(WMColor(ButtonBorderDim));
- draw_border();
- app()->repaint();
- if (contains(x, y))
- execute();
- return true;
- }
- else return false;
-}
diff --git a/wmcube/wmapp/wmbutton.h b/wmcube/wmapp/wmbutton.h
deleted file mode 100644
index 83fa1d90f4af..000000000000
--- a/wmcube/wmapp/wmbutton.h
+++ /dev/null
@@ -1,18 +0,0 @@
-#include "wmimage.h"
-#include "wmcallback.h"
-
-#ifndef _WMBUTTON_H
-#define _WMBUTTON_H
-
-// WMButton: An image that can execute callback functions when clicked upon
-class WMButton : public WMCallback, public WMImage {
- private:
- void real_display();
-
- public:
- WMButton();
- bool press(int button, int x, int y);
- bool release(int button, int x, int y);
-};
-
-#endif
diff --git a/wmcube/wmapp/wmcallback.cc b/wmcube/wmapp/wmcallback.cc
deleted file mode 100644
index 9fb2a9468f5a..000000000000
--- a/wmcube/wmapp/wmcallback.cc
+++ /dev/null
@@ -1,34 +0,0 @@
-#include "wmcallback.h"
-
-// functions for WMCallback ----------------------------------------------
-
-void
-WMCallback::execute()
-{
- // execute all callbacks for this object, in order
- for (unsigned int i = 0; i < numcallbacks(); i++)
- runcallback(i);
-}
-
-bool
-WMCallback::press(int button, int x, int y)
-{
- if (contains(x, y)) {
- wPressed = true;
- return true;
- }
- else return false;
-}
-
-bool
-WMCallback::release(int button, int x, int y)
-{
- if (wPressed) {
- wPressed = false;
- if (contains(x,y))
- execute();
- return true;
- }
- else return false;
-}
-
diff --git a/wmcube/wmapp/wmcallback.h b/wmcube/wmapp/wmcallback.h
deleted file mode 100644
index de9aab471b56..000000000000
--- a/wmcube/wmapp/wmcallback.h
+++ /dev/null
@@ -1,113 +0,0 @@
-#include <vector>
-#include "wmwidget.h"
-#include "wmclickable.h"
-
-#ifndef _WMCALLBACK_H
-#define _WMCALLBACK_H
-
-using std::vector;
-
-// WMCallback: A class capable of setting and executing callback functions.
-class WMCallback : public virtual WMWidget, public virtual WMClickable {
- public:
- typedef void (* data_func)(const WMApp *, void *);
- typedef void (* widget_func)(const WMApp *, WMWidget *, void *);
-
- private:
- class callback {
- public: virtual void execute(const WMApp *) = 0;
- };
-
- class data_callback : public callback {
- data_func func;
- void * data;
- public:
- data_callback(data_func, void *);
- void execute(const WMApp *);
- };
-
- class widget_callback : public callback {
- widget_func func;
- WMWidget * widget;
- void * data;
- public:
- widget_callback(widget_func, WMWidget *, void *);
- void execute(const WMApp *);
- };
-
- vector<callback*> wCallback;
-
- public:
- WMCallback();
- WMCallback(data_func, void * = 0);
- WMCallback(widget_func, WMWidget *, void * = 0);
- virtual ~WMCallback() { clearcallbacks(); }
-
- unsigned int numcallbacks() const;
- void addcallback(data_func, void * = 0);
- void addcallback(widget_func, WMWidget *, void * = 0);
- void runcallback(unsigned int i);
- void clearcallbacks();
-
- // check to see if a mouse click hit the widget; if so, run callbacks
- virtual bool press(int button, int x, int y);
- virtual bool release(int button, int x, int y);
- virtual void execute();
-};
-
-// inline functions for WMCallback ---------------------------------------
-
-inline
-WMCallback::data_callback::data_callback(data_func f, void *datap)
-: func(f), data(datap) { }
-
-inline void
-WMCallback::data_callback::execute(const WMApp *app)
-{ (func)(app, data); }
-
-inline
-WMCallback::widget_callback::widget_callback
-(widget_func f, WMWidget *w, void *datap)
-: func(f), widget(w), data(datap) { }
-
-inline void
-WMCallback::widget_callback::execute(const WMApp *app)
-{ (func)(app, widget, data); }
-
-inline
-WMCallback::WMCallback()
-{ }
-
-inline
-WMCallback::WMCallback(data_func f, void *data)
-{ addcallback(f, data); }
-
-inline
-WMCallback::WMCallback(widget_func f, WMWidget *w, void *data)
-{ addcallback(f, w, data); }
-
-inline void
-WMCallback::addcallback(data_func f, void *data)
-{ wCallback.push_back(new data_callback(f, data)); }
-
-inline void
-WMCallback::addcallback(widget_func f, WMWidget *w, void *data)
-{ wCallback.push_back(new widget_callback(f, w, data)); }
-
-inline void
-WMCallback::runcallback(unsigned int i)
-{ wCallback[i]->execute(app()); }
-
-inline unsigned int
-WMCallback::numcallbacks() const { return wCallback.size(); }
-
-inline void
-WMCallback::clearcallbacks()
-{
- for (vector<callback *>::iterator i = wCallback.begin();
- i != wCallback.end(); ++i)
- delete *i;
- wCallback.clear();
-}
-
-#endif
diff --git a/wmcube/wmapp/wmcanvas.cc b/wmcube/wmapp/wmcanvas.cc
deleted file mode 100644
index e1cf273c39f1..000000000000
--- a/wmcube/wmapp/wmcanvas.cc
+++ /dev/null
@@ -1,160 +0,0 @@
-#include <vector>
-#include "wmcanvas.h"
-#include "wmwindow.h"
-#include "wmapp.h"
-
-// functions for WMCanvas ------------------------------------------------
-
-WMCanvas::WMCanvas(const WMPixmap * pm)
-: WMImage(pm), wCurrentColor(WMColor(Bright)), wBuffered(false) { }
-
-WMCanvas::WMCanvas(const WMPixmap & pm)
-: WMImage(pm), wCurrentColor(WMColor(Bright)), wBuffered(false) { }
-
-WMCanvas::WMCanvas(char *xpm[])
-: WMImage(xpm), wCurrentColor(WMColor(Bright)), wBuffered(false) { }
-
-// these are all variants of the drawing functions in xwrapper.h.
-// Unlike there, they are relative to the borders of the widget.
-// Note that icon() should return an XPM which is the dimension of
-// the WMCanvas _minus_ the border thickness.
-
-/*void
-WMCanvas::copy_buffer()
-{
- WMApp::Xw.copy_rectangle(*icon(), window()->pixmap(), 0, 0,
- b_width(), b_height(), b_left(), b_top());
-// draw_border();
-}*/
-
-// don't use this macro in your programs, it's just to make my life easier in
-// the WMCanvas method definitions
-#define COPY_BUFFER() if (! buffered()) { display() /*copy_buffer()*/; }
-
-Color
-WMCanvas::get_point(int rel_x, int rel_y) const
-{ return WMApp::Xw.get_point(*icon(), rel_x, rel_y); }
-
-void
-WMCanvas::draw_point(int rel_x, int rel_y)
-{
- WMApp::Xw.draw_point(*p_icon(), rel_x, rel_y, color());
- COPY_BUFFER();
-}
-
-void
-WMCanvas::draw_line(int rel_x1, int rel_y1, int rel_x2, int rel_y2)
-{
- WMApp::Xw.draw_line(*p_icon(), rel_x1, rel_y1, rel_x2, rel_y2, color());
- COPY_BUFFER();
-}
-
-void
-WMCanvas::draw_arc(int x, int y, int width, int height, int angle1, int angle2)
-{
- WMApp::Xw.draw_arc(*p_icon(), x, y, width, height, angle1, angle2, color());
- COPY_BUFFER();
-}
-
-void
-WMCanvas::draw_lines(const vector<X::XPoint>& points)
-{
- X::XPoint *p = new X::XPoint[points.size()];
- for (size_t i = 0; i < points.size(); ++i)
- {
- p[i].x = points[i].x;
- p[i].y = points[i].y;
- }
- WMApp::Xw.draw_lines(*p_icon(), p, points.size(), color());
- delete[] p;
- COPY_BUFFER();
-}
-
-void
-WMCanvas::draw_horizontal_gradient(int rel_x1, int rel_y1, int rel_x2,
- int rel_y2, Color c1, Color c2, double amt)
-{
- WMApp::Xw.draw_horizontal_gradient(*p_icon(), rel_x1, rel_y1, rel_x2, rel_y2,
- c1, c2, amt);
- COPY_BUFFER();
-}
-
-void
-WMCanvas::draw_vertical_gradient(int rel_x1, int rel_y1, int rel_x2,
- int rel_y2, Color c1, Color c2, double amt)
-{
- WMApp::Xw.draw_vertical_gradient(*p_icon(), rel_x1, rel_y1, rel_x2, rel_y2,
- c1, c2, amt);
- COPY_BUFFER();
-}
-
-void
-WMCanvas::empty_rectangle(int rel_x, int rel_y, int w, int h, int thickness)
-{
- WMApp::Xw.draw_border(*p_icon(), rel_x, rel_y, w, h, thickness,
- color(), color(), color());
- COPY_BUFFER();
-}
-
-void
-WMCanvas::empty_rectangle(const WMRectangle & rel_posn, int thickness)
-{
- WMApp::Xw.draw_border(*p_icon(), rel_posn, thickness,
- color(), color(), color());
- COPY_BUFFER();
-}
-
-void
-WMCanvas::fill_rectangle(int rel_x, int rel_y, int w, int h)
-{
- WMApp::Xw.fill_rectangle(*p_icon(), rel_x, rel_y, w, h, color());
- COPY_BUFFER();
-}
-
-void
-WMCanvas::fill_rectangle(const WMRectangle & rel_posn)
-{
- WMApp::Xw.fill_rectangle(*p_icon(), rel_posn, color());
- COPY_BUFFER();
-}
-
-void
-WMCanvas::fill_arc(int x, int y, int width, int height, int angle1, int angle2)
-{
- WMApp::Xw.fill_arc(*p_icon(), x, y, width, height, angle1, angle2, color());
- COPY_BUFFER();
-}
-
-void
-WMCanvas::fill_polygon(const vector<X::XPoint>& points, Xwrapper::XShape shape)
-{
- X::XPoint *p = new X::XPoint[points.size()];
- for (size_t i = 0; i < points.size(); ++i)
- {
- p[i].x = points[i].x;
- p[i].y = points[i].y;
- }
- WMApp::Xw.fill_polygon(*p_icon(), p, points.size(), color(), shape);
- delete[] p;
- COPY_BUFFER();
-}
-
-void
-WMCanvas::copy_rectangle(const WMPixmap & source, int source_x, int source_y,
- int source_w, int source_h, int dest_x, int dest_y)
-{
- WMApp::Xw.copy_rectangle(source, *p_icon(), source_x, source_y,
- source_w, source_h, dest_x, dest_y);
- COPY_BUFFER();
-}
-
-void
-WMCanvas::copy_rectangle(const WMPixmap & source, const WMRectangle & posn,
- int dest_x, int dest_y)
-{
- WMApp::Xw.copy_rectangle(source, *p_icon(), posn, dest_x, dest_y);
- COPY_BUFFER();
-}
-
-#undef COPY_BUFFER
-
diff --git a/wmcube/wmapp/wmcanvas.h b/wmcube/wmapp/wmcanvas.h
deleted file mode 100644
index aa596fc4f5b1..000000000000
--- a/wmcube/wmapp/wmcanvas.h
+++ /dev/null
@@ -1,68 +0,0 @@
-#include <vector>
-#include "wmimage.h"
-
-#ifndef _WMCANVAS_H
-#define _WMCANVAS_H
-
-using std::vector;
-
-// WMCanvas: a widget inheriting from WMImage that allows you to change the
-// image using drawing functions
-class WMCanvas : public virtual WMImage {
- Color wCurrentColor;
- bool wBuffered;
- public:
- WMCanvas(const WMPixmap * pm = 0);
- WMCanvas(const WMPixmap & pm);
- WMCanvas(char *xpm[]);
-
- void setcolor(Color);
- void setbuffered(bool);
- Color color() const;
- bool buffered() const;
-
- // these are all variants of the drawing functions in xwrapper.h.
- // Unlike there, they are relative to the borders of the widget.
- Color get_point(int rel_x, int rel_y) const;
- void draw_point(int rel_x, int rel_y);
- void draw_line(int rel_x1, int rel_y1, int rel_x2, int rel_y2);
- void draw_arc(int x, int y, int width, int height, int angle1, int angle2);
- //angles are in units of degrees * 64
- void draw_lines(const vector<X::XPoint>& points);
- //X::XPoint is simply a struct { short x, y };
- void draw_horizontal_gradient(int rel_x1, int rel_y1, int rel_x2, int rel_y2,
- Color c1, Color c2, double amount = 1.0);
- void draw_vertical_gradient(int rel_x1, int rel_y1, int rel_x2, int rel_y2,
- Color c1, Color c2, double amount = 1.0);
- void empty_rectangle(int rel_x, int rel_y, int width, int height,
- int thickness);
- void empty_rectangle(const WMRectangle & rel_posn, int thickness);
- void fill_rectangle(int rel_x, int rel_y, int width, int height);
- void fill_rectangle(const WMRectangle & rel_posn);
- void fill_arc(int x, int y, int width, int height, int angle1, int angle2);
- //angles are in units of degrees * 64
- void fill_polygon(const vector<X::XPoint>& points,
- Xwrapper::XShape shape = Xwrapper::complex);
- //see xwrapper.h for the meaning of shape
- void copy_rectangle(const WMPixmap & source, int source_x, int source_y,
- int source_w, int source_h,
- int dest_x = 0, int dest_y = 0);
- void copy_rectangle(const WMPixmap & source, const WMRectangle & posn,
- int dest_x = 0, int dest_y = 0);
-};
-
-// inline functions for WMCanvas -----------------------------------------
-
-inline void
-WMCanvas::setcolor(Color c) { wCurrentColor = c; }
-
-inline void
-WMCanvas::setbuffered(bool b) { wBuffered = b; }
-
-inline Color
-WMCanvas::color() const { return wCurrentColor; }
-
-inline bool
-WMCanvas::buffered() const { return wBuffered; }
-
-#endif
diff --git a/wmcube/wmapp/wmclickable.h b/wmcube/wmapp/wmclickable.h
deleted file mode 100644
index 419386af1e01..000000000000
--- a/wmcube/wmapp/wmclickable.h
+++ /dev/null
@@ -1,21 +0,0 @@
-#ifndef _WMCLICKABLE_H
-#define _WMCLICKABLE_H
-
-// WMClickable: Widgets that are clickable should inherit from this class.
-class WMClickable {
- protected:
- bool wPressed;
- public:
- WMClickable();
- virtual ~WMClickable() { }
-
- virtual bool press(int button, int x, int y) = 0;
- virtual bool release(int button, int x, int y) = 0;
-};
-
-// inline functions for WMClickable --------------------------------------
-
-inline WMClickable::WMClickable()
-: wPressed(false) { }
-
-#endif
diff --git a/wmcube/wmapp/wmellipse.cc b/wmcube/wmapp/wmellipse.cc
deleted file mode 100644
index 4bbe1c73c928..000000000000
--- a/wmcube/wmapp/wmellipse.cc
+++ /dev/null
@@ -1,58 +0,0 @@
-#include <cmath>
-#include "wmellipse.h"
-#include "wmwindow.h"
-#include "wmapp.h"
-
-// functions for WMEllipse -----------------------------------------------
-
-void
-WMEllipse::draw_border()
-{ WMEllipse::draw_border(top_left_c(), bottom_right_c(), 5 /* steps */); }
-
-void
-WMEllipse::draw_border(Color c1, Color c2, int steps)
-{
- if (border()) {
- X::XGCValues gcv;
- gcv.line_width = border();
- X::XChangeGC(WMApp::Xw.xdisplay(), window()->pixmap().gc,
- X_MACRO(GCLineWidth), &gcv);
-
- // These dimensions are all experimentally determined :)
- int l = left() + (border() - 1) / 2,
- t = top() + (border() - 1) / 2,
- w = width() - border() + (1 - border() % 2),
- h = height() - border() + (1 - border() % 2);
-
- const double weight_inc = 1.0 / (steps + 1);
- const double angle_inc = 45 / steps;
- for (double weight = weight_inc, angle = 0; angle < 44;
- weight += weight_inc, angle += angle_inc)
- {
- Color c = Color::alpha_blend(c1, c2, weight);
- WMApp::Xw.draw_arc(window()->pixmap(), l, t, w, h, (int)(angle * 64),
- (int)(angle_inc * 64), c);
- WMApp::Xw.draw_arc(window()->pixmap(), l, t, w, h, (int)((270 - angle) * 64),
- (int)(-angle_inc * 64), c);
- }
-
- WMApp::Xw.draw_arc(window()->pixmap(), l, t, w, h, 45 * 64, 180 * 64, c1);
- WMApp::Xw.draw_arc(window()->pixmap(), l, t, w, h, 270 * 64, 90 * 64, c2);
-
- gcv.line_width = 0;
- X::XChangeGC(WMApp::Xw.xdisplay(), window()->pixmap().gc,
- X_MACRO(GCLineWidth), &gcv);
- }
-}
-
-bool
-WMEllipse::contains(int x, int y) const
-{
- double h_axis = std::ldexp(double(width()), -1);
- double v_axis = std::ldexp(double(height()), -1);
- double xc = (h_axis + left() - 0.5 - x) / h_axis;
- xc *= xc;
- double yc = (v_axis + top() - 0.5 - y) / v_axis;
- yc *= yc;
- return ((xc + yc) <= 1.0);
-}
diff --git a/wmcube/wmapp/wmellipse.h b/wmcube/wmapp/wmellipse.h
deleted file mode 100644
index b26000e03382..000000000000
--- a/wmcube/wmapp/wmellipse.h
+++ /dev/null
@@ -1,21 +0,0 @@
-#include "wmwidget.h"
-
-#ifndef _WMELLIPSE_H
-#define _WMELLIPSE_H
-
-// WMEllipse: Widgets inherited from this class will be displayed within an
-// elliptical border. Simply inherit from WMEllipse and the desired widget.
-// Note: In order to get a circle, you must make the widget's width the same
-// as its height, for example by placing it inside a WMFrame with padding.
-class WMEllipse : public virtual WMWidget {
- protected:
- virtual void draw_border(Color c1, Color c2, int nsteps);
- virtual void draw_border();
-
- public:
- bool contains(int x, int y) const;
-
- virtual ~WMEllipse() { }
-};
-
-#endif
diff --git a/wmcube/wmapp/wmframe.cc b/wmcube/wmapp/wmframe.cc
deleted file mode 100644
index 197e744480df..000000000000
--- a/wmcube/wmapp/wmframe.cc
+++ /dev/null
@@ -1,303 +0,0 @@
-#include <iostream>
-#include <cstdarg>
-#include "wmframe.h"
-#include "wmclickable.h"
-#include "wmwindow.h"
-#include "wmapp.h"
-
-using std::cerr;
-using std::endl;
-
-// functions for WMFrame -------------------------------------------------
-
-WMFrame::~WMFrame()
-{
- if (wClipMask) {
- WMApp::Xw.free_pixmap(*wClipMask);
- delete wClipMask;
- }
-}
-
-void
-WMFrame::real_display()
-{
- if (border() || !transparency())
- // fill frame with background color before adding children
- WMApp::Xw.fill_rectangle(window()->pixmap(), b_position(),
- WMColor(Background));
-}
-
-void
-WMFrame::display()
-{
- if (!(parent() && parent()->is_displayed())) return;
- real_display();
- setdisplayed(true);
-
- X::GC old_gc = 0;
- if (wClipMask) {
- // keep children from drawing where they shouldn't
- old_gc = window()->pixmap().gc;
- window()->pixmap().gc = wClipMask->gc;
- }
- for (unsigned int i = 0; i < numchildren(); i++)
- child(i)->display();
- if (wClipMask)
- window()->pixmap().gc = old_gc;
-
- draw_border();
-}
-
-void
-WMFrame::hide()
-{
- if (!is_displayed()) return;
- for (unsigned int i = 0; i < numchildren(); i++)
- child(i)->hide();
- real_hide();
- setdisplayed(false);
-}
-
-void
-WMFrame::activate()
-{
- if (is_active()) return;
- setactive(true);
- for (unsigned int i = 0; i < numchildren(); i++)
- child(i)->activate();
- real_activate();
- if (app()->done()) return;
- if (is_displayed()) display();
-}
-
-void
-WMFrame::deactivate()
-{
- if (!is_active()) return;
- real_deactivate();
- for (unsigned int i = 0; i < numchildren(); i++)
- child(i)->deactivate();
- setactive(false);
- if (is_displayed()) display();
-}
-
-bool
-WMFrame::addchild(WMWidget *w)
-{
- if (is_displayed()) return false;
-
- // child cannot already have a parent
- if (w->parent()) {
- cerr << "WMError: Reparenting child widget " << w << " to " << this
- << " not allowed" << endl;
- return false;
- }
-
- // child cannot recursively contain "this"
- const WMWidget *test = this;
- while ((test = test->parent()))
- if (test == w) {
- cerr << "WMError: Widget " << w << " cannot be its own ancestor" << endl;
- return false;
- }
-
- w->setparent(this);
- wChildren.push_back(w);
- return true;
-}
-
-bool
-WMFrame::removechild(WMWidget *w)
-{
- if (is_displayed()) return false;
- for (unsigned int i = 0; i < numchildren(); i++)
- if (w == child(i)) {
- child(i)->setparent(0);
- wChildren.erase(wChildren.begin() + i);
- return true;
- }
- cerr << "WMError: Widget " << w << " is not a child of " << this << endl;
- return false;
-}
-
-void
-WMFrame::clip(char *xpm_array[65])
-{
- if (! is_displayed()) setaspectratios();
- for (unsigned int i = 0; i < numchildren(); i++)
- child(i)->clip(xpm_array);
-
- if (! transparency() || border()) { // create a mask for drawing children
- if (!wClipMask) {
- wClipMask = new WMPixmap;
- WMApp::Xw.create_pixmap(*wClipMask, xpm_array);
- X::XFreePixmap(WMApp::Xw.xdisplay(), wClipMask->pixmap);
- // free unused pixmap
- wClipMask->pixmap = wClipMask->mask;
- wClipMask->mask = 0; // muck around so xwrapper::free_pixmap works right
- X::XSetClipMask(WMApp::Xw.xdisplay(), wClipMask->gc, wClipMask->pixmap);
- }
-
- for (int col = left(); col < right(); col++)
- for (int row = top(); row < bottom(); row++)
- xpm_array[row + 3][col] = contains(col, row) ? 'X' : ' ';
- // clip in the whole frame on the window's mask, but don't let widgets
- // draw outside the frame
- }
-}
-
-bool
-WMFrame::press(int button, int x, int y)
-{
- WMClickable *c;
-
- if (!contains(x, y)) {
- return false; // button pressed is not within this frame
- }
-
- for (unsigned int i = 0; i < numchildren(); i++)
- if ((c = dynamic_cast<WMClickable *>(child(i))))
- if (c->press(button, x, y)) return true;
- return false;
-}
-
-// If the mouse button is released over the WMWidget on which it was
-// initially pressed, that widget's callbacks should be executed.
-bool
-WMFrame::release(int button, int x, int y)
-{
- WMClickable *c;
-
- for (unsigned int i = 0; i < numchildren(); i++)
- if ((c = dynamic_cast<WMClickable *>(child(i))))
- if (c->release(button, x, y)) return true;
- return false;
-}
-
-// This function needs to be fixed to take care of leftover space if the
-// integer division wipes out a remainder.
-bool
-WMFrame::setaspectratios(vector<int> r)
-{
- int totalspace = 0, availablespace;
- if (wRatiosSet || numchildren() == 0) return true; // nothing to do
-
- // if insufficient space to display any children, return an error
- if (width() < 2 * border() || height() < 2 * border())
- { cerr << "WMError: Frame " << this << " too small" << endl; return false; }
-
- if (r.size() > 0) {
- // Widgets that do not already have a size, for whom there is no
- // corresponding element in the vector of size ratios, will be
- // made size zero
- while (r.size() < numchildren())
- r.push_back(0);
- }
-
- // calculate total space consumed by widgets with known sizes
- for (unsigned int i = 0; i < numchildren(); i++)
- totalspace += child(i)->par_to_parent();
- availablespace = b_parallel() - totalspace - (numchildren() - 1) * padding();
-
- // If widgets of known size take up more space than the frame has,
- // rescale them in proportion and do not display the other widgets.
- if (availablespace < 1) {
- int numgoodchildren = 0;
- for (unsigned int i = 0; i < numchildren(); i++) {
- if (child(i)->par_to_parent() > 0)
- numgoodchildren++;
- }
- availablespace = b_parallel() - (numgoodchildren - 1) * padding();
- if (availablespace < 1 || numgoodchildren == 0) {
- // not enough space, even for only the known-size widgets
- cerr << "WMError: Frame " << this << " too small" << endl;
- return false;
- }
-
- for (unsigned int i = 0; i < numchildren(); i++) {
- if (child(i)->par_to_parent() > 0) {
- double ratio = child(i)->par_to_parent() / totalspace;
- child(i)->set_par_to_parent(static_cast<int>
- (ratio * availablespace));
- }
- }
- }
-
- else { // Otherwise, scale the unknown-sized widgets appropriately.
- double ratiosum = 0;
- for (unsigned int i = 0; i < numchildren(); i++) {
- if (child(i)->par_to_parent() == 0)
- ratiosum += ((r.size() > 0) ? r[i] : 1.0);
- }
- for (unsigned int i = 0; i < numchildren(); i++)
- if (child(i)->par_to_parent() == 0) {
- double ratio = (r.size() ? r[i] : 1.0) / ratiosum;
- child(i)->set_par_to_parent(static_cast<int>
- (ratio * availablespace));
- }
- }
-
- // Scale widgets in the perpendicular direction if necessary
- for (unsigned int i = 0; i < numchildren(); i++)
- if (child(i)->perp_to_parent() <= 0
- || child(i)->perp_to_parent() > b_perpend())
- child(i)->set_perp_to_parent(b_perpend());
-
- // Finally, set the location of all these child widgets.
- int posn = 0;
- for (unsigned int i = 0; i < numchildren(); i++) {
- if (child(i)->width() && child(i)->height()) {
- if (orientation() == Orientation::Horizontal) {
- child(i)->setleft(b_left() + posn);
- child(i)->settop(b_top());
- }
- else {
- child(i)->setleft(b_left());
- child(i)->settop(b_top() + posn);
- }
- posn += child(i)->par_to_parent() + padding();
- }
- }
-
- // Deal with rounding errors: if the last widget doesn't reach all the
- // way to the end of the parent, force it to. This isn't the best way
- // to do this, but it's the easiest :)
- if (child(numchildren() - 1)->par_to_parent()) {
- WMWidget *lastchild = child(numchildren() - 1);
- if (orientation() == Orientation::Horizontal)
- lastchild->setwidth(right() - border() - lastchild->left());
- else
- lastchild->setheight(bottom() - border() - lastchild->top());
- }
-
- wRatiosSet = true;
- return true;
-}
-
-// varargs version for people too lazy to create an std::vector.
-// Use with caution: the number of arguments MUST equal the number
-// of children, since we can't check the number of arguments of a
-// varargs function within the function. I'm not sure what happens
-// if you try to provide this function with fewer arguments than
-// the widget has children, but I imagine it's bad.
-bool
-WMFrame::setaspectratios(int ratio, ...)
-{
- if (numchildren() < 1)
- // nothing to do, return OK
- return true;
-
- std::va_list args;
- vector<int> v = vector<int>();
- v.push_back(ratio);
-
- va_start(args, ratio);
- for (unsigned int i = 1; i < numchildren(); i++) {
- ratio = va_arg(args, int);
- v.push_back(ratio);
- }
- va_end(args);
-
- return setaspectratios(v);
-}
-
diff --git a/wmcube/wmapp/wmframe.h b/wmcube/wmapp/wmframe.h
deleted file mode 100644
index 977268bcdf6d..000000000000
--- a/wmcube/wmapp/wmframe.h
+++ /dev/null
@@ -1,109 +0,0 @@
-#include <vector>
-#include "wmwidget.h"
-#include "wmclickable.h"
-#include "xwrapper.h"
-
-#ifndef _WMFRAME_H
-#define _WMFRAME_H
-
-using std::vector;
-
-// WMFrame: A widget that can contain other widgets
-class WMFrame : public virtual WMClickable, public virtual WMWidget {
- private:
- int wPadding;
- bool wRatiosSet;
- bool wTransparentPadding;
- WMPixmap *wClipMask;
-
- protected:
- vector<WMWidget *> wChildren;
- virtual void real_display();
-
- public:
- WMFrame();
- virtual ~WMFrame();
-
- WMWidget * child(int i) const;
- unsigned int numchildren() const;
- bool addchild(WMWidget &child);
- bool addchild(WMWidget *child);
- bool removechild(WMWidget &child);
- bool removechild(WMWidget *child);
-
- void clip(char *xpm_array[65]);
- virtual void display();
- virtual void hide();
- virtual void activate();
- virtual void deactivate();
-
- int padding() const;
- bool transparency() const;
-
- void setpadding(int);
- void settransparency(bool);
-
- // what to do if a mouse button is pressed?
- bool press(int button, int x, int y);
- bool release(int button, int x, int y);
-
- // NOTE: The setaspectratios() function must be called on frames / windows
- // in order from Parent to Child widgets!
- //
- // if passed no argument, this function allots equal space to
- // all child widgets that do not already have a declared size.
- // Otherwise, it uses the vector or va_list it's passed as a list of how
- // the widgets should be sized relative to each other. Note that even though
- // widgets with non-zero sizes are not resized, the vector of sizes must
- // contain dummy place-holder arguments for them anyway.
- //
- // For example, if the frame contains 4 widgets a,b,c,d, of which b already
- // has a known (non-zero) size, and you call this function with argument
- // being the vector (5,4,3), then widget a will be allotted 5/(5+3) = 5/8
- // and widget c will be allotted 3/(5+3) = 3/8 of the space not already
- // allotted to widget b. Widget d will not be displayed. On the other hand,
- // if you call this function with no argument, then a, c, and d will EACH be
- // allocated 1/3 of the space not already taken by widget b.
- //
- // This function, however it is called, will scale widgets to the
- // perpendicular size of the frame if their perpendicular dimension is not
- // known. If the perpendicular size of the widget IS known, it will be
- // rescaled only if the widget is larger than the frame in that dimension.
- bool setaspectratios(vector<int> ratiolist = vector<int>());
-
- // a va_list version for people too lazy to create an std::vector:
- bool setaspectratios(int ratio1, ...);
-};
-
-// inline functions for WMFrame ------------------------------------------
-
-inline WMFrame::WMFrame()
-: wPadding(2), wRatiosSet(false), wTransparentPadding(true), wClipMask(0),
- wChildren() { setborder(0); }
-
-inline unsigned int
-WMFrame::numchildren() const { return wChildren.size(); }
-
-inline WMWidget *
-WMFrame::child(int i) const { return wChildren[i]; }
-
-inline bool
-WMFrame::addchild(WMWidget &child) { return addchild(&child); }
-
-inline bool
-WMFrame::removechild(WMWidget &child) { return removechild(&child); }
-
-inline int
-WMFrame::padding() const { return wPadding; }
-
-inline bool
-WMFrame::transparency() const { return wTransparentPadding; }
-
-inline void
-WMFrame::setpadding(int p) { if (!is_displayed()) wPadding = p; }
-
-inline void
-WMFrame::settransparency(bool b)
-{ if (!is_displayed()) wTransparentPadding = b; }
-
-#endif
diff --git a/wmcube/wmapp/wmhistory.cc b/wmcube/wmapp/wmhistory.cc
deleted file mode 100644
index 5900069d0f1c..000000000000
--- a/wmcube/wmapp/wmhistory.cc
+++ /dev/null
@@ -1,67 +0,0 @@
-#include <iostream>
-#include "wmhistory.h"
-#include "wmwindow.h"
-#include "wmapp.h"
-
-using std::cerr;
-using std::endl;
-
-// functions for WMHistory -----------------------------------------------
-// added by Jason
-
-void WMHistory::setvalue (int value, int index, bool dodisplay)
-{
- if (index == -1)
- {
- wValues.pop_back();
- wValues.push_front(value);
- }
- else
- wValues[index] = value;
- if (dodisplay)
- display();
-}
-
-void WMHistory::setvalues (const vector<int>& values, bool dodisplay)
-{
- vector<int>::const_iterator src = values.begin();
- deque<int>::iterator dest = wValues.begin();
- while (src != values.end() && dest != wValues.end())
- *dest++ = *src++;
- while (dest != wValues.end())
- *dest++ = 0;
- if (dodisplay)
- display();
-}
-
-void WMHistory::clear(bool dodisplay)
-{ setvalues(vector<int>(0), dodisplay); }
-
-void WMHistory::real_display ()
-// XXX: Currently no vertical style, since it doesn't make a lot of sense
-{
- WMApp::Xw.fill_rectangle(window()->pixmap(), b_position(),
- WMColor(Background));
- if (!wTotal)
- return;
- if (width() < 2 * border() || height() < 2 * border())
- { cerr << "WMError: History " << this << " too small" << endl; return; }
-
- for (int x = 0; x < b_width(); x++)
- {
- int h = static_cast<int> (fraction(x) * b_height());
- if (h < 1)
- continue;
- else if (h == 1)
- WMApp::Xw.draw_point(window()->pixmap(), b_right() - 1 - x, b_bottom() - 1
- , WMColor(Bright));
- else
- {
- WMApp::Xw.draw_line(window()->pixmap(), b_right() - 1 - x, b_bottom() - h,
- b_right() - 1 - x, b_bottom() - h + 1, WMColor(Bright));
- if (h > 2)
- WMApp::Xw.draw_line(window()->pixmap(), b_right() - 1 - x, b_bottom() - h + 2, b_right() - 1 - x, b_bottom() - 1, WMColor(Medium));
- }
- }
-}
-
diff --git a/wmcube/wmapp/wmhistory.h b/wmcube/wmapp/wmhistory.h
deleted file mode 100644
index cd7c4ccc2478..000000000000
--- a/wmcube/wmapp/wmhistory.h
+++ /dev/null
@@ -1,71 +0,0 @@
-#include <vector>
-#include <deque>
-#include "wmwidget.h"
-
-#ifndef _WMHISTORY_H
-#define _WMHISTORY_H
-
-using std::vector;
-using std::deque;
-
-// WMHistory: a progress / load meter showing a history
-// added by Jason
-// XXX: Should we have an option to rescale the graph automatically?
-class WMHistory : public virtual WMWidget {
- private:
- static const int size = 64; //Number of values that we keep around
- deque<int> wValues;
- int wTotal;
- void real_display();
-
- public:
- WMHistory();
- WMHistory(int total);
- WMHistory(const vector<int>& values, int total);
- // XXX: Too lazy to make any other constructors.
-
- // All indexed functions refer to the element added that many units ago.
- // An index of -1 therefore appends a new value to the graph.
- void setvalue(int value, int index = -1, bool dodisplay = true);
-
- //setvalues zeros the history before copying the given values in.
- void setvalues(const vector<int>& values, bool dodisplay = true);
- void setvalues(const vector<int>& values, int total, bool dodisplay = true);
- void clear(bool dodisplay = true);
-
- void settotal(int total, bool dodisplay = true);
-
- int value(int index = 0) const;
- int total() const;
- double fraction(int index = 0) const;
-};
-
-// inline functions for WMHistory ----------------------------------------
-
-inline WMHistory::WMHistory ()
-: wValues(WMHistory::size, 0), wTotal(0) { }
-
-inline WMHistory::WMHistory (int total)
-: wValues(WMHistory::size, 0), wTotal(total) { }
-
-inline WMHistory::WMHistory (const vector<int>& values, int total)
-: wValues(size), wTotal(total)
-{ setvalues(values, false); }
-
-inline void WMHistory::setvalues(const vector<int>& values, int total,
- bool dodisplay)
-{ wTotal = total; setvalues(values, dodisplay); }
-
-inline void WMHistory::settotal (int total, bool dodisplay)
-{ wTotal = total; if (dodisplay) display(); }
-
-inline int WMHistory::value (int index) const
-{ return wValues[index]; }
-
-inline int WMHistory::total () const
-{ return wTotal; }
-
-inline double WMHistory::fraction (int index) const
-{ return static_cast<double>(wValues[index]) / wTotal; }
-
-#endif
diff --git a/wmcube/wmapp/wmimage.cc b/wmcube/wmapp/wmimage.cc
deleted file mode 100644
index 9d2b115e6f76..000000000000
--- a/wmcube/wmapp/wmimage.cc
+++ /dev/null
@@ -1,91 +0,0 @@
-#include <iostream>
-#include "wmimage.h"
-#include "wmwindow.h"
-#include "wmapp.h"
-
-using std::cerr;
-using std::endl;
-
-// functions for WMImage -------------------------------------------------
-
-WMImage::WMImage(const WMPixmap *pm)
-: wBGColor(WMColor(Background)) { seticon(pm); }
-
-WMImage::WMImage(const WMPixmap &pm)
-: wBGColor(WMColor(Background)) { seticon(pm); }
-
-WMImage::WMImage(char *xpm[])
-: wBGColor(WMColor(Background)) { seticon(xpm); }
-
-WMImage::~WMImage()
-{ if (icon()) WMApp::Xw.free_pixmap(wIcon); }
-
-void
-WMImage::seticon(bool dodisplay)
-{
- if (icon()) WMApp::Xw.free_pixmap(wIcon);
- if(WMApp::Xw.create_pixmap(wIcon, b_width(), b_height()))
- {
- WMApp::Xw.fill_rectangle(wIcon, 0, 0, b_width(), b_height(), bgcolor());
- wIconPtr = &wIcon;
- if (dodisplay) display();
- }
- else wIconPtr = 0;
-}
-
-void
-WMImage::seticon(const WMPixmap &pm, bool dodisplay)
-{
- if (icon()) WMApp::Xw.free_pixmap(wIcon);
- if (WMApp::Xw.create_pixmap(wIcon, pm))
- { wIconPtr = &wIcon; if (dodisplay) display(); }
- else wIconPtr = 0;
-}
-
-void
-WMImage::seticon(char *xpm[], bool dodisplay)
-{
- if (icon()) WMApp::Xw.free_pixmap(wIcon);
- if (WMApp::Xw.create_pixmap(wIcon, xpm))
- { wIconPtr = &wIcon; if (dodisplay) display(); }
- else wIconPtr = 0;
-}
-
-void
-WMImage::real_display()
-{
- const int imgwidth = icon() ? icon()->attr.width : 0;
- const int imgheight = icon() ? icon()->attr.height : 0;
-
- // if no icon, create an icon that consists only of the background color
- if (! icon())
- seticon(false);
-
- // if widget is not big enough to hold icon, complain about it
- else if (imgwidth > b_width() || imgheight > b_height()) {
- cerr << "WMError: Image " << this << " too small for icon" << endl;
- return;
- }
-
- // if icon is smaller than widget, color in the rest with background color
- else if (imgwidth < b_width() || imgheight < b_height()) {
- WMPixmap temp;
-
- // Blit background color onto rectangle
- WMApp::Xw.create_pixmap(temp, b_width(), b_height());
- WMApp::Xw.fill_rectangle(temp, 0, 0, b_width(), b_height(), bgcolor());
- // center icon onto background
- WMApp::Xw.copy_rectangle(*icon(), temp, 0, 0, imgwidth, imgheight,
- (b_width() - imgwidth) / 2, (b_height() - imgheight) / 2);
- // swap pixmaps
- WMApp::Xw.free_pixmap(wIcon);
- WMApp::Xw.create_pixmap(wIcon, temp);
- WMApp::Xw.free_pixmap(temp);
- }
-
- // if we get here, widget (minus border) and icon are the same size -
- // hallelujah!
- WMApp::Xw.copy_rectangle(*icon(), window()->pixmap(), 0, 0,
- b_width(), b_height(), b_left(), b_top());
-}
-
diff --git a/wmcube/wmapp/wmimage.h b/wmcube/wmapp/wmimage.h
deleted file mode 100644
index 899c31fbd671..000000000000
--- a/wmcube/wmapp/wmimage.h
+++ /dev/null
@@ -1,52 +0,0 @@
-#include "wmwidget.h"
-#include "xwrapper.h"
-
-#ifndef _WMIMAGE_H
-#define _WMIMAGE_H
-
-// WMImage: a widget that displays a picture in Xpm format
-class WMImage : public virtual WMWidget {
- private:
- WMPixmap wIcon;
- WMPixmap * wIconPtr;
-
- protected:
- Color wBGColor;
- virtual void real_display();
- WMPixmap * p_icon();
-
- public:
- WMImage(const WMPixmap * pm = 0);
- WMImage(const WMPixmap & pm);
- WMImage(char *xpm[]);
- virtual ~WMImage();
-
- void seticon(bool dodisplay = true); //make an empty icon
- void seticon(const WMPixmap *, bool dodisplay = true);
- void seticon(const WMPixmap &, bool dodisplay = true);
- void seticon(char *xpm[], bool dodisplay = true);
- void setbgcolor(Color, bool dodisplay = true);
- Color bgcolor() const;
- const WMPixmap * icon() const;
-};
-
-// inline functions for WMImage ------------------------------------------
-
-inline void
-WMImage::seticon(const WMPixmap *pm, bool dodisplay)
-{ if (pm) seticon(*pm, dodisplay); else wIconPtr = 0; }
-
-inline void
-WMImage::setbgcolor(Color c, bool dodisplay)
-{ wBGColor = c; if (dodisplay) display(); }
-
-inline Color
-WMImage::bgcolor() const { return wBGColor; }
-
-inline WMPixmap *
-WMImage::p_icon() { return wIconPtr; }
-
-inline const WMPixmap *
-WMImage::icon() const { return wIconPtr; }
-
-#endif
diff --git a/wmcube/wmapp/wmled.cc b/wmcube/wmapp/wmled.cc
deleted file mode 100644
index 4c08b2a9438b..000000000000
--- a/wmcube/wmapp/wmled.cc
+++ /dev/null
@@ -1,12 +0,0 @@
-#include "wmled.h"
-#include "wmapp.h"
-
-// functions for WMLed ---------------------------------------------------
-
-void
-WMLed::real_display()
-{
- seticon(WMApp::leds_pixmap[static_cast<int>(led())], false);
- if (icon()) WMImage::real_display();
-}
-
diff --git a/wmcube/wmapp/wmled.h b/wmcube/wmapp/wmled.h
deleted file mode 100644
index 5cf71deccba8..000000000000
--- a/wmcube/wmapp/wmled.h
+++ /dev/null
@@ -1,34 +0,0 @@
-#include "wmimage.h"
-
-#ifndef _WMLED_H
-#define _WMLED_H
-
-// WMLed: displays a round LED-type thing with a different color depending on
-// its status.
-class WMLed : public virtual WMImage {
- public:
- enum LedState { Off, Good, Warning, Error };
-
- private:
- enum LedState wState;
- void real_display();
-
- public:
- WMLed(LedState s = Off);
- void setled(enum LedState s, bool dodisplay = true);
- enum LedState led() const;
-};
-
-// inline functions for WMLed --------------------------------------------
-
-inline WMLed::WMLed(enum LedState s)
-: wState(s) { setborder(0); }
-
-inline void
-WMLed::setled(enum LedState s, bool dodisplay)
-{ wState = s; if (dodisplay) display(); }
-
-inline enum WMLed::LedState
-WMLed::led() const { return wState; }
-
-#endif
diff --git a/wmcube/wmapp/wmmeter.h b/wmcube/wmapp/wmmeter.h
deleted file mode 100644
index 023978128579..000000000000
--- a/wmcube/wmapp/wmmeter.h
+++ /dev/null
@@ -1,57 +0,0 @@
-#include "wmwidget.h"
-
-#ifndef _WMMETER_H
-#define _WMMETER_H
-
-// WMMeter: Base class for widgets that display a state of progress or load.
-// Cannot be instantiated (inherits the pure virtual function real_display).
-class WMMeter : public virtual WMWidget {
- private:
- int wValue, wTotal;
-
- public:
- WMMeter();
- WMMeter(int total);
- WMMeter(int value, int total);
-
- virtual void setvalue(int value, bool dodisplay = true);
- virtual void settotal(int total, bool dodisplay = true);
-
- int value() const;
- int total() const;
- double fraction() const;
-};
-
-// inline functions for WMMeter ------------------------------------------
-
-inline WMMeter::WMMeter()
-: wValue(0), wTotal(0) { }
-
-inline WMMeter::WMMeter(int total)
-: wValue(0), wTotal(total) { }
-
-inline WMMeter::WMMeter(int val, int total)
-: wValue(val), wTotal(total) { }
-
-inline void
-WMMeter::setvalue(int val, bool dodisplay)
-{ wValue = val; if (dodisplay) display(); }
-
-inline void
-WMMeter::settotal(int total, bool dodisplay)
-{ wTotal = total; if (dodisplay) display(); }
-
-inline int
-WMMeter::value() const { return wValue; }
-
-inline int
-WMMeter::total() const { return wTotal; }
-
-inline double
-WMMeter::fraction() const
-{
- if (wTotal == 0) return 0;
- else return static_cast<double>(wValue) / wTotal;
-}
-
-#endif
diff --git a/wmcube/wmapp/wmmeterbar.cc b/wmcube/wmapp/wmmeterbar.cc
deleted file mode 100644
index 2ec6dfd5fbcf..000000000000
--- a/wmcube/wmapp/wmmeterbar.cc
+++ /dev/null
@@ -1,80 +0,0 @@
-#include <iostream>
-#include <algorithm> // for max()
-#include "wmmeterbar.h"
-#include "wmwindow.h"
-#include "wmapp.h"
-
-using std::cerr;
-using std::endl;
-
-// functions for WMMeterBar ----------------------------------------------
-// added by Jason
-
-void
-WMMeterBar::real_display()
-{
- if ((orientation() == Orientation::Horizontal && width() < 2 * border())
- || (orientation() == Orientation::Vertical && height() < 2 * border()))
- { cerr << "WMError: Meter Bar " << this << " too small" << endl; return; }
-
- //first draw desired background
- switch (style())
- {
- case Spectrum:
- if (orientation() == Orientation::Horizontal)
- WMApp::Xw.draw_horizontal_gradient(window()->pixmap(),
- b_left(), b_top(), b_right(), b_bottom(), 0x5C00, 0x5C0000);
- else
- WMApp::Xw.draw_vertical_gradient(window()->pixmap(),
- b_left(), b_top(), b_right(), b_bottom(), 0x5C0000, 0x5C00);
- break;
- case Spec_No_BG:
- WMApp::Xw.fill_rectangle(window()->pixmap(), b_position(),
- WMColor(Background));
- break;
- case Blue:
- WMApp::Xw.fill_rectangle(window()->pixmap(), b_position(),
- WMColor(Background));
- if (orientation() == Orientation::Horizontal)
- for (int x = 0; x < b_width(); x += 2)
- WMApp::Xw.draw_line(window()->pixmap(), x + b_left(), b_top(),
- x + b_left(), b_bottom(), 0x004941);
- else
- for (int y = 0; y < b_height(); y += 2)
- WMApp::Xw.draw_line(window()->pixmap(), b_left(),
- b_bottom() - y, b_right(), b_bottom() - y, 0x004941);
- break;
- }
-
- //then draw the progress bar
- if (total() && value())
- switch (style())
- {
- case Spectrum:
- case Spec_No_BG:
- if (orientation() == Orientation::Horizontal)
- WMApp::Xw.draw_horizontal_gradient(window()->pixmap(),
- b_left(), b_top(), b_right(), b_bottom(),
- 0xFF00, 0xFF0000, fraction());
- else
- WMApp::Xw.draw_vertical_gradient(window()->pixmap(),
- b_left(), b_bottom(), b_right(), b_top(),
- 0xFF00, 0xFF0000, fraction());
- break;
- case Blue:
- if (orientation() == Orientation::Horizontal)
- for (int x = 0;
- x < static_cast<int>(std::min(1.0, fraction()) * b_width());
- x += 2)
- WMApp::Xw.draw_line(window()->pixmap(), x + b_left(), b_top(),
- x + b_left(), b_bottom(), WMColor(Bright));
- else
- for (int y = 0;
- y < static_cast<int>(std::min(1.0, fraction()) * b_height());
- y += 2)
- WMApp::Xw.draw_line(window()->pixmap(), b_left(), b_bottom() - y,
- b_right(), b_bottom() - y, WMColor(Bright));
- break;
- }
-}
-
diff --git a/wmcube/wmapp/wmmeterbar.h b/wmcube/wmapp/wmmeterbar.h
deleted file mode 100644
index 00a4c0e3d7c0..000000000000
--- a/wmcube/wmapp/wmmeterbar.h
+++ /dev/null
@@ -1,47 +0,0 @@
-#include "wmmeter.h"
-
-#ifndef _WMMETERBAR_H
-#define _WMMETERBAR_H
-
-// WMMeterBar: a progress bar showing the instantaneous progress or load
-// added by Jason
-class WMMeterBar : public virtual WMMeter {
- public:
- // The styles correspond to those in wmmon, wmtop, and wmsmixer respectively:
- // green-to-red bar on dark green-to-red background; likewise on dark
- // colorless background; and turquoise hashmarks on dark background.
- enum Style { Spectrum, Spec_No_BG, Blue };
-
- private:
- enum Style wStyle;
-
- protected:
- void real_display();
-
- public:
- WMMeterBar();
- WMMeterBar(int total);
- WMMeterBar(int value, int total);
-
- void setstyle(enum Style, bool dodisplay = true);
- enum Style style() const;
-};
-
-// inline functions for WMMeterBar ---------------------------------------
-
-inline WMMeterBar::WMMeterBar() : WMMeter() { }
-
-inline WMMeterBar::WMMeterBar(int total) : WMMeter()
-{ settotal(total); }
-
-inline WMMeterBar::WMMeterBar(int val, int total) : WMMeter()
-{ settotal(total); setvalue(val); }
-
-inline void
-WMMeterBar::setstyle(enum Style s, bool dodisplay)
-{ wStyle = s; if (dodisplay) display(); }
-
-inline enum WMMeterBar::Style
-WMMeterBar::style() const { return wStyle; }
-
-#endif
diff --git a/wmcube/wmapp/wmslider.cc b/wmcube/wmapp/wmslider.cc
deleted file mode 100644
index e73fd1e4c3d9..000000000000
--- a/wmcube/wmapp/wmslider.cc
+++ /dev/null
@@ -1,42 +0,0 @@
-#include <algorithm> // for max, min
-#include "wmslider.h"
-#include "wmapp.h"
-
-void slider_click(const WMApp *a, WMWidget *w, void *)
-{
- WMSlider *s;
- if (!(s = dynamic_cast<WMSlider *>(w))) return;
-
- const WMMouseClick click = a->mouseclick().b_relative_to(w);
- int newval;
-
- if (click.button > Button3) {
- const int increment = s->total() / 10;
- newval = s->value() + (click.button == Button4 ? increment : -increment);
- }
- else {
- const int xrel = click.x;
- // the messy definition of yrel is due to widget layout using a downward-
- // going y-axis, but WMMeterBars using an upward-going y-axis
- const int yrel = s->b_height() - click.y;
- const int rel = (s->orientation() == Orientation::Horizontal) ? xrel : yrel;
- newval = (rel * s->total()) / s->b_parallel();
- }
-
- s->setvalue(std::max(0, std::min(s->total(), newval)));
- a->repaint();
-}
-
-void
-WMSlider::attach_callbacks()
-{
- addcallback(slider_click, this, 0);
-}
-
-// clearcallbacks() shouldn't delete the main callback function of this class
-void
-WMSlider::clearcallbacks()
-{
- WMCallback::clearcallbacks();
- WMSlider::attach_callbacks();
-}
diff --git a/wmcube/wmapp/wmslider.h b/wmcube/wmapp/wmslider.h
deleted file mode 100644
index a706f1c06936..000000000000
--- a/wmcube/wmapp/wmslider.h
+++ /dev/null
@@ -1,32 +0,0 @@
-#include "wmcallback.h"
-#include "wmmeterbar.h"
-
-#ifndef _WMSLIDER_H
-#define _WMSLIDER_H
-
-// WMSlider: a bar that can be slid up or down to set a value.
-// Derived from WMMeterBar and WMCallback.
-class WMSlider : public WMCallback, public WMMeterBar {
- private:
- void attach_callbacks();
-
- public:
- WMSlider();
- WMSlider(int total);
- WMSlider(int value, int total);
-
- void clearcallbacks();
-};
-
-inline WMSlider::WMSlider()
-{ setstyle(Blue, false); attach_callbacks(); }
-
-inline WMSlider::WMSlider(int total)
-: WMMeterBar(total)
-{ setstyle(Blue, false); attach_callbacks(); }
-
-inline WMSlider::WMSlider(int value, int total)
-: WMMeterBar(value, total)
-{ setstyle(Blue, false); attach_callbacks(); }
-
-#endif
diff --git a/wmcube/wmapp/wmtextbar.cc b/wmcube/wmapp/wmtextbar.cc
deleted file mode 100644
index 7cb9ec347a61..000000000000
--- a/wmcube/wmapp/wmtextbar.cc
+++ /dev/null
@@ -1,63 +0,0 @@
-#include <iostream>
-#include "wmtextbar.h"
-#include "wmwindow.h"
-#include "wmapp.h"
-
-using std::cerr;
-using std::endl;
-
-// functions for WMTextBar -----------------------------------------------
-
-void
-WMTextBar::real_display()
-{
- int charwidth, charheight, xbase, ybase;
-
- // Blit background color onto rectangle
- WMApp::Xw.fill_rectangle(window()->pixmap(), b_position(),
- WMColor(Background));
-
- switch (fontsize()) {
- case 0: charwidth = 5, charheight = 9; break;
- case 1: charwidth = 6, charheight = 9; break;
- case 2: charwidth = 7, charheight = 11; break;
- default:
- cerr << "WMError: Text bar " << this << " has bad font size "
- << fontsize() << endl;
- return;
- }
-
- if (b_width() < charwidth || b_height() < charheight)
- { cerr << "WMError: Text bar " << this << " too small" << endl; return; }
-
- xbase = b_left(), ybase = b_top();
- // center the characters in the direction perpendicular to their orientation
- if (orientation() == Orientation::Horizontal)
- ybase += (b_height() - charheight) / 2;
- else
- xbase += (b_width() - charwidth) / 2;
-
- // plot characters onto X display
- for (unsigned int i = 0; xbase + charwidth < b_right()
- && ybase + charheight < b_bottom(); i++) {
- unsigned char c = text(i);
- if (c > ' ' && c <= 127) // 7-bit printable ASCII
- // note: for a degree character, use ASCII 127 (DEL)
- WMApp::Xw.copy_rectangle(app()->char_pixmaps[fontsize()],
- window()->pixmap(),
- /* source X-Y coords */ charwidth * (c % 16), charheight * (c / 16 - 2),
- /* source width/height*/ charwidth, charheight,
- /* destination coords */ xbase, ybase);
- else
- // no pixmap for this character; display a blank.
- WMApp::Xw.copy_rectangle(app()->char_pixmaps[fontsize()],
- window()->pixmap(), 0, 0,
- charwidth, charheight, xbase, ybase);
-
- if (orientation() == Orientation::Horizontal)
- xbase += charwidth;
- else
- ybase += charheight;
- }
-}
-
diff --git a/wmcube/wmapp/wmtextbar.h b/wmcube/wmapp/wmtextbar.h
deleted file mode 100644
index 9e0307bbee71..000000000000
--- a/wmcube/wmapp/wmtextbar.h
+++ /dev/null
@@ -1,57 +0,0 @@
-#include "wmwidget.h"
-#include <string>
-
-#ifndef _WMTEXTBAR_H
-#define _WMTEXTBAR_H
-
-using std::string;
-
-// WMTextBar: a place to draw text in.
-class WMTextBar : public virtual WMWidget {
- private:
- string wText;
- int wFontsize;
- void real_display();
-
- public:
- WMTextBar(const string & text = "", int fontsize = 1);
- ~WMTextBar();
-
- void settext(const string & text, bool dodisplay = true);
- void setfont(int fontsize, bool dodisplay = true);
- const string & text() const;
- char text(unsigned int) const;
- int fontsize() const;
- int size() const;
-};
-
-// inline functions for WMTextBar ----------------------------------------
-
-inline WMTextBar::WMTextBar(const string &text, int fontsize)
-: wText(text), wFontsize(fontsize)
-{ }
-
-inline WMTextBar::~WMTextBar() { }
-
-inline void
-WMTextBar::settext(const string &text, bool dodisplay)
-{ wText = text; if (dodisplay) display(); }
-
-inline void
-WMTextBar::setfont(int fontsize, bool dodisplay)
-{ wFontsize = fontsize; if (dodisplay) display(); }
-
-inline const string &
-WMTextBar::text() const { return wText; }
-
-inline char
-WMTextBar::text(unsigned int posn) const
-{ return (posn >= wText.size()) ? ' ' : wText[posn]; }
-
-inline int
-WMTextBar::fontsize() const { return wFontsize; }
-
-inline int
-WMTextBar::size() const { return wText.size(); }
-
-#endif
diff --git a/wmcube/wmapp/wmwidget.cc b/wmcube/wmapp/wmwidget.cc
deleted file mode 100644
index 14c8bc3289ab..000000000000
--- a/wmcube/wmapp/wmwidget.cc
+++ /dev/null
@@ -1,99 +0,0 @@
-#include "wmwidget.h"
-#include "wmwindow.h"
-#include "wmapp.h"
-
-// functions for WMWidget ------------------------------------------------
-
-WMWidget::WMWidget(const WMRectangle &posn, Orientation::Orientation o)
-: wOrientation(o), wPosition(posn), wBorder(1),
- wTopLeft(WMColor(FrameBorderDim)), wBottomRight(WMColor(FrameBorderBright)),
- wParent(0), wDisplayed(false), wActive(true)
-{ }
-
-int
-WMWidget::par_to_parent() const
-{
- if (!parent()) return -1;
- return (parent()->orientation() == Orientation::Horizontal) ?
- position().width() : position().height();
-}
-
-int
-WMWidget::perp_to_parent() const
-{
- if (!parent()) return -1;
- return (parent()->orientation() == Orientation::Horizontal) ?
- position().height() : position().width();
-}
-
-void
-WMWidget::set_par_to_parent(int p)
-{
- if (wParent && !wDisplayed)
- ((wParent->wOrientation == Orientation::Horizontal) ?
- wPosition.setwidth(p) : wPosition.setheight(p));
-}
-
-void
-WMWidget::set_perp_to_parent(int p)
-{
- if (wParent && !wDisplayed)
- ((wParent->wOrientation == Orientation::Horizontal) ?
- wPosition.setheight(p) : wPosition.setwidth(p));
-}
-
-const WMWindow *
-WMWidget::window() const { return wParent ? wParent->window() : 0; }
-
-WMApp *
-WMWidget::app() const { return wParent ? wParent->app() : 0; }
-
-void
-WMWidget::display()
-{
- if (!(parent() && parent()->is_displayed())) return;
- real_display();
- draw_border();
- setdisplayed(true);
-}
-
-void
-WMWidget::draw_border()
-{
- if (border() && 2 * border() < width() && 2 * border() < height())
- WMApp::Xw.draw_border(window()->pixmap(), position(), border(),
- top_left_c(), bottom_right_c(),
- Color::alpha_blend(top_left_c(), bottom_right_c(),
- 0.5));
-}
-
-void
-WMWidget::hide()
-{
- if (!is_displayed()) return;
- real_hide();
- setdisplayed(false);
-}
-
-void
-WMWidget::activate()
-{
- if (is_active()) return;
- real_activate();
- setactive(true);
- if (is_displayed()) display();
-}
-
-void
-WMWidget::deactivate()
-{
- if (!is_active()) return;
- real_deactivate();
- setactive(false);
- if (is_displayed()) display();
-}
-
-void
-WMWidget::real_hide()
-{ if (window()) WMApp::Xw.clear_rectangle(window()->pixmap(), position()); }
-
diff --git a/wmcube/wmapp/wmwidget.h b/wmcube/wmapp/wmwidget.h
deleted file mode 100644
index 38213e0c1cce..000000000000
--- a/wmcube/wmapp/wmwidget.h
+++ /dev/null
@@ -1,367 +0,0 @@
-#include "colors.h"
-
-#ifndef _WMWIDGET_H
-#define _WMWIDGET_H
-
-// needed forward declarations
-class WMApp;
-class WMWindow;
-class WMFrame;
-
-// Classes for writing complicated WindowMaker Dockapp programs! Yaay!
-// Note: I'm lazy, so ALL LAYOUT has to be done statically before the
-// WMApp starts to run.
-
-namespace Orientation {
- enum Orientation { Horizontal, Vertical };
-};
-
-class WMRectangle {
- private:
- int wLeft, wTop, wWidth, wHeight;
- public:
- WMRectangle(int Left = 0, int Top = 0, int Width = 0, int Height = 0);
- WMRectangle(const WMRectangle &r);
- WMRectangle & operator = (const WMRectangle &r);
- ~WMRectangle();
-
- int left() const;
- int right() const;
- int top() const;
- int bottom() const;
- int width() const;
- int height() const;
- bool contains(int x, int y) const;
-
- void setleft(int);
- void settop(int);
- void setwidth(int);
- void setheight(int);
-};
-
-// WMWidget: the base class for all Dockapp widgets. Cannot be instantiated.
-class WMWidget {
- private:
- enum Orientation::Orientation wOrientation;
- WMRectangle wPosition;
- int wBorder;
- Color wTopLeft, wBottomRight;
- const WMFrame * wParent;
- bool wDisplayed;
- bool wActive;
-
- protected:
- // these functions do the actual work of displaying a widget.
- virtual void real_display() = 0;
- virtual void draw_border();
- virtual void real_hide();
-
- // colors for border of widget
- Color top_left_c() const;
- Color bottom_right_c() const;
- void set_top_left_c(const Color & c);
- void set_bottom_right_c(const Color & c);
-
- virtual void real_activate() { } // these will be no-ops except
- virtual void real_deactivate() { } // for clickable widgets
-
- void setactive(bool);
- void setdisplayed(bool);
-
- public:
- WMWidget(const WMRectangle &layout = WMRectangle(0, 0, 0, 0),
- Orientation::Orientation o = Orientation::Horizontal);
- virtual ~WMWidget();
-
- virtual WMApp *app() const;
- virtual const WMWindow *window() const;
- virtual const WMFrame *parent() const;
- virtual void setparent(const WMFrame *); // should be protected, but then
- virtual void setparent(const WMFrame &); // WMFrame can't use on children
- virtual void clip(char *xpm_array[65]);
-
- virtual void setposition(const WMRectangle &posn);
- void setorientation(Orientation::Orientation o);
-
- // these functions do all the busywork of displaying a widget.
- virtual void display(); // over-ridden by WMFrame
- virtual void hide(); // in order to act recursively
- virtual void activate(); // on all child widgets
- virtual void deactivate(); //
-
- const WMRectangle & position() const;
- enum Orientation::Orientation orientation() const;
- virtual bool contains(int x, int y) const;
-
- int top() const;
- int left() const;
- int bottom() const;
- int right() const;
- int border() const;
-
- int width() const;
- int height() const;
- int parallel() const; // dimension parallel to orientation
- int perpend() const; // dimension perpendicular to orientation
- int par_to_parent() const; // dimension parallel to parent's orientation
- int perp_to_parent() const; // dimension perp. to parent's orientation
-
- // like above, but only considering the part of the widget INSIDE its border
- WMRectangle b_position() const;
- int b_top() const;
- int b_left() const;
- int b_bottom() const;
- int b_right() const;
- int b_width() const;
- int b_height() const;
- int b_parallel() const;
- int b_perpend() const;
- int b_par_to_parent() const;
- int b_perp_to_parent() const;
-
- // "set" accessor functions
- void settop(int);
- void setleft(int);
- void setborder(int);
-
- void setwidth(int);
- void setheight(int);
- void setparallel(int);
- void setperpend(int);
- void set_par_to_parent(int);
- void set_perp_to_parent(int);
-
- bool is_displayed() const;
- bool is_active() const;
-};
-
-
-// inline functions for WMRectangle --------------------------------------
-
-inline WMRectangle::WMRectangle(int Left, int Top, int Width, int Height)
-: wLeft(Left), wTop(Top), wWidth(Width), wHeight(Height)
-{ }
-
-inline WMRectangle::WMRectangle(const WMRectangle &r)
-: wLeft(r.wLeft), wTop(r.wTop), wWidth(r.wWidth), wHeight(r.wHeight)
-{ }
-
-inline WMRectangle::~WMRectangle() { }
-
-inline WMRectangle &
-WMRectangle::operator = (const WMRectangle &r)
-{
- wLeft = r.wLeft, wTop = r.wTop, wWidth = r.wWidth, wHeight = r.wHeight;
- return *this;
-}
-
-inline int
-WMRectangle::left() const { return wLeft; }
-
-inline int
-WMRectangle::right() const { return wLeft + wWidth; }
-
-inline int
-WMRectangle::top() const { return wTop; }
-
-inline int
-WMRectangle::bottom() const { return wTop + wHeight; }
-
-inline int
-WMRectangle::width() const { return wWidth; }
-
-inline int
-WMRectangle::height() const { return wHeight; }
-
-inline void
-WMRectangle::setleft(int l) { wLeft = l; }
-
-inline void
-WMRectangle::settop(int t) { wTop = t; }
-
-inline void
-WMRectangle::setwidth(int w) { wWidth = w; }
-
-inline void
-WMRectangle::setheight(int h) { wHeight = h; }
-
-inline bool
-WMRectangle::contains(int x, int y) const
-{ return x >= left() && x < right() && y >= top() && y < bottom(); }
-
-// inline functions for WMWidget -----------------------------------------
-
-inline WMWidget::~WMWidget() { }
-
-inline const WMFrame *
-WMWidget::parent() const { return wParent; }
-
-inline void
-WMWidget::clip(char *xpm_array[65])
-{
- for (int col = left(); col < right(); col++)
- for (int row = top(); row < bottom(); row++)
- if (contains(col, row))
- xpm_array[row + 3][col] = 'X';
-}
-
-inline void
-WMWidget::setparent(const WMFrame *f) { wParent = f; }
-
-inline void
-WMWidget::setparent(const WMFrame &f) { wParent = &f; }
-
-inline void
-WMWidget::setactive(bool b) { wActive = b; }
-
-inline void
-WMWidget::setdisplayed(bool b) { wDisplayed = b; }
-
-inline Color
-WMWidget::top_left_c() const { return wTopLeft; }
-
-inline Color
-WMWidget::bottom_right_c() const { return wBottomRight; }
-
-inline void
-WMWidget::set_top_left_c(const Color & c) { wTopLeft = c; }
-
-inline void
-WMWidget::set_bottom_right_c(const Color & c) { wBottomRight = c; }
-
-inline void
-WMWidget::setposition(const WMRectangle &posn)
-{ if (!wDisplayed) wPosition = posn; }
-
-inline void
-WMWidget::setorientation(Orientation::Orientation o)
-{ if (!wDisplayed) wOrientation = o; }
-
-inline const WMRectangle &
-WMWidget::position() const { return wPosition; }
-
-inline enum Orientation::Orientation
-WMWidget::orientation() const { return wOrientation; }
-
-inline bool
-WMWidget::contains(int x, int y) const { return position().contains(x, y); }
-
-inline int
-WMWidget::top() const { return position().top(); }
-
-inline int
-WMWidget::left() const { return position().left(); }
-
-inline int
-WMWidget::bottom() const { return position().bottom(); }
-
-inline int
-WMWidget::right() const { return position().right(); }
-
-inline int
-WMWidget::border() const { return wBorder; }
-
-inline int
-WMWidget::width() const { return position().width(); }
-
-inline int
-WMWidget::height() const { return position().height(); }
-
-inline int
-WMWidget::parallel() const
-{
- return (orientation() == Orientation::Horizontal) ?
- position().width() : position().height();
-}
-
-inline int
-WMWidget::perpend() const
-{
- return (orientation() == Orientation::Horizontal) ?
- position().height() : position().width();
-}
-
-// like above, but only considering the part of the widget INSIDE its border:
-
-inline WMRectangle
-WMWidget::b_position() const
-{
- return WMRectangle(left() + border(), top() + border(),
- width() - 2 * border(), height() - 2 * border());
-}
-
-inline int
-WMWidget::b_top() const { return top() + border(); }
-
-inline int
-WMWidget::b_left() const { return left() + border(); }
-
-inline int
-WMWidget::b_bottom() const { return bottom() - border(); }
-
-inline int
-WMWidget::b_right() const { return right() - border(); }
-
-inline int
-WMWidget::b_width() const { return width() - 2 * border(); }
-
-inline int
-WMWidget::b_height() const { return height() - 2 * border(); }
-
-inline int
-WMWidget::b_parallel() const { return parallel() - 2 * border(); }
-
-inline int
-WMWidget::b_perpend() const { return perpend() - 2 * border(); }
-
-inline int
-WMWidget::b_par_to_parent() const { return par_to_parent() - 2 * border(); }
-
-inline int
-WMWidget::b_perp_to_parent() const { return perp_to_parent() - 2 * border(); }
-
-// "set" accessor functions:
-
-inline void
-WMWidget::setwidth(int w)
-{ if (!wDisplayed) wPosition.setwidth(w); }
-
-inline void
-WMWidget::setheight(int h)
-{ if (!wDisplayed) wPosition.setheight(h); }
-
-inline void
-WMWidget::settop(int t)
-{ if (!wDisplayed) wPosition.settop(t); }
-
-inline void
-WMWidget::setleft(int l)
-{ if (!wDisplayed) wPosition.setleft(l); }
-
-inline void
-WMWidget::setborder(int b)
-{ if (!wDisplayed) wBorder = b; }
-
-inline void
-WMWidget::setparallel(int p)
-{
- if (!wDisplayed)
- ((wOrientation == Orientation::Horizontal) ?
- wPosition.setwidth(p) : wPosition.setheight(p));
-}
-
-inline void
-WMWidget::setperpend(int p)
-{
- if (!wDisplayed)
- ((wOrientation == Orientation::Horizontal) ?
- wPosition.setheight(p) : wPosition.setwidth(p));
-}
-
-inline bool
-WMWidget::is_displayed() const { return wDisplayed; }
-
-inline bool
-WMWidget::is_active() const { return wActive; }
-
-#endif
diff --git a/wmcube/wmapp/wmwindow.cc b/wmcube/wmapp/wmwindow.cc
deleted file mode 100644
index 71a7e98e2d68..000000000000
--- a/wmcube/wmapp/wmwindow.cc
+++ /dev/null
@@ -1,114 +0,0 @@
-#include <iostream>
-#include "wmwindow.h"
-#include "wmapp.h"
-
-using std::cerr;
-using std::endl;
-
-// functions for WMWindow ------------------------------------------------
-
-// this is here instead of inlined due to dependency on WMApp
-WMWindow::WMWindow()
-: WMFrame(), wApp(0), wUpdateFreq(10 /* milliseconds */),
- wCounter(0), wFuncPeriod()
-{
- setpadding(2);
- setborder(0);
-
- pixmap().pixmap = 0;
- //use this as a flag determining whether the pixmaps are initialized
-
- int offset = WMApp::size() / 2 - 28;
- setposition(WMRectangle(offset, offset, 56, 56));
-}
-
-WMWindow::~WMWindow ()
-{
- if (pixmap().pixmap) { //only free if it was actually allocated
- WMApp::Xw.free_pixmap(pixmap());
- }
-}
-
-void
-WMWindow::run_timed_functions()
-{
- for (unsigned int i = 0; i < numcallbacks(); i++)
- if (! (wCounter % wFuncPeriod[i])) {
- runcallback(i);
- }
- wCounter++;
-}
-
-void
-WMWindow::initpixmaps()
-{
- // Xlib has no facility to create a mask on the fly from an xpm (at least
- // not that I know about), so we have to do it the hard way, initializing a
- // mask from a char* array:
-
- char *mask_xpm[67];
- for (unsigned int i = 0; i < 67; i++)
- mask_xpm[i] = new char[65];
-
- strcpy(mask_xpm[0], "64 64 2 1"); // width, height, #colors, (?)
- strcpy(mask_xpm[1], " c None"); // transparent
- strcpy(mask_xpm[2], "X c #000000"); // black
- for (unsigned int i = 3; i < 67; i++)
- strcpy(mask_xpm[i], // string with 64 spaces --v
- " ");
- // 0123456789012345678901234567890123456789012345678901234567890123
- // 1 2 3 4 5 6
-
- // now mask out where we want to display things
- for (unsigned int i = 0; i < numchildren(); i++)
- child(i)->clip(mask_xpm);
-
- // finally, create the pixmap and mask
- WMApp::Xw.create_pixmap(pixmap(), mask_xpm);
- WMApp::Xw.fill_rectangle(pixmap(), 0, 0, 64, 64, 0xFFFFFF /*white*/);
-
- // clean up
- for (unsigned int i = 0; i < 67; i++)
- delete [] mask_xpm[i];
-}
-
-void
-WMWindow::display()
-{
- // obviously, we replace the check for existence of a parent
- // with check for existence of an app
- if (!app()) {
- cerr << "WMError: Window " << this << "has no parent application" << endl;
- return;
- }
-
- real_display();
- setdisplayed(true);
- for (unsigned int i = 0; i < numchildren(); i++)
- child(i)->display();
-
- // show the window and start running the GUI and callbacks
- app()->Xshow();
-
- // don't get here until the GUI has been requested to switch to
- // a different window (via a callback), or to exit
- return;
-}
-
-void
-WMWindow::real_display()
-{
- if (!wPixmap.pixmap)
- initpixmaps(); //call this function only once
-
- // apply the mask to the application window so that areas not included
- // in any widget are clear to the icon tile below
- app()->mask();
-}
-
-void
-WMWindow::real_activate() { display(); }
-
-void
-WMWindow::real_deactivate() { hide(); }
-
diff --git a/wmcube/wmapp/wmwindow.h b/wmcube/wmapp/wmwindow.h
deleted file mode 100644
index 20a4ef5a02eb..000000000000
--- a/wmcube/wmapp/wmwindow.h
+++ /dev/null
@@ -1,130 +0,0 @@
-#include "wmframe.h"
-#include "wmcallback.h"
-#include "xwrapper.h"
-
-#ifndef _WMWINDOW_H
-#define _WMWINDOW_H
-
-class WMApp;
-
-// WMWindow: A 64x64 pixel square containing a number of widgets. You can
-// set it to run callback functions at regular intervals. Only one WMWindow
-// may be displayed at once. This is controlled by the WMApp containing a
-// vector of WMWindows.
-class WMWindow : private WMCallback, public WMFrame {
- friend class WMApp;
-
- private:
- WMApp * wApp;
- mutable WMPixmap wPixmap;
-
- // how often to execute callbacks and update display, in milliseconds
- int wUpdateFreq;
- int wCounter;
- // list of periods of individual callbacks (in units of wUpdateFreq)
- vector<int> wFuncPeriod;
-
- void initpixmaps();
- void real_display();
- void real_activate();
- void real_deactivate();
-
- // should be called only by a WMApp.
- void display();
- void hide();
- void activate();
- void deactivate();
- void run_timed_functions();
-
- public:
- WMWindow();
- ~WMWindow();
-
- const WMWindow * window() const; // returns "this"
-
- // override these to make them no-ops; windows have no parents
- WMFrame *parent();
- void setparent(const WMFrame *);
- void setparent(const WMFrame &);
-
- WMApp * app() const;
- int updatefreq() const;
- WMPixmap & pixmap() const;
-
- void setapp(WMApp *);
-
- void setupdatefreq(int milliseconds);
- void add_timed_function(int period, data_func d, void * = 0);
- void add_timed_function(int period, widget_func w, WMWidget *, void * = 0);
- void clear_timed_functions();
-
- bool press(int button, int x, int y);
- bool release(int button, int x, int y);
-};
-
-// inline functions for WMWindow -----------------------------------------
-
-inline void
-WMWindow::activate() { WMFrame::activate(); }
-
-inline void
-WMWindow::deactivate() { WMFrame::deactivate(); }
-
-inline void
-WMWindow::hide() { WMFrame::hide(); }
-
-inline const WMWindow *
-WMWindow::window() const { return this; }
-
-inline WMFrame *
-WMWindow::parent() { return 0; }
-
-inline void
-WMWindow::setparent(const WMFrame *) { }
-
-inline void
-WMWindow::setparent(const WMFrame &) { }
-
-inline WMApp *
-WMWindow::app() const { return wApp; }
-
-inline int
-WMWindow::updatefreq() const { return wUpdateFreq; }
-
-inline void
-WMWindow::setupdatefreq(int milliseconds) { wUpdateFreq = milliseconds; }
-
-inline void
-WMWindow::add_timed_function(int period, data_func f, void *datap)
-{
- WMCallback::addcallback(f, datap);
- wFuncPeriod.push_back(period);
-}
-
-inline void
-WMWindow::add_timed_function(int period, widget_func f, WMWidget *w,
- void *datap)
-{
- WMCallback::addcallback(f, w, datap);
- wFuncPeriod.push_back(period);
-}
-
-inline void
-WMWindow::clear_timed_functions()
-{
- WMCallback::clearcallbacks();
- wFuncPeriod.clear();
-}
-
-inline WMPixmap &
-WMWindow::pixmap() const { return wPixmap; }
-
-inline bool
-WMWindow::press(int button, int x, int y)
-{ return WMFrame::press(button, x, y); }
-
-inline bool
-WMWindow::release(int button, int x, int y)
-{ return WMFrame::release(button, x, y); }
-
-#endif
diff --git a/wmcube/wmapp/xpm/charmap-large.xpm b/wmcube/wmapp/xpm/charmap-large.xpm
deleted file mode 100644
index 037ca2f1e2e7..000000000000
--- a/wmcube/wmapp/xpm/charmap-large.xpm
+++ /dev/null
@@ -1,74 +0,0 @@
-/* XPM */
-static char * charmap_large_xpm[] = {
-"112 66 5 1",
-" c None",
-". c #282828",
-"+ c #004941",
-"@ c #20B2AE",
-"# c #188A86",
-"................................................................................................................",
-"..++++...++++...++++...++++...++++...++++...++++...++++...++++...++++...++++...++++...++++...++++...++++...++++.",
-".+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+",
-".+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+",
-".+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+",
-"..++++...++++...++++...++++...++++...++++...++++...++++...++++...++++...++++...++++...++++...++++...++++...++++.",
-".+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+",
-".+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+",
-".+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+",
-"..++++...++++...++++...++++...++++...++++...++++...++++...++++...++++...++++...++++...++++...++++...++++...++++.",
-"................................................................................................................",
-"................................................................................................................",
-"..@@@@...++++#.#@@@@#.#@@@@#.#++++#.#@@@@#.#@@@@#.#@@@@#.#@@@@#.#@@@@#.........++++...++++...++++...++++...++++.",
-".@....@.+....@.+....@.+....@.@....@.@....+.@....+.+....@.@....@.@....@...@....+....+.+....+.+....+.+....+.+....+",
-".@....@.+....@.+....@.+....@.@....@.@....+.@....+.+....@.@....@.@....@...@....+....+.+....+.+....+.+....+.+....+",
-".@....@.+....@.+....@.+....@.@....@.@....+.@....+.+....@.@....@.@....@........+....+.+....+.+....+.+....+.+....+",
-".#++++#..++++#.#@@@@#.#@@@@#.#@@@@#.#@@@@#.#@@@@#..++++#.#@@@@#.#@@@@#.........++++...++++...++++...++++...++++.",
-".@....@.+....@.@....+.+....@.+....@.+....@.@....@.+....@.@....@.+....@........+....+.+....+.+....+.+....+.+....+",
-".@....@.+....@.@....+.+....@.+....@.+....@.@....@.+....@.@....@.+....@...@....+....+.+....+.+....+.+....+.+....+",
-".@....@.+....@.@....+.+....@.+....@.+....@.@....@.+....@.@....@.+....@...@....+....+.+....+.+....+.+....+.+....+",
-"..@@@@...++++#.#@@@@#.#@@@@#..++++#.#@@@@#.#@@@@#..++++#.#@@@@#.#@@@@#.........++++...++++...++++...++++...++++.",
-"................................................................................................................",
-"................................................................................................................",
-"..++++...++++...++++...++++...++++...++++...++++...++++...++++...++++...++++...++++...++++...++++...++++...++++.",
-".+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+",
-".+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+",
-".+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+",
-"..++++...++++...++++...++++...++++...++++...++++...++++...++++...++++...++++...++++...++++...++++...++++...++++.",
-".+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+",
-".+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+",
-".+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+",
-"..++++...++++...++++...++++...++++...++++...++++...++++...++++...++++...++++...++++...++++...++++...++++...++++.",
-"................................................................................................................",
-"................................................................................................................",
-"..++++...++++...++++...++++...++++...++++...++++...++++...++++...++++...++++...++++...++++...++++...++++...++++.",
-".+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+",
-".+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+",
-".+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+",
-"..++++...++++...++++...++++...++++...++++...++++...++++...++++...++++...++++...++++...++++...++++...++++...++++.",
-".+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+",
-".+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+",
-".+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+",
-"..++++...++++...++++...++++...++++...++++...++++...++++...++++...++++...++++...++++...++++...++++...++++...++++.",
-"................................................................................................................",
-"................................................................................................................",
-"..++++...++++...++++...++++...++++...++++...++++...++++...++++...++++...++++...++++...++++...++++...++++...++++.",
-".+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+",
-".+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+",
-".+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+",
-"..++++...++++...++++...++++...++++...++++...++++...++++...++++...++++...++++...++++...++++...++++...++++...++++.",
-".+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+",
-".+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+",
-".+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+",
-"..++++...++++...++++...++++...++++...++++...++++...++++...++++...++++...++++...++++...++++...++++...++++...++++.",
-"................................................................................................................",
-"................................................................................................................",
-"..++++...++++...++++...++++...++++...++++...++++...++++...++++...++++...++++...++++...++++...++++...++++...++++.",
-".+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+",
-".+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+",
-".+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+",
-"..++++...++++...++++...++++...++++...++++...++++...++++...++++...++++...++++...++++...++++...++++...++++...++++.",
-".+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+",
-".+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+",
-".+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+.+....+",
-"..++++...++++...++++...++++...++++...++++...++++...++++...++++...++++...++++...++++...++++...++++...++++...++++.",
-"................................................................................................................"};
diff --git a/wmcube/wmapp/xpm/charmap-medium.xpm b/wmcube/wmapp/xpm/charmap-medium.xpm
deleted file mode 100644
index 99a87a7cd1bb..000000000000
--- a/wmcube/wmapp/xpm/charmap-medium.xpm
+++ /dev/null
@@ -1,62 +0,0 @@
-/* XPM */
-static char * charmap_medium_xpm[] = {
-"96 54 5 1",
-" c None",
-". c #282828",
-"+ c #004941",
-"@ c #20B2AE",
-"# c #188A86",
-"................................................................................................",
-"..+++...+++...+++...+++...+++...+++...+++...+++...@++...++@...+++...+++.........+++.........++##",
-".+...+.+...+.+...+.+...+.+...+.+...+.+...+.+...+.@...+.+...@.+...+.+.@.+.......+...+.......+..@+",
-".+...+.+...+.+...+.+...+.+...+.+...+.+...+.+...+.@...+.+...@.+...+.+.@.+.......+...+.......+.##+",
-"..+++...+++...+++...+++...+++...+++...+++...+++..#+++...+++#..+++..#@@@#........#@@.........+@+.",
-".+...+.+...+.+...+.+...+.+...+.+...+.+...+.+...+.@...+.+...@.+...+.+.@.+.......+...+.......+##.+",
-".+...+.+...+.+...+.+...+.+...+.+...+.+...+.+...+.@...+.+...@.+...+.+.@.+....@..+...+.......+@..+",
-"..+++...+++...+++...+++...+++...+++...+++...+++...@++...++@...+++...+++....##...+++...#@...##++.",
-"................................................................................................",
-"................................................................................................",
-"..@@@...+++#.#@@@#.#@@@#.@+++@.#@@@#.#@@@#.#@@@#.#@@@#.#@@@#..............+++...+++...+++...+++.",
-".@...@.+...@.+...@.+...@.@...@.@...+.@...+.+...@.@...@.@...@.............+...+.+...+.+...+.+...+",
-".@...@.+...@.+...@.+...@.@...@.@...+.@...+.+...@.@...@.@...@..#@....#@...+...+.+...+.+...+.+...+",
-".#+++#..+++#.#@@@#..@@@#.#@@@#.@@@@#.#@@@#..+++#.#@@@#.#@@@#..............+++...+++...+++...+++.",
-".@...@.+...@.@...+.+...@.+...@.+...@.@...@.+...@.@...@.+...@.............+...+.+...+.+...+.+...+",
-".@...@.+...@.@...+.+...@.+...@.+...@.@...@.+...@.@...@.+...@..#@.....@...+...+.+...+.+...+.+...+",
-"..@@@...+++@.#@@@#.#@@@#..+++#.#@@@#.#@@@#..+++@.#@@@#.#@@@#........##....+++...+++...+++...+++.",
-"................................................................................................",
-"................................................................................................",
-".+@@@+.+@@@+.#@@@...@@@#.#@@@..#@@@#.#@@@#.#@@@#.#+++#..@@@...+++#.#+++#.#+++..@+++@.#@@@..#@@@#",
-".@...@.@...@.@...@.@...+.@...@.@...+.@...+.@...+.@...@.+.@.+.+...@.@...@.@...+.@@.@@.@...@.@...@",
-".@...@.@...@.@...@.@...+.@...@.@...+.@...+.@...+.@...@.+.@.+.+...@.@..@..@...+.@.@.@.@...@.@...@",
-".#+@@#.#@@@#.#@@@..#+++..#+++#.#@@@..#@@@..#+#@#.#@@@#..+#+...+++#.#@@...#+++..#+++#.#+++#.#+++#",
-".@.@@+.@...@.@...@.@...+.@...@.@...+.@...+.@...@.@...@.+.@.+.+...@.@..@..@...+.@...@.@...@.@...@",
-".@...+.@...@.@...@.@...+.@...@.@...+.@...+.@...@.@...@.+.@.+.@...@.@...@.@...+.@...@.@...@.@...@",
-".#@@@#.#+++#.#@@@...@@@#.#@@@..#@@@#.#+++..#@@@#.#+++#..@@@..#@@@#.#+++#.#@@@#.#+++#.#+++#.#@@@#",
-"................................................................................................",
-"................................................................................................",
-".#@@@#.#@@@#.#@@@#.#@@@#.#@@@#.#+++#.#+++#.#+++#.#+++#.#+++#.#@@@#.#@++..##++...++@#..+++...+++.",
-".@...@.@...@.@...@.@...+.+.@.+.@...@.@...@.@...@.@...@.@...@.+...@.@...+.+@..+.+...@.+...+.+...+",
-".@...@.@...@.@...@.@...+.+.@.+.@...@.@...@.@...@..@.@..@...@.+..@+.@...+.+##.+.+...@.+...+.+...+",
-".#@@@#.#@++#.#@@@..#@@@#..+#+..#+++#.#+++#.#+++#...@...#@@@#..+@+..#+++...+@+...+++#..+++...+++.",
-".@...+.@.@.@.@...@.+...@.+.@.+.@...@.@...@.@.@.@..@.@..+...@.+@..+.@...+.+.##+.+...@.+...+.+...+",
-".@...+.@..@@.@...@.+...@.+.@.+.@...@.@...@.@@.@@.@...@.+...@.@...+.@...+.+..@+.+...@.+...+.+...+",
-".#+++..#@@@#.#+++#.#@@@#..+#+..#@@@#..#@#..#+++#.#+++#.#@@@#.#@@@#.#@++...++##..++@#..+++..#@@@#",
-"................................................................................................",
-"................................................................................................",
-"..+++..+@@@+.#@@@...@@@#.#@@@..#@@@#.#@@@#.#@@@#.#+++#..@@@...+++#.#+++#.#+++..@+++@.#@@@..#@@@#",
-".+...+.@...@.@...@.@...+.@...@.@...+.@...+.@...+.@...@.+.@.+.+...@.@...@.@...+.@@.@@.@...@.@...@",
-".+...+.@...@.@...@.@...+.@...@.@...+.@...+.@...+.@...@.+.@.+.+...@.@..@..@...+.@.@.@.@...@.@...@",
-"..+++..#@@@#.#@@@..#+++..#+++#.#@@@..#@@@..#+#@#.#@@@#..+#+...+++#.#@@...#+++..#+++#.#+++#.#+++#",
-".+...+.@...@.@...@.@...+.@...@.@...+.@...+.@...@.@...@.+.@.+.+...@.@..@..@...+.@...@.@...@.@...@",
-".+...+.@...@.@...@.@...+.@...@.@...+.@...+.@...@.@...@.+.@.+.@...@.@...@.@...+.@...@.@...@.@...@",
-"..+++..#+++#.#@@@...@@@#.#@@@..#@@@#.#+++..#@@@#.#+++#..@@@..#@@@#.#+++#.#@@@#.#+++#.#+++#.#@@@#",
-"................................................................................................",
-"................................................................................................",
-".#@@@#.#@@@#.#@@@#.#@@@#.#@@@#.#+++#.#+++#.#+++#.#+++#.#+++#.#@@@#..++@...+#+...@++...+++..+@+..",
-".@...@.@...@.@...@.@...+.+.@.+.@...@.@...@.@...@.@...@.@...@.+...@.+.@.+.+.@.+.+.@.+.+...+.@.@..",
-".@...@.@...@.@...@.@...+.+.@.+.@...@.@...@.@...@..@.@..@...@.+..@+.+.@.+.+.@.+.+.@.+.+...+.+@+..",
-".#@@@#.#@++#.#@@@..#@@@#..+#+..#+++#.#+++#.#+++#...@...#@@@#..+@+...@#+...+#+...+#@...+++.......",
-".@...+.@.@.@.@...@.+...@.+.@.+.@...@.@...@.@.@.@..@.@..+...@.+@..+.+.@.+.+.@.+.+.@.+.+...+......",
-".@...+.@..@@.@...@.+...@.+.@.+.@...@.@...@.@@.@@.@...@.+...@.@...+.+.@.+.+.@.+.+.@.+.+...+......",
-".#+++..#@@@#.#+++#.#@@@#..+#+..#@@@#..#@#..#+++#.#+++#.#@@@#.#@@@#..++@...+#+...@++...+++.......",
-"................................................................................................"};
diff --git a/wmcube/wmapp/xpm/charmap-small.xpm b/wmcube/wmapp/xpm/charmap-small.xpm
deleted file mode 100644
index 13ff70292386..000000000000
--- a/wmcube/wmapp/xpm/charmap-small.xpm
+++ /dev/null
@@ -1,62 +0,0 @@
-/* XPM */
-static char * charmap_small_xpm[] = {
-"80 54 5 1",
-" c None",
-". c #282828",
-"+ c #004941",
-"@ c #20B2AE",
-"# c #188A86",
-"................................................................................",
-"..++...++...++...++...++...++...++...++...@+...+@...++.............++........++.",
-".+..+.+..+.+..+.+..+.+..+.+..+.+..+.+..+.@..+.+..@.+..+..@........+..+......+.@+",
-".+..+.+..+.+..+.+..+.+..+.+..+.+..+.+..+.@..+.+..@.+..+..@........+..+......+##+",
-"..++...++...++...++...++...++...++...++..#++...++#..++..@@@.......#@@........@+.",
-".+..+.+..+.+..+.+..+.+..+.+..+.+..+.+..+.@..+.+..@.+..+..@........+..+......##.+",
-".+..+.+..+.+..+.+..+.+..+.+..+.+..+.+..+.@..+.+..@.+..+..@.....@..+..+......@..+",
-"..++...++...++...++...++...++...++...++...@+...+@...++........##...++...#@...++.",
-"................................................................................",
-"................................................................................",
-"..@@...++#.#@@#.#@@#.#++#.#@@#.#@@#.#@@#.#@@#.#@@#............++...++...++...++.",
-".@..@.+..@.+..@.+..@.@..@.@..+.@..+.+..@.@..@.@..@...........+..+.+..+.+..+.+..+",
-".@..@.+..@.+..@.+..@.@..@.@..+.@..+.+..@.@..@.@..@..#@...#@..+..+.+..+.+..+.+..+",
-".#++#..++#.#@@#.#@@#.#@@#.@@@#.#@@#..++#.#@@#.#@@#............++...++...++...++.",
-".@..@.+..@.@..+.+..@.+..@.+..@.@..@.+..@.@..@.+..@...........+..+.+..+.+..+.+..+",
-".@..@.+..@.@..+.+..@.+..@.+..@.@..@.+..@.@..@.+..@..#@....@..+..+.+..+.+..+.+..+",
-"..@@...++@.#@@#.#@@#..++#.#@@#.#@@#..++#.#@@#.#@@#.......##...++...++...++...++.",
-"................................................................................",
-"................................................................................",
-".+@@+.+@@+.#@@...@@#.#@@..#@@#.#@@#.#@@#.#++#.@@@...++#.#++#.#++..@..@.#@@..#@@#",
-".@..@.@..@.@..@.@..+.@..@.@..+.@..+.@..+.@..@.+@.+.+..@.@..@.@..+.@@@@.@..@.@..@",
-".@..@.@..@.@..@.@..+.@..@.@..+.@..+.@..+.@..@.+@.+.+..@.@.@..@..+.@##@.@..@.@..@",
-".#+@@.#@@#.#@@..#+++.#++#.#@@..#@@..#+@#.#@@#..#+...++#.#@...#++..#++#.#++#.#++#",
-".@.@#.@..@.@..@.@..+.@..@.@..+.@..+.@..@.@..@.+@.+.+..@.@.@..@..+.@..@.@..@.@..@",
-".@..+.@..@.@..@.@..+.@..@.@..+.@..+.@..@.@..@.+@.+.@..@.@..@.@..+.@..@.@..@.@..@",
-".#@@..#++#.#@@...@@#.#@@..#@@#.#++..#@@#.#++#.@@@..#@@#.#++#.#@@#.#++#.#++#.#@@#",
-"................................................................................",
-"................................................................................",
-".#@@#.#@@#.#@@#.#@@#.@@@#.#++#.#++#.#++#.#++#.#++#.#@@#.@@+...++...+@@..++...++.",
-".@..@.@..@.@..@.@..+.+@.+.@..@.@..@.@..@.@..@.@..@.+..@.@..+.@..+.+..@.+..+.+..+",
-".@..@.@..@.@..@.@..+.+@.+.@..@.@..@.@..@.@..@.@..@.+.@+.@..+.##.+.+..@.+..+.+..+",
-".#@@#.#++#.#@@..#@@#..#+..#++#.#++#.#++#..@@...@@#..##..#++...@+...++#..++...++.",
-".@..+.@##@.@..@.+..@.+@.+.@..@.@..@.@##@.@..@.+..@.+@.+.@..+.+##+.+..@.+..+.+..+",
-".@..+.@.@@.@..@.+..@.+@.+.@..@.@..@.@@@@.@..@.+..@.@..+.@..+.+.@+.+..@.+..+.+..+",
-".#++..#@@#.#++#.#@@#..#+..#@@#..#@..@..@.#++#.#@@#.#@@#.@@+...++...+@@..++..#@@#",
-"................................................................................",
-"................................................................................",
-"..++..+@@+.#@@...@@#.#@@..#@@#.#@@#.#@@#.#++#.@@@...++#.#++#.#++..@..@.#@@..#@@#",
-".+..+.@..@.@..@.@..+.@..@.@..+.@..+.@..+.@..@.+@.+.+..@.@..@.@..+.@@@@.@..@.@..@",
-".+..+.@..@.@..@.@..+.@..@.@..+.@..+.@..+.@..@.+@.+.+..@.@.@..@..+.@##@.@..@.@..@",
-"..++..#@@#.#@@..#+++.#++#.#@@..#@@..#+@#.#@@#..#+...++#.#@...#++..#++#.#++#.#++#",
-".+..+.@..@.@..@.@..+.@..@.@..+.@..+.@..@.@..@.+@.+.+..@.@.@..@..+.@..@.@..@.@..@",
-".+..+.@..@.@..@.@..+.@..@.@..+.@..+.@..@.@..@.+@.+.@..@.@..@.@..+.@..@.@..@.@..@",
-"..++..#++#.#@@...@@#.#@@..#@@#.#++..#@@#.#++#.@@@..#@@#.#++#.#@@#.#++#.#++#.#@@#",
-"................................................................................",
-"................................................................................",
-".#@@#.#@@#.#@@#.#@@#.@@@#.#++#.#++#.#++#.#++#.#++#.#@@#..#@...#+...@#...++..+@+.",
-".@..@.@..@.@..@.@..+.+@.+.@..@.@..@.@..@.@..@.@..@.+..@.+@.+.+@.+.+.@+.+..+.@.@.",
-".@..@.@..@.@..@.@..+.+@.+.@..@.@..@.@..@.@..@.@..@.+.@+.+@.+.+@.+.+.@+.+..+.+@+.",
-".#@@#.#++#.#@@..#@@#..#+..#++#.#++#.#++#..@@...@@#..##..@#+...#+...+#@..++......",
-".@..+.@##@.@..@.+..@.+@.+.@..@.@..@.@##@.@..@.+..@.+@.+.+@.+.+@.+.+.@+.+..+.....",
-".@..+.@.@@.@..@.+..@.+@.+.@..@.@..@.@@@@.@..@.+..@.@..+.+@.+.+@.+.+.@+.+..+.....",
-".#++..#@@#.#++#.#@@#..#+..#@@#..#@..@..@.#++#.#@@#.#@@#..#@...#+...@#...++......",
-"................................................................................"};
diff --git a/wmcube/wmapp/xpm/checkbox.xpm b/wmcube/wmapp/xpm/checkbox.xpm
deleted file mode 100644
index 7b4b0e90df13..000000000000
--- a/wmcube/wmapp/xpm/checkbox.xpm
+++ /dev/null
@@ -1,14 +0,0 @@
-/* XPM */
-static char * checkbox_xpm[] = {
-"9 9 2 1",
-". c #AEAAAE",
-"+ c #000000",
-".........",
-"......++.",
-".....+++.",
-".++.+++..",
-".+++++...",
-".++++....",
-".+++.....",
-".++......",
-"........."};
diff --git a/wmcube/wmapp/xpm/emptybar.xpm b/wmcube/wmapp/xpm/emptybar.xpm
deleted file mode 100644
index e36963175232..000000000000
--- a/wmcube/wmapp/xpm/emptybar.xpm
+++ /dev/null
@@ -1,62 +0,0 @@
-/* XPM for empty bar - taken from wmtop's progress bar, dimmed with GIMP */
-static char * emptybar_xpm[] = {
-"58 1 58 1",
-" c None",
-". c #007007",
-"+ c #026D07",
-"@ c #046C07",
-"# c #066A07",
-"$ c #086706",
-"% c #0A6506",
-"& c #0C6406",
-"* c #0E6206",
-"= c #105F06",
-"- c #115E06",
-"; c #145C06",
-"> c #165905",
-", c #185705",
-"' c #1A5605",
-") c #1C5405",
-"! c #1E5105",
-"~ c #1F5005",
-"{ c #224E05",
-"] c #244C04",
-"^ c #264904",
-"/ c #284804",
-"( c #2A4604",
-"_ c #2C4304",
-": c #2D4204",
-"< c #304004",
-"[ c #323E03",
-"} c #343B03",
-"| c #353A03",
-"1 c #383803",
-"2 c #3A3503",
-"3 c #3B3403",
-"4 c #3E3203",
-"5 c #403003",
-"6 c #422D03",
-"7 c #432C03",
-"8 c #462A03",
-"9 c #482803",
-"0 c #492603",
-"a c #4C2403",
-"b c #4E2202",
-"c c #501F02",
-"d c #511E02",
-"e c #541C02",
-"f c #561A02",
-"g c #571802",
-"h c #591602",
-"i c #5C1401",
-"j c #5E1101",
-"k c #5F1001",
-"l c #620E01",
-"m c #640C01",
-"n c #650A01",
-"o c #670801",
-"p c #6A0600",
-"q c #6C0400",
-"r c #6D0200",
-"s c #700000",
-"..+@#$%&*=-;>,')!~{]^/(_:<[}|1234567890abcdefghijklmnopqrs"};
diff --git a/wmcube/wmapp/xpm/fullbar.xpm b/wmcube/wmapp/xpm/fullbar.xpm
deleted file mode 100644
index f5c3986dc9c7..000000000000
--- a/wmcube/wmapp/xpm/fullbar.xpm
+++ /dev/null
@@ -1,62 +0,0 @@
-/* XPM for full progress bar - taken from wmtop */
-static char * fullbar_xpm[] = {
-"58 1 58 1",
-" c None",
-". c #00FF0F",
-"+ c #04FA0F",
-"@ c #09F50F",
-"# c #0DF10F",
-"$ c #12EC0E",
-"% c #16E80E",
-"& c #1BE30E",
-"* c #1FDF0D",
-"= c #24DA0D",
-"- c #28D60D",
-"; c #2DD10D",
-"> c #32CC0C",
-", c #36C80C",
-"' c #3BC30C",
-") c #3FBF0B",
-"! c #44BA0B",
-"~ c #48B60B",
-"{ c #4DB10B",
-"] c #51AD0A",
-"^ c #56A80A",
-"/ c #5BA30A",
-"( c #5F9F09",
-"_ c #649A09",
-": c #689609",
-"< c #6D9109",
-"[ c #718D08",
-"} c #768808",
-"| c #7A8408",
-"1 c #7F7F07",
-"2 c #847A07",
-"3 c #887607",
-"4 c #8D7107",
-"5 c #916D06",
-"6 c #966806",
-"7 c #9A6406",
-"8 c #9F5F05",
-"9 c #A35B05",
-"0 c #A85605",
-"a c #AD5105",
-"b c #B14D04",
-"c c #B64804",
-"d c #BA4404",
-"e c #BF3F03",
-"f c #C33B03",
-"g c #C83603",
-"h c #CC3203",
-"i c #D12D02",
-"j c #D62802",
-"k c #DA2402",
-"l c #DF1F01",
-"m c #E31B01",
-"n c #E81601",
-"o c #EC1201",
-"p c #F10D00",
-"q c #F50900",
-"r c #FA0400",
-"s c #FF0000",
-"..+@#$%&*=-;>,')!~{]^/(_:<[}|1234567890abcdefghijklmnopqrs"};
diff --git a/wmcube/wmapp/xpm/leds.xpm b/wmcube/wmapp/xpm/leds.xpm
deleted file mode 100644
index a9d1fa56ac6e..000000000000
--- a/wmcube/wmapp/xpm/leds.xpm
+++ /dev/null
@@ -1,14 +0,0 @@
-/* XPM for LED lights - taken from wmppp */
-static char * leds_xpm[] = {
-"16 4 7 1",
-" c None",
-". c #202020",
-"+ c #283C38",
-"@ c #00EB00",
-"# c #E7C308",
-"$ c #B60418",
-"% c #F7F3FF",
-".++..@@..##..$$.",
-"++++@%@@#%##$%$$",
-"++++@@@@####$$$$",
-".++..@@..##..$$."};
diff --git a/wmcube/wmapp/xpm/tile.xpm b/wmcube/wmapp/xpm/tile.xpm
deleted file mode 100644
index e65c234c7a7f..000000000000
--- a/wmcube/wmapp/xpm/tile.xpm
+++ /dev/null
@@ -1,121 +0,0 @@
-/* XPM */
-static char *tile_xpm[] = {
-"64 64 54 1",
-" c #F3CEF3CEF3CE",
-". c #000000000000",
-"X c #514461856185",
-"o c #A289A289B2CA",
-"O c #A289A289A289",
-"+ c #A2899248B2CA",
-"@ c #9248A289A289",
-"# c #A2899248A289",
-"$ c #92489248A289",
-"% c #924892489248",
-"& c #92488207A289",
-"* c #820792489248",
-"= c #924882079248",
-"- c #820782079248",
-"; c #820782078207",
-": c #820771C69248",
-"> c #618551446185",
-", c #9248A289B2CA",
-"< c #92489248B2CA",
-"1 c #82079248A289",
-"2 c #82078207A289",
-"3 c #71C682079248",
-"4 c #71C682078207",
-"5 c #514451446185",
-"6 c #514451445144",
-"7 c #820771C68207",
-"8 c #410351445144",
-"9 c #514441035144",
-"0 c #71C671C69248",
-"q c #71C671C68207",
-"w c #71C671C671C6",
-"e c #410341035144",
-"r c #71C661858207",
-"t c #618571C68207",
-"y c #410351444103",
-"u c #410341034103",
-"i c #618571C671C6",
-"p c #410330C24103",
-"a c #30C241034103",
-"s c #71C6618571C6",
-"d c #6185618571C6",
-"f c #618561858207",
-"g c #30C230C230C2",
-"h c #618561856185",
-"j c #30C230C24103",
-"k c #5144618571C6",
-"l c #30C2410330C2",
-"z c #6185514471C6",
-"x c #208130C230C2",
-"c c #30C2208130C2",
-"v c #5144514471C6",
-"b c #2081208130C2",
-"n c #208120812081",
-"m c #410330C25144",
-" .",
-" X.",
-" oOoO+O+O+O+@#$+@#$#$#$$$#$$%&%&%&%&*&*&*=-=*=-=-=--;---;:;:;>.",
-" oo@o,o@o@o@+@+@<@$@$@$@$@$1$$$*$*$*&*&*2*&*2*-*-*-----3-3-4-X.",
-" oO+OoO#O+@#@#@#$#@#$#%#$$%$%$%&%&*=%&*=*=*=-=-=--;-;-;:;:;:;5.",
-" ,ooo@+@+@+@+@<@#@<@$$$$$$$$$*$1$*&*&*&*&*2*---*-----3---4:4:6.",
-" +O+O+O+@#$#@#$#$#$$%$$$%&%&%&%&*=*&*=-=*=---=--;---;:;:4:;:45.",
-" @o@o@o@+@+@<@$@$@$$$@$1$1$*$*$*&*&*2*=*2*-*-*-----4-3-4:4-4:6.",
-" +O#O+@#@#@#$#$#$#%#%$%&%$%&%&*=*&*=*=*=-=-=--;-;-;:;:;:;:4745.",
-" @+@+@+@+@<@#@$@$$$$$$$$$*$*$*&*&*&*&*2*---*-----3---4:4:4:4:8.",
-" #O+@#$#@#$#$#$$%$$$%&%&%&%&*=*&*=-=-=---=--;:;-;:;:4:4:474:49.",
-" @o@<@+@<@$@$@$$$$$1$1$*$*$*&*&*2*=*2*-*-*-----4-4-4:4:4:4:408.",
-" +@#@#@#$#$#$$%#%$%&%$%&%&*=*&*=*=*=-=-=--;-;-;:;:;:;:474747q9.",
-" @+@+@<@$$$@$$$$$1$$$*&*$*&*&*&*&*2*---------3-3-4:4:4:4:404q8.",
-" #$#@#$#$#$$%$$$%&%&%&%&*=-&*=-=-=---=--;:;:;:;:4:4:474:47q7q9.",
-" @#@<@$@$@$$$$$*$1$*$*$*&*&*2*-*2*-*-*-3---4-4-4:4:4:4:404q4q8.",
-" #@#$#$#$$%$%$%&%$%&%&*=*=*=-=*=-=;=--;-;-;:;:47;:474747q7q7q9.",
-" @<@$$$@$$$$$1$$$*&*&*&*&*&*=*2*---------4-3-4:4:4:4:404qq04q8.",
-" #$#$#$$%$%$%&%&%&%&*=-&*=-=-=------;:;:;:;:4:4:47q747qqq7qqq9.",
-" @$@$@$$$$$*$1$*$*$*&*&*2*-*-*---*-3-3-4-4-4:4:4:4:404q4q4qqq8.",
-" #$#$$%$%$%&%&%&%&*=*=*=-=-=-=;=--;:;-;:;:474:474747q7q7qqwqw9.",
-" $$@$$$$$*$$$*&*&*&*&*2*=*2*---------4-3-4:4:4:4:404qqq4qqqqqe.",
-" #$$%$%$%&%&*&%&*=-&*=-=-=------;:;:;:;:4:4:47q7q7qqq7qqwrqqw9.",
-" @$$$$$*$1$*&*$*2*&*2*-*-*-----3-3-4-4-4:4:404:404q4q4qqqqqtqy.",
-" $%$%$%&%&%=%&*=*=*=-=-=--;=--;:;-;:;:474:474747q7q7qqwqwqwrwe.",
-" $$$$*$1$*&*&*&*&*2*--2*-----3---4:3-4:4:4:4:404qqqqqqqqqtqtqu.",
-" &%$%&%&*&*&*=-=*=-=-=--;---;:;:;:;:4:4:47q7q7qqq7qqwrqrwrwrip.",
-" $$*$*$*&*&*2*&*2*-*-*-----3-3-4-4-4:4:404q404q4q4qtqqqiqtqiru.",
-" $%&%&*=%&*=*=*=-=-=--;-;-;:;-;:;:474:47q747q7q7qqwqwqwrwrirwu.",
-" *$1$*&*&*&*&*2*---*-----3---4:4:4:4:4:4:404qqqqqqqqqtqtqirira.",
-" &%&*=*&*=-=*=-=-=--;---;:;:;:;:4:4:47q7q7qqqqqqwrqrwrwriririp.",
-" *$*&*&*2*&*2*-*-*-----3-3-4-4-4:4:404q4q4qqq4qtqtqiqiqiriqira.",
-" &*=*&*=*=*=-=-=--;-;-;:;:;:;:474:47q7q7q7q7qqwrwqwrwrirwrisip.",
-" *&*&*&*&*2*---*-----3---4:4:4:4:404:404qqqqqqqqqtqtqiriririra.",
-" =*&*=-=*=---=--;---;:;:4:;:474:47q7q7qqqqqqwrwrwrwriririsdrdp.",
-" *&*2*=*2*-*-*-----4-3-4:4-4:4:404q4q4qqqqqtqtqiqiqiriqifirifa.",
-" &*=*=*=-=-=--;-;-;:;:;:;:474747q7q7qqq7qqwrwqwrwrirwrisisisdp.",
-" *&*&*2*---*-----3-3-4:4:4:4:404qq04qqqqqtqqqirtqiririririfida.",
-" =-=-=---=--;:;-;:;:4:4:474:47q7q7qqqqqqwrwrwrwriririsdrdsdddp.",
-" *=*2*-*-*-----4-4-4:4:4:4:404q4q4qqqqqtqtqiqiqiriqifififidida.",
-" =*=-=-=--;-;-;:;:4:;:474747q7q7qqwqwqwrwqwrwrirwrisdsisdsdsdp.",
-" *2*---------4-3-4:4:4:4:404qq04qqqqqtqqqiririririririfidddddg.",
-" =---=--;:;:;:;:4:4:474:47q7q7qqqqqqwrwrwrwriririsdsdsddddddhj.",
-" *---*-3---4-4-4:4:4:4:404q4q4qqqqqtqtqiqiqiririfififidddidkdl.",
-" =;=--;:;-;:;:474:474747q7q7qqwqwqwrwrwrwrirwrisdsdsdsdsddhzhj.",
-" --------4-3-4:4:4:4:404qq04qqqqqtqqqiririririfirifidddddddddx.",
-" ---;:;:;:;:4:4:47q747qqq7qqwqqqwrwrirwriririsdsdsddddddhzhzhc.",
-" --3-3-4-4-4:4:4:4:404q4q4qqqqqtqtqiriqiririfififidddddkdkdXdx.",
-" -;:;-;:;:474:474747q7q7qqwqwqwrwrwrwrisisisdsdsdddsddhzhdhzhg.",
-" ----4-3-4:4:4:4:404qqq4qqqqqtqtqiriririrififdfidddddkdddkzkdx.",
-" :;:;:;:4:4:47q7q7qqq7qqwrqqwrwriririririsdsdsddddddhzhzhzhzXc.",
-" 3-4-4-4:4:404:404q4q4qqqqqtqtqiriqiririfidididddddkdkdXdXdXzx.",
-" -;:;:474:47q747q7q7qqwqwqwrwrirwrisisisdsdsddddddhzhdhzhzXzhc.",
-" 4:4-4:4:4:4:404qqqqqqqqqtqtqiriririrififdfidddddkdddkzkdXzXzx.",
-" :;:4:4:47q7q7qqq7qqwrqrwrwriririsirisdsdsddddddhzhzhzhzXzXzXc.",
-" 4-4:4:404q404qqq4qtqqqiqtqiriqiririfidididddddkdkdXdXdXzXzXvx.",
-" :474:47q7q7q7q7qqwrwqwrwrirwrisisisdsdsddddddhzhzhzhzXzhzX>5c.",
-" 4:4:4:4:404qqqqqqqqqtqtqiririririfiddfidddddkdddXzkdXzXzXvXzx.",
-" :4:47q7q7qqqqqqwrwrwrwriririsdrisdddsddddddhzhzXzhzXzXzX>5>5c.",
-" 4:404q4q4qqqqqtqtqiqiqiriqiririfidididddddkdkdXzXdXzXzXvXvXvx.",
-" :47q7q7q7q7qqwrwqwrwrirwrisisisdsdsddhdddhzhzhzhzXzXzX>5>5>5b.",
-" 404:404qqqqqqqqqiqtqiririririfidddidddddkdkdXzkzXzXzXvXv5vX5n.",
-" >65656569698989y9e9u9ueumueupupapaplpgjgjgjgcgcgcgcxcbcncnbnb.",
-" ..............................................................."};
diff --git a/wmcube/wmapp/xpm/xbutton.xpm b/wmcube/wmapp/xpm/xbutton.xpm
deleted file mode 100644
index ba8e5e95d824..000000000000
--- a/wmcube/wmapp/xpm/xbutton.xpm
+++ /dev/null
@@ -1,14 +0,0 @@
-/* XPM */
-static char * xbutton_xpm[] = {
-"9 9 2 1",
-". c #AEAAAE",
-"+ c #000000",
-".........",
-".++...++.",
-".+++.+++.",
-"..+++++..",
-"...+++...",
-"..+++++..",
-".+++.+++.",
-".++...++.",
-"........."};
diff --git a/wmcube/wmapp/xwrapper.cc b/wmcube/wmapp/xwrapper.cc
deleted file mode 100644
index 44000e25c15e..000000000000
--- a/wmcube/wmapp/xwrapper.cc
+++ /dev/null
@@ -1,329 +0,0 @@
-#include <iostream>
-#include "xwrapper.h"
-#include "wmwidget.h"
-using std::cerr;
-using std::endl;
-
-// This class includes most of the crap normally required to do X stuff.
-
-Xwrapper::Xwrapper()
-{
- xDisplay = X::XOpenDisplay(0);
- if (!xDisplay) { cerr << "Xwrapper: Could not open X display!" << endl; }
- xRootWindow = DefaultRootWindow(xDisplay);
- X::XGetWindowAttributes(xDisplay, xRootWindow, &xAttributes);
-
- X::XGCValues gcv;
- gcv.graphics_exposures = false;
- xGC = X::XCreateGC(xDisplay, xRootWindow,
- X_MACRO(GCGraphicsExposures), &gcv);
-}
-
-Xwrapper::~Xwrapper()
-{
- //XXX: This is only the beginning...
- X::XFreeGC(xDisplay, xGC);
- X::XCloseDisplay(xDisplay);
-}
-
-void
-Xwrapper::set_GC(X::GC gc, Color c) const
-{
- X::XSetForeground(xDisplay, gc, color_to_xcolor(c));
- X::XSetFillStyle(xDisplay, gc, X_MACRO(FillSolid));
-}
-
-unsigned long
-Xwrapper::color_to_xcolor(Color c) const
-{
- X::XColor xcolor;
-
- xcolor.pixel = 0;
- xcolor.flags = X_MACRO(DoRed | DoGreen | DoBlue);
- // map the range 0 -> 0xff to the range 0 -> 0xffff
- // (X insists on using "short" for color values)
- xcolor.red = c.r() * 0x0101;
- xcolor.green = c.g() * 0x0101;
- xcolor.blue = c.b() * 0x0101;
-
- if (X::XAllocColor(xDisplay, xAttributes.colormap, &xcolor))
- X::XFreeColors(xDisplay, xAttributes.colormap, &xcolor.pixel, 1, 0);
- //XXX: This is an incredibly stupid solution, but it works above 8-bit
- //color. It appears that decent color management is a shortcoming of X.
- return xcolor.pixel;
-}
-
-Color
-Xwrapper::get_point(const WMPixmap& src, int x, int y) const
-{
- //magic incantaions to read a pixel from a pixmap
- X::XGCValues gcvalues;
- X::XGetGCValues(xDisplay, src.gc, GCPlaneMask, &gcvalues);
-
- // XXX: Surely there's a better way than allocating an image every time
- X::XImage* dest = XGetImage(xDisplay, src.pixmap, 0, 0, src.attr.width, src.attr.height, gcvalues.plane_mask, XYPixmap);
-
- Color color = XGetPixel(dest, x, y);
- XDestroyImage(dest);
- return color;
-}
-
-bool
-Xwrapper::create_pixmap(WMPixmap & dest, char * pixmap_bytes[]) const
-{
- dest.attr.exactColors = false;
- dest.attr.closeness = 40000;
- dest.attr.valuemask = X_MACRO(XpmExactColors | XpmCloseness |
- XpmReturnPixels | XpmReturnExtensions);
- int error = X::XpmCreatePixmapFromData(xDisplay, xRootWindow, pixmap_bytes,
- &dest.pixmap, &dest.mask, &dest.attr);
- if (error == X_MACRO(XpmSuccess)) {
- X::XGCValues gcv;
- gcv.clip_mask = dest.mask;
- dest.gc = X::XCreateGC(xDisplay, dest.pixmap, X_MACRO(GCClipMask), &gcv);
- return true;
- }
- else return false;
-}
-
-bool
-Xwrapper::create_pixmap(WMPixmap & dest, const WMPixmap & source) const
-{
- create_pixmap(dest, source.attr.width, source.attr.height);
- copy_rectangle(source, dest, 0, 0, source.attr.width, source.attr.height,
- 0, 0);
- return true;
-}
-
-bool
-Xwrapper::create_pixmap(WMPixmap & dest, const WMPixmap * source) const
-{ return source ? create_pixmap(dest, *source) : false; }
-
-bool
-Xwrapper::create_pixmap(WMPixmap & dest, int width, int height) const
-{
- dest.attr.width = width;
- dest.attr.height = height;
- dest.pixmap = X::XCreatePixmap(xDisplay, xRootWindow, width, height,
- DefaultDepth(xDisplay,
- DefaultScreen(xDisplay)));
- dest.mask = 0; //hope XCreateFoo never returns 0
- X::XGCValues gcv;
- dest.gc = X::XCreateGC(xDisplay, dest.pixmap, X_MACRO(None), &gcv);
- return true;
-}
-
-bool
-Xwrapper::create_pixmap(WMPixmap & dest, int width, int height, int depth) const
-{
- dest.attr.width = width;
- dest.attr.height = height;
- dest.pixmap = X::XCreatePixmap(xDisplay, xRootWindow, width, height, depth);
- dest.mask = 0; //hope XCreateFoo never returns 0
- X::XGCValues gcv;
- dest.gc = X::XCreateGC(xDisplay, dest.pixmap, X_MACRO(None), &gcv);
- return true;
-}
-
-void
-Xwrapper::free_pixmap(WMPixmap & dest) const
-{
- X::XFreeGC(xDisplay, dest.gc);
- X::XFreePixmap(xDisplay, dest.pixmap);
- if (dest.mask) X::XFreePixmap(xDisplay, dest.mask);
-}
-
-void
-Xwrapper::draw_point(WMPixmap & dest, int x, int y, Color c) const
-{
- set_GC(dest.gc, c);
- X::XDrawPoint(xDisplay, dest.pixmap, dest.gc, x, y);
-}
-
-void
-Xwrapper::draw_line(WMPixmap & dest, int x1, int y1, int x2, int y2,
- Color c) const
-{
- set_GC(dest.gc, c);
- X::XDrawLine(xDisplay, dest.pixmap, dest.gc, x1, y1, x2, y2);
-}
-
-void
-Xwrapper::draw_arc(WMPixmap & dest, int x, int y, int width, int height,
- int angle1, int angle2, Color c)
-{
- set_GC(dest.gc, c);
- X::XDrawArc(xDisplay, dest.pixmap, dest.gc, x, y, width, height, angle1,
- angle2);
-}
-
-void
-Xwrapper::draw_lines(WMPixmap & dest, const X::XPoint* points, int npoints,
- Color c) const
-{
- set_GC(dest.gc, c);
- X::XDrawLines(xDisplay, dest.pixmap, dest.gc, const_cast<X::XPoint*>(points),
- npoints, X_MACRO(CoordModeOrigin));
-}
-
-void
-Xwrapper::draw_horizontal_gradient(WMPixmap & dest, int x1, int y1, int x2,
- int y2, Color c1, Color c2, double amount)
-{
- if (!(x2 - x1) || !amount)
- return; //gradient isn't wide enough, or none of it is to be drawn
- if (x1 > x2) //put x1 on left while keeping colors straight
- {
- int tempx = x2; x2 = x1; x1 = tempx;
- Color tempc = c2; c2 = c1; c1 = tempc;
- }
-
- int glinesm1 = x2 - x1;
- int glines = glinesm1 + 1; //number of lines in the full gradient
- double dlines = glines * amount; //number of lines that we want to show
- int tdlines = static_cast<int> (dlines); //number of lines truncated to int
- double residue = dlines - tdlines; //amount left over from integer truncation
- for (int x = 0; x < tdlines; x++)
- draw_line(dest, x1 + x, y1, x1 + x, y2, Color::alpha_blend(c2, c1,
- 1.0 * x / glinesm1));
- if (tdlines < glines) //correct undrawn line by using alpha blending
- {
- Color backcolor = get_point(dest, x1 + tdlines, y1);
- Color forecolor = Color::alpha_blend(c2, c1, 1.0 * tdlines / glinesm1);
- Color color = Color::alpha_blend(forecolor, backcolor, residue);
- draw_line(dest, x1 + tdlines, y1, x1 + tdlines, y2, color);
- }
-}
-
-void
-Xwrapper::draw_vertical_gradient(WMPixmap & dest, int x1, int y1, int x2,
- int y2, Color c1, Color c2, double amount)
-{
- if (!(y2 - y1) || !amount)
- return; //gradient isn't high enough, or none of it is to be drawn
- if (y1 > y2) //put y1 on left while keeping colors straight
- {
- int tempy = y2; y2 = y1; y1 = tempy;
- Color tempc = c2; c2 = c1; c1 = tempc;
- }
-
- int glinesm1 = y2 - y1;
- int glines = glinesm1 + 1; //number of lines in the full gradient
- double dlines = glines * amount; //number of lines that we want to show
- int tdlines = static_cast<int> (dlines); //number of lines truncated to int
- double residue = dlines - tdlines; //amount left over from integer truncation
- for (int y = 0; y < tdlines; y++)
- draw_line(dest, x1, y1 + y, x2, y1 + y, Color::alpha_blend(c2, c1,
- 1.0 * y / glinesm1));
- if (tdlines < glines) //correct undrawn line by using alpha blending
- {
- Color backcolor = get_point(dest, x1, y1 + tdlines);
- Color forecolor = Color::alpha_blend(c2, c1, 1.0 * tdlines / glinesm1);
- Color color = Color::alpha_blend(forecolor, backcolor, residue);
- draw_line(dest, x1, y1 + tdlines, x2, y1 + tdlines, color);
- }
-}
-
-void
-Xwrapper::draw_border(WMPixmap & dest, int x, int y, int width, int height,
- int thickness, Color topleft, Color botright,
- Color corner) const
-{
- if (width / 2 < thickness || height / 2 < thickness) return;
-
- fill_rectangle(dest, x, y, width, thickness, topleft);
- fill_rectangle(dest, x, y, thickness, height, topleft);
- fill_rectangle(dest, x, y + height - thickness, width, thickness, botright);
- fill_rectangle(dest, x + width - thickness, y, thickness, height, botright);
- fill_rectangle(dest, x, y + height - thickness, thickness, thickness, corner);
- fill_rectangle(dest, x + width - thickness, y, thickness, thickness, corner);
-}
-
-void
-Xwrapper::draw_border(WMPixmap & dest, const WMRectangle & r, int thickness,
- Color topleft, Color botright, Color corner) const
-{
- draw_border(dest, r.left(), r.top(), r.width(), r.height(), thickness,
- topleft, botright, corner);
-}
-
-void
-Xwrapper::fill_rectangle(WMPixmap & dest, int x, int y,
- int width, int height, Color c) const
-{
- set_GC(dest.gc, c);
- X::XFillRectangle(xDisplay, dest.pixmap, dest.gc, x, y, width, height);
-}
-
-void
-Xwrapper::fill_rectangle(WMPixmap & dest, const WMRectangle & r, Color c)
-const
-{ fill_rectangle(dest, r.left(), r.top(), r.width(), r.height(), c); }
-
-void
-Xwrapper::fill_arc(WMPixmap & dest, int x, int y, int width, int height,
- int angle1, int angle2, Color c)
-{
- set_GC(dest.gc, c);
- X::XFillArc(xDisplay, dest.pixmap, dest.gc, x, y, width, height, angle1,
- angle2);
-}
-
-void
-Xwrapper::fill_polygon(WMPixmap & dest, const X::XPoint* points, int npoints,
- Color c, XShape shape) const
-{
- set_GC(dest.gc, c);
- X::XFillPolygon(xDisplay, dest.pixmap, dest.gc,
- const_cast<X::XPoint*>(points), npoints, shape,
- X_MACRO(CoordModeOrigin));
-}
-
-void
-Xwrapper::clear_rectangle(WMPixmap & dest, int x, int y,
- int width, int height) const
-{
- X::XClearArea(xDisplay, dest.pixmap, x, y, width, height,
- /* don't generate expose events */ false);
-}
-
-void
-Xwrapper::clear_rectangle(WMPixmap & dest, const WMRectangle & r) const
-{ clear_rectangle(dest, r.left(), r.top(), r.width(), r.height()); }
-
-void
-Xwrapper::copy_rectangle(const WMPixmap & source, WMPixmap & dest,
- int source_x, int source_y,
- int source_w, int source_h,
- int dest_x, int dest_y) const
-{
- X::XCopyArea(xDisplay, source.pixmap, dest.pixmap, dest.gc, source_x,
- source_y, source_w, source_h, dest_x, dest_y);
-}
-
-void
-Xwrapper::copy_rectangle(const WMPixmap & source, WMPixmap & dest,
- const WMRectangle & r, int dest_x, int dest_y) const
-{
- copy_rectangle(source, dest, r.left(), r.top(), r.width(), r.height(),
- dest_x, dest_y);
-}
-
-void
-Xwrapper::copy_rectangle(const WMPixmap & source, X::Drawable & dest,
- int source_x, int source_y,
- int source_w, int source_h,
- int dest_x, int dest_y) const
-{
- X::XCopyArea(xDisplay, source.pixmap, dest, xGC, source_x, source_y,
- source_w, source_h, dest_x, dest_y);
-}
-
-void
-Xwrapper::copy_rectangle(const WMPixmap & source, X::Drawable & dest,
- const WMRectangle & r, int dest_x, int dest_y) const
-{
- copy_rectangle(source, dest, r.left(), r.top(), r.width(), r.height(),
- dest_x, dest_y);
-}
-
diff --git a/wmcube/wmapp/xwrapper.h b/wmcube/wmapp/xwrapper.h
deleted file mode 100644
index 4f1b03877fdc..000000000000
--- a/wmcube/wmapp/xwrapper.h
+++ /dev/null
@@ -1,140 +0,0 @@
-#include "colors.h"
-
-#ifndef _MY_XWRAPPER_H
-#define _MY_XWRAPPER_H
-
-//These must be included here so that important types and functions aren't
-//dragged into the X namespace, but left undefined in the global namespace.
-extern "C" {
-# include <stddef.h>
-# include <stdlib.h>
-# include <sys/types.h>
-# include <malloc.h>
-}
-namespace X {
- // Unfortunately, many common X calls are actually macros and the X::
- // prefix must be avoided when using them. Still, it is nice to use
- // a separate namespace whenever possible.
-
- // the next line ensures that X macros are expanded correctly into functions
- // in the X namespace, since _XPrivDisplay appears to be the only
- // real X object used by all X macros:
-# define _XPrivDisplay X::_XPrivDisplay
-
- // this is just so I can easily see which identifiers are macros from Xlib
- // that can't be prefixed by "X::"
-# define X_MACRO(x) (x)
-
- extern "C" {
-# include <X11/X.h>
-# include <X11/Xlib.h>
-# include <X11/xpm.h>
-# include <X11/extensions/shape.h>
- }
-};
-
-// forward declaration for rectangle
-struct WMRectangle;
-
-struct WMPixmap {
- X::Pixmap pixmap;
- X::Pixmap mask;
- X::GC gc;
- X::XpmAttributes attr;
-};
-
-// global X thingies
-extern X::Window wActiveWin, wProgramWin;
-extern X::Atom deleteWin, _XA_GNUSTEP_WM_FUNC;
-
-class Xwrapper {
- private:
- X::Display * xDisplay;
- X::Window xRootWindow;
- X::XWindowAttributes xAttributes;
- mutable X::GC xGC;
-
- unsigned long color_to_xcolor(Color) const;
- void set_GC(X::GC, Color) const;
-
- public:
- Xwrapper();
- ~Xwrapper();
-
- X::Display * xdisplay() const;
- const X::Window xrootwin() const;
- X::GC get_GC() const;
-
- bool create_pixmap(WMPixmap & dest, char * pixmap_bytes[]) const;
- bool create_pixmap(WMPixmap & dest, const WMPixmap & source) const;
- bool create_pixmap(WMPixmap & dest, const WMPixmap * source) const;
- bool create_pixmap(WMPixmap & dest, int width, int height) const;
- bool create_pixmap(WMPixmap & dest, int width, int height, int depth) const;
-
- void free_pixmap(WMPixmap & dest) const;
-
- Color get_point(const WMPixmap & src, int x, int y) const;
-
- void draw_point(WMPixmap & dest, int x, int y, Color c) const;
- void draw_line(WMPixmap & dest, int x1, int y1, int x2, int y2, Color c)
- const;
- void draw_arc(WMPixmap & dest, int x, int y, int width, int height,
- int angle1, int angle2, Color c); //angles are in units of degrees * 64
- void draw_lines(WMPixmap & dest, const X::XPoint* points, int npoints,
- Color c) const; //X::XPoint is simply a struct { short x, y };
-
- // draws a color gradient from left to right or bottom to top from color1
- // to color2. amount is the proportion of the gradient to draw i.e. 0.5
- // draws half the gradient. It should always be at least 2 pixels wide.
- void draw_horizontal_gradient(WMPixmap & dest, int x1, int y1, int x2, int y2, Color c1, Color c2, double amount = 1.0);
- void draw_vertical_gradient(WMPixmap & dest, int x1, int y1, int x2, int y2, Color c1, Color c2, double amount = 1.0);
-
- void draw_border(WMPixmap & dest, int x, int y, int width, int height,
- int thickness, Color topleft, Color botright, Color corner)
- const;
- void draw_border(WMPixmap & dest, const WMRectangle & posn, int thickness,
- Color topleft, Color botright, Color corner) const;
-
- void fill_rectangle(WMPixmap & dest, int x, int y, int width, int height,
- Color c) const;
- void fill_rectangle(WMPixmap & dest, const WMRectangle & posn, Color c)
- const;
-
- void fill_arc(WMPixmap & dest, int x, int y, int width, int height,
- int angle1, int angle2, Color c); //angles are in units of degrees * 64
-
- enum XShape { complex = X_MACRO(Complex), convex = X_MACRO(Convex),
- nonconvex = X_MACRO(Nonconvex) };
- void fill_polygon(WMPixmap & dest, const X::XPoint* points, int npoints,
- Color c, XShape shape = complex) const;
- //shape is simply a hint to the X server about what type of shape is
- //being drawn. See XFillPolygon(3) for a complete description.
-
- void clear_rectangle(WMPixmap & dest, int x, int y, int width, int height)
- const;
- void clear_rectangle(WMPixmap & dest, const WMRectangle & posn) const;
-
- void copy_rectangle(const WMPixmap & source, WMPixmap & dest,
- int source_x, int source_y, int source_w, int source_h,
- int dest_x = 0, int dest_y = 0) const;
- void copy_rectangle(const WMPixmap & source, WMPixmap & dest,
- const WMRectangle & posn, int dest_x = 0, int dest_y = 0)
- const;
- void copy_rectangle(const WMPixmap & source, X::Drawable & dest,
- int source_x, int source_y, int source_w, int source_h,
- int dest_x = 0, int dest_y = 0) const;
- void copy_rectangle(const WMPixmap & source, X::Drawable & dest,
- const WMRectangle & posn, int dest_x = 0, int dest_y = 0)
- const;
-};
-
-inline X::Display *
-Xwrapper::xdisplay() const { return xDisplay; }
-
-inline const X::Window
-Xwrapper::xrootwin() const { return xRootWindow; }
-
-inline X::GC
-Xwrapper::get_GC() const { return xGC; }
-
-#endif
diff --git a/wmcube/wmc/cossin.wmc b/wmcube/wmc/cossin.wmc
deleted file mode 100755
index 93dd0a14f6d4..000000000000
--- a/wmcube/wmc/cossin.wmc
+++ /dev/null
@@ -1,362 +0,0 @@
-WMCUBE_COORDINATES
-1 100 0 0
-2 54.030230586814 84.1470984807897 45.4648713412841
-3 -41.6146836547142 90.9297426825682 -37.8401247653964
-4 -98.9992496600445 14.1120008059867 -13.9707749099463
-5 -65.3643620863612 -75.6802495307928 49.4679123311691
-6 28.3662185463226 -95.8924274663138 -27.2010555444685
-7 96.0170286650366 -27.9415498198926 -26.8286459000217
-8 75.3902254343305 65.6986598718789 49.5303677847435
-9 -14.5500033808614 98.9358246623382 -14.3951658332533
-10 -91.1130261884677 41.2118485241757 -37.5493623385838
-11 -83.9071529076452 -54.402111088937 45.6472625363814
-12 0.442569798805079 -99.9990206550704 -0.442565464520194
-13 84.3853958732492 -53.6572918000435 -45.2789181003312
-14 90.7446781450196 42.0167036826641 38.1279225239801
-15 13.6737218207834 99.060735569487 13.5452894153935
-16 -75.9687912858821 65.0287840157117 -49.4015812046431
-17 -95.7659480323385 -28.7903316665065 27.5713340620845
-18 -27.5163338051597 -96.1397491879557 26.4541343060012
-19 66.031670824408 -75.0987246771676 -49.5889426721558
-20 98.8704618186669 14.9877209662952 14.8184289354693
-21 40.8082061813392 91.2945250727628 37.2556580239674
-22 -54.7729260224268 83.6655638536056 -45.8260773957817
-23 -99.9960826394637 -0.885130929040388 0.885096255270679
-24 -53.2833020333398 -84.6220404175171 45.0894173824405
-25 42.4179007336997 -90.5578362006624 -38.4127330661833
-26 99.1202811863474 -13.2351750097773 -13.1187426851964
-27 64.691932232864 76.2558450479603 49.3313796020243
-28 -29.2138808733836 95.6375928404503 -27.9394524425808
-29 -96.2605866313567 27.0905788307869 -26.0775501043456
-30 -74.8057529689 -66.3633884212967 49.6436324042268
-31 15.4251449887584 -98.8031624092862 -15.2405310551108
-32 91.4742357804531 -40.4037645323065 -36.9590348324611
-33 83.422336050651 55.1426681241691 46.0013019098395
-34 -1.32767472230595 99.9911860107267 -1.32755770119834
-35 -84.8570274784605 52.9082686120024 -44.8963840344646
-36 -90.3692205091507 -42.8182669496151 38.6945340778945
-37 -12.7963689627405 -99.1778853443116 12.6911681381018
-38 76.5414051945343 -64.3538133357 -49.2573130234124
-39 95.5073644047295 29.6368578709385 28.305381844909
-40 26.6642932359937 96.3795386284088 25.6989227993768
-41 -66.6938061652262 74.5113160479349 -49.6944326961688
-42 -98.7339277523826 -15.8622668804709 15.6614391216543
-43 -39.9985314988351 -91.6521547915634 36.6595160036646
-44 55.5113301520626 -83.1774742628598 -46.172922350203
-45 99.9843308647691 1.77019251054136 1.76991513668303
-46 52.532198881773 85.0903524534118 44.6998331800279
-47 -43.2177944884778 90.1788347648809 -38.9733034807902
-48 -99.2335469150929 12.3573122745224 -12.2625992733827
-49 -64.01443394692 -76.8254661323667 49.1793872717172
-50 30.0592543743637 -95.3752652759472 -28.6690935995211
-51 96.4966028492113 -26.2374853703929 -25.3182820554879
-52 74.2154196813783 67.0229175843375 49.7413395679203
-53 -16.2990780795705 98.6627592040485 -16.0811201581265
-54 -91.8282786212119 39.5925150181834 -36.3571250040426
-55 -82.930983286315 -55.8789048851616 46.3409252708893
-56 2.21267562619557 -99.975517335862 -2.21213390425355
-57 85.3220107722584 -52.1551002086912 -44.4997802183417
-58 89.9866826969194 43.6164755247825 39.2490194340655
-59 11.9180135448819 99.2872648084537 11.8330696682143
-60 -77.1080222975845 63.6738007139138 -49.0976084522042
-61 -95.2412980415156 -30.4810621102217 29.0305592106157
-62 -25.8101635938267 -96.6117770008393 24.9356576948197
-63 67.3507162323586 -73.9180696649223 -49.784349344459
-64 98.589658158255 16.7355700302807 16.4995412836891
-65 39.185723042955 92.0026038196791 36.0518855250866
-66 -56.2453851238172 82.6828679490103 -46.5052975093381
-67 -99.964745596635 -2.65511540239668 2.65417935730291
-68 -51.7769799789505 -85.5519978975322 44.2962408229974
-69 44.0143022496041 -89.7927680689291 -39.5216603361444
-70 99.3390379722272 -11.4784813783187 -11.4026129750431
-71 63.33192030863 77.3890681557889 49.0119829720156
-72 -30.9022728166071 95.1054653254375 -29.3897503583703
-73 -96.7250588273882 25.3823362762036 -24.5510796949235
-74 -73.6192718227316 -67.6771956887308 49.8234586560887
-75 17.1717341830778 -98.5146260468247 -16.9166697162138
-76 92.1751269724749 -38.778163540943 -35.7438214814582
-77 82.4331331107558 56.610763689818 46.6660261874431
-78 -3.09750317312165 99.9520158580731 -3.09601686280287
-79 -85.7803093244988 51.3978455987535 -44.089230940739
-80 -89.5970946790963 -44.4112668707508 39.7912048263728
-81 -11.0387243839048 -99.3888653923375 10.9712629189502
-82 77.6685982021631 -62.9887994274454 -48.922517539669
-83 94.9677697882543 31.3228782433085 29.7466389011604
-84 24.9540117973338 96.8364461100185 24.1645781864128
-85 -68.0023495587339 73.3190320073292 -49.858664438704
-86 -98.4376643394042 -17.6075619948587 17.3324727748515
-87 -38.3698444949742 -92.345844700406 35.4329570091161
-88 56.9750334265312 -82.1817836630823 -46.8230987125607
-89 99.9373283695125 3.53983027336607 3.53761180401726
-90 51.0177044941669 86.0069405812453 43.8787667902134
-91 -44.807361612917 89.3996663600558 -40.0576317866915
-92 -99.4367460928201 10.5987511751157 -10.5390532950096
-93 -62.6444447910339 -77.9466069615805 48.8292191645315
-94 31.7428701519702 -94.8282141269947 -30.1011968777642
-95 96.9459366669988 -24.5251985467654 -23.7761834506029
-96 73.017356099482 68.3261714736121 49.88996393403
-97 -18.0430449291084 98.3587745434345 -17.7469178825923
-98 -92.5147536596414 37.9607739027522 -35.1193164634246
-99 -81.9288245291459 -57.3381871990423 46.9765027784966
-100 3.98208803931389 -99.9206834186354 -3.97892958321418
-101 86.2318872287684 -50.6365641109759 -43.6648648606997
-102 89.200486978816 45.2025787178351 40.3209203432915
-103 10.1585703696621 99.4826791358406 10.1060179656396
-104 -78.2230889887116 62.2988631442349 -48.7320951562705
-105 -94.6868010751213 -32.1622403162531 30.453396509553
-106 -24.0959049236201 -97.0535283537485 23.3859259171379
-107 68.6486550906984 -72.7142500080853 -49.9173546898386
-108 98.2779582041221 18.4781744560667 18.159972568818
-109 37.5509597767012 92.6818505417785 34.8029244172456
-110 -57.7002178942952 81.6742606636317 -47.1262263664701
-111 -99.9020813314648 -4.4242678085071 4.41993562437658
-112 -50.2544319145385 -86.4551448610608 43.4475419108175
-113 45.5969104444276 -88.9995604366833 -40.5810498682487
-114 99.5266636217131 -9.7181905893209 -9.67219085795039
-115 61.952061255921 78.498038868131 48.6311531242812
-116 -32.5809805219964 94.543533402477 -30.8032102026682
-117 -97.1592190628802 23.6661393364286 -22.9938361616071
-118 -72.4097196700474 -68.9697940935389 49.9408345601404
-119 18.9129420528958 -98.1952169044084 -18.5716044718461
-120 92.8471320739076 -37.140410143809 -34.4838056590133
-121 81.4180970526562 58.0611184212314 47.2722577460558
-122 -4.86636092001539 99.881522472358 -4.86059537591122
-123 -86.676709105198 49.8713153896394 -43.2268149672136
-124 -88.7968906691855 -45.9903490689591 40.8379999811404
-125 -9.27762045976609 -99.5686986889179 9.2376059610859
-126 78.7714512144235 -61.6040459188656 -48.5264009770903
-127 94.3984139152314 32.9990825673782 31.1506105501826
-128 23.2359102029658 97.2630067242408 22.5999449031492
-129 -69.2895821920165 72.1037710501732 -49.9604017053531
-130 -98.1105522649388 -19.3473392038468 18.9817813414652
-131 -36.7291330454696 -93.0105950186762 34.1619851907925
-132 58.4208817109289 -81.16033871367 -47.4145854761024
-133 99.8590072439991 5.30835871460582 5.30087431335569
-134 49.487222040343 86.8965756214236 43.0027013232285
-135 -46.3828868851872 88.5924816459948 -41.091750550642
-136 -99.6087835141185 8.83686861040014 -8.80229732356057
-137 -61.25482394961 -79.0433206722889 48.4178469217362
-138 33.4165382630761 -94.2514454558251 -31.4955703342481
-139 97.3648893049518 -22.8052259500861 -22.2042830020455
-140 71.7964101410472 69.6080131224741 49.9760545924455
-141 -19.7813574004268 98.0239659440312 -19.3904710414615
-142 -93.172236174352 36.3171365373259 -33.8374882263192
-143 -80.9009906953598 -58.7795007167406 47.5531984056293
-144 5.75025253491242 -99.8345360873918 -5.7407379420833
-145 87.1147401032343 -49.1021593898469 -42.775218537541
-146 88.38633737085 46.7745162045133 41.3422816961041
-147 8.39594367418485 99.6469173121774 8.36629905059196
-148 -79.3136419166478 60.9044021883292 -48.3054994631265
-149 -94.1026309029144 -33.8333394324276 31.8380625282276
-150 -22.3740950135584 -97.4648648094495 21.8068814573024
-151 69.9250806478375 -71.4876429629165 -49.9877919950575
-152 97.9354596376429 20.2149881415654 19.797641552137
-153 35.9044286891116 93.3320523748862 33.5103401890253
-154 -59.1369684144325 80.6400580775486 -47.6880856746999
-155 -99.80810948185 -6.19203372560573 6.18015180000565
-156 -48.7161349803341 -87.3311982774648 42.544384432793
-157 47.1652293561339 -88.1784618814781 -41.5895737891102
-158 99.6830993361718 -7.95485428747221 -7.92964530142864
-159 60.552787498699 79.5824096527455 48.1893674033711
-160 -34.2494779115907 93.9519731713148 -32.1780602988131
-161 -97.5629312795237 21.9425258379005 -21.4077714042226
-162 -71.1774755635724 -70.2407785577371 49.9956129935963
-163 20.6482229337811 -97.845035079338 -20.203260972818
-164 93.490040489975 -35.4910175844935 -33.1805667100472
-165 80.3775459710974 59.4932778023209 47.8192367152731
-166 -6.63369363356237 99.7797279449891 -6.6190814602726
-167 -87.5459459043705 48.3291563728257 -42.3102170941926
-168 -87.9688592495152 -47.5550186871899 41.8336074550147
-169 -7.51360908983532 -99.717328877408 7.49237028667391
-170 79.8496186162556 -60.1999867677605 -48.069459841093
-171 93.7994752119442 34.664945549703 32.5155370081276
-172 21.5105268762141 97.6590867943566 21.0069841119653
-173 -70.55510066863 70.8659140182323 -49.9995169753086
-174 -97.7526940402531 -21.0810532913481 20.6072975243543
-175 -35.0769113209131 -93.6461974251213 32.848193626217
-176 59.84842190141 -80.1134595178041 -47.9466412520307
-177 99.7493920327152 7.07522360803452 7.05749253396957
-178 47.9412311470322 87.7589787777116 42.0727348680976
-179 -47.9438765629173 87.7575335804269 -42.0743635744605
-180 -99.7496052654355 7.07221672389912 -7.05450826560549
-181 -59.8460069057858 -80.115263573383 47.9457861707153
-
-WMCUBE_PLANES
-1 2 3
-2 3 4
-3 4 5
-4 5 6
-5 6 7
-6 7 8
-7 8 9
-8 9 10
-9 10 11
-10 11 12
-11 12 13
-12 13 14
-13 14 15
-14 15 16
-15 16 17
-16 17 18
-17 18 19
-18 19 20
-19 20 21
-20 21 22
-21 22 23
-22 23 24
-23 24 25
-24 25 26
-25 26 27
-26 27 28
-27 28 29
-28 29 30
-29 30 31
-30 31 32
-31 32 33
-32 33 34
-33 34 35
-34 35 36
-35 36 37
-36 37 38
-37 38 39
-38 39 40
-39 40 41
-40 41 42
-41 42 43
-42 43 44
-43 44 45
-44 45 46
-45 46 47
-46 47 48
-47 48 49
-48 49 50
-49 50 51
-50 51 52
-51 52 53
-52 53 54
-53 54 55
-54 55 56
-55 56 57
-56 57 58
-57 58 59
-58 59 60
-59 60 61
-60 61 62
-61 62 63
-62 63 64
-63 64 65
-64 65 66
-65 66 67
-66 67 68
-67 68 69
-68 69 70
-69 70 71
-70 71 72
-71 72 73
-72 73 74
-73 74 75
-74 75 76
-75 76 77
-76 77 78
-77 78 79
-78 79 80
-79 80 81
-80 81 82
-81 82 83
-82 83 84
-83 84 85
-84 85 86
-85 86 87
-86 87 88
-87 88 89
-88 89 90
-89 90 91
-90 91 92
-91 92 93
-92 93 94
-93 94 95
-94 95 96
-95 96 97
-96 97 98
-97 98 99
-98 99 100
-99 100 101
-100 101 102
-101 102 103
-102 103 104
-103 104 105
-104 105 106
-105 106 107
-106 107 108
-107 108 109
-108 109 110
-109 110 111
-110 111 112
-111 112 113
-112 113 114
-113 114 115
-114 115 116
-115 116 117
-116 117 118
-117 118 119
-118 119 120
-119 120 121
-120 121 122
-121 122 123
-122 123 124
-123 124 125
-124 125 126
-125 126 127
-126 127 128
-127 128 129
-128 129 130
-129 130 131
-130 131 132
-131 132 133
-132 133 134
-133 134 135
-134 135 136
-135 136 137
-136 137 138
-137 138 139
-138 139 140
-139 140 141
-140 141 142
-141 142 143
-142 143 144
-143 144 145
-144 145 146
-145 146 147
-146 147 148
-147 148 149
-148 149 150
-149 150 151
-150 151 152
-151 152 153
-152 153 154
-153 154 155
-154 155 156
-155 156 157
-156 157 158
-157 158 159
-158 159 160
-159 160 161
-160 161 162
-161 162 163
-162 163 164
-163 164 165
-164 165 166
-165 166 167
-166 167 168
-167 168 169
-168 169 170
-169 170 171
-170 171 172
-171 172 173
-172 173 174
-173 174 175
-174 175 176
-175 176 177
-176 177 178
-177 178 179
-178 179 180
diff --git a/wmcube/wmc/coussin.bande.diag.wmc b/wmcube/wmc/coussin.bande.diag.wmc
deleted file mode 100755
index 7287b32f162c..000000000000
--- a/wmcube/wmc/coussin.bande.diag.wmc
+++ /dev/null
@@ -1,124 +0,0 @@
-WMCUBE_COORDINATES
-1 -3 -3 -0.989992496600445
-2 -3 -2 -0.923561053656561
-3 -3 -1 -0.875844530679003
-4 -3 0 -0.858525596664594
-5 -3 1 -0.875844530679003
-6 -3 2 -0.923561053656561
-7 -3 3 -0.989992496600445
-8 -2 -3 -0.923561053656561
-9 -2 -2 -0.416146836547142
-10 -2 -1 -0.0516802364419242
-11 -2 0 0.0806046117362795
-12 -2 1 -0.0516802364419242
-13 -2 2 -0.416146836547142
-14 -2 3 -0.923561053656561
-15 -1 -3 -0.875844530679003
-16 -1 -2 -0.0516802364419242
-17 -1 -1 0.54030230586814
-18 -1 0 0.755165123780746
-19 -1 1 0.54030230586814
-20 -1 2 -0.0516802364419242
-21 -1 3 -0.875844530679003
-22 0 -3 -0.858525596664594
-23 0 -2 0.0806046117362795
-24 0 -1 0.755165123780746
-25 0 0 1
-26 0 1 0.755165123780746
-27 0 2 0.0806046117362795
-28 0 3 -0.858525596664594
-29 1 -3 -0.875844530679003
-30 1 -2 -0.0516802364419242
-31 1 -1 0.54030230586814
-32 1 0 0.755165123780746
-33 1 1 0.54030230586814
-34 1 2 -0.0516802364419242
-35 1 3 -0.875844530679003
-36 2 -3 -0.923561053656561
-37 2 -2 -0.416146836547142
-38 2 -1 -0.0516802364419242
-39 2 0 0.0806046117362795
-40 2 1 -0.0516802364419242
-41 2 2 -0.416146836547142
-42 2 3 -0.923561053656561
-43 3 -3 -0.989992496600445
-44 3 -2 -0.923561053656561
-45 3 -1 -0.875844530679003
-46 3 0 -0.858525596664594
-47 3 1 -0.875844530679003
-48 3 2 -0.923561053656561
-49 3 3 -0.989992496600445
-
-WMCUBE_PLANES
-1 8 2
-8 2 9
-2 3 9
-9 10 3
-3 10 4
-10 4 11
-4 5 11
-11 12 5
-5 12 6
-12 6 13
-6 7 13
-13 14 7
-8 9 15
-15 16 9
-9 16 10
-16 10 17
-10 11 17
-17 18 11
-11 18 12
-18 12 19
-12 13 19
-19 20 13
-13 20 14
-20 14 21
-15 22 16
-22 16 23
-16 17 23
-23 24 17
-17 24 18
-24 18 25
-18 19 25
-25 26 19
-19 26 20
-26 20 27
-20 21 27
-27 28 21
-22 23 29
-29 30 23
-23 30 24
-30 24 31
-24 25 31
-31 32 25
-25 32 26
-32 26 33
-26 27 33
-33 34 27
-27 34 28
-34 28 35
-29 36 30
-36 30 37
-30 31 37
-37 38 31
-31 38 32
-38 32 39
-32 33 39
-39 40 33
-33 40 34
-40 34 41
-34 35 41
-41 42 35
-36 37 43
-43 44 37
-37 44 38
-44 38 45
-38 39 45
-45 46 39
-39 46 40
-46 40 47
-40 41 47
-47 48 41
-41 48 42
-48 42 49
diff --git a/wmcube/wmc/diamond.wmc b/wmcube/wmc/diamond.wmc
deleted file mode 100644
index 98214554826f..000000000000
--- a/wmcube/wmc/diamond.wmc
+++ /dev/null
@@ -1,107 +0,0 @@
-# This object is somewhat broken
-# Originally by Nicolas Mieville <n...@altern.org>
-
-WMCUBE_COORDINATES
-
-1 -50 0 0
-2 -35 0 35
-3 0 0 50
-4 35 0 35
-5 50 0 0
-6 35 0 -35
-7 0 0 -50
-8 -35 0 -35
-9 -32 17 13
-10 -13 17 32
-11 13 17 32
-12 32 17 13
-13 32 17 -13
-14 13 17 -32
-15 -13 17 -32
-16 -32 17 -13
-17 0 -60 0
-18 0 17 0
-
-
-WMCUBE_PLANES
-
-17 1 2
-17 2 3
-17 3 4
-17 4 5
-17 5 6
-17 6 7
-17 7 8
-17 8 1
-
-2 1 9
-2 9 10
-3 2 10
-3 10 11
-4 3 11
-4 11 12
-5 4 12
-5 12 13
-6 5 13
-6 13 14
-7 6 14
-7 14 15
-8 7 15
-8 15 16
-9 8 16
-9 1 16
-1 8 16
-
-9 18 10
-10 18 11
-11 18 12
-12 18 13
-13 18 14
-14 18 15
-15 18 16
-16 18 9
diff --git a/wmcube/wmc/hyp_par.wmc b/wmcube/wmc/hyp_par.wmc
deleted file mode 100644
index 67e5083f009b..000000000000
--- a/wmcube/wmc/hyp_par.wmc
+++ /dev/null
@@ -1,70 +0,0 @@
-WMCUBE_COORDINATES
-1 50 50 50
-2 -50 50 50
-3 -50 -50 50
-4 50 -50 50
-5 50 50 -50
-6 -50 50 -50
-7 -50 -50 -50
-8 50 -50 -50
-9 50 40 40
-10 -50 -40 40
-11 50 30 30
-12 -50 -30 30
-13 50 20 20
-14 -50 -20 20
-15 50 10 10
-16 -50 -10 10
-17 50 0 0
-18 -50 0 0
-19 50 -10 -10
-20 -50 10 -10
-21 50 -20 -20
-22 -50 20 -20
-23 50 -30 -30
-24 -50 30 -30
-25 50 -40 -40
-26 -50 40 -40
-27 -40 -40 50
-28 -40 40 -50
-29 -30 -30 50
-30 -30 30 -50
-31 -20 -20 50
-32 -20 20 -50
-
-33 -10 -10 50
-34 -10 10 -50
-35 0 0 50
-36 0 0 -50
-37 10 10 50
-38 10 -10 -50
-39 20 20 50
-40 20 -20 -50
-41 30 30 50
-42 30 -30 -50
-43 40 40 50
-44 40 -40 -50
-
-WMCUBE_LINES
-9 10
-11 12
-13 14
-15 16
-17 18
-19 20
-21 22
-23 24
-25 26
-27 28
-29 30
-31 32
-33 34
-35 36
-37 38
-39 40
-41 42
-43 44
-1 8
-8 6
-6 3
-3 1
diff --git a/wmcube/wmc/judaspriest.wmc b/wmcube/wmc/judaspriest.wmc
deleted file mode 100644
index 7a8d6d285168..000000000000
--- a/wmcube/wmc/judaspriest.wmc
+++ /dev/null
@@ -1,239 +0,0 @@
-WMCUBE_COORDINATES
-1 -66 100 35
-2 -27 17 35
-3 -106 17 35
-4 -130 55 35
-5 -162 21 35
-6 -117 -62 35
-7 -68 -108 35
-8 -7 -108 35
-9 -28 -60 35
-10 -64 -60 35
-11 -90 -24 35
-12 -8 -24 35
-13 37 -118 35
-14 83 -118 35
-15 37 -24 35
-16 120 -24 35
-17 114 -68 35
-18 101 -68 35
-19 122 -115 35
-20 146 -115 35
-21 164 -44 35
-22 132 27 35
-23 84 52 35
-24 101 17 35
-25 18 17 35
-26 -11 74 35
-
-27 -66 100 -35
-28 -27 17 -35
-29 -106 17 -35
-30 -130 55 -35
-31 -162 21 -35
-32 -117 -62 -35
-33 -68 -108 -35
-34 -7 -108 -35
-35 -28 -60 -35
-36 -64 -60 -35
-37 -90 -24 -35
-38 -8 -24 -35
-39 37 -118 -35
-40 83 -118 -35
-41 37 -24 -35
-42 120 -24 -35
-43 114 -68 -35
-44 101 -68 -35
-45 122 -115 -35
-46 146 -115 -35
-47 164 -44 -35
-48 132 27 -35
-49 84 52 -35
-50 101 17 -35
-51 18 17 -35
-52 -11 74 -35
-
-
-WMCUBE_LINES
-1 2
-2 3
-3 4
-4 5
-5 6
-6 7
-7 8
-8 9
-9 10
-10 11
-11 12
-12 13
-13 14
-14 15
-15 16
-16 17
-17 18
-18 19
-19 20
-20 21
-21 22
-22 23
-23 24
-24 25
-25 26
-26 1
-
-27 28
-28 29
-29 30
-30 31
-31 32
-32 33
-33 34
-34 35
-35 36
-36 37
-37 38
-38 39
-39 40
-40 41
-41 42
-42 43
-43 44
-44 45
-45 46
-46 47
-47 48
-48 49
-49 50
-50 51
-51 52
-52 27
-
-1 27
-2 28
-3 29
-4 30
-5 31
-6 32
-7 33
-8 34
-9 35
-10 36
-11 37
-12 38
-13 39
-14 40
-15 41
-16 42
-17 43
-18 44
-19 45
-20 46
-21 47
-22 48
-23 49
-24 50
-25 51
-26 52
-
-WMCUBE_PLANES
-1 2 26
-26 2 25
-26 2 15
-24 3 11
-24 11 16
-15 12 13
-15 2 13
-15 13 14
-23 24 22
-22 24 16
-22 16 21
-21 16 17
-21 17 20
-17 19 20
-17 18 19
-4 5 3
-3 5 6
-3 6 11
-11 6 10
-10 6 7
-9 10 7
-9 7 8
-
-52 28 27
-51 28 52
-41 28 52
-37 29 50
-42 37 50
-39 38 41
-39 28 41
-40 39 41
-48 50 49
-42 50 48
-47 42 48
-43 42 47
-46 43 47
-46 45 43
-45 44 43
-29 31 30
-32 31 29
-37 32 29
-36 32 37
-33 32 36
-33 36 35
-34 33 35
-
-13 1 27
-27 39 13
-28 29 3
-28 3 2
-29 24 50
-24 29 3
-30 4 29
-29 4 3
-31 4 30
-4 31 5
-32 6 5
-5 31 32
-7 6 32
-7 32 33
-33 34 7
-7 34 8
-8 35 9
-35 8 34
-36 9 35
-9 36 10
-10 37 11
-37 10 36
-12 37 38
-37 12 11
-13 40 14
-13 39 40
-14 41 15
-41 14 40
-16 41 42
-41 16 15
-42 16 37
-11 37 16
-17 16 42
-43 17 42
-17 43 44
-18 17 44
-44 19 18
-19 44 45
-20 45 46
-45 20 19
-20 47 21
-47 20 46
-21 48 22
-48 21 47
-22 49 23
-49 22 48
-23 49 24
-50 24 49
-51 24 50
-24 51 25
-25 52 26
-52 25 51
-27 1 52
-1 26 52
\ No newline at end of file
diff --git a/wmcube/wmcube.cc b/wmcube/wmcube.cc
deleted file mode 100644
index d529026a125d..000000000000
--- a/wmcube/wmcube.cc
+++ /dev/null
@@ -1,695 +0,0 @@
-#include <stdio.h>
-#include <stdexcept>
-#include <sys/types.h>
-#include <dirent.h>
-#include <iostream>
-#include <vector>
-#include <math.h>
-#include <unistd.h>
-
-#include "WmcObject.h"
-#include "wmcube.h"
-
-using namespace std;
-
-/**************************************************
-
- Defines
-
-**************************************************/
-
-#define DEFAULT_WMC_PATH "/usr/share/wmcube"
-#define WMC_REDRAW 2 // centiseconds (= 50 fps)
-#define CANVAS_BGCOLOR 0x202020
-#define CYAN 0x20B2AE
-
-#define WINDOW_NEW 0
-#define WINDOW_CLASSIC 1
-
-// Rotation speed (in radians) for each screen update
-#define ROT_SPEED_X (float)clopt_rspeed * (0.005 + (float)cpu_load / 3000.0)
-#define ROT_SPEED_Y (float)clopt_rspeed * (0.005 + (float)cpu_load / 3500.0)
-#define ROT_SPEED_Z (float)clopt_rspeed * (0.005 + (float)cpu_load / 4000.0)
-
-// Placement for the objects in new/classic mode
-#define XOFF_NEW 27
-#define YOFF_NEW 20
-#define ZOFF_NEW 400
-#define XOFF_CLASSIC XOFF_NEW
-#define YOFF_CLASSIC 27
-#define ZOFF_CLASSIC -ZOFF_NEW
-
-/**************************************************
-
- Function predeclaration
-
-**************************************************/
-
-// Timer and widget callbacks
-void gatherStatistics(const WMApp *a, void *);
-void displayWmcObject(const WMApp *a, WMWidget *w, void *);
-void displayCpuText(const WMApp *a, WMWidget *w, void *);
-void displayCpuMeter(const WMApp *a, WMWidget *w, void *);
-void canvasClicked(const WMApp *a, WMWidget *w, void *);
-
-// Other funcs
-void switchWindow(WmcObject *currentwmc);
-void scanWmcDirectory(const char *dirname);
-char *nextObject();
-char *prevObject();
-void clearCanvas(WMCanvas *canvas);
-bool checkMouseRegion(const WMCanvas *c, int button, int ulx, int uly, int lrx, int lry);
-
-/**************************************************
-
- Global variables
-
-**************************************************/
-
-// "Main" variables
-WMApp wmcube;
-CpuMonitor *cpumon = 0;
-WmcObject *wmc, *wmcnew, *wmcold;
-int cpu_load = 0;
-int switching = 0;
-int xoff = XOFF_NEW, yoff = YOFF_NEW, zoff = ZOFF_NEW;
-
-// A list of available object's filenames and an iterator
-vector <char *> objects;
-vector <char *>::const_iterator obj_iterator;
-
-// Variables for command line options (set to their defaults)
-char *clopt_object = 0;
-int clopt_cpu = -1;
-int clopt_update = 50;
-int clopt_window = WINDOW_NEW;
-float clopt_rspeed = 3;
-bool clopt_nice = true;
-unsigned clopt_fgcolor = CYAN;
-float clopt_shade = 90.0;
-unsigned clopt_bgcolor = CANVAS_BGCOLOR;
-int clopt_invert = false;
-int clopt_mode = SOLID;
-bool clopt_lsource = false;
-bool clopt_wheel = false;
-bool clopt_help = false;
-
-/**************************************************
-
- Main
-
-**************************************************/
-int main(int argc, char *argv[])
-{
- WMApp::initialize(argc, argv);
-
- /**************************************************
-
- Parse command line parameters
-
- ***************************************************/
- int c = 0;
- char clstr[64] = "";
-
- for (int i = 0; i < NUM_CL_OPT; i++)
- {
- clstr[c++] = CL_OPT[i].c;
- if (strlen(CL_OPT[i].parms) > 0) clstr[c++] = ':';
- }
-
- clstr[c] = 0;
-
- while ((c = getopt (argc, argv, clstr)) != -1)
- {
- switch (c)
- {
- case CL_OPT_OBJECT_INT:
- clopt_object = strndup(optarg, 256);
- break;
- case CL_OPT_CPU_INT:
- clopt_cpu = atoi(optarg);
- break;
- case CL_OPT_UPDATE_INT:
- clopt_update = atoi(optarg);
- break;
- case CL_OPT_WINDOW_INT:
- clopt_window = WINDOW_CLASSIC;
- break;
- case CL_OPT_RSPEED_INT:
- clopt_rspeed = atoi(optarg);
- break;
- case CL_OPT_NICE_INT:
- clopt_nice = false;
- break;
- case CL_OPT_FGCOLOR_INT:
- sscanf(optarg, "%x", &clopt_fgcolor);
- //printf("FGCOLOR = 0x%X shade = %.3f\n", clopt_fgcolor, clopt_shade);
- break;
- case CL_OPT_SHADE_INT:
- clopt_shade = atoi(optarg);
- break;
- case CL_OPT_BGCOLOR_INT:
- sscanf(optarg, "%x", &clopt_bgcolor);
- //printf("BGCOLOR = 0x%X\n", clopt_bgcolor);
- break;
- case CL_OPT_INVERT_INT:
- clopt_invert = true;
- break;
- case CL_OPT_MODE_INT:
- clopt_mode = atoi(optarg);
- break;
- case CL_OPT_LSOURCE_INT:
- clopt_lsource = true;
- break;
- case CL_OPT_WHEEL_INT:
- clopt_wheel = true;
- break;
- case CL_OPT_HELP_INT:
- clopt_help = true;
- printUsage();
- break;
- default:
- clopt_help = true;
- printUsage();
- break;
- }
- }
-
-
- /**************************************************
-
- Set up cpu monitor
-
- ***************************************************/
-
- try
- {
-
-#ifdef DARWIN
- cpumon = new CpuMonitor();
-#endif
-
-#ifdef FREEBSD
- cpumon = new CpuMonitor(clopt_nice);
-#endif
-
-#ifdef LINUX
- cpumon = new CpuMonitor(clopt_cpu, clopt_nice);
-#endif
-
-#ifdef NETBSD
- cpumon = new CpuMonitor(clopt_nice);
-#endif
-
-#ifdef OPENBSD
- cpumon = new CpuMonitor();
-#endif
-
-#ifdef SOLARIS
- cpumon = new CpuMonitor(clopt_cpu);
-#endif
-
- }
- catch (exception &e)
- {
- cout << e.what() << endl;
- return -1;
- }
-
- cpumon->setRange(99); // Only two digits fits in text area
-
- /**************************************************
-
- Scan wmc-directory and load (initial) object
-
- **************************************************/
- try
- {
- if (clopt_object == 0)
- {
- scanWmcDirectory(DEFAULT_WMC_PATH);
- wmc = (objects.size() > 0) ? new WmcObject(nextObject()) : new WmcObject();
- }
- else
- {
- scanWmcDirectory(clopt_object);
- wmc = (objects.size() > 0) ? new WmcObject(nextObject()) : new WmcObject(clopt_object);
- }
- }
- catch (exception &e)
- {
- cout << e.what() << endl;
- return -1;
- }
-
- wmc->setColorShading(clopt_fgcolor, clopt_shade);
- wmc->setMode(clopt_mode);
-
- printf("Objects in %s: %d\n", DEFAULT_WMC_PATH, objects.size());
-
- /***********************************************************************
-
- Set up the new style window
-
- ***********************************************************************/
-
- WMWindow nw;
- WMFrame nmain, bottom, botleft, botright;
- WMCanvasCallback ncanvas;
- WMTextBar cpu("00", 0);
- WMMeterBar meter(0, 100);
-
- nw.setpadding(1);
- nw.addchild(nmain);
- nw.addchild(bottom);
- nw.setorientation(Orientation::Vertical);
- nw.setaspectratios(80, 21);
- nw.add_timed_function(clopt_update, gatherStatistics, 0);
- nw.add_timed_function(clopt_update, displayCpuText, &cpu, 0);
- nw.add_timed_function(clopt_update, displayCpuMeter, &meter, 0);
- nw.add_timed_function(WMC_REDRAW, displayWmcObject, &ncanvas, wmc);
-
- ncanvas.addcallback(canvasClicked, &ncanvas, 0);
-
- ncanvas.setbuffered(true);
- meter.setstyle(WMMeterBar::Blue);
-
- //bottom.setpadding(2);
- //bottom.setborder(0);
- nmain.addchild(ncanvas);
- bottom.addchild(botleft);
- bottom.addchild(botright);
- bottom.setorientation(Orientation::Horizontal);
- bottom.setaspectratios(4, 11);
-
- meter.setorientation(Orientation::Horizontal);
-
- botleft.addchild(cpu);
- botright.setorientation(Orientation::Vertical);
- botright.setpadding(2);
- botright.addchild(meter);
-
- /***********************************************************************
-
- Set up the classic style window
-
- ***********************************************************************/
-
- WMWindow cw;
- WMCanvasCallback ccanvas;
-
- cw.setpadding(1);
- cw.addchild(ccanvas);
- cw.setaspectratios(1, 1);
- cw.add_timed_function(clopt_update, gatherStatistics, 0);
- cw.add_timed_function(WMC_REDRAW, displayWmcObject, &ccanvas, wmc);
-
- ccanvas.addcallback(canvasClicked, &ccanvas, 0);
- ccanvas.setbuffered(true);
-
- /***********************************************************************
-
- Ok we're more or less set to go..
-
- ***********************************************************************/
-
- wmcube.addwindow(nw);
- wmcube.addwindow(cw);
-
- // If the user selected to start in classic mode...
- if (clopt_window == WINDOW_CLASSIC)
- {
- // .. we need to tell switchWindow that we currently are in new mode.
- clopt_window = WINDOW_NEW;
- switchWindow(wmc);
- wmcube.run(cw);
- }
- else
- wmcube.run(nw);
-
- delete cpumon;
- delete wmc;
-
- return 0;
-}
-
-/********************************************************************************
-
- void switchWindow(WmcObject *currentwmc)
-
- Switch between new/classic mode.
-
-********************************************************************************/
-void switchWindow(WmcObject *currentwmc)
-{
- //printf("switching windows\n"); fflush(stdout);
-
- if (clopt_window == WINDOW_CLASSIC)
- {
- clopt_window = WINDOW_NEW;
- xoff = XOFF_NEW;
- yoff = YOFF_NEW;
- zoff = ZOFF_NEW;
- }
- else
- {
- clopt_window = WINDOW_CLASSIC;
- xoff = XOFF_CLASSIC;
- yoff = YOFF_CLASSIC;
- zoff = ZOFF_CLASSIC;
- }
-
- wmcube.switch_to(clopt_window);
-
- // Zoom/translate object to fit current canvas size
- currentwmc->modifyZOffset(zoff);
- currentwmc->setYOffset(yoff);
-}
-
-/********************************************************************************
-
- void canvasClicked(const WMApp *a, WMWidget *w, void *)
-
- Event callback for everything that has to do with the canvas that the object(s)
- are being drawn in.
-
-********************************************************************************/
-#define ZOOM_STEP 100
-#define LSOURCE_Z_OFF 10
-
-void canvasClicked(const WMApp *a, WMWidget *w, void *)
-{
- WMCanvas *c = dynamic_cast<WMCanvas *>(w);
- WmcObject *current;
-
- if (!c) return;
-
- current = switching ? wmcnew : wmc;
-
- /*
- Mouse-wheel zoom in and out (unless clopt_wheel == true).
- */
- if (((a->mouseclick().button == Button4) && (!clopt_wheel)) ||
- checkMouseRegion(c, Button1, 47, 12, 65, 48))
- {
- current->modifyZOffset(-ZOOM_STEP);
- return;
- }
- if (((a->mouseclick().button == Button5) && (!clopt_wheel)) ||
- checkMouseRegion(c, Button1, 0, 12, 16, 48))
- {
- current->modifyZOffset( ZOOM_STEP);
- return;
- }
-
- /*
- Switch window mode
- */
- if (checkMouseRegion(c, Button1, 0, 0, 13, 13))
- {
- switchWindow(current);
- return;
- }
-
- /*
- Switch 3d mode
- */
- if ((a->mouseclick().button == Button2) || checkMouseRegion(c, Button1, 15, yoff-10, 48, yoff+10))
- {
- current->setMode(++clopt_mode % NUM_MODES);
- return;
- }
-
- /*
- Change lightsource position with right mouse button
- */
- if (a->mouseclick().button == Button3)
- {
- current->setLightSource(xoff - a->mouseclick().relative_to(c).x,
- yoff - a->mouseclick().relative_to(c).y,
- LSOURCE_Z_OFF);
- return;
- }
-
- /*
- Switch objects (if not already doing so)
- */
- if ((switching == 0) && (objects.size() > 0))
- {
- // Store a pointer to the old object so we can delete it later
- wmcold = wmc;
-
- // Switch object with mousewheel instead of zooming
- if ((a->mouseclick().button == Button4) && clopt_wheel)
- {
- // Scrolling object up with mousewheel
- switching = 1;
- wmcnew = new WmcObject(nextObject());
- }
- else if ((a->mouseclick().button == Button5) && clopt_wheel)
- {
- // Scrolling object down with mousewheel
- switching = -1;
- wmcnew = new WmcObject(prevObject());
- }
- // Switch objects by clicking
- else if (checkMouseRegion(c, Button1, 12, 0, 60, yoff - 5))
- {
- // Scrolling object up by clicking top of canvas
- switching = 1;
- wmcnew = new WmcObject(nextObject());
- }
- else if (checkMouseRegion(c, Button1, 12, yoff + 5, 60, 60))
- {
- // Scrolling object down by clicking bottom of canvas
- switching = -1;
- wmcnew = new WmcObject(prevObject());
- }
-
- if (clopt_window == WINDOW_CLASSIC) wmcnew->modifyZOffset(ZOFF_CLASSIC);
- wmcnew->setColorShading(clopt_fgcolor, clopt_shade);
- wmcnew->setMode(clopt_mode % NUM_MODES);
-
- return;
- }
-}
-
-/********************************************************************************
-
- bool checkMouseRegion(const WMCanvas *c, int button, int ulx, int uly, int lrx, int lry)
-
- ulx = upper left x, go figure on the rest..
-
-********************************************************************************/
-
-bool checkMouseRegion(const WMCanvas *c, int button, int ulx, int uly, int lrx, int lry)
-{
- if ((c->app())->mouseclick().button != button) return false;
- if (((c->app())->mouseclick().relative_to(c).y > lry) ||
- ((c->app())->mouseclick().relative_to(c).y < uly)) return false;
- if (((c->app())->mouseclick().relative_to(c).x < ulx) ||
- ((c->app())->mouseclick().relative_to(c).x > lrx)) return false;
-
- return true;
-}
-
-/********************************************************************************
-
- void displayWmcObject(const WMApp *a, WMWidget *w, void *)
-
- Timer-callback for drawing the object(s) in the canvas that is passed in w.
-
- Defines are for the scroll-in/out-speed of the objects (SCROLL_SPEED) as well
- as the initial displacement from the center for the new object (INITIAL_DISP).
-
- Variable 'switching' take on values -1 (scrolling down), 0 (not switching)
- and 1 (scrolling up).
-
-********************************************************************************/
-#define SCROLL_SPEED 2.0
-#define INITIAL_DISP switching * 2 * yoff
-
-void displayWmcObject(const WMApp *a, WMWidget *w, void *)
-{
- static float yd = 0.0;
- int local_yoff;
- static float mlight = 0.0;
- WMCanvas *c = dynamic_cast<WMCanvas *>(w);
-
- if (!c) return;
-
- clearCanvas(c);
-
- if (switching != 0)
- {
- /*
- We're currently switching objects - do alot of magic.
- Basically we're scrolling 'wmcnew' in from top/bottom
- while simultanously scrolling 'wmc' out.
- */
- yd += SCROLL_SPEED;
- local_yoff = yoff - switching * (int)yd;
-
- wmc->rotate(ROT_SPEED_X, ROT_SPEED_Y, ROT_SPEED_Z);
- wmc->setYOffset(local_yoff);
- wmc->draw(c);
-
- wmcnew->setYOffset(yoff + INITIAL_DISP - switching * (int)yd);
- wmcnew->rotate(ROT_SPEED_X, ROT_SPEED_Y, ROT_SPEED_Z);
- wmcnew->draw(c);
-
- if (yd >= switching * INITIAL_DISP)
- {
- // Finished switching, delete the old object
- switching = 0;
- yd = 0.0;
- mlight = 0.0;
- wmc = wmcnew;
- delete wmcold;
- }
- }
- else
- {
- wmc->rotate(ROT_SPEED_X, ROT_SPEED_Y, ROT_SPEED_Z);
-
- if (clopt_lsource)
- {
- wmc->setLightSource(55.0 * cos(mlight*0.002), 50.0 * sin(mlight*0.040), LSOURCE_Z_OFF);
- mlight += 1.0;
- }
-
- wmc->draw(c);
- }
-
- a->repaint();
-}
-
-/********************************************************************************
-
- void gatherStatistics(const WMApp *a, void *)
-
- Store the polled cpu-load in variable 'cpu_load'
-
-********************************************************************************/
-void gatherStatistics(const WMApp *a, void *)
-{
- cpu_load = (int)cpumon->getLoad();
-}
-
-/********************************************************************************
-
- void displayCpuText(const WMApp *a, WMWidget *w, void *)'
-
- Display the cpu-load in the textbar passed in w.
-
-********************************************************************************/
-void displayCpuText(const WMApp *a, WMWidget *w, void *)
-{
- char tmp[6];
- WMTextBar *b = dynamic_cast<WMTextBar*>(w);
-
- if (!b) return;
-
- sprintf(tmp, "%2d", cpu_load);
- b->settext(tmp);
- a->repaint();
-}
-
-/********************************************************************************
-
- void displayCpuMeter(const WMApp *a, WMWidget *w, void *)
-
- Display the cpu-load in the meterbar passed in w.
-
-********************************************************************************/
-void displayCpuMeter(const WMApp *a, WMWidget *w, void *)
-{
- WMMeterBar *m = dynamic_cast<WMMeterBar *>(w);
-
- if (!m) return;
-
- m->setvalue(cpu_load, true);
- a->repaint();
-}
-
-/********************************************************************************
-
- char *nextObject()
-
- Returns the next objects' filename
-
-********************************************************************************/
-char *nextObject()
-{
- if (obj_iterator == objects.end() - 1)
- obj_iterator = objects.begin();
- else
- obj_iterator++;
-
- //printf("returning next Object = %s\n", *obj_iterator); fflush(stdout);
-
- return *obj_iterator;
-}
-
-/********************************************************************************
-
- char *prevObject()
-
- Returns the previous objects' filename
-
-********************************************************************************/
-char *prevObject()
-{
- if (obj_iterator == objects.begin())
- obj_iterator = objects.end() - 1;
- else
- obj_iterator--;
-
- //printf("returning previous Object = %s\n", *obj_iterator); fflush(stdout);
-
- return *obj_iterator;
-}
-
-/********************************************************************************
-
- int scanWmcDirectory(const char *dirname)
-
- Scans the directory 'dirname' and stores the full pathname of all found
- wmc-files in the global vector 'objects'. This code should be POSIX compliant
- which the old code was not (didnt work on Solaris for example). Objects are
- listed in some seemingly random order (creation time?).
-
-********************************************************************************/
-void scanWmcDirectory(const char *dirname)
-{
- DIR *dir_stream = opendir(dirname);
- struct dirent *dirp;
- char *strp;
-
- if (dir_stream == NULL)
- return; //throw runtime_error("scanWmcDirectory: Could not open directory.");
-
- for (dirp = readdir(dir_stream); dirp != NULL; dirp = readdir(dir_stream))
- {
- if (strstr(dirp->d_name, ".wmc"))
- {
- // Make sure there's space for the dirname, a slash, filename and terminating zero
- strp = new char[strlen(dirname) + strlen(dirp->d_name) + 2];
- strcpy(strp, dirname);
- strcat(strp, "/");
- strcat(strp, dirp->d_name);
- objects.push_back(strp);
- //printf("%s\n", objects[objects.size() - 1]);
- }
- }
-
- obj_iterator = objects.begin();
- closedir(dir_stream);
-}
-
-void clearCanvas(WMCanvas *canvas)
-{
- canvas->setcolor((WMColor::WMColor)clopt_bgcolor);
- canvas->fill_rectangle(0, 0, 54, 54);
- //canvas->draw_vertical_gradient(0,0,53,40, 0x000000, 0x555555);
-}
diff --git a/wmcube/wmcube.h b/wmcube/wmcube.h
deleted file mode 100644
index d9052b535524..000000000000
--- a/wmcube/wmcube.h
+++ /dev/null
@@ -1,118 +0,0 @@
-#ifndef _WMCUBE_HPP_
-#define _WMCUBE_HPP_
-
-#include "wmapp/wmwidget.h"
-#include "wmapp/wmapp.h"
-#include "wmapp/wmwindow.h"
-#include "wmapp/wmframe.h"
-#include "wmapp/wmcanvas.h"
-#include "wmapp/wmmeterbar.h"
-#include "wmapp/wmtextbar.h"
-#include "wmapp/wmcallback.h"
-
-#ifdef DARWIN
-#include "cpumoncc/darwin/CpuMonitor.h"
-#endif
-#ifdef FREEBSD
-#include "cpumoncc/freebsd/CpuMonitor.h"
-#endif
-#ifdef LINUX
-#include "cpumoncc/linux/CpuMonitor.h"
-#endif
-#ifdef NETBSD
-#include "cpumoncc/netbsd/CpuMonitor.h"
-#endif
-#ifdef OPENBSD
-#include "cpumoncc/openbsd/CpuMonitor.h"
-#endif
-#ifdef SOLARIS
-#include "cpumoncc/solaris/CpuMonitor.h"
-#endif
-
-#define WMCUBE_VERSION "0.99-pre1"
-#define WMCUBE_RELDATE "2003-02-28"
-
-typedef struct
-{
- const int c;
- const char *parms;
- const char *desc;
-}
-cl_opt;
-
-#define CL_OPT_OBJECT_INT (int)'o'
-#define CL_OPT_CPU_INT (int)'c'
-#define CL_OPT_UPDATE_INT (int)'u'
-#define CL_OPT_WINDOW_INT (int)'k'
-#define CL_OPT_RSPEED_INT (int)'r'
-#define CL_OPT_NICE_INT (int)'n'
-#define CL_OPT_FGCOLOR_INT (int)'f'
-#define CL_OPT_SHADE_INT (int)'s'
-#define CL_OPT_BGCOLOR_INT (int)'b'
-#define CL_OPT_INVERT_INT (int)'i'
-#define CL_OPT_MODE_INT (int)'m'
-#define CL_OPT_LSOURCE_INT (int)'l'
-#define CL_OPT_WHEEL_INT (int)'w'
-#define CL_OPT_HELP_INT (int)'h'
-
-const cl_opt CL_OPT_OBJECT = { CL_OPT_OBJECT_INT,"filename/directory","load wmc-object or scan a directory for objects"};
-const cl_opt CL_OPT_CPU = { CL_OPT_CPU_INT ,"X","monitor cpu X (starts with 0, default average over all)" };
-const cl_opt CL_OPT_UPDATE = { CL_OPT_UPDATE_INT ,"X","read cpu load every X centiseconds (default 50)" };
-const cl_opt CL_OPT_WINDOW = { CL_OPT_WINDOW_INT,"","start in classic mode" };
-const cl_opt CL_OPT_RSPEED = { CL_OPT_RSPEED_INT ,"X","rotating speed 0-9 (default 3)" };
-const cl_opt CL_OPT_NICE = { CL_OPT_NICE_INT, "","exclude nice processes" };
-const cl_opt CL_OPT_FGCOLOR = { CL_OPT_FGCOLOR_INT,"0xXXXXXX","solid/wireframe color (default CYANish color)" };
-const cl_opt CL_OPT_SHADE = { CL_OPT_SHADE_INT,"X","amount of shading on solid objects 0-100 (default 80)" };
-const cl_opt CL_OPT_BGCOLOR = { CL_OPT_BGCOLOR_INT,"0xXXXXXX","background color (default 0x202020)" };
-const cl_opt CL_OPT_INVERT = { CL_OPT_INVERT_INT, "","invert rotating speed/cpu load relationship" };
-const cl_opt CL_OPT_MODE = { CL_OPT_MODE_INT,"wire/solid/solidwire","default mode for objects with multiple modes" };
-const cl_opt CL_OPT_LSOURCE = { CL_OPT_LSOURCE_INT,"","moving light source (default clickable light source)" };
-const cl_opt CL_OPT_WHEEL = { CL_OPT_WHEEL_INT,"","switch object with mouse wheel (default zoom)" };
-const cl_opt CL_OPT_HELP = { CL_OPT_HELP_INT,"","print help" };
-
-#define NUM_CL_OPT 11
-
-const cl_opt CL_OPT[NUM_CL_OPT] =
-{
- CL_OPT_OBJECT,
- CL_OPT_CPU,
- CL_OPT_UPDATE,
- CL_OPT_WINDOW,
- CL_OPT_RSPEED,
- CL_OPT_NICE,
- CL_OPT_FGCOLOR,
- CL_OPT_SHADE,
- CL_OPT_BGCOLOR,
- //CL_OPT_INVERT,
- //CL_OPT_MODE,
- CL_OPT_LSOURCE,
- //CL_OPT_WHEEL,
- CL_OPT_HELP
-};
-
-void printUsage()
-{
- printf("wmCube %s (%s) (C) Robert Kling 2003\n\n", WMCUBE_VERSION, WMCUBE_RELDATE);
- printf("Usage: wmcube [options]\n\n");
-
- for (int i = 0; i < NUM_CL_OPT; i++)
- {
-
- printf(" -%c %s", CL_OPT[i].c, CL_OPT[i].parms);
- for (int j = 0; j < 22 - strlen(CL_OPT[i].parms); j++) printf(" ");
- printf("%s\n", CL_OPT[i].desc);
- }
-
-// printf("\nThe -c option is only availible on Linux and Solaris.");
-// printf("\nThe -n option is only availible on FreeBSD, Linux and NetBSD.\n\n");
- fflush(stdout);
-}
-
-class WMCanvasCallback : public WMCallback, public WMCanvas
-{
-public:
- WMCanvasCallback() : WMCallback(), WMCanvas() { }
-};
-
-
-#endif
diff --git a/wmcube/wmcube/Makefile b/wmcube/wmcube/Makefile
new file mode 100644
index 000000000000..f0b3d170b382
--- /dev/null
+++ b/wmcube/wmcube/Makefile
@@ -0,0 +1,57 @@
+CC = gcc
+OS = -DLINUX
+
+LIBDIR = -L/usr/X11R6/lib
+LIBDIR = -L/usr/X11R6/lib
+INCDIR = -I/usr/X11R6/share/include
+
+PREFIX = /usr
+BINDIR = $(PREFIX)/bin
+DOCDIR = $(PREFIX)/doc/wmcube-1.0.0
+OBJDIR = $(PREFIX)/share/wmcube
+
+# Edit OSLIBS as appropriate to include OS specific libraries.
+
+OSLIBS =
+LIBS = -lXpm -lXext -lX11 -lm $(OSLIBS)
+CFLAGS = -Wall -O2 $(OS)
+
+OBJS = wmcube.o \
+ ../wmgeneral/wmgeneral.o \
+ ../wmgeneral/misc.o \
+ ../wmgeneral/list.o
+
+.c.o:
+ $(CC) $(CFLAGS) $(INCDIR) -c $< -o $*.o
+
+wmcube: $(OBJS)
+ $(CC) -o wmcube $^ -lXext $(LIBDIR) $(LIBS)
+
+all:: wmcube
+
+clean::
+ for i in $(OBJS) ; do \
+ rm -f $$i ; \
+ done
+ rm -f wmcube
+ rm -f *~
+
+install:: wmcube
+ cp -f wmcube $(BINDIR)
+ chmod 755 $(BINDIR)/wmcube
+ chown root:root $(BINDIR)/wmcube
+ mkdir -p $(DOCDIR)
+ cp -p ../CHANGES ../COPYING ../INSTALL ../README $(DOCDIR)
+ cp -pr ../3D-objects $(DOCDIR)
+ mkdir -p $(OBJDIR)
+ cp -p ../3D-objects/* $(OBJDIR)
+ @echo "wmcube installation finished..."
+
+uninstall::
+ rm -f $(BINDIR)/wmcube
+ rm -f $(DOCDIR)/3D-objects/*
+ if [ -d $(DOCDIR)/3D-objects ]; then rmdir $(DOCDIR)/3D-objects; fi
+ rm -f $(DOCDIR)/*
+ if [ -d $(DOCDIR) ]; then rmdir $(DOCDIR); fi
+ rm -f $(OBJDIR)/*
+ if [ -d $(OBJDIR) ]; then rmdir $(OBJDIR); fi
diff --git a/wmcube/wmcube/Makefile.FREEBSD b/wmcube/wmcube/Makefile.FREEBSD
new file mode 100644
index 000000000000..9bc78bcc28ee
--- /dev/null
+++ b/wmcube/wmcube/Makefile.FREEBSD
@@ -0,0 +1,57 @@
+CC = gcc
+OS = -DFREEBSD
+
+LIBDIR = -L/usr/X11R6/lib
+LIBDIR = -L/usr/X11R6/lib
+INCDIR = -I/usr/X11R6/include
+
+PREFIX = /usr
+BINDIR = $(PREFIX)/bin
+DOCDIR = $(PREFIX)/doc/wmcube-1.0.0
+OBJDIR = $(PREFIX)/share/wmcube
+
+# Edit OSLIBS as appropriate to include OS specific libraries.
+
+OSLIBS = -lkvm
+LIBS = -lXpm -lXext -lX11 -lm $(OSLIBS)
+CFLAGS = -Wall -O2 $(OS)
+
+OBJS = wmcube.o \
+ ../wmgeneral/wmgeneral.o \
+ ../wmgeneral/misc.o \
+ ../wmgeneral/list.o
+
+.c.o:
+ $(CC) $(CFLAGS) $(INCDIR) -c $< -o $*.o
+
+wmcube: $(OBJS)
+ $(CC) -o wmcube $(OBJS) -lXext $(LIBDIR) $(LIBS)
+
+all:: wmcube
+
+clean::
+ for i in $(OBJS) ; do \
+ rm -f $$i ; \
+ done
+ rm -f wmcube
+ rm -f *~
+
+install:: wmcube
+ cp -f wmcube $(BINDIR)
+ chmod 755 $(BINDIR)/wmcube
+ chown root:root $(BINDIR)/wmcube
+ mkdir -p $(DOCDIR)
+ cp -p ../CHANGES ../COPYING ../INSTALL ../README $(DOCDIR)
+ cp -pr ../3D-objects $(DOCDIR)
+ mkdir -p $(OBJDIR)
+ cp -p ../3D-objects/* $(OBJDIR)
+ @echo "wmcube installation finished..."
+
+uninstall::
+ rm -f $(BINDIR)/wmcube
+ rm -f $(DOCDIR)/3D-objects/*
+ if [ -d $(DOCDIR)/3D-objects ]; then rmdir $(DOCDIR)/3D-objects; fi
+ rm -f $(DOCDIR)/*
+ if [ -d $(DOCDIR) ]; then rmdir $(DOCDIR); fi
+ rm -f $(OBJDIR)/*
+ if [ -d $(OBJDIR) ]; then rmdir $(OBJDIR); fi
diff --git a/wmcube/wmcube/Makefile.LINUX b/wmcube/wmcube/Makefile.LINUX
new file mode 100644
index 000000000000..f0b3d170b382
--- /dev/null
+++ b/wmcube/wmcube/Makefile.LINUX
@@ -0,0 +1,57 @@
+CC = gcc
+OS = -DLINUX
+
+LIBDIR = -L/usr/X11R6/lib
+LIBDIR = -L/usr/X11R6/lib
+INCDIR = -I/usr/X11R6/share/include
+
+PREFIX = /usr
+BINDIR = $(PREFIX)/bin
+DOCDIR = $(PREFIX)/doc/wmcube-1.0.0
+OBJDIR = $(PREFIX)/share/wmcube
+
+# Edit OSLIBS as appropriate to include OS specific libraries.
+
+OSLIBS =
+LIBS = -lXpm -lXext -lX11 -lm $(OSLIBS)
+CFLAGS = -Wall -O2 $(OS)
+
+OBJS = wmcube.o \
+ ../wmgeneral/wmgeneral.o \
+ ../wmgeneral/misc.o \
+ ../wmgeneral/list.o
+
+.c.o:
+ $(CC) $(CFLAGS) $(INCDIR) -c $< -o $*.o
+
+wmcube: $(OBJS)
+ $(CC) -o wmcube $^ -lXext $(LIBDIR) $(LIBS)
+
+all:: wmcube
+
+clean::
+ for i in $(OBJS) ; do \
+ rm -f $$i ; \
+ done
+ rm -f wmcube
+ rm -f *~
+
+install:: wmcube
+ cp -f wmcube $(BINDIR)
+ chmod 755 $(BINDIR)/wmcube
+ chown root:root $(BINDIR)/wmcube
+ mkdir -p $(DOCDIR)
+ cp -p ../CHANGES ../COPYING ../INSTALL ../README $(DOCDIR)
+ cp -pr ../3D-objects $(DOCDIR)
+ mkdir -p $(OBJDIR)
+ cp -p ../3D-objects/* $(OBJDIR)
+ @echo "wmcube installation finished..."
+
+uninstall::
+ rm -f $(BINDIR)/wmcube
+ rm -f $(DOCDIR)/3D-objects/*
+ if [ -d $(DOCDIR)/3D-objects ]; then rmdir $(DOCDIR)/3D-objects; fi
+ rm -f $(DOCDIR)/*
+ if [ -d $(DOCDIR) ]; then rmdir $(DOCDIR); fi
+ rm -f $(OBJDIR)/*
+ if [ -d $(OBJDIR) ]; then rmdir $(OBJDIR); fi
diff --git a/wmcube/wmcube/Makefile.NETBSD b/wmcube/wmcube/Makefile.NETBSD
new file mode 100644
index 000000000000..874553b2f6e8
--- /dev/null
+++ b/wmcube/wmcube/Makefile.NETBSD
@@ -0,0 +1,55 @@
+CC = gcc
+OS = -DNETBSD
+
+LIBDIR = -L/usr/X11R6/lib -L./libdocapp/
+
+# Edit OSLIBS as appropriate to include OS specific libraries.
+
+OSLIBS =
+LIBS = -lXpm -lXext -lX11 -lm $(OSLIBS)
+CFLAGS = -Wall -I/usr/X11R6/include -O2 $(OS)
+
+PREFIX = /usr
+BINDIR = $(PREFIX)/bin
+DOCDIR = $(PREFIX)/doc/wmcube-1.0.0
+OBJDIR = $(PREFIX)/share/wmcube
+
+OBJS = wmcube.o \
+ ../wmgeneral/wmgeneral.o \
+ ../wmgeneral/misc.o \
+ ../wmgeneral/list.o
+
+.c.o:
+ $(CC) $(CFLAGS) $(INCDIR) -c $< -o $*.o
+
+wmcube: $(OBJS)
+ $(CC) -o wmcube -lXext $(LIBDIR) $(LIBS) $(OBJS)
+
+all:: wmcube
+
+clean::
+ for i in $(OBJS) ; do \
+ rm -f $$i ; \
+ done
+ rm -f wmcube
+ rm -f *~
+
+install:: wmcube
+ cp -f wmcube $(BINDIR)
+ chmod 755 $(BINDIR)/wmcube
+ chown root:root $(BINDIR)/wmcube
+ mkdir -p $(DOCDIR)
+ cp -p ../CHANGES ../COPYING ../INSTALL ../README $(DOCDIR)
+ cp -pr ../3D-objects $(DOCDIR)
+ mkdir -p $(OBJDIR)
+ cp -p ../3D-objects/* $(OBJDIR)
+ @echo "wmcube installation finished..."
+
+uninstall::
+ rm -f $(BINDIR)/wmcube
+ rm -f $(DOCDIR)/3D-objects/*
+ if [ -d $(DOCDIR)/3D-objects ]; then rmdir $(DOCDIR)/3D-objects; fi
+ rm -f $(DOCDIR)/*
+ if [ -d $(DOCDIR) ]; then rmdir $(DOCDIR); fi
+ rm -f $(OBJDIR)/*
+ if [ -d $(OBJDIR) ]; then rmdir $(OBJDIR); fi
diff --git a/wmcube/wmcube/Makefile.OPENBSD b/wmcube/wmcube/Makefile.OPENBSD
new file mode 100644
index 000000000000..7313e9bb1d60
--- /dev/null
+++ b/wmcube/wmcube/Makefile.OPENBSD
@@ -0,0 +1,56 @@
+CC = gcc
+OS = -DOPENBSD
+
+LIBDIR = -L/usr/X11R6/lib -L./libdocapp/
+
+# Edit OSLIBS as appropriate to include OS specific libraries.
+
+OSLIBS =
+LIBS = -lXpm -lXext -lX11 -lm $(OSLIBS)
+INCLUDES = -I/usr/X11R6/include
+CFLAGS = -Wall -O2 $(OS) $(INCLUDES)
+
+PREFIX = /usr
+BINDIR = $(PREFIX)/bin
+DOCDIR = $(PREFIX)/doc/wmcube-1.0.0
+OBJDIR = $(PREFIX)/share/wmcube
+
+OBJS = wmcube.o \
+ ../wmgeneral/wmgeneral.o \
+ ../wmgeneral/misc.o \
+ ../wmgeneral/list.o
+
+.c.o:
+ $(CC) $(CFLAGS) $(INCDIR) -c $< -o $*.o
+
+wmcube: $(OBJS)
+ $(CC) -o wmcube $^ -lXext $(LIBDIR) $(LIBS) $>
+
+all:: wmcube
+
+clean::
+ for i in $(OBJS) ; do \
+ rm -f $$i ; \
+ done
+ rm -f wmcube
+ rm -f *~
+
+install:: wmcube
+ cp -f wmcube $(BINDIR)
+ chmod 755 $(BINDIR)/wmcube
+ chown root:root $(BINDIR)/wmcube
+ mkdir -p $(DOCDIR)
+ cp -p ../CHANGES ../COPYING ../INSTALL ../README $(DOCDIR)
+ cp -pr ../3D-objects $(DOCDIR)
+ mkdir -p $(OBJDIR)
+ cp -p ../3D-objects/* $(OBJDIR)
+ @echo "wmcube installation finished..."
+
+uninstall::
+ rm -f $(BINDIR)/wmcube
+ rm -f $(DOCDIR)/3D-objects/*
+ if [ -d $(DOCDIR)/3D-objects ]; then rmdir $(DOCDIR)/3D-objects; fi
+ rm -f $(DOCDIR)/*
+ if [ -d $(DOCDIR) ]; then rmdir $(DOCDIR); fi
+ rm -f $(OBJDIR)/*
+ if [ -d $(OBJDIR) ]; then rmdir $(OBJDIR); fi
diff --git a/wmcube/wmcube/Makefile.SOLARIS b/wmcube/wmcube/Makefile.SOLARIS
new file mode 100644
index 000000000000..f0c4c14f4213
--- /dev/null
+++ b/wmcube/wmcube/Makefile.SOLARIS
@@ -0,0 +1,57 @@
+CC = gcc
+OS = -DSOLARIS
+
+LIBDIR = -L/usr/X11R6/lib
+LIBDIR = -L/usr/openwin/lib -L/opt/sfw/lib -L/usr/local/lib -R/usr/openwin/lib -R/opt/sfw/lib -R/usr/local/lib
+INCDIR = -I/usr/openwin/include -I/opt/sfw/include -I/usr/local/include
+
+PREFIX = /usr
+BINDIR = $(PREFIX)/bin
+DOCDIR = $(PREFIX)/doc/wmcube-1.0.0
+OBJDIR = $(PREFIX)/share/wmcube
+
+# Edit OSLIBS as appropriate to include OS specific libraries.
+
+OSLIBS = -lkstat
+LIBS = -lXpm -lXext -lX11 -lm $(OSLIBS)
+CFLAGS = -Wall -O2 $(OS)
+
+OBJS = wmcube.o \
+ ../wmgeneral/wmgeneral.o \
+ ../wmgeneral/misc.o \
+ ../wmgeneral/list.o
+
+.c.o:
+ $(CC) $(CFLAGS) $(INCDIR) -c $< -o $*.o
+
+wmcube: $(OBJS)
+ $(CC) -o wmcube $^ -lXext $(LIBDIR) $(LIBS)
+
+all:: wmcube
+
+clean::
+ for i in $(OBJS) ; do \
+ rm -f $$i ; \
+ done
+ rm -f wmcube
+ rm -f *~
+
+install:: wmcube
+ cp -f wmcube $(BINDIR)
+ chmod 755 $(BINDIR)/wmcube
+ chown root:root $(BINDIR)/wmcube
+ mkdir -p $(DOCDIR)
+ cp -p ../CHANGES ../COPYING ../INSTALL ../README $(DOCDIR)
+ cp -pr ../3D-objects $(DOCDIR)
+ mkdir -p $(OBJDIR)
+ cp -p ../3D-objects/* $(OBJDIR)
+ @echo "wmcube installation finished..."
+
+uninstall::
+ rm -f $(BINDIR)/wmcube
+ rm -f $(DOCDIR)/3D-objects/*
+ if [ -d $(DOCDIR)/3D-objects ]; then rmdir $(DOCDIR)/3D-objects; fi
+ rm -f $(DOCDIR)/*
+ if [ -d $(DOCDIR) ]; then rmdir $(DOCDIR); fi
+ rm -f $(OBJDIR)/*
+ if [ -d $(OBJDIR) ]; then rmdir $(OBJDIR); fi
diff --git a/wmcube/wmcube/wmcube.c b/wmcube/wmcube/wmcube.c
new file mode 100644
index 000000000000..28ceb1e9f039
--- /dev/null
+++ b/wmcube/wmcube/wmcube.c
@@ -0,0 +1,1430 @@
+/*
+
+ wmcube.c
+
+ Version 1.0.0 (2014-11-26)
+ Cezary M. Kruk <c.k...@bigfoot.com>
+ http://linux-bsd-unix.strefa.pl
+
+ Versions 0.98 (2000-10-23)
+ Robert Kling <robk...@student.luth.se>
+ http://boombox.campus.luth.se/projects.php
+
+ Contributions:
+ -n option patch by Thorsten Jens (th...@et-inf.fho-emden.de) (2000-05-12)
+ Various bugfixes and optimizations by Jakob Borg (2000-05-13)
+ Solaris Port by Dan Price (d...@rampant.org) (2000-07-16)
+ OpenBSD Port by Brian Joseph Czapiga (r...@godsey.net) (2000-07-19)
+ FreeBSD Port by Tai-hwa Liang (ava...@mmlab.cse.yzu.edu.tw) (2000-07-20)
+ NetBSD Port by Jared Smolens <jsmo...@andrew.cmu.edu> (2000-09-23)
+
+ This software is licensed through the GNU General Public Licence.
+
+ See http://www.BenSinclair.com/dockapp/ for more wm dock apps.
+
+ If you want to port wmcube to another OS the system specific code is
+ sectioned the bottom of this file. See instructions there.
+
+*/
+
+#define WMCUBE_VERSION "1.0.0"
+#define REV_YEAR "2014"
+#define REV_DATE "2014-11-26"
+#define WMCUBE_OLDVERSION "0.98"
+#define OLDREV_YEAR "2000"
+#define OLDREV_DATE "2000-10-23"
+#include "wmcubered.xpm"
+#include "wmcubegreen.xpm"
+#include "wmcubeblue.xpm"
+#include "wmcubecyan.xpm"
+#include "wmcubemagenta.xpm"
+#include "wmcubeyellow.xpm"
+char wmcube_mask_bits[64*64];
+int wmcube_mask_width = 64;
+int wmcube_mask_height = 64;
+
+#define CHAR_WIDTH 5
+#define CHAR_HEIGHT 7
+#define PI 3.1415926535
+
+//**** Graphics ***********************************
+
+void putpixel(int x, int y, int c);
+void line(int x1, int y1, int x2, int y2, int c);
+void hline(int x1, int x2, int y, int c);
+void triangle(int x1, int y1, int x2, int y2, int x3, int y3, int c);
+void BlitString(char *name, int x, int y);
+void BlitNum(int num, int x, int y);
+void clearscr();
+void draw();
+void set_plugin();
+void startup_seq();
+int red = 0;
+int green = 0;
+int blue = 0;
+int font = 0;
+
+int but_stat = -1;
+
+float lum_vector[3] = { 0, 0, 100 }; // Lightsource vector
+
+#ifdef FREEBSD
+static kvm_t *kd;
+static struct nlist nlst[] = { {"_cp_time"}, {0} };
+#endif
+
+ char obj_filename[256];
+ char *plugin = {""};
+
+int main(int argc, char **argv)
+{
+ int j, i = 0, rot_speed = 0, cpu_usage = 0, rot_step = 1;
+ long screen_speed = 10000; // microseconds between screen updates (approx.)
+ long cpu_update = 490000; // microseconds between cpu update (approx.)
+ int loop = 0;
+ XEvent Event;
+
+ char *rotdiv = {"25"};
+ char *rotstep = {"1"};
+ int rot;
+ int cube_color = 1;
+ int c = 0;
+ int invert_speed = 0;
+
+ pname = strrchr(argv[0], '/');
+ if (pname == NULL) pname = argv[0];
+
+ srand((unsigned)time(NULL));
+ opterr = 0;
+
+ while ((c = getopt (argc, argv, "o:d:r:c:fnbipRGBh")) != -1) {
+ switch (c)
+ {
+ case 'o':
+ plugin = optarg;
+ break;
+ case 'd':
+ rotstep = optarg;
+ break;
+ case 'r':
+ rotdiv = optarg;
+ break;
+ case 'c':
+ which_cpu = atoi(optarg);
+ break;
+ case 'f':
+ font = 40;
+ break;
+ case 'n':
+ use_nice = 0;
+ break;
+ case 'b':
+ cube_color = 2;
+ break;
+ case 'i':
+ invert_speed = 1;
+ break;
+ case 'p':
+ show_load = 0;
+ break;
+ case 'R':
+ red = 1;
+ break;
+ case 'G':
+ green = 1;
+ break;
+ case 'B':
+ blue = 1;
+ break;
+ case 'h':
+ print_help();
+ return 1;
+ case '?':
+ print_help();
+ return 1;
+ default:
+ abort();
+ }
+ }
+
+ set_plugin();
+
+ /*
+ * Validate that wmcube can run on this system given the parameters,
+ * then setup the statistics gathering subsystem.
+ */
+
+ if (init_calc_cpu() != 0) die();
+
+ /*
+ * Scan directory for .wmc files and choose one randomly. If the user
+ * specified a particular file, load that one.
+ */
+
+#ifndef SOLARIS // scan4objects doesnt work on Solaris, load object immediatly
+ scan4objects(obj_filename);
+
+ if (nof_objects != 0)
+ next_object();
+ else
+#endif
+ setupobj(obj_filename);
+
+ /*
+ * Various initializion stuff for the 3d-engine etc.
+ */
+
+ setUpAngles();
+
+ rot = atoi(rotdiv);
+ if ((rot >= 1) && (rot <=100)) ; else rot = 25;
+
+ rot_step = atoi(rotstep);
+ if (rot_step < 0) rot_step = -rot_step;
+
+ if (calc_cpu_total() == -1) die();
+
+ cpu_update /= screen_speed;
+
+ if ((red == 0) && (green == 0) && (blue == 0)) {
+ createXBMfromXPM(wmcube_mask_bits, wmcube_xpm, wmcube_mask_width, wmcube_mask_height);
+ openXwindow(argc, argv, wmcube_xpm, wmcube_mask_bits, wmcube_mask_width, wmcube_mask_height);
+ } else if ((red == 1) && (green == 0) && (blue == 0)) {
+ createXBMfromXPM(wmcube_mask_bits, wmcubered_xpm, wmcube_mask_width, wmcube_mask_height);
+ openXwindow(argc, argv, wmcubered_xpm, wmcube_mask_bits, wmcube_mask_width, wmcube_mask_height);
+ } else if ((red == 0) && (green == 1) && (blue == 0)) {
+ createXBMfromXPM(wmcube_mask_bits, wmcubegreen_xpm, wmcube_mask_width, wmcube_mask_height);
+ openXwindow(argc, argv, wmcubegreen_xpm, wmcube_mask_bits, wmcube_mask_width, wmcube_mask_height);
+ } else if ((red == 0) && (green == 0) && (blue == 1)) {
+ createXBMfromXPM(wmcube_mask_bits, wmcubeblue_xpm, wmcube_mask_width, wmcube_mask_height);
+ openXwindow(argc, argv, wmcubeblue_xpm, wmcube_mask_bits, wmcube_mask_width, wmcube_mask_height);
+ } else if ((red == 1) && (green == 1) && (blue == 0)) {
+ createXBMfromXPM(wmcube_mask_bits, wmcubeyellow_xpm, wmcube_mask_width, wmcube_mask_height);
+ openXwindow(argc, argv, wmcubeyellow_xpm, wmcube_mask_bits, wmcube_mask_width, wmcube_mask_height);
+ } else if ((red == 0) && (green == 1) && (blue == 1)) {
+ createXBMfromXPM(wmcube_mask_bits, wmcubecyan_xpm, wmcube_mask_width, wmcube_mask_height);
+ openXwindow(argc, argv, wmcubecyan_xpm, wmcube_mask_bits, wmcube_mask_width, wmcube_mask_height);
+ } else if ((red == 1) && (green == 0) && (blue == 1)) {
+ createXBMfromXPM(wmcube_mask_bits, wmcubemagenta_xpm, wmcube_mask_width, wmcube_mask_height);
+ openXwindow(argc, argv, wmcubemagenta_xpm, wmcube_mask_bits, wmcube_mask_width, wmcube_mask_height);
+ } else if ((red == 1) && (green == 1) && (blue == 1)) {
+ createXBMfromXPM(wmcube_mask_bits, wmcube_xpm, wmcube_mask_width, wmcube_mask_height);
+ openXwindow(argc, argv, wmcube_xpm, wmcube_mask_bits, wmcube_mask_width, wmcube_mask_height);
+ }
+
+ startup_seq();
+
+ if (calc_cpu_total() == -1) die();
+
+ // index, left, top, right, bottom
+ AddMouseRegion(1, 45, 45, 58, 58); // + Zoom In
+ AddMouseRegion(5, 5, 45, 20, 58); // - Zoom Out
+ AddMouseRegion(3, 21, 45, 45, 58); // Show cpu-load
+ AddMouseRegion(2, 5, 5, 55, 45); // Everywhere else (almost) to change object
+
+ /*
+ * Main loop begins here
+ */
+
+ while (1)
+ {
+ i = (i+rot_speed+rot_step) % 360;
+
+ clearscr();
+
+ rotate(i,i,i);
+ draw(cube_color);
+
+ if (show_load) {
+ BlitNum(cpu_usage,24,49);
+ BlitString("%",38,49);
+ }
+
+ RedrawWindow();
+
+ if (loop++ == cpu_update) {
+ loop = 0;
+
+ /*
+ break;
+ case ButtonPress:
+ j = CheckMouseRegion(Event.xbutton.x, Event.xbutton.y);
+ but_stat = j;
+
+ break;
+ case ButtonRelease:
+ j = CheckMouseRegion(Event.xbutton.x, Event.xbutton.y);
+
+ switch(j)
+ {
+ case 1:
+ if (zoff > 750) {
+ BlitString("ö",48,48);
+ RedrawWindow();
+ zoff -= 150;
+ }
+ break;
+
+ case 2:
+ next_object();
+ break;
+
+ case 3:
+ if (show_load == 1) show_load = 0; else show_load = 1;
+ ycenter = 15 - 2*show_load;
+ break;
+
+ case 5:
+ BlitString("ä",11,49);
+ RedrawWindow();
+ zoff += 150;
+ break;
+ }
+ }
+ break;
+ }
+ usleep(screen_speed);
+ }
+
+ /*
+ * Free up memory used by the object (dirty...)
+ */
+
+ free(matrix);
+ free(rmatrix);
+ free(cline);
+
+ return 1;
+}
+
+//**** Graphics ***********************************
+//*************************************************
+
+void set_plugin()
+{
+ strcpy(obj_filename,plugin);
+ if (access (obj_filename, R_OK) == -1) {
+ strcpy(obj_filename,"/usr/share/wmcube/");
+ strcat(obj_filename,plugin);
+ }
+}
+
+void startup_seq()
+{
+ char *tmp = malloc(32);
+ int oldzoff = 3600;
+
+ sprintf(tmp,"%s",WMCUBE_VERSION);
+{
+ int i;
+
+ if (planesORlines) {
+
+ sortz(nofplanes);
+ for (i = 0; i < nofplanes; i++) {
+ if (normal(rmatrix[planes[zorder[i]][0]], rmatrix[planes[zorder[i]][1]], rmatrix[planes[zorder[i]][2]]) > 0) {
+
+ triangle(xcenter+rmatrix[planes[zorder[i]][0]][0], ycenter+rmatrix[planes[zorder[i]][0]][1],
+ xcenter+rmatrix[planes[zorder[i]][1]][0], ycenter+rmatrix[planes[zorder[i]][1]][1],
+ xcenter+rmatrix[planes[zorder[i]][2]][0], ycenter+rmatrix[planes[zorder[i]][2]][1], plane_color[zorder[i]]);
+ }
+ }
+
+ } else {
+ if (y3<y2)
+ {
+ tmp1=y2;
+ y2=y3;
+ y3=tmp1;
+ tmp1=x2;
+ x2=x3;
+ x3=tmp1;
+ }
+
+ if (y2<y1)
+ {
+ tmp1=y1;
+ y1=y2;
+ y2=tmp1;
+ tmp1=x1;
+ x1=x2;
+ x2=tmp1;
+ }
+
+ if (y3<y2)
+ {
+ tmp1=y2;
+ y2=y3;
+ y3=tmp1;
+ tmp1=x2;
+ x2=x3;
+ x3=tmp1;
+ }
+
+// Blits a string at given co-ordinates
+void BlitString(char *name, int x, int y)
+{
+ int i;
+ int c;
+ int k;
+
+ k = x;
+
+ copyXPMArea(73,64,1,8,k-1,y);
+
+ for (i=0; name[i]; i++)
+ {
+ c = toupper(name[i]);
+ //printf("%c",c);
+
+ if (c >= '0' && c<= '9')
+ { // its a number or symbol
+ c -= '0';
+ if ( k > -2) copyXPMArea(c * 6, 64 + font, 6, 9, k, y);
+ k += 6;
+ } else
+ if (c >= 'A' && c <= 'Z')
+ { // its a letter
+ c -= 'A';
+ if ( k > -2) copyXPMArea(c * 6, 74 + font, 6, 9, k, y);
+ k += 6;
+ } else
+ if (c == '.') {
+ if ( k > -2) copyXPMArea(60, 64 + font, 6, 9, k, y);
+ k += 6;
+ } else
+ if (c == '%') {
+ if ( k > -2) copyXPMArea(66, 64 + font, 6, 9, k, y);
+ k += 6;
+ } else
+ if (c == 246) {
+ if ( k > -2) copyXPMArea(0, 84 + font, 6, 9, k, y);
+ k += 6;
+ } else
+ if (c == 228) {
+ if ( k > -2) copyXPMArea(6, 84 + font, 6, 9, k, y);
+ k += 6;
+ } else
+ { // its a blank or something else
+ if ( k > -2) copyXPMArea(73, 64 + font, 6, 9, k, y);
+ k += 6;
+ }
+ if (k >= 58) break;
+ }
+ copyXPMArea(73, 64 + font, 1, 9, k, y);
+
+}
+
+// Blits number to given coordinates.. two 0's, right justified
+
+void BlitNum(int num, int x, int y)
+{
+ char buf[1024];
+ int newx=x;
+
+ if (num > 99)
+ {
+ newx -= CHAR_WIDTH;
+ }
+
+ if (num > 999)
+ {
+ }
+ else
+ {
+ numpixels = deltay + 1;
+ d = (deltax << 1) - deltay;
+ dinc1 = deltax << 1;
+ dinc2 = (deltax - deltay) << 1;
+ xinc1 = 0;
+ xinc2 = 1;
+ yinc1 = 1;
+ yinc2 = 1;
+ }
+ if (x1 > x2)
+ {
+ xinc1 = - xinc1;
+ xinc2 = - xinc2;
+ }
+ if (y1 > y2)
+ {
+ yinc1 = - yinc1;
+ yinc2 = - yinc2;
+ }
+ x = x1;
+ y = y1;
+ for (i=1; i<numpixels; i++)
+ {
+ putpixel(x, y, c);
+ if (d < 0)
+ {
+ d = d + dinc1;
+ x = x + xinc1;
+ y = y + yinc1;
+ }
+ else
+ {
+ d = d + dinc2;
+ x = x + xinc2;
+ y = y + yinc2;
+ }
+ }
+}
+
+
+//**** 3d specific ********************************
+//*************************************************
+
+void rotate(int xang, int yang, int zang)
+{
+ float tx, ty, tz;
+ int i;
+
+ for (i = 0; i < nofcoords; i++)
+ {
+ tx = cost[yang]*matrix[i][0]-sint[yang]*matrix[i][2];
+ tz = sint[yang]*matrix[i][0]+cost[yang]*matrix[i][2];
+ ty = cost[zang]*matrix[i][1]-sint[zang]*tx;
+
+ rmatrix[i][0] = (cost[zang]*tx+sint[zang]*matrix[i][1]);
+ rmatrix[i][1] = (sint[xang]*tz+cost[xang]*ty);
+ rmatrix[i][2] = (cost[xang]*tz-sint[xang]*ty);
+ }
+
+ if (planesORlines)
+ for (i = 0; i < nofplanes; i++)
+ if (normal(rmatrix[planes[i][0]], rmatrix[planes[i][1]], rmatrix[planes[i][2]]) > 0)
+ plane_color[i] = luminate(rmatrix[planes[i][0]], rmatrix[planes[i][1]], rmatrix[planes[i][2]]);
+
+ for (i = 0; i < nofcoords; i++) {
+ // Perspective correcting lines...
+ rmatrix[i][0] = (rmatrix[i][0] *256) / (2*rmatrix[i][2] - zoff) + xcenter;
+ rmatrix[i][1] = (rmatrix[i][1] *256) / (2*rmatrix[i][2] - zoff) + ycenter;
+ }
+}
+
+
+void sortz(int nofelements) { // Insertion-sort the planes in increasing z-distance
+
+ int i, j, k;
+ float key;
+ float temparr[nofelements];
+
+ for (i = 0; i < nofelements; i++)
+ {
+ zorder[i] = i;
+ temparr[i] = rmatrix[planes[i][0]][2]+rmatrix[planes[i][1]][2]+rmatrix[planes[i][2]][2];
+ }
+
+ for (j = 1; j < nofelements; j++) {
+
+ key = temparr[j];
+ k = zorder[j];
+ i = j - 1;
+
+ while ((i > -1) && (temparr[i] > key)) {
+ temparr[i+1] = temparr[i];
+ zorder[i+1] = zorder[i];
+ i--;
+ }
+
+ zorder[i+1] = k;
+ temparr[i+1] = key;
+ }
+}
+
+int normal(float p1[], float p2[], float p3[])
+{
+ return ((p1[0]-p3[0])*(p2[1]-p3[1])-(p2[0]-p3[0])*(p1[1]-p3[1]));
+}
+
+int luminate(float p1[], float p2[], float p3[])
+{
+ double x1 = (float)(p1[0]-p3[0]), y1 = (float)(p1[1]-p3[1]), z1 = (float)(p1[2]-p3[2]);
+ double x2 = (float)(p2[0]-p3[0]), y2 = (float)(p2[1]-p3[1]), z2 = (float)(p2[2]-p3[2]);
+ double nx = y1*z2-y2*z1, ny =-(x1*z2-x2*z1),nz = x1*y2-y1*x2;
+
+ return (int)(53 * (acost[(int)(50 + 50*(nx*lum_vector[0]+ny*lum_vector[1]+nz*lum_vector[2])/
+ (sqrt(nx*nx+ny*ny+nz*nz)*
+ sqrt(lum_vector[0]*lum_vector[0]+lum_vector[1]*lum_vector[1]+
+ lum_vector[2]*lum_vector[2])))] / PI));
+
+ // Do I smell optimization? :-)
+}
+
+void setUpAngles()
+{
+ int i;
+ for (i = 0; i < 361; i++) {
+ cost[i] = cos((double)i*(2*PI/(double)360));
+ sint[i] = sin((double)i*(2*PI/(double)360));
+ }
+
+ for (i = 0; i < 100; i++) acost[i] = acos((double)(-50+i)/50);
+}
+
+void setupobj(char *filename)
+{
+ int i, j = 0;
+ int biggest = 0;
+ float scale = 1;
+
+ xcenter = 16;
+ ycenter = 15 - 2*show_load;
+
+ if (strcmp(filename,"") != 0)
+ loadobj(filename);
+ else
+ {
+ nofcoords = 8;
+ noflines = 24;
+ nofplanes = 12;
+ planesORlines = 1;
+
+ matrix = (float **)malloc(nofcoords*sizeof(float *)); mem_alloc_error(matrix);
+ planes = (int **)malloc(nofplanes*sizeof(int *)); mem_alloc_error(planes);
+ plane_color = (int *)malloc(nofplanes*sizeof(int)); mem_alloc_error(plane_color);
+ zorder = (int *)malloc(nofplanes*sizeof(int)); mem_alloc_error(zorder);
+
+ for (i = 0; i < nofplanes; i++) zorder[i] = i;
+
+ for (i = 0; i < nofcoords; i++) {
+ matrix[i] = (float *)malloc(3*sizeof(float));
+ mem_alloc_error(matrix[i]);
+ }
+
+ for (i = 0; i < nofplanes; i++) {
+ planes[i] = (int *)malloc(3*sizeof(int));
+ mem_alloc_error(planes[i]);
+ }
+
+ cline = (int *)malloc((noflines+1)*sizeof(int)); mem_alloc_error(cline);
+
+ matrix[0][0] = -180; matrix[0][1] = -180; matrix[0][2] = 180; // 0
+ matrix[1][0] = 180; matrix[1][1] = -180; matrix[1][2] = 180; // 1
+ matrix[2][0] = 180; matrix[2][1] = 180; matrix[2][2] = 180; // 2
+ matrix[3][0] = -180; matrix[3][1] = 180; matrix[3][2] = 180; // 3
+ matrix[4][0] = -180; matrix[4][1] = -180; matrix[4][2] = -180; // 4
+ matrix[5][0] = 180; matrix[5][1] = -180; matrix[5][2] = -180; // 5
+ matrix[6][0] = 180; matrix[6][1] = 180; matrix[6][2] = -180; // 6
+ matrix[7][0] = -180; matrix[7][1] = 180; matrix[7][2] = -180; // 7
+
+ cline[0] = 1; cline[1] = 2;
+ cline[2] = 2; cline[3] = 3;
+ cline[4] = 3; cline[5] = 4;
+ cline[6] = 4; cline[7] = 1;
+ cline[8] = 5; cline[9] = 6;
+ cline[10] = 6; cline[11] = 7;
+ cline[12] = 7; cline[13] = 8;
+ cline[14] = 8; cline[15] = 5;
+ cline[16] = 1; cline[17] = 5;
+ cline[18] = 2; cline[19] = 6;
+ cline[20] = 3; cline[21] = 7;
+ cline[22] = 4; cline[23] = 8;
+
+ planes[0][0] = 0; planes[0][1] = 1; planes[0][2] = 3;
+ planes[1][0] = 1; planes[1][1] = 2; planes[1][2] = 3;
+ planes[2][0] = 1; planes[2][1] = 5; planes[2][2] = 6;
+ planes[3][0] = 1; planes[3][1] = 6; planes[3][2] = 2;
+
+ planes[4][0] = 4; planes[4][1] = 0; planes[4][2] = 3;
+ planes[5][0] = 4; planes[5][1] = 3; planes[5][2] = 7;
+ planes[6][0] = 3; planes[6][1] = 2; planes[6][2] = 7;
+ planes[7][0] = 7; planes[7][1] = 2; planes[7][2] = 6;
+
+ planes[8][0] = 4; planes[8][1] = 1; planes[8][2] = 0;
+ planes[9][0] = 4; planes[9][1] = 5; planes[9][2] = 1;
+ planes[10][0] = 5; planes[10][1] = 4; planes[10][2] = 7;
+ planes[11][0] = 5; planes[11][1] = 7; planes[11][2] = 6;
+ }
+
+ rmatrix = (float **)realloc(rmatrix,nofcoords*sizeof(float *)); mem_alloc_error(rmatrix);
+ for (i = 0; i < nofcoords; i++) {
+ rmatrix[i] = (float *)malloc(3*sizeof(float));
+ mem_alloc_error(rmatrix[i]);
+ }
+
+ /*
+ * Find the longest discance between all coordinates relative to the origin
+ */
+
+ for (i = 0; i < nofcoords; i++) {
+ j = (int)sqrt((pow(matrix[i][0],2)+pow(matrix[i][1],2)+pow(matrix[i][2],2)));
+ if (j > biggest) biggest = j;
+ }
+
+ /*
+ * Scale every coordinate using the calculated factor
+ */
+
+ scale = 280 / (float)biggest;
+
+ for (i = 0; i < nofcoords; i++) {
+ matrix[i][0] *= scale;
+ matrix[i][1] *= scale;
+ matrix[i][2] *= scale;
+ }
+}
+
+
+
+
+//**** Application Management, I/O etc. ***********
+//*************************************************
+
+void print_help() {
+ printf("\nwmcube %s (C) %s Cezary M. Kruk (%s)\n", WMCUBE_VERSION, REV_YEAR, REV_DATE);
+ printf("wmCube %s (C) %s Robert Kling (%s)\n\n", WMCUBE_OLDVERSION, OLDREV_YEAR, OLDREV_DATE);
+
+ printf(" Usage: wmcube [-o <filename>] [-drcfnbipRGBh]\n\n");
+
+ printf(" -o <filename> : load external 3D object (plugin).\n\n");
+ printf(" -d x : rotate x degrees/step when the CPU is idle (default 1).\n");
+ printf(" -r x : rotate 1 degree faster every x percent of the CPU usage (default 25).\n");
+
+#ifdef LINUX
+ printf(" -c x : which CPU (0, 1, 2...) to monitor (default average over all).\n");
+ printf(" -f : use smooth font (default OFF).\n");
+ printf(" -n : exclude \"nice\" processes (default OFF).\n");
+#endif
+
+#ifdef SOLARIS
+ printf(" -c x : which CPU (0, 1, 2...) to monitor (default average over all).\n");
+ printf(" -f : use smooth font (default OFF).\n");
+#endif
+
+#ifdef FREEBSD
+ printf(" -f : use smooth font (default OFF).\n");
+ printf(" -n : exclude \"nice\" processes (default OFF).\n");
+#endif
+
+#ifdef NETBSD
+ printf(" -f : use smooth font (default OFF).\n");
+ printf(" -n : exclude \"nice\" processes (default OFF).\n");
+#endif
+
+ printf(" -b : draw the cube in a brighter color (default OFF).\n");
+ printf(" -i : invert cube speed (default OFF).\n");
+ printf(" -p : do not display the CPU load (default OFF).\n");
+ printf(" -R : use red image.\n");
+ printf(" -G : use green image.\n");
+ printf(" -B : use blue image.\n");
+ printf(" -h : display this help.\n\n");
+}
+
+ if (nof_objects == 0) return -1;
+ setupobj(objects[rand() % (nof_objects )]);
+
+ return 0;
+}
+
+
+int loadobj(char *filename) {
+
+ FILE *fp;
+ char tmp[64] = {""};
+ int i = 0;
+
+ //printf("\nLoading file %s...",filename); fflush(stdout);
+
+ if ((fp = fopen(filename,"rt")) == NULL) {
+ printf("\nERROR: wmcube object-file not found (%s).\n\n",filename);
+ exit(0);
+ }
+
+ fscanf(fp,"%s",tmp);
+
+ if (strcmp(tmp,"WMCUBE_COORDINATES") != 0) {
+ printf("\nError in objectfile: it must start with WMCUBE_COORDINATES\n\n");
+ fclose(fp);
+ exit(0);
+ }
+
+ fscanf(fp,"%s",tmp);
+
+ while ((strcmp(tmp,"WMCUBE_LINES") != 0) && (strcmp(tmp,"WMCUBE_PLANES") != 0)) {
+
+ matrix = (float **)realloc(matrix,(i+1)*sizeof(float *)); mem_alloc_error(matrix);
+ matrix[i] = (float *)malloc(3*sizeof(float)); mem_alloc_error(matrix[i]);
+ fscanf(fp,"%f %f %f",&matrix[i][0],&matrix[i][1],&matrix[i][2]);
+ //printf("\n%d: %f %f %f",atoi(tmp), matrix[i][0],matrix[i][1],matrix[i][2]);
+
+ if (atoi(tmp) != (++i)) {
+
+ printf("\nError in objectfile (WMCUBE_COORDINATES section):\n"
+ "the coordinates must be listed in order 1..n\n\n");
+ fclose(fp);
+ exit(0);
+ }
+ fscanf(fp,"%s",tmp);
+
+ if (feof(fp)) {
+ printf("\nError in objectfile: you must have a section WMCUBE_LINES or WMCUBE_PLANES\n\n");
+ fclose(fp);
+ exit(0);
+ }
+ }
+
+ nofcoords = i;
+ i = 0;
+
+ if (strcmp(tmp,"WMCUBE_LINES") == 0) {
+
+ planesORlines = 0;
+ while (1) {
+
+ cline = (int *)realloc(cline,(i+2)*sizeof(int)); mem_alloc_error(cline);
+ fscanf(fp,"%d %d",&cline[i],&cline[i+1]);
+ i += 2;
+ if (planes[i][0] > nofcoords || planes[i][1] > nofcoords || planes[i][2] > nofcoords) {
+ printf("\nError in objectfile (WMCUBE_PLANES section):\n"
+ "coordinates %d or/and %d or/and %d doesnt exist\n\n",planes[i][0],planes[i][1],planes[i][2]);
+ fclose(fp);
+ exit(0);
+ }
+ i++;
+ }
+ nofplanes = i;
+ plane_color = (int *)malloc(nofplanes*sizeof(int)); mem_alloc_error(plane_color);
+ zorder = (int *)malloc(nofplanes*sizeof(int)); mem_alloc_error(zorder);
+ for (i = 0; i < nofplanes; i++) zorder[i] = i;
+
+ } else {
+ printf("\nError in objectfile: you must have a section WMCUBE_LINES or WMCUBE_PLANES\n\n");
+ fclose(fp);
+ exit(0);
+ }
+
+ fclose(fp);
+ * init_calc_cpu doesn't have much to do on Linux, but it can check to see if
+ * /proc/stat is available; if the user selected to monitor a particular CPU,
+ * it can check it's existence.
+ */
+int init_calc_cpu()
+{
+ FILE *fp;
+ int i;
+ char cpuid[6];
+ char check_cpu[6];
+
+ sprintf(check_cpu, "cpu%d", which_cpu);
+
+ if ((fp = fopen("/proc/stat","rb")) == NULL) {
+ perror("/proc/stat required for this system");
+ return -1;
+ }
+
+ if (which_cpu == -1)
+ return 0;
+
+ for (i = -2; i < which_cpu; i++) {
+ fscanf(fp, "%s", cpuid);
+ }
+
+ if (strcmp(check_cpu,cpuid) != 0) {
+ fprintf(stderr, "ERROR: could not read cpu-load on %s. Are you "
+ "sure you have an SMP system?\n",check_cpu);
+ return -1;
+ }
+ return (0);
+}
+
+int calc_cpu_total() {
+ int total, used, t=0, i;
+ static int previous_total = 0, previous_used = 0;
+ char cpuid[6];
+ int cpu,nice,system,idle;
+ FILE *fp;
+
+ fp = fopen("/proc/stat","rt");
+
+ for (i = -2; i < which_cpu; i++) {
+ fscanf(fp,"%s %d %d %d %d",cpuid,&cpu,&nice,&system,&idle);
+ }
+
+ fclose(fp);
+
+ used = cpu + system + use_nice*nice;
+ total = used + idle + (1-use_nice)*nice;
+
+ t = 100 * (double)(used - previous_used) / (double)(total - previous_total);
+ previous_total = total;
+ previous_used = used;
+
+ return t;
+}
+
+#elif defined SOLARIS
+#include <sys/types.h>
+#include <sys/sysinfo.h>
+#include <kstat.h>
+
+static kstat_ctl_t *kc;
+static kstat_t **cpu_ksp_list;
+static kstat_t *the_cpu;
+static int ncpus;
+
+/*
+ * The biggest subtlety of the Solaris port is that init_calc_cpu can be called
+ * after the initial program setup. This occurs when a 'kstat state change'
+ * occurs. Usually this means that a CPU has been taken on or off-line using
+ * the psradm command. Another possibility is that on server systems, a new
+ * CPU might have been hot-added to a running system.
+ *
+ * As a result, init_calc_cpu frees any resources it might have setup if needed,
+ * and reinitializes everything.
+ */
+int init_calc_cpu()
+{
+ kstat_t *ksp;
+ int i = 0;
+
+ if (kc == NULL) {
+ if ((kc = kstat_open()) == NULL) {
+ fprintf(stderr, "wmcube: can't open /dev/kstat\n");
+ return -1;
+ }
+ }
+
+ if (which_cpu != -1) {
+ /*
+ * User selected to monitor a particlur CPU. find it...
+ */
+ for (ksp = kc->kc_chain; ksp; ksp = ksp->ks_next) {
+ if ((strcmp(ksp->ks_module, "cpu_stat") == 0) &&
+ (ksp->ks_instance == which_cpu)) {
+ the_cpu = ksp;
+ break;
+ }
+ }
+ if (the_cpu == NULL) {
+ fprintf(stderr, "CPU %d not found\n", which_cpu);
+ return -1;
+ }
+ } else {
+ /*
+ * User selected to monitor all CPUs. First, count them.
+ */
+ for (ksp = kc->kc_chain; ksp; ksp = ksp->ks_next) {
+ if (strcmp(ksp->ks_module, "cpu_stat") == 0)
+ i++;
+ }
+
+ if (cpu_ksp_list) {
+ free(cpu_ksp_list);
+ }
+ cpu_ksp_list = (kstat_t **) calloc(i * sizeof (kstat_t *), 1);
+ ncpus = i;
+
+ /*
+ * stash the ksp for each CPU.
+ */
+ i = 0;
+ for (ksp = kc->kc_chain; ksp; ksp = ksp->ks_next) {
+ if (strcmp(ksp->ks_module, "cpu_stat") == 0) {
+ cpu_ksp_list[i] = ksp;
+ i++;
+ }
+ }
+ }
+ return 0;
+}
+
+int calc_cpu_total()
+{
+ int i;
+ cpu_stat_t stat;
+ static int previous_total = 0, previous_used = 0;
+ int used, total, t, user = 0, wait = 0, kern = 0, idle = 0;
+
+ /*
+ * Read each cpu's data. If the kstat chain has changed (a state change
+ * has happened, maybe a new cpu was added to the system or one went
+ * away), then reinitialize everything with init_calc_cpu(). Finally,
+ * recursively call calc_cpu_total.
+ *
+ * We'll need to do a little better than this in the future, since we
+ * could recurse too much in the pathological case here.
+ */
+ if (which_cpu == -1) {
+ for (i = 0; i < ncpus; i++) {
+ if (kstat_read(kc, cpu_ksp_list[i],
+ (void *)&stat) == -1) {
+ if (init_calc_cpu() != 0) {
+ fprintf(stderr, "failed to "
+ "reinitialize following state "
+ "change\n");
+ return (-1);
+ }
+ return (calc_cpu_total());
+ }
+ user += stat.cpu_sysinfo.cpu[CPU_USER]; /* user */
+ wait += stat.cpu_sysinfo.cpu[CPU_WAIT]; /* io wait */
+ kern += stat.cpu_sysinfo.cpu[CPU_KERNEL]; /* sys */
+ idle += stat.cpu_sysinfo.cpu[CPU_IDLE]; /*idle("free")*/
+ }
+ } else {
+ if (kstat_read(kc, the_cpu, (void *)&stat) == -1) {
+ if (init_calc_cpu() != 0) {
+ fprintf(stderr, "failed to reinitialize "
+ "following state change\n");
+ return (-1);
+ }
+ return (calc_cpu_total());
+ }
+ user += stat.cpu_sysinfo.cpu[CPU_USER]; /* user */
+ wait += stat.cpu_sysinfo.cpu[CPU_WAIT]; /* io wait */
+ kern += stat.cpu_sysinfo.cpu[CPU_KERNEL]; /* sys */
+ idle += stat.cpu_sysinfo.cpu[CPU_IDLE]; /* idle("free") */
+ }
+
+ used = user + wait + kern;
+ total = used + idle;
+ t = 100 * (double)(used - previous_used) /
+ (double)(total - previous_total);
+ previous_total = total;
+ previous_used = used;
+ return (t);
+}
+
+#elif defined FREEBSD
+#include <nlist.h>
+#include <fcntl.h>
+#include <sys/dkstat.h>
+
+int init_calc_cpu()
+{
+
+ if ((kd = kvm_open(NULL, NULL, NULL, O_RDONLY, "kvm_open")) == NULL)
+ {
+ printf("\nError: unable to open kvm\n\n");
+ exit(0);
+ }
+ kvm_nlist(kd, nlst);
+ if (nlst[0].n_type == 0)
+ {
+ printf("\nError: unable to get nlist\n\n");
+ exit(1);
+ }
+
+ return 0;
+}
+
+int calc_cpu_total() {
+ int total, used, t=0;
+ static int previous_total = 0, previous_used = 0;
+ int cpu,nice,system,idle;
+ unsigned long int cpu_time[CPUSTATES];
+
+ if (kvm_read(kd, nlst[0].n_value, &cpu_time, sizeof(cpu_time))
+ != sizeof(cpu_time))
+ {
+ printf("\nError reading kvm\n\n");
+ exit(0);
+ }
+
+ cpu = cpu_time[CP_USER];
+ nice = cpu_time[CP_NICE];
+ system = cpu_time[CP_SYS];
+ idle = cpu_time[CP_IDLE];
+
+ used = cpu + system + use_nice*nice;
+ total = used + idle + (1-use_nice)*nice;
+
+ t = 100 * (double)(used - previous_used) / (double)(total - previous_total);
+ previous_total = total;
+ previous_used = used;
+
+ return t;
+}
+
+#elif defined OPENBSD
+
+int init_calc_cpu()
+{
+ return 0;
+}
+
+int calc_cpu_total() {
+ double avenrun[3];
+
+ (void) getloadavg(avenrun, sizeof(avenrun) / sizeof(avenrun[0]));
+ return(((5.0*avenrun[0] + 0.5) > 50) ? 50 : (5.0*avenrun[0] + 0.5))*2;
+}
+
+
+#elif defined NETBSD /* END OPENBSD */
+#include <sys/sched.h>
+#include <sys/sysctl.h>
+
+int init_calc_cpu ()
+{
+ return 0;
+}
+
+int calc_cpu_total ()
+{
+ static u_int64_t last_cp_time[CPUSTATES] = { 0, 0, 0, 0, 0 };
+ u_int64_t curr_cp_time[CPUSTATES];
+ u_int64_t total_time = 0, idle_time = 0;
+ int mib[2];
+ int i;
+ size_t ssize;
+ const int IDLE_TIME = 4;
+ const int NICE_TIME = 1;
+
+ ssize = sizeof ( curr_cp_time );
+ mib[0] = CTL_KERN;
+ mib[1] = KERN_CP_TIME;
+ if ( sysctl ( mib, 2, curr_cp_time, &ssize, NULL, 0 ) ) {
+ fprintf ( stderr, "wmcube: unable to read CP_TIME from sysctl()\n" );
+ exit ( 0 );
+ }
+ if ( !use_nice )
+ curr_cp_time[NICE_TIME] = 0;
+
+ /* NetBSD gives 5 CPUSTATES -
+ * User, Nice, System, Interrupt, Idle
+ */
+ idle_time = curr_cp_time[IDLE_TIME] - last_cp_time[IDLE_TIME];
+ for ( i = 0; i < CPUSTATES; i++ ) {
+ total_time += ( curr_cp_time[i] - last_cp_time[i] );
+ last_cp_time[i] = curr_cp_time[i];
+ }
+
+ /* Calculate the % CPU usage as the User+Nice+System+Interrupt/Total
+ * for the interval
+ */
+ return ( 100 * (int) ( total_time - idle_time ) / total_time );
+
+}
+
+#else /* END NETBSD */
+
+/*
+ * This is a stub which will compile for platforms other than LINUX or SOLARIS.
+ * Use these to start your port to a new platform.
+ */
+int init_calc_cpu()
+{
+ return 0;
+}
+
+int calc_cpu_total()
+{
+ return 0;
+}
+
+#endif /* OS SPECIFIC CODE */
diff --git a/wmcube/wmcube/wmcube.xpm b/wmcube/wmcube/wmcube.xpm
new file mode 100644
index 000000000000..04e92689d410
--- /dev/null
+++ b/wmcube/wmcube/wmcube.xpm
@@ -0,0 +1,174 @@
+/* XPM */
+static char * wmcube_xpm[] = {
+"160 133 38 1",
+" c #0000FF",
+". c #000000",
+"o c #808080",
+"O c #C0C0C0",
+"+ c #808080",
+"@ c #B40404",
+"# c #ACACAC",
+"$ c #383838",
+"% c #F4F4F4",
+"& c #404040",
+"! c #8C8C8C",
+"A c #A8A8A8",
+"B c #A4A4A4",
+"C c #A0A0A0",
+"D c #9C9C9C",
+"E c #989898",
+"F c #949494",
+"G c #909090",
+"H c #8C8C8C",
+"I c #888888",
+"J c #848484",
+"K c #808080",
+"L c #7C7C7C",
+"M c #767676",
+"N c #747474",
+"P c #707070",
+"Q c #6C6C6C",
+"R c #686868",
+"S c #646464",
+"T c #606060",
+"U c #5C5C5C",
+"V c #585858",
+"W c #545454",
+"Y c #505050",
+"Z c #4C4C4C",
+"1 c #484848",
+"2 c #444444",
+"3 c #404040",
+" ...................................................................... O!",
+" .............o.......................................................o ",
+" .............o.......................................................o ",
+" .............o.......................................................o ",
+" ........................................................ .............o.......................................................o ",
+" .......................................................o .............o.......................................................o ",
+" .......................................................o .............o.......................................................o..........................",
+" .......................................................o .............o.......................................................o..........................",
+" .......................................................o .............o.......................................................o..........................",
+" .......................................................o .............o.......................................................o..........................",
+" .......................................................o .............o.......................................................o..........................",
+" .......................................................o .............o.......................................................o..........................",
+" .......................................................o .............o.......................................................o..........................",
+" .......................................................o .............o.......................................................o..........................",
+" .......................................................o .............o.......................................................o..........................",
+" .......................................................o .............o.......................................................o..........................",
+" .......................................................o .............o.......................................................o..........................",
+" .......................................................o .............o.......................................................o..........................",
+" .......................................................o .............o.......................................................o..........................",
+" .......................................................o .............o.......................................................o..........................",
+" .......................................................o .............o.......................................................o..........................",
+" .......................................................o .............o.......................................................o..........................",
+" .......................................................o .............o.......................................................o..........................",
+" .......................................................o .............o.......................................................o..........................",
+" .......................................................o .............o.......................................................o..........................",
+" .......................................................o .............o.......................................................o..........................",
+" .......................................................o .............o.......................................................o..........................",
+" .......................................................o .............o.......................................................o..........................",
+" .......................................................o .............o.......................................................o..........................",
+" .......................................................o .............o.......................................................o..........................",
+" .......................................................o .............o.......................................................o..........................",
+" .......................................................o .............o.......................................................o..........................",
+" .......................................................o .............o.......................................................o..........................",
+" .......................................................o .............o.......................................................o..........................",
+" .......................................................o .............o.......................................................o..........................",
+" .......................................................o .............o.......................................................o..........................",
+" .......................................................o .............o.......................................................o..........................",
+" .......................................................o .............o.......................................................o..........................",
+" .......................................................o .............o.......................................................o..........................",
+" .......................................................o .............o.......................................................o..........................",
+" .......................................................o .............o.......................................................o..........................",
+" .......................................................o .............o.......................................................o..........................",
+" .......................................................o .............o.......................................................o..........................",
+" .......................................................o .............o.......................................................o..........................",
+" .......................................................o .............o.......................................................o..........................",
+" .......................................................o .............o.......................................................o..........................",
+" .......................................................o .............o...............................................&&......o..........................",
+" .......................................................o .............o...............................................&&......o..........................",
+" .......................................................o .............o......&&&&&&.................................&&&&&&....o..........................",
+" .......................................................o .............o......&&&&&&.................................&&&&&&....o..........................",
+" .......................................................o .............o...............................................&&......o..........................",
+" .......................................................o .............o...............................................&&......o..........................",
+" .......................................................o .............o.......................................................o..........................",
+" .......................................................o .............o.......................................................o..........................",
+" .......................................................o .............o.......................................................o..........................",
+" .......................................................o oooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo..........................",
+" .......................................................o . OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO",
+" .......................................................o . AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA",
+" .......................................................o . BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB",
+" oooooooooooooooooooooooooooooooooooooooooooooooooooooooo . CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC",
+" . EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE",
+" . FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF",
+" . GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGG",
+" . HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHH",
+".............................................................................. IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII",
+"..OOO.....+..+OOO+.+OOO+.+...+.+OOO+.+OOO+.+OOO+.+OOO+.+OOO+.......OO.O....... JJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJ",
+".O...O....O......O.....O.O...O.O.....O.........O.O...O.O...O.......OO.O....... KKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKK",
+".O...O....O......O.....O.O...O.O.....O.........O.O...O.O...O.........O........ LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLL",
+".+...+....+..+OOO+..OOO+.+OOO+.+OOO+.+OOO+.....+.&OOO&.+OOO+.........O........ MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM",
+".O...O....O..O.........O.....O.....O.O...O.....O.O...O.....O.........O........ NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNN",
+".O...O....O..O.........O.....O.....O.O...O.....O.O...O.....O...O....O.OO...... PPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPP",
+"..OOO.....O..+OOO+.+OOO+.....+.+OOO+.+OOO+.....+.+OOO+.+OOO+...+....O.OO...... QQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQ",
+".............................................................................. RRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRR",
+" SSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSS",
+"............................................................................................................................................................ ",
+".&OOO&.+OOO..+OOO+.+OOO..+OOO+.+OOO+.+OOO+.+...+...+.......+.+...+.+.....O...O.+OOO..+OOO+.+OOO+.+OOO+.+OOO+.+OOO+.+OOO+.+...+.+...+.+...+.+...+.+...+.+OOO+ ",
+".O...O.O...O.O.....O...O.O.....O.....O.....O...O...O.......O.O...O.O.....OO.OO.O...O.O...O.O...O.O...O.O...O.O.......O...O...O.O...O.O...O.O...O.O...O.....O ",
+".O...O.O...O.O.....O...O.O.....O.....O.....O...O...O.......O.O..O..O.....O.O.O.O...O.O...O.O...O.O...O.O...O.O.......O...O...O.O...O.O...O..O.O..O...O.....O ",
+".+OOO+.+OOO..+.....+...+.+OOO..+OOO..+.OO+.+OOO+...+.......+.+OO&..+.....+...+.+...+.+...+.+OOO+.+O..+.+OOO..+OOO+...+...+...+.+...+.+...+..&O&..+OOO+.+OOO+ ",
+".O...O.O...O.O.....O...O.O.....O.....O...O.O...O...O.......O.O..O..O.....O...O.O...O.O...O.O.....O.O.O.O...O.....O...O...O...O.O+.+O.O.O.O..O.O......O.O.... ",
+".O...O.O...O.O.....O...O.O.....O.....O...O.O...O...O.......O.O...O.O.....O...O.O...O.O...O.O.....O..OO.O...O.....O...O...O...O..O+O..OO.OO.O...O.....O.O.... ",
+".+...+.+OOO..+OOO+.OOOO..+OOO+.O.....+OOO+.+...+...O...+OOO+.+...+.+OOO&.+...+.O...O.+OOO+.+.....+OOO+.+...+.+OOO+...+...&OOOO...O...O...O.+...O.+OOO+.+OOO+ ",
+"............................................................................................................................................................ ",
+" TTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTT",
+"............. UUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUU",
+"...++........ VVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV",
+"...++........ WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWW",
+".++++++++++++ YYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYY",
+".++++++++++++ ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ",
+"...++........ 11111111111111111111111111111111111111111111111111111111",
+"...++........ 22222222222222222222222222222222222222222222222222222222",
+"............. 33333333333333333333333333333333333333333333333333333333",
+"............. ",
+" ",
+" ",
+" ",
+" ",
+" ",
+" ",
+" ",
+" ",
+" ",
+" ",
+" ",
+".............................................................................. ",
+"..OOO.....O...OOO..OOOOO.....O.OOOOO..OOO..OOOOO..OOO...OOO........OO.O....... ",
+".O...O...OO..O...O....O.....OO.O.....O........O..O...O.O...O.......OO.O....... ",
+".O..OO....O......O...OO....O.O.OOOO..O........O..O...O.O...O.........O........ ",
+".O.O.O....O.....O......O..O..O.O...O.OOOO....O....OOO...OOOO.........O........ ",
+".OO..O....O....O.......O.OOOOO.....O.O...O...O...O...O.....O.........O........ ",
+".O...O....O...O....O...O.....O.O...O.O...O..O....O...O.....O........O.OO...... ",
+"..OOO.....O..OOOOO..OOO......O..OOO...OOO...O.....OOO...OOO....O....O.OO...... ",
+".............................................................................. ",
+" ",
+"............................................................................................................................................................ ",
+"...O...OOOO...OOO..OOOO..OOOOO.OOOOO..OOO..O...O...O.......O.O...O.O.....O...O.O...O..OOO..OOOO...OOO..OOOO...OOO..OOOOO.O...O.O...O.O...O.O...O.O...O.OOOOO ",
+"..O.O..O...O.O...O.O...O.O.....O.....O...O.O...O...O.......O.O..O..O.....OO.OO.O...O.O...O.O...O.O...O.O...O.O...O...O...O...O.O...O.O...O.O...O.O...O.....O ",
+".O...O.O...O.O.....O...O.O.....O.....O.....O...O...O.......O.O.O...O.....O.O.O.OO..O.O...O.O...O.O...O.O...O.O.......O...O...O.O...O.O...O..O.O...O.O.....O. ",
+".OOOOO.OOOO..O.....O...O.OOOO..OOOO..O..OO.OOOOO...O.......O.OO....O.....O...O.O.O.O.O...O.OOOO..O...O.OOOO...OOO....O...O...O.O...O.O...O...O.....O.....O.. ",
+".O...O.O...O.O.....O...O.O.....O.....O...O.O...O...O.......O.O.O...O.....O...O.O..OO.O...O.O.....O...O.O.O.......O...O...O...O.O...O.O.O.O..O.O....O....O... ",
+".O...O.O...O.O...O.O...O.O.....O.....O...O.O...O...O...O...O.O..O..O.....O...O.O...O.O...O.O.....O...O.O..O..O...O...O...O...O..O.O..OO.OO.O...O...O...O.... ",
+".O...O.OOOO...OOO..OOOO..OOOOO.O......OOO..O...O...O....OOO..O...O.OOOOO.O...O.O...O..OOO..O......OOO..O...O..OOO....O....OOO....O...O...O.O...O...O...OOOOO ",
+"....................................................................................................O....................................................... ",
+" ",
+"............. ",
+"...++........ ",
+"...++........ ",
+".++++++++++++ ",
+".++++++++++++ ",
+"...++........ ",
+"...++........ ",
+"............. ",
+"............. "};
diff --git a/wmcube/wmcube/wmcubeblue.xpm b/wmcube/wmcube/wmcubeblue.xpm
new file mode 100644
index 000000000000..19e4a1efbda5
--- /dev/null
+++ b/wmcube/wmcube/wmcubeblue.xpm
@@ -0,0 +1,168 @@
+/* XPM */
+static char * wmcubeblue_xpm[] = {
+"160 133 32 1",
+" c #0000FF",
+"+ c #000000",
+"@ c #005ED2",
+"# c #004BA8",
+"$ c #808080",
+"% c #00264A",
+"& c #005DD0",
+"* c #0056CC",
+"= c #0059C8",
+"- c #0050BE",
+"; c #004EB8",
+"> c #0050B4",
+", c #004EAE",
+"' c #00417E",
+") c #0048A2",
+"! c #00469C",
+"~ c #004396",
+"{ c #004090",
+"] c #003F8C",
+"^ c #003C86",
+"/ c #003980",
+"( c #00377A",
+"_ c #003474",
+": c #003570",
+"< c #00316E",
+"[ c #002E68",
+"} c #002C62",
+"| c #00275C",
+"1 c #00295C",
+"2 c #002758",
+"3 c #002552",
+"4 c #00234E",
+" ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ @#",
+" +++++++++++++$+++++++++++++++++++++++++++++++++++++++++++++++++++++++$ ",
+" +++++++++++++$+++++++++++++++++++++++++++++++++++++++++++++++++++++++$ ",
+" +++++++++++++$+++++++++++++++++++++++++++++++++++++++++++++++++++++++$ ",
+" ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ +++++++++++++$+++++++++++++++++++++++++++++++++++++++++++++++++++++++$ ",
+" +++++++++++++++++++++++++++++++++++++++++++++++++++++++$ +++++++++++++$+++++++++++++++++++++++++++++++++++++++++++++++++++++++$ ",
+" +++++++++++++++++++++++++++++++++++++++++++++++++++++++$ +++++++++++++$+++++++++++++++++++++++++++++++++++++++++++++++++++++++$++++++++++++++++++++++++++",
+" +++++++++++++++++++++++++++++++++++++++++++++++++++++++$ +++++++++++++$+++++++++++++++++++++++++++++++++++++++++++++++++++++++$++++++++++++++++++++++++++",
+" +++++++++++++++++++++++++++++++++++++++++++++++++++++++$ +++++++++++++$+++++++++++++++++++++++++++++++++++++++++++++++++++++++$++++++++++++++++++++++++++",
+" +++++++++++++++++++++++++++++++++++++++++++++++++++++++$ +++++++++++++$+++++++++++++++++++++++++++++++++++++++++++++++++++++++$++++++++++++++++++++++++++",
+" +++++++++++++++++++++++++++++++++++++++++++++++++++++++$ +++++++++++++$+++++++++++++++++++++++++++++++++++++++++++++++++++++++$++++++++++++++++++++++++++",
+" +++++++++++++++++++++++++++++++++++++++++++++++++++++++$ +++++++++++++$+++++++++++++++++++++++++++++++++++++++++++++++++++++++$++++++++++++++++++++++++++",
+" +++++++++++++++++++++++++++++++++++++++++++++++++++++++$ +++++++++++++$+++++++++++++++++++++++++++++++++++++++++++++++++++++++$++++++++++++++++++++++++++",
+" +++++++++++++++++++++++++++++++++++++++++++++++++++++++$ +++++++++++++$+++++++++++++++++++++++++++++++++++++++++++++++++++++++$++++++++++++++++++++++++++",
+" +++++++++++++++++++++++++++++++++++++++++++++++++++++++$ +++++++++++++$+++++++++++++++++++++++++++++++++++++++++++++++++++++++$++++++++++++++++++++++++++",
+" +++++++++++++++++++++++++++++++++++++++++++++++++++++++$ +++++++++++++$+++++++++++++++++++++++++++++++++++++++++++++++++++++++$++++++++++++++++++++++++++",
+" +++++++++++++++++++++++++++++++++++++++++++++++++++++++$ +++++++++++++$+++++++++++++++++++++++++++++++++++++++++++++++++++++++$++++++++++++++++++++++++++",
+" +++++++++++++++++++++++++++++++++++++++++++++++++++++++$ +++++++++++++$+++++++++++++++++++++++++++++++++++++++++++++++++++++++$++++++++++++++++++++++++++",
+" +++++++++++++++++++++++++++++++++++++++++++++++++++++++$ +++++++++++++$+++++++++++++++++++++++++++++++++++++++++++++++++++++++$++++++++++++++++++++++++++",
+" +++++++++++++++++++++++++++++++++++++++++++++++++++++++$ +++++++++++++$+++++++++++++++++++++++++++++++++++++++++++++++++++++++$++++++++++++++++++++++++++",
+" +++++++++++++++++++++++++++++++++++++++++++++++++++++++$ +++++++++++++$+++++++++++++++++++++++++++++++++++++++++++++++++++++++$++++++++++++++++++++++++++",
+" +++++++++++++++++++++++++++++++++++++++++++++++++++++++$ +++++++++++++$+++++++++++++++++++++++++++++++++++++++++++++++++++++++$++++++++++++++++++++++++++",
+" +++++++++++++++++++++++++++++++++++++++++++++++++++++++$ +++++++++++++$+++++++++++++++++++++++++++++++++++++++++++++++++++++++$++++++++++++++++++++++++++",
+" +++++++++++++++++++++++++++++++++++++++++++++++++++++++$ +++++++++++++$+++++++++++++++++++++++++++++++++++++++++++++++++++++++$++++++++++++++++++++++++++",
+" +++++++++++++++++++++++++++++++++++++++++++++++++++++++$ +++++++++++++$+++++++++++++++++++++++++++++++++++++++++++++++++++++++$++++++++++++++++++++++++++",
+" +++++++++++++++++++++++++++++++++++++++++++++++++++++++$ +++++++++++++$+++++++++++++++++++++++++++++++++++++++++++++++++++++++$++++++++++++++++++++++++++",
+" +++++++++++++++++++++++++++++++++++++++++++++++++++++++$ +++++++++++++$+++++++++++++++++++++++++++++++++++++++++++++++++++++++$++++++++++++++++++++++++++",
+" +++++++++++++++++++++++++++++++++++++++++++++++++++++++$ +++++++++++++$+++++++++++++++++++++++++++++++++++++++++++++++++++++++$++++++++++++++++++++++++++",
+" +++++++++++++++++++++++++++++++++++++++++++++++++++++++$ +++++++++++++$+++++++++++++++++++++++++++++++++++++++++++++++++++++++$++++++++++++++++++++++++++",
+" +++++++++++++++++++++++++++++++++++++++++++++++++++++++$ +++++++++++++$+++++++++++++++++++++++++++++++++++++++++++++++++++++++$++++++++++++++++++++++++++",
+" +++++++++++++++++++++++++++++++++++++++++++++++++++++++$ +++++++++++++$+++++++++++++++++++++++++++++++++++++++++++++++++++++++$++++++++++++++++++++++++++",
+" +++++++++++++++++++++++++++++++++++++++++++++++++++++++$ +++++++++++++$+++++++++++++++++++++++++++++++++++++++++++++++++++++++$++++++++++++++++++++++++++",
+" +++++++++++++++++++++++++++++++++++++++++++++++++++++++$ +++++++++++++$+++++++++++++++++++++++++++++++++++++++++++++++++++++++$++++++++++++++++++++++++++",
+" +++++++++++++++++++++++++++++++++++++++++++++++++++++++$ +++++++++++++$+++++++++++++++++++++++++++++++++++++++++++++++++++++++$++++++++++++++++++++++++++",
+" +++++++++++++++++++++++++++++++++++++++++++++++++++++++$ +++++++++++++$+++++++++++++++++++++++++++++++++++++++++++++++++++++++$++++++++++++++++++++++++++",
+" +++++++++++++++++++++++++++++++++++++++++++++++++++++++$ +++++++++++++$+++++++++++++++++++++++++++++++++++++++++++++++++++++++$++++++++++++++++++++++++++",
+" +++++++++++++++++++++++++++++++++++++++++++++++++++++++$ +++++++++++++$+++++++++++++++++++++++++++++++++++++++++++++++++++++++$++++++++++++++++++++++++++",
+" +++++++++++++++++++++++++++++++++++++++++++++++++++++++$ +++++++++++++$+++++++++++++++++++++++++++++++++++++++++++++++++++++++$++++++++++++++++++++++++++",
+" +++++++++++++++++++++++++++++++++++++++++++++++++++++++$ +++++++++++++$+++++++++++++++++++++++++++++++++++++++++++++++++++++++$++++++++++++++++++++++++++",
+" +++++++++++++++++++++++++++++++++++++++++++++++++++++++$ +++++++++++++$+++++++++++++++++++++++++++++++++++++++++++++++++++++++$++++++++++++++++++++++++++",
+" +++++++++++++++++++++++++++++++++++++++++++++++++++++++$ +++++++++++++$+++++++++++++++++++++++++++++++++++++++++++++++++++++++$++++++++++++++++++++++++++",
+" +++++++++++++++++++++++++++++++++++++++++++++++++++++++$ +++++++++++++$+++++++++++++++++++++++++++++++++++++++++++++++++++++++$++++++++++++++++++++++++++",
+" +++++++++++++++++++++++++++++++++++++++++++++++++++++++$ +++++++++++++$+++++++++++++++++++++++++++++++++++++++++++++++++++++++$++++++++++++++++++++++++++",
+" +++++++++++++++++++++++++++++++++++++++++++++++++++++++$ +++++++++++++$+++++++++++++++++++++++++++++++++++++++++++++++++++++++$++++++++++++++++++++++++++",
+" +++++++++++++++++++++++++++++++++++++++++++++++++++++++$ +++++++++++++$+++++++++++++++++++++++++++++++++++++++++++++++++++++++$++++++++++++++++++++++++++",
+" +++++++++++++++++++++++++++++++++++++++++++++++++++++++$ +++++++++++++$+++++++++++++++++++++++++++++++++++++++++++++++++++++++$++++++++++++++++++++++++++",
+" +++++++++++++++++++++++++++++++++++++++++++++++++++++++$ +++++++++++++$+++++++++++++++++++++++++++++++++++++++++++++++%%++++++$++++++++++++++++++++++++++",
+" +++++++++++++++++++++++++++++++++++++++++++++++++++++++$ +++++++++++++$+++++++++++++++++++++++++++++++++++++++++++++++%%++++++$++++++++++++++++++++++++++",
+" +++++++++++++++++++++++++++++++++++++++++++++++++++++++$ +++++++++++++$++++++%%%%%%+++++++++++++++++++++++++++++++++%%%%%%++++$++++++++++++++++++++++++++",
+" +++++++++++++++++++++++++++++++++++++++++++++++++++++++$ +++++++++++++$++++++%%%%%%+++++++++++++++++++++++++++++++++%%%%%%++++$++++++++++++++++++++++++++",
+" +++++++++++++++++++++++++++++++++++++++++++++++++++++++$ +++++++++++++$+++++++++++++++++++++++++++++++++++++++++++++++%%++++++$++++++++++++++++++++++++++",
+" +++++++++++++++++++++++++++++++++++++++++++++++++++++++$ +++++++++++++$+++++++++++++++++++++++++++++++++++++++++++++++%%++++++$++++++++++++++++++++++++++",
+" +++++++++++++++++++++++++++++++++++++++++++++++++++++++$ +++++++++++++$+++++++++++++++++++++++++++++++++++++++++++++++++++++++$++++++++++++++++++++++++++",
+" +++++++++++++++++++++++++++++++++++++++++++++++++++++++$ +++++++++++++$+++++++++++++++++++++++++++++++++++++++++++++++++++++++$++++++++++++++++++++++++++",
+" +++++++++++++++++++++++++++++++++++++++++++++++++++++++$ +++++++++++++$+++++++++++++++++++++++++++++++++++++++++++++++++++++++$++++++++++++++++++++++++++",
+" +++++++++++++++++++++++++++++++++++++++++++++++++++++++$ $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$++++++++++++++++++++++++++",
+" +++++++++++++++++++++++++++++++++++++++++++++++++++++++$ + @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@",
+" +++++++++++++++++++++++++++++++++++++++++++++++++++++++$ + &&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&",
+" +++++++++++++++++++++++++++++++++++++++++++++++++++++++$ + ********************************************************",
+" $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ + ========================================================",
+" + --------------------------------------------------------",
+" + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;",
+" + >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>",
+" + ,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,",
+"++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ########################################################",
+"++@@@+++++'++'@@@'+'@@@'+'+++'+'@@@'+'@@@'+'@@@'+'@@@'+'@@@'+++++++@@+@+++++++ ))))))))))))))))))))))))))))))))))))))))))))))))))))))))",
+"+@+++@++++@++++++@+++++@+@+++@+@+++++@+++++++++@+@+++@+@+++@+++++++@@+@+++++++ !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!",
+"+@+++@++++@++++++@+++++@+@+++@+@+++++@+++++++++@+@+++@+@+++@+++++++++@++++++++ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~",
+"+'+++'++++'++'@@@'++@@@'+'@@@'+'@@@'+'@@@'+++++'+%@@@%+'@@@'+++++++++@++++++++ {{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{",
+"+@+++@++++@++@+++++++++@+++++@+++++@+@+++@+++++@+@+++@+++++@+++++++++@++++++++ ]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]",
+"+@+++@++++@++@+++++++++@+++++@+++++@+@+++@+++++@+@+++@+++++@+++@++++@+@@++++++ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^",
+"++@@@+++++@++'@@@'+'@@@'+++++'+'@@@'+'@@@'+++++'+'@@@'+'@@@'+++'++++@+@@++++++ ////////////////////////////////////////////////////////",
+"++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ((((((((((((((((((((((((((((((((((((((((((((((((((((((((",
+" ________________________________________________________",
+"++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ",
+"+%@@@%+'@@@++'@@@'+'@@@++'@@@'+'@@@'+'@@@'+'+++'+++'+++++++'+'+++'+'+++++@+++@+'@@@++'@@@'+'@@@'+'@@@'+'@@@'+'@@@'+'@@@'+'+++'+'+++'+'+++'+'+++'+'+++'+'@@@' ",
+"+@+++@+@+++@+@+++++@+++@+@+++++@+++++@+++++@+++@+++@+++++++@+@+++@+@+++++@@+@@+@+++@+@+++@+@+++@+@+++@+@+++@+@+++++++@+++@+++@+@+++@+@+++@+@+++@+@+++@+++++@ ",
+"+@+++@+@+++@+@+++++@+++@+@+++++@+++++@+++++@+++@+++@+++++++@+@++@++@+++++@+@+@+@+++@+@+++@+@+++@+@+++@+@+++@+@+++++++@+++@+++@+@+++@+@+++@++@+@++@+++@+++++@ ",
+"+'@@@'+'@@@++'+++++'+++'+'@@@++'@@@++'+@@'+'@@@'+++'+++++++'+'@@%++'+++++'+++'+'+++'+'+++'+'@@@'+'@++'+'@@@++'@@@'+++'+++'+++'+'+++'+'+++'++%@%++'@@@'+'@@@' ",
+"+@+++@+@+++@+@+++++@+++@+@+++++@+++++@+++@+@+++@+++@+++++++@+@++@++@+++++@+++@+@+++@+@+++@+@+++++@+@+@+@+++@+++++@+++@+++@+++@+@'+'@+@+@+@++@+@++++++@+@++++ ",
+"+@+++@+@+++@+@+++++@+++@+@+++++@+++++@+++@+@+++@+++@+++++++@+@+++@+@+++++@+++@+@+++@+@+++@+@+++++@++@@+@+++@+++++@+++@+++@+++@++@'@++@@+@@+@+++@+++++@+@++++ ",
+"+'+++'+'@@@++'@@@'+@@@@++'@@@'+@+++++'@@@'+'+++'+++@+++'@@@'+'+++'+'@@@%+'+++'+@+++@+'@@@'+'+++++'@@@'+'+++'+'@@@'+++'+++%@@@@+++@+++@+++@+'+++@+'@@@'+'@@@' ",
+"++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ",
+" ::::::::::::::::::::::::::::::::::::::::::::::::::::::::",
+"+++++++++++++ <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<",
+"+++''++++++++ [[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[",
+"+++''++++++++ }}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}",
+"+'''''''''''' ||||||||||||||||||||||||||||||||||||||||||||||||||||||||",
+"+'''''''''''' 11111111111111111111111111111111111111111111111111111111",
+"+++''++++++++ 22222222222222222222222222222222222222222222222222222222",
+"+++''++++++++ 33333333333333333333333333333333333333333333333333333333",
+"+++++++++++++ 44444444444444444444444444444444444444444444444444444444",
+"+++++++++++++ ",
+" ",
+" ",
+" ",
+" ",
+" ",
+" ",
+" ",
+" ",
+" ",
+" ",
+" ",
+"++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ",
+"++@@@+++++@+++@@@++@@@@@+++++@+@@@@@++@@@++@@@@@++@@@+++@@@++++++++@@+@+++++++ ",
+"+@+++@+++@@++@+++@++++@+++++@@+@+++++@++++++++@++@+++@+@+++@+++++++@@+@+++++++ ",
+"+@++@@++++@++++++@+++@@++++@+@+@@@@++@++++++++@++@+++@+@+++@+++++++++@++++++++ ",
+"+@+@+@++++@+++++@++++++@++@++@+@+++@+@@@@++++@++++@@@+++@@@@+++++++++@++++++++ ",
+"+@@++@++++@++++@+++++++@+@@@@@+++++@+@+++@+++@+++@+++@+++++@+++++++++@++++++++ ",
+"+@+++@++++@+++@++++@+++@+++++@+@+++@+@+++@++@++++@+++@+++++@++++++++@+@@++++++ ",
+"++@@@+++++@++@@@@@++@@@++++++@++@@@+++@@@+++@+++++@@@+++@@@++++@++++@+@@++++++ ",
+"++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ",
+" ",
+"++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ",
+"+++@+++@@@@+++@@@++@@@@++@@@@@+@@@@@++@@@++@+++@+++@+++++++@+@+++@+@+++++@+++@+@+++@++@@@++@@@@+++@@@++@@@@+++@@@++@@@@@+@+++@+@+++@+@+++@+@+++@+@+++@+@@@@@ ",
+"++@+@++@+++@+@+++@+@+++@+@+++++@+++++@+++@+@+++@+++@+++++++@+@++@++@+++++@@+@@+@+++@+@+++@+@+++@+@+++@+@+++@+@+++@+++@+++@+++@+@+++@+@+++@+@+++@+@+++@+++++@ ",
+"+@+++@+@+++@+@+++++@+++@+@+++++@+++++@+++++@+++@+++@+++++++@+@+@+++@+++++@+@+@+@@++@+@+++@+@+++@+@+++@+@+++@+@+++++++@+++@+++@+@+++@+@+++@++@+@+++@+@+++++@+ ",
+"+@@@@@+@@@@++@+++++@+++@+@@@@++@@@@++@++@@+@@@@@+++@+++++++@+@@++++@+++++@+++@+@+@+@+@+++@+@@@@++@+++@+@@@@+++@@@++++@+++@+++@+@+++@+@+++@+++@+++++@+++++@++ ",
+"+@+++@+@+++@+@+++++@+++@+@+++++@+++++@+++@+@+++@+++@+++++++@+@+@+++@+++++@+++@+@++@@+@+++@+@+++++@+++@+@+@+++++++@+++@+++@+++@+@+++@+@+@+@++@+@++++@++++@+++ ",
+"+@+++@+@+++@+@+++@+@+++@+@+++++@+++++@+++@+@+++@+++@+++@+++@+@++@++@+++++@+++@+@+++@+@+++@+@+++++@+++@+@++@++@+++@+++@+++@+++@++@+@++@@+@@+@+++@+++@+++@++++ ",
+"+@+++@+@@@@+++@@@++@@@@++@@@@@+@++++++@@@++@+++@+++@++++@@@++@+++@+@@@@@+@+++@+@+++@++@@@++@++++++@@@++@+++@++@@@++++@++++@@@++++@+++@+++@+@+++@+++@+++@@@@@ ",
+"++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++@+++++++++++++++++++++++++++++++++++++++++++++++++++++++ ",
+" ",
+"+++++++++++++ ",
+"+++''++++++++ ",
+"+++''++++++++ ",
+"+'''''''''''' ",
+"+'''''''''''' ",
+"+++''++++++++ ",
+"+++''++++++++ ",
+"+++++++++++++ ",
+"+++++++++++++ "};
diff --git a/wmcube/wmcube/wmcubecyan.xpm b/wmcube/wmcube/wmcubecyan.xpm
new file mode 100644
index 000000000000..46a1624536bc
--- /dev/null
+++ b/wmcube/wmcube/wmcubecyan.xpm
@@ -0,0 +1,168 @@
+/* XPM */
+static char * wmcubecyan_xpm[] = {
+"160 133 32 1",
+" c #0000FF",
+"+ c #000000",
+"@ c #00D2CB",
+"# c #00A8A2",
+"$ c #808080",
+"% c #004A42",
+"& c #00D0C9",
+"* c #00CCCA",
+"= c #00C8C1",
+"- c #00BEBC",
+"; c #00B8B6",
+"> c #00B4AE",
+", c #00AEA8",
+"' c #007E71",
+") c #00A29C",
+"! c #009C96",
+"~ c #009691",
+"{ c #00908B",
+"] c #008C87",
+"^ c #008681",
+"/ c #00807B",
+"( c #007A76",
+"_ c #007470",
+": c #007069",
+"< c #006E6A",
+"[ c #006864",
+"} c #00625F",
+"| c #005C5B",
+"1 c #005C59",
+"2 c #005855",
+"3 c #00524F",
+"4 c #004E4B",
+" ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ @#",
+" +++++++++++++$+++++++++++++++++++++++++++++++++++++++++++++++++++++++$ ",
+" +++++++++++++$+++++++++++++++++++++++++++++++++++++++++++++++++++++++$ ",
+" +++++++++++++$+++++++++++++++++++++++++++++++++++++++++++++++++++++++$ ",
+" ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ +++++++++++++$+++++++++++++++++++++++++++++++++++++++++++++++++++++++$ ",
+" +++++++++++++++++++++++++++++++++++++++++++++++++++++++$ +++++++++++++$+++++++++++++++++++++++++++++++++++++++++++++++++++++++$ ",
+" +++++++++++++++++++++++++++++++++++++++++++++++++++++++$ +++++++++++++$+++++++++++++++++++++++++++++++++++++++++++++++++++++++$++++++++++++++++++++++++++",
+" +++++++++++++++++++++++++++++++++++++++++++++++++++++++$ +++++++++++++$+++++++++++++++++++++++++++++++++++++++++++++++++++++++$++++++++++++++++++++++++++",
+" +++++++++++++++++++++++++++++++++++++++++++++++++++++++$ +++++++++++++$+++++++++++++++++++++++++++++++++++++++++++++++++++++++$++++++++++++++++++++++++++",
+" +++++++++++++++++++++++++++++++++++++++++++++++++++++++$ +++++++++++++$+++++++++++++++++++++++++++++++++++++++++++++++++++++++$++++++++++++++++++++++++++",
+" +++++++++++++++++++++++++++++++++++++++++++++++++++++++$ +++++++++++++$+++++++++++++++++++++++++++++++++++++++++++++++++++++++$++++++++++++++++++++++++++",
+" +++++++++++++++++++++++++++++++++++++++++++++++++++++++$ +++++++++++++$+++++++++++++++++++++++++++++++++++++++++++++++++++++++$++++++++++++++++++++++++++",
+" +++++++++++++++++++++++++++++++++++++++++++++++++++++++$ +++++++++++++$+++++++++++++++++++++++++++++++++++++++++++++++++++++++$++++++++++++++++++++++++++",
+" +++++++++++++++++++++++++++++++++++++++++++++++++++++++$ +++++++++++++$+++++++++++++++++++++++++++++++++++++++++++++++++++++++$++++++++++++++++++++++++++",
+" +++++++++++++++++++++++++++++++++++++++++++++++++++++++$ +++++++++++++$+++++++++++++++++++++++++++++++++++++++++++++++++++++++$++++++++++++++++++++++++++",
+" +++++++++++++++++++++++++++++++++++++++++++++++++++++++$ +++++++++++++$+++++++++++++++++++++++++++++++++++++++++++++++++++++++$++++++++++++++++++++++++++",
+" +++++++++++++++++++++++++++++++++++++++++++++++++++++++$ +++++++++++++$+++++++++++++++++++++++++++++++++++++++++++++++++++++++$++++++++++++++++++++++++++",
+" +++++++++++++++++++++++++++++++++++++++++++++++++++++++$ +++++++++++++$+++++++++++++++++++++++++++++++++++++++++++++++++++++++$++++++++++++++++++++++++++",
+" +++++++++++++++++++++++++++++++++++++++++++++++++++++++$ +++++++++++++$+++++++++++++++++++++++++++++++++++++++++++++++++++++++$++++++++++++++++++++++++++",
+" +++++++++++++++++++++++++++++++++++++++++++++++++++++++$ +++++++++++++$+++++++++++++++++++++++++++++++++++++++++++++++++++++++$++++++++++++++++++++++++++",
+" +++++++++++++++++++++++++++++++++++++++++++++++++++++++$ +++++++++++++$+++++++++++++++++++++++++++++++++++++++++++++++++++++++$++++++++++++++++++++++++++",
+" +++++++++++++++++++++++++++++++++++++++++++++++++++++++$ +++++++++++++$+++++++++++++++++++++++++++++++++++++++++++++++++++++++$++++++++++++++++++++++++++",
+" +++++++++++++++++++++++++++++++++++++++++++++++++++++++$ +++++++++++++$+++++++++++++++++++++++++++++++++++++++++++++++++++++++$++++++++++++++++++++++++++",
+" +++++++++++++++++++++++++++++++++++++++++++++++++++++++$ +++++++++++++$+++++++++++++++++++++++++++++++++++++++++++++++++++++++$++++++++++++++++++++++++++",
+" +++++++++++++++++++++++++++++++++++++++++++++++++++++++$ +++++++++++++$+++++++++++++++++++++++++++++++++++++++++++++++++++++++$++++++++++++++++++++++++++",
+" +++++++++++++++++++++++++++++++++++++++++++++++++++++++$ +++++++++++++$+++++++++++++++++++++++++++++++++++++++++++++++++++++++$++++++++++++++++++++++++++",
+" +++++++++++++++++++++++++++++++++++++++++++++++++++++++$ +++++++++++++$+++++++++++++++++++++++++++++++++++++++++++++++++++++++$++++++++++++++++++++++++++",
+" +++++++++++++++++++++++++++++++++++++++++++++++++++++++$ +++++++++++++$+++++++++++++++++++++++++++++++++++++++++++++++++++++++$++++++++++++++++++++++++++",
+" +++++++++++++++++++++++++++++++++++++++++++++++++++++++$ +++++++++++++$+++++++++++++++++++++++++++++++++++++++++++++++++++++++$++++++++++++++++++++++++++",
+" +++++++++++++++++++++++++++++++++++++++++++++++++++++++$ +++++++++++++$+++++++++++++++++++++++++++++++++++++++++++++++++++++++$++++++++++++++++++++++++++",
+" +++++++++++++++++++++++++++++++++++++++++++++++++++++++$ +++++++++++++$+++++++++++++++++++++++++++++++++++++++++++++++++++++++$++++++++++++++++++++++++++",
+" +++++++++++++++++++++++++++++++++++++++++++++++++++++++$ +++++++++++++$+++++++++++++++++++++++++++++++++++++++++++++++++++++++$++++++++++++++++++++++++++",
+" +++++++++++++++++++++++++++++++++++++++++++++++++++++++$ +++++++++++++$+++++++++++++++++++++++++++++++++++++++++++++++++++++++$++++++++++++++++++++++++++",
+" +++++++++++++++++++++++++++++++++++++++++++++++++++++++$ +++++++++++++$+++++++++++++++++++++++++++++++++++++++++++++++++++++++$++++++++++++++++++++++++++",
+" +++++++++++++++++++++++++++++++++++++++++++++++++++++++$ +++++++++++++$+++++++++++++++++++++++++++++++++++++++++++++++++++++++$++++++++++++++++++++++++++",
+" +++++++++++++++++++++++++++++++++++++++++++++++++++++++$ +++++++++++++$+++++++++++++++++++++++++++++++++++++++++++++++++++++++$++++++++++++++++++++++++++",
+" +++++++++++++++++++++++++++++++++++++++++++++++++++++++$ +++++++++++++$+++++++++++++++++++++++++++++++++++++++++++++++++++++++$++++++++++++++++++++++++++",
+" +++++++++++++++++++++++++++++++++++++++++++++++++++++++$ +++++++++++++$+++++++++++++++++++++++++++++++++++++++++++++++++++++++$++++++++++++++++++++++++++",
+" +++++++++++++++++++++++++++++++++++++++++++++++++++++++$ +++++++++++++$+++++++++++++++++++++++++++++++++++++++++++++++++++++++$++++++++++++++++++++++++++",
+" +++++++++++++++++++++++++++++++++++++++++++++++++++++++$ +++++++++++++$+++++++++++++++++++++++++++++++++++++++++++++++++++++++$++++++++++++++++++++++++++",
+" +++++++++++++++++++++++++++++++++++++++++++++++++++++++$ +++++++++++++$+++++++++++++++++++++++++++++++++++++++++++++++++++++++$++++++++++++++++++++++++++",
+" +++++++++++++++++++++++++++++++++++++++++++++++++++++++$ +++++++++++++$+++++++++++++++++++++++++++++++++++++++++++++++++++++++$++++++++++++++++++++++++++",
+" +++++++++++++++++++++++++++++++++++++++++++++++++++++++$ +++++++++++++$+++++++++++++++++++++++++++++++++++++++++++++++++++++++$++++++++++++++++++++++++++",
+" +++++++++++++++++++++++++++++++++++++++++++++++++++++++$ +++++++++++++$+++++++++++++++++++++++++++++++++++++++++++++++++++++++$++++++++++++++++++++++++++",
+" +++++++++++++++++++++++++++++++++++++++++++++++++++++++$ +++++++++++++$+++++++++++++++++++++++++++++++++++++++++++++++++++++++$++++++++++++++++++++++++++",
+" +++++++++++++++++++++++++++++++++++++++++++++++++++++++$ +++++++++++++$+++++++++++++++++++++++++++++++++++++++++++++++++++++++$++++++++++++++++++++++++++",
+" +++++++++++++++++++++++++++++++++++++++++++++++++++++++$ +++++++++++++$+++++++++++++++++++++++++++++++++++++++++++++++%%++++++$++++++++++++++++++++++++++",
+" +++++++++++++++++++++++++++++++++++++++++++++++++++++++$ +++++++++++++$+++++++++++++++++++++++++++++++++++++++++++++++%%++++++$++++++++++++++++++++++++++",
+" +++++++++++++++++++++++++++++++++++++++++++++++++++++++$ +++++++++++++$++++++%%%%%%+++++++++++++++++++++++++++++++++%%%%%%++++$++++++++++++++++++++++++++",
+" +++++++++++++++++++++++++++++++++++++++++++++++++++++++$ +++++++++++++$++++++%%%%%%+++++++++++++++++++++++++++++++++%%%%%%++++$++++++++++++++++++++++++++",
+" +++++++++++++++++++++++++++++++++++++++++++++++++++++++$ +++++++++++++$+++++++++++++++++++++++++++++++++++++++++++++++%%++++++$++++++++++++++++++++++++++",
+" +++++++++++++++++++++++++++++++++++++++++++++++++++++++$ +++++++++++++$+++++++++++++++++++++++++++++++++++++++++++++++%%++++++$++++++++++++++++++++++++++",
+" +++++++++++++++++++++++++++++++++++++++++++++++++++++++$ +++++++++++++$+++++++++++++++++++++++++++++++++++++++++++++++++++++++$++++++++++++++++++++++++++",
+" +++++++++++++++++++++++++++++++++++++++++++++++++++++++$ +++++++++++++$+++++++++++++++++++++++++++++++++++++++++++++++++++++++$++++++++++++++++++++++++++",
+" +++++++++++++++++++++++++++++++++++++++++++++++++++++++$ +++++++++++++$+++++++++++++++++++++++++++++++++++++++++++++++++++++++$++++++++++++++++++++++++++",
+" +++++++++++++++++++++++++++++++++++++++++++++++++++++++$ $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$++++++++++++++++++++++++++",
+" +++++++++++++++++++++++++++++++++++++++++++++++++++++++$ + @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@",
+" +++++++++++++++++++++++++++++++++++++++++++++++++++++++$ + &&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&",
+" +++++++++++++++++++++++++++++++++++++++++++++++++++++++$ + ********************************************************",
+" $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ + ========================================================",
+" + --------------------------------------------------------",
+" + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;",
+" + >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>",
+" + ,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,",
+"++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ########################################################",
+"++@@@+++++'++'@@@'+'@@@'+'+++'+'@@@'+'@@@'+'@@@'+'@@@'+'@@@'+++++++@@+@+++++++ ))))))))))))))))))))))))))))))))))))))))))))))))))))))))",
+"+@+++@++++@++++++@+++++@+@+++@+@+++++@+++++++++@+@+++@+@+++@+++++++@@+@+++++++ !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!",
+"+@+++@++++@++++++@+++++@+@+++@+@+++++@+++++++++@+@+++@+@+++@+++++++++@++++++++ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~",
+"+'+++'++++'++'@@@'++@@@'+'@@@'+'@@@'+'@@@'+++++'+%@@@%+'@@@'+++++++++@++++++++ {{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{",
+"+@+++@++++@++@+++++++++@+++++@+++++@+@+++@+++++@+@+++@+++++@+++++++++@++++++++ ]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]",
+"+@+++@++++@++@+++++++++@+++++@+++++@+@+++@+++++@+@+++@+++++@+++@++++@+@@++++++ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^",
+"++@@@+++++@++'@@@'+'@@@'+++++'+'@@@'+'@@@'+++++'+'@@@'+'@@@'+++'++++@+@@++++++ ////////////////////////////////////////////////////////",
+"++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ((((((((((((((((((((((((((((((((((((((((((((((((((((((((",
+" ________________________________________________________",
+"++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ",
+"+%@@@%+'@@@++'@@@'+'@@@++'@@@'+'@@@'+'@@@'+'+++'+++'+++++++'+'+++'+'+++++@+++@+'@@@++'@@@'+'@@@'+'@@@'+'@@@'+'@@@'+'@@@'+'+++'+'+++'+'+++'+'+++'+'+++'+'@@@' ",
+"+@+++@+@+++@+@+++++@+++@+@+++++@+++++@+++++@+++@+++@+++++++@+@+++@+@+++++@@+@@+@+++@+@+++@+@+++@+@+++@+@+++@+@+++++++@+++@+++@+@+++@+@+++@+@+++@+@+++@+++++@ ",
+"+@+++@+@+++@+@+++++@+++@+@+++++@+++++@+++++@+++@+++@+++++++@+@++@++@+++++@+@+@+@+++@+@+++@+@+++@+@+++@+@+++@+@+++++++@+++@+++@+@+++@+@+++@++@+@++@+++@+++++@ ",
+"+'@@@'+'@@@++'+++++'+++'+'@@@++'@@@++'+@@'+'@@@'+++'+++++++'+'@@%++'+++++'+++'+'+++'+'+++'+'@@@'+'@++'+'@@@++'@@@'+++'+++'+++'+'+++'+'+++'++%@%++'@@@'+'@@@' ",
+"+@+++@+@+++@+@+++++@+++@+@+++++@+++++@+++@+@+++@+++@+++++++@+@++@++@+++++@+++@+@+++@+@+++@+@+++++@+@+@+@+++@+++++@+++@+++@+++@+@'+'@+@+@+@++@+@++++++@+@++++ ",
+"+@+++@+@+++@+@+++++@+++@+@+++++@+++++@+++@+@+++@+++@+++++++@+@+++@+@+++++@+++@+@+++@+@+++@+@+++++@++@@+@+++@+++++@+++@+++@+++@++@'@++@@+@@+@+++@+++++@+@++++ ",
+"+'+++'+'@@@++'@@@'+@@@@++'@@@'+@+++++'@@@'+'+++'+++@+++'@@@'+'+++'+'@@@%+'+++'+@+++@+'@@@'+'+++++'@@@'+'+++'+'@@@'+++'+++%@@@@+++@+++@+++@+'+++@+'@@@'+'@@@' ",
+"++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ",
+" ::::::::::::::::::::::::::::::::::::::::::::::::::::::::",
+"+++++++++++++ <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<",
+"+++''++++++++ [[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[",
+"+++''++++++++ }}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}",
+"+'''''''''''' ||||||||||||||||||||||||||||||||||||||||||||||||||||||||",
+"+'''''''''''' 11111111111111111111111111111111111111111111111111111111",
+"+++''++++++++ 22222222222222222222222222222222222222222222222222222222",
+"+++''++++++++ 33333333333333333333333333333333333333333333333333333333",
+"+++++++++++++ 44444444444444444444444444444444444444444444444444444444",
+"+++++++++++++ ",
+" ",
+" ",
+" ",
+" ",
+" ",
+" ",
+" ",
+" ",
+" ",
+" ",
+" ",
+"++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ",
+"++@@@+++++@+++@@@++@@@@@+++++@+@@@@@++@@@++@@@@@++@@@+++@@@++++++++@@+@+++++++ ",
+"+@+++@+++@@++@+++@++++@+++++@@+@+++++@++++++++@++@+++@+@+++@+++++++@@+@+++++++ ",
+"+@++@@++++@++++++@+++@@++++@+@+@@@@++@++++++++@++@+++@+@+++@+++++++++@++++++++ ",
+"+@+@+@++++@+++++@++++++@++@++@+@+++@+@@@@++++@++++@@@+++@@@@+++++++++@++++++++ ",
+"+@@++@++++@++++@+++++++@+@@@@@+++++@+@+++@+++@+++@+++@+++++@+++++++++@++++++++ ",
+"+@+++@++++@+++@++++@+++@+++++@+@+++@+@+++@++@++++@+++@+++++@++++++++@+@@++++++ ",
+"++@@@+++++@++@@@@@++@@@++++++@++@@@+++@@@+++@+++++@@@+++@@@++++@++++@+@@++++++ ",
+"++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ",
+" ",
+"++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ",
+"+++@+++@@@@+++@@@++@@@@++@@@@@+@@@@@++@@@++@+++@+++@+++++++@+@+++@+@+++++@+++@+@+++@++@@@++@@@@+++@@@++@@@@+++@@@++@@@@@+@+++@+@+++@+@+++@+@+++@+@+++@+@@@@@ ",
+"++@+@++@+++@+@+++@+@+++@+@+++++@+++++@+++@+@+++@+++@+++++++@+@++@++@+++++@@+@@+@+++@+@+++@+@+++@+@+++@+@+++@+@+++@+++@+++@+++@+@+++@+@+++@+@+++@+@+++@+++++@ ",
+"+@+++@+@+++@+@+++++@+++@+@+++++@+++++@+++++@+++@+++@+++++++@+@+@+++@+++++@+@+@+@@++@+@+++@+@+++@+@+++@+@+++@+@+++++++@+++@+++@+@+++@+@+++@++@+@+++@+@+++++@+ ",
+"+@@@@@+@@@@++@+++++@+++@+@@@@++@@@@++@++@@+@@@@@+++@+++++++@+@@++++@+++++@+++@+@+@+@+@+++@+@@@@++@+++@+@@@@+++@@@++++@+++@+++@+@+++@+@+++@+++@+++++@+++++@++ ",
+"+@+++@+@+++@+@+++++@+++@+@+++++@+++++@+++@+@+++@+++@+++++++@+@+@+++@+++++@+++@+@++@@+@+++@+@+++++@+++@+@+@+++++++@+++@+++@+++@+@+++@+@+@+@++@+@++++@++++@+++ ",
+"+@+++@+@+++@+@+++@+@+++@+@+++++@+++++@+++@+@+++@+++@+++@+++@+@++@++@+++++@+++@+@+++@+@+++@+@+++++@+++@+@++@++@+++@+++@+++@+++@++@+@++@@+@@+@+++@+++@+++@++++ ",
+"+@+++@+@@@@+++@@@++@@@@++@@@@@+@++++++@@@++@+++@+++@++++@@@++@+++@+@@@@@+@+++@+@+++@++@@@++@++++++@@@++@+++@++@@@++++@++++@@@++++@+++@+++@+@+++@+++@+++@@@@@ ",
+"++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++@+++++++++++++++++++++++++++++++++++++++++++++++++++++++ ",
+" ",
+"+++++++++++++ ",
+"+++''++++++++ ",
+"+++''++++++++ ",
+"+'''''''''''' ",
+"+'''''''''''' ",
+"+++''++++++++ ",
+"+++''++++++++ ",
+"+++++++++++++ ",
+"+++++++++++++ "};
diff --git a/wmcube/wmcube/wmcubegreen.xpm b/wmcube/wmcube/wmcubegreen.xpm
new file mode 100644
index 000000000000..737d65c6c6df
--- /dev/null
+++ b/wmcube/wmcube/wmcubegreen.xpm
@@ -0,0 +1,168 @@
+/* XPM */
+static char * wmcubegreen_xpm[] = {
+"160 133 32 1",
+" c #0000FF",
+"+ c #000000",
+"@ c #00D21E",
+"# c #00A818",
+"$ c #808080",
+"% c #004A05",
+"& c #00D01D",
+"* c #00CC22",
+"= c #00C81C",
+"- c #00BE1F",
+"; c #00B81E",
+"> c #00B419",
+", c #00AE19",
+"' c #007E09",
+") c #00A217",
+"! c #009C16",
+"~ c #009615",
+"{ c #009014",
+"] c #008C14",
+"^ c #008613",
+"/ c #008012",
+"( c #007A11",
+"_ c #007410",
+": c #00700D",
+"< c #006E10",
+"[ c #00680F",
+"} c #00620E",
+"| c #005C0F",
+"1 c #005C0D",
+"2 c #00580C",
+"3 c #00520C",
+"4 c #004E0B",
+" ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ @#",
+" +++++++++++++$+++++++++++++++++++++++++++++++++++++++++++++++++++++++$ ",
+" +++++++++++++$+++++++++++++++++++++++++++++++++++++++++++++++++++++++$ ",
+" +++++++++++++$+++++++++++++++++++++++++++++++++++++++++++++++++++++++$ ",
+" ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ +++++++++++++$+++++++++++++++++++++++++++++++++++++++++++++++++++++++$ ",
+" +++++++++++++++++++++++++++++++++++++++++++++++++++++++$ +++++++++++++$+++++++++++++++++++++++++++++++++++++++++++++++++++++++$ ",
+" +++++++++++++++++++++++++++++++++++++++++++++++++++++++$ +++++++++++++$+++++++++++++++++++++++++++++++++++++++++++++++++++++++$++++++++++++++++++++++++++",
+" +++++++++++++++++++++++++++++++++++++++++++++++++++++++$ +++++++++++++$+++++++++++++++++++++++++++++++++++++++++++++++++++++++$++++++++++++++++++++++++++",
+" +++++++++++++++++++++++++++++++++++++++++++++++++++++++$ +++++++++++++$+++++++++++++++++++++++++++++++++++++++++++++++++++++++$++++++++++++++++++++++++++",
+" +++++++++++++++++++++++++++++++++++++++++++++++++++++++$ +++++++++++++$+++++++++++++++++++++++++++++++++++++++++++++++++++++++$++++++++++++++++++++++++++",
+" +++++++++++++++++++++++++++++++++++++++++++++++++++++++$ +++++++++++++$+++++++++++++++++++++++++++++++++++++++++++++++++++++++$++++++++++++++++++++++++++",
+" +++++++++++++++++++++++++++++++++++++++++++++++++++++++$ +++++++++++++$+++++++++++++++++++++++++++++++++++++++++++++++++++++++$++++++++++++++++++++++++++",
+" +++++++++++++++++++++++++++++++++++++++++++++++++++++++$ +++++++++++++$+++++++++++++++++++++++++++++++++++++++++++++++++++++++$++++++++++++++++++++++++++",
+" +++++++++++++++++++++++++++++++++++++++++++++++++++++++$ +++++++++++++$+++++++++++++++++++++++++++++++++++++++++++++++++++++++$++++++++++++++++++++++++++",
+" +++++++++++++++++++++++++++++++++++++++++++++++++++++++$ +++++++++++++$+++++++++++++++++++++++++++++++++++++++++++++++++++++++$++++++++++++++++++++++++++",
+" +++++++++++++++++++++++++++++++++++++++++++++++++++++++$ +++++++++++++$+++++++++++++++++++++++++++++++++++++++++++++++++++++++$++++++++++++++++++++++++++",
+" +++++++++++++++++++++++++++++++++++++++++++++++++++++++$ +++++++++++++$+++++++++++++++++++++++++++++++++++++++++++++++++++++++$++++++++++++++++++++++++++",
+" +++++++++++++++++++++++++++++++++++++++++++++++++++++++$ +++++++++++++$+++++++++++++++++++++++++++++++++++++++++++++++++++++++$++++++++++++++++++++++++++",
+" +++++++++++++++++++++++++++++++++++++++++++++++++++++++$ +++++++++++++$+++++++++++++++++++++++++++++++++++++++++++++++++++++++$++++++++++++++++++++++++++",
+" +++++++++++++++++++++++++++++++++++++++++++++++++++++++$ +++++++++++++$+++++++++++++++++++++++++++++++++++++++++++++++++++++++$++++++++++++++++++++++++++",
+" +++++++++++++++++++++++++++++++++++++++++++++++++++++++$ +++++++++++++$+++++++++++++++++++++++++++++++++++++++++++++++++++++++$++++++++++++++++++++++++++",
+" +++++++++++++++++++++++++++++++++++++++++++++++++++++++$ +++++++++++++$+++++++++++++++++++++++++++++++++++++++++++++++++++++++$++++++++++++++++++++++++++",
+" +++++++++++++++++++++++++++++++++++++++++++++++++++++++$ +++++++++++++$+++++++++++++++++++++++++++++++++++++++++++++++++++++++$++++++++++++++++++++++++++",
+" +++++++++++++++++++++++++++++++++++++++++++++++++++++++$ +++++++++++++$+++++++++++++++++++++++++++++++++++++++++++++++++++++++$++++++++++++++++++++++++++",
+" +++++++++++++++++++++++++++++++++++++++++++++++++++++++$ +++++++++++++$+++++++++++++++++++++++++++++++++++++++++++++++++++++++$++++++++++++++++++++++++++",
+" +++++++++++++++++++++++++++++++++++++++++++++++++++++++$ +++++++++++++$+++++++++++++++++++++++++++++++++++++++++++++++++++++++$++++++++++++++++++++++++++",
+" +++++++++++++++++++++++++++++++++++++++++++++++++++++++$ +++++++++++++$+++++++++++++++++++++++++++++++++++++++++++++++++++++++$++++++++++++++++++++++++++",
+" +++++++++++++++++++++++++++++++++++++++++++++++++++++++$ +++++++++++++$+++++++++++++++++++++++++++++++++++++++++++++++++++++++$++++++++++++++++++++++++++",
+" +++++++++++++++++++++++++++++++++++++++++++++++++++++++$ +++++++++++++$+++++++++++++++++++++++++++++++++++++++++++++++++++++++$++++++++++++++++++++++++++",
+" +++++++++++++++++++++++++++++++++++++++++++++++++++++++$ +++++++++++++$+++++++++++++++++++++++++++++++++++++++++++++++++++++++$++++++++++++++++++++++++++",
+" +++++++++++++++++++++++++++++++++++++++++++++++++++++++$ +++++++++++++$+++++++++++++++++++++++++++++++++++++++++++++++++++++++$++++++++++++++++++++++++++",
+" +++++++++++++++++++++++++++++++++++++++++++++++++++++++$ +++++++++++++$+++++++++++++++++++++++++++++++++++++++++++++++++++++++$++++++++++++++++++++++++++",
+" +++++++++++++++++++++++++++++++++++++++++++++++++++++++$ +++++++++++++$+++++++++++++++++++++++++++++++++++++++++++++++++++++++$++++++++++++++++++++++++++",
+" +++++++++++++++++++++++++++++++++++++++++++++++++++++++$ +++++++++++++$+++++++++++++++++++++++++++++++++++++++++++++++++++++++$++++++++++++++++++++++++++",
+" +++++++++++++++++++++++++++++++++++++++++++++++++++++++$ +++++++++++++$+++++++++++++++++++++++++++++++++++++++++++++++++++++++$++++++++++++++++++++++++++",
+" +++++++++++++++++++++++++++++++++++++++++++++++++++++++$ +++++++++++++$+++++++++++++++++++++++++++++++++++++++++++++++++++++++$++++++++++++++++++++++++++",
+" +++++++++++++++++++++++++++++++++++++++++++++++++++++++$ +++++++++++++$+++++++++++++++++++++++++++++++++++++++++++++++++++++++$++++++++++++++++++++++++++",
+" +++++++++++++++++++++++++++++++++++++++++++++++++++++++$ +++++++++++++$+++++++++++++++++++++++++++++++++++++++++++++++++++++++$++++++++++++++++++++++++++",
+" +++++++++++++++++++++++++++++++++++++++++++++++++++++++$ +++++++++++++$+++++++++++++++++++++++++++++++++++++++++++++++++++++++$++++++++++++++++++++++++++",
+" +++++++++++++++++++++++++++++++++++++++++++++++++++++++$ +++++++++++++$+++++++++++++++++++++++++++++++++++++++++++++++++++++++$++++++++++++++++++++++++++",
+" +++++++++++++++++++++++++++++++++++++++++++++++++++++++$ +++++++++++++$+++++++++++++++++++++++++++++++++++++++++++++++++++++++$++++++++++++++++++++++++++",
+" +++++++++++++++++++++++++++++++++++++++++++++++++++++++$ +++++++++++++$+++++++++++++++++++++++++++++++++++++++++++++++++++++++$++++++++++++++++++++++++++",
+" +++++++++++++++++++++++++++++++++++++++++++++++++++++++$ +++++++++++++$+++++++++++++++++++++++++++++++++++++++++++++++++++++++$++++++++++++++++++++++++++",
+" +++++++++++++++++++++++++++++++++++++++++++++++++++++++$ +++++++++++++$+++++++++++++++++++++++++++++++++++++++++++++++++++++++$++++++++++++++++++++++++++",
+" +++++++++++++++++++++++++++++++++++++++++++++++++++++++$ +++++++++++++$+++++++++++++++++++++++++++++++++++++++++++++++++++++++$++++++++++++++++++++++++++",
+" +++++++++++++++++++++++++++++++++++++++++++++++++++++++$ +++++++++++++$+++++++++++++++++++++++++++++++++++++++++++++++++++++++$++++++++++++++++++++++++++",
+" +++++++++++++++++++++++++++++++++++++++++++++++++++++++$ +++++++++++++$+++++++++++++++++++++++++++++++++++++++++++++++%%++++++$++++++++++++++++++++++++++",
+" +++++++++++++++++++++++++++++++++++++++++++++++++++++++$ +++++++++++++$+++++++++++++++++++++++++++++++++++++++++++++++%%++++++$++++++++++++++++++++++++++",
+" +++++++++++++++++++++++++++++++++++++++++++++++++++++++$ +++++++++++++$++++++%%%%%%+++++++++++++++++++++++++++++++++%%%%%%++++$++++++++++++++++++++++++++",
+" +++++++++++++++++++++++++++++++++++++++++++++++++++++++$ +++++++++++++$++++++%%%%%%+++++++++++++++++++++++++++++++++%%%%%%++++$++++++++++++++++++++++++++",
+" +++++++++++++++++++++++++++++++++++++++++++++++++++++++$ +++++++++++++$+++++++++++++++++++++++++++++++++++++++++++++++%%++++++$++++++++++++++++++++++++++",
+" +++++++++++++++++++++++++++++++++++++++++++++++++++++++$ +++++++++++++$+++++++++++++++++++++++++++++++++++++++++++++++%%++++++$++++++++++++++++++++++++++",
+" +++++++++++++++++++++++++++++++++++++++++++++++++++++++$ +++++++++++++$+++++++++++++++++++++++++++++++++++++++++++++++++++++++$++++++++++++++++++++++++++",
+" +++++++++++++++++++++++++++++++++++++++++++++++++++++++$ +++++++++++++$+++++++++++++++++++++++++++++++++++++++++++++++++++++++$++++++++++++++++++++++++++",
+" +++++++++++++++++++++++++++++++++++++++++++++++++++++++$ +++++++++++++$+++++++++++++++++++++++++++++++++++++++++++++++++++++++$++++++++++++++++++++++++++",
+" +++++++++++++++++++++++++++++++++++++++++++++++++++++++$ $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$++++++++++++++++++++++++++",
+" +++++++++++++++++++++++++++++++++++++++++++++++++++++++$ + @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@",
+" +++++++++++++++++++++++++++++++++++++++++++++++++++++++$ + &&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&",
+" +++++++++++++++++++++++++++++++++++++++++++++++++++++++$ + ********************************************************",
+" $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ + ========================================================",
+" + --------------------------------------------------------",
+" + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;",
+" + >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>",
+" + ,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,",
+"++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ########################################################",
+"++@@@+++++'++'@@@'+'@@@'+'+++'+'@@@'+'@@@'+'@@@'+'@@@'+'@@@'+++++++@@+@+++++++ ))))))))))))))))))))))))))))))))))))))))))))))))))))))))",
+"+@+++@++++@++++++@+++++@+@+++@+@+++++@+++++++++@+@+++@+@+++@+++++++@@+@+++++++ !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!",
+"+@+++@++++@++++++@+++++@+@+++@+@+++++@+++++++++@+@+++@+@+++@+++++++++@++++++++ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~",
+"+'+++'++++'++'@@@'++@@@'+'@@@'+'@@@'+'@@@'+++++'+%@@@%+'@@@'+++++++++@++++++++ {{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{",
+"+@+++@++++@++@+++++++++@+++++@+++++@+@+++@+++++@+@+++@+++++@+++++++++@++++++++ ]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]",
+"+@+++@++++@++@+++++++++@+++++@+++++@+@+++@+++++@+@+++@+++++@+++@++++@+@@++++++ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^",
+"++@@@+++++@++'@@@'+'@@@'+++++'+'@@@'+'@@@'+++++'+'@@@'+'@@@'+++'++++@+@@++++++ ////////////////////////////////////////////////////////",
+"++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ((((((((((((((((((((((((((((((((((((((((((((((((((((((((",
+" ________________________________________________________",
+"++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ",
+"+%@@@%+'@@@++'@@@'+'@@@++'@@@'+'@@@'+'@@@'+'+++'+++'+++++++'+'+++'+'+++++@+++@+'@@@++'@@@'+'@@@'+'@@@'+'@@@'+'@@@'+'@@@'+'+++'+'+++'+'+++'+'+++'+'+++'+'@@@' ",
+"+@+++@+@+++@+@+++++@+++@+@+++++@+++++@+++++@+++@+++@+++++++@+@+++@+@+++++@@+@@+@+++@+@+++@+@+++@+@+++@+@+++@+@+++++++@+++@+++@+@+++@+@+++@+@+++@+@+++@+++++@ ",
+"+@+++@+@+++@+@+++++@+++@+@+++++@+++++@+++++@+++@+++@+++++++@+@++@++@+++++@+@+@+@+++@+@+++@+@+++@+@+++@+@+++@+@+++++++@+++@+++@+@+++@+@+++@++@+@++@+++@+++++@ ",
+"+'@@@'+'@@@++'+++++'+++'+'@@@++'@@@++'+@@'+'@@@'+++'+++++++'+'@@%++'+++++'+++'+'+++'+'+++'+'@@@'+'@++'+'@@@++'@@@'+++'+++'+++'+'+++'+'+++'++%@%++'@@@'+'@@@' ",
+"+@+++@+@+++@+@+++++@+++@+@+++++@+++++@+++@+@+++@+++@+++++++@+@++@++@+++++@+++@+@+++@+@+++@+@+++++@+@+@+@+++@+++++@+++@+++@+++@+@'+'@+@+@+@++@+@++++++@+@++++ ",
+"+@+++@+@+++@+@+++++@+++@+@+++++@+++++@+++@+@+++@+++@+++++++@+@+++@+@+++++@+++@+@+++@+@+++@+@+++++@++@@+@+++@+++++@+++@+++@+++@++@'@++@@+@@+@+++@+++++@+@++++ ",
+"+'+++'+'@@@++'@@@'+@@@@++'@@@'+@+++++'@@@'+'+++'+++@+++'@@@'+'+++'+'@@@%+'+++'+@+++@+'@@@'+'+++++'@@@'+'+++'+'@@@'+++'+++%@@@@+++@+++@+++@+'+++@+'@@@'+'@@@' ",
+"++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ",
+" ::::::::::::::::::::::::::::::::::::::::::::::::::::::::",
+"+++++++++++++ <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<",
+"+++''++++++++ [[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[",
+"+++''++++++++ }}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}",
+"+'''''''''''' ||||||||||||||||||||||||||||||||||||||||||||||||||||||||",
+"+'''''''''''' 11111111111111111111111111111111111111111111111111111111",
+"+++''++++++++ 22222222222222222222222222222222222222222222222222222222",
+"+++''++++++++ 33333333333333333333333333333333333333333333333333333333",
+"+++++++++++++ 44444444444444444444444444444444444444444444444444444444",
+"+++++++++++++ ",
+" ",
+" ",
+" ",
+" ",
+" ",
+" ",
+" ",
+" ",
+" ",
+" ",
+" ",
+"++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ",
+"++@@@+++++@+++@@@++@@@@@+++++@+@@@@@++@@@++@@@@@++@@@+++@@@++++++++@@+@+++++++ ",
+"+@+++@+++@@++@+++@++++@+++++@@+@+++++@++++++++@++@+++@+@+++@+++++++@@+@+++++++ ",
+"+@++@@++++@++++++@+++@@++++@+@+@@@@++@++++++++@++@+++@+@+++@+++++++++@++++++++ ",
+"+@+@+@++++@+++++@++++++@++@++@+@+++@+@@@@++++@++++@@@+++@@@@+++++++++@++++++++ ",
+"+@@++@++++@++++@+++++++@+@@@@@+++++@+@+++@+++@+++@+++@+++++@+++++++++@++++++++ ",
+"+@+++@++++@+++@++++@+++@+++++@+@+++@+@+++@++@++++@+++@+++++@++++++++@+@@++++++ ",
+"++@@@+++++@++@@@@@++@@@++++++@++@@@+++@@@+++@+++++@@@+++@@@++++@++++@+@@++++++ ",
+"++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ",
+" ",
+"++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ",
+"+++@+++@@@@+++@@@++@@@@++@@@@@+@@@@@++@@@++@+++@+++@+++++++@+@+++@+@+++++@+++@+@+++@++@@@++@@@@+++@@@++@@@@+++@@@++@@@@@+@+++@+@+++@+@+++@+@+++@+@+++@+@@@@@ ",
+"++@+@++@+++@+@+++@+@+++@+@+++++@+++++@+++@+@+++@+++@+++++++@+@++@++@+++++@@+@@+@+++@+@+++@+@+++@+@+++@+@+++@+@+++@+++@+++@+++@+@+++@+@+++@+@+++@+@+++@+++++@ ",
+"+@+++@+@+++@+@+++++@+++@+@+++++@+++++@+++++@+++@+++@+++++++@+@+@+++@+++++@+@+@+@@++@+@+++@+@+++@+@+++@+@+++@+@+++++++@+++@+++@+@+++@+@+++@++@+@+++@+@+++++@+ ",
+"+@@@@@+@@@@++@+++++@+++@+@@@@++@@@@++@++@@+@@@@@+++@+++++++@+@@++++@+++++@+++@+@+@+@+@+++@+@@@@++@+++@+@@@@+++@@@++++@+++@+++@+@+++@+@+++@+++@+++++@+++++@++ ",
+"+@+++@+@+++@+@+++++@+++@+@+++++@+++++@+++@+@+++@+++@+++++++@+@+@+++@+++++@+++@+@++@@+@+++@+@+++++@+++@+@+@+++++++@+++@+++@+++@+@+++@+@+@+@++@+@++++@++++@+++ ",
+"+@+++@+@+++@+@+++@+@+++@+@+++++@+++++@+++@+@+++@+++@+++@+++@+@++@++@+++++@+++@+@+++@+@+++@+@+++++@+++@+@++@++@+++@+++@+++@+++@++@+@++@@+@@+@+++@+++@+++@++++ ",
+"+@+++@+@@@@+++@@@++@@@@++@@@@@+@++++++@@@++@+++@+++@++++@@@++@+++@+@@@@@+@+++@+@+++@++@@@++@++++++@@@++@+++@++@@@++++@++++@@@++++@+++@+++@+@+++@+++@+++@@@@@ ",
+"++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++@+++++++++++++++++++++++++++++++++++++++++++++++++++++++ ",
+" ",
+"+++++++++++++ ",
+"+++''++++++++ ",
+"+++''++++++++ ",
+"+'''''''''''' ",
+"+'''''''''''' ",
+"+++''++++++++ ",
+"+++''++++++++ ",
+"+++++++++++++ ",
+"+++++++++++++ "};
diff --git a/wmcube/wmcube/wmcubemagenta.xpm b/wmcube/wmcube/wmcubemagenta.xpm
new file mode 100644
index 000000000000..196c802d98cd
--- /dev/null
+++ b/wmcube/wmcube/wmcubemagenta.xpm
@@ -0,0 +1,168 @@
+/* XPM */
+static char * wmcubemagenta_xpm[] = {
+"160 133 32 1",
+" c #0000FF",
+"+ c #000000",
+"@ c #A300D2",
+"# c #8200A8",
+"$ c #808080",
+"% c #34004A",
+"& c #A200D0",
+"* c #A300CC",
+"= c #9B00C8",
+"- c #9800BE",
+"; c #9300B8",
+"> c #8C00B4",
+", c #8700AE",
+"' c #59007E",
+") c #7E00A2",
+"! c #79009C",
+"~ c #740096",
+"{ c #700090",
+"] c #6D008C",
+"^ c #680086",
+"/ c #630080",
+"( c #5F007A",
+"_ c #5A0074",
+": c #540070",
+"< c #55006E",
+"[ c #510068",
+"} c #4C0062",
+"| c #4A005C",
+"1 c #47005C",
+"2 c #440058",
+"3 c #400052",
+"4 c #3D004E",
+" ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ @#",
+" +++++++++++++$+++++++++++++++++++++++++++++++++++++++++++++++++++++++$ ",
+" +++++++++++++$+++++++++++++++++++++++++++++++++++++++++++++++++++++++$ ",
+" +++++++++++++$+++++++++++++++++++++++++++++++++++++++++++++++++++++++$ ",
+" ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ +++++++++++++$+++++++++++++++++++++++++++++++++++++++++++++++++++++++$ ",
+" +++++++++++++++++++++++++++++++++++++++++++++++++++++++$ +++++++++++++$+++++++++++++++++++++++++++++++++++++++++++++++++++++++$ ",
+" +++++++++++++++++++++++++++++++++++++++++++++++++++++++$ +++++++++++++$+++++++++++++++++++++++++++++++++++++++++++++++++++++++$++++++++++++++++++++++++++",
+" +++++++++++++++++++++++++++++++++++++++++++++++++++++++$ +++++++++++++$+++++++++++++++++++++++++++++++++++++++++++++++++++++++$++++++++++++++++++++++++++",
+" +++++++++++++++++++++++++++++++++++++++++++++++++++++++$ +++++++++++++$+++++++++++++++++++++++++++++++++++++++++++++++++++++++$++++++++++++++++++++++++++",
+" +++++++++++++++++++++++++++++++++++++++++++++++++++++++$ +++++++++++++$+++++++++++++++++++++++++++++++++++++++++++++++++++++++$++++++++++++++++++++++++++",
+" +++++++++++++++++++++++++++++++++++++++++++++++++++++++$ +++++++++++++$+++++++++++++++++++++++++++++++++++++++++++++++++++++++$++++++++++++++++++++++++++",
+" +++++++++++++++++++++++++++++++++++++++++++++++++++++++$ +++++++++++++$+++++++++++++++++++++++++++++++++++++++++++++++++++++++$++++++++++++++++++++++++++",
+" +++++++++++++++++++++++++++++++++++++++++++++++++++++++$ +++++++++++++$+++++++++++++++++++++++++++++++++++++++++++++++++++++++$++++++++++++++++++++++++++",
+" +++++++++++++++++++++++++++++++++++++++++++++++++++++++$ +++++++++++++$+++++++++++++++++++++++++++++++++++++++++++++++++++++++$++++++++++++++++++++++++++",
+" +++++++++++++++++++++++++++++++++++++++++++++++++++++++$ +++++++++++++$+++++++++++++++++++++++++++++++++++++++++++++++++++++++$++++++++++++++++++++++++++",
+" +++++++++++++++++++++++++++++++++++++++++++++++++++++++$ +++++++++++++$+++++++++++++++++++++++++++++++++++++++++++++++++++++++$++++++++++++++++++++++++++",
+" +++++++++++++++++++++++++++++++++++++++++++++++++++++++$ +++++++++++++$+++++++++++++++++++++++++++++++++++++++++++++++++++++++$++++++++++++++++++++++++++",
+" +++++++++++++++++++++++++++++++++++++++++++++++++++++++$ +++++++++++++$+++++++++++++++++++++++++++++++++++++++++++++++++++++++$++++++++++++++++++++++++++",
+" +++++++++++++++++++++++++++++++++++++++++++++++++++++++$ +++++++++++++$+++++++++++++++++++++++++++++++++++++++++++++++++++++++$++++++++++++++++++++++++++",
+" +++++++++++++++++++++++++++++++++++++++++++++++++++++++$ +++++++++++++$+++++++++++++++++++++++++++++++++++++++++++++++++++++++$++++++++++++++++++++++++++",
+" +++++++++++++++++++++++++++++++++++++++++++++++++++++++$ +++++++++++++$+++++++++++++++++++++++++++++++++++++++++++++++++++++++$++++++++++++++++++++++++++",
+" +++++++++++++++++++++++++++++++++++++++++++++++++++++++$ +++++++++++++$+++++++++++++++++++++++++++++++++++++++++++++++++++++++$++++++++++++++++++++++++++",
+" +++++++++++++++++++++++++++++++++++++++++++++++++++++++$ +++++++++++++$+++++++++++++++++++++++++++++++++++++++++++++++++++++++$++++++++++++++++++++++++++",
+" +++++++++++++++++++++++++++++++++++++++++++++++++++++++$ +++++++++++++$+++++++++++++++++++++++++++++++++++++++++++++++++++++++$++++++++++++++++++++++++++",
+" +++++++++++++++++++++++++++++++++++++++++++++++++++++++$ +++++++++++++$+++++++++++++++++++++++++++++++++++++++++++++++++++++++$++++++++++++++++++++++++++",
+" +++++++++++++++++++++++++++++++++++++++++++++++++++++++$ +++++++++++++$+++++++++++++++++++++++++++++++++++++++++++++++++++++++$++++++++++++++++++++++++++",
+" +++++++++++++++++++++++++++++++++++++++++++++++++++++++$ +++++++++++++$+++++++++++++++++++++++++++++++++++++++++++++++++++++++$++++++++++++++++++++++++++",
+" +++++++++++++++++++++++++++++++++++++++++++++++++++++++$ +++++++++++++$+++++++++++++++++++++++++++++++++++++++++++++++++++++++$++++++++++++++++++++++++++",
+" +++++++++++++++++++++++++++++++++++++++++++++++++++++++$ +++++++++++++$+++++++++++++++++++++++++++++++++++++++++++++++++++++++$++++++++++++++++++++++++++",
+" +++++++++++++++++++++++++++++++++++++++++++++++++++++++$ +++++++++++++$+++++++++++++++++++++++++++++++++++++++++++++++++++++++$++++++++++++++++++++++++++",
+" +++++++++++++++++++++++++++++++++++++++++++++++++++++++$ +++++++++++++$+++++++++++++++++++++++++++++++++++++++++++++++++++++++$++++++++++++++++++++++++++",
+" +++++++++++++++++++++++++++++++++++++++++++++++++++++++$ +++++++++++++$+++++++++++++++++++++++++++++++++++++++++++++++++++++++$++++++++++++++++++++++++++",
+" +++++++++++++++++++++++++++++++++++++++++++++++++++++++$ +++++++++++++$+++++++++++++++++++++++++++++++++++++++++++++++++++++++$++++++++++++++++++++++++++",
+" +++++++++++++++++++++++++++++++++++++++++++++++++++++++$ +++++++++++++$+++++++++++++++++++++++++++++++++++++++++++++++++++++++$++++++++++++++++++++++++++",
+" +++++++++++++++++++++++++++++++++++++++++++++++++++++++$ +++++++++++++$+++++++++++++++++++++++++++++++++++++++++++++++++++++++$++++++++++++++++++++++++++",
+" +++++++++++++++++++++++++++++++++++++++++++++++++++++++$ +++++++++++++$+++++++++++++++++++++++++++++++++++++++++++++++++++++++$++++++++++++++++++++++++++",
+" +++++++++++++++++++++++++++++++++++++++++++++++++++++++$ +++++++++++++$+++++++++++++++++++++++++++++++++++++++++++++++++++++++$++++++++++++++++++++++++++",
+" +++++++++++++++++++++++++++++++++++++++++++++++++++++++$ +++++++++++++$+++++++++++++++++++++++++++++++++++++++++++++++++++++++$++++++++++++++++++++++++++",
+" +++++++++++++++++++++++++++++++++++++++++++++++++++++++$ +++++++++++++$+++++++++++++++++++++++++++++++++++++++++++++++++++++++$++++++++++++++++++++++++++",
+" +++++++++++++++++++++++++++++++++++++++++++++++++++++++$ +++++++++++++$+++++++++++++++++++++++++++++++++++++++++++++++++++++++$++++++++++++++++++++++++++",
+" +++++++++++++++++++++++++++++++++++++++++++++++++++++++$ +++++++++++++$+++++++++++++++++++++++++++++++++++++++++++++++++++++++$++++++++++++++++++++++++++",
+" +++++++++++++++++++++++++++++++++++++++++++++++++++++++$ +++++++++++++$+++++++++++++++++++++++++++++++++++++++++++++++++++++++$++++++++++++++++++++++++++",
+" +++++++++++++++++++++++++++++++++++++++++++++++++++++++$ +++++++++++++$+++++++++++++++++++++++++++++++++++++++++++++++++++++++$++++++++++++++++++++++++++",
+" +++++++++++++++++++++++++++++++++++++++++++++++++++++++$ +++++++++++++$+++++++++++++++++++++++++++++++++++++++++++++++++++++++$++++++++++++++++++++++++++",
+" +++++++++++++++++++++++++++++++++++++++++++++++++++++++$ +++++++++++++$+++++++++++++++++++++++++++++++++++++++++++++++++++++++$++++++++++++++++++++++++++",
+" +++++++++++++++++++++++++++++++++++++++++++++++++++++++$ +++++++++++++$+++++++++++++++++++++++++++++++++++++++++++++++++++++++$++++++++++++++++++++++++++",
+" +++++++++++++++++++++++++++++++++++++++++++++++++++++++$ +++++++++++++$+++++++++++++++++++++++++++++++++++++++++++++++%%++++++$++++++++++++++++++++++++++",
+" +++++++++++++++++++++++++++++++++++++++++++++++++++++++$ +++++++++++++$+++++++++++++++++++++++++++++++++++++++++++++++%%++++++$++++++++++++++++++++++++++",
+" +++++++++++++++++++++++++++++++++++++++++++++++++++++++$ +++++++++++++$++++++%%%%%%+++++++++++++++++++++++++++++++++%%%%%%++++$++++++++++++++++++++++++++",
+" +++++++++++++++++++++++++++++++++++++++++++++++++++++++$ +++++++++++++$++++++%%%%%%+++++++++++++++++++++++++++++++++%%%%%%++++$++++++++++++++++++++++++++",
+" +++++++++++++++++++++++++++++++++++++++++++++++++++++++$ +++++++++++++$+++++++++++++++++++++++++++++++++++++++++++++++%%++++++$++++++++++++++++++++++++++",
+" +++++++++++++++++++++++++++++++++++++++++++++++++++++++$ +++++++++++++$+++++++++++++++++++++++++++++++++++++++++++++++%%++++++$++++++++++++++++++++++++++",
+" +++++++++++++++++++++++++++++++++++++++++++++++++++++++$ +++++++++++++$+++++++++++++++++++++++++++++++++++++++++++++++++++++++$++++++++++++++++++++++++++",
+" +++++++++++++++++++++++++++++++++++++++++++++++++++++++$ +++++++++++++$+++++++++++++++++++++++++++++++++++++++++++++++++++++++$++++++++++++++++++++++++++",
+" +++++++++++++++++++++++++++++++++++++++++++++++++++++++$ +++++++++++++$+++++++++++++++++++++++++++++++++++++++++++++++++++++++$++++++++++++++++++++++++++",
+" +++++++++++++++++++++++++++++++++++++++++++++++++++++++$ $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$++++++++++++++++++++++++++",
+" +++++++++++++++++++++++++++++++++++++++++++++++++++++++$ + @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@",
+" +++++++++++++++++++++++++++++++++++++++++++++++++++++++$ + &&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&",
+" +++++++++++++++++++++++++++++++++++++++++++++++++++++++$ + ********************************************************",
+" $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ + ========================================================",
+" + --------------------------------------------------------",
+" + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;",
+" + >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>",
+" + ,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,",
+"++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ########################################################",
+"++@@@+++++'++'@@@'+'@@@'+'+++'+'@@@'+'@@@'+'@@@'+'@@@'+'@@@'+++++++@@+@+++++++ ))))))))))))))))))))))))))))))))))))))))))))))))))))))))",
+"+@+++@++++@++++++@+++++@+@+++@+@+++++@+++++++++@+@+++@+@+++@+++++++@@+@+++++++ !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!",
+"+@+++@++++@++++++@+++++@+@+++@+@+++++@+++++++++@+@+++@+@+++@+++++++++@++++++++ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~",
+"+'+++'++++'++'@@@'++@@@'+'@@@'+'@@@'+'@@@'+++++'+%@@@%+'@@@'+++++++++@++++++++ {{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{",
+"+@+++@++++@++@+++++++++@+++++@+++++@+@+++@+++++@+@+++@+++++@+++++++++@++++++++ ]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]",
+"+@+++@++++@++@+++++++++@+++++@+++++@+@+++@+++++@+@+++@+++++@+++@++++@+@@++++++ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^",
+"++@@@+++++@++'@@@'+'@@@'+++++'+'@@@'+'@@@'+++++'+'@@@'+'@@@'+++'++++@+@@++++++ ////////////////////////////////////////////////////////",
+"++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ((((((((((((((((((((((((((((((((((((((((((((((((((((((((",
+" ________________________________________________________",
+"++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ",
+"+%@@@%+'@@@++'@@@'+'@@@++'@@@'+'@@@'+'@@@'+'+++'+++'+++++++'+'+++'+'+++++@+++@+'@@@++'@@@'+'@@@'+'@@@'+'@@@'+'@@@'+'@@@'+'+++'+'+++'+'+++'+'+++'+'+++'+'@@@' ",
+"+@+++@+@+++@+@+++++@+++@+@+++++@+++++@+++++@+++@+++@+++++++@+@+++@+@+++++@@+@@+@+++@+@+++@+@+++@+@+++@+@+++@+@+++++++@+++@+++@+@+++@+@+++@+@+++@+@+++@+++++@ ",
+"+@+++@+@+++@+@+++++@+++@+@+++++@+++++@+++++@+++@+++@+++++++@+@++@++@+++++@+@+@+@+++@+@+++@+@+++@+@+++@+@+++@+@+++++++@+++@+++@+@+++@+@+++@++@+@++@+++@+++++@ ",
+"+'@@@'+'@@@++'+++++'+++'+'@@@++'@@@++'+@@'+'@@@'+++'+++++++'+'@@%++'+++++'+++'+'+++'+'+++'+'@@@'+'@++'+'@@@++'@@@'+++'+++'+++'+'+++'+'+++'++%@%++'@@@'+'@@@' ",
+"+@+++@+@+++@+@+++++@+++@+@+++++@+++++@+++@+@+++@+++@+++++++@+@++@++@+++++@+++@+@+++@+@+++@+@+++++@+@+@+@+++@+++++@+++@+++@+++@+@'+'@+@+@+@++@+@++++++@+@++++ ",
+"+@+++@+@+++@+@+++++@+++@+@+++++@+++++@+++@+@+++@+++@+++++++@+@+++@+@+++++@+++@+@+++@+@+++@+@+++++@++@@+@+++@+++++@+++@+++@+++@++@'@++@@+@@+@+++@+++++@+@++++ ",
+"+'+++'+'@@@++'@@@'+@@@@++'@@@'+@+++++'@@@'+'+++'+++@+++'@@@'+'+++'+'@@@%+'+++'+@+++@+'@@@'+'+++++'@@@'+'+++'+'@@@'+++'+++%@@@@+++@+++@+++@+'+++@+'@@@'+'@@@' ",
+"++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ",
+" ::::::::::::::::::::::::::::::::::::::::::::::::::::::::",
+"+++++++++++++ <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<",
+"+++''++++++++ [[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[",
+"+++''++++++++ }}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}",
+"+'''''''''''' ||||||||||||||||||||||||||||||||||||||||||||||||||||||||",
+"+'''''''''''' 11111111111111111111111111111111111111111111111111111111",
+"+++''++++++++ 22222222222222222222222222222222222222222222222222222222",
+"+++''++++++++ 33333333333333333333333333333333333333333333333333333333",
+"+++++++++++++ 44444444444444444444444444444444444444444444444444444444",
+"+++++++++++++ ",
+" ",
+" ",
+" ",
+" ",
+" ",
+" ",
+" ",
+" ",
+" ",
+" ",
+" ",
+"++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ",
+"++@@@+++++@+++@@@++@@@@@+++++@+@@@@@++@@@++@@@@@++@@@+++@@@++++++++@@+@+++++++ ",
+"+@+++@+++@@++@+++@++++@+++++@@+@+++++@++++++++@++@+++@+@+++@+++++++@@+@+++++++ ",
+"+@++@@++++@++++++@+++@@++++@+@+@@@@++@++++++++@++@+++@+@+++@+++++++++@++++++++ ",
+"+@+@+@++++@+++++@++++++@++@++@+@+++@+@@@@++++@++++@@@+++@@@@+++++++++@++++++++ ",
+"+@@++@++++@++++@+++++++@+@@@@@+++++@+@+++@+++@+++@+++@+++++@+++++++++@++++++++ ",
+"+@+++@++++@+++@++++@+++@+++++@+@+++@+@+++@++@++++@+++@+++++@++++++++@+@@++++++ ",
+"++@@@+++++@++@@@@@++@@@++++++@++@@@+++@@@+++@+++++@@@+++@@@++++@++++@+@@++++++ ",
+"++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ",
+" ",
+"++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ",
+"+++@+++@@@@+++@@@++@@@@++@@@@@+@@@@@++@@@++@+++@+++@+++++++@+@+++@+@+++++@+++@+@+++@++@@@++@@@@+++@@@++@@@@+++@@@++@@@@@+@+++@+@+++@+@+++@+@+++@+@+++@+@@@@@ ",
+"++@+@++@+++@+@+++@+@+++@+@+++++@+++++@+++@+@+++@+++@+++++++@+@++@++@+++++@@+@@+@+++@+@+++@+@+++@+@+++@+@+++@+@+++@+++@+++@+++@+@+++@+@+++@+@+++@+@+++@+++++@ ",
+"+@+++@+@+++@+@+++++@+++@+@+++++@+++++@+++++@+++@+++@+++++++@+@+@+++@+++++@+@+@+@@++@+@+++@+@+++@+@+++@+@+++@+@+++++++@+++@+++@+@+++@+@+++@++@+@+++@+@+++++@+ ",
+"+@@@@@+@@@@++@+++++@+++@+@@@@++@@@@++@++@@+@@@@@+++@+++++++@+@@++++@+++++@+++@+@+@+@+@+++@+@@@@++@+++@+@@@@+++@@@++++@+++@+++@+@+++@+@+++@+++@+++++@+++++@++ ",
+"+@+++@+@+++@+@+++++@+++@+@+++++@+++++@+++@+@+++@+++@+++++++@+@+@+++@+++++@+++@+@++@@+@+++@+@+++++@+++@+@+@+++++++@+++@+++@+++@+@+++@+@+@+@++@+@++++@++++@+++ ",
+"+@+++@+@+++@+@+++@+@+++@+@+++++@+++++@+++@+@+++@+++@+++@+++@+@++@++@+++++@+++@+@+++@+@+++@+@+++++@+++@+@++@++@+++@+++@+++@+++@++@+@++@@+@@+@+++@+++@+++@++++ ",
+"+@+++@+@@@@+++@@@++@@@@++@@@@@+@++++++@@@++@+++@+++@++++@@@++@+++@+@@@@@+@+++@+@+++@++@@@++@++++++@@@++@+++@++@@@++++@++++@@@++++@+++@+++@+@+++@+++@+++@@@@@ ",
+"++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++@+++++++++++++++++++++++++++++++++++++++++++++++++++++++ ",
+" ",
+"+++++++++++++ ",
+"+++''++++++++ ",
+"+++''++++++++ ",
+"+'''''''''''' ",
+"+'''''''''''' ",
+"+++''++++++++ ",
+"+++''++++++++ ",
+"+++++++++++++ ",
+"+++++++++++++ "};
diff --git a/wmcube/wmcube/wmcubered.xpm b/wmcube/wmcube/wmcubered.xpm
new file mode 100644
index 000000000000..b3f9918e8a19
--- /dev/null
+++ b/wmcube/wmcube/wmcubered.xpm
@@ -0,0 +1,168 @@
+/* XPM */
+static char * wmcubered_xpm[] = {
+"160 133 32 1",
+" c #0000FF",
+"+ c #000000",
+"@ c #D20005",
+"# c #A80004",
+"$ c #808080",
+"% c #4A0007",
+"& c #D00005",
+"* c #CC0000",
+"= c #C80005",
+"- c #BE0000",
+"; c #B80000",
+"> c #B40004",
+", c #AE0004",
+"' c #7E000C",
+") c #A20004",
+"! c #9C0004",
+"~ c #960004",
+"{ c #900003",
+"] c #8C0003",
+"^ c #860003",
+"/ c #800003",
+"( c #7A0003",
+"_ c #740003",
+": c #700005",
+"< c #6E0003",
+"[ c #680002",
+"} c #620002",
+"| c #5C0000",
+"1 c #5C0002",
+"2 c #580002",
+"3 c #520002",
+"4 c #4E0002",
+" ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ @#",
+" +++++++++++++$+++++++++++++++++++++++++++++++++++++++++++++++++++++++$ ",
+" +++++++++++++$+++++++++++++++++++++++++++++++++++++++++++++++++++++++$ ",
+" +++++++++++++$+++++++++++++++++++++++++++++++++++++++++++++++++++++++$ ",
+" ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ +++++++++++++$+++++++++++++++++++++++++++++++++++++++++++++++++++++++$ ",
+" +++++++++++++++++++++++++++++++++++++++++++++++++++++++$ +++++++++++++$+++++++++++++++++++++++++++++++++++++++++++++++++++++++$ ",
+" +++++++++++++++++++++++++++++++++++++++++++++++++++++++$ +++++++++++++$+++++++++++++++++++++++++++++++++++++++++++++++++++++++$++++++++++++++++++++++++++",
+" +++++++++++++++++++++++++++++++++++++++++++++++++++++++$ +++++++++++++$+++++++++++++++++++++++++++++++++++++++++++++++++++++++$++++++++++++++++++++++++++",
+" +++++++++++++++++++++++++++++++++++++++++++++++++++++++$ +++++++++++++$+++++++++++++++++++++++++++++++++++++++++++++++++++++++$++++++++++++++++++++++++++",
+" +++++++++++++++++++++++++++++++++++++++++++++++++++++++$ +++++++++++++$+++++++++++++++++++++++++++++++++++++++++++++++++++++++$++++++++++++++++++++++++++",
+" +++++++++++++++++++++++++++++++++++++++++++++++++++++++$ +++++++++++++$+++++++++++++++++++++++++++++++++++++++++++++++++++++++$++++++++++++++++++++++++++",
+" +++++++++++++++++++++++++++++++++++++++++++++++++++++++$ +++++++++++++$+++++++++++++++++++++++++++++++++++++++++++++++++++++++$++++++++++++++++++++++++++",
+" +++++++++++++++++++++++++++++++++++++++++++++++++++++++$ +++++++++++++$+++++++++++++++++++++++++++++++++++++++++++++++++++++++$++++++++++++++++++++++++++",
+" +++++++++++++++++++++++++++++++++++++++++++++++++++++++$ +++++++++++++$+++++++++++++++++++++++++++++++++++++++++++++++++++++++$++++++++++++++++++++++++++",
+" +++++++++++++++++++++++++++++++++++++++++++++++++++++++$ +++++++++++++$+++++++++++++++++++++++++++++++++++++++++++++++++++++++$++++++++++++++++++++++++++",
+" +++++++++++++++++++++++++++++++++++++++++++++++++++++++$ +++++++++++++$+++++++++++++++++++++++++++++++++++++++++++++++++++++++$++++++++++++++++++++++++++",
+" +++++++++++++++++++++++++++++++++++++++++++++++++++++++$ +++++++++++++$+++++++++++++++++++++++++++++++++++++++++++++++++++++++$++++++++++++++++++++++++++",
+" +++++++++++++++++++++++++++++++++++++++++++++++++++++++$ +++++++++++++$+++++++++++++++++++++++++++++++++++++++++++++++++++++++$++++++++++++++++++++++++++",
+" +++++++++++++++++++++++++++++++++++++++++++++++++++++++$ +++++++++++++$+++++++++++++++++++++++++++++++++++++++++++++++++++++++$++++++++++++++++++++++++++",
+" +++++++++++++++++++++++++++++++++++++++++++++++++++++++$ +++++++++++++$+++++++++++++++++++++++++++++++++++++++++++++++++++++++$++++++++++++++++++++++++++",
+" +++++++++++++++++++++++++++++++++++++++++++++++++++++++$ +++++++++++++$+++++++++++++++++++++++++++++++++++++++++++++++++++++++$++++++++++++++++++++++++++",
+" +++++++++++++++++++++++++++++++++++++++++++++++++++++++$ +++++++++++++$+++++++++++++++++++++++++++++++++++++++++++++++++++++++$++++++++++++++++++++++++++",
+" +++++++++++++++++++++++++++++++++++++++++++++++++++++++$ +++++++++++++$+++++++++++++++++++++++++++++++++++++++++++++++++++++++$++++++++++++++++++++++++++",
+" +++++++++++++++++++++++++++++++++++++++++++++++++++++++$ +++++++++++++$+++++++++++++++++++++++++++++++++++++++++++++++++++++++$++++++++++++++++++++++++++",
+" +++++++++++++++++++++++++++++++++++++++++++++++++++++++$ +++++++++++++$+++++++++++++++++++++++++++++++++++++++++++++++++++++++$++++++++++++++++++++++++++",
+" +++++++++++++++++++++++++++++++++++++++++++++++++++++++$ +++++++++++++$+++++++++++++++++++++++++++++++++++++++++++++++++++++++$++++++++++++++++++++++++++",
+" +++++++++++++++++++++++++++++++++++++++++++++++++++++++$ +++++++++++++$+++++++++++++++++++++++++++++++++++++++++++++++++++++++$++++++++++++++++++++++++++",
+" +++++++++++++++++++++++++++++++++++++++++++++++++++++++$ +++++++++++++$+++++++++++++++++++++++++++++++++++++++++++++++++++++++$++++++++++++++++++++++++++",
+" +++++++++++++++++++++++++++++++++++++++++++++++++++++++$ +++++++++++++$+++++++++++++++++++++++++++++++++++++++++++++++++++++++$++++++++++++++++++++++++++",
+" +++++++++++++++++++++++++++++++++++++++++++++++++++++++$ +++++++++++++$+++++++++++++++++++++++++++++++++++++++++++++++++++++++$++++++++++++++++++++++++++",
+" +++++++++++++++++++++++++++++++++++++++++++++++++++++++$ +++++++++++++$+++++++++++++++++++++++++++++++++++++++++++++++++++++++$++++++++++++++++++++++++++",
+" +++++++++++++++++++++++++++++++++++++++++++++++++++++++$ +++++++++++++$+++++++++++++++++++++++++++++++++++++++++++++++++++++++$++++++++++++++++++++++++++",
+" +++++++++++++++++++++++++++++++++++++++++++++++++++++++$ +++++++++++++$+++++++++++++++++++++++++++++++++++++++++++++++++++++++$++++++++++++++++++++++++++",
+" +++++++++++++++++++++++++++++++++++++++++++++++++++++++$ +++++++++++++$+++++++++++++++++++++++++++++++++++++++++++++++++++++++$++++++++++++++++++++++++++",
+" +++++++++++++++++++++++++++++++++++++++++++++++++++++++$ +++++++++++++$+++++++++++++++++++++++++++++++++++++++++++++++++++++++$++++++++++++++++++++++++++",
+" +++++++++++++++++++++++++++++++++++++++++++++++++++++++$ +++++++++++++$+++++++++++++++++++++++++++++++++++++++++++++++++++++++$++++++++++++++++++++++++++",
+" +++++++++++++++++++++++++++++++++++++++++++++++++++++++$ +++++++++++++$+++++++++++++++++++++++++++++++++++++++++++++++++++++++$++++++++++++++++++++++++++",
+" +++++++++++++++++++++++++++++++++++++++++++++++++++++++$ +++++++++++++$+++++++++++++++++++++++++++++++++++++++++++++++++++++++$++++++++++++++++++++++++++",
+" +++++++++++++++++++++++++++++++++++++++++++++++++++++++$ +++++++++++++$+++++++++++++++++++++++++++++++++++++++++++++++++++++++$++++++++++++++++++++++++++",
+" +++++++++++++++++++++++++++++++++++++++++++++++++++++++$ +++++++++++++$+++++++++++++++++++++++++++++++++++++++++++++++++++++++$++++++++++++++++++++++++++",
+" +++++++++++++++++++++++++++++++++++++++++++++++++++++++$ +++++++++++++$+++++++++++++++++++++++++++++++++++++++++++++++++++++++$++++++++++++++++++++++++++",
+" +++++++++++++++++++++++++++++++++++++++++++++++++++++++$ +++++++++++++$+++++++++++++++++++++++++++++++++++++++++++++++++++++++$++++++++++++++++++++++++++",
+" +++++++++++++++++++++++++++++++++++++++++++++++++++++++$ +++++++++++++$+++++++++++++++++++++++++++++++++++++++++++++++++++++++$++++++++++++++++++++++++++",
+" +++++++++++++++++++++++++++++++++++++++++++++++++++++++$ +++++++++++++$+++++++++++++++++++++++++++++++++++++++++++++++++++++++$++++++++++++++++++++++++++",
+" +++++++++++++++++++++++++++++++++++++++++++++++++++++++$ +++++++++++++$+++++++++++++++++++++++++++++++++++++++++++++++++++++++$++++++++++++++++++++++++++",
+" +++++++++++++++++++++++++++++++++++++++++++++++++++++++$ +++++++++++++$+++++++++++++++++++++++++++++++++++++++++++++++++++++++$++++++++++++++++++++++++++",
+" +++++++++++++++++++++++++++++++++++++++++++++++++++++++$ +++++++++++++$+++++++++++++++++++++++++++++++++++++++++++++++%%++++++$++++++++++++++++++++++++++",
+" +++++++++++++++++++++++++++++++++++++++++++++++++++++++$ +++++++++++++$+++++++++++++++++++++++++++++++++++++++++++++++%%++++++$++++++++++++++++++++++++++",
+" +++++++++++++++++++++++++++++++++++++++++++++++++++++++$ +++++++++++++$++++++%%%%%%+++++++++++++++++++++++++++++++++%%%%%%++++$++++++++++++++++++++++++++",
+" +++++++++++++++++++++++++++++++++++++++++++++++++++++++$ +++++++++++++$++++++%%%%%%+++++++++++++++++++++++++++++++++%%%%%%++++$++++++++++++++++++++++++++",
+" +++++++++++++++++++++++++++++++++++++++++++++++++++++++$ +++++++++++++$+++++++++++++++++++++++++++++++++++++++++++++++%%++++++$++++++++++++++++++++++++++",
+" +++++++++++++++++++++++++++++++++++++++++++++++++++++++$ +++++++++++++$+++++++++++++++++++++++++++++++++++++++++++++++%%++++++$++++++++++++++++++++++++++",
+" +++++++++++++++++++++++++++++++++++++++++++++++++++++++$ +++++++++++++$+++++++++++++++++++++++++++++++++++++++++++++++++++++++$++++++++++++++++++++++++++",
+" +++++++++++++++++++++++++++++++++++++++++++++++++++++++$ +++++++++++++$+++++++++++++++++++++++++++++++++++++++++++++++++++++++$++++++++++++++++++++++++++",
+" +++++++++++++++++++++++++++++++++++++++++++++++++++++++$ +++++++++++++$+++++++++++++++++++++++++++++++++++++++++++++++++++++++$++++++++++++++++++++++++++",
+" +++++++++++++++++++++++++++++++++++++++++++++++++++++++$ $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$++++++++++++++++++++++++++",
+" +++++++++++++++++++++++++++++++++++++++++++++++++++++++$ + @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@",
+" +++++++++++++++++++++++++++++++++++++++++++++++++++++++$ + &&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&",
+" +++++++++++++++++++++++++++++++++++++++++++++++++++++++$ + ********************************************************",
+" $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ + ========================================================",
+" + --------------------------------------------------------",
+" + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;",
+" + >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>",
+" + ,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,",
+"++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ########################################################",
+"++@@@+++++'++'@@@'+'@@@'+'+++'+'@@@'+'@@@'+'@@@'+'@@@'+'@@@'+++++++@@+@+++++++ ))))))))))))))))))))))))))))))))))))))))))))))))))))))))",
+"+@+++@++++@++++++@+++++@+@+++@+@+++++@+++++++++@+@+++@+@+++@+++++++@@+@+++++++ !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!",
+"+@+++@++++@++++++@+++++@+@+++@+@+++++@+++++++++@+@+++@+@+++@+++++++++@++++++++ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~",
+"+'+++'++++'++'@@@'++@@@'+'@@@'+'@@@'+'@@@'+++++'+%@@@%+'@@@'+++++++++@++++++++ {{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{",
+"+@+++@++++@++@+++++++++@+++++@+++++@+@+++@+++++@+@+++@+++++@+++++++++@++++++++ ]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]",
+"+@+++@++++@++@+++++++++@+++++@+++++@+@+++@+++++@+@+++@+++++@+++@++++@+@@++++++ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^",
+"++@@@+++++@++'@@@'+'@@@'+++++'+'@@@'+'@@@'+++++'+'@@@'+'@@@'+++'++++@+@@++++++ ////////////////////////////////////////////////////////",
+"++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ((((((((((((((((((((((((((((((((((((((((((((((((((((((((",
+" ________________________________________________________",
+"++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ",
+"+%@@@%+'@@@++'@@@'+'@@@++'@@@'+'@@@'+'@@@'+'+++'+++'+++++++'+'+++'+'+++++@+++@+'@@@++'@@@'+'@@@'+'@@@'+'@@@'+'@@@'+'@@@'+'+++'+'+++'+'+++'+'+++'+'+++'+'@@@' ",
+"+@+++@+@+++@+@+++++@+++@+@+++++@+++++@+++++@+++@+++@+++++++@+@+++@+@+++++@@+@@+@+++@+@+++@+@+++@+@+++@+@+++@+@+++++++@+++@+++@+@+++@+@+++@+@+++@+@+++@+++++@ ",
+"+@+++@+@+++@+@+++++@+++@+@+++++@+++++@+++++@+++@+++@+++++++@+@++@++@+++++@+@+@+@+++@+@+++@+@+++@+@+++@+@+++@+@+++++++@+++@+++@+@+++@+@+++@++@+@++@+++@+++++@ ",
+"+'@@@'+'@@@++'+++++'+++'+'@@@++'@@@++'+@@'+'@@@'+++'+++++++'+'@@%++'+++++'+++'+'+++'+'+++'+'@@@'+'@++'+'@@@++'@@@'+++'+++'+++'+'+++'+'+++'++%@%++'@@@'+'@@@' ",
+"+@+++@+@+++@+@+++++@+++@+@+++++@+++++@+++@+@+++@+++@+++++++@+@++@++@+++++@+++@+@+++@+@+++@+@+++++@+@+@+@+++@+++++@+++@+++@+++@+@'+'@+@+@+@++@+@++++++@+@++++ ",
+"+@+++@+@+++@+@+++++@+++@+@+++++@+++++@+++@+@+++@+++@+++++++@+@+++@+@+++++@+++@+@+++@+@+++@+@+++++@++@@+@+++@+++++@+++@+++@+++@++@'@++@@+@@+@+++@+++++@+@++++ ",
+"+'+++'+'@@@++'@@@'+@@@@++'@@@'+@+++++'@@@'+'+++'+++@+++'@@@'+'+++'+'@@@%+'+++'+@+++@+'@@@'+'+++++'@@@'+'+++'+'@@@'+++'+++%@@@@+++@+++@+++@+'+++@+'@@@'+'@@@' ",
+"++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ",
+" ::::::::::::::::::::::::::::::::::::::::::::::::::::::::",
+"+++++++++++++ <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<",
+"+++''++++++++ [[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[",
+"+++''++++++++ }}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}",
+"+'''''''''''' ||||||||||||||||||||||||||||||||||||||||||||||||||||||||",
+"+'''''''''''' 11111111111111111111111111111111111111111111111111111111",
+"+++''++++++++ 22222222222222222222222222222222222222222222222222222222",
+"+++''++++++++ 33333333333333333333333333333333333333333333333333333333",
+"+++++++++++++ 44444444444444444444444444444444444444444444444444444444",
+"+++++++++++++ ",
+" ",
+" ",
+" ",
+" ",
+" ",
+" ",
+" ",
+" ",
+" ",
+" ",
+" ",
+"++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ",
+"++@@@+++++@+++@@@++@@@@@+++++@+@@@@@++@@@++@@@@@++@@@+++@@@++++++++@@+@+++++++ ",
+"+@+++@+++@@++@+++@++++@+++++@@+@+++++@++++++++@++@+++@+@+++@+++++++@@+@+++++++ ",
+"+@++@@++++@++++++@+++@@++++@+@+@@@@++@++++++++@++@+++@+@+++@+++++++++@++++++++ ",
+"+@+@+@++++@+++++@++++++@++@++@+@+++@+@@@@++++@++++@@@+++@@@@+++++++++@++++++++ ",
+"+@@++@++++@++++@+++++++@+@@@@@+++++@+@+++@+++@+++@+++@+++++@+++++++++@++++++++ ",
+"+@+++@++++@+++@++++@+++@+++++@+@+++@+@+++@++@++++@+++@+++++@++++++++@+@@++++++ ",
+"++@@@+++++@++@@@@@++@@@++++++@++@@@+++@@@+++@+++++@@@+++@@@++++@++++@+@@++++++ ",
+"++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ",
+" ",
+"++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ",
+"+++@+++@@@@+++@@@++@@@@++@@@@@+@@@@@++@@@++@+++@+++@+++++++@+@+++@+@+++++@+++@+@+++@++@@@++@@@@+++@@@++@@@@+++@@@++@@@@@+@+++@+@+++@+@+++@+@+++@+@+++@+@@@@@ ",
+"++@+@++@+++@+@+++@+@+++@+@+++++@+++++@+++@+@+++@+++@+++++++@+@++@++@+++++@@+@@+@+++@+@+++@+@+++@+@+++@+@+++@+@+++@+++@+++@+++@+@+++@+@+++@+@+++@+@+++@+++++@ ",
+"+@+++@+@+++@+@+++++@+++@+@+++++@+++++@+++++@+++@+++@+++++++@+@+@+++@+++++@+@+@+@@++@+@+++@+@+++@+@+++@+@+++@+@+++++++@+++@+++@+@+++@+@+++@++@+@+++@+@+++++@+ ",
+"+@@@@@+@@@@++@+++++@+++@+@@@@++@@@@++@++@@+@@@@@+++@+++++++@+@@++++@+++++@+++@+@+@+@+@+++@+@@@@++@+++@+@@@@+++@@@++++@+++@+++@+@+++@+@+++@+++@+++++@+++++@++ ",
+"+@+++@+@+++@+@+++++@+++@+@+++++@+++++@+++@+@+++@+++@+++++++@+@+@+++@+++++@+++@+@++@@+@+++@+@+++++@+++@+@+@+++++++@+++@+++@+++@+@+++@+@+@+@++@+@++++@++++@+++ ",
+"+@+++@+@+++@+@+++@+@+++@+@+++++@+++++@+++@+@+++@+++@+++@+++@+@++@++@+++++@+++@+@+++@+@+++@+@+++++@+++@+@++@++@+++@+++@+++@+++@++@+@++@@+@@+@+++@+++@+++@++++ ",
+"+@+++@+@@@@+++@@@++@@@@++@@@@@+@++++++@@@++@+++@+++@++++@@@++@+++@+@@@@@+@+++@+@+++@++@@@++@++++++@@@++@+++@++@@@++++@++++@@@++++@+++@+++@+@+++@+++@+++@@@@@ ",
+"++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++@+++++++++++++++++++++++++++++++++++++++++++++++++++++++ ",
+" ",
+"+++++++++++++ ",
+"+++''++++++++ ",
+"+++''++++++++ ",
+"+'''''''''''' ",
+"+'''''''''''' ",
+"+++''++++++++ ",
+"+++''++++++++ ",
+"+++++++++++++ ",
+"+++++++++++++ "};
diff --git a/wmcube/wmcube/wmcubeyellow.xpm b/wmcube/wmcube/wmcubeyellow.xpm
new file mode 100644
index 000000000000..91b71567726e
--- /dev/null
+++ b/wmcube/wmcube/wmcubeyellow.xpm
@@ -0,0 +1,168 @@
+/* XPM */
+static char * wmcubeyellow_xpm[] = {
+"160 133 32 1",
+" c #0000FF",
+"+ c #000000",
+"@ c #D2CB00",
+"# c #A8A200",
+"$ c #808080",
+"% c #4A4200",
+"& c #D0C900",
+"* c #CCCA00",
+"= c #C8C100",
+"- c #BEBC00",
+"; c #B8B600",
+"> c #B4AE00",
+", c #AEA800",
+"' c #7E7100",
+") c #A29C00",
+"! c #9C9600",
+"~ c #969100",
+"{ c #908B00",
+"] c #8C8700",
+"^ c #868100",
+"/ c #807B00",
+"( c #7A7600",
+"_ c #747000",
+": c #706900",
+"< c #6E6A00",
+"[ c #686400",
+"} c #625F00",
+"| c #5C5B00",
+"1 c #5C5900",
+"2 c #585500",
+"3 c #524F00",
+"4 c #4E4B00",
+" ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ @#",
+" +++++++++++++$+++++++++++++++++++++++++++++++++++++++++++++++++++++++$ ",
+" +++++++++++++$+++++++++++++++++++++++++++++++++++++++++++++++++++++++$ ",
+" +++++++++++++$+++++++++++++++++++++++++++++++++++++++++++++++++++++++$ ",
+" ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ +++++++++++++$+++++++++++++++++++++++++++++++++++++++++++++++++++++++$ ",
+" +++++++++++++++++++++++++++++++++++++++++++++++++++++++$ +++++++++++++$+++++++++++++++++++++++++++++++++++++++++++++++++++++++$ ",
+" +++++++++++++++++++++++++++++++++++++++++++++++++++++++$ +++++++++++++$+++++++++++++++++++++++++++++++++++++++++++++++++++++++$++++++++++++++++++++++++++",
+" +++++++++++++++++++++++++++++++++++++++++++++++++++++++$ +++++++++++++$+++++++++++++++++++++++++++++++++++++++++++++++++++++++$++++++++++++++++++++++++++",
+" +++++++++++++++++++++++++++++++++++++++++++++++++++++++$ +++++++++++++$+++++++++++++++++++++++++++++++++++++++++++++++++++++++$++++++++++++++++++++++++++",
+" +++++++++++++++++++++++++++++++++++++++++++++++++++++++$ +++++++++++++$+++++++++++++++++++++++++++++++++++++++++++++++++++++++$++++++++++++++++++++++++++",
+" +++++++++++++++++++++++++++++++++++++++++++++++++++++++$ +++++++++++++$+++++++++++++++++++++++++++++++++++++++++++++++++++++++$++++++++++++++++++++++++++",
+" +++++++++++++++++++++++++++++++++++++++++++++++++++++++$ +++++++++++++$+++++++++++++++++++++++++++++++++++++++++++++++++++++++$++++++++++++++++++++++++++",
+" +++++++++++++++++++++++++++++++++++++++++++++++++++++++$ +++++++++++++$+++++++++++++++++++++++++++++++++++++++++++++++++++++++$++++++++++++++++++++++++++",
+" +++++++++++++++++++++++++++++++++++++++++++++++++++++++$ +++++++++++++$+++++++++++++++++++++++++++++++++++++++++++++++++++++++$++++++++++++++++++++++++++",
+" +++++++++++++++++++++++++++++++++++++++++++++++++++++++$ +++++++++++++$+++++++++++++++++++++++++++++++++++++++++++++++++++++++$++++++++++++++++++++++++++",
+" +++++++++++++++++++++++++++++++++++++++++++++++++++++++$ +++++++++++++$+++++++++++++++++++++++++++++++++++++++++++++++++++++++$++++++++++++++++++++++++++",
+" +++++++++++++++++++++++++++++++++++++++++++++++++++++++$ +++++++++++++$+++++++++++++++++++++++++++++++++++++++++++++++++++++++$++++++++++++++++++++++++++",
+" +++++++++++++++++++++++++++++++++++++++++++++++++++++++$ +++++++++++++$+++++++++++++++++++++++++++++++++++++++++++++++++++++++$++++++++++++++++++++++++++",
+" +++++++++++++++++++++++++++++++++++++++++++++++++++++++$ +++++++++++++$+++++++++++++++++++++++++++++++++++++++++++++++++++++++$++++++++++++++++++++++++++",
+" +++++++++++++++++++++++++++++++++++++++++++++++++++++++$ +++++++++++++$+++++++++++++++++++++++++++++++++++++++++++++++++++++++$++++++++++++++++++++++++++",
+" +++++++++++++++++++++++++++++++++++++++++++++++++++++++$ +++++++++++++$+++++++++++++++++++++++++++++++++++++++++++++++++++++++$++++++++++++++++++++++++++",
+" +++++++++++++++++++++++++++++++++++++++++++++++++++++++$ +++++++++++++$+++++++++++++++++++++++++++++++++++++++++++++++++++++++$++++++++++++++++++++++++++",
+" +++++++++++++++++++++++++++++++++++++++++++++++++++++++$ +++++++++++++$+++++++++++++++++++++++++++++++++++++++++++++++++++++++$++++++++++++++++++++++++++",
+" +++++++++++++++++++++++++++++++++++++++++++++++++++++++$ +++++++++++++$+++++++++++++++++++++++++++++++++++++++++++++++++++++++$++++++++++++++++++++++++++",
+" +++++++++++++++++++++++++++++++++++++++++++++++++++++++$ +++++++++++++$+++++++++++++++++++++++++++++++++++++++++++++++++++++++$++++++++++++++++++++++++++",
+" +++++++++++++++++++++++++++++++++++++++++++++++++++++++$ +++++++++++++$+++++++++++++++++++++++++++++++++++++++++++++++++++++++$++++++++++++++++++++++++++",
+" +++++++++++++++++++++++++++++++++++++++++++++++++++++++$ +++++++++++++$+++++++++++++++++++++++++++++++++++++++++++++++++++++++$++++++++++++++++++++++++++",
+" +++++++++++++++++++++++++++++++++++++++++++++++++++++++$ +++++++++++++$+++++++++++++++++++++++++++++++++++++++++++++++++++++++$++++++++++++++++++++++++++",
+" +++++++++++++++++++++++++++++++++++++++++++++++++++++++$ +++++++++++++$+++++++++++++++++++++++++++++++++++++++++++++++++++++++$++++++++++++++++++++++++++",
+" +++++++++++++++++++++++++++++++++++++++++++++++++++++++$ +++++++++++++$+++++++++++++++++++++++++++++++++++++++++++++++++++++++$++++++++++++++++++++++++++",
+" +++++++++++++++++++++++++++++++++++++++++++++++++++++++$ +++++++++++++$+++++++++++++++++++++++++++++++++++++++++++++++++++++++$++++++++++++++++++++++++++",
+" +++++++++++++++++++++++++++++++++++++++++++++++++++++++$ +++++++++++++$+++++++++++++++++++++++++++++++++++++++++++++++++++++++$++++++++++++++++++++++++++",
+" +++++++++++++++++++++++++++++++++++++++++++++++++++++++$ +++++++++++++$+++++++++++++++++++++++++++++++++++++++++++++++++++++++$++++++++++++++++++++++++++",
+" +++++++++++++++++++++++++++++++++++++++++++++++++++++++$ +++++++++++++$+++++++++++++++++++++++++++++++++++++++++++++++++++++++$++++++++++++++++++++++++++",
+" +++++++++++++++++++++++++++++++++++++++++++++++++++++++$ +++++++++++++$+++++++++++++++++++++++++++++++++++++++++++++++++++++++$++++++++++++++++++++++++++",
+" +++++++++++++++++++++++++++++++++++++++++++++++++++++++$ +++++++++++++$+++++++++++++++++++++++++++++++++++++++++++++++++++++++$++++++++++++++++++++++++++",
+" +++++++++++++++++++++++++++++++++++++++++++++++++++++++$ +++++++++++++$+++++++++++++++++++++++++++++++++++++++++++++++++++++++$++++++++++++++++++++++++++",
+" +++++++++++++++++++++++++++++++++++++++++++++++++++++++$ +++++++++++++$+++++++++++++++++++++++++++++++++++++++++++++++++++++++$++++++++++++++++++++++++++",
+" +++++++++++++++++++++++++++++++++++++++++++++++++++++++$ +++++++++++++$+++++++++++++++++++++++++++++++++++++++++++++++++++++++$++++++++++++++++++++++++++",
+" +++++++++++++++++++++++++++++++++++++++++++++++++++++++$ +++++++++++++$+++++++++++++++++++++++++++++++++++++++++++++++++++++++$++++++++++++++++++++++++++",
+" +++++++++++++++++++++++++++++++++++++++++++++++++++++++$ +++++++++++++$+++++++++++++++++++++++++++++++++++++++++++++++++++++++$++++++++++++++++++++++++++",
+" +++++++++++++++++++++++++++++++++++++++++++++++++++++++$ +++++++++++++$+++++++++++++++++++++++++++++++++++++++++++++++++++++++$++++++++++++++++++++++++++",
+" +++++++++++++++++++++++++++++++++++++++++++++++++++++++$ +++++++++++++$+++++++++++++++++++++++++++++++++++++++++++++++++++++++$++++++++++++++++++++++++++",
+" +++++++++++++++++++++++++++++++++++++++++++++++++++++++$ +++++++++++++$+++++++++++++++++++++++++++++++++++++++++++++++++++++++$++++++++++++++++++++++++++",
+" +++++++++++++++++++++++++++++++++++++++++++++++++++++++$ +++++++++++++$+++++++++++++++++++++++++++++++++++++++++++++++++++++++$++++++++++++++++++++++++++",
+" +++++++++++++++++++++++++++++++++++++++++++++++++++++++$ +++++++++++++$+++++++++++++++++++++++++++++++++++++++++++++++++++++++$++++++++++++++++++++++++++",
+" +++++++++++++++++++++++++++++++++++++++++++++++++++++++$ +++++++++++++$+++++++++++++++++++++++++++++++++++++++++++++++%%++++++$++++++++++++++++++++++++++",
+" +++++++++++++++++++++++++++++++++++++++++++++++++++++++$ +++++++++++++$+++++++++++++++++++++++++++++++++++++++++++++++%%++++++$++++++++++++++++++++++++++",
+" +++++++++++++++++++++++++++++++++++++++++++++++++++++++$ +++++++++++++$++++++%%%%%%+++++++++++++++++++++++++++++++++%%%%%%++++$++++++++++++++++++++++++++",
+" +++++++++++++++++++++++++++++++++++++++++++++++++++++++$ +++++++++++++$++++++%%%%%%+++++++++++++++++++++++++++++++++%%%%%%++++$++++++++++++++++++++++++++",
+" +++++++++++++++++++++++++++++++++++++++++++++++++++++++$ +++++++++++++$+++++++++++++++++++++++++++++++++++++++++++++++%%++++++$++++++++++++++++++++++++++",
+" +++++++++++++++++++++++++++++++++++++++++++++++++++++++$ +++++++++++++$+++++++++++++++++++++++++++++++++++++++++++++++%%++++++$++++++++++++++++++++++++++",
+" +++++++++++++++++++++++++++++++++++++++++++++++++++++++$ +++++++++++++$+++++++++++++++++++++++++++++++++++++++++++++++++++++++$++++++++++++++++++++++++++",
+" +++++++++++++++++++++++++++++++++++++++++++++++++++++++$ +++++++++++++$+++++++++++++++++++++++++++++++++++++++++++++++++++++++$++++++++++++++++++++++++++",
+" +++++++++++++++++++++++++++++++++++++++++++++++++++++++$ +++++++++++++$+++++++++++++++++++++++++++++++++++++++++++++++++++++++$++++++++++++++++++++++++++",
+" +++++++++++++++++++++++++++++++++++++++++++++++++++++++$ $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$++++++++++++++++++++++++++",
+" +++++++++++++++++++++++++++++++++++++++++++++++++++++++$ + @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@",
+" +++++++++++++++++++++++++++++++++++++++++++++++++++++++$ + &&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&",
+" +++++++++++++++++++++++++++++++++++++++++++++++++++++++$ + ********************************************************",
+" $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ + ========================================================",
+" + --------------------------------------------------------",
+" + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;",
+" + >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>",
+" + ,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,",
+"++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ########################################################",
+"++@@@+++++'++'@@@'+'@@@'+'+++'+'@@@'+'@@@'+'@@@'+'@@@'+'@@@'+++++++@@+@+++++++ ))))))))))))))))))))))))))))))))))))))))))))))))))))))))",
+"+@+++@++++@++++++@+++++@+@+++@+@+++++@+++++++++@+@+++@+@+++@+++++++@@+@+++++++ !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!",
+"+@+++@++++@++++++@+++++@+@+++@+@+++++@+++++++++@+@+++@+@+++@+++++++++@++++++++ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~",
+"+'+++'++++'++'@@@'++@@@'+'@@@'+'@@@'+'@@@'+++++'+%@@@%+'@@@'+++++++++@++++++++ {{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{",
+"+@+++@++++@++@+++++++++@+++++@+++++@+@+++@+++++@+@+++@+++++@+++++++++@++++++++ ]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]",
+"+@+++@++++@++@+++++++++@+++++@+++++@+@+++@+++++@+@+++@+++++@+++@++++@+@@++++++ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^",
+"++@@@+++++@++'@@@'+'@@@'+++++'+'@@@'+'@@@'+++++'+'@@@'+'@@@'+++'++++@+@@++++++ ////////////////////////////////////////////////////////",
+"++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ((((((((((((((((((((((((((((((((((((((((((((((((((((((((",
+" ________________________________________________________",
+"++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ",
+"+%@@@%+'@@@++'@@@'+'@@@++'@@@'+'@@@'+'@@@'+'+++'+++'+++++++'+'+++'+'+++++@+++@+'@@@++'@@@'+'@@@'+'@@@'+'@@@'+'@@@'+'@@@'+'+++'+'+++'+'+++'+'+++'+'+++'+'@@@' ",
+"+@+++@+@+++@+@+++++@+++@+@+++++@+++++@+++++@+++@+++@+++++++@+@+++@+@+++++@@+@@+@+++@+@+++@+@+++@+@+++@+@+++@+@+++++++@+++@+++@+@+++@+@+++@+@+++@+@+++@+++++@ ",
+"+@+++@+@+++@+@+++++@+++@+@+++++@+++++@+++++@+++@+++@+++++++@+@++@++@+++++@+@+@+@+++@+@+++@+@+++@+@+++@+@+++@+@+++++++@+++@+++@+@+++@+@+++@++@+@++@+++@+++++@ ",
+"+'@@@'+'@@@++'+++++'+++'+'@@@++'@@@++'+@@'+'@@@'+++'+++++++'+'@@%++'+++++'+++'+'+++'+'+++'+'@@@'+'@++'+'@@@++'@@@'+++'+++'+++'+'+++'+'+++'++%@%++'@@@'+'@@@' ",
+"+@+++@+@+++@+@+++++@+++@+@+++++@+++++@+++@+@+++@+++@+++++++@+@++@++@+++++@+++@+@+++@+@+++@+@+++++@+@+@+@+++@+++++@+++@+++@+++@+@'+'@+@+@+@++@+@++++++@+@++++ ",
+"+@+++@+@+++@+@+++++@+++@+@+++++@+++++@+++@+@+++@+++@+++++++@+@+++@+@+++++@+++@+@+++@+@+++@+@+++++@++@@+@+++@+++++@+++@+++@+++@++@'@++@@+@@+@+++@+++++@+@++++ ",
+"+'+++'+'@@@++'@@@'+@@@@++'@@@'+@+++++'@@@'+'+++'+++@+++'@@@'+'+++'+'@@@%+'+++'+@+++@+'@@@'+'+++++'@@@'+'+++'+'@@@'+++'+++%@@@@+++@+++@+++@+'+++@+'@@@'+'@@@' ",
+"++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ",
+" ::::::::::::::::::::::::::::::::::::::::::::::::::::::::",
+"+++++++++++++ <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<",
+"+++''++++++++ [[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[",
+"+++''++++++++ }}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}",
+"+'''''''''''' ||||||||||||||||||||||||||||||||||||||||||||||||||||||||",
+"+'''''''''''' 11111111111111111111111111111111111111111111111111111111",
+"+++''++++++++ 22222222222222222222222222222222222222222222222222222222",
+"+++''++++++++ 33333333333333333333333333333333333333333333333333333333",
+"+++++++++++++ 44444444444444444444444444444444444444444444444444444444",
+"+++++++++++++ ",
+" ",
+" ",
+" ",
+" ",
+" ",
+" ",
+" ",
+" ",
+" ",
+" ",
+" ",
+"++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ",
+"++@@@+++++@+++@@@++@@@@@+++++@+@@@@@++@@@++@@@@@++@@@+++@@@++++++++@@+@+++++++ ",
+"+@+++@+++@@++@+++@++++@+++++@@+@+++++@++++++++@++@+++@+@+++@+++++++@@+@+++++++ ",
+"+@++@@++++@++++++@+++@@++++@+@+@@@@++@++++++++@++@+++@+@+++@+++++++++@++++++++ ",
+"+@+@+@++++@+++++@++++++@++@++@+@+++@+@@@@++++@++++@@@+++@@@@+++++++++@++++++++ ",
+"+@@++@++++@++++@+++++++@+@@@@@+++++@+@+++@+++@+++@+++@+++++@+++++++++@++++++++ ",
+"+@+++@++++@+++@++++@+++@+++++@+@+++@+@+++@++@++++@+++@+++++@++++++++@+@@++++++ ",
+"++@@@+++++@++@@@@@++@@@++++++@++@@@+++@@@+++@+++++@@@+++@@@++++@++++@+@@++++++ ",
+"++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ",
+" ",
+"++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ",
+"+++@+++@@@@+++@@@++@@@@++@@@@@+@@@@@++@@@++@+++@+++@+++++++@+@+++@+@+++++@+++@+@+++@++@@@++@@@@+++@@@++@@@@+++@@@++@@@@@+@+++@+@+++@+@+++@+@+++@+@+++@+@@@@@ ",
+"++@+@++@+++@+@+++@+@+++@+@+++++@+++++@+++@+@+++@+++@+++++++@+@++@++@+++++@@+@@+@+++@+@+++@+@+++@+@+++@+@+++@+@+++@+++@+++@+++@+@+++@+@+++@+@+++@+@+++@+++++@ ",
+"+@+++@+@+++@+@+++++@+++@+@+++++@+++++@+++++@+++@+++@+++++++@+@+@+++@+++++@+@+@+@@++@+@+++@+@+++@+@+++@+@+++@+@+++++++@+++@+++@+@+++@+@+++@++@+@+++@+@+++++@+ ",
+"+@@@@@+@@@@++@+++++@+++@+@@@@++@@@@++@++@@+@@@@@+++@+++++++@+@@++++@+++++@+++@+@+@+@+@+++@+@@@@++@+++@+@@@@+++@@@++++@+++@+++@+@+++@+@+++@+++@+++++@+++++@++ ",
+"+@+++@+@+++@+@+++++@+++@+@+++++@+++++@+++@+@+++@+++@+++++++@+@+@+++@+++++@+++@+@++@@+@+++@+@+++++@+++@+@+@+++++++@+++@+++@+++@+@+++@+@+@+@++@+@++++@++++@+++ ",
+"+@+++@+@+++@+@+++@+@+++@+@+++++@+++++@+++@+@+++@+++@+++@+++@+@++@++@+++++@+++@+@+++@+@+++@+@+++++@+++@+@++@++@+++@+++@+++@+++@++@+@++@@+@@+@+++@+++@+++@++++ ",
+"+@+++@+@@@@+++@@@++@@@@++@@@@@+@++++++@@@++@+++@+++@++++@@@++@+++@+@@@@@+@+++@+@+++@++@@@++@++++++@@@++@+++@++@@@++++@++++@@@++++@+++@+++@+@+++@+++@+++@@@@@ ",
+"++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++@+++++++++++++++++++++++++++++++++++++++++++++++++++++++ ",
+" ",
+"+++++++++++++ ",
+"+++''++++++++ ",
+"+++''++++++++ ",
+"+'''''''''''' ",
+"+'''''''''''' ",
+"+++''++++++++ ",
+"+++''++++++++ ",
+"+++++++++++++ ",
+"+++++++++++++ "};
diff --git a/wmcube/wmgeneral/list.c b/wmcube/wmgeneral/list.c
new file mode 100644
index 000000000000..f804b2c7abff
--- /dev/null
+++ b/wmcube/wmgeneral/list.c
@@ -0,0 +1,169 @@
+/* Generic single linked list to keep various information
+ Copyright (C) 1993, 1994 Free Software Foundation, Inc.
+
+
+Author: Kresten Krab Thorup
+
+Many modifications by Alfredo K. Kojima
+
+
+This file is part of GNU CC.
+
+GNU CC is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU CC is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+ int i = 0;
+ while(list)
+ {
+ i += 1;
+ list = list->tail;
+ }
+ return i;
+}
+
+/* Return the Nth element of LIST, where N count from zero. If N
+ larger than the list length, NULL is returned */
+
+INLINE void*
+list_nth(int index, LinkedList* list)
+{
+ while(index-- != 0)
+ {
+ if(list->tail)
+ list = list->tail;
+ else
+ return 0;
+ }
+ return list->head;
+}
+
+/* Remove the element at the head by replacing it by its successor */
+
+INLINE void
+list_remove_head(LinkedList** list)
+{
+ if (!*list) return;
+ if ((*list)->tail)
+ {
+ LinkedList* tail = (*list)->tail; /* fetch next */
+ *(*list) = *tail; /* copy next to list head */
+ free(tail); /* free next */
+ }
+ else /* only one element in list */
+ {
+ free(*list);
+ (*list) = 0;
+ }
+}
+
new file mode 100644
index 000000000000..af0f22c2a882
--- /dev/null
+++ b/wmcube/wmgeneral/list.h
@@ -0,0 +1,59 @@
+/* Generic single linked list to keep various information
+ Copyright (C) 1993, 1994 Free Software Foundation, Inc.
+
+Author: Kresten Krab Thorup
+
+This file is part of GNU CC.
+
+GNU CC is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU CC is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU CC; see the file COPYING. If not, write to
+the Free Software Foundation, 59 Temple Place - Suite 330,
+Boston, MA 02111-1307, USA. */
+
new file mode 100644
index 000000000000..34281e2c089a
--- /dev/null
+++ b/wmcube/wmgeneral/misc.c
@@ -0,0 +1,164 @@
+/* dock.c- built-in Dock module for WindowMaker
+ *
+ * WindowMaker window manager
+ *
+ * Copyright (c) 1997 Alfredo K. Kojima
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+#include <stdlib.h>
+#include <string.h>
+ state = mtable[state][ctype].nstate;
+ ptr++;
+ if (mtable[state][0].output<0) {
+ break;
+ }
+ }
+
+ if (*ret==0)
+ t = NULL;
+ else
+ t = strdup(ret);
+
+ free(ret);
+
+ if (ctype==PRC_EOS)
+ *next = NULL;
+ else
+ *next = ptr;
+
+ return t;
+}
+
+ return 0;
+ }
+
+ if ((pid=fork())==0) {
+ char **args;
+ int i;
+
+ args = malloc(sizeof(char*)*(argc+1));
+ if (!args)
+ exit(10);
+ for (i=0; i<argc; i++) {
+ args[i] = argv[i];
+ }
+ args[argc] = NULL;
+ execvp(argv[0], args);
+ exit(10);
+ }
+ return pid;
+}
diff --git a/wmcube/wmgeneral/misc.h b/wmcube/wmgeneral/misc.h
new file mode 100644
index 000000000000..602e1b76f6e7
--- /dev/null
+++ b/wmcube/wmgeneral/misc.h
@@ -0,0 +1,9 @@
+#ifndef __MISC_H
+#define __MISC_H
+
+#include <unistd.h>
+
+extern void parse_command(char *, char ***, int *);
+
+extern pid_t execCommand(char *);
+#endif /* __MISC_H */
diff --git a/wmcube/wmgeneral/wmgeneral.c b/wmcube/wmgeneral/wmgeneral.c
new file mode 100644
+#include <stdio.h>
+#include <string.h>
+#include <unistd.h>
+ char *tokens = " :\t\n";
+ FILE *fp;
+ int i,key;
+
+ fp = fopen(filename, "r");
+ if (fp) {
+ while (fgets(temp, 128, fp)) {
+ key = 0;
+ q = strdup(temp);
+ q = strtok(q, tokens);
+ while (key >= 0 && keys[key].label) {
+ if ((!strcmp(q, keys[key].label))) {
+ p = strstr(temp, keys[key].label);
+ p += strlen(keys[key].label);
+ p += strspn(p, tokens);
+ if ((i = strcspn(p, "#\n"))) p[i] = 0;
+ free(*keys[key].var);
+ *keys[key].var = strdup(p);
+ key = -1;
+ } else key++;
+ }
+ free(q);
+ }
+ fclose(fp);
+ }
+}
+
+/*******************************************************************************\
+|* parse_rcfile2 *|
+\*******************************************************************************/
+
+void parse_rcfile2(const char *filename, rckeys2 *keys) {
+
+ char *p;
+ char temp[128];
+ char *tokens = " :\t\n";
+ FILE *fp;
+ int i,key;
+ char *family = NULL;
+
+ fp = fopen(filename, "r");
+ if (fp) {
+ while (fgets(temp, 128, fp)) {
+ key = 0;
+ while (key >= 0 && keys[key].label) {
+ if ((p = strstr(temp, keys[key].label))) {
+ p += strlen(keys[key].label);
+ p += strspn(p, tokens);
+ if ((i = strcspn(p, "#\n"))) p[i] = 0;
+ free(*keys[key].var);
+ *keys[key].var = strdup(p);
+ key = -1;
+ } else key++;
+ }
+ }
+ fclose(fp);
+ }
+void RedrawWindowXY(int x, int y) {
+
+int CheckMouseRegion(int x, int y) {
+
+ bwrite = 0;
+ }
+ }
+ }
+void setMaskXY(int x, int y) {
+
+ i++;
+ }
+ }
+
new file mode 100644
+typedef struct {
+ Pixmap pixmap;
+void parse_rcfile(const char *, rckeys *);
+
+#endif
--
2.26.2

Doug Torrance

unread,
May 16, 2020, 7:14:07 PM5/16/20
to Window Maker Development
Yeah, Google flagged them and put them in the pending message folder.
I went in and authorized them, so all should be good now.

Jeremy Sowden

unread,
May 16, 2020, 7:15:27 PM5/16/20
to Window Maker Development
On 2020-05-16, at 19:13:52 -0400, Doug Torrance wrote:
Cheers.

J.
signature.asc

Carlos R. Mafra

unread,
May 17, 2020, 3:27:45 AM5/17/20
to Window Maker Dev
This patch does not apply, if fails with:

error: patch failed: wmcube/wmapp/COPYING:1
error: wmcube/wmapp/COPYING: patch does not apply
Patch failed at 0001 wmcube: bump to version 1.0.0.

Did you try to apply the patches yourself to a mock repository?

Because it seems the problem is that wmcube/COPYING was created
in the previous two patches, but this patch tries to create it
again:


> wmcube/COPYING | 674 ++++++++

> create mode 100644 wmcube/COPYING

> diff --git a/wmcube/COPYING b/wmcube/COPYING
> new file mode 100644
> index 000000000000..94a9ed024d38
> --- /dev/null
> +++ b/wmcube/COPYING
> @@ -0,0 +1,674 @@
> + GNU GENERAL PUBLIC LICENSE
> + Version 3, 29 June 2007


Can you double check what is going on?

Do you want me to upload the first two patches to the repo so
that you can base the rest on top of it?


Jeremy Sowden

unread,
May 17, 2020, 4:39:09 AM5/17/20
to Window Maker Dev
On 2020-05-17, at 08:27:36 +0100, Carlos R. Mafra wrote:
> This patch does not apply, if fails with:
>
> error: patch failed: wmcube/wmapp/COPYING:1
> error: wmcube/wmapp/COPYING: patch does not apply
> Patch failed at 0001 wmcube: bump to version 1.0.0.
>
> Did you try to apply the patches yourself to a mock repository?
>
> Because it seems the problem is that wmcube/COPYING was created
> in the previous two patches, but this patch tries to create it
> again:
>
>
> > wmcube/COPYING | 674 ++++++++
>
> > create mode 100644 wmcube/COPYING
>
> > diff --git a/wmcube/COPYING b/wmcube/COPYING
> > new file mode 100644
> > index 000000000000..94a9ed024d38
> > --- /dev/null
> > +++ b/wmcube/COPYING
> > @@ -0,0 +1,674 @@
> > + GNU GENERAL PUBLIC LICENSE
> > + Version 3, 29 June 2007
>
>
> Can you double check what is going on?

Some of the patches contain 8-bit characters. The patches that I
generated with git-format-patch apply (and pulling from my repo works),
but git-send-email seems to have mangled them. I will work out what
went wrong and re-send.

> Do you want me to upload the first two patches to the repo so
> that you can base the rest on top of it?

No need.

J.
signature.asc

Jeremy Sowden

unread,
May 17, 2020, 6:53:51 AM5/17/20
to Window Maker Dev
The upstream URL from the Debian package of wmcube no longer works, and
my e-mail to the upstream contact to ask about its status bounced, so I
have extracted the upstream branch from the Debian package and applied
the Debian patches to it with a view to adopting it in dockapps.net.

Some of the patches contain Latin 1, UTF-8 or a mixture of the two.
I've added appropriate content-type and content-transfer-encoding
headers to the 8-bit patches. In order to prevent git-am from
complaining about not being able to convert the metadata of the mixed
encodings to UTF-8, please pass `--no-utf8` to it.

Apologies to Doug for the spam while I was testing: I initially forgot
to suppress the CC's. :)

Doug Torrance (5):
wmcube: imported Upstream version 0.98
wmcube: imported Upstream version 0.99-pre1
wmcube: bump to version 1.0.0.
wmcube: imported Upstream version 1.0.1
wmcube: imported Upstream version 1.0.2

Jeremy Sowden (2):
wmcube: use wmgeneral functions in libdockapp instead of the private
copy.
wmcube: remove root chown from Makefile.

wmcube/3D-objects/2planes-solid.wmc | 23 +
wmcube/3D-objects/4d.wmc | 59 ++
wmcube/3D-objects/8star-small.wmc | 40 +
wmcube/3D-objects/8star.wmc | 40 +
wmcube/3D-objects/CONTRIBUTE | 66 ++
wmcube/3D-objects/README | 54 +
wmcube/3D-objects/X-lines.wmc | 65 ++
wmcube/3D-objects/X-planes.wmc | 68 ++
wmcube/3D-objects/ball-solid.wmc | 104 ++
wmcube/3D-objects/ball.wmc | 83 ++
wmcube/3D-objects/beryllium.wmc | 89 ++
wmcube/3D-objects/celtic.wmc | 71 ++
wmcube/3D-objects/cross.wmc | 63 ++
wmcube/3D-objects/cross2-solid.wmc | 80 ++
wmcube/3D-objects/cross2.wmc | 51 +
wmcube/3D-objects/cross3-solid.wmc | 107 ++
wmcube/3D-objects/cross3.wmc | 95 ++
wmcube/3D-objects/cross4-solid.wmc | 107 ++
wmcube/3D-objects/crystal.wmc | 108 ++
wmcube/3D-objects/cube-solid.wmc | 27 +
wmcube/3D-objects/cube.wmc | 24 +
wmcube/3D-objects/diamond.wmc | 66 ++
wmcube/3D-objects/dice-solid.wmc | 81 ++
wmcube/3D-objects/e.wmc | 69 ++
wmcube/3D-objects/e2.wmc | 160 +++
wmcube/3D-objects/foo.wmc | 149 +++
wmcube/3D-objects/gnustep.wmc | 110 ++
wmcube/3D-objects/hyperpyramid.wmc | 54 +
wmcube/3D-objects/jeep.wmc | 157 +++
wmcube/3D-objects/multicube.wmc | 83 ++
wmcube/3D-objects/peace.wmc | 155 +++
wmcube/3D-objects/pyramid.wmc | 16 +
wmcube/3D-objects/radioactive.wmc | 185 ++++
wmcube/3D-objects/shield.wmc | 197 ++++
wmcube/3D-objects/slackware1.wmc | 130 +++
wmcube/3D-objects/slackware2.wmc | 256 +++++
wmcube/3D-objects/slackware3.wmc | 319 ++++++
wmcube/3D-objects/spaceshuttle.wmc | 382 +++++++
wmcube/3D-objects/spiral.wmc | 49 +
wmcube/3D-objects/star.wmc | 95 ++
wmcube/wmgeneral/misc.h | 9 +
wmcube/wmgeneral/wmgeneral.c | 481 +++++++++
wmcube/wmgeneral/wmgeneral.h | 59 ++
68 files changed, 9182 insertions(+)
create mode 100644 wmcube/3D-objects/2planes-solid.wmc
create mode 100644 wmcube/3D-objects/4d.wmc
create mode 100644 wmcube/3D-objects/8star-small.wmc
create mode 100644 wmcube/3D-objects/8star.wmc
create mode 100644 wmcube/3D-objects/CONTRIBUTE
create mode 100644 wmcube/3D-objects/README
create mode 100644 wmcube/3D-objects/X-lines.wmc
create mode 100644 wmcube/3D-objects/X-planes.wmc
create mode 100644 wmcube/3D-objects/ball-solid.wmc
create mode 100644 wmcube/3D-objects/ball.wmc
create mode 100644 wmcube/3D-objects/beryllium.wmc
create mode 100644 wmcube/3D-objects/celtic.wmc
create mode 100644 wmcube/3D-objects/cross.wmc
create mode 100644 wmcube/3D-objects/cross2-solid.wmc
create mode 100644 wmcube/3D-objects/cross2.wmc
create mode 100644 wmcube/3D-objects/cross3-solid.wmc
create mode 100644 wmcube/3D-objects/cross3.wmc
create mode 100644 wmcube/3D-objects/cross4-solid.wmc
create mode 100644 wmcube/3D-objects/crystal.wmc
create mode 100644 wmcube/3D-objects/cube-solid.wmc
create mode 100644 wmcube/3D-objects/cube.wmc
create mode 100644 wmcube/3D-objects/diamond.wmc
create mode 100644 wmcube/3D-objects/dice-solid.wmc
create mode 100644 wmcube/3D-objects/e.wmc
create mode 100644 wmcube/3D-objects/e2.wmc
create mode 100644 wmcube/3D-objects/foo.wmc
create mode 100644 wmcube/3D-objects/gnustep.wmc
create mode 100644 wmcube/3D-objects/hyperpyramid.wmc
create mode 100644 wmcube/3D-objects/jeep.wmc
create mode 100644 wmcube/3D-objects/multicube.wmc
create mode 100644 wmcube/3D-objects/peace.wmc
create mode 100644 wmcube/3D-objects/pyramid.wmc
create mode 100644 wmcube/3D-objects/radioactive.wmc
create mode 100644 wmcube/3D-objects/shield.wmc
create mode 100644 wmcube/3D-objects/slackware1.wmc
create mode 100644 wmcube/3D-objects/slackware2.wmc
create mode 100644 wmcube/3D-objects/slackware3.wmc
create mode 100644 wmcube/3D-objects/spaceshuttle.wmc
create mode 100644 wmcube/3D-objects/spiral.wmc
create mode 100644 wmcube/3D-objects/star.wmc
create mode 100644 wmcube/3D-objects/starcube.wmc
create mode 100644 wmcube/3D-objects/wmlogo.wmc
create mode 100644 wmcube/CHANGES
create mode 100644 wmcube/COPYING
create mode 100644 wmcube/INSTALL
create mode 100644 wmcube/README
create mode 100644 wmcube/THANKS
create mode 100644 wmcube/wmcube/Makefile
create mode 100644 wmcube/wmcube/Makefile.FREEBSD
create mode 100644 wmcube/wmcube/Makefile.LINUX
create mode 100644 wmcube/wmcube/Makefile.NETBSD
create mode 100644 wmcube/wmcube/Makefile.OPENBSD
create mode 100644 wmcube/wmcube/Makefile.SOLARIS
create mode 100644 wmcube/wmcube/wmcube.1
create mode 100644 wmcube/wmcube/wmcube.c
create mode 100644 wmcube/wmcube/wmcube.xpm
create mode 100644 wmcube/wmcube/wmcubeblue.xpm
create mode 100644 wmcube/wmcube/wmcubecyan.xpm
create mode 100644 wmcube/wmcube/wmcubegreen.xpm
create mode 100644 wmcube/wmcube/wmcubemagenta.xpm
create mode 100644 wmcube/wmcube/wmcubered.xpm
create mode 100644 wmcube/wmcube/wmcubeyellow.xpm
create mode 100644 wmcube/wmgeneral/list.c
create mode 100644 wmcube/wmgeneral/list.h
create mode 100644 wmcube/wmgeneral/misc.c
create mode 100644 wmcube/wmgeneral/misc.h
create mode 100644 wmcube/wmgeneral/wmgeneral.c
create mode 100644 wmcube/wmgeneral/wmgeneral.h

--
2.26.2

Jeremy Sowden

unread,
May 17, 2020, 6:53:52 AM5/17/20
to Window Maker Dev

Jeremy Sowden

unread,
May 17, 2020, 6:53:52 AM5/17/20
to Window Maker Dev
Signed-off-by: Jeremy Sowden <jer...@azazel.net>
---
wmcube/wmcube/Makefile | 1 -
1 file changed, 1 deletion(-)

diff --git a/wmcube/wmcube/Makefile b/wmcube/wmcube/Makefile
index 5039dd75942a..973532b54ad4 100644
--- a/wmcube/wmcube/Makefile
+++ b/wmcube/wmcube/Makefile
@@ -39,7 +39,6 @@ clean::
install:: wmcube
cp -f wmcube $(BINDIR)
chmod 755 $(BINDIR)/wmcube
- chown root:root $(BINDIR)/wmcube
mkdir -p $(DOCDIR)
cp -p ../CHANGES ../COPYING ../INSTALL ../README ../THANKS $(DOCDIR)
cp -pr ../3D-objects $(DOCDIR)
--
2.26.2

Jeremy Sowden

unread,
May 17, 2020, 6:53:52 AM5/17/20
to Window Maker Dev

Jeremy Sowden

unread,
May 17, 2020, 6:53:52 AM5/17/20
to Window Maker Dev
Signed-off-by: Jeremy Sowden <jer...@azazel.net>
---
wmcube/wmcube/Makefile | 7 ++-----
wmcube/wmcube/wmcube.c | 4 ++--
2 files changed, 4 insertions(+), 7 deletions(-)

diff --git a/wmcube/wmcube/Makefile b/wmcube/wmcube/Makefile
index 9109993c181d..5039dd75942a 100644
--- a/wmcube/wmcube/Makefile
+++ b/wmcube/wmcube/Makefile
@@ -16,13 +16,10 @@ OBJDIR = $(PREFIX)/share/wmcube
# Edit OSLIBS as appropriate to include OS specific libraries.

OSLIBS =
-LIBS = -lXpm -lXext -lX11 -lm $(OSLIBS)
+LIBS = -lXpm -lXext -lX11 -ldockapp -lm $(OSLIBS)
CFLAGS = -Wall -O2

-OBJS = wmcube.o \
- ../wmgeneral/wmgeneral.o \
- ../wmgeneral/misc.o \
- ../wmgeneral/list.o

Jeremy Sowden

unread,
May 17, 2020, 6:53:52 AM5/17/20
to Window Maker Dev

Jeremy Sowden

unread,
May 17, 2020, 6:53:53 AM5/17/20
to Window Maker Dev

Jeremy Sowden

unread,
May 17, 2020, 6:53:54 AM5/17/20
to Window Maker Dev
Reply all
Reply to author
Forward
0 new messages