g_message("this image bit depth is currently unhandled\n");
}
}
+
+int RrColorRed(const RrColor *c)
+{
+ return c->r;
+}
+
+int RrColorGreen(const RrColor *c)
+{
+ return c->g;
+}
+
+int RrColorBlue(const RrColor *c)
+{
+ return c->b;
+}
+
+gulong RrColorPixel(const RrColor *c)
+{
+ return c->pixel;
+}
#include "color.h"
#include "mask.h"
#include "theme.h"
-#include "kernel/geom.h"
-#include "kernel/gettext.h"
-#define _(str) gettext(str)
+#include "gettext.h"
#include <X11/Xft/Xft.h>
#include <glib.h>
#include <string.h>
-#include <stdlib.h>
#define ELIPSES "..."
#define ELIPSES_LENGTH(font) \
return (signed) f->xftfont->max_advance_width;
}
-void RrFontDraw(XftDraw *d, RrTextureText *t, Rect *area)
+void RrFontDraw(XftDraw *d, RrTextureText *t, RrRect *area)
{
gint x,y,w,h;
XftColor c;
#define _XFT_NO_COMPAT_ /* no Xft 1 API */
#include <X11/Xft/Xft.h>
#include "render.h"
-#include "kernel/geom.h"
+#include "geom.h"
struct _RrFont {
const RrInstance *inst;
RrFont *RrFontOpen(const RrInstance *inst, char *fontstring);
void RrFontClose(RrFont *f);
-void RrFontDraw(XftDraw *d, RrTextureText *t, Rect *position);
+void RrFontDraw(XftDraw *d, RrTextureText *t, RrRect *position);
#endif /* __font_h */
--- /dev/null
+#ifndef __geom_h
+#define __geom_h
+
+typedef struct {
+ int width;
+ int height;
+} RrSize;
+
+typedef struct {
+ int x;
+ int y;
+ int width;
+ int height;
+} RrRect;
+
+#define RECT_SET(r, nx, ny, w, h) \
+ (r).x = (nx), (r).y = (ny), (r).width = (w), (r).height = (h)
+
+#endif
-#include "kernel/geom.h"
+#include "geom.h"
#include "image.h"
#include "color.h"
#include <glib.h>
-void RrImageDraw(RrPixel32 *target, RrTextureRGBA *rgba, Rect *area)
+void RrImageDraw(RrPixel32 *target, RrTextureRGBA *rgba, RrRect *area)
{
RrPixel32 *draw = rgba->data;
gint c, i, e, t, sfw, sfh;
#define __image_h
#include "render.h"
-#include "../kernel/geom.h"
+#include "geom.h"
-void RrImageDraw(RrPixel32 *target, RrTextureRGBA *rgba, Rect *area);
+void RrImageDraw(RrPixel32 *target, RrTextureRGBA *rgba, RrRect *area);
#endif
}
}
-void RrPixmapMaskDraw(Pixmap p, const RrTextureMask *m, const Rect *area)
+void RrPixmapMaskDraw(Pixmap p, const RrTextureMask *m, const RrRect *area)
{
int x, y;
if (m->mask == None) return; /* no mask given */
#define __mask_h
#include "render.h"
-#include "kernel/geom.h"
+#include "geom.h"
RrPixmapMask *RrPixmapMaskNew(const RrInstance *inst,
gint w, gint h, const gchar *data);
void RrPixmapMaskFree(RrPixmapMask *m);
RrPixmapMask *RrPixmapMaskCopy(const RrPixmapMask *src);
-void RrPixmapMaskDraw(Pixmap p, const RrTextureMask *m, const Rect *area);
+void RrPixmapMaskDraw(Pixmap p, const RrTextureMask *m, const RrRect *area);
#endif
int i, transferred = 0, sw;
RrPixel32 *source, *dest;
Pixmap oldp;
- Rect tarea; /* area in which to draw textures */
+ RrRect tarea; /* area in which to draw textures */
gboolean resized;
if (w <= 0 || h <= 0) return;
RrColor *RrColorParse (const RrInstance *inst, gchar *colorname);
void RrColorFree (RrColor *in);
+gint RrColorRed (const RrColor *c);
+gint RrColorGreen (const RrColor *c);
+gint RrColorBlue (const RrColor *c);
+gulong RrColorPixel (const RrColor *c);
+
RrAppearance *RrAppearanceNew (const RrInstance *inst, gint numtex);
RrAppearance *RrAppearanceCopy (RrAppearance *a);
void RrAppearanceFree (RrAppearance *a);