| 672 | sample_info_t *si = (sample_info_t *)ud; |
| 673 | #else |
| 674 | ssize_t idaapi sample_info_t::on_event(ssize_t code, va_list va) |
| 675 | { |
| 676 | sample_info_t *si = this; |
| 677 | #endif //IDA_SDK_VERSION < 920 |
| 678 | switch (code) |
| 679 | { |
| 680 | case ui_widget_invisible: |
| 681 | { |
| 682 | TWidget *f = va_arg(va, TWidget *); |
| 683 | if (f == si->cv) { |
| 684 | #if IDA_SDK_VERSION < 920 |
| 685 | unhook_from_notification_point(HT_UI, ui_callback); |
| 686 | #else |
| 687 | //unhook_event_listener(HT_UI, si); it should be done by `delete si;` on next line |
| 688 | #endif //IDA_SDK_VERSION < 920 |
| 689 | delete si; |
| 690 | return 0; |
| 691 | } |
| 692 | } |
| 693 | break; |
| 694 | case ui_populating_widget_popup: |
| 695 | { |
| 696 | TWidget* f = va_arg(va, TWidget*); |
| 697 | TPopupMenu* p = va_arg(va, TPopupMenu*); |
| 698 | if (f == si->cv && si->mba != NULL) { |
| 699 | action_desc_t desc = DYNACTION_DESC_LITERAL("Show Microcode Graph", new microcodegraph_ah_t(si), "M", nullptr, -1); |
| 700 | attach_dynamic_action_to_popup(f, p, desc, nullptr, 0); |
| 701 | |
| 702 | minsn_t* minsn; |
| 703 | if (InsGraphCheck(si, &minsn)) { |
| 704 | action_desc_t desc = DYNACTION_DESC_LITERAL("Show Microinstruction Graph", new microinsngraph_ah_t(si, minsn), "I", nullptr, -1); |
| 705 | attach_dynamic_action_to_popup(f, p, desc, nullptr, 0); |
| 706 | } |
| 707 | } |
| 708 | } |
| 709 | break; |
| 710 | } |
| 711 | return 0; |
| 712 | } |
| 713 | |
| 714 | void showMicrocodeExplorer(mbl_array_t* mba, bool keepMba, const char* name) |
| 715 | { |
nothing calls this directly
no test coverage detected