new color management design starts to take shape (canvas color only for now)
[ardour.git] / gtk2_ardour / canvas-imageframe.h
1 /* Image item type for GnomeCanvas widget
2  *
3  * GnomeCanvas is basically a port of the Tk toolkit's most excellent canvas widget.  Tk is
4  * copyrighted by the Regents of the University of California, Sun Microsystems, and other parties.
5  *
6  * Copyright (C) 1998 The Free Software Foundation
7  *
8  * Author: Federico Mena <federico@nuclecu.unam.mx>
9  */
10  
11  
12 #ifndef __GNOME_CANVAS_IMAGEFRAME_H__
13 #define __GNOME_CANVAS_IMAGEFRAME_H__
14
15 #include <stdint.h>
16
17 #include <libgnomecanvas/libgnomecanvas.h>
18 #include <gtk/gtkenums.h> 
19 #include <libart_lgpl/art_misc.h>
20 #include <libart_lgpl/art_pixbuf.h>
21
22
23 G_BEGIN_DECLS
24
25
26 /* Image item for the canvas.  Images are positioned by anchoring them to a point.
27  * The following arguments are available:
28  *
29  * name         type                    read/write      description
30  * ------------------------------------------------------------------------------------------
31  * pixbuf     ArtPixBuf*      W         Pointer to an ArtPixBuf (aa-mode)
32  * x          double          RW                X coordinate of anchor point
33  * y          double          RW                Y coordinate of anchor point
34  * width      double          RW                Width to scale image to, in canvas units
35  * height     double          RW                Height to scale image to, in canvas units
36  * drawwidth  double          RW                Width to scale image to, in canvas units
37  * anchor     GtkAnchorType   RW                Anchor side for the image
38  */
39
40
41 #define GNOME_CANVAS_TYPE_CANVAS_IMAGEFRAME            (gnome_canvas_imageframe_get_type ())
42 #define GNOME_CANVAS_IMAGEFRAME(obj)                   (GTK_CHECK_CAST ((obj), GNOME_CANVAS_TYPE_CANVAS_IMAGEFRAME, GnomeCanvasImageFrame))
43 #define GNOME_CANVAS_IMAGEFRAME_CLASS(klass)           (GTK_CHECK_CLASS_CAST ((klass), GNOME_CANVAS_TYPE_CANVAS_IMAGEFRAME, GnomeCanvasImageFrameClass))
44 #define GNOME_CANVAS_IS_CANVAS_IMAGEFRAME(obj)         (GTK_CHECK_TYPE ((obj), GNOME_CANVAS_TYPE_CANVAS_IMAGEFRAME))
45 #define GNOME_CANVAS_IS_CANVAS_IMAGEFRAME_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), GNOME_CANVAS_TYPE_CANVAS_IMAGEFRAME))
46
47
48 typedef struct _GnomeCanvasImageFrame GnomeCanvasImageFrame;
49 typedef struct _GnomeCanvasImageFrameClass GnomeCanvasImageFrameClass;
50
51 struct _GnomeCanvasImageFrame {
52         GnomeCanvasItem item;
53
54         double x, y;                    /* Position at anchor, item relative */
55         double width, height;           /* Size of image, item relative */
56         double drawwidth ;              /* the amount of the image we draw width-wise (0-drawwidth)*/
57         GtkAnchorType anchor;           /* Anchor side for image */
58
59         int cx, cy;                     /* Top-left canvas coordinates for display */
60         int cwidth, cheight;            /* Rendered size in pixels */
61
62         uint32_t need_recalc : 1;       /* Do we need to rescale the image? */
63
64         ArtPixBuf *pixbuf;              /* A pixbuf, for aa rendering */
65         double affine[6];               /* The item -> canvas affine */
66 };
67
68 struct _GnomeCanvasImageFrameClass {
69         GnomeCanvasItemClass parent_class;
70 };
71
72
73 /* Standard Gtk function */
74 GtkType gnome_canvas_imageframe_get_type (void);
75
76
77 G_END_DECLS
78
79 #endif