NoteWindow * get_window() const { if(is_disposing() && !has_buffer()) { throw sharp::Exception("Plugin is disposing already"); } return m_note->get_window(); }
const NoteBuffer::Ptr & get_buffer() const { if(is_disposing() && !has_buffer()) { throw sharp::Exception("Plugin is disposing already"); } return m_note->get_buffer(); }
void NoteAddin::add_note_action(const Glib::RefPtr<Gtk::Action> & action, int order) { if(is_disposing()) { throw sharp::Exception("Plugin is disposing already"); } m_note_actions.push_back(action->get_name()); get_window()->add_widget_action(action, order); }
void NoteAddin::add_plugin_menu_item (Gtk::MenuItem *item) { if (is_disposing()) throw sharp::Exception ("Plugin is disposing already"); m_tools_menu_items.push_back (item); if (m_note->is_opened()) { get_window()->plugin_menu()->add (*item); } }
void NoteAddin::add_tool_item (Gtk::ToolItem *item, int position) { if (is_disposing()) throw sharp::Exception ("Add-in is disposing already"); m_toolbar_items [item] = position; if (m_note->is_opened()) { get_window()->toolbar()->insert (*item, position); } }
Gtk::Window *NoteAddin::get_host_window() const { if(is_disposing() && !has_buffer()) { throw sharp::Exception(_("Plugin is disposing already")); } NoteWindow *note_window = m_note->get_window(); if(!note_window->host()) { throw std::runtime_error(_("Window is not embedded")); } return dynamic_cast<Gtk::Window*>(note_window->host()); }
void NoteAddin::add_text_menu_item (Gtk::MenuItem * item) { if (is_disposing()) throw sharp::Exception(_("Plugin is disposing already")); m_text_menu_items.push_back(item); if (m_note->is_opened()) { get_window()->text_menu()->add (*item); get_window()->text_menu()->reorder_child (*item, 7); } }
void NoteAddin::add_tool_item (Gtk::ToolItem *item, int position) { if (is_disposing()) throw sharp::Exception(_("Plugin is disposing already")); m_toolbar_items [item] = position; if (m_note->is_opened()) { Gtk::Grid *grid = get_window()->embeddable_toolbar(); grid->insert_column(position); grid->attach(*item, position, 0, 1, 1); } }