Mercurial > MadButterfly
comparison src/X_main.c @ 822:586e50f82c1f
Unify coding style tag for emacs and vim.
author | Shih-Yuan Lee (FourDollars) <fourdollars@gmail.com> |
---|---|
date | Tue, 14 Sep 2010 01:08:39 +0800 |
parents | e98ae1407ca2 |
children | e6c107b2e271 |
comparison
equal
deleted
inserted
replaced
821:bfdc82bbd6e4 | 822:586e50f82c1f |
---|---|
1 // -*- indent-tabs-mode: t; tab-width: 8; c-basic-offset: 4; -*- | |
2 // vim: sw=4:ts=8:sts=4 | |
1 #include <stdio.h> | 3 #include <stdio.h> |
2 #include <unistd.h> | 4 #include <unistd.h> |
3 #include <sys/time.h> | 5 #include <sys/time.h> |
4 #include <sys/select.h> | 6 #include <sys/select.h> |
5 #include <X11/Xlib.h> | 7 #include <X11/Xlib.h> |
189 rdman_coord_changed(&rdman, coord1); | 191 rdman_coord_changed(&rdman, coord1); |
190 rdman_coord_changed(&rdman, coord2); | 192 rdman_coord_changed(&rdman, coord2); |
191 rdman_add_shape(&rdman, (shape_t *)path1, coord1); | 193 rdman_add_shape(&rdman, (shape_t *)path1, coord1); |
192 rdman_add_shape(&rdman, (shape_t *)path2, coord2); | 194 rdman_add_shape(&rdman, (shape_t *)path2, coord2); |
193 | 195 |
194 | 196 |
195 fill3 = rdman_paint_linear_new(&rdman, 50, 50, 150, 150); | 197 fill3 = rdman_paint_linear_new(&rdman, 50, 50, 150, 150); |
196 grad_stop_init(fill3_stops, 0, 1, 0, 0, 0.5); | 198 grad_stop_init(fill3_stops, 0, 1, 0, 0, 0.5); |
197 grad_stop_init(fill3_stops + 1, 0.5, 0, 1, 0, 0.5); | 199 grad_stop_init(fill3_stops + 1, 0.5, 0, 1, 0, 0.5); |
198 grad_stop_init(fill3_stops + 2, 1, 0, 0, 1, 0.5); | 200 grad_stop_init(fill3_stops + 2, 1, 0, 0, 1, 0.5); |
199 paint_linear_stops(fill3, 3, fill3_stops); | 201 paint_linear_stops(fill3, 3, fill3_stops); |
207 | 209 |
208 tman = mb_tman_new(); | 210 tman = mb_tman_new(); |
209 if(tman) { | 211 if(tman) { |
210 /* Prepare an animation program. */ | 212 /* Prepare an animation program. */ |
211 progm = mb_progm_new(10, &rdman); | 213 progm = mb_progm_new(10, &rdman); |
212 | 214 |
213 MB_TIMEVAL_SET(&start, 0, 0); | 215 MB_TIMEVAL_SET(&start, 0, 0); |
214 MB_TIMEVAL_SET(&playing, 1, 0); | 216 MB_TIMEVAL_SET(&playing, 1, 0); |
215 word = mb_progm_next_word(progm, &start, &playing); | 217 word = mb_progm_next_word(progm, &start, &playing); |
216 | 218 |
217 act = mb_shift_new(50, 50, coord1, word); | 219 act = mb_shift_new(50, 50, coord1, word); |
222 word = mb_progm_next_word(progm, &start, &playing); | 224 word = mb_progm_next_word(progm, &start, &playing); |
223 | 225 |
224 act = mb_shift_new(0, 20, coord1, word); | 226 act = mb_shift_new(0, 20, coord1, word); |
225 act = mb_shift_new(0, -20, coord2, word); | 227 act = mb_shift_new(0, -20, coord2, word); |
226 act = mb_visibility_new(VIS_HIDDEN, coord3, word); | 228 act = mb_visibility_new(VIS_HIDDEN, coord3, word); |
227 | 229 |
228 MB_TIMEVAL_SET(&start, 3, 0); | 230 MB_TIMEVAL_SET(&start, 3, 0); |
229 MB_TIMEVAL_SET(&playing, 2, 0); | 231 MB_TIMEVAL_SET(&playing, 2, 0); |
230 word = mb_progm_next_word(progm, &start, &playing); | 232 word = mb_progm_next_word(progm, &start, &playing); |
231 | 233 |
232 act = mb_shift_new(0, -20, coord1, word); | 234 act = mb_shift_new(0, -20, coord1, word); |
233 act = mb_shift_new(0, 20, coord2, word); | 235 act = mb_shift_new(0, 20, coord2, word); |
234 act = mb_chgcolor_new(0, 0, 1, 0.5, fill1, word); | 236 act = mb_chgcolor_new(0, 0, 1, 0.5, fill1, word); |
235 act = mb_chgcolor_new(1, 0, 0, 0.5, fill2, word); | 237 act = mb_chgcolor_new(1, 0, 0, 0.5, fill2, word); |
236 act = mb_visibility_new(VIS_VISIBLE, coord3, word); | 238 act = mb_visibility_new(VIS_VISIBLE, coord3, word); |
237 | 239 |
238 /* Start playing the program. */ | 240 /* Start playing the program. */ |
239 gettimeofday(&tv, NULL); | 241 gettimeofday(&tv, NULL); |
240 MB_TIMEVAL_SET(&mbtv, tv.tv_sec, tv.tv_usec); | 242 MB_TIMEVAL_SET(&mbtv, tv.tv_sec, tv.tv_usec); |
241 mb_progm_start(progm, tman, &mbtv); | 243 mb_progm_start(progm, tman, &mbtv); |
242 | 244 |