1 #ifndef __SP_IMAGE_H__
2 #define __SP_IMAGE_H__
4 /*
5 * SVG <image> implementation
6 *
7 * Authors:
8 * Lauris Kaplinski <lauris@kaplinski.com>
9 * Edward Flick (EAF)
10 *
11 * Copyright (C) 1999-2005 Authors
12 * Copyright (C) 2000-2001 Ximian, Inc.
13 *
14 * Released under GNU GPL, read the file 'COPYING' for more information
15 */
17 #define SP_TYPE_IMAGE (sp_image_get_type ())
18 #define SP_IMAGE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), SP_TYPE_IMAGE, SPImage))
19 #define SP_IMAGE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), SP_TYPE_IMAGE, SPImageClass))
20 #define SP_IS_IMAGE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), SP_TYPE_IMAGE))
21 #define SP_IS_IMAGE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), SP_TYPE_IMAGE))
23 class SPImage;
24 class SPImageClass;
26 /* SPImage */
28 #include <gdk-pixbuf/gdk-pixbuf.h>
29 #include "svg/svg-length.h"
30 #include "sp-item.h"
31 #include "display/display-forward.h"
33 #define SP_IMAGE_HREF_MODIFIED_FLAG SP_OBJECT_USER_MODIFIED_FLAG_A
35 struct SPImage : public SPItem {
36 SVGLength x;
37 SVGLength y;
38 SVGLength width;
39 SVGLength height;
41 // Added by EAF
42 /* preserveAspectRatio */
43 unsigned int aspect_align : 4;
44 unsigned int aspect_clip : 1;
45 int trimx, trimy, trimwidth, trimheight;
46 double viewx, viewy, viewwidth, viewheight;
48 SPCurve *curve; // This curve is at the image's boundary for snapping
50 gchar *href;
51 #if ENABLE_LCMS
52 gchar *color_profile;
53 #endif // ENABLE_LCMS
55 GdkPixbuf *pixbuf;
56 gchar *pixPath;
57 time_t lastMod;
58 };
60 struct SPImageClass {
61 SPItemClass parent_class;
62 };
64 GType sp_image_get_type (void);
66 /* Return duplicate of curve or NULL */
67 SPCurve *sp_image_get_curve (SPImage *image);
69 void sp_image_refresh_if_outdated( SPImage* image );
71 #endif