Code

Split SPCanvasItem and SPCanvasGroup to individual .h files. Removed forward header.
[inkscape.git] / src / display / sp-canvas-item.h
1 #ifndef SEEN_SP_CANVAS_ITEM_H
2 #define SEEN_SP_CANVAS_ITEM_H
4 /** \file
5  * SPCanvasItem.
6  *
7  * Authors:
8  *   Federico Mena <federico@nuclecu.unam.mx>
9  *   Raph Levien <raph@gimp.org>
10  *   Lauris Kaplinski <lauris@kaplinski.com>
11  *   Jon A. Cruz <jon@joncruz.org>
12  *
13  * Copyright (C) 1998 The Free Software Foundation
14  * Copyright (C) 2002 Lauris Kaplinski
15  * Copyright (C) 2010 authors
16  *
17  * Released under GNU GPL, read the file 'COPYING' for more information
18  */
20 #ifdef HAVE_CONFIG_H
21 # include "config.h"
22 #endif
24 #include <glib-object.h>
25 #include <gtk/gtkobject.h>
26 #include <gdk/gdkevents.h>
28 #include "2geom/rect.h"
30 G_BEGIN_DECLS
32 struct SPCanvas;
33 struct SPCanvasBuf;
34 struct SPCanvasGroup;
36 typedef struct _SPCanvasItemClass SPCanvasItemClass;
38 #define SP_TYPE_CANVAS_ITEM (sp_canvas_item_get_type())
39 #define SP_CANVAS_ITEM(obj) (GTK_CHECK_CAST((obj), SP_TYPE_CANVAS_ITEM, SPCanvasItem))
40 #define SP_IS_CANVAS_ITEM(obj) (GTK_CHECK_TYPE((obj), SP_TYPE_CANVAS_ITEM))
41 #define SP_CANVAS_ITEM_GET_CLASS(o) (GTK_CHECK_GET_CLASS((o), SP_TYPE_CANVAS_ITEM, SPCanvasItemClass))
43 GType sp_canvas_item_get_type();
45 /**
46  * An SPCanvasItem refers to a SPCanvas and to its parent item; it has
47  * four coordinates, a bounding rectangle, and a transformation matrix.
48  */
49 struct SPCanvasItem : public GtkObject {
50     SPCanvas *canvas;
51     SPCanvasItem *parent;
53     double x1, y1, x2, y2;
54     Geom::Rect bounds;
55     Geom::Matrix xform;
56 };
58 /**
59  * The vtable of an SPCanvasItem.
60  */
61 struct _SPCanvasItemClass : public GtkObjectClass {
62     void (* update) (SPCanvasItem *item, Geom::Matrix const &affine, unsigned int flags);
64     void (* render) (SPCanvasItem *item, SPCanvasBuf *buf);
65     double (* point) (SPCanvasItem *item, Geom::Point p, SPCanvasItem **actual_item);
67     int (* event) (SPCanvasItem *item, GdkEvent *event);
68 };
70 SPCanvasItem *sp_canvas_item_new(SPCanvasGroup *parent, GtkType type, const gchar *first_arg_name, ...);
72 G_END_DECLS
75 #define sp_canvas_item_set gtk_object_set
77 void sp_canvas_item_affine_absolute(SPCanvasItem *item, Geom::Matrix const &aff);
79 void sp_canvas_item_raise(SPCanvasItem *item, int positions);
80 void sp_canvas_item_lower(SPCanvasItem *item, int positions);
81 bool sp_canvas_item_is_visible(SPCanvasItem *item);
82 void sp_canvas_item_show(SPCanvasItem *item);
83 void sp_canvas_item_hide(SPCanvasItem *item);
84 int sp_canvas_item_grab(SPCanvasItem *item, unsigned int event_mask, GdkCursor *cursor, guint32 etime);
85 void sp_canvas_item_ungrab(SPCanvasItem *item, guint32 etime);
87 Geom::Matrix sp_canvas_item_i2w_affine(SPCanvasItem const *item);
89 void sp_canvas_item_grab_focus(SPCanvasItem *item);
91 void sp_canvas_item_request_update(SPCanvasItem *item);
93 /* get item z-order in parent group */
95 gint sp_canvas_item_order(SPCanvasItem * item);
99 #endif // SEEN_SP_CANVAS_ITEM_H
101 /*
102   Local Variables:
103   mode:c++
104   c-file-style:"stroustrup"
105   c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
106   indent-tabs-mode:nil
107   fill-column:99
108   End:
109 */
110 // vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4 :