dws

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

commit 590424ef3748253e1b8c4a8c8312dd0f6a2140ff
parent 2ab3765b9f4e23e34b39decd585a9f46e9f8940f
Author: arg@garbe.us <unknown>
Date:   Thu, 26 Feb 2009 17:09:56 +0000

tiny example
Diffstat:
leinwand.h | 45+++++++++++++++++++++++++++------------------
1 file changed, 27 insertions(+), 18 deletions(-)

diff --git a/leinwand.h b/leinwand.h @@ -85,41 +85,50 @@ struct LScreen { }; struct LSurface { - unsigned int id; - LDisplay *dpy; - LSurface *parent; /* if parent == NULL, then it's the root surface */ - LSurface *childs; - LSurface *prev; - LSurface *next; + unsigned int id; + LDisplay *dpy; + LSurface *parent; /* if parent == NULL, then it's the root surface */ + LSurface **childs; + LSurface *prev; + LSurface *next; }; -LDisplay *LOpen(unsigned int id); +LDisplay *LOpen(const char *server); +void LClose(LDisplay *dpy); -LCompositor *LCreateCompositor(LDisplay *dpy, LCompositorType type); +LScreen *LGetScreens(LDisplay *dpy); -void LClose(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); - -LSurface *LCreateSurface(LDisplay *dpy, LSurface *parent); - +void LUnmapSurface(LDisplay *dpy, LSurface *surface); +void LResizeSurface(LDisplay *dpy, LSurface *surface, LRectangle newsize); void LDestroySurface(LDisplay *dpy, LSurface *surface); -void LSetCompositor(LDisplay *dpy, LSurface *surface, LCompositor *compositor); - 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