[hackers] [leinwand] reorganized, added initial C stub || arg

From: <hg_AT_suckless.org>
Date: Thu, 26 Feb 2009 13:54:47 +0000 (UTC)

changeset: 1:89e7aee30f9b
tag: tip
user: arg_AT_garbe.us
date: Thu Feb 26 13:54:41 2009 +0000
files: Makefile config.mk leinwand.c leinwand.h
description:
reorganized, added initial C stub

diff -r 88835e7f7920 -r 89e7aee30f9b Makefile
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/Makefile Thu Feb 26 13:54:41 2009 +0000
@@ -0,0 +1,49 @@
+# leinwand - a new DRM-based window system
+# See LICENSE file for copyright and license details.
+
+include config.mk
+
+SRC = leinwand.c
+OBJ = ${SRC:.c=.o}
+
+all: options leinwand
+
+options:
+ @echo leinwand build options:
+ @echo "CFLAGS = ${CFLAGS}"
+ @echo "LDFLAGS = ${LDFLAGS}"
+ @echo "CC = ${CC}"
+
+.c.o:
+ @echo CC $<
+ @${CC} -c ${CFLAGS} $<
+
+${OBJ}: config.mk
+
+leinwand: ${OBJ}
+ @echo CC -o $@
+ @${CC} -o $@ ${OBJ} ${LDFLAGS}
+
+clean:
+ @echo cleaning
+ @rm -f leinwand ${OBJ} leinwand-${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}
+
+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
+
+uninstall:
+ @echo removing executable file from ${DESTDIR}${PREFIX}/bin
+ @rm -f ${DESTDIR}${PREFIX}/bin/leinwand
+
+.PHONY: all options clean dist install uninstall
diff -r 88835e7f7920 -r 89e7aee30f9b config.mk
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/config.mk Thu Feb 26 13:54:41 2009 +0000
@@ -0,0 +1,23 @@
+# leinwand version
+VERSION = 0.0
+
+# Customize below to fit your system
+
+# paths
+PREFIX = /usr/local
+
+# includes and libs
+INCS = -I. -I/usr/include -I/usr/include/linux
+LIBS = -L/usr/lib -lc
+
+# flags
+CPPFLAGS = -DVERSION=\"${VERSION}\" ${XINERAMAFLAGS}
+CFLAGS = -std=c99 -pedantic -Wall -Os ${INCS} ${CPPFLAGS}
+LDFLAGS = -s ${LIBS}
+
+# Solaris
+#CFLAGS = -fast ${INCS} -DVERSION=\"${VERSION}\"
+#LDFLAGS = ${LIBS}
+
+# compiler and linker
+CC = cc
diff -r 88835e7f7920 -r 89e7aee30f9b leinwand.c
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/leinwand.c Thu Feb 26 13:54:41 2009 +0000
@@ -0,0 +1,7 @@
+/* See LICENSE file for license details. */
+#include "leinwand.h"
+
+int
+main(int argc, char *argv[]) {
+ return 0;
+}
diff -r 88835e7f7920 -r 89e7aee30f9b leinwand.h
--- a/leinwand.h Thu Feb 26 12:40:35 2009 +0000
+++ b/leinwand.h Thu Feb 26 13:54:41 2009 +0000
@@ -1,23 +1,4 @@
 /* See LICENSE file for license details */
-
-typedef struct {
- int x;
- int y;
- unsigned int w;
- unsigned int h;
-} LRectangle;
-
-typedef struct _LInput LInput;
-typedef struct _LDisplay LDisplay;
-typedef struct _LScreen LScreen;
-typedef struct _LSurface LSurface;
-struct _LScreen {
- unsigned int id;
- LDisplay *dpy;
- LRectangle r;
- LSurface *surface;
- LScreen *next;
-};
 
 typedef enum {
         ComposerTypeSourceOver,
@@ -34,49 +15,6 @@
         ComposerTypeEnd
 } LComposerType;
 
-typedef struct _LComposer LComposer;
-struct _LDisplay {
- unsigned int id;
- LRectangle vr; /* virtual rectangle convering all screens */
- LComposer *composer;
- LSurface *root; /* root surface tier is 0 */
- LScreen *screens;
- LInput *inputs;
-};
-
-struct _LSurface {
- unsigned int id;
- usingned int tier;
- LDisplay *dpy;
- LSurface *parent;
- LSurface *childs;
- LSurface *next;
-};
-
-struct _LComposer {
- unsigned int id;
- LComposerType type;
-};
-
-typedef struct {
- unsigned int id;
- LRectangle r;
- void *data;
-} LImage;
-
-
-typedef enum {
- InputTypeMouse,
- InputTypeKeyboard,
- InputTypeEnd
-} LInputType;
-
-struct _LInput {
- unsigned int id;
- LInputType type;
- LInput *next;
-};
-
 typedef enum {
         EventTypeKeyPress,
         EventTypeKeyRelease,
@@ -86,9 +24,74 @@
         EventTypeExpose,
 } LEventType;
 
-typedef struct {
- unsigned int id;
- LEventType type;
+typedef enum {
+ InputTypeMouse,
+ InputTypeKeyboard,
+ InputTypeEnd
+} LInputType;
+
+typedef struct _LComposer LComposer;
+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 _LComposer {
+ unsigned int id;
+ LComposerType type;
+};
+
+struct _LDisplay {
+ unsigned int id;
+ LRectangle r; /* virtual rectangle spanned over all screens */
+ LComposer *composer;
+ LSurface *root; /* root surface tier is 0 */
+ 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;
+ LSurface *surface;
+ LScreen *next;
+};
+
+struct _LSurface {
+ unsigned int id;
+ unsigned int tier;
+ LDisplay *dpy;
+ LSurface *parent;
+ LSurface *childs;
+ LSurface *next;
 };
 
 LDisplay *LOpen(unsigned int id);
@@ -97,13 +100,15 @@
 
 void LClose(LDisplay *dpy);
 
-LSurface *LCreateSurface(LDisplay *dpy);
+LSurface *LGetRootSurface(LDisplay *dpy);
+
+LSurface *LCreateSurface(LDisplay *dpy, LSurface *parent);
 
 void LSetComposer(LDisplay *dpy, LSurface *surface, LComposer *composer);
 
 void LDrawSurface(LDisplay *dpy, LSurface *surface, LRectangle destr, LImage *src, LRectangle srcr);
 
-LImage *LGetImagine(LDisplay *dpy, LSurface *surface, LRectangle r);
+LImage *LGetImage(LDisplay *dpy, LSurface *surface, LRectangle r);
 
 void LFreeImage(LDisplay *dpy, LImage *img);
 
@@ -115,4 +120,3 @@
 
 void LRemoveInputHandler(LDisplay *dpy, LInput *input, void (*handler)(LEvent *event));
 
-
Received on Thu Feb 26 2009 - 13:54:47 UTC

This archive was generated by hypermail 2.2.0 : Thu Feb 26 2009 - 14:00:05 UTC