MCPcopy Create free account
hub / github.com/audacity/audacity / NullaryCommandType

Function NullaryCommandType

src/JournalEvents.cpp:193–208  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

191
192template<typename Event = wxCommandEvent, typename EventType >
193static Type NullaryCommandType( EventType type, const wxString &code ){
194 const auto deserialize =
195 []( wxEventType evtType, const wxArrayStringEx &components) {
196 std::unique_ptr< wxCommandEvent > result;
197 if ( components.size() == 1 ) {
198 if ( auto pWindow = WindowPaths::FindByPath( components[0] ) ) {
199 result = std::make_unique< wxCommandEvent >(
200 evtType, pWindow->GetId() );
201 result->SetEventObject( pWindow );
202 }
203 }
204 return result;
205 };
206
207 return Type{ type, code, WindowEventSerialization, deserialize };
208}
209
210template<typename Event = wxCommandEvent, typename EventType >
211static Type BooleanCommandType( EventType type, const wxString &code ){

Callers 1

JournalEvents.cppFile · 0.85

Calls 3

FindByPathFunction · 0.85
GetIdMethod · 0.80
sizeMethod · 0.45

Tested by

no test coverage detected