diff options
author | Søren Sandmann Pedersen <ssp@redhat.com> | 2011-02-25 09:32:28 -0500 |
---|---|---|
committer | Søren Sandmann Pedersen <ssp@redhat.com> | 2011-02-25 09:32:28 -0500 |
commit | 9607f48e1951418cc811d94ea24e360a872c9641 (patch) | |
tree | d88268f275831b89c48742e2959b518366a8ae6d |
Initial check-in
-rw-r--r-- | Makefile | 7 | ||||
-rw-r--r-- | main.c | 38 | ||||
-rw-r--r-- | ocm.h | 12 | ||||
-rw-r--r-- | utils.c | 25 |
4 files changed, 82 insertions, 0 deletions
diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..145f3bb --- /dev/null +++ b/Makefile @@ -0,0 +1,7 @@ +sources := main.c utils.c ocm.h + +%.o: %.c + $(CC) -c $(CFLAGS) $(CPPFLAGS) $< -o $@ + +ocm: utils.o main.o + $(CC) $(filter %.c %.s,$(sources)) -o $@ @@ -0,0 +1,38 @@ +/* Some principles: + * + * - We can only deal with one screen (but know about monitors) + * + * - We don't reparent + * + * - Compositing manager only + * + * - XRender, not OpenGL + * + * - There is no theming + * + * - There is very little configuation + */ +#include <stdlib.h> +#include <X11/Xlib.h> + +typedef struct ocm_screen_t ocm_screen_t; +typedef struct ocm_app_t ocm_app_t; + +struct ocm_app_t +{ + Display *dpy; +}; + +static ocm_app_t * +ocm_app_new (int argc, char **argv) +{ + ocm_app_t *app = malloc (sizeof (*app)); + +} + + +int +main (int argc, char **argv) +{ + +} @@ -0,0 +1,12 @@ +#include <stdlib.h> + +/* utils.c */ + +void +ocm_error (const char *fmt, ...); + +void * +ocm_malloc (size_t n); + +void +ocm_free (void *data); @@ -0,0 +1,25 @@ +#include <stdarg.h> +#include <stdio.h> + +#include "ocm.h" + +void +ocm_error (const char *fmt, ...) +{ + va_list ap; + + va_start (ap, fmt); + vfprintf (stderr, fmt, ap); + va_end (ap); + + exit (-1); +} + +void * +ocm_malloc (size_t n) +{ + void *mem = malloc (n); + + if (!mem) + ocm_error ("Out of memory allocating %d bytes\n", mem); +} |