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 __SWFEDIT_TAG_H__
21 #define __SWFEDIT_TAG_H__
23 #include <libswfdec/swfdec_buffer.h>
24 #include <libswfdec/swfdec_bits.h>
25 #include "swfdec_out.h"
26 #include "swfedit_token.h"
30 typedef struct _SwfeditTag SwfeditTag
;
31 typedef struct _SwfeditTagClass SwfeditTagClass
;
32 typedef struct _SwfeditTagDefinition SwfeditTagDefinition
;
34 struct _SwfeditTagDefinition
{
35 const char * name
; /* name to use for this field */
36 SwfeditTokenType type
; /* type of this field */
37 guint n_items
; /* 1-indexed field to look at for item count (or 0 to use 1 item) */
38 gconstpointer hint
; /* hint to pass to field when creating */
41 #define SWFEDIT_TYPE_TAG (swfedit_tag_get_type())
42 #define SWFEDIT_IS_TAG(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), SWFEDIT_TYPE_TAG))
43 #define SWFEDIT_IS_TAG_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), SWFEDIT_TYPE_TAG))
44 #define SWFEDIT_TAG(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), SWFEDIT_TYPE_TAG, SwfeditTag))
45 #define SWFEDIT_TAG_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), SWFEDIT_TYPE_TAG, SwfeditTagClass))
46 #define SWFEDIT_TAG_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), SWFEDIT_TYPE_TAG, SwfeditTagClass))
51 guint tag
; /* tag type */
54 struct _SwfeditTagClass
{
55 SwfeditTokenClass token_class
;
58 GType
swfedit_tag_get_type (void);
60 SwfeditTag
* swfedit_tag_new (SwfeditToken
* parent
,
62 SwfdecBuffer
* buffer
);
64 SwfdecBuffer
* swfedit_tag_write (SwfeditToken
* token
);
65 void swfedit_tag_write_token (SwfeditToken
* token
,
68 void swfedit_tag_add_token (SwfeditToken
* token
,
70 SwfeditTokenType type
,
72 void swfedit_tag_read_token (SwfeditToken
* token
,
75 SwfeditTokenType type
,
77 void swfedit_tag_read_tag (SwfeditToken
* token
,
79 const SwfeditTagDefinition
*def
);