index 6c3dbf896480564d0dab720bbd7da20f93320caf..56984dcbb99095d85b1c65e4ecf0221bffe198ba 100644 (file)
Editor::getActiveDocument()
{
if (getActiveDesktop()) {
- return SP_DT_DOCUMENT (getActiveDesktop());
+ return sp_desktop_document (getActiveDesktop());
}
return NULL;
void
Editor::addDocument (SPDocument *doc)
{
- g_assert (!g_slist_find (_instance->_documents, doc));
- _instance->_documents = g_slist_append (_instance->_documents, doc);
+ if ( _instance->_document_set.find(doc) == _instance->_document_set.end() ) {
+ _instance->_documents = g_slist_append (_instance->_documents, doc);
+ }
+ _instance->_document_set.insert(doc);
}
void
Editor::removeDocument (SPDocument *doc)
{
- g_assert (g_slist_find (_instance->_documents, doc));
- _instance->_documents = g_slist_remove (_instance->_documents, doc);
+ _instance->_document_set.erase(doc);
+ if ( _instance->_document_set.find(doc) == _instance->_document_set.end() ) {
+ _instance->_documents = g_slist_remove (_instance->_documents, doc);
+ }
}
SPDesktop*
if (isDesktopActive (dt)) {
_instance->_desktop_activated_signal.emit (dt);
- _instance->_event_context_set_signal.emit (SP_DT_EVENTCONTEXT (dt));
- _instance->_selection_set_signal.emit (SP_DT_SELECTION (dt));
- _instance->_selection_changed_signal.emit (SP_DT_SELECTION (dt));
+ _instance->_event_context_set_signal.emit (sp_desktop_event_context (dt));
+ _instance->_selection_set_signal.emit (sp_desktop_selection (dt));
+ _instance->_selection_changed_signal.emit (sp_desktop_selection (dt));
}
}
_instance->_desktops = g_slist_remove (_instance->_desktops, new_desktop);
_instance->_desktops = g_slist_prepend (_instance->_desktops, new_desktop);
_instance->_desktop_activated_signal.emit (new_desktop);
- _instance->_event_context_set_signal.emit (SP_DT_EVENTCONTEXT (new_desktop));
- _instance->_selection_set_signal.emit (SP_DT_SELECTION (new_desktop));
- _instance->_selection_changed_signal.emit (SP_DT_SELECTION (new_desktop));
+ _instance->_event_context_set_signal.emit (sp_desktop_event_context (new_desktop));
+ _instance->_selection_set_signal.emit (sp_desktop_selection (new_desktop));
+ _instance->_selection_changed_signal.emit (sp_desktop_selection (new_desktop));
} else {
_instance->_event_context_set_signal.emit (0);
- if (SP_DT_SELECTION(dt))
- SP_DT_SELECTION(dt)->clear();
+ if (sp_desktop_selection(dt))
+ sp_desktop_selection(dt)->clear();
}
}
_instance->_desktops = g_slist_prepend (_instance->_desktops, dt);
_instance->_desktop_activated_signal.emit (dt);
- _instance->_event_context_set_signal.emit (SP_DT_EVENTCONTEXT(dt));
- _instance->_selection_set_signal.emit (SP_DT_SELECTION(dt));
- _instance->_selection_changed_signal.emit (SP_DT_SELECTION(dt));
+ _instance->_event_context_set_signal.emit (sp_desktop_event_context(dt));
+ _instance->_selection_set_signal.emit (sp_desktop_selection(dt));
+ _instance->_selection_changed_signal.emit (sp_desktop_selection(dt));
}
void
//Editor::getEventContext()
//{
// if (getActiveDesktop()) {
-// return SP_DT_EVENTCONTEXT (getActiveDesktop());
+// return sp_desktop_event_context (getActiveDesktop());
// }
//
// return NULL;