mircv::XKBMapper::XKBMapper() { xkb_rule_names names; names.rules = "evdev"; names.model = "pc105"; names.layout = "us"; names.variant = ""; names.options = ""; set_rules(names); }
int sc_main(int,char**) { allocate_user_actions(); sc_report_handler::set_handler( &dump_all_handler ); // disable automatic stop sc_report_handler::stop_after( SC_ERROR, 0 ); sc_report_handler::stop_after( SC_FATAL, 0 ); // Don't emit error|fatal for ID4 because this would // terminate the simulation. cout << "Default settings for ID4\n"; query_rules( id4 ); // check default setting of rules cout << "Specific settings for ID1..ID3\n"; set_rules(); query_rules(); // temporarily suppress usr4: // - check which actions are emitted // - check that suppress() restores old state // - check return value of suppress(.) cout << "temporarily suppress usr4\n"; sc_start( 1,SC_NS ); sc_report_handler::suppress( usr3 ); assert( sc_report_handler::suppress( usr4 ) == usr3 ); query_rules( id1 ); assert( sc_report_handler::suppress() == usr4 ); query_rules( id1 ); // temporarily force usr1: same checking as with suppress cout << "temporarily force usr1\n"; sc_start( 1,SC_NS ); sc_report_handler::force( usr2 ); assert( sc_report_handler::force( usr1 ) == usr2 ); query_rules( id1 ); assert( sc_report_handler::force() == usr1 ); query_rules( id1 ); // temporarily force usr1: same checking as with suppress cout << "temporarily suppress {usr3,usr4} and force {usr1,usr3}\n"; sc_start( 1,SC_NS ); sc_report_handler::force ( usr1|usr3 ); sc_report_handler::suppress( usr3|usr4 ); query_rules( id1 ); sc_report_handler::force(); sc_report_handler::suppress(); query_rules( id1 ); return 0; }
/************************************************************************** Edit the currenty selected rule **************************************************************************/ static void filter_edit(void) { #if 0 if (!rules_wnd) init_rules(); if (rules_wnd) { struct filter *f; DoMethod(filter_listview, MUIM_NList_GetEntry, MUIV_NList_GetEntry_Active, &f); set_rules(f); set(rules_wnd,MUIA_Window_Open,TRUE); } #endif }
MF::MF() { int rules[6][4] = { {1, 2, 3, 4}, {5, 6, 7, 8}, {1, 2, 6, 5}, {3, 4, 8, 7}, {1, 5, 8, 4}, {2, 6, 7, 3} }; num = 0; for(int i = 0; i < 6; ++i) for(int j = 0; j < 4; ++j) r[i][j] = rules[i][j]; set_rules(); }