~centralelyon2010/inkscape/imagelinks2

« back to all changes in this revision

Viewing changes to src/display/sp-canvas-item.h

  • Committer: JazzyNico
  • Date: 2011-08-29 20:25:30 UTC
  • Revision ID: nicoduf@yahoo.fr-20110829202530-6deuoz11q90usldv
Code refactoring and merging with trunk (revision 10599).

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#ifndef SEEN_SP_CANVAS_ITEM_H
 
2
#define SEEN_SP_CANVAS_ITEM_H
 
3
 
 
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
 */
 
19
 
 
20
#ifdef HAVE_CONFIG_H
 
21
# include "config.h"
 
22
#endif
 
23
 
 
24
#include <glib-object.h>
 
25
#include <gtk/gtk.h>
 
26
#include <gdk/gdk.h>
 
27
#include <2geom/rect.h>
 
28
 
 
29
G_BEGIN_DECLS
 
30
 
 
31
struct SPCanvas;
 
32
struct SPCanvasBuf;
 
33
struct SPCanvasGroup;
 
34
 
 
35
typedef struct _SPCanvasItemClass SPCanvasItemClass;
 
36
 
 
37
#define SP_TYPE_CANVAS_ITEM (sp_canvas_item_get_type())
 
38
#define SP_CANVAS_ITEM(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), SP_TYPE_CANVAS_ITEM, SPCanvasItem))
 
39
#define SP_IS_CANVAS_ITEM(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), SP_TYPE_CANVAS_ITEM))
 
40
#define SP_CANVAS_ITEM_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS((o), SP_TYPE_CANVAS_ITEM, SPCanvasItemClass))
 
41
 
 
42
GType sp_canvas_item_get_type();
 
43
 
 
44
/**
 
45
 * An SPCanvasItem refers to a SPCanvas and to its parent item; it has
 
46
 * four coordinates, a bounding rectangle, and a transformation matrix.
 
47
 */
 
48
struct SPCanvasItem : public GtkObject {
 
49
    SPCanvas *canvas;
 
50
    SPCanvasItem *parent;
 
51
 
 
52
    double x1, y1, x2, y2;
 
53
    Geom::Rect bounds;
 
54
    Geom::Affine xform;
 
55
};
 
56
 
 
57
/**
 
58
 * The vtable of an SPCanvasItem.
 
59
 */
 
60
struct _SPCanvasItemClass : public GtkObjectClass {
 
61
    void (* update) (SPCanvasItem *item, Geom::Affine const &affine, unsigned int flags);
 
62
 
 
63
    void (* render) (SPCanvasItem *item, SPCanvasBuf *buf);
 
64
    double (* point) (SPCanvasItem *item, Geom::Point p, SPCanvasItem **actual_item);
 
65
 
 
66
    int (* event) (SPCanvasItem *item, GdkEvent *event);
 
67
    void (* viewbox_changed) (SPCanvasItem *item, Geom::IntRect const &new_area);
 
68
};
 
69
 
 
70
SPCanvasItem *sp_canvas_item_new(SPCanvasGroup *parent, GType type, const gchar *first_arg_name, ...);
 
71
 
 
72
G_END_DECLS
 
73
 
 
74
 
 
75
#define sp_canvas_item_set g_object_set
 
76
 
 
77
void sp_canvas_item_affine_absolute(SPCanvasItem *item, Geom::Affine const &aff);
 
78
 
 
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);
 
86
 
 
87
Geom::Affine sp_canvas_item_i2w_affine(SPCanvasItem const *item);
 
88
 
 
89
void sp_canvas_item_grab_focus(SPCanvasItem *item);
 
90
 
 
91
void sp_canvas_item_request_update(SPCanvasItem *item);
 
92
 
 
93
/* get item z-order in parent group */
 
94
 
 
95
gint sp_canvas_item_order(SPCanvasItem * item);
 
96
 
 
97
 
 
98
 
 
99
#endif // SEEN_SP_CANVAS_ITEM_H
 
100
 
 
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 :