index 4997c5ef4d07a797cef09d377e93818bfbc094fa..3f5fe668d1dd322a2a424d2b2ec42181cd0f06e4 100644 (file)
#include <gtkmm.h>
#include <2geom/point.h>
-#include "display/display-forward.h"
#include "forward.h"
#include "util/accumulators.h"
#include "display/sodipodi-ctrl.h"
/// @name Receive notifications about control point events
/// @{
- sigc::signal<void, Geom::Point const &, Geom::Point &, GdkEventMotion*> signal_dragged;
+ /*sigc::signal<void, Geom::Point const &, Geom::Point &, GdkEventMotion*> signal_dragged;
sigc::signal<bool, GdkEventButton*>::accumulated<RInt> signal_clicked;
sigc::signal<bool, GdkEventButton*>::accumulated<RInt> signal_doubleclicked;
sigc::signal<bool, GdkEventMotion*>::accumulated<Int> signal_grabbed;
- sigc::signal<void, GdkEventButton*> signal_ungrabbed;
+ sigc::signal<void, GdkEventButton*> signal_ungrabbed;*/
/// @}
/// @name Inspect the state of the control point
static sigc::signal<void, ControlPoint*> signal_mouseover_change;
static Glib::ustring format_tip(char const *format, ...) G_GNUC_PRINTF(1,2);
- // temporarily public, until snapping is refactored a little
+ // temporarily public, until snap delay is refactored a little
virtual bool _eventHandler(GdkEvent *event);
protected:
ControlPoint(SPDesktop *d, Geom::Point const &initial_pos, Gtk::AnchorType anchor,
Glib::RefPtr<Gdk::Pixbuf> pixbuf, ColorSet *cset = 0, SPCanvasGroup *group = 0);
+ /// @name Handle control point events in subclasses
+ /// @{
+ /**
+ * Called when the user moves the point beyond the drag tolerance with the first button held
+ * down. Return true if you called transferGrab() during this method.
+ * @param event Motion event when drag tolerance was exceeded */
+ virtual bool grabbed(GdkEventMotion *event);
+ /**
+ * Called while dragging, but before moving the knot to new position.
+ * @param pos Old position, always equal to position()
+ * @param new_pos New position (after drag). This is passed as a non-const reference,
+ * so you can change it from the handler - that's how constrained dragging is implemented.
+ * @param event Motion event */
+ virtual void dragged(Geom::Point &new_pos, GdkEventMotion *event);
+ /**
+ * @var ControlPoint::signal_ungrabbed
+ * Emitted when the control point finishes a drag.
+ * @param event Button release event
+ */
+ virtual void ungrabbed(GdkEventButton *event);
+ /**
+ * Called when the control point is clicked, at mouse button release. Your override should
+ * return true if the click had some effect. If it did nothing, return false. Improperly
+ * implementing this method can cause the default context menu not to appear when a control
+ * point is right-clicked.
+ * @param event Button release event */
+ virtual bool clicked(GdkEventButton *event);
+ /**
+ * Called when the control point is doubleclicked, at mouse button release.
+ * @param event Button release event */
+ virtual bool doubleclicked(GdkEventButton *);
+ /// @}
+
/// @name Manipulate the control point's appearance in subclasses
/// @{
virtual void _setState(State state);
void _setPixbuf(Glib::RefPtr<Gdk::Pixbuf>);
/// @}
- virtual Glib::ustring _getTip(unsigned state) { return ""; }
- virtual Glib::ustring _getDragTip(GdkEventMotion *event) { return ""; }
+ virtual Glib::ustring _getTip(unsigned /*state*/) { return ""; }
+ virtual Glib::ustring _getDragTip(GdkEventMotion */*event*/) { return ""; }
virtual bool _hasDragTips() { return false; }
SPDesktop *const _desktop; ///< The desktop this control point resides on.
fill-column:99
End:
*/
-// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 :
+// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8:textwidth=99 :