MCPcopy Create free account
hub / github.com/KLayout/klayout / update_event_handlers

Method update_event_handlers

src/laybasic/laybasic/layLayoutViewBase.cc:527–558  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

525}
526
527void LayoutViewBase::update_event_handlers ()
528{
529 tl::Object::detach_from_all_events ();
530
531 for (std::vector<lay::Plugin *>::iterator p = mp_plugins.begin (); p != mp_plugins.end (); ++p) {
532 // TODO: get rid of the const_cast hack
533 const_cast<lay::PluginDeclaration *> ((*p)->plugin_declaration ())->editable_enabled_changed_event.add (this, &LayoutViewBase::signal_plugin_enabled_changed);
534 }
535
536 for (unsigned int i = 0; i < cellviews (); ++i) {
537 db::Layout &ly = cellview (i)->layout ();
538 ly.hier_changed_event.add (this, &LayoutViewBase::signal_hier_changed);
539 ly.bboxes_changed_event.add (this, &LayoutViewBase::signal_bboxes_from_layer_changed, i);
540 ly.dbu_changed_event.add (this, &LayoutViewBase::signal_bboxes_changed);
541 ly.prop_ids_changed_event.add (this, &LayoutViewBase::signal_prop_ids_changed);
542 ly.layer_properties_changed_event.add (this, &LayoutViewBase::signal_layer_properties_changed);
543 ly.cell_name_changed_event.add (this, &LayoutViewBase::signal_cell_name_changed, i);
544 cellview (i)->apply_technology_with_sender_event.add (this, &LayoutViewBase::signal_apply_technology);
545 }
546
547 annotation_shapes ().bboxes_changed_any_event.add (this, &LayoutViewBase::signal_annotations_changed);
548
549 mp_canvas->viewport_changed_event.add (this, &LayoutViewBase::viewport_changed);
550 mp_canvas->left_arrow_key_pressed.add (this, &LayoutViewBase::pan_left);
551 mp_canvas->up_arrow_key_pressed.add (this, &LayoutViewBase::pan_up);
552 mp_canvas->right_arrow_key_pressed.add (this, &LayoutViewBase::pan_right);
553 mp_canvas->down_arrow_key_pressed.add (this, &LayoutViewBase::pan_down);
554 mp_canvas->left_arrow_key_pressed_with_shift.add (this, &LayoutViewBase::pan_left_fast);
555 mp_canvas->up_arrow_key_pressed_with_shift.add (this, &LayoutViewBase::pan_up_fast);
556 mp_canvas->right_arrow_key_pressed_with_shift.add (this, &LayoutViewBase::pan_right_fast);
557 mp_canvas->down_arrow_key_pressed_with_shift.add (this, &LayoutViewBase::pan_down_fast);
558}
559
560void LayoutViewBase::viewport_changed ()
561{

Callers

nothing calls this directly

Calls 5

cellviewsFunction · 0.85
beginMethod · 0.45
endMethod · 0.45
addMethod · 0.45
layoutMethod · 0.45

Tested by

no test coverage detected