diff options
-rw-r--r-- | src/libdraw/mkfile | 40 | ||||
-rw-r--r-- | src/libdraw/mkwsysrules.sh | 30 | ||||
-rw-r--r-- | src/libdraw/nowsys-alloc.c | 17 | ||||
-rw-r--r-- | src/libdraw/nowsys-cload.c | 11 | ||||
-rw-r--r-- | src/libdraw/nowsys-draw.c | 15 | ||||
-rw-r--r-- | src/libdraw/nowsys-event.c | 0 | ||||
-rw-r--r-- | src/libdraw/nowsys-fill.c | 11 | ||||
-rw-r--r-- | src/libdraw/nowsys-get.c | 0 | ||||
-rw-r--r-- | src/libdraw/nowsys-init.c | 0 | ||||
-rw-r--r-- | src/libdraw/nowsys-itrans.c | 0 | ||||
-rw-r--r-- | src/libdraw/nowsys-keyboard.c | 0 | ||||
-rw-r--r-- | src/libdraw/nowsys-keysym2ucs.c | 0 | ||||
-rw-r--r-- | src/libdraw/nowsys-load.c | 11 | ||||
-rw-r--r-- | src/libdraw/nowsys-mouse.c | 0 | ||||
-rw-r--r-- | src/libdraw/nowsys-pixelbits.c | 12 | ||||
-rw-r--r-- | src/libdraw/nowsys-unload.c | 11 | ||||
-rw-r--r-- | src/libdraw/nowsys-wsys.c | 0 |
17 files changed, 142 insertions, 16 deletions
diff --git a/src/libdraw/mkfile b/src/libdraw/mkfile index 7b372337..da115f31 100644 --- a/src/libdraw/mkfile +++ b/src/libdraw/mkfile @@ -85,21 +85,6 @@ OFILES=\ ml-ltofront.$O\ ml-ltorear.$O\ ml-unload.$O\ - x11-alloc.$O\ - x11-cload.$O\ - x11-draw.$O\ - x11-event.$O\ - x11-fill.$O\ - x11-get.$O\ - x11-init.$O\ - x11-itrans.$O\ - x11-keyboard.$O\ - x11-keysym2ucs.$O\ - x11-load.$O\ - x11-mouse.$O\ - x11-pixelbits.$O\ - x11-unload.$O\ - x11-wsys.$O\ devdraw.$O\ unix.$O\ @@ -111,10 +96,33 @@ HFILES=\ $PLAN9/include/cursor.h\ $PLAN9/include/mouse.h\ $PLAN9/include/keyboard.h\ + +# some of these should move to wsysofiles + +XHFILES=\ x11-inc.h\ x11-memdraw.h\ -CFLAGS=$CFLAGS -I$X11/include +<|sh ./mkwsysrules.sh + +WSYSOFILES=\ + $WSYSTYPE-alloc.$O\ + $WSYSTYPE-cload.$O\ + $WSYSTYPE-draw.$O\ + $WSYSTYPE-event.$O\ + $WSYSTYPE-fill.$O\ + $WSYSTYPE-get.$O\ + $WSYSTYPE-init.$O\ + $WSYSTYPE-itrans.$O\ + $WSYSTYPE-keyboard.$O\ + $WSYSTYPE-keysym2ucs.$O\ + $WSYSTYPE-load.$O\ + $WSYSTYPE-mouse.$O\ + $WSYSTYPE-pixelbits.$O\ + $WSYSTYPE-unload.$O\ + $WSYSTYPE-wsys.$O\ + +OFILES=$OFILES $WSYSOFILES <$PLAN9/src/mksyslib diff --git a/src/libdraw/mkwsysrules.sh b/src/libdraw/mkwsysrules.sh new file mode 100644 index 00000000..9d7f4b9a --- /dev/null +++ b/src/libdraw/mkwsysrules.sh @@ -0,0 +1,30 @@ +#!/bin/sh + +[ -f $PLAN9/config ] && . $PLAN9/config + +if [ "x$X11" = "x" ]; then + if [ -d /usr/X11R6 ]; then + X11=/usr/X11R6 + elif [ -d /usr/local/X11R6 ]; then + X11=/usr/local/X11R6 + else + X11=noX11dir + fi +fi + +if [ "x$WSYSTYPE" = "x" ]; then + if [ -d "$X11/include" ]; then + WSYSTYPE=x11 + else + WSYSTYPE=nowsys + fi +fi + +echo 'WSYSTYPE='$WSYSTYPE +echo 'X11='$X11 + +if [ WSYSTYPE = x11 ]; then + echo 'HFILES=$HFILES $XHFILES' +fi + + diff --git a/src/libdraw/nowsys-alloc.c b/src/libdraw/nowsys-alloc.c new file mode 100644 index 00000000..2c92f6fe --- /dev/null +++ b/src/libdraw/nowsys-alloc.c @@ -0,0 +1,17 @@ +#include <u.h> +#include <libc.h> +#include <draw.h> +#include <memdraw.h> + +Memimage* +allocmemimage(Rectangle r, u32int chan) +{ + return _allocmemimage(r, chan); +} + +void +freememimage(Memimage *m) +{ + _freememimage(m); +} + diff --git a/src/libdraw/nowsys-cload.c b/src/libdraw/nowsys-cload.c new file mode 100644 index 00000000..3d5261d1 --- /dev/null +++ b/src/libdraw/nowsys-cload.c @@ -0,0 +1,11 @@ +#include <u.h> +#include <libc.h> +#include <draw.h> +#include <memdraw.h> + +int +cloadmemimage(Memimage *i, Rectangle r, uchar *data, int ndata) +{ + return _cloadmemimage(i, r, data, ndata); +} + diff --git a/src/libdraw/nowsys-draw.c b/src/libdraw/nowsys-draw.c new file mode 100644 index 00000000..5eac24f0 --- /dev/null +++ b/src/libdraw/nowsys-draw.c @@ -0,0 +1,15 @@ +#include <u.h> +#include <libc.h> +#include <draw.h> +#include <memdraw.h> + +void +memimagedraw(Memimage *dst, Rectangle r, Memimage *src, Point sp, + Memimage *mask, Point mp, int op) +{ + Memdrawparam *par; + + if((par = _memimagedrawsetup(dst, r, src, sp, mask, mp, op)) == nil) + return; + _memimagedraw(par); +} diff --git a/src/libdraw/nowsys-event.c b/src/libdraw/nowsys-event.c new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/src/libdraw/nowsys-event.c diff --git a/src/libdraw/nowsys-fill.c b/src/libdraw/nowsys-fill.c new file mode 100644 index 00000000..d75459f1 --- /dev/null +++ b/src/libdraw/nowsys-fill.c @@ -0,0 +1,11 @@ +#include <u.h> +#include <libc.h> +#include <draw.h> +#include <memdraw.h> + +void +memfillcolor(Memimage *m, u32int val) +{ + _memfillcolor(m, val); +} + diff --git a/src/libdraw/nowsys-get.c b/src/libdraw/nowsys-get.c new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/src/libdraw/nowsys-get.c diff --git a/src/libdraw/nowsys-init.c b/src/libdraw/nowsys-init.c new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/src/libdraw/nowsys-init.c diff --git a/src/libdraw/nowsys-itrans.c b/src/libdraw/nowsys-itrans.c new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/src/libdraw/nowsys-itrans.c diff --git a/src/libdraw/nowsys-keyboard.c b/src/libdraw/nowsys-keyboard.c new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/src/libdraw/nowsys-keyboard.c diff --git a/src/libdraw/nowsys-keysym2ucs.c b/src/libdraw/nowsys-keysym2ucs.c new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/src/libdraw/nowsys-keysym2ucs.c diff --git a/src/libdraw/nowsys-load.c b/src/libdraw/nowsys-load.c new file mode 100644 index 00000000..b0d5fcee --- /dev/null +++ b/src/libdraw/nowsys-load.c @@ -0,0 +1,11 @@ +#include <u.h> +#include <libc.h> +#include <draw.h> +#include <memdraw.h> + +int +loadmemimage(Memimage *i, Rectangle r, uchar *data, int ndata) +{ + return _loadmemimage(i, r, data, ndata); +} + diff --git a/src/libdraw/nowsys-mouse.c b/src/libdraw/nowsys-mouse.c new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/src/libdraw/nowsys-mouse.c diff --git a/src/libdraw/nowsys-pixelbits.c b/src/libdraw/nowsys-pixelbits.c new file mode 100644 index 00000000..de744b96 --- /dev/null +++ b/src/libdraw/nowsys-pixelbits.c @@ -0,0 +1,12 @@ +#include <u.h> +#include <libc.h> +#include <draw.h> +#include <memdraw.h> + +u32int +pixelbits(Memimage *m, Point p) +{ + return _pixelbits(m, p); +} + + diff --git a/src/libdraw/nowsys-unload.c b/src/libdraw/nowsys-unload.c new file mode 100644 index 00000000..38593213 --- /dev/null +++ b/src/libdraw/nowsys-unload.c @@ -0,0 +1,11 @@ +#include <u.h> +#include <libc.h> +#include <draw.h> +#include <memdraw.h> + +int +unloadmemimage(Memimage *i, Rectangle r, uchar *data, int ndata) +{ + return _unloadmemimage(i, r, data, ndata); +} + diff --git a/src/libdraw/nowsys-wsys.c b/src/libdraw/nowsys-wsys.c new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/src/libdraw/nowsys-wsys.c |