[hackers] [leinwand] tiny example || arg

From: <hg_AT_suckless.org>
Date: Thu, 26 Feb 2009 17:10:03 +0000 (UTC)

changeset: 5:9368043ad033
tag: tip
user: arg_AT_garbe.us
date: Thu Feb 26 17:09:56 2009 +0000
files: leinwand.h
description:
tiny example

diff -r 05848150cf16 -r 9368043ad033 leinwand.h
--- a/leinwand.h Thu Feb 26 16:47:39 2009 +0000
+++ b/leinwand.h Thu Feb 26 17:09:56 2009 +0000
@@ -85,41 +85,50 @@
 };
 
 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);
-
-LCompositor *LCreateCompositor(LDisplay *dpy, LCompositorType type);
-
+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);
-
-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
Received on Thu Feb 26 2009 - 17:10:03 UTC

This archive was generated by hypermail 2.2.0 : Thu Feb 26 2009 - 17:12:04 UTC