2 * Copyright (C) 2003-2006 David Schleef <ds@schleef.org>
3 * 2005-2006 Eric Anholt <eric@anholt.net>
4 * 2006 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 <libswfdec/swfdec_graphic.h>
26 #include <libswfdec/swfdec_color.h>
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 */
40 SWFDEC_BUTTON_INIT
= -1,
42 SWFDEC_BUTTON_OVER
= 1,
43 SWFDEC_BUTTON_DOWN
= 2,
47 /* these values have to be kept in line with condition parsing */
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 GList
* 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);