]> Dogcows Code - chaz/openbox/commitdiff
remove rependancy on geom.h from the kernel, provide what is used in its own geom.h
authorDana Jansens <danakj@orodu.net>
Thu, 10 Jul 2003 04:31:34 +0000 (04:31 +0000)
committerDana Jansens <danakj@orodu.net>
Thu, 10 Jul 2003 04:31:34 +0000 (04:31 +0000)
render/color.c
render/font.c
render/font.h
render/geom.h [new file with mode: 0644]
render/image.c
render/image.h
render/mask.c
render/mask.h
render/render.c
render/render.h

index 46f81161e1defaf86e43602538e1a0c13757ccaa..dfdd092c56062046206835eb53ce84bd46717c36 100644 (file)
@@ -242,3 +242,23 @@ void RrIncreaseDepth(const RrInstance *inst, RrPixel32 *data, XImage *im)
         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;
+}
index 67e19ec240831874c73eb4fc629e6d6d4f81cbf5..d2a4acaeed31e0b8177d4903489d136a3b913581 100644 (file)
@@ -2,14 +2,11 @@
 #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) \
@@ -149,7 +146,7 @@ int RrFontMaxCharWidth(const RrFont *f)
     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;
index 85aa9f3efb3e8afadb7099d190c624123b3e0437..6a6f19092c4cf21f95bb0ad4e10a50f1971a4b9f 100644 (file)
@@ -3,7 +3,7 @@
 #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;
@@ -16,5 +16,5 @@ struct _RrFont {
 
 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 */
diff --git a/render/geom.h b/render/geom.h
new file mode 100644 (file)
index 0000000..f6fa4f2
--- /dev/null
@@ -0,0 +1,19 @@
+#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
index acd11858464ff16fba05d5279cbb5e3f9ab15af7..2ec710438cd32632cb8f09aabd97c7404373b1f9 100644 (file)
@@ -1,10 +1,10 @@
-#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;
index 9404e5fa3f7eef758703a74f4ab2e35d8bba56aa..5bf6ea550e70da31800be94bc7066763ae052b2e 100644 (file)
@@ -2,8 +2,8 @@
 #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
index 8b0f21c04eb83a02629358b77588262f437f99c3..60e89d489bf8f4718ad18bb1373110525cc1c3f7 100644 (file)
@@ -25,7 +25,7 @@ void RrPixmapMaskFree(RrPixmapMask *m)
     }
 }
 
-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 */
index b18baffc953e20f6e8a569cb645324bbc6567d78..dccb5a460e73968cdafe59f903f57cecbbd4d77f 100644 (file)
@@ -2,12 +2,12 @@
 #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
index 96866923f568b7ce713e939fe8ea500e1391c3b2..5245d3061ffa494bab24f46d485ef2656618f7d6 100644 (file)
@@ -23,7 +23,7 @@ void RrPaint(RrAppearance *l, Window win, gint w, gint h)
     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;
index 56ec29f19fddc7b646f2db121296dfafd9005969..8a1eda123168abe3474c984490e7254cbc2cddc3 100644 (file)
@@ -166,6 +166,11 @@ RrColor *RrColorNew   (const RrInstance *inst, gint r, gint g, gint b);
 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);
This page took 0.030575 seconds and 4 git commands to generate.