本文整理汇总了C++中inkscape::Selection::connectModified方法的典型用法代码示例。如果您正苦于以下问题:C++ Selection::connectModified方法的具体用法?C++ Selection::connectModified怎么用?C++ Selection::connectModified使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类inkscape::Selection
的用法示例。
在下文中一共展示了Selection::connectModified方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: mesh_toolbox_watch_ec
static void mesh_toolbox_watch_ec(SPDesktop* desktop, Inkscape::UI::Tools::ToolBase* ec, GObject* holder)
{
static sigc::connection c_selection_changed;
static sigc::connection c_selection_modified;
static sigc::connection c_subselection_changed;
static sigc::connection c_defs_release;
static sigc::connection c_defs_modified;
if (SP_IS_MESH_CONTEXT(ec)) {
// connect to selection modified and changed signals
Inkscape::Selection *selection = desktop->getSelection();
SPDocument *document = desktop->getDocument();
c_selection_changed = selection->connectChanged(sigc::bind(sigc::ptr_fun(&ms_tb_selection_changed), holder));
c_selection_modified = selection->connectModified(sigc::bind(sigc::ptr_fun(&ms_tb_selection_modified), holder));
c_subselection_changed = desktop->connectToolSubselectionChanged(sigc::bind(sigc::ptr_fun(&ms_drag_selection_changed), holder));
c_defs_release = document->getDefs()->connectRelease(sigc::bind<1>(sigc::ptr_fun(&ms_defs_release), holder));
c_defs_modified = document->getDefs()->connectModified(sigc::bind<2>(sigc::ptr_fun(&ms_defs_modified), holder));
ms_tb_selection_changed(selection, holder);
} else {
if (c_selection_changed)
c_selection_changed.disconnect();
if (c_selection_modified)
c_selection_modified.disconnect();
if (c_subselection_changed)
c_subselection_changed.disconnect();
if (c_defs_release)
c_defs_release.disconnect();
if (c_defs_modified)
c_defs_modified.disconnect();
}
}
示例2: onSelectionChanged
void
LivePathEffectEditor::setDesktop(SPDesktop *desktop)
{
Panel::setDesktop(desktop);
if ( desktop == current_desktop ) {
return;
}
if (current_desktop) {
selection_changed_connection.disconnect();
selection_modified_connection.disconnect();
}
lpe_list_locked = false;
current_desktop = desktop;
if (desktop) {
Inkscape::Selection *selection = sp_desktop_selection(desktop);
selection_changed_connection = selection->connectChanged(
sigc::bind (sigc::ptr_fun(&lpeeditor_selection_changed), this ) );
selection_modified_connection = selection->connectModified(
sigc::bind (sigc::ptr_fun(&lpeeditor_selection_modified), this ) );
onSelectionChanged(selection);
} else {
onSelectionChanged(NULL);
}
}
示例3: gradient_toolbox_check_ec
/**
* Checks the current tool and connects gradient aux toolbox signals if it happens to be the gradient tool.
* Called every time the current tool changes by signal emission.
*/
static void gradient_toolbox_check_ec(SPDesktop* desktop, Inkscape::UI::Tools::ToolBase* ec, GObject* holder)
{
static sigc::connection connChanged;
static sigc::connection connModified;
static sigc::connection connSubselectionChanged;
static sigc::connection connDefsRelease;
static sigc::connection connDefsModified;
if (SP_IS_GRADIENT_CONTEXT(ec)) {
Inkscape::Selection *selection = sp_desktop_selection(desktop);
SPDocument *document = sp_desktop_document(desktop);
// connect to selection modified and changed signals
connChanged = selection->connectChanged(sigc::bind(sigc::ptr_fun(&gr_tb_selection_changed), holder));
connModified = selection->connectModified(sigc::bind(sigc::ptr_fun(&gr_tb_selection_modified), holder));
connSubselectionChanged = desktop->connectToolSubselectionChanged(sigc::bind(sigc::ptr_fun(&gr_drag_selection_changed), holder));
// Is this necessary? Couldn't hurt.
gr_tb_selection_changed(selection, holder);
// connect to release and modified signals of the defs (i.e. when someone changes gradient)
connDefsRelease = document->getDefs()->connectRelease(sigc::bind<1>(sigc::ptr_fun(&gr_defs_release), GTK_WIDGET(holder)));
connDefsModified = document->getDefs()->connectModified(sigc::bind<2>(sigc::ptr_fun(&gr_defs_modified), GTK_WIDGET(holder)));
} else {
if (connChanged)
connChanged.disconnect();
if (connModified)
connModified.disconnect();
if (connSubselectionChanged)
connSubselectionChanged.disconnect();
if (connDefsRelease)
connDefsRelease.disconnect();
if (connDefsModified)
connDefsModified.disconnect();
}
}