$(GLIB_CFLAGS) \
$(XML_CFLAGS) \
$(PANGO_CFLAGS) \
+ $(CAIRO_CFLAGS) \
-DG_LOG_DOMAIN=\"ObRender\" \
-DDEFAULT_THEME=\"$(theme)\"
obrender_libobrender_la_LDFLAGS = \
obrender_libobrender_la_LIBADD = \
$(X_LIBS) \
$(PANGO_LIBS) \
+ $(CAIRO_LIBS) \
$(GLIB_LIBS) \
$(XML_LIBS)
obrender_libobrender_la_SOURCES = \
obrender/render.h \
obrender/render.c \
obrender/theme.h \
- obrender/theme.c
+ obrender/theme.c \
+ obrender/window.h \
+ obrender/window.c
## obt ##
AC_SUBST(PANGO_CFLAGS)
AC_SUBST(PANGO_LIBS)
+PKG_CHECK_MODULES(CAIRO, [cairo-xlib])
+AC_SUBST(CAIRO_CFLAGS)
+AC_SUBST(CAIRO_LIBS)
+
PKG_CHECK_MODULES(XML, [libxml-2.0 >= 2.6.0])
AC_SUBST(XML_CFLAGS)
AC_SUBST(XML_LIBS)
typedef struct _RrImage RrImage;
typedef struct _RrImagePic RrImagePic;
typedef struct _RrImageCache RrImageCache;
+typedef struct _RrWindow RrWindow;
typedef guint32 RrPixel32;
typedef guint16 RrPixel16;
--- /dev/null
+/* -*- indent-tabs-mode: nil; tab-width: 4; c-basic-offset: 4; -*-
+
+ window.c for the Openbox window manager
+ Copyright (c) 2010 Dana Jansens
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ See the COPYING file for a copy of the GNU General Public License.
+*/
+
+#include "window.h"
+#include "instance.h"
+#include "render.h"
+#include <cairo.h>
+#include <cairo-xlib.h>
+
+struct _RrWindow {
+ guint ref;
+ cairo_surface_t *sur;
+ cairo_t *cr;
+};
+
+
+RrWindow* RrWindowNew(RrInstance *inst)
+{
+ RrWindow *win;
+
+ win = g_slice_new(RrWindow);
+ win->sur = cairo_xlib_surface_create(inst->display, None, inst->visual,
+ 1, 1);
+ win->cr = cairo_create(win->sur);
+
+ return win;
+}
+void RrWindowRef(RrWindow *win)
+{
+ ++win->ref;
+}
+
+void RrWindowUnref(RrWindow *win)
+{
+ if (win && --win->ref < 1) {
+ cairo_destroy(win->cr);
+ cairo_surface_destroy(win->sur);
+ g_slice_free(RrWindow, win);
+ }
+}
--- /dev/null
+/* -*- indent-tabs-mode: nil; tab-width: 4; c-basic-offset: 4; -*-
+
+ window.h for the Openbox window manager
+ Copyright (c) 2010 Dana Jansens
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ See the COPYING file for a copy of the GNU General Public License.
+*/
+
+#ifndef __render_window_h
+#define __render_window_h
+
+#include "render.h"
+#include "geom.h"
+
+RrWindow* RrWindowNew(RrInstance *inst);
+void RrWindowRef(RrWindow *win);
+void RrWindowUnref(RrWindow *win);
+
+#endif