dws

a new direct/dynamic/dri/drm based window system
git clone git://git.suckless.org/dws
Log | Files | Refs | README | LICENSE

commit ab4190d503462678aedeeab40fbb1be9045000b4
parent 590424ef3748253e1b8c4a8c8312dd0f6a2140ff
Author: arg@garbe.us <unknown>
Date:   Fri, 27 Feb 2009 14:58:20 +0000

renamed leinwand into dws
Diffstat:
LICENSE | 2+-
Makefile | 28++++++++++++++--------------
README | 14+++++++-------
config.mk | 2+-
dws.c | 7+++++++
dws.h | 123+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
leinwand.c | 7-------
leinwand.h | 134-------------------------------------------------------------------------------
8 files changed, 153 insertions(+), 164 deletions(-)

diff --git a/LICENSE b/LICENSE @@ -1,6 +1,6 @@ MIT/X Consortium License -© 20089Anselm R Garbe <ganselm at garbe dot us> +© 2009 Anselm R Garbe <anselm at garbe dot us> Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), diff --git a/Makefile b/Makefile @@ -1,15 +1,15 @@ -# leinwand - a new DRM-based window system +# dws - a new DRM-based window system # See LICENSE file for copyright and license details. include config.mk -SRC = leinwand.c +SRC = dws.c OBJ = ${SRC:.c=.o} -all: options leinwand +all: options dws options: - @echo leinwand build options: + @echo dws build options: @echo "CFLAGS = ${CFLAGS}" @echo "LDFLAGS = ${LDFLAGS}" @echo "CC = ${CC}" @@ -20,30 +20,30 @@ options: ${OBJ}: config.mk -leinwand: ${OBJ} +dws: ${OBJ} @echo CC -o $@ @${CC} -o $@ ${OBJ} ${LDFLAGS} clean: @echo cleaning - @rm -f leinwand ${OBJ} leinwand-${VERSION}.tar.gz + @rm -f dws ${OBJ} dws-${VERSION}.tar.gz dist: clean @echo creating dist tarball - @mkdir -p leinwand-${VERSION} - @cp -R LICENSE Makefile README config.mk ${SRC} leinwand-${VERSION} - @tar -cf leinwand-${VERSION}.tar leinwand-${VERSION} - @gzip leinwand-${VERSION}.tar - @rm -rf leinwand-${VERSION} + @mkdir -p dws-${VERSION} + @cp -R LICENSE Makefile README config.mk ${SRC} dws-${VERSION} + @tar -cf dws-${VERSION}.tar dws-${VERSION} + @gzip dws-${VERSION}.tar + @rm -rf dws-${VERSION} install: all @echo installing executable file to ${DESTDIR}${PREFIX}/bin @mkdir -p ${DESTDIR}${PREFIX}/bin - @cp -f leinwand ${DESTDIR}${PREFIX}/bin - @chmod 755 ${DESTDIR}${PREFIX}/bin/leinwand + @cp -f dws ${DESTDIR}${PREFIX}/bin + @chmod 755 ${DESTDIR}${PREFIX}/bin/dws uninstall: @echo removing executable file from ${DESTDIR}${PREFIX}/bin - @rm -f ${DESTDIR}${PREFIX}/bin/leinwand + @rm -f ${DESTDIR}${PREFIX}/bin/dws .PHONY: all options clean dist install uninstall diff --git a/README b/README @@ -1,33 +1,33 @@ -leinwand - a new DRM-based window system +dws - a new DRM-based window system ---------------------------------------- -leinwand is a new DRM-based window system in order to replace the obsolete X +dws is a new DRM-based window system in order to replace the obsolete X Window System and to provide a modern and frugal window system on DRM-capable Unices, such as Linux. Requirements ------------ -In order to build leinwand you need the DRM header files (usually part of the +In order to build dws you need the DRM header files (usually part of the linux kernel header files). Installation ------------ -Edit config.mk to match your local setup (leinwand is installed into +Edit config.mk to match your local setup (dws is installed into the /usr/local namespace by default). -Afterwards enter the following command to build and install leinwand +Afterwards enter the following command to build and install dws (if necessary as root): make clean install -Running leinwand +Running dws ---------------- Make sure you have setup DRM in your kernel settings being usable and make sure that you have a proper mode setup for the given screens you drive with DRM. Details on these vary on different platforms and we will extend the manual accordingly in the future. -There is also a legacy leinwand port on top of X11, which we only recommend for +There is also a legacy dws port on top of X11, which we only recommend for trying. diff --git a/config.mk b/config.mk @@ -1,4 +1,4 @@ -# leinwand version +# dws version VERSION = 0.0 # Customize below to fit your system diff --git a/dws.c b/dws.c @@ -0,0 +1,7 @@ +/* See LICENSE file for license details. */ +#include "dws.h" + +int +main(int argc, char *argv[]) { + return 0; +} diff --git a/dws.h b/dws.h @@ -0,0 +1,123 @@ +/* See DICENSE file for license details */ + +typedef enum { + CompositorTypeSrcOver, + CompositorTypeEnd +} DCompositorType; + +typedef enum { + EventTypeKeyPress, + EventTypeKeyRelease, + EventTypeButtonPress, + EventTypeButtonRelease, + EventTypePointerMove, + EventTypeExpose, +} DEventType; + +typedef enum { + InputTypeMouse, + InputTypeKeyboard, + InputTypeEnd +} DInputType; + +typedef struct DCompositor DCompositor; +typedef struct DDisplay DDisplay; +typedef struct DEvent DEvent; +typedef struct DImage DImage; +typedef struct DInput DInput; +typedef struct DRectangle DRectangle; +typedef struct DScreen DScreen; +typedef struct DSurface DSurface; + +struct DRectangle { + int x; + int y; + unsigned int w; + unsigned int h; +}; + +struct DCompositor { + unsigned int id; + DCompositorType type; +}; + +struct DDisplay { + unsigned int id; + DRectangle r; /* virtual rectangle spanned over all screens */ + DCompositor *compositor; + DSurface *surfaces; + DScreen *screens; + DInput *inputs; +}; + +struct DEvent { + unsigned int id; + DEventType type; +}; + +struct DImage{ + unsigned int id; + DRectangle r; + void *data; +}; + +struct DInput { + unsigned int id; + DInputType type; + DInput *next; +}; + +struct DScreen { + unsigned int id; + DDisplay *dpy; + DRectangle r; + DScreen *next; +}; + +struct DSurface { + unsigned int id; + DDisplay *dpy; + DSurface *parent; /* if parent == NULL, then it's the root surface */ + DSurface **childs; + DSurface *prev; + DSurface *next; +}; + +DDisplay *DOpen(const char *server); +void DClose(DDisplay *dpy); + +DScreen *DGetScreens(DDisplay *dpy); + +DCompositor *DCreateCompositor(DDisplay *dpy, DCompositorType type); +void DSetCompositor(DDisplay *dpy, DSurface *root, DCompositor *compositor); + +DSurface *DGetRootSurface(DDisplay *dpy); +DSurface *DCreateSurface(DDisplay *dpy, DSurface *parent, DRectangle size); +void DMapSurface(DDisplay *dpy, DSurface *surface); +void DUnmapSurface(DDisplay *dpy, DSurface *surface); +void DResizeSurface(DDisplay *dpy, DSurface *surface, DRectangle newsize); +void DDestroySurface(DDisplay *dpy, DSurface *surface); + +void DDrawImage(DDisplay *dpy, DSurface *surface, DRectangle destr, DRectangle srcr, DImage *src); +DImage *DCopyImage(DDisplay *dpy, DSurface *surface, DRectangle r); +void DFreeImage(DDisplay *dpy, DImage *img); + +DInput *DGetInput(DDisplay *dpy, DInputType type); + +void DAddEventListener(DDisplay *dpy, void (*listener)(DEvent *event)); +void DRemoveEventListener(DDisplay *dpy, void (*listener)(DEvent *event)); + +void DCommit(DDisplay *dpy); + +#if 0 + + /* hello world example */ + DDisplay *dpy = DOpen(NULL); + DScreen *screen0 = &DGetScreens(dpy)[0]; + DSurface *window = DCreateSurface(dpy, DGetRootSurface(dpy), screen0->r); + DMapSurface(dpy, window); + DCommit(dpy); + DDestroySurface(dpy, window); + DClose(dpy); + +#endif diff --git a/leinwand.c b/leinwand.c @@ -1,7 +0,0 @@ -/* See LICENSE file for license details. */ -#include "leinwand.h" - -int -main(int argc, char *argv[]) { - return 0; -} diff --git a/leinwand.h b/leinwand.h @@ -1,134 +0,0 @@ -/* See LICENSE file for license details */ - -typedef enum { - CompositorTypeSrcOver, - CompositorTypeSrcAtTop, - CompositorTypeSrcIn, - CompositorTypeSrcOut, - CompositorTypeDestOver, - CompositorTypeDestAtTop, - CompositorTypeDestIn, - CompositorTypeDestOut, - CompositorTypeLighter, - CompositorTypeCopy, - CompositorTypeXOR, - CompositorTypeEnd -} LCompositorType; - -typedef enum { - EventTypeKeyPress, - EventTypeKeyRelease, - EventTypeButtonPress, - EventTypeButtonRelease, - EventTypePointerMove, - EventTypeExpose, -} LEventType; - -typedef enum { - InputTypeMouse, - InputTypeKeyboard, - InputTypeEnd -} LInputType; - -typedef struct LCompositor LCompositor; -typedef struct LDisplay LDisplay; -typedef struct LEvent LEvent; -typedef struct LImage LImage; -typedef struct LInput LInput; -typedef struct LRectangle LRectangle; -typedef struct LScreen LScreen; -typedef struct LSurface LSurface; - -struct LRectangle { - int x; - int y; - unsigned int w; - unsigned int h; -}; - -struct LCompositor { - unsigned int id; - LCompositorType type; -}; - -struct LDisplay { - unsigned int id; - LRectangle r; /* virtual rectangle spanned over all screens */ - LCompositor *compositor; - LSurface *surfaces; - LScreen *screens; - LInput *inputs; -}; - -struct LEvent { - unsigned int id; - LEventType type; -}; - -struct LImage{ - unsigned int id; - LRectangle r; - void *data; -}; - -struct LInput { - unsigned int id; - LInputType type; - LInput *next; -}; - -struct LScreen { - unsigned int id; - LDisplay *dpy; - LRectangle r; - LScreen *next; -}; - -struct LSurface { - unsigned int id; - LDisplay *dpy; - LSurface *parent; /* if parent == NULL, then it's the root surface */ - LSurface **childs; - LSurface *prev; - LSurface *next; -}; - -LDisplay *LOpen(const char *server); -void LClose(LDisplay *dpy); - -LScreen *LGetScreens(LDisplay *dpy); - -LCompositor *LGetDefaultCompositor(LDisplay *dpy); -LCompositor *LCreateCompositor(LDisplay *dpy, LCompositorType type); -void LSetCompositor(LDisplay *dpy, LSurface *root, LCompositor *compositor); - -LSurface *LGetRootSurface(LDisplay *dpy); -LSurface *LCreateSurface(LDisplay *dpy, LSurface *parent, LRectangle size); -void LMapSurface(LDisplay *dpy, LSurface *surface); -void LUnmapSurface(LDisplay *dpy, LSurface *surface); -void LResizeSurface(LDisplay *dpy, LSurface *surface, LRectangle newsize); -void LDestroySurface(LDisplay *dpy, LSurface *surface); - -void LDrawImage(LDisplay *dpy, LSurface *surface, LRectangle destr, LRectangle srcr, LImage *src); -LImage *LGetImage(LDisplay *dpy, LSurface *surface, LRectangle r); -void LFreeImage(LDisplay *dpy, LImage *img); - -LInput *LGetInput(LDisplay *dpy, LInputType type); - -void LAddEventHandler(LDisplay *dpy, void (*handler)(LEvent *event)); -void LRemoveEventHandler(LDisplay *dpy, void (*handler)(LEvent *event)); - -void LCommit(LDisplay *dpy); - -#if 0 - - /* hello world example */ - LDisplay *dpy = LOpen(NULL); - LScreen *screen0 = &LGetScreens(dpy)[0]; - LSurface *window = LCreateSurface(dpy, LGetRootSurface(dpy), screen0->r); - LMapSurface(dpy, window); - LCommit(dpy); - LDestroySurface(dpy, window); - LClose(dpy); - -#endif