void Gobby::TextTabLabel::on_style_changed(const Glib::RefPtr<Gtk::Style>& prev) #endif { #ifdef USE_GTKMM3 TabLabel::on_style_updated(); #else TabLabel::on_style_changed(prev); #endif static const gunichar dot_chars[] = { 0x270E, /* pencil */ 0x26AB, /* medium black circle */ 0x25CF, /* black circle */ 0x002A, /* asterisk */ 0x0000 }; // Find a glyph for the user dots const gunichar* c; for(c = dot_chars; *c; ++c) { m_dots.set_text(Glib::ustring(1, *c)); if(m_dots.get_layout()->get_unknown_glyphs_count() == 0) break; } m_dot_char = *c; // Update dots using this char update_dots(); }
void Gobby::TextTabLabel::on_changed(InfTextUser* author) { if(!m_changed) { InfSession* session = INF_SESSION(m_view.get_session()); if(inf_session_get_status(session) == INF_SESSION_RUNNING) set_changed(); } if(m_folder.get_current_document() != &m_view) { // TODO: remove dot if all the user's // new contributions where undone if(std::find(m_changed_by.begin(), m_changed_by.end(), author) == m_changed_by.end()) { m_changed_by.push_back(UserWatcher(this, author)); update_dots(); } } }
Gobby::TextTabLabel::TextTabLabel(Folder& folder, TextSessionView& view): TabLabel(folder, view, Gtk::Stock::EDIT), m_dot_char(0) { update_modified(); update_dots(); m_modified_changed_handle = g_signal_connect_after( G_OBJECT(view.get_text_buffer()), "modified-changed", G_CALLBACK(on_modified_changed_static), this); InfTextBuffer* buffer = INF_TEXT_BUFFER( inf_session_get_buffer( INF_SESSION(view.get_session()))); m_insert_text_handle = g_signal_connect_after( G_OBJECT(buffer), "text-inserted", G_CALLBACK(on_text_inserted_static), this); m_erase_text_handle = g_signal_connect_after( G_OBJECT(buffer), "text-erased", G_CALLBACK(on_text_erased_static), this); m_extra.pack_start(m_dots, Gtk::PACK_SHRINK); }
void Gobby::TextTabLabel::update_dot_char() { static const gunichar dot_chars[] = { 0x270E, /* pencil */ 0x26AB, /* medium black circle */ 0x25CF, /* black circle */ 0x002A, /* asterisk */ 0x0000 }; // Find a glyph for the user dots const gunichar* c; for(c = dot_chars; *c; ++c) { m_dots.set_text(Glib::ustring(1, *c)); if(m_dots.get_layout()->get_unknown_glyphs_count() == 0) break; } m_dot_char = *c; // Update dots using this char update_dots(); }
void Gobby::TextTabLabel::on_activate() { TabLabel::on_activate(); m_changed_by.clear(); update_dots(); }