sp-canvas-item.h revision cb18d33283b8806a9fb5a854fac079dce564fc2f
#ifndef SEEN_SP_CANVAS_ITEM_H
#define SEEN_SP_CANVAS_ITEM_H
/**
* @file
* SPCanvasItem.
*/
/*
* Authors:
* Federico Mena <federico@nuclecu.unam.mx>
* Raph Levien <raph@gimp.org>
* Lauris Kaplinski <lauris@kaplinski.com>
* Jon A. Cruz <jon@joncruz.org>
*
* Copyright (C) 1998 The Free Software Foundation
* Copyright (C) 2002 Lauris Kaplinski
* Copyright (C) 2010 authors
*
* Released under GNU GPL, read the file 'COPYING' for more information
*/
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif
#include <glib-object.h>
#include "ui/control-types.h"
struct SPCanvas;
struct SPCanvasBuf;
struct SPCanvasGroup;
typedef struct _SPCanvasItemClass SPCanvasItemClass;
typedef struct _GdkCursor GdkCursor;
#define SP_TYPE_CANVAS_ITEM (sp_canvas_item_get_type())
#define SP_CANVAS_ITEM_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), SP_TYPE_CANVAS_ITEM, SPCanvasItemClass))
#define SP_CANVAS_ITEM_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS((o), SP_TYPE_CANVAS_ITEM, SPCanvasItemClass))
/**
* An SPCanvasItem refers to a SPCanvas and to its parent item; it has
* four coordinates, a bounding rectangle, and a transformation matrix.
*/
struct SPCanvasItem {
double x1;
double y1;
double x2;
double y2;
int ctrlResize;
// Replacement for custom GtkObject flag enumeration
// If true, then SPCanvasGroup::point() and sp_canvas_item_invoke_point() will calculate
// the distance to the pointer, such that this item can be picked in pickCurrentItem()
// Only if an item can be picked, then it can be set as current_item and receive events!
bool pickable;
bool in_destruction;
};
/**
* The vtable of an SPCanvasItem.
*/
struct _SPCanvasItemClass {
/* Default signal handler for the ::destroy signal, which is
* invoked to request that references to the widget be dropped.
* If an object class overrides destroy() in order to perform class
* specific destruction then it must still invoke its superclass'
* implementation of the method after it is finished with its
* own cleanup. (See gtk_widget_real_destroy() for an example of
* how to do this).
*/
};
/**
* Constructs new SPCanvasItem on SPCanvasGroup.
*/
SPCanvasItem *sp_canvas_item_new(SPCanvasGroup *parent, GType type, const gchar *first_arg_name, ...);
int sp_canvas_item_grab(SPCanvasItem *item, unsigned int event_mask, GdkCursor *cursor, guint32 etime);
/* get item z-order in parent group */
#endif // SEEN_SP_CANVAS_ITEM_H
/*
Local Variables:
mode:c++
c-file-style:"stroustrup"
c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
indent-tabs-mode:nil
fill-column:99
End:
*/
// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4 :