add borders to planars
authorDana Jansens <danakj@orodu.net>
Mon, 2 Jun 2003 01:20:46 +0000 (01:20 +0000)
committerDana Jansens <danakj@orodu.net>
Mon, 2 Jun 2003 01:20:46 +0000 (01:20 +0000)
render2/planar.c
render2/planar.h
render2/render.h
render2/test.c

index 55e18bdbdb8051677e25a16bf3957a5606a1b26a..e01b67e8a874659010fc8185d696c4bb02741875 100644 (file)
@@ -6,18 +6,25 @@
 #include "debug.h"
 #include "font.h"
 #include <string.h>
+#include <assert.h>
 #include <GL/glx.h>
 
 void RrPlanarSet(struct RrSurface *sur,
                  enum RrSurfaceColorType type,
                  enum RrBevelType bevel,
                  struct RrColor *primary,
-                 struct RrColor *secondary)
+                 struct RrColor *secondary,
+                 int borderwidth,
+                 struct RrColor *border)
 {
     sur->data.planar.colortype = type;
     sur->data.planar.bevel = bevel;
     sur->data.planar.primary = *primary;
     sur->data.planar.secondary = *secondary;
+    assert(borderwidth >= 0);
+    sur->data.planar.borderwidth = borderwidth >= 0 ? borderwidth : 0;
+    if (borderwidth)
+        sur->data.planar.border = *border;
 }
 
 static void copy_parent(struct RrSurface *sur)
index 1877b5cad58f38824d3a2bc9c397f91dcb2ff8a7..bb48aca465011c6ca571f05c82f605e761f3df01 100644 (file)
@@ -9,6 +9,9 @@ struct RrPlanarSurface {
 
     struct RrColor primary;
     struct RrColor secondary;
+
+    int borderwidth;
+    struct RrColor border;
 };
 
 #define RrPlanarColorType(sur) ((sur)->data.planar.colortype)
index 6bff9a1c6e3573721d47d6a83cbc510e5dacc8f5..0a7654719000b06101d0f1e19896f632c77d530d 100644 (file)
@@ -184,7 +184,9 @@ void RrPlanarSet(struct RrSurface *sur,
                  enum RrSurfaceColorType type,
                  enum RrBevelType bevel,
                  struct RrColor *primary,
-                 struct RrColor *secondary);
+                 struct RrColor *secondary,
+                 int borderwidth,
+                 struct RrColor *border);
 
 /* textures */
 
index 261fdbad84e76003d6171b564bf1e5c9a3587dbe..eb76e5c9f96bb39f9c880cc37b05ede335a2ab77 100644 (file)
@@ -67,7 +67,8 @@ int main()
     RrSurfaceSetArea(sur, X, Y, W, H);
     RrColorSet(&pri, 0, 0, 0, 0);
     RrColorSet(&sec, 1, 1, 1, 0);
-    RrPlanarSet(sur, RR_PLANAR_PIPECROSS, RR_RAISED_INNER, &pri, &sec);
+    RrPlanarSet(sur, RR_PLANAR_PIPECROSS, RR_RAISED_INNER, &pri, &sec,
+                0, NULL);
 
     quit = 0;
     while (!quit) {