fix jsut committed crasher by rewriting startDrag action
[swfdec.git] / libswfdec / swfdec_pattern.h
blobcc636457116082abb072a17bf3f08a31aae5bf02
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_swf_decoder.h>
26 #include <libswfdec/swfdec_color.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 GObject object;
44 cairo_matrix_t start_transform; /* user-to-pattern transform */
45 cairo_matrix_t end_transform; /* user-to-pattern transform */
48 struct _SwfdecPatternClass
50 GObjectClass object_class;
52 /* create a cairo pattern for the given values */
53 cairo_pattern_t * (* get_pattern) (SwfdecPattern * pattern,
54 const SwfdecColorTransform * trans,
55 guint ratio);
58 GType swfdec_pattern_get_type (void);
60 SwfdecPattern * swfdec_pattern_new_color (SwfdecColor color);
61 SwfdecPattern * swfdec_pattern_parse (SwfdecSwfDecoder * dec);
62 SwfdecPattern * swfdec_pattern_parse_rgba (SwfdecSwfDecoder * dec);
63 SwfdecPattern * swfdec_pattern_parse_morph (SwfdecSwfDecoder * dec);
65 void swfdec_pattern_paint (SwfdecPattern * pattern,
66 cairo_t * cr,
67 const cairo_path_t * path,
68 const SwfdecColorTransform * trans,
69 guint ratio);
70 cairo_pattern_t *swfdec_pattern_get_pattern (SwfdecPattern * pattern,
71 const SwfdecColorTransform * trans,
72 guint ratio);
73 void swfdec_pattern_get_path_extents (SwfdecPattern * pattern,
74 const cairo_path_t * path,
75 SwfdecRect * extents);
77 /* debug */
78 char * swfdec_pattern_to_string (SwfdecPattern * pattern);
80 G_END_DECLS
81 #endif