MCPcopy Create free account
hub / github.com/Predelnik/DSpellCheck / beNotified

Function beNotified

src/plugin/Plugin.cpp:729–823  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

727
728// ReSharper disable once CppInconsistentNaming
729extern "C" __declspec(dllexport) void beNotified(SCNotification *notify_code) {
730 notify(notify_code);
731 switch (notify_code->nmhdr.code) {
732 case NPPN_SHUTDOWN: {
733 print_to_log(L"NPPN_SHUTDOWN", npp->get_editor_hwnd());
734 edit_recheck_timer.reset();
735 scroll_recheck_timer.reset();
736 command_menu_clean_up();
737
738 plugin_clean_up();
739 RemoveWindowSubclass(npp_data.npp_handle, subclass_proc, 0);
740 }
741 break;
742
743 case NPPN_READY: {
744 register_custom_messages();
745 init_classes();
746 print_to_log(L"NPPN_READY", npp->get_editor_hwnd());
747 check_queue.clear();
748 create_hooks();
749 edit_recheck_timer.emplace(npp_data.npp_handle);
750 edit_recheck_timer->on_timer_tick.connect(edit_recheck_callback);
751 scroll_recheck_timer.emplace(npp_data.npp_handle);
752 scroll_recheck_timer->on_timer_tick.connect(scroll_recheck_callback);
753 spell_checker->recheck_visible_both_views();
754 restyling_caused_recheck_was_done = false;
755 suggestions_button->set_transparency();
756 rearrange_menu();
757 }
758 break;
759
760 case NPPN_BUFFERACTIVATED: {
761 if (settings)
762 print_to_log(L"NPPN_BUFFERACTIVATED", npp->get_editor_hwnd());
763 if (!spell_checker)
764 return;
765 recheck_visible();
766 restyling_caused_recheck_was_done = false;
767 }
768 break;
769
770 case SCN_FOLDINGSTATECHANGED:
771 update_on_visible_area_changed();
772 break;
773
774 case SCN_UPDATEUI:
775 if (!spell_checker)
776 return;
777 if ((notify_code->updated & SC_UPDATE_CONTENT) != 0 && (!is_any_timer_active() || first_restyle) && !restyling_caused_recheck_was_done)
778 // If restyling wasn't caused
779 // by user input...
780 {
781 ACTIVE_VIEW_BLOCK(npp_interface());
782 spell_checker->recheck_visible();
783 if (!first_restyle)
784 restyling_caused_recheck_was_done = true;
785 first_restyle = false;
786 } else if ((notify_code->updated & (SC_UPDATE_V_SCROLL | SC_UPDATE_H_SCROLL)) != 0) // If scroll wasn't caused by user input...

Callers

nothing calls this directly

Calls 15

notifyFunction · 0.85
print_to_logFunction · 0.85
command_menu_clean_upFunction · 0.85
plugin_clean_upFunction · 0.85
register_custom_messagesFunction · 0.85
init_classesFunction · 0.85
create_hooksFunction · 0.85
rearrange_menuFunction · 0.85
recheck_visibleFunction · 0.85
is_any_timer_activeFunction · 0.85
add_iconsFunction · 0.85

Tested by

no test coverage detected