本文整理汇总了C++中SPObject::connectDelete方法的典型用法代码示例。如果您正苦于以下问题:C++ SPObject::connectDelete方法的具体用法?C++ SPObject::connectDelete怎么用?C++ SPObject::connectDelete使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SPObject
的用法示例。
在下文中一共展示了SPObject::connectDelete方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
/* For the sigc::connection changes (i.e. when the object being refered to changes) */
static void
sp_tref_href_changed(SPObject */*old_ref*/, SPObject */*ref*/, SPTRef *tref)
{
if (tref)
{
// Save a pointer to the original object being referred to
SPObject *refRoot = tref->getObjectReferredTo();
tref->_delete_connection.disconnect();
if (tref->stringChild) {
tref->detach(tref->stringChild);
tref->stringChild = NULL;
}
// Ensure that we are referring to a legitimate object
if (tref->href && refRoot && sp_tref_reference_allowed(tref, refRoot)) {
// Update the text being referred to (will create a new string child)
sp_tref_update_text(tref);
// Restore the delete connection now that we're done messing with stuff
tref->_delete_connection = refRoot->connectDelete(sigc::bind(sigc::ptr_fun(&sp_tref_delete_self), tref));
}
}
}
示例2:
void
sp_conn_end_href_changed(SPObject */*old_ref*/, SPObject */*ref*/,
SPConnEnd *connEndPtr, SPPath *const path, unsigned const handle_ix)
{
g_return_if_fail(connEndPtr != NULL);
SPConnEnd &connEnd = *connEndPtr;
connEnd._delete_connection.disconnect();
connEnd._transformed_connection.disconnect();
connEnd._group_connection.disconnect();
if (connEnd.href) {
SPObject *refobj = connEnd.ref.getObject();
if (refobj) {
connEnd._delete_connection
= refobj->connectDelete(sigc::bind(sigc::ptr_fun(&sp_conn_end_deleted),
path, handle_ix));
// This allows the connector tool to dive into a group's children
// And connect to their children's centers.
SPObject *parent = refobj->parent;
if (SP_IS_GROUP(parent) && ! SP_IS_LAYER(parent)) {
connEnd._group_connection
= SP_ITEM(parent)->connectTransformed(sigc::bind(sigc::ptr_fun(&sp_conn_end_shape_move),
path));
}
connEnd._transformed_connection
= SP_ITEM(refobj)->connectTransformed(sigc::bind(sigc::ptr_fun(&sp_conn_end_shape_move),
path));
}
}
}