fix build for --disable-gtk-doc
[swfdec.git] / swfdec / swfdec_bots.h
blob93c120dc693a865e050a2d4f7a6ce52dec1bf050
1 /* Swfdec
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.
8 *
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>
27 G_BEGIN_DECLS
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;
38 struct _SwfdecBots {
39 unsigned char * data;
40 unsigned char * ptr;
41 unsigned int idx;
42 unsigned char * end;
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,
56 unsigned int bits);
57 void swfdec_bots_prepare_bytes (SwfdecBots * bots,
58 unsigned int bytes);
60 void swfdec_bots_put_bit (SwfdecBots * bots,
61 gboolean bit);
62 void swfdec_bots_put_bits (SwfdecBots * bots,
63 guint bits,
64 guint n_bits);
65 void swfdec_bots_put_sbits (SwfdecBots * bots,
66 int bits,
67 guint n_bits);
68 void swfdec_bots_put_data (SwfdecBots * bots,
69 const guint8 * data,
70 guint length);
71 void swfdec_bots_put_buffer (SwfdecBots * bots,
72 SwfdecBuffer * buffer);
73 void swfdec_bots_put_bots (SwfdecBots * bots,
74 SwfdecBots * other);
75 void swfdec_bots_put_u8 (SwfdecBots * bots,
76 guint i);
77 void swfdec_bots_put_u16 (SwfdecBots * bots,
78 guint i);
79 void swfdec_bots_put_s16 (SwfdecBots * bots,
80 gint i);
81 void swfdec_bots_put_u32 (SwfdecBots * bots,
82 guint i);
83 void swfdec_bots_put_string (SwfdecBots * bots,
84 const char * s);
85 void swfdec_bots_put_double (SwfdecBots * bots,
86 double value);
87 void swfdec_bots_put_float (SwfdecBots * bots,
88 float f);
90 void swfdec_bots_put_rgb (SwfdecBots * bots,
91 SwfdecColor color);
92 void swfdec_bots_put_rgba (SwfdecBots * bots,
93 SwfdecColor color);
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);
102 G_END_DECLS
104 #endif