notetag.cpp 16.4 KB
Newer Older
Hubert Figuière's avatar
Hubert Figuière committed
1 2 3
/*
 * gnote
 *
4
 * Copyright (C) 2011,2013-2014 Aurimas Cernius
Hubert Figuière's avatar
Hubert Figuière committed
5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
 * Copyright (C) 2009 Hubert Figuiere
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */

21 22


23
#include <gtk/gtk.h>
24 25
#include <gtkmm/image.h>

26
#include "sharp/xmlreader.hpp"
27 28 29 30 31 32 33
#include "sharp/xmlwriter.hpp"
#include "debug.hpp"
#include "notetag.hpp"
#include "noteeditor.hpp"

namespace gnote {

Hubert Figuière's avatar
Hubert Figuière committed
34 35 36 37
  NoteTag::NoteTag(const std::string & tag_name, int flags) throw(sharp::Exception)
    : Gtk::TextTag(tag_name)
    , m_element_name(tag_name)
    , m_widget(NULL)
38
    , m_allow_middle_activate(false)
Hubert Figuière's avatar
Hubert Figuière committed
39 40 41 42 43 44 45
    , m_flags(flags | CAN_SERIALIZE | CAN_SPLIT)
  {
    if (tag_name.empty()) {
      throw sharp::Exception ("NoteTags must have a tag name.  Use "
                              "DynamicNoteTag for constructing "
                              "anonymous tags.");
    }
Hubert Figuière's avatar
Hubert Figuière committed
46 47 48 49 50 51 52
    
  }

  
  NoteTag::NoteTag()
    : Gtk::TextTag()
    , m_widget(NULL)
53
    , m_allow_middle_activate(false)
Hubert Figuière's avatar
Hubert Figuière committed
54 55
    , m_flags(0)
  {
Hubert Figuière's avatar
Hubert Figuière committed
56 57 58
  }


Hubert Figuière's avatar
Hubert Figuière committed
59 60 61 62
  void NoteTag::initialize(const std::string & element_name)
  {
    m_element_name = element_name;
    m_flags = CAN_SERIALIZE | CAN_SPLIT;
63
    m_save_type = CONTENT;
Hubert Figuière's avatar
Hubert Figuière committed
64 65 66 67
  }
  


Hubert Figuière's avatar
Hubert Figuière committed
68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130
  void NoteTag::set_can_serialize(bool value)
  {
    if (value) {
      m_flags |= CAN_SERIALIZE;
    }
    else {
      m_flags &= ~CAN_SERIALIZE;
    }
  }

  void NoteTag::set_can_undo(bool value)
  {
    if (value) {
      m_flags |= CAN_UNDO;
    }
    else {
      m_flags &= ~CAN_UNDO;
    }
  }

  void NoteTag::set_can_grow(bool value)
  {
    if (value) {
      m_flags |= CAN_GROW;
    }
    else {
      m_flags &= ~CAN_GROW;
    }
  }

  void NoteTag::set_can_spell_check(bool value)
  {
    if (value) {
      m_flags |= CAN_SPELL_CHECK;
    }
    else {
      m_flags &= ~CAN_SPELL_CHECK;
    }
  }

  void NoteTag::set_can_activate(bool value)
  {
    if (value) {
      m_flags |= CAN_ACTIVATE;
    }
    else {
      m_flags &= ~CAN_ACTIVATE;
    }
  }

  void NoteTag::set_can_split(bool value)
  {
    if (value) {
      m_flags |= CAN_SPLIT;
    }
    else {
      m_flags &= ~CAN_SPLIT;
    }
  }

  void NoteTag::get_extents(const Gtk::TextIter & iter, Gtk::TextIter & start,
                            Gtk::TextIter & end)
  {
131
    Glib::RefPtr<Gtk::TextTag> this_ref = NoteTagTable::instance()->lookup(property_name());
Hubert Figuière's avatar
Hubert Figuière committed
132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151
    start = iter;
    if (!start.begins_tag (this_ref)) {
      start.backward_to_tag_toggle (this_ref);
    }
    end = iter;
    end.forward_to_tag_toggle (this_ref);
  }

  void NoteTag::write(sharp::XmlWriter & xml, bool start) const
  {
    if (can_serialize()) {
      if (start) {
        xml.write_start_element ("", m_element_name, "");
      } 
      else {
        xml.write_end_element();
      }
    }
  }

152
  void NoteTag::read(sharp::XmlReader & xml, bool start)
Hubert Figuière's avatar
Hubert Figuière committed
153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174
  {
    if (can_serialize()) {
      if (start) {
        m_element_name = xml.get_name();
      }
    }
  }

  bool NoteTag::on_event(const Glib::RefPtr<Glib::Object> & sender, 
                         GdkEvent * ev, const Gtk::TextIter & iter)
  {
    NoteEditor::Ptr editor = NoteEditor::Ptr::cast_dynamic(sender);
    Gtk::TextIter start, end;

    if (!can_activate())
      return false;

    switch (ev->type) {
    case GDK_BUTTON_PRESS:
    {
      GdkEventButton *button_ev = (GdkEventButton*)ev;

175 176 177
      // Do not insert selected text when activating links with
      // middle mouse button
      if (button_ev->button == 2) {
178
        m_allow_middle_activate = true;
179 180 181 182 183 184 185 186
        return true;
      }

      return false;
    }
    case GDK_BUTTON_RELEASE:
    {
      GdkEventButton *button_ev = (GdkEventButton*)ev;
Hubert Figuière's avatar
Hubert Figuière committed
187 188 189 190 191 192 193 194
      if ((button_ev->button != 1) && (button_ev->button != 2))
        return false;

      /* Don't activate if Shift or Control is pressed */
      if ((button_ev->state & (Gdk::SHIFT_MASK |
                               Gdk::CONTROL_MASK)) != 0)
        return false;

195 196 197 198 199
      // Prevent activation when selecting links with the mouse
      if (editor->get_buffer()->get_has_selection()) {
        return false;
      }

200 201 202 203 204 205 206 207 208
      // Don't activate if the link has just been pasted with the
      // middle mouse button (no preceding ButtonPress event)
      if (button_ev->button == 2 && !m_allow_middle_activate) {
        return false;
      }
      else {
        m_allow_middle_activate = false;
      }

Hubert Figuière's avatar
Hubert Figuière committed
209
      get_extents (iter, start, end);
210
      on_activate (*(editor.operator->()), start, end);
211
      return false;
Hubert Figuière's avatar
Hubert Figuière committed
212 213 214 215 216 217 218 219 220
    }
    case GDK_KEY_PRESS:
    {
      GdkEventKey *key_ev = (GdkEventKey*)ev;

      // Control-Enter activates the link at point...
      if ((key_ev->state & Gdk::CONTROL_MASK) == 0)
        return false;

221 222
      if (key_ev->keyval != GDK_KEY_Return &&
          key_ev->keyval != GDK_KEY_KP_Enter)
Hubert Figuière's avatar
Hubert Figuière committed
223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239
        return false;

      get_extents (iter, start, end);
      return on_activate (*(editor.operator->()), start, end);
    }
    default:
      break;
    }

    return false;
  }


  bool NoteTag::on_activate(const NoteEditor & editor , const Gtk::TextIter & start, 
                            const Gtk::TextIter & end)
  {
    bool retval = false;
240 241

#if 0
Hubert Figuière's avatar
Hubert Figuière committed
242 243 244 245 246 247
    if (Activated != null) {
      foreach (Delegate d in Activated.GetInvocationList()) {
        TagActivatedHandler handler = (TagActivatedHandler) d;
        retval |= handler (*this, editor, start, end);
      }
    }
248
#endif
249
    retval = m_signal_activate(editor, start, end);
Hubert Figuière's avatar
Hubert Figuière committed
250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283

    return retval;
  }


  Glib::RefPtr<Gdk::Pixbuf> NoteTag::get_image() const
  {
    Gtk::Image * image = dynamic_cast<Gtk::Image*>(m_widget);
    if(!image) {
      return Glib::RefPtr<Gdk::Pixbuf>();
    }
    return image->get_pixbuf();
  }


  void NoteTag::set_image(const Glib::RefPtr<Gdk::Pixbuf> & value)
  {
    if(!value) {
      set_widget(NULL);
      return;
    }
    set_widget(new Gtk::Image(value));
  }


  void NoteTag::set_widget(Gtk::Widget * value)
  {
    if ((value == NULL) && m_widget) {
      delete m_widget;
    }

    m_widget = value;

    try {
284
      m_signal_changed(*this, false);
Hubert Figuière's avatar
Hubert Figuière committed
285 286 287 288 289 290 291 292 293 294 295 296
    } catch (sharp::Exception & e) {
      DBG_OUT("Exception calling TagChanged from NoteTag.set_Widget: %s", e.what());
    }
  }

  Gdk::Color NoteTag::get_background() const
  {
    /* We can't know the exact background because we're not
       in TextView's rendering, but we can make a guess */
    if (property_background_set().get_value())
      return property_background_gdk().get_value();

Aurimas Černius's avatar
Aurimas Černius committed
297 298 299 300
    Gdk::RGBA rgba = Gtk::TextView().get_style_context()->get_background_color();
    Gdk::Color color;
    color.set_rgb(rgba.get_red_u(), rgba.get_green_u(), rgba.get_blue_u());
    return color;
Hubert Figuière's avatar
Hubert Figuière committed
301 302 303 304 305 306 307 308 309 310 311 312 313 314
  }

  Gdk::Color NoteTag::render_foreground(ContrastPaletteColor symbol)
  {
    return contrast_render_foreground_color(get_background(), symbol);
  }


  void DynamicNoteTag::write(sharp::XmlWriter & xml, bool start) const
  {
    if (can_serialize()) {
      NoteTag::write (xml, start);

      if (start) {
315 316
        for(AttributeMap::const_iterator iter = m_attributes.begin();
            iter != m_attributes.end(); ++iter) {
Hubert Figuière's avatar
Hubert Figuière committed
317 318 319 320 321 322
          xml.write_attribute_string ("", iter->first, "", iter->second);
        }
      }
    }
  }

323
  void DynamicNoteTag::read(sharp::XmlReader & xml, bool start)
Hubert Figuière's avatar
Hubert Figuière committed
324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343
  {
    if (can_serialize()) {
      NoteTag::read (xml, start);

      if (start) {
          while (xml.move_to_next_attribute()) {
            std::string name = xml.get_name();

            xml.read_attribute_value();
            m_attributes [name] = xml.get_value();

            on_attribute_read (name);
            DBG_OUT("NoteTag: %s read attribute %s='%s'",
                    get_element_name().c_str(), name.c_str(), xml.get_value().c_str());
          }
      }
    }
  }
  
  DepthNoteTag::DepthNoteTag(int depth, Pango::Direction direction)
344 345
    : NoteTag("depth:" + TO_STRING(depth) 
              + ":" + TO_STRING((int)direction))
Hubert Figuière's avatar
Hubert Figuière committed
346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375
    , m_depth(depth)
    , m_direction(direction)
  {
  }

  

  void DepthNoteTag::write(sharp::XmlWriter & xml, bool start) const
  {
    if (can_serialize()) {
      if (start) {
        xml.write_start_element ("", "list-item", "");

        // Write the list items writing direction
        xml.write_start_attribute ("dir");
        if (get_direction() == Pango::DIRECTION_RTL) {
          xml.write_string ("rtl");
        }
        else {
          xml.write_string ("ltr");
        }
        xml.write_end_attribute ();
      } 
      else {
        xml.write_end_element ();
      }
    }
  }


376
  NoteTagTable::Ptr NoteTagTable::s_instance;
Hubert Figuière's avatar
Hubert Figuière committed
377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406

  void NoteTagTable::_init_common_tags()
  {
    NoteTag::Ptr tag;

    // Font stylings

    tag = NoteTag::create("centered", NoteTag::CAN_UNDO | NoteTag::CAN_GROW | NoteTag::CAN_SPELL_CHECK);
    tag->property_justification() = Gtk::JUSTIFY_CENTER;
    add (tag);

    tag = NoteTag::create("bold", NoteTag::CAN_UNDO | NoteTag::CAN_GROW | NoteTag::CAN_SPELL_CHECK);
    tag->property_weight() = PANGO_WEIGHT_BOLD;
    add (tag);

    tag = NoteTag::create("italic", NoteTag::CAN_UNDO | NoteTag::CAN_GROW | NoteTag::CAN_SPELL_CHECK);
    tag->property_style() = Pango::STYLE_ITALIC;
    add (tag);
    
    tag = NoteTag::create("strikethrough", NoteTag::CAN_UNDO | NoteTag::CAN_GROW | NoteTag::CAN_SPELL_CHECK);
    tag->property_strikethrough() = true;
    add (tag);

    tag = NoteTag::create("highlight", NoteTag::CAN_UNDO | NoteTag::CAN_GROW | NoteTag::CAN_SPELL_CHECK);
    tag->property_background() = "yellow";
    add (tag);

    tag = NoteTag::create("find-match", NoteTag::CAN_SPELL_CHECK);
    tag->property_background() = "green";
    tag->set_can_serialize(false);
407
    tag->set_save_type(META);
Hubert Figuière's avatar
Hubert Figuière committed
408 409 410 411 412 413 414
    add (tag);

    tag = NoteTag::create("note-title", 0);
    tag->set_palette_foreground(CONTRAST_COLOR_BLUE);
    tag->property_scale() = Pango::SCALE_XX_LARGE;
    // FiXME: Hack around extra rewrite on open
    tag->set_can_serialize(false);
415
    tag->set_save_type(META);
Hubert Figuière's avatar
Hubert Figuière committed
416 417 418 419 420 421
    add (tag);
      
    tag = NoteTag::create("related-to", 0);
    tag->property_scale() = Pango::SCALE_SMALL;
    tag->property_left_margin() = 40;
    tag->property_editable() = false;
422
    tag->set_save_type(META);
Hubert Figuière's avatar
Hubert Figuière committed
423 424 425 426 427 428 429
    add (tag);

    // Used when inserting dropped URLs/text to Start Here
    tag = NoteTag::create("datetime", 0);
    tag->property_scale() = Pango::SCALE_SMALL;
    tag->property_style() = Pango::STYLE_ITALIC;
    tag->set_palette_foreground(CONTRAST_COLOR_GREY);
430
    tag->set_save_type(META);
Hubert Figuière's avatar
Hubert Figuière committed
431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455
    add (tag);

    // Font sizes

    tag = NoteTag::create("size:huge", NoteTag::CAN_UNDO | NoteTag::CAN_GROW | NoteTag::CAN_SPELL_CHECK);
    tag->property_scale() = Pango::SCALE_XX_LARGE;
    add (tag);

    tag = NoteTag::create("size:large", NoteTag::CAN_UNDO | NoteTag::CAN_GROW | NoteTag::CAN_SPELL_CHECK);
    tag->property_scale() = Pango::SCALE_X_LARGE;
    add (tag);

    tag = NoteTag::create("size:normal", NoteTag::CAN_UNDO | NoteTag::CAN_GROW | NoteTag::CAN_SPELL_CHECK);
    tag->property_scale() = Pango::SCALE_MEDIUM;
    add (tag);

    tag = NoteTag::create("size:small", NoteTag::CAN_UNDO | NoteTag::CAN_GROW | NoteTag::CAN_SPELL_CHECK);
    tag->property_scale() = Pango::SCALE_SMALL;
    add (tag);

    // Links

    tag = NoteTag::create("link:broken", NoteTag::CAN_ACTIVATE);
    tag->property_underline() = Pango::UNDERLINE_SINGLE;
    tag->set_palette_foreground(CONTRAST_COLOR_GREY);
456
    tag->set_save_type(META);
Hubert Figuière's avatar
Hubert Figuière committed
457
    add (tag);
458
    m_broken_link_tag = tag;
Hubert Figuière's avatar
Hubert Figuière committed
459 460 461 462

    tag = NoteTag::create("link:internal", NoteTag::CAN_ACTIVATE);
    tag->property_underline() = Pango::UNDERLINE_SINGLE;
    tag->set_palette_foreground(CONTRAST_COLOR_BLUE);
463
    tag->set_save_type(META);
Hubert Figuière's avatar
Hubert Figuière committed
464
    add (tag);
465
    m_link_tag = tag;
Hubert Figuière's avatar
Hubert Figuière committed
466 467 468 469

    tag = NoteTag::create("link:url", NoteTag::CAN_ACTIVATE);
    tag->property_underline() = Pango::UNDERLINE_SINGLE;
    tag->set_palette_foreground(CONTRAST_COLOR_BLUE);
470
    tag->set_save_type(META);
Hubert Figuière's avatar
Hubert Figuière committed
471
    add (tag);
472
    m_url_tag = tag;
Hubert Figuière's avatar
Hubert Figuière committed
473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525
  }


  bool NoteTagTable::tag_is_serializable(const Glib::RefPtr<const Gtk::TextTag> & tag)
  {
    NoteTag::ConstPtr note_tag = NoteTag::ConstPtr::cast_dynamic(tag);
    if(note_tag) {
      return note_tag->can_serialize();
    }
    return false;
  }

  bool NoteTagTable::tag_is_growable(const Glib::RefPtr<Gtk::TextTag> & tag)
  {
    NoteTag::Ptr note_tag = NoteTag::Ptr::cast_dynamic(tag);
    if(note_tag) {
      return note_tag->can_grow();
    }
    return false;
  }

  bool NoteTagTable::tag_is_undoable(const Glib::RefPtr<Gtk::TextTag> & tag)
  {
    NoteTag::Ptr note_tag = NoteTag::Ptr::cast_dynamic(tag);
    if(note_tag) {
      return note_tag->can_undo();
    }
    return false;
  }


  bool NoteTagTable::tag_is_spell_checkable(const Glib::RefPtr<const Gtk::TextTag> & tag)
  {
    NoteTag::ConstPtr note_tag = NoteTag::ConstPtr::cast_dynamic(tag);
    if(note_tag) {
      return note_tag->can_spell_check();
    }
    return false;
  }


  bool NoteTagTable::tag_is_activatable(const Glib::RefPtr<Gtk::TextTag> & tag)
  {
    NoteTag::Ptr note_tag = NoteTag::Ptr::cast_dynamic(tag);
    if(note_tag) {
      return note_tag->can_activate();
    }
    return false;
  }


  bool NoteTagTable::tag_has_depth(const Glib::RefPtr<Gtk::TextBuffer::Tag> & tag)
  {
Dominique Leuenberger's avatar
Dominique Leuenberger committed
526
    return (bool)DepthNoteTag::Ptr::cast_dynamic(tag);
Hubert Figuière's avatar
Hubert Figuière committed
527
  }
Aurimas Černius's avatar
Aurimas Černius committed
528 529 530 531 532 533


  bool NoteTagTable::has_link_tag(const Gtk::TextIter & iter)
  {
    return iter.has_tag(get_link_tag()) || iter.has_tag(get_url_tag()) || iter.has_tag(get_broken_link_tag());
  }
534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562


  ChangeType NoteTagTable::get_change_type(const Glib::RefPtr<Gtk::TextTag> &tag)
  {
    ChangeType change;

    // Use tag Name for Gtk.TextTags
    // For extensibility, add Gtk.TextTag names here
    change = OTHER_DATA_CHANGED;

    // Use SaveType for NoteTags
    Glib::RefPtr<NoteTag> note_tag = Glib::RefPtr<NoteTag>::cast_dynamic(tag);
    if(note_tag) {
      switch(note_tag->save_type()) {
        case META:
          change = OTHER_DATA_CHANGED;
          break;
        case CONTENT:
          change = CONTENT_CHANGED;
          break;
        case NO_SAVE:
        default:
          change = NO_CHANGE;
        break;
      }
    }

    return change;
  }
Hubert Figuière's avatar
Hubert Figuière committed
563 564 565 566
  

  DepthNoteTag::Ptr NoteTagTable::get_depth_tag(int depth, Pango::Direction direction)
  {
567
    std::string name = "depth:" + TO_STRING(depth) + ":" + TO_STRING((int)direction);
Hubert Figuière's avatar
Hubert Figuière committed
568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591

    DepthNoteTag::Ptr tag = DepthNoteTag::Ptr::cast_dynamic(lookup(name));

    if (!tag) {
      tag = DepthNoteTag::Ptr(new DepthNoteTag (depth, direction));
      tag->property_indent().set_value(-14);

      if (direction == Pango::DIRECTION_RTL) {
        tag->property_right_margin().set_value((depth+1) * 25);
      }
      else {
        tag->property_left_margin().set_value((depth+1) * 25);
      }

      tag->property_pixels_below_lines().set_value(4);
      tag->property_scale().set_value(Pango::SCALE_MEDIUM);
      add (tag);
    }

    return tag;
  }
      
  DynamicNoteTag::Ptr NoteTagTable::create_dynamic_tag(const std::string & tag_name)
  {
Hubert Figuière's avatar
Hubert Figuière committed
592
    std::map<std::string, Factory>::iterator iter = m_tag_types.find(tag_name);
Hubert Figuière's avatar
Hubert Figuière committed
593 594 595
    if(iter == m_tag_types.end()) {
      return DynamicNoteTag::Ptr();
    }
Hubert Figuière's avatar
Hubert Figuière committed
596 597
    DynamicNoteTag::Ptr tag(iter->second());
    tag->initialize(tag_name);
Hubert Figuière's avatar
Hubert Figuière committed
598 599 600
    add(tag);
    return tag;
  }
601 602

 
603
  void NoteTagTable::register_dynamic_tag(const std::string & tag_name, const Factory & factory)
Hubert Figuière's avatar
Hubert Figuière committed
604
  {
605
    m_tag_types[tag_name] = factory;
Hubert Figuière's avatar
Hubert Figuière committed
606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630
  }


  bool NoteTagTable::is_dynamic_tag_registered(const std::string & tag_name)
  {
    return m_tag_types.find(tag_name) != m_tag_types.end();
  }

  void NoteTagTable::on_tag_added(const Glib::RefPtr<Gtk::TextTag> & tag)
  {
    m_added_tags.push_back(tag);

    NoteTag::Ptr note_tag = NoteTag::Ptr::cast_dynamic(tag);
    if (note_tag) {
//      note_tag->signal_changed().connect(sigc::mem_fun(*this, &NoteTagTable::on_notetag_changed));
    }
  }

  
  void NoteTagTable::on_tag_removed(const Glib::RefPtr<Gtk::TextTag> & tag)
  {
    m_added_tags.remove(tag);

    NoteTag::Ptr note_tag = NoteTag::Ptr::cast_dynamic(tag);
    if (note_tag) {
631
// TODO disconnect the signal
Hubert Figuière's avatar
Hubert Figuière committed
632 633 634
//      note_tag.Changed -= OnTagChanged;
    }
  }
635 636 637


#if 0
Hubert Figuière's avatar
Hubert Figuière committed
638
  void NoteTagTable::on_notetag_changed(Glib::RefPtr<Gtk::TextTag>& tag, bool size_changed)
639 640 641
  {
    m_signal_changed(tag, size_changed);
  }
642
#endif
643

644 645
}