back to development
[swfdec.git] / swfdec / swfdec_button.h
blobb69ed5a2736c47d470428132b26003a60a462b0c
1 /* Swfdec
2 * Copyright (C) 2003-2006 David Schleef <ds@schleef.org>
3 * 2005-2006 Eric Anholt <eric@anholt.net>
4 * 2006-2007 Benjamin Otte <otte@gnome.org>
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin Street, Fifth Floor,
19 * Boston, MA 02110-1301 USA
22 #ifndef _SWFDEC_BUTTON_H_
23 #define _SWFDEC_BUTTON_H_
25 #include <swfdec/swfdec_graphic.h>
26 #include <swfdec/swfdec_color.h>
28 G_BEGIN_DECLS
29 //typedef struct _SwfdecButton SwfdecButton;
30 typedef struct _SwfdecButtonClass SwfdecButtonClass;
32 #define SWFDEC_TYPE_BUTTON (swfdec_button_get_type())
33 #define SWFDEC_IS_BUTTON(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), SWFDEC_TYPE_BUTTON))
34 #define SWFDEC_IS_BUTTON_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), SWFDEC_TYPE_BUTTON))
35 #define SWFDEC_BUTTON(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), SWFDEC_TYPE_BUTTON, SwfdecButton))
36 #define SWFDEC_BUTTON_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), SWFDEC_TYPE_BUTTON, SwfdecButtonClass))
38 /* these values have to be kept in line with record parsing */
39 typedef enum {
40 SWFDEC_BUTTON_INIT = -1,
41 SWFDEC_BUTTON_UP = 0,
42 SWFDEC_BUTTON_OVER = 1,
43 SWFDEC_BUTTON_DOWN = 2,
44 SWFDEC_BUTTON_HIT = 3
45 } SwfdecButtonState;
47 /* these values have to be kept in line with condition parsing */
48 typedef enum {
49 SWFDEC_BUTTON_IDLE_TO_OVER_UP = 0,
50 SWFDEC_BUTTON_OVER_UP_TO_IDLE = 1,
51 SWFDEC_BUTTON_OVER_UP_TO_OVER_DOWN = 2,
52 SWFDEC_BUTTON_OVER_DOWN_TO_OVER_UP = 3,
53 SWFDEC_BUTTON_OVER_DOWN_TO_OUT_DOWN = 4,
54 SWFDEC_BUTTON_OUT_DOWN_TO_OVER_DOWN = 5,
55 SWFDEC_BUTTON_OUT_DOWN_TO_IDLE = 6,
56 SWFDEC_BUTTON_IDLE_TO_OVER_DOWN = 7,
57 SWFDEC_BUTTON_OVER_DOWN_TO_IDLE = 8
58 } SwfdecButtonCondition;
60 struct _SwfdecButton {
61 SwfdecGraphic graphic; /* graphic->extents is used for HIT area extents only */
63 gboolean menubutton; /* treat as menubutton */
65 GSList * records; /* the contained objects */
66 SwfdecEventList * events; /* the events triggered by this button */
67 SwfdecSoundChunk * sounds[4]; /* for meaning of index see DefineButtonSound */
70 struct _SwfdecButtonClass
72 SwfdecGraphicClass graphic_class;
75 GType swfdec_button_get_type (void);
77 int tag_func_define_button (SwfdecSwfDecoder * s,
78 guint tag);
79 int tag_func_define_button_2 (SwfdecSwfDecoder * s,
80 guint tag);
82 G_END_DECLS
83 #endif