node-context.h revision c87d0307348fcfdc65b6b4ab6999a3cb0de2431f
01d27eab5fca2dcb8e883011f8be77ae6b78a11cTed Gould#ifndef __SP_NODE_CONTEXT_H__
01d27eab5fca2dcb8e883011f8be77ae6b78a11cTed Gould#define __SP_NODE_CONTEXT_H__
01d27eab5fca2dcb8e883011f8be77ae6b78a11cTed Gould
6e16a663ee96cd1329e48518138efb415046d9f6mcecchetti/*
6e16a663ee96cd1329e48518138efb415046d9f6mcecchetti * Node editing context
6e16a663ee96cd1329e48518138efb415046d9f6mcecchetti *
6e16a663ee96cd1329e48518138efb415046d9f6mcecchetti * Authors:
6e16a663ee96cd1329e48518138efb415046d9f6mcecchetti * Lauris Kaplinski <lauris@kaplinski.com>
6e16a663ee96cd1329e48518138efb415046d9f6mcecchetti * bulia byak <buliabyak@users.sf.net>
6e16a663ee96cd1329e48518138efb415046d9f6mcecchetti *
6e16a663ee96cd1329e48518138efb415046d9f6mcecchetti * This code is in public domain
6e16a663ee96cd1329e48518138efb415046d9f6mcecchetti */
6e16a663ee96cd1329e48518138efb415046d9f6mcecchetti
6e16a663ee96cd1329e48518138efb415046d9f6mcecchetti#include <sigc++/sigc++.h>
6e16a663ee96cd1329e48518138efb415046d9f6mcecchetti#include "event-context.h"
6e16a663ee96cd1329e48518138efb415046d9f6mcecchetti#include "forward.h"
6e16a663ee96cd1329e48518138efb415046d9f6mcecchetti#include "nodepath.h"
6e16a663ee96cd1329e48518138efb415046d9f6mcecchettistruct SPKnotHolder;
6e16a663ee96cd1329e48518138efb415046d9f6mcecchettinamespace Inkscape { class Selection; }
6e16a663ee96cd1329e48518138efb415046d9f6mcecchetti
6e16a663ee96cd1329e48518138efb415046d9f6mcecchetti#define SP_TYPE_NODE_CONTEXT (sp_node_context_get_type ())
6e16a663ee96cd1329e48518138efb415046d9f6mcecchetti#define SP_NODE_CONTEXT(obj) (GTK_CHECK_CAST ((obj), SP_TYPE_NODE_CONTEXT, SPNodeContext))
6e16a663ee96cd1329e48518138efb415046d9f6mcecchetti#define SP_NODE_CONTEXT_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), SP_TYPE_NODE_CONTEXT, SPNodeContextClass))
6e16a663ee96cd1329e48518138efb415046d9f6mcecchetti#define SP_IS_NODE_CONTEXT(obj) (GTK_CHECK_TYPE ((obj), SP_TYPE_NODE_CONTEXT))
6e16a663ee96cd1329e48518138efb415046d9f6mcecchetti#define SP_IS_NODE_CONTEXT_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), SP_TYPE_NODE_CONTEXT))
6e16a663ee96cd1329e48518138efb415046d9f6mcecchetti
6e16a663ee96cd1329e48518138efb415046d9f6mcecchetticlass SPNodeContext;
6e16a663ee96cd1329e48518138efb415046d9f6mcecchetticlass SPNodeContextClass;
6e16a663ee96cd1329e48518138efb415046d9f6mcecchetti
6e16a663ee96cd1329e48518138efb415046d9f6mcecchettistruct SPNodeContext {
6e16a663ee96cd1329e48518138efb415046d9f6mcecchetti SPEventContext event_context;
6e16a663ee96cd1329e48518138efb415046d9f6mcecchetti
6e16a663ee96cd1329e48518138efb415046d9f6mcecchetti guint drag : 1;
6e16a663ee96cd1329e48518138efb415046d9f6mcecchetti
6e16a663ee96cd1329e48518138efb415046d9f6mcecchetti Inkscape::NodePath::Path *nodepath;
6e16a663ee96cd1329e48518138efb415046d9f6mcecchetti
6e16a663ee96cd1329e48518138efb415046d9f6mcecchetti bool leftalt;
6e16a663ee96cd1329e48518138efb415046d9f6mcecchetti bool rightalt;
6e16a663ee96cd1329e48518138efb415046d9f6mcecchetti bool leftctrl;
6e16a663ee96cd1329e48518138efb415046d9f6mcecchetti bool rightctrl;
6e16a663ee96cd1329e48518138efb415046d9f6mcecchetti
8001ba81cb851b38d86650a2fef5817facffb763johanengelen /// If true, rubberband was cancelled by esc, so the next button release should not deselect.
8001ba81cb851b38d86650a2fef5817facffb763johanengelen bool rb_escaped;
8001ba81cb851b38d86650a2fef5817facffb763johanengelen
6e16a663ee96cd1329e48518138efb415046d9f6mcecchetti sigc::connection sel_changed_connection;
6e16a663ee96cd1329e48518138efb415046d9f6mcecchetti
6e16a663ee96cd1329e48518138efb415046d9f6mcecchetti Inkscape::MessageContext *_node_message_context;
6e16a663ee96cd1329e48518138efb415046d9f6mcecchetti
6e16a663ee96cd1329e48518138efb415046d9f6mcecchetti double grab_t;
6e16a663ee96cd1329e48518138efb415046d9f6mcecchetti Inkscape::NodePath::Node * grab_node;
6e16a663ee96cd1329e48518138efb415046d9f6mcecchetti bool hit;
6e16a663ee96cd1329e48518138efb415046d9f6mcecchetti NR::Point curvepoint_event; // int coords from event
6e16a663ee96cd1329e48518138efb415046d9f6mcecchetti NR::Point curvepoint_doc; // same, in doc coords
6e16a663ee96cd1329e48518138efb415046d9f6mcecchetti bool cursor_drag;
6e16a663ee96cd1329e48518138efb415046d9f6mcecchetti
6e16a663ee96cd1329e48518138efb415046d9f6mcecchetti bool added_node;
6e16a663ee96cd1329e48518138efb415046d9f6mcecchetti};
6e16a663ee96cd1329e48518138efb415046d9f6mcecchetti
6e16a663ee96cd1329e48518138efb415046d9f6mcecchettistruct SPNodeContextClass {
6e16a663ee96cd1329e48518138efb415046d9f6mcecchetti SPEventContextClass parent_class;
6e16a663ee96cd1329e48518138efb415046d9f6mcecchetti};
6e16a663ee96cd1329e48518138efb415046d9f6mcecchetti
6e16a663ee96cd1329e48518138efb415046d9f6mcecchetti/* Standard Gtk function */
6e16a663ee96cd1329e48518138efb415046d9f6mcecchetti
6e16a663ee96cd1329e48518138efb415046d9f6mcecchettiGtkType sp_node_context_get_type (void);
6e16a663ee96cd1329e48518138efb415046d9f6mcecchetti
6e16a663ee96cd1329e48518138efb415046d9f6mcecchettivoid sp_node_context_selection_changed (Inkscape::Selection * selection, gpointer data);
6e16a663ee96cd1329e48518138efb415046d9f6mcecchetti
6e16a663ee96cd1329e48518138efb415046d9f6mcecchetti#endif
6e16a663ee96cd1329e48518138efb415046d9f6mcecchetti