make numbers garbage-collected objects
[swfdec.git] / swfdec / swfdec_draw.h
blobddb2688da2d6054b29344d6f3b68bacc169ba58b
1 /* Swfdec
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.
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_DRAW_H_
21 #define _SWFDEC_DRAW_H_
23 #include <glib-object.h>
24 #include <cairo.h>
25 #include <swfdec/swfdec_swf_decoder.h>
26 #include <swfdec/swfdec_color.h>
28 G_BEGIN_DECLS
30 //typedef struct _SwfdecDraw SwfdecDraw;
31 typedef struct _SwfdecDrawClass SwfdecDrawClass;
33 #define SWFDEC_TYPE_DRAW (swfdec_draw_get_type())
34 #define SWFDEC_IS_DRAW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), SWFDEC_TYPE_DRAW))
35 #define SWFDEC_IS_DRAW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), SWFDEC_TYPE_DRAW))
36 #define SWFDEC_DRAW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), SWFDEC_TYPE_DRAW, SwfdecDraw))
37 #define SWFDEC_DRAW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), SWFDEC_TYPE_DRAW, SwfdecDrawClass))
38 #define SWFDEC_DRAW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), SWFDEC_TYPE_DRAW, SwfdecDrawClass))
40 struct _SwfdecDraw
42 GObject object;
44 /*< protected >*/
45 gboolean snap; /* this drawing op does pixel snapping on the device grid */
46 SwfdecRect extents; /* extents of path */
47 cairo_path_t path; /* path to draw with this operation - in twips */
48 cairo_path_t end_path; /* end path to draw with this operation if morph operation */
51 struct _SwfdecDrawClass
53 GObjectClass object_class;
55 /* morph this drawing operation using the given ratio */
56 void (* morph) (SwfdecDraw * dest,
57 SwfdecDraw * source,
58 guint ratio);
59 /* paint the current drawing operation */
60 void (* paint) (SwfdecDraw * draw,
61 cairo_t * cr,
62 const SwfdecColorTransform * trans);
63 /* compute extents of this drawing op for the given movie */
64 void (* compute_extents) (SwfdecDraw * draw);
65 /* check if the given coordinate is part of the area rendered to */
66 gboolean (* contains) (SwfdecDraw * draw,
67 cairo_t * cr,
68 double x,
69 double y);
72 GType swfdec_draw_get_type (void);
74 SwfdecDraw * swfdec_draw_morph (SwfdecDraw * draw,
75 guint ratio);
76 SwfdecDraw * swfdec_draw_copy (SwfdecDraw * draw);
77 void swfdec_draw_paint (SwfdecDraw * draw,
78 cairo_t * cr,
79 const SwfdecColorTransform * trans);
80 gboolean swfdec_draw_contains (SwfdecDraw * draw,
81 double x,
82 double y);
83 void swfdec_draw_recompute (SwfdecDraw * draw);
85 G_END_DECLS
86 #endif