+
+#ifdef DCPOMATIC_CUCUMBER
+ void cucumber_add_content_file (string filename)
+ {
+ _frame->cucumber_add_content_file (filename);
+ }
+
+
+ std::string cucumber_get_content_list ()
+ {
+ return _frame->cucumber_get_content_list ();
+ }
+
+
+ void cucumber_click_button (string id)
+ {
+ CucumberRegistry::instance()->click_button (id);
+ }
+
+
+ void cucumber_select_menu (string id)
+ {
+ if (id == CUCUMBER_MENU_FILE_NEW) {
+ wxPostEvent (_frame, wxMenuEvent(wxEVT_MENU, ID_file_new));
+ }
+ }
+
+
+ void cucumber_type (string text)
+ {
+#ifdef DCPOMATIC_LINUX
+ // xdo_t* xdo = xdo_new (NULL);
+ // xdo_enter_text_window (xdo, CURRENTWINDOW, text.c_str(), 200000);
+ // xdo_send_keysequence_window (xdo, CURRENTWINDOW, "Return", 200000);
+ // xdo_free (xdo);
+ auto send = [this](int code, int rawcode) {
+ auto event = wxKeyEvent(wxEVT_KEY_DOWN);
+ event.SetEventObject(this);
+ event.m_keyCode = event.m_uniChar = code;
+ event.m_rawCode = rawcode;
+ std::cout << "process " << code << " " << rawcode << "\n";
+ ProcessEvent (event);
+
+ event = wxKeyEvent(wxEVT_CHAR);
+ event.SetEventObject(this);
+ event.m_keyCode = event.m_uniChar = code;
+ event.m_rawCode = rawcode;
+ std::cout << "process " << code << " " << rawcode << "\n";
+ ProcessEvent (event);
+
+ event = wxKeyEvent(wxEVT_KEY_UP);
+ event.SetEventObject(this);
+ event.m_keyCode = event.m_uniChar = code;
+ event.m_rawCode = rawcode;
+ std::cout << "process " << code << " " << rawcode << "\n";
+ ProcessEvent (event);
+ };
+
+ for (auto i = 0U; i < text.length(); ++i) {
+ send (text[i], text[i]);
+ }
+ send (WXK_RETURN, 65293);
+#endif
+ }
+#endif
+