Code

Indent support for XSLT extensions output.
[inkscape.git] / src / sp-image.h
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 <glibmm/ustring.h>
30 #include "svg/svg-length.h"
31 #include "sp-item.h"
32 #include "display/display-forward.h"
34 #define SP_IMAGE_HREF_MODIFIED_FLAG SP_OBJECT_USER_MODIFIED_FLAG_A
36 struct SPImage : public SPItem {
37     SVGLength x;
38     SVGLength y;
39     SVGLength width;
40     SVGLength height;
42     // Added by EAF
43     /* preserveAspectRatio */
44     unsigned int aspect_align : 4;
45     unsigned int aspect_clip : 1;
46     int trimx, trimy, trimwidth, trimheight;
47     double viewx, viewy, viewwidth, viewheight;
49     SPCurve *curve; // This curve is at the image's boundary for snapping
51     gchar *href;
52 #if ENABLE_LCMS
53     gchar *color_profile;
54 #endif // ENABLE_LCMS
56     GdkPixbuf *pixbuf;
57     gchar *pixPath;
58     time_t lastMod;
59 };
61 struct SPImageClass {
62     SPItemClass parent_class;
63 };
65 GType sp_image_get_type (void);
67 /* Return duplicate of curve or NULL */
68 SPCurve *sp_image_get_curve (SPImage *image);
69 void sp_embed_image(Inkscape::XML::Node *imgnode, GdkPixbuf *pb, Glib::ustring const &mime);
70 void sp_image_refresh_if_outdated( SPImage* image );
72 #endif