Remove erroneous assert which I added earlier.
[ardour2.git] / gtk2_ardour / canvas-imageframe.h
blob8cfb6e273a26af819422383c47f30e5927f615f7
1 /* Image item type for GnomeCanvas widget
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.
6 * Copyright (C) 1998 The Free Software Foundation
8 * Author: Federico Mena <federico@nuclecu.unam.mx>
9 */
12 #ifndef __GNOME_CANVAS_IMAGEFRAME_H__
13 #define __GNOME_CANVAS_IMAGEFRAME_H__
15 #include <stdint.h>
17 #include <libgnomecanvas/libgnomecanvas.h>
18 #include <gtk/gtkenums.h>
20 #ifdef __cplusplus
21 extern "C" {
22 #endif
23 #include <libart_lgpl/art_misc.h>
24 #ifdef __cplusplus
26 #endif
28 #include <libart_lgpl/art_pixbuf.h>
31 G_BEGIN_DECLS
34 /* Image item for the canvas. Images are positioned by anchoring them to a point.
35 * The following arguments are available:
37 * name type read/write description
38 * ------------------------------------------------------------------------------------------
39 * pixbuf ArtPixBuf* W Pointer to an ArtPixBuf (aa-mode)
40 * x double RW X coordinate of anchor point
41 * y double RW Y coordinate of anchor point
42 * width double RW Width to scale image to, in canvas units
43 * height double RW Height to scale image to, in canvas units
44 * drawwidth double RW Width to scale image to, in canvas units
45 * anchor GtkAnchorType RW Anchor side for the image
49 #define GNOME_CANVAS_TYPE_CANVAS_IMAGEFRAME (gnome_canvas_imageframe_get_type ())
50 #define GNOME_CANVAS_IMAGEFRAME(obj) (GTK_CHECK_CAST ((obj), GNOME_CANVAS_TYPE_CANVAS_IMAGEFRAME, GnomeCanvasImageFrame))
51 #define GNOME_CANVAS_IMAGEFRAME_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), GNOME_CANVAS_TYPE_CANVAS_IMAGEFRAME, GnomeCanvasImageFrameClass))
52 #define GNOME_CANVAS_IS_CANVAS_IMAGEFRAME(obj) (GTK_CHECK_TYPE ((obj), GNOME_CANVAS_TYPE_CANVAS_IMAGEFRAME))
53 #define GNOME_CANVAS_IS_CANVAS_IMAGEFRAME_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), GNOME_CANVAS_TYPE_CANVAS_IMAGEFRAME))
56 typedef struct _GnomeCanvasImageFrame GnomeCanvasImageFrame;
57 typedef struct _GnomeCanvasImageFrameClass GnomeCanvasImageFrameClass;
59 struct _GnomeCanvasImageFrame {
60 GnomeCanvasItem item;
62 double x, y; /* Position at anchor, item relative */
63 double width, height; /* Size of image, item relative */
64 double drawwidth ; /* the amount of the image we draw width-wise (0-drawwidth)*/
65 GtkAnchorType anchor; /* Anchor side for image */
67 int cx, cy; /* Top-left canvas coordinates for display */
68 int cwidth, cheight; /* Rendered size in pixels */
70 uint32_t need_recalc : 1; /* Do we need to rescale the image? */
72 ArtPixBuf *pixbuf; /* A pixbuf, for aa rendering */
73 double affine[6]; /* The item -> canvas affine */
76 struct _GnomeCanvasImageFrameClass {
77 GnomeCanvasItemClass parent_class;
81 /* Standard Gtk function */
82 GtkType gnome_canvas_imageframe_get_type (void);
85 G_END_DECLS
87 #endif