| 1 | // SPDX-FileCopyrightText: 2009 Ingo Ruhnke <[email protected]>cxx . . $ `<file>/src/joystick_calibration_widget.cpp`/ |
| 2 | // SPDX-License-Identifier: GPL-3.0-or-later |
| 3 | |
| 4 | #include <iostream> |
| 5 | #include <assert.h> |
| 6 | #include <gtkmm/spinbutton.h> |
| 7 | #include <gtkmm/stock.h> |
| 8 | |
| 9 | #include "joystick.hpp"cxx . . $ `<file>/src/joystick.hpp`/ |
| 10 | #include "calibrate_maximum_dialog.hpp"cxx . . $ `<file>/src/calibrate_maximum_dialog.hpp`/ |
| 11 | #include "joystick_calibration_widget.hpp"cxx . . $ `<file>/src/joystick_calibration_widget.hpp`/ |
| 12 | |
| 13 | JoystickCalibrationWidgetcxx . . $ JoystickCalibrationWidget#::JoystickCalibrationWidgetcxx . . $ JoystickCalibrationWidget#JoystickCalibrationWidget(a141bca875d6b270).(Joystickcxx . . $ Joystick#& joystick) |
| 14 | : Gtkcxx . . $ Gtk/::Dialogcxx . . $ Gtk/Dialog#("Calibration: " +cxx . . $ Glib/operator+(733d8bb4b557ea40). joystick.get_namecxx . . $ Joystick#get_name(fff0f585954e56f3).()), |
| 15 | joystickcxx . . $ JoystickCalibrationWidget#joystick.(joystick), |
| 16 | labelcxx . . $ JoystickCalibrationWidget#label.("The <i>center</i> values are the minimum and the maximum values of the deadzone.\n"cxx . . $ Glib/ustring#ustring(85c52e162fed56f9). |
| 17 | "The <i>min</i> and <i>max</i> values refer to the outer values. You have to unplug\n" |
| 18 | "your joystick or reboot to reset the values to their original default.\n" |
| 19 | "\n" |
| 20 | "To run the calibration wizard, press the <i>Calibrate</i> button."), |
| 21 | axis_framecxx . . $ JoystickCalibrationWidget#axis_frame.("Axes"cxx . . $ Glib/ustring#ustring(85c52e162fed56f9).), |
| 22 | axis_tablecxx . . $ JoystickCalibrationWidget#axis_table.(joystick.get_axis_countcxx . . $ Joystick#get_axis_count(455f465bc33b4cdf).() + 1, 5), |
| 23 | buttonboxcxx . . $ JoystickCalibrationWidget#buttonbox.(Gtkcxx . . $ Gtk/::BUTTONBOX_SPREADcxx . . $ Gtk/BUTTONBOX_SPREAD.), |
| 24 | calibration_buttoncxx . . $ JoystickCalibrationWidget#calibration_button.("Start Calibration"cxx . . $ Glib/ustring#ustring(85c52e162fed56f9).) |
| 25 | { |
| 26 | set_border_widthcxx . . $ Gtk/Container#set_border_width(cb2f890c2fdad230).(5); |
| 27 | axis_framecxx . . $ JoystickCalibrationWidget#axis_frame..set_border_widthcxx . . $ Gtk/Container#set_border_width(cb2f890c2fdad230).(5); |
| 28 | axis_tablecxx . . $ JoystickCalibrationWidget#axis_table..set_border_widthcxx . . $ Gtk/Container#set_border_width(cb2f890c2fdad230).(5); |
| 29 | |
| 30 | labelcxx . . $ JoystickCalibrationWidget#label..set_use_markupcxx . . $ Gtk/Label#set_use_markup(b45ddcbc8423892c).(true); |
| 31 | labelcxx . . $ JoystickCalibrationWidget#label..set_line_wrapcxx . . $ Gtk/Label#set_line_wrap(b45ddcbc8423892c).(); |
| 32 | get_vboxcxx . . $ Gtk/Dialog#get_vbox(d9bef252bf7ebc20).()->pack_startcxx . . $ Gtk/Box#pack_start(492efd5ed8431628).(labelcxx . . $ JoystickCalibrationWidget#label., Gtkcxx . . $ Gtk/::PACK_SHRINKcxx . . $ Gtk/PACK_SHRINK.); |
| 33 | |
| 34 | calibration_buttoncxx . . $ JoystickCalibrationWidget#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, &JoystickCalibrationWidgetcxx . . $ JoystickCalibrationWidget#::on_calibratecxx . . $ JoystickCalibrationWidget#on_calibrate(49f6e7a06ebc5aa8).)); |
| 35 | |
| 36 | buttonboxcxx . . $ JoystickCalibrationWidget#buttonbox..set_border_widthcxx . . $ Gtk/Container#set_border_width(cb2f890c2fdad230).(5); |
| 37 | buttonboxcxx . . $ JoystickCalibrationWidget#buttonbox..addcxx . . $ Gtk/Container#add(c65b1b431719167f).(calibration_buttoncxx . . $ JoystickCalibrationWidget#calibration_button.); |
| 38 | get_vboxcxx . . $ Gtk/Dialog#get_vbox(d9bef252bf7ebc20).()->pack_startcxx . . $ Gtk/Box#pack_start(492efd5ed8431628).(buttonboxcxx . . $ JoystickCalibrationWidget#buttonbox., Gtkcxx . . $ Gtk/::PACK_SHRINKcxx . . $ Gtk/PACK_SHRINK.); |
| 39 | |
| 40 | axis_tablecxx . . $ JoystickCalibrationWidget#axis_table..attachcxx . . $ Gtk/Table#attach(45588a21adf610ec).(*Gtkcxx . . $ Gtk/::managecxx . . $ Gtk/manage(98ea26de6545f0ca).(new Gtkcxx . . $ Gtk/::Labelcxx . . $ Gtk/Label#("Axes"cxx . . $ Glib/ustring#ustring(85c52e162fed56f9).)), 0, 1, 0, 1); |
| 41 | |
| 42 | axis_tablecxx . . $ JoystickCalibrationWidget#axis_table..attachcxx . . $ Gtk/Table#attach(45588a21adf610ec).(*Gtkcxx . . $ Gtk/::managecxx . . $ Gtk/manage(98ea26de6545f0ca).(new Gtkcxx . . $ Gtk/::Labelcxx . . $ Gtk/Label#("CenterMin"cxx . . $ Glib/ustring#ustring(85c52e162fed56f9).)), 1, 2, 0, 1); |
| 43 | axis_tablecxx . . $ JoystickCalibrationWidget#axis_table..attachcxx . . $ Gtk/Table#attach(45588a21adf610ec).(*Gtkcxx . . $ Gtk/::managecxx . . $ Gtk/manage(98ea26de6545f0ca).(new Gtkcxx . . $ Gtk/::Labelcxx . . $ Gtk/Label#("CenterMax"cxx . . $ Glib/ustring#ustring(85c52e162fed56f9).)), 2, 3, 0, 1); |
| 44 | |
| 45 | axis_tablecxx . . $ JoystickCalibrationWidget#axis_table..attachcxx . . $ Gtk/Table#attach(45588a21adf610ec).(*Gtkcxx . . $ Gtk/::managecxx . . $ Gtk/manage(98ea26de6545f0ca).(new Gtkcxx . . $ Gtk/::Labelcxx . . $ Gtk/Label#("RangeMin"cxx . . $ Glib/ustring#ustring(85c52e162fed56f9).)), 3, 4, 0, 1); |
| 46 | axis_tablecxx . . $ JoystickCalibrationWidget#axis_table..attachcxx . . $ Gtk/Table#attach(45588a21adf610ec).(*Gtkcxx . . $ Gtk/::managecxx . . $ Gtk/manage(98ea26de6545f0ca).(new Gtkcxx . . $ Gtk/::Labelcxx . . $ Gtk/Label#("RangeMax"cxx . . $ Glib/ustring#ustring(85c52e162fed56f9).)), 4, 5, 0, 1); |
| 47 | |
| 48 | axis_tablecxx . . $ JoystickCalibrationWidget#axis_table..attachcxx . . $ Gtk/Table#attach(45588a21adf610ec).(*Gtkcxx . . $ Gtk/::managecxx . . $ Gtk/manage(98ea26de6545f0ca).(new Gtkcxx . . $ Gtk/::Labelcxx . . $ Gtk/Label#("Invert"cxx . . $ Glib/ustring#ustring(85c52e162fed56f9).)), 5, 6, 0, 1); |
| 49 | |
| 50 | axis_tablecxx . . $ JoystickCalibrationWidget#axis_table..set_col_spacingcxx . . $ Gtk/Table#set_col_spacing(b4d55b1286ff73e8).(2, 8); |
| 51 | for(int i = 0; i < joystick.get_axis_countcxx . . $ Joystick#get_axis_count(455f465bc33b4cdf).(); ++i) |
| 52 | { |
| 53 | CalibrationDatacxx . . $ JoystickCalibrationWidget#CalibrationData# data; |
| 54 | |
| 55 | Gtkcxx . . $ Gtk/::SpinButtoncxx . . $ Gtk/SpinButton#& center_min = *Gtkcxx . . $ Gtk/::managecxx . . $ Gtk/manage(98ea26de6545f0ca).(new Gtkcxx . . $ Gtk/::SpinButtoncxx . . $ Gtk/SpinButton#((data.center_mincxx . . $ JoystickCalibrationWidget#CalibrationData#center_min. =cxx . . $ Glib/RefPtr#`operator=`(b66de19e2ab7ce1f). Gtkcxx . . $ Gtk/::Adjustmentcxx . . $ Gtk/Adjustment#::createcxx . . $ Gtk/Adjustment#create(926fa29e4dbebfc4).(0, -32768, 32767)))); |
| 56 | Gtkcxx . . $ Gtk/::SpinButtoncxx . . $ Gtk/SpinButton#& center_max = *Gtkcxx . . $ Gtk/::managecxx . . $ Gtk/manage(98ea26de6545f0ca).(new Gtkcxx . . $ Gtk/::SpinButtoncxx . . $ Gtk/SpinButton#((data.center_maxcxx . . $ JoystickCalibrationWidget#CalibrationData#center_max. =cxx . . $ Glib/RefPtr#`operator=`(b66de19e2ab7ce1f). Gtkcxx . . $ Gtk/::Adjustmentcxx . . $ Gtk/Adjustment#::createcxx . . $ Gtk/Adjustment#create(926fa29e4dbebfc4).(0, -32768, 32767)))); |
| 57 | Gtkcxx . . $ Gtk/::SpinButtoncxx . . $ Gtk/SpinButton#& range_min = *Gtkcxx . . $ Gtk/::managecxx . . $ Gtk/manage(98ea26de6545f0ca).(new Gtkcxx . . $ Gtk/::SpinButtoncxx . . $ Gtk/SpinButton#((data.range_mincxx . . $ JoystickCalibrationWidget#CalibrationData#range_min. =cxx . . $ Glib/RefPtr#`operator=`(b66de19e2ab7ce1f). Gtkcxx . . $ Gtk/::Adjustmentcxx . . $ Gtk/Adjustment#::createcxx . . $ Gtk/Adjustment#create(926fa29e4dbebfc4).(0, -32768, 32767)))); |
| 58 | Gtkcxx . . $ Gtk/::SpinButtoncxx . . $ Gtk/SpinButton#& range_max = *Gtkcxx . . $ Gtk/::managecxx . . $ Gtk/manage(98ea26de6545f0ca).(new Gtkcxx . . $ Gtk/::SpinButtoncxx . . $ Gtk/SpinButton#((data.range_maxcxx . . $ JoystickCalibrationWidget#CalibrationData#range_max. =cxx . . $ Glib/RefPtr#`operator=`(b66de19e2ab7ce1f). Gtkcxx . . $ Gtk/::Adjustmentcxx . . $ Gtk/Adjustment#::createcxx . . $ Gtk/Adjustment#create(926fa29e4dbebfc4).(0, -32768, 32767)))); |
| 59 | Gtkcxx . . $ Gtk/::CheckButtoncxx . . $ Gtk/CheckButton#& invert = *(data.invertcxx . . $ JoystickCalibrationWidget#CalibrationData#invert. = Gtkcxx . . $ Gtk/::managecxx . . $ Gtk/manage(98ea26de6545f0ca).(new Gtkcxx . . $ Gtk/::CheckButtoncxx . . $ Gtk/CheckButton#())); |
| 60 | |
| 61 | center_min.signal_value_changedcxx . . $ Gtk/SpinButton#signal_value_changed(5db58c3a758c1880).().connectcxx . . $ Glib/SignalProxy#connect(23e07d4a2c0735e0).(sigccxx . . $ sigc/slot#slot(edcd8b2679e9bd1a).::mem_funcxx . . $ sigc/mem_fun(84441c09a3e988ac).(this, &JoystickCalibrationWidgetcxx . . $ JoystickCalibrationWidget#::on_applycxx . . $ JoystickCalibrationWidget#on_apply(49f6e7a06ebc5aa8).)); |
| 62 | center_max.signal_value_changedcxx . . $ Gtk/SpinButton#signal_value_changed(5db58c3a758c1880).().connectcxx . . $ Glib/SignalProxy#connect(23e07d4a2c0735e0).(sigccxx . . $ sigc/slot#slot(edcd8b2679e9bd1a).::mem_funcxx . . $ sigc/mem_fun(84441c09a3e988ac).(this, &JoystickCalibrationWidgetcxx . . $ JoystickCalibrationWidget#::on_applycxx . . $ JoystickCalibrationWidget#on_apply(49f6e7a06ebc5aa8).)); |
| 63 | range_min.signal_value_changedcxx . . $ Gtk/SpinButton#signal_value_changed(5db58c3a758c1880).().connectcxx . . $ Glib/SignalProxy#connect(23e07d4a2c0735e0).(sigccxx . . $ sigc/slot#slot(edcd8b2679e9bd1a).::mem_funcxx . . $ sigc/mem_fun(84441c09a3e988ac).(this, &JoystickCalibrationWidgetcxx . . $ JoystickCalibrationWidget#::on_applycxx . . $ JoystickCalibrationWidget#on_apply(49f6e7a06ebc5aa8).)); |
| 64 | range_max.signal_value_changedcxx . . $ Gtk/SpinButton#signal_value_changed(5db58c3a758c1880).().connectcxx . . $ Glib/SignalProxy#connect(23e07d4a2c0735e0).(sigccxx . . $ sigc/slot#slot(edcd8b2679e9bd1a).::mem_funcxx . . $ sigc/mem_fun(84441c09a3e988ac).(this, &JoystickCalibrationWidgetcxx . . $ JoystickCalibrationWidget#::on_applycxx . . $ JoystickCalibrationWidget#on_apply(49f6e7a06ebc5aa8).)); |
| 65 | invert.signal_clickedcxx . . $ Gtk/Button#signal_clicked(5db58c3a758c1880).().connectcxx . . $ Glib/SignalProxy#connect(23e07d4a2c0735e0).(sigccxx . . $ sigc/slot#slot(edcd8b2679e9bd1a).::mem_funcxx . . $ sigc/mem_fun(84441c09a3e988ac).(this, &JoystickCalibrationWidgetcxx . . $ JoystickCalibrationWidget#::on_applycxx . . $ JoystickCalibrationWidget#on_apply(49f6e7a06ebc5aa8).)); |
| 66 | |
| 67 | center_min.set_tooltip_textcxx . . $ Gtk/Widget#set_tooltip_text(1ff0bff2cee2bc51).("The minimal value of the dead zone"cxx . . $ Glib/ustring#ustring(85c52e162fed56f9).); |
| 68 | center_max.set_tooltip_textcxx . . $ Gtk/Widget#set_tooltip_text(1ff0bff2cee2bc51).("The maximum value of the dead zone"cxx . . $ Glib/ustring#ustring(85c52e162fed56f9).); |
| 69 | range_min.set_tooltip_textcxx . . $ Gtk/Widget#set_tooltip_text(1ff0bff2cee2bc51).("The minimal position reachable"cxx . . $ Glib/ustring#ustring(85c52e162fed56f9).); |
| 70 | range_max.set_tooltip_textcxx . . $ Gtk/Widget#set_tooltip_text(1ff0bff2cee2bc51).("The maximum position reachable"cxx . . $ Glib/ustring#ustring(85c52e162fed56f9).); |
| 71 | |
| 72 | calibration_datacxx . . $ JoystickCalibrationWidget#calibration_data..push_backcxx . . $ std/vector#push_back(77d9f17553126ecb).(data); |
| 73 | |
| 74 | stdcxx . . $ std/::ostringstreamcxx . . $ std/ostringstream# strcxx . . $ std/__cxx11/basic_ostringstream#basic_ostringstream(49f6e7a06ebc5aa8).; |
| 75 | str <<cxx . . $ std/basic_ostream#`operator<<`(23b6575433a77e57). i; |
| 76 | axis_tablecxx . . $ JoystickCalibrationWidget#axis_table..attachcxx . . $ Gtk/Table#attach(45588a21adf610ec).(*Gtkcxx . . $ Gtk/::managecxx . . $ Gtk/manage(98ea26de6545f0ca).(new Gtkcxx . . $ Gtk/::Labelcxx . . $ Gtk/Label#(strcxx . . $ Glib/ustring#ustring(b484295947d76b8d)..strcxx . . $ std/__cxx11/basic_ostringstream#str(d33e1a6fd36255f7).())), 0, 1, i+1, i+2); |
| 77 | |
| 78 | axis_tablecxx . . $ JoystickCalibrationWidget#axis_table..attachcxx . . $ Gtk/Table#attach(45588a21adf610ec).(center_min, 1, 2, i+1, i+2); |
| 79 | axis_tablecxx . . $ JoystickCalibrationWidget#axis_table..attachcxx . . $ Gtk/Table#attach(45588a21adf610ec).(center_max, 2, 3, i+1, i+2); |
| 80 | |
| 81 | axis_tablecxx . . $ JoystickCalibrationWidget#axis_table..attachcxx . . $ Gtk/Table#attach(45588a21adf610ec).(range_min, 3, 4, i+1, i+2); |
| 82 | axis_tablecxx . . $ JoystickCalibrationWidget#axis_table..attachcxx . . $ Gtk/Table#attach(45588a21adf610ec).(range_max, 4, 5, i+1, i+2); |
| 83 | |
| 84 | axis_tablecxx . . $ JoystickCalibrationWidget#axis_table..attachcxx . . $ Gtk/Table#attach(45588a21adf610ec).(invert, 5, 6, i+1, i+2, Gtkcxx . . $ Gtk/::SHRINKcxx . . $ Gtk/SHRINK., Gtkcxx . . $ Gtk/::SHRINKcxx . . $ Gtk/SHRINK.); |
| 85 | } |
| 86 | |
| 87 | add_buttoncxx . . $ Gtk/Dialog#add_button(6cdba0e79b6969d0).(Gtkcxx . . $ Gtk/StockID#StockID(5e31ef76c53be42c).::Stockcxx . . $ Gtk/Stock/::REVERT_TO_SAVEDcxx . . $ Gtk/Stock/REVERT_TO_SAVED., 2); |
| 88 | add_buttoncxx . . $ Gtk/Dialog#add_button(b265544cb5f9b482).("Raw Events"cxx . . $ Glib/ustring#ustring(85c52e162fed56f9)., 1); |
| 89 | Gtkcxx . . $ Gtk/::Widgetcxx . . $ Gtk/Widget#* close_button = add_buttoncxx . . $ Gtk/Dialog#add_button(6cdba0e79b6969d0).(Gtkcxx . . $ Gtk/StockID#StockID(5e31ef76c53be42c).::Stockcxx . . $ Gtk/Stock/::CLOSEcxx . . $ Gtk/Stock/CLOSE., 0); |
| 90 | |
| 91 | scrollcxx . . $ JoystickCalibrationWidget#scroll..addcxx . . $ Gtk/ScrolledWindow#add(c65b1b431719167f).(axis_tablecxx . . $ JoystickCalibrationWidget#axis_table.); |
| 92 | scrollcxx . . $ JoystickCalibrationWidget#scroll..set_policycxx . . $ Gtk/ScrolledWindow#set_policy(a7abc6f4440f07bd).(Gtkcxx . . $ Gtk/::POLICY_NEVERcxx . . $ Gtk/POLICY_NEVER., Gtkcxx . . $ Gtk/::POLICY_AUTOMATICcxx . . $ Gtk/POLICY_AUTOMATIC.); |
| 93 | scrollcxx . . $ JoystickCalibrationWidget#scroll..set_size_requestcxx . . $ Gtk/Widget#set_size_request(3e454b8ccf442868).(-1, 300); |
| 94 | axis_framecxx . . $ JoystickCalibrationWidget#axis_frame..addcxx . . $ Gtk/Container#add(c65b1b431719167f).(scrollcxx . . $ JoystickCalibrationWidget#scroll.); |
| 95 | |
| 96 | get_vboxcxx . . $ Gtk/Dialog#get_vbox(d9bef252bf7ebc20).()->pack_startcxx . . $ Gtk/Box#pack_start(492efd5ed8431628).(axis_framecxx . . $ JoystickCalibrationWidget#axis_frame., Gtkcxx . . $ Gtk/::PACK_EXPAND_WIDGETcxx . . $ Gtk/PACK_EXPAND_WIDGET.); |
| 97 | |
| 98 | signal_responsecxx . . $ Gtk/Dialog#signal_response(3ef21198a019bfc3).().connectcxx . . $ Glib/SignalProxy#connect(23e07d4a2c0735e0).(sigccxx . . $ sigc/slot#slot(edcd8b2679e9bd1a).::mem_funcxx . . $ sigc/mem_fun(6f5a0390fdf5a127).(this, &JoystickCalibrationWidgetcxx . . $ JoystickCalibrationWidget#::on_responsecxx . . $ JoystickCalibrationWidget#on_response(d4f767463ce0a6b3).)); |
| 99 | |
| 100 | close_button->grab_focuscxx . . $ Gtk/Widget#grab_focus(49f6e7a06ebc5aa8).(); |
| 101 | |
| 102 | update_withcxx . . $ JoystickCalibrationWidget#update_with(6fc732b2aab18c50).(joystick.get_calibrationcxx . . $ Joystick#get_calibration(2ef09a8d9ed4db48).()); |
| 103 | } |
| 104 | |
| 105 | void |
| 106 | JoystickCalibrationWidgetcxx . . $ JoystickCalibrationWidget#::on_clearcxx . . $ JoystickCalibrationWidget#on_clear(49f6e7a06ebc5aa8).() |
| 107 | { |
| 108 | joystickcxx . . $ JoystickCalibrationWidget#joystick..clear_calibrationcxx . . $ Joystick#clear_calibration(49f6e7a06ebc5aa8).(); |
| 109 | update_withcxx . . $ JoystickCalibrationWidget#update_with(6fc732b2aab18c50).(joystickcxx . . $ JoystickCalibrationWidget#joystick..get_calibrationcxx . . $ Joystick#get_calibration(2ef09a8d9ed4db48).()); |
| 110 | } |
| 111 | |
| 112 | void |
| 113 | JoystickCalibrationWidgetcxx . . $ JoystickCalibrationWidget#::update_withcxx . . $ JoystickCalibrationWidget#update_with(6fc732b2aab18c50).(const stdcxx . . $ std/::vectorcxx . . $ std/vector#<Joystickcxx . . $ Joystick#::CalibrationDatacxx . . $ Joystick#CalibrationData#>& data) |
| 114 | { |
| 115 | assertcxx . . $ `<external>/4398592474888995393/assert.h:137:11`!(data.size() == calibration_data.size()); |
| 116 | |
| 117 | for(int i = 0; i < (int)data.sizecxx . . $ std/vector#size(fe4d2d262d4164a8).(); ++i) |
| 118 | { |
| 119 | calibration_datacxx . . $ JoystickCalibrationWidget#calibration_data.[cxx . . $ std/vector#`operator[]`(428bb168810b9e52).i].invertcxx . . $ JoystickCalibrationWidget#CalibrationData#invert.->set_activecxx . . $ Gtk/ToggleButton#set_active(b45ddcbc8423892c).(data[cxx . . $ std/vector#`operator[]`(b61e45a10b63f40a).i].invertcxx . . $ Joystick#CalibrationData#invert.); |
| 120 | calibration_datacxx . . $ JoystickCalibrationWidget#calibration_data.[cxx . . $ std/vector#`operator[]`(428bb168810b9e52).i].center_mincxx . . $ JoystickCalibrationWidget#CalibrationData#center_min.->cxx . . $ Glib/RefPtr#`operator->`(5a2a78a048fb49a8).set_valuecxx . . $ Gtk/Adjustment#set_value(ba8836b59fb42830).(data[cxx . . $ std/vector#`operator[]`(b61e45a10b63f40a).i].center_mincxx . . $ Joystick#CalibrationData#center_min.); |
| 121 | calibration_datacxx . . $ JoystickCalibrationWidget#calibration_data.[cxx . . $ std/vector#`operator[]`(428bb168810b9e52).i].center_maxcxx . . $ JoystickCalibrationWidget#CalibrationData#center_max.->cxx . . $ Glib/RefPtr#`operator->`(5a2a78a048fb49a8).set_valuecxx . . $ Gtk/Adjustment#set_value(ba8836b59fb42830).(data[cxx . . $ std/vector#`operator[]`(b61e45a10b63f40a).i].center_maxcxx . . $ Joystick#CalibrationData#center_max.); |
| 122 | calibration_datacxx . . $ JoystickCalibrationWidget#calibration_data.[cxx . . $ std/vector#`operator[]`(428bb168810b9e52).i].range_mincxx . . $ JoystickCalibrationWidget#CalibrationData#range_min.->cxx . . $ Glib/RefPtr#`operator->`(5a2a78a048fb49a8).set_valuecxx . . $ Gtk/Adjustment#set_value(ba8836b59fb42830).(data[cxx . . $ std/vector#`operator[]`(b61e45a10b63f40a).i].range_mincxx . . $ Joystick#CalibrationData#range_min.); |
| 123 | calibration_datacxx . . $ JoystickCalibrationWidget#calibration_data.[cxx . . $ std/vector#`operator[]`(428bb168810b9e52).i].range_maxcxx . . $ JoystickCalibrationWidget#CalibrationData#range_max.->cxx . . $ Glib/RefPtr#`operator->`(5a2a78a048fb49a8).set_valuecxx . . $ Gtk/Adjustment#set_value(ba8836b59fb42830).(data[cxx . . $ std/vector#`operator[]`(b61e45a10b63f40a).i].range_maxcxx . . $ Joystick#CalibrationData#range_max.); |
| 124 | } |
| 125 | } |
| 126 | |
| 127 | void |
| 128 | JoystickCalibrationWidgetcxx . . $ JoystickCalibrationWidget#::on_applycxx . . $ JoystickCalibrationWidget#on_apply(49f6e7a06ebc5aa8).() |
| 129 | { |
| 130 | stdcxx . . $ std/::vectorcxx . . $ std/vector#<Joystickcxx . . $ Joystick#::CalibrationDatacxx . . $ Joystick#CalibrationData#> datacxx . . $ std/vector#vector(83fdeebbe0501a83).(calibration_datacxx . . $ JoystickCalibrationWidget#calibration_data..sizecxx . . $ std/vector#size(fe4d2d262d4164a8).()); |
| 131 | |
| 132 | for(int i = 0; i < (int)data.sizecxx . . $ std/vector#size(fe4d2d262d4164a8).(); ++i) |
| 133 | { |
| 134 | data[cxx . . $ std/vector#`operator[]`(428bb168810b9e52).i].calibratecxx . . $ Joystick#CalibrationData#calibrate. = true; |
| 135 | data[cxx . . $ std/vector#`operator[]`(428bb168810b9e52).i].invertcxx . . $ Joystick#CalibrationData#invert. = calibration_datacxx . . $ JoystickCalibrationWidget#calibration_data.[cxx . . $ std/vector#`operator[]`(428bb168810b9e52).i].invertcxx . . $ JoystickCalibrationWidget#CalibrationData#invert.->get_activecxx . . $ Gtk/ToggleButton#get_active(50ce9a9e25b4a850).(); |
| 136 | data[cxx . . $ std/vector#`operator[]`(428bb168810b9e52).i].center_mincxx . . $ Joystick#CalibrationData#center_min. = calibration_datacxx . . $ JoystickCalibrationWidget#calibration_data.[cxx . . $ std/vector#`operator[]`(428bb168810b9e52).i].center_mincxx . . $ JoystickCalibrationWidget#CalibrationData#center_min.->cxx . . $ Glib/RefPtr#`operator->`(5a2a78a048fb49a8).get_valuecxx . . $ Gtk/Adjustment#get_value(21b6c25e127938e2).(); |
| 137 | data[cxx . . $ std/vector#`operator[]`(428bb168810b9e52).i].center_maxcxx . . $ Joystick#CalibrationData#center_max. = calibration_datacxx . . $ JoystickCalibrationWidget#calibration_data.[cxx . . $ std/vector#`operator[]`(428bb168810b9e52).i].center_maxcxx . . $ JoystickCalibrationWidget#CalibrationData#center_max.->cxx . . $ Glib/RefPtr#`operator->`(5a2a78a048fb49a8).get_valuecxx . . $ Gtk/Adjustment#get_value(21b6c25e127938e2).(); |
| 138 | data[cxx . . $ std/vector#`operator[]`(428bb168810b9e52).i].range_mincxx . . $ Joystick#CalibrationData#range_min. = calibration_datacxx . . $ JoystickCalibrationWidget#calibration_data.[cxx . . $ std/vector#`operator[]`(428bb168810b9e52).i].range_mincxx . . $ JoystickCalibrationWidget#CalibrationData#range_min.->cxx . . $ Glib/RefPtr#`operator->`(5a2a78a048fb49a8).get_valuecxx . . $ Gtk/Adjustment#get_value(21b6c25e127938e2).(); |
| 139 | data[cxx . . $ std/vector#`operator[]`(428bb168810b9e52).i].range_maxcxx . . $ Joystick#CalibrationData#range_max. = calibration_datacxx . . $ JoystickCalibrationWidget#calibration_data.[cxx . . $ std/vector#`operator[]`(428bb168810b9e52).i].range_maxcxx . . $ JoystickCalibrationWidget#CalibrationData#range_max.->cxx . . $ Glib/RefPtr#`operator->`(5a2a78a048fb49a8).get_valuecxx . . $ Gtk/Adjustment#get_value(21b6c25e127938e2).(); |
| 140 | } |
| 141 | |
| 142 | joystickcxx . . $ JoystickCalibrationWidget#joystick..set_calibrationcxx . . $ Joystick#set_calibration(6fc732b2aab18c50).(data); |
| 143 | } |
| 144 | |
| 145 | void |
| 146 | JoystickCalibrationWidgetcxx . . $ JoystickCalibrationWidget#::on_calibratecxx . . $ JoystickCalibrationWidget#on_calibrate(49f6e7a06ebc5aa8).() |
| 147 | { |
| 148 | CalibrateMaximumDialogcxx . . $ CalibrateMaximumDialog# dialogcxx . . $ CalibrateMaximumDialog#CalibrateMaximumDialog(a141bca875d6b270).(joystickcxx . . $ JoystickCalibrationWidget#joystick.); |
| 149 | dialog.show_allcxx . . $ Gtk/Widget#show_all(49f6e7a06ebc5aa8).(); |
| 150 | dialog.runcxx . . $ Gtk/Dialog#run(b126dc7c1de90089).(); |
| 151 | update_withcxx . . $ JoystickCalibrationWidget#update_with(6fc732b2aab18c50).(joystickcxx . . $ JoystickCalibrationWidget#joystick..get_calibrationcxx . . $ Joystick#get_calibration(2ef09a8d9ed4db48).()); |
| 152 | } |
| 153 | |
| 154 | void |
| 155 | JoystickCalibrationWidgetcxx . . $ JoystickCalibrationWidget#::on_responsecxx . . $ JoystickCalibrationWidget#on_response(d4f767463ce0a6b3).(int i) |
| 156 | { |
| 157 | if (i == 0) |
| 158 | { |
| 159 | hidecxx . . $ Gtk/Widget#hide(49f6e7a06ebc5aa8).(); |
| 160 | } |
| 161 | else if (i == 1) |
| 162 | { |
| 163 | on_clearcxx . . $ JoystickCalibrationWidget#on_clear(49f6e7a06ebc5aa8).(); |
| 164 | } |
| 165 | else if (i == 2) |
| 166 | { |
| 167 | joystickcxx . . $ JoystickCalibrationWidget#joystick..reset_calibrationcxx . . $ Joystick#reset_calibration(49f6e7a06ebc5aa8).(); |
| 168 | update_withcxx . . $ JoystickCalibrationWidget#update_with(6fc732b2aab18c50).(joystickcxx . . $ JoystickCalibrationWidget#joystick..get_calibrationcxx . . $ Joystick#get_calibration(2ef09a8d9ed4db48).()); |
| 169 | } |
| 170 | } |
| 171 | |
| 172 | /* EOF */ |