diff --git a/src/knot.cpp b/src/knot.cpp
index 5483280daafc463d9595f932845ed6ceed8174ac..c8d2f2065256800e47f79d6693d8ae1d940ee642 100644 (file)
--- a/src/knot.cpp
+++ b/src/knot.cpp
*/
static void sp_knot_class_init(SPKnotClass *klass)
{
- GObjectClass *object_class = (GObjectClass *) klass;
+ GObjectClass *object_class = (GObjectClass*)klass;
parent_class = (GObjectClass*) g_type_class_peek_parent(klass);
knot->tip = NULL;
}
- if (((GObjectClass *) (parent_class))->dispose) {
- (* ((GObjectClass *) (parent_class))->dispose) (object);
+ if (parent_class->dispose) {
+ (*parent_class->dispose) (object);
}
}
g_assert(knot != NULL);
g_assert(SP_IS_KNOT(knot));
- g_object_ref(G_OBJECT(knot));
+ g_object_ref(knot);
tolerance = prefs_get_int_attribute_limited("options.dragtolerance", "value", 0, 0, 100);
gboolean consumed = FALSE;
/* Run client universal event handler, if present */
- g_signal_emit(G_OBJECT(knot), knot_signals[EVENT], 0, event, &consumed);
+ g_signal_emit(knot, knot_signals[EVENT], 0, event, &consumed);
if (consumed) {
return TRUE;
switch (event->type) {
case GDK_2BUTTON_PRESS:
if (event->button.button == 1) {
- g_signal_emit(G_OBJECT(knot), knot_signals[DOUBLECLICKED], 0, event->button.state);
+ g_signal_emit(knot, knot_signals[DOUBLECLICKED], 0, event->button.state);
grabbed = FALSE;
moved = FALSE;
sp_knot_set_flag(knot,
SP_KNOT_DRAGGING,
FALSE);
- g_signal_emit(G_OBJECT (knot),
+ g_signal_emit(knot,
knot_signals[UNGRABBED], 0,
event->button.state);
} else {
- g_signal_emit(G_OBJECT (knot),
+ g_signal_emit(knot,
knot_signals[CLICKED], 0,
event->button.state);
}
within_tolerance = false;
if (!moved) {
- g_signal_emit(G_OBJECT (knot),
+ g_signal_emit(knot,
knot_signals[GRABBED], 0,
event->motion.state);
sp_knot_set_flag(knot,
sp_knot_set_flag(knot,
SP_KNOT_DRAGGING,
FALSE);
- g_signal_emit(G_OBJECT(knot),
+ g_signal_emit(knot,
knot_signals[UNGRABBED], 0,
event->button.state);
- sp_document_undo(SP_DT_DOCUMENT(knot->desktop));
+ sp_document_undo(sp_desktop_document(knot->desktop));
knot->desktop->messageStack()->flash(Inkscape::NORMAL_MESSAGE, _("Node or handle drag canceled."));
transform_escaped = true;
consumed = TRUE;
break;
}
- g_object_unref(G_OBJECT(knot));
+ g_object_unref(knot);
return consumed;
}
knot->tip = g_strdup (tip);
}
- knot->item = sp_canvas_item_new(SP_DT_CONTROLS (desktop),
+ knot->item = sp_canvas_item_new(sp_desktop_controls (desktop),
SP_TYPE_CTRL,
"anchor", GTK_ANCHOR_CENTER,
"size", 8.0,
gboolean done = FALSE;
- g_signal_emit(G_OBJECT (knot),
+ g_signal_emit(knot,
knot_signals[REQUEST], 0,
p,
state,
gdouble distance = NR::L2(*p - knot->pos);
- g_signal_emit(G_OBJECT(knot),
+ g_signal_emit(knot,
knot_signals[DISTANCE], 0,
p,
state,
SP_CTRL(knot->item)->moveto (*p);
}
- g_signal_emit(G_OBJECT (knot),
+ g_signal_emit(knot,
knot_signals[MOVED], 0,
p,
state);