first step at rewriting the button code - nothing works, but it compiles
[swfdec.git] / libswfdec / swfdec_pattern.h
blob3fdcf997f2597168e0d7642da7892cfca29cf412
1 /* Swfdec
2 * Copyright (C) 2006-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_PATTERN_H_
21 #define _SWFDEC_PATTERN_H_
23 #include <glib-object.h>
24 #include <cairo.h>
25 #include <libswfdec/swfdec_draw.h>
26 #include <libswfdec/swfdec_swf_decoder.h>
28 G_BEGIN_DECLS
30 typedef struct _SwfdecPattern SwfdecPattern;
31 typedef struct _SwfdecPatternClass SwfdecPatternClass;
33 #define SWFDEC_TYPE_PATTERN (swfdec_pattern_get_type())
34 #define SWFDEC_IS_PATTERN(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), SWFDEC_TYPE_PATTERN))
35 #define SWFDEC_IS_PATTERN_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), SWFDEC_TYPE_PATTERN))
36 #define SWFDEC_PATTERN(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), SWFDEC_TYPE_PATTERN, SwfdecPattern))
37 #define SWFDEC_PATTERN_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), SWFDEC_TYPE_PATTERN, SwfdecPatternClass))
38 #define SWFDEC_PATTERN_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), SWFDEC_TYPE_PATTERN, SwfdecPatternClass))
40 struct _SwfdecPattern
42 SwfdecDraw draw;
44 cairo_matrix_t transform; /* user-to-pattern transform */
45 cairo_matrix_t start_transform; /* start transform */
46 cairo_matrix_t end_transform; /* end transform (if morph) */
49 struct _SwfdecPatternClass
51 SwfdecDrawClass draw_class;
53 /* create a cairo pattern for the given values */
54 cairo_pattern_t * (* get_pattern) (SwfdecPattern * pattern,
55 const SwfdecColorTransform * trans);
58 GType swfdec_pattern_get_type (void);
60 SwfdecPattern * swfdec_pattern_new_color (SwfdecColor color);
61 SwfdecDraw * swfdec_pattern_parse (SwfdecBits * bits,
62 SwfdecSwfDecoder * dec);
63 SwfdecDraw * swfdec_pattern_parse_rgba (SwfdecBits * bits,
64 SwfdecSwfDecoder * dec);
65 SwfdecDraw * swfdec_pattern_parse_morph (SwfdecBits * bits,
66 SwfdecSwfDecoder * dec);
68 cairo_pattern_t *swfdec_pattern_get_pattern (SwfdecPattern * pattern,
69 const SwfdecColorTransform * trans);
71 /* debug */
72 char * swfdec_pattern_to_string (SwfdecPattern * pattern);
74 G_END_DECLS
75 #endif