2 * Copyright (C) 2007 Benjamin Otte <otte@gnome.org>
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2.1 of the License, or (at your option) any later version.
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin Street, Fifth Floor,
17 * Boston, MA 02110-1301 USA
20 #ifndef __SWFDEC_BOTS_H__
21 #define __SWFDEC_BOTS_H__
23 #include <swfdec/swfdec_buffer.h>
24 #include <swfdec/swfdec_color.h>
25 #include <swfdec/swfdec_rect.h>
29 /* About the name SwfdecBots:
30 * We were (actually, we still are) looking for a good name to match
31 * SwfdecBits, but couldn't come up with anything. So we just translated "bits"
32 * as "Binary Input Token Stream", and as this struct is for output, the name
33 * Bots == "Binary Output Token Stream" suddenly made a lot of sense.
34 * If you find a more natural name, tell us.
36 typedef struct _SwfdecBots SwfdecBots
;
45 #define SWFDEC_OUT_INITIAL (32)
46 #define SWFDEC_OUT_STEP (32)
48 SwfdecBots
* swfdec_bots_open (void);
49 SwfdecBuffer
* swfdec_bots_close (SwfdecBots
* bots
);
50 void swfdec_bots_free (SwfdecBots
* bots
);
52 gsize
swfdec_bots_get_bits (SwfdecBots
* bots
);
53 gsize
swfdec_bots_get_bytes (SwfdecBots
* bots
);
54 gsize
swfdec_bots_left (SwfdecBots
* bots
);
55 void swfdec_bots_ensure_bits (SwfdecBots
* bots
,
57 void swfdec_bots_prepare_bytes (SwfdecBots
* bots
,
60 void swfdec_bots_put_bit (SwfdecBots
* bots
,
62 void swfdec_bots_put_bits (SwfdecBots
* bots
,
65 void swfdec_bots_put_sbits (SwfdecBots
* bots
,
68 void swfdec_bots_put_data (SwfdecBots
* bots
,
71 void swfdec_bots_put_buffer (SwfdecBots
* bots
,
72 SwfdecBuffer
* buffer
);
73 void swfdec_bots_put_bots (SwfdecBots
* bots
,
75 void swfdec_bots_put_u8 (SwfdecBots
* bots
,
77 void swfdec_bots_put_u16 (SwfdecBots
* bots
,
79 void swfdec_bots_put_s16 (SwfdecBots
* bots
,
81 void swfdec_bots_put_u32 (SwfdecBots
* bots
,
83 void swfdec_bots_put_string (SwfdecBots
* bots
,
85 void swfdec_bots_put_double (SwfdecBots
* bots
,
87 void swfdec_bots_put_float (SwfdecBots
* bots
,
90 void swfdec_bots_put_rgb (SwfdecBots
* bots
,
92 void swfdec_bots_put_rgba (SwfdecBots
* bots
,
94 void swfdec_bots_put_rect (SwfdecBots
* bots
,
95 const SwfdecRect
* rect
);
96 void swfdec_bots_put_matrix (SwfdecBots
* bots
,
97 const cairo_matrix_t
* matrix
);
98 void swfdec_bots_put_color_transform (SwfdecBots
* bots
,
99 const SwfdecColorTransform
*trans
);