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>
12 #ifndef __GNOME_CANVAS_IMAGEFRAME_H__
13 #define __GNOME_CANVAS_IMAGEFRAME_H__
17 #include <libgnomecanvas/libgnomecanvas.h>
18 #include <gtk/gtkenums.h>
23 #include <libart_lgpl/art_misc.h>
28 #include <libart_lgpl/art_pixbuf.h>
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
{
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);