void JoystickCalibrationWidget::on_response(int i) { if (i == 0) { hide(); } else if (i == 1) { on_clear(); } else if (i == 2) { joystick.reset_calibration(); update_with(joystick.get_calibration()); } }
gboolean diagram_update(GArray *events, int size, GHashTable *devices) { struct event_t *e; struct device_t *d; struct event_diagram *ed; struct device_diagram *dd; struct point p; int line_size; int i; gpointer key, value; GHashTableIter iter; /* Set global variables */ events_list = events; events_size = size; devices_hash = devices; /* Clear diagram */ on_clear(root); /* Make all events */ p.x = EVENT_BOX_LEFT_MARGIN; p.y = EVENT_BOX_TOP_MARGIN; events_diagram = make_all_events(root, events, event_callback, size, p, EVENT_BOX_W, EVENT_BOX_H); /* Make all devices timeline */ line_size = events_size * EVENT_BOX_H + EVENT_BOX_TOP_MARGIN; p.x = EVENT_BOX_W / 2 + 6 * SPACE; p.y = 0; devices_diagram = make_all_devices_timeline(root, devices_hash, p, line_size); /* Make all links */ /* Half of EVENT_BOX_W to use CrCanvas positioning system */ make_all_links(root, events_diagram, devices_diagram, EVENT_BOX_W / 2); return TRUE; }