| 1 | // SPDX-FileCopyrightText: 2009 Ingo Ruhnke <[email protected]>cxx . . $ `<file>/src/joystick_test_widget.cpp`/ |
| 2 | // SPDX-FileCopyrightText: 2025 Raphael Rosch <[email protected]> |
| 3 | // SPDX-License-Identifier: GPL-3.0-or-later |
| 4 | |
| 5 | #include <sstream> |
| 6 | #include <iostream> |
| 7 | #include <gtkmm/label.h> |
| 8 | #include <gtkmm/stock.h> |
| 9 | #include <gtkmm/dialog.h> |
| 10 | #include <glibmm/markup.h> |
| 11 | #include <glibmm/fileutils.h> |
| 12 | |
| 13 | #include "main.hpp"cxx . . $ `<file>/src/main.hpp`/ |
| 14 | #include "joystick.hpp"cxx . . $ `<file>/src/joystick.hpp`/ |
| 15 | #include "button_widget.hpp"cxx . . $ `<file>/src/button_widget.hpp`/ |
| 16 | #include "joystick_map_widget.hpp"cxx . . $ `<file>/src/joystick_map_widget.hpp`/ |
| 17 | #include "joystick_calibration_widget.hpp"cxx . . $ `<file>/src/joystick_calibration_widget.hpp`/ |
| 18 | #include "joystick_test_widget.hpp"cxx . . $ `<file>/src/joystick_test_widget.hpp`/ |
| 19 | #include "joystick_config_files.hpp"cxx . . $ `<file>/src/joystick_config_files.hpp`/ |
| 20 | |
| 21 | namespacecxx . . $ `$anonymous_namespace_src/joystick_test_widget.cpp`/ { |
| 22 | |
| 23 | class DeviceColumnscxx . . $ `$anonymous_namespace_src/joystick_test_widget.cpp`/DeviceColumns# : public Gtkcxx . . $ Gtk/::TreeModelcxx . . $ Gtk/TreeModel#::ColumnRecordcxx . . $ Gtk/TreeModel#ColumnRecord# |
| 24 | { |
| 25 | public: |
| 26 | DeviceColumnscxx . . $ `$anonymous_namespace_src/joystick_test_widget.cpp`/DeviceColumns#DeviceColumns(49f6e7a06ebc5aa8).() |
| 27 | { |
| 28 | addcxx . . $ Gtk/TreeModelColumnRecord#add(3c675b78d16a40bf).(pathcxx . . $ `$anonymous_namespace_src/joystick_test_widget.cpp`/DeviceColumns#path.); |
| 29 | addcxx . . $ Gtk/TreeModelColumnRecord#add(3c675b78d16a40bf).(markupcxx . . $ `$anonymous_namespace_src/joystick_test_widget.cpp`/DeviceColumns#markup.); |
| 30 | } |
| 31 | |
| 32 | Gtkcxx . . $ Gtk/::TreeModelColumncxx . . $ Gtk/TreeModelColumn#<Glibcxx . . $ Glib/::ustringcxx . . $ Glib/ustring#> pathcxx . . $ `$anonymous_namespace_src/joystick_test_widget.cpp`/DeviceColumns#path.; |
| 33 | Gtkcxx . . $ Gtk/::TreeModelColumncxx . . $ Gtk/TreeModelColumn#<Glibcxx . . $ Glib/::ustringcxx . . $ Glib/ustring#> markupcxx . . $ `$anonymous_namespace_src/joystick_test_widget.cpp`/DeviceColumns#markup.; |
| 34 | }; |
| 35 | |
| 36 | DeviceColumnscxx . . $ `$anonymous_namespace_src/joystick_test_widget.cpp`/DeviceColumns#& device_columnscxx . . $ `$anonymous_namespace_src/joystick_test_widget.cpp`/device_columns(1af76caf03e395c1).() |
| 37 | { |
| 38 | static DeviceColumnscxx . . $ `$anonymous_namespace_src/joystick_test_widget.cpp`/DeviceColumns# colscxx . . $ `$anonymous_namespace_src/joystick_test_widget.cpp`/DeviceColumns#DeviceColumns(49f6e7a06ebc5aa8).; |
| 39 | return cols; |
| 40 | } |
| 41 | |
| 42 | Glibcxx . . $ Glib/::ustringcxx . . $ Glib/ustring# device_entry_markupcxx . . $ `$anonymous_namespace_src/joystick_test_widget.cpp`/device_entry_markup(e3b777c8f9970bbb).(const Glibcxx . . $ Glib/::ustringcxx . . $ Glib/ustring#& name, |
| 43 | const Glibcxx . . $ Glib/::ustringcxx . . $ Glib/ustring#& path, |
| 44 | const Glibcxx . . $ Glib/::ustringcxx . . $ Glib/ustring#& usb_id) |
| 45 | { |
| 46 | return "<b>"cxx . . $ Glib/ustring#ustring(9ff8f5cb794dfdbf). +cxx . . $ Glib/operator+(733d8bb4b557ea40). Glibcxx . . $ Glib/::Markupcxx . . $ Glib/Markup/::escape_textcxx . . $ Glib/Markup/escape_text(f09497d1ca15336f).(name) +cxx . . $ Glib/operator+(6b0655b476210372). "</b>\n" |
| 47 | "Device: " +cxx . . $ Glib/operator+(a085081755b563c5). Glibcxx . . $ Glib/::Markupcxx . . $ Glib/Markup/::escape_textcxx . . $ Glib/Markup/escape_text(f09497d1ca15336f).(path) +cxx . . $ Glib/operator+(6b0655b476210372). "\n" |
| 48 | "USB ID: " +cxx . . $ Glib/operator+(a085081755b563c5). Glibcxx . . $ Glib/::Markupcxx . . $ Glib/Markup/::escape_textcxx . . $ Glib/Markup/escape_text(f09497d1ca15336f).(usb_id.emptycxx . . $ Glib/ustring#empty(50ce9a9e25b4a850).() ? "unknown"cxx . . $ Glib/ustring#ustring(1ff0bff2cee2bc51). : usb_idcxx . . $ Glib/ustring#ustring(1ff0bff2cee2bc51).); |
| 49 | } |
| 50 | |
| 51 | } // namespace |
| 52 | |
| 53 | JoystickTestWidgetcxx . . $ JoystickTestWidget#::~cxx . . $ JoystickTestWidget#`~JoystickTestWidget`(49f6e7a06ebc5aa8).JoystickTestWidgetcxx . . $ JoystickTestWidget#() = default; |
| 54 | |
| 55 | JoystickTestWidgetcxx . . $ JoystickTestWidget#::JoystickTestWidgetcxx . . $ JoystickTestWidget#JoystickTestWidget(a6d8bc3e36d41cda).(bool simple_ui, const stdcxx . . $ std/::stringcxx . . $ std/string#& optional_device) : |
| 56 | Gtkcxx . . $ Gtk/::Windowcxx . . $ Gtk/Window#(), |
| 57 | m_simple_uicxx . . $ JoystickTestWidget#m_simple_ui.(simple_ui), |
| 58 | axis_framecxx . . $ JoystickTestWidget#axis_frame.("Axes"cxx . . $ Glib/ustring#ustring(85c52e162fed56f9).), |
| 59 | button_framecxx . . $ JoystickTestWidget#button_frame.("Buttons"cxx . . $ Glib/ustring#ustring(85c52e162fed56f9).), |
| 60 | mapping_buttoncxx . . $ JoystickTestWidget#mapping_button.("Mapping"cxx . . $ Glib/ustring#ustring(85c52e162fed56f9).), |
| 61 | calibration_buttoncxx . . $ JoystickTestWidget#calibration_button.("Calibration"cxx . . $ Glib/ustring#ustring(85c52e162fed56f9).), |
| 62 | close_buttoncxx . . $ JoystickTestWidget#close_button.(Gtkcxx . . $ Gtk/StockID#StockID(5e31ef76c53be42c).::Stockcxx . . $ Gtk/Stock/::CLOSEcxx . . $ Gtk/Stock/CLOSE.), |
| 63 | stick1_widgetcxx . . $ JoystickTestWidget#stick1_widget.(128, 128), |
| 64 | stick2_widgetcxx . . $ JoystickTestWidget#stick2_widget.(128, 128), |
| 65 | stick3_widgetcxx . . $ JoystickTestWidget#stick3_widget.(128, 128), |
| 66 | rudder_widgetcxx . . $ JoystickTestWidget#rudder_widget.(128, 32), |
| 67 | throttle_widgetcxx . . $ JoystickTestWidget#throttle_widget.(32, 128), |
| 68 | left_trigger_widgetcxx . . $ JoystickTestWidget#left_trigger_widget.(32, 128, true), |
| 69 | right_trigger_widgetcxx . . $ JoystickTestWidget#right_trigger_widget.(32, 128, true) |
| 70 | { |
| 71 | set_titlecxx . . $ Gtk/Window#set_title(1ff0bff2cee2bc51).("jstest-gtk"cxx . . $ Glib/ustring#ustring(85c52e162fed56f9).); |
| 72 | set_icon_from_filecxx . . $ Gtk/Window#set_icon_from_file(7c222eea44a24d43).(Maincxx . . $ Main#::currentcxx . . $ Main#current(d972e08ee8a5bfee).()->get_data_directorycxx . . $ Main#get_data_directory(219584694fe2b248).() +cxx . . $ std/operator+(900ec9581c410ad9). "icons/generic.png"); |
| 73 | set_default_sizecxx . . $ Gtk/Window#set_default_size(3e454b8ccf442868).(520, 400); |
| 74 | |
| 75 | axis_framecxx . . $ JoystickTestWidget#axis_frame..set_border_widthcxx . . $ Gtk/Container#set_border_width(cb2f890c2fdad230).(5); |
| 76 | axis_tablecxx . . $ JoystickTestWidget#axis_table..set_border_widthcxx . . $ Gtk/Container#set_border_width(cb2f890c2fdad230).(5); |
| 77 | axis_tablecxx . . $ JoystickTestWidget#axis_table..set_spacingscxx . . $ Gtk/Table#set_spacings(cb2f890c2fdad230).(5); |
| 78 | button_framecxx . . $ JoystickTestWidget#button_frame..set_border_widthcxx . . $ Gtk/Container#set_border_width(cb2f890c2fdad230).(5); |
| 79 | button_tablecxx . . $ JoystickTestWidget#button_table..set_border_widthcxx . . $ Gtk/Container#set_border_width(cb2f890c2fdad230).(5); |
| 80 | button_tablecxx . . $ JoystickTestWidget#button_table..set_spacingscxx . . $ Gtk/Table#set_spacings(cb2f890c2fdad230).(8); |
| 81 | buttonboxcxx . . $ JoystickTestWidget#buttonbox..set_border_widthcxx . . $ Gtk/Container#set_border_width(cb2f890c2fdad230).(5); |
| 82 | stick_hboxcxx . . $ JoystickTestWidget#stick_hbox..set_border_widthcxx . . $ Gtk/Container#set_border_width(cb2f890c2fdad230).(5); |
| 83 | |
| 84 | m_device_storecxx . . $ JoystickTestWidget#m_device_store. =cxx . . $ Glib/RefPtr#`operator=`(b66de19e2ab7ce1f). Gtkcxx . . $ Gtk/::ListStorecxx . . $ Gtk/ListStore#::createcxx . . $ Gtk/ListStore#create(6b3238bf3b35b5b6).(device_columnscxx . . $ `$anonymous_namespace_src/joystick_test_widget.cpp`/device_columns(1af76caf03e395c1).()); |
| 85 | m_device_combocxx . . $ JoystickTestWidget#m_device_combo..set_modelcxx . . $ Gtk/ComboBox#set_model(163469a83190ea6a).(m_device_storecxx . . $ Glib/RefPtr#RefPtr(11a1ac667024f826).); |
| 86 | m_device_combocxx . . $ JoystickTestWidget#m_device_combo..set_hexpandcxx . . $ Gtk/Widget#set_hexpand(b45ddcbc8423892c).(true); |
| 87 | m_device_combocxx . . $ JoystickTestWidget#m_device_combo..set_focus_on_clickcxx . . $ Gtk/ComboBox#set_focus_on_click(b45ddcbc8423892c).(false); |
| 88 | { |
| 89 | auto* renderer = Gtkcxx . . $ Gtk/::managecxx . . $ Gtk/manage(98ea26de6545f0ca).(new Gtkcxx . . $ Gtk/::CellRendererTextcxx . . $ Gtk/CellRendererText#()); |
| 90 | renderer->property_xaligncxx . . $ Gtk/CellRenderer#property_xalign(31c2a2acc51e77db).() =cxx . . $ Glib/PropertyProxy#`operator=`(96d6f65396a143d8). 0.0; |
| 91 | // Multi-line rows in the popup and closed button |
| 92 | m_device_combocxx . . $ JoystickTestWidget#m_device_combo..pack_startcxx . . $ Gtk/CellLayout#pack_start(10f3d714fe73d3b9).(*renderer, true); |
| 93 | m_device_combocxx . . $ JoystickTestWidget#m_device_combo..add_attributecxx . . $ Gtk/CellLayout#add_attribute(666b215ea28b504f).(renderer->property_markupcxx . . $ Gtk/CellRendererText#property_markup(e65eacb1b792b2d2).(), device_columnscxx . . $ `$anonymous_namespace_src/joystick_test_widget.cpp`/device_columns(1af76caf03e395c1).().markupcxx . . $ `$anonymous_namespace_src/joystick_test_widget.cpp`/DeviceColumns#markup.); |
| 94 | } |
| 95 | m_device_combocxx . . $ JoystickTestWidget#m_device_combo..signal_changedcxx . . $ Gtk/ComboBox#signal_changed(5db58c3a758c1880).().connectcxx . . $ Glib/SignalProxy#connect(23e07d4a2c0735e0).( |
| 96 | sigccxx . . $ sigc/slot#slot(edcd8b2679e9bd1a).::mem_funcxx . . $ sigc/mem_fun(84441c09a3e988ac).(this, &JoystickTestWidgetcxx . . $ JoystickTestWidget#::on_device_changedcxx . . $ JoystickTestWidget#on_device_changed(49f6e7a06ebc5aa8).)); |
| 97 | |
| 98 | buttonboxcxx . . $ JoystickTestWidget#buttonbox..addcxx . . $ Gtk/Container#add(c65b1b431719167f).(mapping_buttoncxx . . $ JoystickTestWidget#mapping_button.); |
| 99 | buttonboxcxx . . $ JoystickTestWidget#buttonbox..addcxx . . $ Gtk/Container#add(c65b1b431719167f).(calibration_buttoncxx . . $ JoystickTestWidget#calibration_button.); |
| 100 | buttonboxcxx . . $ JoystickTestWidget#buttonbox..addcxx . . $ Gtk/Container#add(c65b1b431719167f).(close_buttoncxx . . $ JoystickTestWidget#close_button.); |
| 101 | |
| 102 | test_hboxcxx . . $ JoystickTestWidget#test_hbox..pack_startcxx . . $ Gtk/Box#pack_start(492efd5ed8431628).(axis_framecxx . . $ JoystickTestWidget#axis_frame., Gtkcxx . . $ Gtk/::PACK_EXPAND_WIDGETcxx . . $ Gtk/PACK_EXPAND_WIDGET.); |
| 103 | test_hboxcxx . . $ JoystickTestWidget#test_hbox..pack_startcxx . . $ Gtk/Box#pack_start(492efd5ed8431628).(button_framecxx . . $ JoystickTestWidget#button_frame., Gtkcxx . . $ Gtk/::PACK_EXPAND_WIDGETcxx . . $ Gtk/PACK_EXPAND_WIDGET.); |
| 104 | |
| 105 | m_vboxcxx . . $ JoystickTestWidget#m_vbox..pack_startcxx . . $ Gtk/Box#pack_start(492efd5ed8431628).(m_device_combocxx . . $ JoystickTestWidget#m_device_combo., Gtkcxx . . $ Gtk/::PACK_SHRINKcxx . . $ Gtk/PACK_SHRINK.); |
| 106 | m_vboxcxx . . $ JoystickTestWidget#m_vbox..pack_startcxx . . $ Gtk/Box#pack_start(492efd5ed8431628).(test_hboxcxx . . $ JoystickTestWidget#test_hbox., Gtkcxx . . $ Gtk/::PACK_EXPAND_WIDGETcxx . . $ Gtk/PACK_EXPAND_WIDGET.); |
| 107 | m_vboxcxx . . $ JoystickTestWidget#m_vbox..pack_endcxx . . $ Gtk/Box#pack_end(492efd5ed8431628).(buttonboxcxx . . $ JoystickTestWidget#buttonbox., Gtkcxx . . $ Gtk/::PACK_SHRINKcxx . . $ Gtk/PACK_SHRINK.); |
| 108 | addcxx . . $ Gtk/Container#add(c65b1b431719167f).(m_vboxcxx . . $ JoystickTestWidget#m_vbox.); |
| 109 | |
| 110 | axis_vboxcxx . . $ JoystickTestWidget#axis_vbox..pack_startcxx . . $ Gtk/Box#pack_start(492efd5ed8431628).(stick_hboxcxx . . $ JoystickTestWidget#stick_hbox., Gtkcxx . . $ Gtk/::PACK_SHRINKcxx . . $ Gtk/PACK_SHRINK.); |
| 111 | axis_vboxcxx . . $ JoystickTestWidget#axis_vbox..addcxx . . $ Gtk/Container#add(c65b1b431719167f).(axis_tablecxx . . $ JoystickTestWidget#axis_table.); |
| 112 | axis_framecxx . . $ JoystickTestWidget#axis_frame..addcxx . . $ Gtk/Container#add(c65b1b431719167f).(axis_vboxcxx . . $ JoystickTestWidget#axis_vbox.); |
| 113 | button_framecxx . . $ JoystickTestWidget#button_frame..addcxx . . $ Gtk/Container#add(c65b1b431719167f).(button_tablecxx . . $ JoystickTestWidget#button_table.); |
| 114 | |
| 115 | calibration_buttoncxx . . $ JoystickTestWidget#calibration_button..signal_clickedcxx . . $ Gtk/Button#signal_clicked(5db58c3a758c1880).().connectcxx . . $ Glib/SignalProxy#connect(23e07d4a2c0735e0).(sigccxx . . $ sigc/slot#slot(edcd8b2679e9bd1a).::mem_funcxx . . $ sigc/mem_fun(84441c09a3e988ac).(this, &JoystickTestWidgetcxx . . $ JoystickTestWidget#::on_calibratecxx . . $ JoystickTestWidget#on_calibrate(49f6e7a06ebc5aa8).)); |
| 116 | mapping_buttoncxx . . $ JoystickTestWidget#mapping_button..signal_clickedcxx . . $ Gtk/Button#signal_clicked(5db58c3a758c1880).().connectcxx . . $ Glib/SignalProxy#connect(23e07d4a2c0735e0).(sigccxx . . $ sigc/slot#slot(edcd8b2679e9bd1a).::mem_funcxx . . $ sigc/mem_fun(84441c09a3e988ac).(this, &JoystickTestWidgetcxx . . $ JoystickTestWidget#::on_mappingcxx . . $ JoystickTestWidget#on_mapping(49f6e7a06ebc5aa8).)); |
| 117 | close_buttoncxx . . $ JoystickTestWidget#close_button..signal_clickedcxx . . $ Gtk/Button#signal_clicked(5db58c3a758c1880).().connectcxx . . $ Glib/SignalProxy#connect(23e07d4a2c0735e0).([cxx . . $ sigc/slot#slot(edcd8b2679e9bd1a).this]{ hidecxx . . $ Gtk/Widget#hide(49f6e7a06ebc5aa8).(); }); |
| 118 | |
| 119 | udev_monitorcxx . . $ JoystickTestWidget#udev_monitor..resetcxx . . $ std/unique_ptr#reset(57bc6b0441bf5294).(new UdevMonitorcxx . . $ UdevMonitor#()); |
| 120 | udev_monitorcxx . . $ JoystickTestWidget#udev_monitor.->cxx . . $ std/unique_ptr#`operator->`(ca399b2b6292c808).signal_joystick_eventcxx . . $ UdevMonitor#signal_joystick_event..connectcxx . . $ sigc/signal2#connect(caeb51ab355a557b).( |
| 121 | sigccxx . . $ sigc/slot#slot(edcd8b2679e9bd1a).::mem_funcxx . . $ sigc/mem_fun(e9236287a72714ab).(this, &JoystickTestWidgetcxx . . $ JoystickTestWidget#::on_udev_js_eventcxx . . $ JoystickTestWidget#on_udev_js_event(c3ca1c130ce09c52).)); |
| 122 | |
| 123 | refresh_device_listcxx . . $ JoystickTestWidget#refresh_device_list(9c546c94e5fcce4e).(optional_device); |
| 124 | close_buttoncxx . . $ JoystickTestWidget#close_button..grab_focuscxx . . $ Gtk/Widget#grab_focus(49f6e7a06ebc5aa8).(); |
| 125 | } |
| 126 | |
| 127 | void |
| 128 | JoystickTestWidgetcxx . . $ JoystickTestWidget#::clear_device_uicxx . . $ JoystickTestWidget#clear_device_ui(49f6e7a06ebc5aa8).() |
| 129 | { |
| 130 | m_axis_conncxx . . $ JoystickTestWidget#m_axis_conn..disconnectcxx . . $ sigc/connection#disconnect(49f6e7a06ebc5aa8).(); |
| 131 | m_button_conncxx . . $ JoystickTestWidget#m_button_conn..disconnectcxx . . $ sigc/connection#disconnect(49f6e7a06ebc5aa8).(); |
| 132 | |
| 133 | if (m_mapping_widgetcxx . . $ JoystickTestWidget#m_mapping_widget.) |
| 134 | m_mapping_widgetcxx . . $ JoystickTestWidget#m_mapping_widget..resetcxx . . $ std/unique_ptr#reset(57bc6b0441bf5294).(); |
| 135 | if (m_calibration_widgetcxx . . $ JoystickTestWidget#m_calibration_widget.) |
| 136 | m_calibration_widgetcxx . . $ JoystickTestWidget#m_calibration_widget..resetcxx . . $ std/unique_ptr#reset(57bc6b0441bf5294).(); |
| 137 | |
| 138 | // Detach children from tables/hboxes (managed widgets are deleted with parents) |
| 139 | for (auto* child : axis_tablecxx . . $ JoystickTestWidget#axis_table..get_childrencxx . . $ Gtk/Container#get_children(fe15fd335df0fd10).()) |
| 140 | axis_tablecxx . . $ JoystickTestWidget#axis_table..removecxx . . $ Gtk/Container#remove(c65b1b431719167f).(*child); |
| 141 | for (auto* child : button_tablecxx . . $ JoystickTestWidget#button_table..get_childrencxx . . $ Gtk/Container#get_children(fe15fd335df0fd10).()) |
| 142 | button_tablecxx . . $ JoystickTestWidget#button_table..removecxx . . $ Gtk/Container#remove(c65b1b431719167f).(*child); |
| 143 | for (auto* child : stick_hboxcxx . . $ JoystickTestWidget#stick_hbox..get_childrencxx . . $ Gtk/Container#get_children(fe15fd335df0fd10).()) |
| 144 | stick_hboxcxx . . $ JoystickTestWidget#stick_hbox..removecxx . . $ Gtk/Container#remove(c65b1b431719167f).(*child); |
| 145 | |
| 146 | axescxx . . $ JoystickTestWidget#axes..clearcxx . . $ std/vector#clear(49f6e7a06ebc5aa8).(); |
| 147 | buttonscxx . . $ JoystickTestWidget#buttons..clearcxx . . $ std/vector#clear(49f6e7a06ebc5aa8).(); |
| 148 | axis_callbackscxx . . $ JoystickTestWidget#axis_callbacks..clearcxx . . $ std/vector#clear(49f6e7a06ebc5aa8).(); |
| 149 | } |
| 150 | |
| 151 | void |
| 152 | JoystickTestWidgetcxx . . $ JoystickTestWidget#::set_empty_statecxx . . $ JoystickTestWidget#set_empty_state(49f6e7a06ebc5aa8).() |
| 153 | { |
| 154 | clear_device_uicxx . . $ JoystickTestWidget#clear_device_ui(49f6e7a06ebc5aa8).(); |
| 155 | m_joystickcxx . . $ JoystickTestWidget#m_joystick..resetcxx . . $ std/unique_ptr#reset(57bc6b0441bf5294).(); |
| 156 | m_connectedcxx . . $ JoystickTestWidget#m_connected. = false; |
| 157 | |
| 158 | m_updating_combocxx . . $ JoystickTestWidget#m_updating_combo. = true; |
| 159 | m_device_storecxx . . $ JoystickTestWidget#m_device_store.->cxx . . $ Glib/RefPtr#`operator->`(5a2a78a048fb49a8).clearcxx . . $ Gtk/ListStore#clear(49f6e7a06ebc5aa8).(); |
| 160 | { |
| 161 | auto row = *cxx . . $ Gtk/TreeIter#`operator*`(f3c18258c91a795).m_device_storecxx . . $ JoystickTestWidget#m_device_store.->cxx . . $ Glib/RefPtr#`operator->`(5a2a78a048fb49a8).appendcxx . . $ Gtk/ListStore#append(2910abbde3964236).(); |
| 162 | row[cxx . . $ Gtk/TreeRow#`operator[]`(8a28268fd9c4eab5).device_columnscxx . . $ `$anonymous_namespace_src/joystick_test_widget.cpp`/device_columns(1af76caf03e395c1).().pathcxx . . $ `$anonymous_namespace_src/joystick_test_widget.cpp`/DeviceColumns#path.] =cxx . . $ Gtk/TreeValueProxy#`operator=`(98a201c0d7d7f90d). "none"cxx . . $ Glib/ustring#ustring(85c52e162fed56f9).; |
| 163 | row[cxx . . $ Gtk/TreeRow#`operator[]`(8a28268fd9c4eab5).device_columnscxx . . $ `$anonymous_namespace_src/joystick_test_widget.cpp`/device_columns(1af76caf03e395c1).().markupcxx . . $ `$anonymous_namespace_src/joystick_test_widget.cpp`/DeviceColumns#markup.] =cxx . . $ Gtk/TreeValueProxy#`operator=`(98a201c0d7d7f90d). "<i>No joystick connected</i>"cxx . . $ Glib/ustring#ustring(85c52e162fed56f9).; |
| 164 | m_device_combocxx . . $ JoystickTestWidget#m_device_combo..set_activecxx . . $ Gtk/ComboBox#set_active(fe84ae3a1da4c59c).(row); |
| 165 | } |
| 166 | m_device_combocxx . . $ JoystickTestWidget#m_device_combo..set_sensitivecxx . . $ Gtk/Widget#set_sensitive(b45ddcbc8423892c).(false); |
| 167 | m_updating_combocxx . . $ JoystickTestWidget#m_updating_combo. = false; |
| 168 | |
| 169 | set_titlecxx . . $ Gtk/Window#set_title(1ff0bff2cee2bc51).("jstest-gtk"cxx . . $ Glib/ustring#ustring(85c52e162fed56f9).); |
| 170 | mapping_buttoncxx . . $ JoystickTestWidget#mapping_button..set_sensitivecxx . . $ Gtk/Widget#set_sensitive(b45ddcbc8423892c).(false); |
| 171 | calibration_buttoncxx . . $ JoystickTestWidget#calibration_button..set_sensitivecxx . . $ Gtk/Widget#set_sensitive(b45ddcbc8423892c).(false); |
| 172 | } |
| 173 | |
| 174 | void |
| 175 | JoystickTestWidgetcxx . . $ JoystickTestWidget#::build_device_uicxx . . $ JoystickTestWidget#build_device_ui(49f6e7a06ebc5aa8).() |
| 176 | { |
| 177 | if (!m_joystickcxx . . $ JoystickTestWidget#m_joystick.) |
| 178 | return; |
| 179 | |
| 180 | Joystickcxx . . $ Joystick#& joystick = *cxx . . $ std/unique_ptr#`operator*`(f3c3f5757bf81a4e).m_joystickcxx . . $ JoystickTestWidget#m_joystick.; |
| 181 | |
| 182 | set_titlecxx . . $ Gtk/Window#set_title(1ff0bff2cee2bc51).(joystick.get_namecxx . . $ Joystick#get_name(fff0f585954e56f3).()); |
| 183 | |
| 184 | for (int i = 0; i < joystick.get_axis_countcxx . . $ Joystick#get_axis_count(455f465bc33b4cdf).(); ++i) |
| 185 | { |
| 186 | stdcxx . . $ std/::ostringstreamcxx . . $ std/ostringstream# strcxx . . $ std/__cxx11/basic_ostringstream#basic_ostringstream(49f6e7a06ebc5aa8).; |
| 187 | str <<cxx . . $ std/`operator<<`(efaf8c13fc75f3c7). "Axis " <<cxx . . $ std/basic_ostream#`operator<<`(23b6575433a77e57). i; |
| 188 | try { |
| 189 | if (!joystick.js_cfgcxx . . $ Joystick#js_cfg..axescxx . . $ JoystickConfig#axes..emptycxx . . $ std/vector#empty(50ce9a9e25b4a850).() && |
| 190 | i < static_cast<int>(joystick.js_cfgcxx . . $ Joystick#js_cfg..axescxx . . $ JoystickConfig#axes..sizecxx . . $ std/vector#size(fe4d2d262d4164a8).()) && |
| 191 | !joystick.js_cfgcxx . . $ Joystick#js_cfg..axescxx . . $ JoystickConfig#axes..atcxx . . $ std/vector#at(428bb168810b9e52).(i).emptycxx . . $ std/__cxx11/basic_string#empty(50ce9a9e25b4a850).()) |
| 192 | { |
| 193 | str <<cxx . . $ std/`operator<<`(efaf8c13fc75f3c7). " [" <<cxx . . $ std/`operator<<`(88df5bef833f7f83). joystick.js_cfgcxx . . $ Joystick#js_cfg..axescxx . . $ JoystickConfig#axes.[cxx . . $ std/vector#`operator[]`(428bb168810b9e52).i] <<cxx . . $ std/`operator<<`(efaf8c13fc75f3c7). "] "; |
| 194 | } |
| 195 | } catch (const stdcxx . . $ std/::out_of_rangecxx . . $ std/out_of_range#&) {} |
| 196 | str <<cxx . . $ std/`operator<<`(efaf8c13fc75f3c7). ": "; |
| 197 | auto* lbl = Gtkcxx . . $ Gtk/::managecxx . . $ Gtk/manage(98ea26de6545f0ca).(new Gtkcxx . . $ Gtk/::Labelcxx . . $ Gtk/Label#(strcxx . . $ Glib/ustring#ustring(b484295947d76b8d)..strcxx . . $ std/__cxx11/basic_ostringstream#str(d33e1a6fd36255f7).())); |
| 198 | lbl->set_xaligncxx . . $ Gtk/Label#set_xalign(9364e6e7bff7660).(0.0); |
| 199 | |
| 200 | Gtkcxx . . $ Gtk/::ProgressBarcxx . . $ Gtk/ProgressBar#& progressbar = *Gtkcxx . . $ Gtk/::managecxx . . $ Gtk/manage(98ea26de6545f0ca).(new Gtkcxx . . $ Gtk/::ProgressBarcxx . . $ Gtk/ProgressBar#()); |
| 201 | progressbar.set_fractioncxx . . $ Gtk/ProgressBar#set_fraction(ba8836b59fb42830).(0.5); |
| 202 | |
| 203 | int x = (i / 10) * 2; |
| 204 | int y = i % 10; |
| 205 | axis_tablecxx . . $ JoystickTestWidget#axis_table..attachcxx . . $ Gtk/Table#attach(45588a21adf610ec).(*lbl, x, x + 1, y, y + 1, Gtkcxx . . $ Gtk/::FILLcxx . . $ Gtk/FILL., Gtkcxx . . $ Gtk/::SHRINKcxx . . $ Gtk/SHRINK.); |
| 206 | axis_tablecxx . . $ JoystickTestWidget#axis_table..attachcxx . . $ Gtk/Table#attach(45588a21adf610ec).(progressbar, x + 1, x + 2, y, y + 1, Gtkcxx . . $ Gtk/::FILLcxx . . $ Gtk/FILL. |cxx . . $ Gtk/`operator|`(ef3d89dfa1d77c2d). Gtkcxx . . $ Gtk/::EXPANDcxx . . $ Gtk/EXPAND., Gtkcxx . . $ Gtk/::EXPANDcxx . . $ Gtk/EXPAND.); |
| 207 | axescxx . . $ JoystickTestWidget#axes..push_backcxx . . $ std/vector#push_back(fe7a8a4d1eddb70).(&progressbar); |
| 208 | } |
| 209 | |
| 210 | for (int i = 0; i < joystick.get_button_countcxx . . $ Joystick#get_button_count(455f465bc33b4cdf).(); ++i) |
| 211 | { |
| 212 | int x = i / 10; |
| 213 | int y = i % 10; |
| 214 | stdcxx . . $ std/::ostringstreamcxx . . $ std/ostringstream# strcxx . . $ std/__cxx11/basic_ostringstream#basic_ostringstream(49f6e7a06ebc5aa8).; |
| 215 | str <<cxx . . $ std/basic_ostream#`operator<<`(23b6575433a77e57). i; |
| 216 | try { |
| 217 | if (!joystick.js_cfgcxx . . $ Joystick#js_cfg..buttonscxx . . $ JoystickConfig#buttons..emptycxx . . $ std/vector#empty(50ce9a9e25b4a850).() && |
| 218 | i < static_cast<int>(joystick.js_cfgcxx . . $ Joystick#js_cfg..buttonscxx . . $ JoystickConfig#buttons..sizecxx . . $ std/vector#size(fe4d2d262d4164a8).()) && |
| 219 | !joystick.js_cfgcxx . . $ Joystick#js_cfg..buttonscxx . . $ JoystickConfig#buttons.[cxx . . $ std/vector#`operator[]`(428bb168810b9e52).i].emptycxx . . $ std/__cxx11/basic_string#empty(50ce9a9e25b4a850).()) |
| 220 | { |
| 221 | str <<cxx . . $ std/`operator<<`(efaf8c13fc75f3c7). " - " <<cxx . . $ std/`operator<<`(88df5bef833f7f83). joystick.js_cfgcxx . . $ Joystick#js_cfg..buttonscxx . . $ JoystickConfig#buttons.[cxx . . $ std/vector#`operator[]`(428bb168810b9e52).i]; |
| 222 | } |
| 223 | } catch (const stdcxx . . $ std/::out_of_rangecxx . . $ std/out_of_range#&) {} |
| 224 | |
| 225 | auto* button = Gtkcxx . . $ Gtk/::managecxx . . $ Gtk/manage(98ea26de6545f0ca).(new ButtonWidgetcxx . . $ ButtonWidget#()); |
| 226 | auto* blabel = Gtkcxx . . $ Gtk/::managecxx . . $ Gtk/manage(98ea26de6545f0ca).(new Gtkcxx . . $ Gtk/::Labelcxx . . $ Gtk/Label#(strcxx . . $ Glib/ustring#ustring(b484295947d76b8d)..strcxx . . $ std/__cxx11/basic_ostringstream#str(d33e1a6fd36255f7).())); |
| 227 | blabel->set_xaligncxx . . $ Gtk/Label#set_xalign(9364e6e7bff7660).(0.0); |
| 228 | blabel->set_margin_startcxx . . $ Gtk/Widget#set_margin_start(d4f767463ce0a6b3).(10); |
| 229 | blabel->set_margin_endcxx . . $ Gtk/Widget#set_margin_end(d4f767463ce0a6b3).(10); |
| 230 | button->addcxx . . $ Gtk/Container#add(c65b1b431719167f).(*blabel); |
| 231 | button_tablecxx . . $ JoystickTestWidget#button_table..attachcxx . . $ Gtk/Table#attach(45588a21adf610ec).(*button, x, x + 1, y, y + 1, Gtkcxx . . $ Gtk/::EXPANDcxx . . $ Gtk/EXPAND. |cxx . . $ Gtk/`operator|`(ef3d89dfa1d77c2d). Gtkcxx . . $ Gtk/::FILLcxx . . $ Gtk/FILL., Gtkcxx . . $ Gtk/::EXPANDcxx . . $ Gtk/EXPAND.); |
| 232 | buttonscxx . . $ JoystickTestWidget#buttons..push_backcxx . . $ std/vector#push_back(77d9f17553126ecb).(button); |
| 233 | } |
| 234 | |
| 235 | axis_callbackscxx . . $ JoystickTestWidget#axis_callbacks..clearcxx . . $ std/vector#clear(49f6e7a06ebc5aa8).(); |
| 236 | for (int i = 0; i < joystick.get_axis_countcxx . . $ Joystick#get_axis_count(455f465bc33b4cdf).(); ++i) |
| 237 | axis_callbackscxx . . $ JoystickTestWidget#axis_callbacks..push_backcxx . . $ std/vector#push_back(fe7a8a4d1eddb70).(sigccxx . . $ sigc/signal#signal(49f6e7a06ebc5aa8).::signalcxx . . $ sigc/signal#<void, double>()); |
| 238 | |
| 239 | if (m_verbosecxx . . $ m_verbose.) |
| 240 | { |
| 241 | stdcxx . . $ std/::coutcxx . . $ std/cout. <<cxx . . $ std/`operator<<`(efaf8c13fc75f3c7). "joystick.get_name(): " <<cxx . . $ Glib/`operator<<`(d3a65685b7328161). joystick.get_namecxx . . $ Joystick#get_name(fff0f585954e56f3).() <<cxx . . $ std/basic_ostream#`operator<<`(f46f7e25851d787a). stdcxx . . $ std/::endlcxx . . $ std/endl(345bf97a19cc83a9).; |
| 242 | stdcxx . . $ std/::coutcxx . . $ std/cout. <<cxx . . $ std/`operator<<`(efaf8c13fc75f3c7). "joystick.get_usb_id(): " <<cxx . . $ std/`operator<<`(88df5bef833f7f83). joystick.get_usb_idcxx . . $ Joystick#get_usb_id(219584694fe2b248).() <<cxx . . $ std/basic_ostream#`operator<<`(f46f7e25851d787a). stdcxx . . $ std/::endlcxx . . $ std/endl(345bf97a19cc83a9).; |
| 243 | stdcxx . . $ std/::coutcxx . . $ std/cout. <<cxx . . $ std/`operator<<`(efaf8c13fc75f3c7). "joystick.get_js_type(): " <<cxx . . $ std/`operator<<`(88df5bef833f7f83). joystick.get_js_typecxx . . $ Joystick#get_js_type(219584694fe2b248).() <<cxx . . $ std/basic_ostream#`operator<<`(f46f7e25851d787a). stdcxx . . $ std/::endlcxx . . $ std/endl(345bf97a19cc83a9).; |
| 244 | stdcxx . . $ std/::coutcxx . . $ std/cout. <<cxx . . $ std/`operator<<`(efaf8c13fc75f3c7). "joystick.get_axis_count(): " <<cxx . . $ std/basic_ostream#`operator<<`(23b6575433a77e57). joystick.get_axis_countcxx . . $ Joystick#get_axis_count(455f465bc33b4cdf).() <<cxx . . $ std/basic_ostream#`operator<<`(f46f7e25851d787a). stdcxx . . $ std/::endlcxx . . $ std/endl(345bf97a19cc83a9).; |
| 245 | } |
| 246 | |
| 247 | if (joystick.get_js_typecxx . . $ Joystick#get_js_type(219584694fe2b248).() ==cxx . . $ std/`operator==`(4b17aa87c9f300c6). "ps4-dualshock4") |
| 248 | setup_dualshock4_equivcxx . . $ JoystickTestWidget#setup_dualshock4_equiv(49f6e7a06ebc5aa8).(); |
| 249 | else if (joystick.get_js_typecxx . . $ Joystick#get_js_type(219584694fe2b248).() ==cxx . . $ std/`operator==`(4b17aa87c9f300c6). "ps3-sixaxis") |
| 250 | setup_sixaxis_equivcxx . . $ JoystickTestWidget#setup_sixaxis_equiv(49f6e7a06ebc5aa8).(); |
| 251 | else if (joystick.get_js_typecxx . . $ Joystick#get_js_type(219584694fe2b248).() ==cxx . . $ std/`operator==`(4b17aa87c9f300c6). "ps2-dualshock2") |
| 252 | setup_dualshock2_equivcxx . . $ JoystickTestWidget#setup_dualshock2_equiv(49f6e7a06ebc5aa8).(); |
| 253 | else if (joystick.get_js_typecxx . . $ Joystick#get_js_type(219584694fe2b248).() ==cxx . . $ std/`operator==`(4b17aa87c9f300c6). "xbox360") |
| 254 | setup_xbox360_equivcxx . . $ JoystickTestWidget#setup_xbox360_equiv(49f6e7a06ebc5aa8).(); |
| 255 | else if (joystick.get_js_typecxx . . $ Joystick#get_js_type(219584694fe2b248).() ==cxx . . $ std/`operator==`(4b17aa87c9f300c6). "gamecube") |
| 256 | setup_gamecube_equivcxx . . $ JoystickTestWidget#setup_gamecube_equiv(49f6e7a06ebc5aa8).(); |
| 257 | else |
| 258 | { |
| 259 | switch (joystick.get_axis_countcxx . . $ Joystick#get_axis_count(455f465bc33b4cdf).()) |
| 260 | { |
| 261 | case 2: |
| 262 | setup_joystick_widgetscxx . . $ JoystickTestWidget#setup_joystick_widgets(6e75af32c21ea348).(1, {cxx . . $ std/vector#vector(9619226211e5a241).0, 1}, {cxx . . $ std/vector#vector(49f6e7a06ebc5aa8).}); |
| 263 | break; |
| 264 | case 6: |
| 265 | { |
| 266 | Gtkcxx . . $ Gtk/::Tablecxx . . $ Gtk/Table#& table = *Gtkcxx . . $ Gtk/::managecxx . . $ Gtk/manage(98ea26de6545f0ca).(new Gtkcxx . . $ Gtk/::Tablecxx . . $ Gtk/Table#(2, 2)); |
| 267 | table.attachcxx . . $ Gtk/Table#attach(45588a21adf610ec).(stick1_widgetcxx . . $ JoystickTestWidget#stick1_widget., 0, 1, 0, 1, Gtkcxx . . $ Gtk/::SHRINKcxx . . $ Gtk/SHRINK., Gtkcxx . . $ Gtk/::SHRINKcxx . . $ Gtk/SHRINK.); |
| 268 | table.attachcxx . . $ Gtk/Table#attach(45588a21adf610ec).(rudder_widgetcxx . . $ JoystickTestWidget#rudder_widget., 0, 1, 1, 2, Gtkcxx . . $ Gtk/::SHRINKcxx . . $ Gtk/SHRINK., Gtkcxx . . $ Gtk/::SHRINKcxx . . $ Gtk/SHRINK.); |
| 269 | table.attachcxx . . $ Gtk/Table#attach(45588a21adf610ec).(throttle_widgetcxx . . $ JoystickTestWidget#throttle_widget., 1, 2, 0, 1, Gtkcxx . . $ Gtk/::SHRINKcxx . . $ Gtk/SHRINK., Gtkcxx . . $ Gtk/::SHRINKcxx . . $ Gtk/SHRINK.); |
| 270 | stick_hboxcxx . . $ JoystickTestWidget#stick_hbox..pack_startcxx . . $ Gtk/Box#pack_start(492efd5ed8431628).(table, Gtkcxx . . $ Gtk/::PACK_EXPAND_PADDINGcxx . . $ Gtk/PACK_EXPAND_PADDING.); |
| 271 | stick_hboxcxx . . $ JoystickTestWidget#stick_hbox..pack_startcxx . . $ Gtk/Box#pack_start(492efd5ed8431628).(stick3_widgetcxx . . $ JoystickTestWidget#stick3_widget., Gtkcxx . . $ Gtk/::PACK_EXPAND_PADDINGcxx . . $ Gtk/PACK_EXPAND_PADDING.); |
| 272 | axis_callbackscxx . . $ JoystickTestWidget#axis_callbacks.[cxx . . $ std/vector#`operator[]`(428bb168810b9e52).0].connectcxx . . $ sigc/signal1#connect(18bafff315daab59).(sigccxx . . $ sigc/slot#slot(edcd8b2679e9bd1a).::mem_funcxx . . $ sigc/mem_fun(5a1f7901f4fc005e).(stick1_widgetcxx . . $ JoystickTestWidget#stick1_widget., &AxisWidgetcxx . . $ AxisWidget#::set_x_axiscxx . . $ AxisWidget#set_x_axis(ba8836b59fb42830).)); |
| 273 | axis_callbackscxx . . $ JoystickTestWidget#axis_callbacks.[cxx . . $ std/vector#`operator[]`(428bb168810b9e52).1].connectcxx . . $ sigc/signal1#connect(18bafff315daab59).(sigccxx . . $ sigc/slot#slot(edcd8b2679e9bd1a).::mem_funcxx . . $ sigc/mem_fun(5a1f7901f4fc005e).(stick1_widgetcxx . . $ JoystickTestWidget#stick1_widget., &AxisWidgetcxx . . $ AxisWidget#::set_y_axiscxx . . $ AxisWidget#set_y_axis(ba8836b59fb42830).)); |
| 274 | axis_callbackscxx . . $ JoystickTestWidget#axis_callbacks.[cxx . . $ std/vector#`operator[]`(428bb168810b9e52).2].connectcxx . . $ sigc/signal1#connect(18bafff315daab59).(sigccxx . . $ sigc/slot#slot(edcd8b2679e9bd1a).::mem_funcxx . . $ sigc/mem_fun(5a1f7901f4fc005e).(rudder_widgetcxx . . $ JoystickTestWidget#rudder_widget., &RudderWidgetcxx . . $ RudderWidget#::set_poscxx . . $ RudderWidget#set_pos(ba8836b59fb42830).)); |
| 275 | axis_callbackscxx . . $ JoystickTestWidget#axis_callbacks.[cxx . . $ std/vector#`operator[]`(428bb168810b9e52).3].connectcxx . . $ sigc/signal1#connect(18bafff315daab59).(sigccxx . . $ sigc/slot#slot(edcd8b2679e9bd1a).::mem_funcxx . . $ sigc/mem_fun(5a1f7901f4fc005e).(throttle_widgetcxx . . $ JoystickTestWidget#throttle_widget., &ThrottleWidgetcxx . . $ ThrottleWidget#::set_poscxx . . $ ThrottleWidget#set_pos(ba8836b59fb42830).)); |
| 276 | axis_callbackscxx . . $ JoystickTestWidget#axis_callbacks.[cxx . . $ std/vector#`operator[]`(428bb168810b9e52).4].connectcxx . . $ sigc/signal1#connect(18bafff315daab59).(sigccxx . . $ sigc/slot#slot(edcd8b2679e9bd1a).::mem_funcxx . . $ sigc/mem_fun(5a1f7901f4fc005e).(stick3_widgetcxx . . $ JoystickTestWidget#stick3_widget., &AxisWidgetcxx . . $ AxisWidget#::set_x_axiscxx . . $ AxisWidget#set_x_axis(ba8836b59fb42830).)); |
| 277 | axis_callbackscxx . . $ JoystickTestWidget#axis_callbacks.[cxx . . $ std/vector#`operator[]`(428bb168810b9e52).5].connectcxx . . $ sigc/signal1#connect(18bafff315daab59).(sigccxx . . $ sigc/slot#slot(edcd8b2679e9bd1a).::mem_funcxx . . $ sigc/mem_fun(5a1f7901f4fc005e).(stick3_widgetcxx . . $ JoystickTestWidget#stick3_widget., &AxisWidgetcxx . . $ AxisWidget#::set_y_axiscxx . . $ AxisWidget#set_y_axis(ba8836b59fb42830).)); |
| 278 | break; |
| 279 | } |
| 280 | case 7: |
| 281 | setup_joystick_widgetscxx . . $ JoystickTestWidget#setup_joystick_widgets(6e75af32c21ea348).(3, {cxx . . $ std/vector#vector(9619226211e5a241).0, 1, 3, 4, 5, 6}, {cxx . . $ std/vector#vector(49f6e7a06ebc5aa8).}); |
| 282 | break; |
| 283 | case 8: |
| 284 | setup_joystick_widgetscxx . . $ JoystickTestWidget#setup_joystick_widgets(6e75af32c21ea348).(3, {cxx . . $ std/vector#vector(9619226211e5a241).0, 1, 2, 3, 6, 7}, {cxx . . $ std/vector#vector(9619226211e5a241).4, 5}); |
| 285 | break; |
| 286 | default: |
| 287 | if (m_verbosecxx . . $ m_verbose.) |
| 288 | stdcxx . . $ std/::coutcxx . . $ std/cout. <<cxx . . $ std/`operator<<`(efaf8c13fc75f3c7). "No graphical stick layout for this axis count." <<cxx . . $ std/basic_ostream#`operator<<`(f46f7e25851d787a). stdcxx . . $ std/::endlcxx . . $ std/endl(345bf97a19cc83a9).; |
| 289 | break; |
| 290 | } |
| 291 | } |
| 292 | |
| 293 | if (m_simple_uicxx . . $ JoystickTestWidget#m_simple_ui.) |
| 294 | { |
| 295 | // hide stick graphics by removing from axis_vbox if packed |
| 296 | if (stick_hboxcxx . . $ JoystickTestWidget#stick_hbox..get_parentcxx . . $ Gtk/Widget#get_parent(82bc654f5e8a60b4).()) |
| 297 | axis_vboxcxx . . $ JoystickTestWidget#axis_vbox..removecxx . . $ Gtk/Container#remove(c65b1b431719167f).(stick_hboxcxx . . $ JoystickTestWidget#stick_hbox.); |
| 298 | } |
| 299 | else if (!stick_hboxcxx . . $ JoystickTestWidget#stick_hbox..get_parentcxx . . $ Gtk/Widget#get_parent(82bc654f5e8a60b4).()) |
| 300 | { |
| 301 | axis_vboxcxx . . $ JoystickTestWidget#axis_vbox..pack_startcxx . . $ Gtk/Box#pack_start(492efd5ed8431628).(stick_hboxcxx . . $ JoystickTestWidget#stick_hbox., Gtkcxx . . $ Gtk/::PACK_SHRINKcxx . . $ Gtk/PACK_SHRINK.); |
| 302 | axis_vboxcxx . . $ JoystickTestWidget#axis_vbox..reorder_childcxx . . $ Gtk/Box#reorder_child(8f5b829cb5dd12db).(stick_hboxcxx . . $ JoystickTestWidget#stick_hbox., 0); |
| 303 | } |
| 304 | |
| 305 | axis_tablecxx . . $ JoystickTestWidget#axis_table..show_allcxx . . $ Gtk/Widget#show_all(49f6e7a06ebc5aa8).(); |
| 306 | button_tablecxx . . $ JoystickTestWidget#button_table..show_allcxx . . $ Gtk/Widget#show_all(49f6e7a06ebc5aa8).(); |
| 307 | stick_hboxcxx . . $ JoystickTestWidget#stick_hbox..show_allcxx . . $ Gtk/Widget#show_all(49f6e7a06ebc5aa8).(); |
| 308 | |
| 309 | m_axis_conncxx . . $ JoystickTestWidget#m_axis_conn. =cxx . . $ sigc/connection#`operator=`(57213ff876e42ba7). joystick.axis_movecxx . . $ Joystick#axis_move..connectcxx . . $ sigc/signal2#connect(caeb51ab355a557b).( |
| 310 | sigccxx . . $ sigc/slot#slot(edcd8b2679e9bd1a).::mem_funcxx . . $ sigc/mem_fun(e9236287a72714ab).(this, &JoystickTestWidgetcxx . . $ JoystickTestWidget#::axis_movecxx . . $ JoystickTestWidget#axis_move(3e454b8ccf442868).)); |
| 311 | m_button_conncxx . . $ JoystickTestWidget#m_button_conn. =cxx . . $ sigc/connection#`operator=`(57213ff876e42ba7). joystick.button_presscxx . . $ Joystick#button_press..connectcxx . . $ sigc/signal2#connect(caeb51ab355a557b).( |
| 312 | sigccxx . . $ sigc/slot#slot(edcd8b2679e9bd1a).::mem_funcxx . . $ sigc/mem_fun(e9236287a72714ab).(this, &JoystickTestWidgetcxx . . $ JoystickTestWidget#::button_presscxx . . $ JoystickTestWidget#button_press(918ebd27a9ddbad3).)); |
| 313 | |
| 314 | m_connectedcxx . . $ JoystickTestWidget#m_connected. = true; |
| 315 | mapping_buttoncxx . . $ JoystickTestWidget#mapping_button..set_sensitivecxx . . $ Gtk/Widget#set_sensitive(b45ddcbc8423892c).(true); |
| 316 | calibration_buttoncxx . . $ JoystickTestWidget#calibration_button..set_sensitivecxx . . $ Gtk/Widget#set_sensitive(b45ddcbc8423892c).(true); |
| 317 | } |
| 318 | |
| 319 | void |
| 320 | JoystickTestWidgetcxx . . $ JoystickTestWidget#::refresh_device_listcxx . . $ JoystickTestWidget#refresh_device_list(9c546c94e5fcce4e).(const stdcxx . . $ std/::stringcxx . . $ std/string#& prefer_path) |
| 321 | { |
| 322 | stdcxx . . $ std/::stringcxx . . $ std/string# previouscxx . . $ std/__cxx11/basic_string#basic_string(49f6e7a06ebc5aa8).; |
| 323 | if (m_joystickcxx . . $ JoystickTestWidget#m_joystick.) |
| 324 | previous =cxx . . $ std/__cxx11/basic_string#`operator=`(706c69e8c742c906). m_joystickcxx . . $ JoystickTestWidget#m_joystick.->cxx . . $ std/unique_ptr#`operator->`(ca399b2b6292c808).get_filenamecxx . . $ Joystick#get_filename(219584694fe2b248).(); |
| 325 | if (!prefer_path.emptycxx . . $ std/__cxx11/basic_string#empty(50ce9a9e25b4a850).()) |
| 326 | previous =cxx . . $ std/__cxx11/basic_string#`operator=`(c0b47be1fddc0e75). prefer_path; |
| 327 | |
| 328 | struct Entrycxx . . $ JoystickTestWidget#refresh_device_list(9c546c94e5fcce4e).Entry# { stdcxx . . $ std/::stringcxx . . $ std/string# pathcxx . . $ JoystickTestWidget#refresh_device_list(9c546c94e5fcce4e).Entry#path.; stdcxx . . $ std/::stringcxx . . $ std/string# js_idcxx . . $ JoystickTestWidget#refresh_device_list(9c546c94e5fcce4e).Entry#js_id.; stdcxx . . $ std/::stringcxx . . $ std/string# namecxx . . $ JoystickTestWidget#refresh_device_list(9c546c94e5fcce4e).Entry#name.; stdcxx . . $ std/::stringcxx . . $ std/string# usb_idcxx . . $ JoystickTestWidget#refresh_device_list(9c546c94e5fcce4e).Entry#usb_id.; }; |
| 329 | stdcxx . . $ std/::vectorcxx . . $ std/vector#<Entrycxx . . $ JoystickTestWidget#refresh_device_list(9c546c94e5fcce4e).Entry#> foundcxx . . $ std/vector#vector(49f6e7a06ebc5aa8).; |
| 330 | |
| 331 | for (int i = 0; i < 32; ++i) |
| 332 | { |
| 333 | stdcxx . . $ std/::stringcxx . . $ std/string# js_id = "js"cxx . . $ std/__cxx11/basic_string#basic_string(3bc0f77cdfbaa67f). +cxx . . $ std/operator+(39ed2c165380f78e). stdcxx . . $ std/::to_stringcxx . . $ std/__cxx11/to_string(7eb93f795f0defb3).(i); |
| 334 | stdcxx . . $ std/::stringcxx . . $ std/string# path = "/dev/input/"cxx . . $ std/__cxx11/basic_string#basic_string(3bc0f77cdfbaa67f). +cxx . . $ std/operator+(42c652dfebe55ad7). js_id; |
| 335 | if (!Glibcxx . . $ Glib/::file_testcxx . . $ Glib/file_test(60aaef9f7bdf1611).(path, Glibcxx . . $ Glib/::FILE_TEST_EXISTScxx . . $ Glib/FILE_TEST_EXISTS.)) |
| 336 | continue; |
| 337 | try |
| 338 | { |
| 339 | Joystickcxx . . $ Joystick# probecxx . . $ Joystick#Joystick(c3ca1c130ce09c52).(path, js_id); |
| 340 | found.push_backcxx . . $ std/vector#push_back(fe7a8a4d1eddb70).({path, js_id, probe.get_namecxx . . $ Joystick#get_name(fff0f585954e56f3).(), probe.get_usb_idcxx . . $ Joystick#get_usb_id(219584694fe2b248).()}); |
| 341 | } |
| 342 | catch (const stdcxx . . $ std/::exception& err) |
| 343 | { |
| 344 | if (m_verbosecxx . . $ m_verbose.) |
| 345 | stdcxx . . $ std/::coutcxx . . $ std/cout. <<cxx . . $ std/`operator<<`(efaf8c13fc75f3c7). err.what() <<cxx . . $ std/basic_ostream#`operator<<`(f46f7e25851d787a). stdcxx . . $ std/::endlcxx . . $ std/endl(345bf97a19cc83a9).; |
| 346 | } |
| 347 | } |
| 348 | |
| 349 | if (found.emptycxx . . $ std/vector#empty(50ce9a9e25b4a850).()) |
| 350 | { |
| 351 | set_empty_statecxx . . $ JoystickTestWidget#set_empty_state(49f6e7a06ebc5aa8).(); |
| 352 | return; |
| 353 | } |
| 354 | |
| 355 | m_updating_combocxx . . $ JoystickTestWidget#m_updating_combo. = true; |
| 356 | m_device_combocxx . . $ JoystickTestWidget#m_device_combo..set_sensitivecxx . . $ Gtk/Widget#set_sensitive(b45ddcbc8423892c).(true); |
| 357 | m_device_storecxx . . $ JoystickTestWidget#m_device_store.->cxx . . $ Glib/RefPtr#`operator->`(5a2a78a048fb49a8).clearcxx . . $ Gtk/ListStore#clear(49f6e7a06ebc5aa8).(); |
| 358 | |
| 359 | Gtkcxx . . $ Gtk/::TreeModelcxx . . $ Gtk/TreeModel#::iteratorcxx . . $ Gtk/TreeModel#iterator# active_itcxx . . $ Gtk/TreeIter#TreeIter(49f6e7a06ebc5aa8).; |
| 360 | for (const auto& e : found) |
| 361 | { |
| 362 | auto it = m_device_storecxx . . $ JoystickTestWidget#m_device_store.->cxx . . $ Glib/RefPtr#`operator->`(5a2a78a048fb49a8).appendcxx . . $ Gtk/ListStore#append(2910abbde3964236).(); |
| 363 | auto row = *cxx . . $ Gtk/TreeIter#`operator*`(f3c18258c91a795).it; |
| 364 | row[cxx . . $ Gtk/TreeRow#`operator[]`(8a28268fd9c4eab5).device_columnscxx . . $ `$anonymous_namespace_src/joystick_test_widget.cpp`/device_columns(1af76caf03e395c1).().pathcxx . . $ `$anonymous_namespace_src/joystick_test_widget.cpp`/DeviceColumns#path.] =cxx . . $ Gtk/TreeValueProxy#`operator=`(98a201c0d7d7f90d). ecxx . . $ Glib/ustring#ustring(9c546c94e5fcce4e)..pathcxx . . $ JoystickTestWidget#refresh_device_list(9c546c94e5fcce4e).Entry#path.; |
| 365 | row[cxx . . $ Gtk/TreeRow#`operator[]`(8a28268fd9c4eab5).device_columnscxx . . $ `$anonymous_namespace_src/joystick_test_widget.cpp`/device_columns(1af76caf03e395c1).().markupcxx . . $ `$anonymous_namespace_src/joystick_test_widget.cpp`/DeviceColumns#markup.] =cxx . . $ Gtk/TreeValueProxy#`operator=`(98a201c0d7d7f90d). device_entry_markupcxx . . $ `$anonymous_namespace_src/joystick_test_widget.cpp`/device_entry_markup(e3b777c8f9970bbb).(ecxx . . $ Glib/ustring#ustring(9c546c94e5fcce4e)..namecxx . . $ JoystickTestWidget#refresh_device_list(9c546c94e5fcce4e).Entry#name., ecxx . . $ Glib/ustring#ustring(9c546c94e5fcce4e)..pathcxx . . $ JoystickTestWidget#refresh_device_list(9c546c94e5fcce4e).Entry#path., ecxx . . $ Glib/ustring#ustring(9c546c94e5fcce4e)..usb_idcxx . . $ JoystickTestWidget#refresh_device_list(9c546c94e5fcce4e).Entry#usb_id.); |
| 366 | if (!active_it) |
| 367 | active_it =cxx . . $ Gtk/TreeIter#`operator=`(5c666131cb6ae0c1). it; |
| 368 | if (!previous.emptycxx . . $ std/__cxx11/basic_string#empty(50ce9a9e25b4a850).() && e.pathcxx . . $ JoystickTestWidget#refresh_device_list(9c546c94e5fcce4e).Entry#path. ==cxx . . $ std/`operator==`(2965e344aacb545b). previous) |
| 369 | active_it =cxx . . $ Gtk/TreeIter#`operator=`(5c666131cb6ae0c1). it; |
| 370 | } |
| 371 | m_device_combocxx . . $ JoystickTestWidget#m_device_combo..set_activecxx . . $ Gtk/ComboBox#set_active(fe84ae3a1da4c59c).(active_it); |
| 372 | m_updating_combocxx . . $ JoystickTestWidget#m_updating_combo. = false; |
| 373 | |
| 374 | on_device_changedcxx . . $ JoystickTestWidget#on_device_changed(49f6e7a06ebc5aa8).(); |
| 375 | } |
| 376 | |
| 377 | Glibcxx . . $ Glib/::ustringcxx . . $ Glib/ustring# |
| 378 | JoystickTestWidgetcxx . . $ JoystickTestWidget#::get_selected_device_pathcxx . . $ JoystickTestWidget#get_selected_device_path(fff0f585954e56f3).() const |
| 379 | { |
| 380 | auto it = m_device_combocxx . . $ JoystickTestWidget#m_device_combo..get_activecxx . . $ Gtk/ComboBox#get_active(c9aa6dc2bdf8b3a6).(); |
| 381 | if (!it) |
| 382 | return {cxx . . $ Glib/ustring#ustring(49f6e7a06ebc5aa8).}; |
| 383 | returncxx . . $ Glib/ustring#ustring(9ff8f5cb794dfdbf). (*cxx . . $ Gtk/TreeIter#`operator*`(f3c18258c91a795).it)[cxx . . $ Gtk/TreeRow#`operator[]`(8a28268fd9c4eab5).device_columnscxx . . $ `$anonymous_namespace_src/joystick_test_widget.cpp`/device_columns(1af76caf03e395c1).().pathcxx . . $ `$anonymous_namespace_src/joystick_test_widget.cpp`/DeviceColumns#path.]; |
| 384 | } |
| 385 | |
| 386 | void |
| 387 | JoystickTestWidgetcxx . . $ JoystickTestWidget#::on_device_changedcxx . . $ JoystickTestWidget#on_device_changed(49f6e7a06ebc5aa8).() |
| 388 | { |
| 389 | if (m_updating_combocxx . . $ JoystickTestWidget#m_updating_combo.) |
| 390 | return; |
| 391 | |
| 392 | Glibcxx . . $ Glib/::ustringcxx . . $ Glib/ustring# id = get_selected_device_pathcxx . . $ Glib/ustring#ustring(9ff8f5cb794dfdbf).(); |
| 393 | if (id.emptycxx . . $ Glib/ustring#empty(50ce9a9e25b4a850).() || id ==cxx . . $ Glib/`operator==`(c236aab782da112f). "none") |
| 394 | { |
| 395 | set_empty_statecxx . . $ JoystickTestWidget#set_empty_state(49f6e7a06ebc5aa8).(); |
| 396 | return; |
| 397 | } |
| 398 | |
| 399 | clear_device_uicxx . . $ JoystickTestWidget#clear_device_ui(49f6e7a06ebc5aa8).(); |
| 400 | m_joystickcxx . . $ JoystickTestWidget#m_joystick..resetcxx . . $ std/unique_ptr#reset(57bc6b0441bf5294).(); |
| 401 | |
| 402 | stdcxx . . $ std/::stringcxx . . $ std/string# js_id = get_js_dev_id_from_filenamecxx . . $ std/__cxx11/basic_string#basic_string(3bc0f77cdfbaa67f).(id); |
| 403 | try |
| 404 | { |
| 405 | m_joystickcxx . . $ JoystickTestWidget#m_joystick..resetcxx . . $ std/unique_ptr#reset(57bc6b0441bf5294).(new Joystickcxx . . $ Joystick#(id, js_id)); |
| 406 | build_device_uicxx . . $ JoystickTestWidget#build_device_ui(49f6e7a06ebc5aa8).(); |
| 407 | } |
| 408 | catch (const stdcxx . . $ std/::exception& err) |
| 409 | { |
| 410 | stdcxx . . $ std/::coutcxx . . $ std/cout. <<cxx . . $ std/`operator<<`(efaf8c13fc75f3c7). err.what() <<cxx . . $ std/basic_ostream#`operator<<`(f46f7e25851d787a). stdcxx . . $ std/::endlcxx . . $ std/endl(345bf97a19cc83a9).; |
| 411 | set_empty_statecxx . . $ JoystickTestWidget#set_empty_state(49f6e7a06ebc5aa8).(); |
| 412 | } |
| 413 | } |
| 414 | |
| 415 | void |
| 416 | JoystickTestWidgetcxx . . $ JoystickTestWidget#::schedule_refreshcxx . . $ JoystickTestWidget#schedule_refresh(49f6e7a06ebc5aa8).() |
| 417 | { |
| 418 | if (m_refresh_timeoutcxx . . $ JoystickTestWidget#m_refresh_timeout..connectedcxx . . $ sigc/connection#connected(50ce9a9e25b4a850).()) |
| 419 | return; |
| 420 | m_refresh_timeoutcxx . . $ JoystickTestWidget#m_refresh_timeout. =cxx . . $ sigc/connection#`operator=`(d6e79c7c2c834e86). Glibcxx . . $ Glib/::signal_timeoutcxx . . $ Glib/signal_timeout(66f5cf45299e0490).().connectcxx . . $ Glib/SignalTimeout#connect(c26b6904efe464be).( |
| 421 | sigccxx . . $ sigc/slot#slot(edcd8b2679e9bd1a).::mem_funcxx . . $ sigc/mem_fun(84441c09a3e988ac).(this, &JoystickTestWidgetcxx . . $ JoystickTestWidget#::on_refresh_timeoutcxx . . $ JoystickTestWidget#on_refresh_timeout(c9857a73d68e59ba).), 250); |
| 422 | } |
| 423 | |
| 424 | bool |
| 425 | JoystickTestWidgetcxx . . $ JoystickTestWidget#::on_refresh_timeoutcxx . . $ JoystickTestWidget#on_refresh_timeout(c9857a73d68e59ba).() |
| 426 | { |
| 427 | stdcxx . . $ std/::stringcxx . . $ std/string# prefercxx . . $ std/__cxx11/basic_string#basic_string(49f6e7a06ebc5aa8).; |
| 428 | if (m_joystickcxx . . $ JoystickTestWidget#m_joystick.) |
| 429 | prefer =cxx . . $ std/__cxx11/basic_string#`operator=`(706c69e8c742c906). m_joystickcxx . . $ JoystickTestWidget#m_joystick.->cxx . . $ std/unique_ptr#`operator->`(ca399b2b6292c808).get_filenamecxx . . $ Joystick#get_filename(219584694fe2b248).(); |
| 430 | refresh_device_listcxx . . $ JoystickTestWidget#refresh_device_list(9c546c94e5fcce4e).(prefer); |
| 431 | return false; |
| 432 | } |
| 433 | |
| 434 | void |
| 435 | JoystickTestWidgetcxx . . $ JoystickTestWidget#::on_udev_js_eventcxx . . $ JoystickTestWidget#on_udev_js_event(c3ca1c130ce09c52).(const stdcxx . . $ std/::stringcxx . . $ std/string#& action, const stdcxx . . $ std/::stringcxx . . $ std/string#& devnode) |
| 436 | { |
| 437 | if (m_verbosecxx . . $ m_verbose.) |
| 438 | stdcxx . . $ std/::coutcxx . . $ std/cout. <<cxx . . $ std/`operator<<`(efaf8c13fc75f3c7). "joystick_test_widget " <<cxx . . $ std/`operator<<`(88df5bef833f7f83). action <<cxx . . $ std/`operator<<`(efaf8c13fc75f3c7). ": " <<cxx . . $ std/`operator<<`(88df5bef833f7f83). devnode <<cxx . . $ std/basic_ostream#`operator<<`(f46f7e25851d787a). stdcxx . . $ std/::endlcxx . . $ std/endl(345bf97a19cc83a9).; |
| 439 | schedule_refreshcxx . . $ JoystickTestWidget#schedule_refresh(49f6e7a06ebc5aa8).(); |
| 440 | } |
| 441 | |
| 442 | void |
| 443 | JoystickTestWidgetcxx . . $ JoystickTestWidget#::on_calibratecxx . . $ JoystickTestWidget#on_calibrate(49f6e7a06ebc5aa8).() |
| 444 | { |
| 445 | if (!m_joystickcxx . . $ JoystickTestWidget#m_joystick. || !m_connectedcxx . . $ JoystickTestWidget#m_connected.) |
| 446 | return; |
| 447 | if (m_calibration_widgetcxx . . $ JoystickTestWidget#m_calibration_widget.) |
| 448 | { |
| 449 | m_calibration_widgetcxx . . $ JoystickTestWidget#m_calibration_widget.->cxx . . $ std/unique_ptr#`operator->`(ca399b2b6292c808).presentcxx . . $ Gtk/Window#present(49f6e7a06ebc5aa8).(); |
| 450 | return; |
| 451 | } |
| 452 | m_calibration_widgetcxx . . $ JoystickTestWidget#m_calibration_widget..resetcxx . . $ std/unique_ptr#reset(57bc6b0441bf5294).(new JoystickCalibrationWidgetcxx . . $ JoystickCalibrationWidget#(*cxx . . $ std/unique_ptr#`operator*`(f3c3f5757bf81a4e).m_joystickcxx . . $ JoystickTestWidget#m_joystick.)); |
| 453 | m_calibration_widgetcxx . . $ JoystickTestWidget#m_calibration_widget.->cxx . . $ std/unique_ptr#`operator->`(ca399b2b6292c808).signal_hidecxx . . $ Gtk/Widget#signal_hide(5db58c3a758c1880).().connectcxx . . $ Glib/SignalProxy#connect(23e07d4a2c0735e0).([cxx . . $ sigc/slot#slot(edcd8b2679e9bd1a).this] { m_calibration_widgetcxx . . $ JoystickTestWidget#m_calibration_widget..resetcxx . . $ std/unique_ptr#reset(57bc6b0441bf5294).(); }); |
| 454 | m_calibration_widgetcxx . . $ JoystickTestWidget#m_calibration_widget.->cxx . . $ std/unique_ptr#`operator->`(ca399b2b6292c808).set_transient_forcxx . . $ Gtk/Window#set_transient_for(94064acb90bf55c0).(*this); |
| 455 | m_calibration_widgetcxx . . $ JoystickTestWidget#m_calibration_widget.->cxx . . $ std/unique_ptr#`operator->`(ca399b2b6292c808).show_allcxx . . $ Gtk/Widget#show_all(49f6e7a06ebc5aa8).(); |
| 456 | } |
| 457 | |
| 458 | void |
| 459 | JoystickTestWidgetcxx . . $ JoystickTestWidget#::on_mappingcxx . . $ JoystickTestWidget#on_mapping(49f6e7a06ebc5aa8).() |
| 460 | { |
| 461 | if (!m_joystickcxx . . $ JoystickTestWidget#m_joystick. || !m_connectedcxx . . $ JoystickTestWidget#m_connected.) |
| 462 | return; |
| 463 | if (m_mapping_widgetcxx . . $ JoystickTestWidget#m_mapping_widget.) |
| 464 | { |
| 465 | m_mapping_widgetcxx . . $ JoystickTestWidget#m_mapping_widget.->cxx . . $ std/unique_ptr#`operator->`(ca399b2b6292c808).presentcxx . . $ Gtk/Window#present(49f6e7a06ebc5aa8).(); |
| 466 | return; |
| 467 | } |
| 468 | m_mapping_widgetcxx . . $ JoystickTestWidget#m_mapping_widget..resetcxx . . $ std/unique_ptr#reset(57bc6b0441bf5294).(new JoystickMapWidgetcxx . . $ JoystickMapWidget#(*cxx . . $ std/unique_ptr#`operator*`(f3c3f5757bf81a4e).m_joystickcxx . . $ JoystickTestWidget#m_joystick.)); |
| 469 | m_mapping_widgetcxx . . $ JoystickTestWidget#m_mapping_widget.->cxx . . $ std/unique_ptr#`operator->`(ca399b2b6292c808).signal_hidecxx . . $ Gtk/Widget#signal_hide(5db58c3a758c1880).().connectcxx . . $ Glib/SignalProxy#connect(23e07d4a2c0735e0).([cxx . . $ sigc/slot#slot(edcd8b2679e9bd1a).this] { m_mapping_widgetcxx . . $ JoystickTestWidget#m_mapping_widget..resetcxx . . $ std/unique_ptr#reset(57bc6b0441bf5294).(); }); |
| 470 | m_mapping_widgetcxx . . $ JoystickTestWidget#m_mapping_widget.->cxx . . $ std/unique_ptr#`operator->`(ca399b2b6292c808).set_transient_forcxx . . $ Gtk/Window#set_transient_for(94064acb90bf55c0).(*this); |
| 471 | m_mapping_widgetcxx . . $ JoystickTestWidget#m_mapping_widget.->cxx . . $ std/unique_ptr#`operator->`(ca399b2b6292c808).show_allcxx . . $ Gtk/Widget#show_all(49f6e7a06ebc5aa8).(); |
| 472 | } |
| 473 | |
| 474 | void |
| 475 | JoystickTestWidgetcxx . . $ JoystickTestWidget#::setup_joystick_widgetscxx . . $ JoystickTestWidget#setup_joystick_widgets(6e75af32c21ea348).(const unsigned sticks, const stdcxx . . $ std/::vectorcxx . . $ std/vector#<unsigned>& axes, const stdcxx . . $ std/::vectorcxx . . $ std/vector#<u_int>& triggers) |
| 476 | { // eg: setup_joystick_widgets(2, {0,1,3,4}, {}); => 2 sticks, with axes 0,1 and 3,4, and no triggers |
| 477 | try { |
| 478 | if (sticks >= 1) { |
| 479 | stick_hboxcxx . . $ JoystickTestWidget#stick_hbox..pack_startcxx . . $ Gtk/Box#pack_start(492efd5ed8431628).(stick1_widgetcxx . . $ JoystickTestWidget#stick1_widget., Gtkcxx . . $ Gtk/::PACK_EXPAND_PADDINGcxx . . $ Gtk/PACK_EXPAND_PADDING.); |
| 480 | axis_callbackscxx . . $ JoystickTestWidget#axis_callbacks..atcxx . . $ std/vector#at(428bb168810b9e52).(axes.atcxx . . $ std/vector#at(b61e45a10b63f40a).(0)).connectcxx . . $ sigc/signal1#connect(18bafff315daab59).(sigccxx . . $ sigc/slot#slot(edcd8b2679e9bd1a).::mem_funcxx . . $ sigc/mem_fun(5a1f7901f4fc005e).(stick1_widgetcxx . . $ JoystickTestWidget#stick1_widget., &AxisWidgetcxx . . $ AxisWidget#::set_x_axiscxx . . $ AxisWidget#set_x_axis(ba8836b59fb42830).)); |
| 481 | axis_callbackscxx . . $ JoystickTestWidget#axis_callbacks..atcxx . . $ std/vector#at(428bb168810b9e52).(axes.atcxx . . $ std/vector#at(b61e45a10b63f40a).(1)).connectcxx . . $ sigc/signal1#connect(18bafff315daab59).(sigccxx . . $ sigc/slot#slot(edcd8b2679e9bd1a).::mem_funcxx . . $ sigc/mem_fun(5a1f7901f4fc005e).(stick1_widgetcxx . . $ JoystickTestWidget#stick1_widget., &AxisWidgetcxx . . $ AxisWidget#::set_y_axiscxx . . $ AxisWidget#set_y_axis(ba8836b59fb42830).)); |
| 482 | } |
| 483 | if (sticks >= 2) { |
| 484 | stick_hboxcxx . . $ JoystickTestWidget#stick_hbox..pack_startcxx . . $ Gtk/Box#pack_start(492efd5ed8431628).(stick2_widgetcxx . . $ JoystickTestWidget#stick2_widget., Gtkcxx . . $ Gtk/::PACK_EXPAND_PADDINGcxx . . $ Gtk/PACK_EXPAND_PADDING.); |
| 485 | axis_callbackscxx . . $ JoystickTestWidget#axis_callbacks..atcxx . . $ std/vector#at(428bb168810b9e52).(axes.atcxx . . $ std/vector#at(b61e45a10b63f40a).(2)).connectcxx . . $ sigc/signal1#connect(18bafff315daab59).(sigccxx . . $ sigc/slot#slot(edcd8b2679e9bd1a).::mem_funcxx . . $ sigc/mem_fun(5a1f7901f4fc005e).(stick2_widgetcxx . . $ JoystickTestWidget#stick2_widget., &AxisWidgetcxx . . $ AxisWidget#::set_x_axiscxx . . $ AxisWidget#set_x_axis(ba8836b59fb42830).)); |
| 486 | axis_callbackscxx . . $ JoystickTestWidget#axis_callbacks..atcxx . . $ std/vector#at(428bb168810b9e52).(axes.atcxx . . $ std/vector#at(b61e45a10b63f40a).(3)).connectcxx . . $ sigc/signal1#connect(18bafff315daab59).(sigccxx . . $ sigc/slot#slot(edcd8b2679e9bd1a).::mem_funcxx . . $ sigc/mem_fun(5a1f7901f4fc005e).(stick2_widgetcxx . . $ JoystickTestWidget#stick2_widget., &AxisWidgetcxx . . $ AxisWidget#::set_y_axiscxx . . $ AxisWidget#set_y_axis(ba8836b59fb42830).)); |
| 487 | } |
| 488 | if (sticks >= 3) { |
| 489 | stick_hboxcxx . . $ JoystickTestWidget#stick_hbox..pack_startcxx . . $ Gtk/Box#pack_start(492efd5ed8431628).(stick3_widgetcxx . . $ JoystickTestWidget#stick3_widget., Gtkcxx . . $ Gtk/::PACK_EXPAND_PADDINGcxx . . $ Gtk/PACK_EXPAND_PADDING.); |
| 490 | axis_callbackscxx . . $ JoystickTestWidget#axis_callbacks..atcxx . . $ std/vector#at(428bb168810b9e52).(axes.atcxx . . $ std/vector#at(b61e45a10b63f40a).(4)).connectcxx . . $ sigc/signal1#connect(18bafff315daab59).(sigccxx . . $ sigc/slot#slot(edcd8b2679e9bd1a).::mem_funcxx . . $ sigc/mem_fun(5a1f7901f4fc005e).(stick3_widgetcxx . . $ JoystickTestWidget#stick3_widget., &AxisWidgetcxx . . $ AxisWidget#::set_x_axiscxx . . $ AxisWidget#set_x_axis(ba8836b59fb42830).)); |
| 491 | axis_callbackscxx . . $ JoystickTestWidget#axis_callbacks..atcxx . . $ std/vector#at(428bb168810b9e52).(axes.atcxx . . $ std/vector#at(b61e45a10b63f40a).(5)).connectcxx . . $ sigc/signal1#connect(18bafff315daab59).(sigccxx . . $ sigc/slot#slot(edcd8b2679e9bd1a).::mem_funcxx . . $ sigc/mem_fun(5a1f7901f4fc005e).(stick3_widgetcxx . . $ JoystickTestWidget#stick3_widget., &AxisWidgetcxx . . $ AxisWidget#::set_y_axiscxx . . $ AxisWidget#set_y_axis(ba8836b59fb42830).)); |
| 492 | } |
| 493 | } |
| 494 | catch (const stdcxx . . $ std/::out_of_rangecxx . . $ std/out_of_range#& e) { |
| 495 | stdcxx . . $ std/::coutcxx . . $ std/cout. <<cxx . . $ std/`operator<<`(efaf8c13fc75f3c7). "joystick configuration error. Some axis data missing or out of range." <<cxx . . $ std/basic_ostream#`operator<<`(f46f7e25851d787a). stdcxx . . $ std/::endlcxx . . $ std/endl(345bf97a19cc83a9).; |
| 496 | if (m_verbosecxx . . $ m_verbose.) |
| 497 | stdcxx . . $ std/::coutcxx . . $ std/cout. <<cxx . . $ std/`operator<<`(efaf8c13fc75f3c7). e.whatcxx . . $ std/logic_error#what(a9f41ea0e82d88cf).() <<cxx . . $ std/basic_ostream#`operator<<`(f46f7e25851d787a). stdcxx . . $ std/::endlcxx . . $ std/endl(345bf97a19cc83a9).; |
| 498 | if (m_verbosecxx . . $ m_verbose.) |
| 499 | stdcxx . . $ std/::coutcxx . . $ std/cout. <<cxx . . $ std/`operator<<`(efaf8c13fc75f3c7). "ERROR: axis config data" <<cxx . . $ std/basic_ostream#`operator<<`(f46f7e25851d787a). stdcxx . . $ std/::endlcxx . . $ std/endl(345bf97a19cc83a9).; |
| 500 | } |
| 501 | |
| 502 | try { |
| 503 | if (triggers.sizecxx . . $ std/vector#size(fe4d2d262d4164a8).() >= 1) { |
| 504 | stick_hboxcxx . . $ JoystickTestWidget#stick_hbox..pack_startcxx . . $ Gtk/Box#pack_start(492efd5ed8431628).(left_trigger_widgetcxx . . $ JoystickTestWidget#left_trigger_widget., Gtkcxx . . $ Gtk/::PACK_EXPAND_PADDINGcxx . . $ Gtk/PACK_EXPAND_PADDING.); |
| 505 | axis_callbackscxx . . $ JoystickTestWidget#axis_callbacks..atcxx . . $ std/vector#at(428bb168810b9e52).(triggers.atcxx . . $ std/vector#at(b61e45a10b63f40a).(0)).connectcxx . . $ sigc/signal1#connect(18bafff315daab59).(sigccxx . . $ sigc/slot#slot(edcd8b2679e9bd1a).::mem_funcxx . . $ sigc/mem_fun(5a1f7901f4fc005e).(left_trigger_widgetcxx . . $ JoystickTestWidget#left_trigger_widget., &ThrottleWidgetcxx . . $ ThrottleWidget#::set_poscxx . . $ ThrottleWidget#set_pos(ba8836b59fb42830).)); |
| 506 | } |
| 507 | if (triggers.sizecxx . . $ std/vector#size(fe4d2d262d4164a8).() >= 2) { |
| 508 | stick_hboxcxx . . $ JoystickTestWidget#stick_hbox..pack_startcxx . . $ Gtk/Box#pack_start(492efd5ed8431628).(right_trigger_widgetcxx . . $ JoystickTestWidget#right_trigger_widget., Gtkcxx . . $ Gtk/::PACK_EXPAND_PADDINGcxx . . $ Gtk/PACK_EXPAND_PADDING.); |
| 509 | axis_callbackscxx . . $ JoystickTestWidget#axis_callbacks..atcxx . . $ std/vector#at(428bb168810b9e52).(triggers.atcxx . . $ std/vector#at(b61e45a10b63f40a).(1)).connectcxx . . $ sigc/signal1#connect(18bafff315daab59).(sigccxx . . $ sigc/slot#slot(edcd8b2679e9bd1a).::mem_funcxx . . $ sigc/mem_fun(5a1f7901f4fc005e).(right_trigger_widgetcxx . . $ JoystickTestWidget#right_trigger_widget., &ThrottleWidgetcxx . . $ ThrottleWidget#::set_poscxx . . $ ThrottleWidget#set_pos(ba8836b59fb42830).)); |
| 510 | } |
| 511 | } |
| 512 | catch (const stdcxx . . $ std/::out_of_rangecxx . . $ std/out_of_range#& e) { |
| 513 | stdcxx . . $ std/::coutcxx . . $ std/cout. <<cxx . . $ std/`operator<<`(efaf8c13fc75f3c7). "joystick configuration error. Some trigger data missing or out of range." <<cxx . . $ std/basic_ostream#`operator<<`(f46f7e25851d787a). stdcxx . . $ std/::endlcxx . . $ std/endl(345bf97a19cc83a9).; |
| 514 | if (m_verbosecxx . . $ m_verbose.) |
| 515 | stdcxx . . $ std/::coutcxx . . $ std/cout. <<cxx . . $ std/`operator<<`(efaf8c13fc75f3c7). e.whatcxx . . $ std/logic_error#what(a9f41ea0e82d88cf).() <<cxx . . $ std/basic_ostream#`operator<<`(f46f7e25851d787a). stdcxx . . $ std/::endlcxx . . $ std/endl(345bf97a19cc83a9).; |
| 516 | if (m_verbosecxx . . $ m_verbose.) |
| 517 | stdcxx . . $ std/::coutcxx . . $ std/cout. <<cxx . . $ std/`operator<<`(efaf8c13fc75f3c7). "ERROR: trigger config data" <<cxx . . $ std/basic_ostream#`operator<<`(f46f7e25851d787a). stdcxx . . $ std/::endlcxx . . $ std/endl(345bf97a19cc83a9).; |
| 518 | } |
| 519 | } |
| 520 | |
| 521 | |
| 522 | // (sticks, axes, triggers) |
| 523 | // eg: setup_joystick_widgets(2, {0,1,3,4}, {}); => 2 sticks, with axes 0,1 and 3,4, and no triggers |
| 524 | void |
| 525 | JoystickTestWidgetcxx . . $ JoystickTestWidget#::setup_sixaxis_equivcxx . . $ JoystickTestWidget#setup_sixaxis_equiv(49f6e7a06ebc5aa8).() |
| 526 | { |
| 527 | setup_joystick_widgetscxx . . $ JoystickTestWidget#setup_joystick_widgets(6e75af32c21ea348).(2, {cxx . . $ std/vector#vector(9619226211e5a241).0,1,3,4}, {cxx . . $ std/vector#vector(9619226211e5a241).2,5}); |
| 528 | } |
| 529 | |
| 530 | void |
| 531 | JoystickTestWidgetcxx . . $ JoystickTestWidget#::setup_dualshock4_equivcxx . . $ JoystickTestWidget#setup_dualshock4_equiv(49f6e7a06ebc5aa8).() |
| 532 | { |
| 533 | setup_joystick_widgetscxx . . $ JoystickTestWidget#setup_joystick_widgets(6e75af32c21ea348).(3, {cxx . . $ std/vector#vector(9619226211e5a241).0,1,3,4,6,7}, {cxx . . $ std/vector#vector(9619226211e5a241).2,5}); |
| 534 | } |
| 535 | |
| 536 | void |
| 537 | JoystickTestWidgetcxx . . $ JoystickTestWidget#::setup_dualshock2_equivcxx . . $ JoystickTestWidget#setup_dualshock2_equiv(49f6e7a06ebc5aa8).() |
| 538 | { |
| 539 | setup_joystick_widgetscxx . . $ JoystickTestWidget#setup_joystick_widgets(6e75af32c21ea348).(2, {cxx . . $ std/vector#vector(9619226211e5a241).0,1,3,2}, {cxx . . $ std/vector#vector(49f6e7a06ebc5aa8).}); |
| 540 | } |
| 541 | |
| 542 | void |
| 543 | JoystickTestWidgetcxx . . $ JoystickTestWidget#::setup_xbox360_equivcxx . . $ JoystickTestWidget#setup_xbox360_equiv(49f6e7a06ebc5aa8).() |
| 544 | { |
| 545 | setup_joystick_widgetscxx . . $ JoystickTestWidget#setup_joystick_widgets(6e75af32c21ea348).(3, {cxx . . $ std/vector#vector(9619226211e5a241).0,1,3,4,6,7}, {cxx . . $ std/vector#vector(9619226211e5a241).2,5}); |
| 546 | } |
| 547 | |
| 548 | void |
| 549 | JoystickTestWidgetcxx . . $ JoystickTestWidget#::setup_gamecube_equivcxx . . $ JoystickTestWidget#setup_gamecube_equiv(49f6e7a06ebc5aa8).() |
| 550 | { |
| 551 | setup_joystick_widgetscxx . . $ JoystickTestWidget#setup_joystick_widgets(6e75af32c21ea348).(3, {cxx . . $ std/vector#vector(9619226211e5a241).0,1,5,2,6,7}, {cxx . . $ std/vector#vector(9619226211e5a241).3,4}); |
| 552 | } |
| 553 | |
| 554 | |
| 555 | void |
| 556 | JoystickTestWidgetcxx . . $ JoystickTestWidget#::axis_movecxx . . $ JoystickTestWidget#axis_move(3e454b8ccf442868).(int number, int value) |
| 557 | { |
| 558 | if (number < 0 || number >= static_cast<int>(axescxx . . $ JoystickTestWidget#axes..sizecxx . . $ std/vector#size(fe4d2d262d4164a8).())) |
| 559 | return; |
| 560 | axescxx . . $ JoystickTestWidget#axes..atcxx . . $ std/vector#at(428bb168810b9e52).(number)->set_fractioncxx . . $ Gtk/ProgressBar#set_fraction(ba8836b59fb42830).((value + 32767) / (double)(2*32767)); |
| 561 | |
| 562 | stdcxx . . $ std/::ostringstreamcxx . . $ std/ostringstream# strcxx . . $ std/__cxx11/basic_ostringstream#basic_ostringstream(49f6e7a06ebc5aa8).; |
| 563 | str <<cxx . . $ std/basic_ostream#`operator<<`(23b6575433a77e57). value; |
| 564 | axescxx . . $ JoystickTestWidget#axes..atcxx . . $ std/vector#at(428bb168810b9e52).(number)->set_textcxx . . $ Gtk/ProgressBar#set_text(1ff0bff2cee2bc51).(strcxx . . $ Glib/ustring#ustring(b484295947d76b8d)..strcxx . . $ std/__cxx11/basic_ostringstream#str(d33e1a6fd36255f7).()); |
| 565 | axis_callbackscxx . . $ JoystickTestWidget#axis_callbacks.[cxx . . $ std/vector#`operator[]`(428bb168810b9e52).number](cxx . . $ sigc/signal1#`operator()`(be845e7cacd4451f).value / 32767.0); |
| 566 | } |
| 567 | |
| 568 | void |
| 569 | JoystickTestWidgetcxx . . $ JoystickTestWidget#::button_presscxx . . $ JoystickTestWidget#button_press(918ebd27a9ddbad3).(int number, bool value) |
| 570 | { |
| 571 | if (number < 0 || number >= static_cast<int>(buttonscxx . . $ JoystickTestWidget#buttons..sizecxx . . $ std/vector#size(fe4d2d262d4164a8).())) |
| 572 | return; |
| 573 | buttonscxx . . $ JoystickTestWidget#buttons..atcxx . . $ std/vector#at(428bb168810b9e52).(number)->set_activecxx . . $ Gtk/ToggleButton#set_active(b45ddcbc8423892c).(value); |
| 574 | } |
| 575 |