diff src/paint.h @ 23:56f592f56ff7

Fix bug and add linear gradient paint. - fix the bug that forget to clear n_dirty_geos in rdman_redraw_all().
author Thinker K.F. Li <thinker@branda.to>
date Sat, 02 Aug 2008 23:10:42 +0800
parents 83d24300a992
children 59a295651480
line wrap: on
line diff
--- a/src/paint.h	Sat Aug 02 16:20:15 2008 +0800
+++ b/src/paint.h	Sat Aug 02 23:10:42 2008 +0800
@@ -21,4 +21,25 @@
 	 STAILQ_INIT((_paint)->members);	\
      } while(0)					\
 
+
+typedef struct _grad_stop {
+    co_aix offset;
+    co_comp_t r, g, b, a;
+} grad_stop_t;
+
+extern paint_t *paint_linear_new(redraw_man_t *rdman,
+				 co_aix x1, co_aix y1, co_aix x2, co_aix y2);
+extern grad_stop_t *paint_linear_stops(paint_t *paint,
+				       int n_stops,
+				       grad_stop_t *stops);
+#define grad_stop_init(stop, _offset, _r, _g, _b, _a)	\
+    do {						\
+	(stop)->offset = _offset;			\
+	(stop)->r = _r;					\
+	(stop)->g = _g;					\
+	(stop)->b = _b;					\
+	(stop)->a = _a;					\
+    } while(0)
+
+
 #endif /* __PAINT_H_ */