comparison tools/mb_c_source.m4 @ 84:42698de1f653

Support translate() function for transform attribute of 'g' tag.
author Thinker K.F. Li <thinker@branda.to>
date Fri, 22 Aug 2008 12:52:48 +0800
parents ea758bb3bbe2
children 9b4a02bcaeb1
comparison
equal deleted inserted replaced
83:ea758bb3bbe2 84:42698de1f653
44 define([STROKE_SHAPE_WITH_PAINT]) 44 define([STROKE_SHAPE_WITH_PAINT])
45 define([STROKE_WIDTH]) 45 define([STROKE_WIDTH])
46 define([GROUP_HIDE],) 46 define([GROUP_HIDE],)
47 define([RECT_HIDE],) 47 define([RECT_HIDE],)
48 define([PATH_HIDE],) 48 define([PATH_HIDE],)
49 define([COORD_TRANSLATE],)
49 divert[]]) 50 divert[]])
50 51
51 define([S_ADD_LINEAR_PAINT],[ 52 define([S_ADD_LINEAR_PAINT],[
52 obj->$1 = paint_linear_new(rdman, $2, $3, $4, $5); 53 obj->$1 = paint_linear_new(rdman, $2, $3, $4, $5);
53 ifelse(COUNT($6),0,,[dnl 54 ifelse(COUNT($6),0,,[dnl
129 [ sh_hide(obj->$1); 130 [ sh_hide(obj->$1);
130 ]]) 131 ]])
131 132
132 define([S_PATH_HIDE],[dnl 133 define([S_PATH_HIDE],[dnl
133 [ sh_hide(obj->$1); 134 [ sh_hide(obj->$1);
135 ]])
136
137 define([S_COORD_TRANSLATE],[dnl
138 [ memset(obj->$1->matrix, 0, sizeof(obj->$1->matrix));
139 obj->$1->matrix[0] = 1;
140 obj->$1->matrix[2] = $2;
141 obj->$1->matrix[4] = 1;
142 obj->$1->matrix[5] = $3;
143 rdman_coord_changed(rdman, obj->$1);
134 ]]) 144 ]])
135 145
136 define([SETUP_VARS],[divert([-1]) 146 define([SETUP_VARS],[divert([-1])
137 define([SIMPORT],[IMPORT(]QUOTE($[]1)[,[S_])]) 147 define([SIMPORT],[IMPORT(]QUOTE($[]1)[,[S_])])
138 SIMPORT([ADD_LINEAR_PAINT]) 148 SIMPORT([ADD_LINEAR_PAINT])
150 SIMPORT([STROKE_SHAPE_WITH_PAINT]) 160 SIMPORT([STROKE_SHAPE_WITH_PAINT])
151 SIMPORT([STROKE_WIDTH]) 161 SIMPORT([STROKE_WIDTH])
152 SIMPORT([GROUP_HIDE]) 162 SIMPORT([GROUP_HIDE])
153 SIMPORT([RECT_HIDE]) 163 SIMPORT([RECT_HIDE])
154 SIMPORT([PATH_HIDE]) 164 SIMPORT([PATH_HIDE])
165 SIMPORT([COORD_TRANSLATE])
155 divert[]]) 166 divert[]])
156 167
157 define([F_ADD_LINEAR_PAINT],[[ 168 define([F_ADD_LINEAR_PAINT],[[
158 stops = paint_linear_stops(obj->$1, 0, NULL); 169 stops = paint_linear_stops(obj->$1, 0, NULL);
159 free(stops); 170 free(stops);
203 define([STROKE_SHAPE_WITH_PAINT]) 214 define([STROKE_SHAPE_WITH_PAINT])
204 define([STROKE_WIDTH]) 215 define([STROKE_WIDTH])
205 define([GROUP_HIDE],) 216 define([GROUP_HIDE],)
206 define([RECT_HIDE],) 217 define([RECT_HIDE],)
207 define([PATH_HIDE],) 218 define([PATH_HIDE],)
219 define([COORD_TRANSLATE],)
208 divert[]]) 220 divert[]])
209 221
210 define([MADBUTTERFLY],[dnl 222 define([MADBUTTERFLY],[dnl
211 [#include <stdio.h> 223 [#include <stdio.h>
212 #include <stdlib.h> 224 #include <stdlib.h>