Renamed mouse_mode to mouse_input_mode to fix the conflict on Haiku OS.

This commit is contained in:
OBattler
2023-10-23 01:21:28 +02:00
parent 8b86bd812c
commit 5c5b286358
7 changed files with 34 additions and 34 deletions

View File

@@ -1388,7 +1388,7 @@ pc_run(void)
}
if (title_update) {
mouse_msg_idx = ((mouse_type == MOUSE_TYPE_NONE) || (mouse_mode >= 1)) ? 2 : !!mouse_capture;
mouse_msg_idx = ((mouse_type == MOUSE_TYPE_NONE) || (mouse_input_mode >= 1)) ? 2 : !!mouse_capture;
swprintf(temp, sizeof_w(temp), mouse_msg[mouse_msg_idx], fps);
#ifdef __APPLE__
/* Needed due to modifying the UI on the non-main thread is a big no-no. */

View File

@@ -41,7 +41,7 @@ typedef struct mouse_t {
} mouse_t;
int mouse_type = 0;
int mouse_mode;
int mouse_input_mode;
int mouse_timed = 1;
int mouse_tablet_in_proximity = 0;
int tablet_tool_type = 1; /* 0 = Puck/Cursor, 1 = Pen */
@@ -530,9 +530,9 @@ mouse_process(void)
if (mouse_curr == NULL)
return;
if ((mouse_mode >= 1) && mouse_poll_ex)
if ((mouse_input_mode >= 1) && mouse_poll_ex)
mouse_poll_ex();
else if ((mouse_mode == 0) && ((mouse_dev_poll != NULL) || (mouse_curr->poll != NULL))) {
else if ((mouse_input_mode == 0) && ((mouse_dev_poll != NULL) || (mouse_curr->poll != NULL))) {
if (mouse_curr->poll != NULL)
mouse_curr->poll(mouse_priv);
else
@@ -628,7 +628,7 @@ mouse_reset(void)
/* Clear local data. */
mouse_clear_coords();
mouse_clear_buttons();
mouse_mode = 0;
mouse_input_mode = 0;
mouse_timed = 1;
/* If no mouse configured, we're done. */

View File

@@ -215,7 +215,7 @@ wacom_process_settings_dword(mouse_wacom_t *wacom, uint32_t dword)
break;
}
mouse_mode = !wacom->settings_bits.coord_sys;
mouse_input_mode = !wacom->settings_bits.coord_sys;
wacom->x_res = wacom->y_res = wacom_resolution_values[wacom->settings_bits.resolution];
}
@@ -235,7 +235,7 @@ wacom_reset(mouse_wacom_t *wacom)
wacom->settings_bits.remote_mode = wacom->remote_req = 0;
wacom->settings_bits.out_of_range_data = 0;
mouse_mode = 1;
mouse_input_mode = 1;
wacom_process_settings_dword(wacom, 0xA21BC800);
}
@@ -257,7 +257,7 @@ wacom_reset_artpad(mouse_wacom_t *wacom)
wacom->settings_bits.out_of_range_data = 0;
wacom_process_settings_dword(wacom, 0xE203C000);
mouse_mode = 1;
mouse_input_mode = 1;
}
static void
@@ -364,8 +364,8 @@ wacom_write(UNUSED(struct serial_s *serial), void *priv, uint8_t data)
} else if (!memcmp(wacom->data_rec, "IT", 2)) {
sscanf((const char *) wacom->data_rec, "IT%d", &wacom->interval);
} else if (!memcmp(wacom->data_rec, "DE", 2) && wacom->settings_bits.cmd_set == WACOM_CMDSET_IIS) {
sscanf((const char *) wacom->data_rec, "DE%d", &mouse_mode);
mouse_mode = !mouse_mode;
sscanf((const char *) wacom->data_rec, "DE%d", &mouse_input_mode);
mouse_input_mode = !mouse_input_mode;
plat_mouse_capture(0);
} else if (!memcmp(wacom->data_rec, "SU", 2)) {
sscanf((const char *) wacom->data_rec, "SU%d", &wacom->suppressed_increment);
@@ -520,7 +520,7 @@ wacom_transmit_prepare(mouse_wacom_t *wacom, int x, int y)
data[1] = ((x & 0x3F80) >> 7) & 0x7F;
data[0] |= (((x & 0xC000) >> 14) & 3);
if (mouse_mode == 0 && wacom->settings_bits.cmd_set == WACOM_CMDSET_IIS) {
if (mouse_input_mode == 0 && wacom->settings_bits.cmd_set == WACOM_CMDSET_IIS) {
data[0] |= (!!(x < 0)) << 2;
data[3] |= (!!(y < 0)) << 2;
}
@@ -563,7 +563,7 @@ wacom_report_timer(void *priv)
{
mouse_wacom_t *wacom = (mouse_wacom_t *) priv;
double milisecond_diff = ((double) (tsc - wacom->old_tsc)) / cpuclock * 1000.0;
int relative_mode = (mouse_mode == 0);
int relative_mode = (mouse_input_mode == 0);
int x = (relative_mode ? wacom->rel_x : wacom->abs_x);
int y = (relative_mode ? wacom->rel_y : wacom->abs_y);
int x_diff = abs(relative_mode ? wacom->rel_x : (wacom->abs_x - wacom->last_abs_x));

View File

@@ -50,7 +50,7 @@ extern "C" {
#endif
extern int mouse_type;
extern int mouse_mode; /* 1 = Absolute, 0 = Relative */
extern int mouse_input_mode; /* 1 = Absolute, 0 = Relative */
extern int mouse_timed; /* 1 = Timed, 0 = Constant */
extern int mouse_tablet_in_proximity;
extern double mouse_x_abs;

View File

@@ -130,7 +130,7 @@ typedef struct m24_kbd_t {
uint8_t scan[7];
/* Mouse stuff. */
int mouse_mode;
int mouse_input_mode;
int b;
pc_timer_t send_delay_timer;
@@ -550,7 +550,7 @@ m24_kbd_write(uint16_t port, uint8_t val, void *priv)
if (m24_kbd->param == m24_kbd->param_total) {
switch (m24_kbd->command) {
case 0x11:
m24_kbd->mouse_mode = 0;
m24_kbd->mouse_input_mode = 0;
m24_kbd->scan[0] = m24_kbd->params[0];
m24_kbd->scan[1] = m24_kbd->params[1];
m24_kbd->scan[2] = m24_kbd->params[2];
@@ -561,7 +561,7 @@ m24_kbd_write(uint16_t port, uint8_t val, void *priv)
break;
case 0x12:
m24_kbd->mouse_mode = 1;
m24_kbd->mouse_input_mode = 1;
m24_kbd->scan[0] = m24_kbd->params[0];
m24_kbd->scan[1] = m24_kbd->params[1];
m24_kbd->scan[2] = m24_kbd->params[2];
@@ -720,7 +720,7 @@ m24_kbd_reset(void *priv)
m24_kbd->wantirq = 0;
keyboard_scan = 1;
m24_kbd->param = m24_kbd->param_total = 0;
m24_kbd->mouse_mode = 0;
m24_kbd->mouse_input_mode = 0;
m24_kbd->scan[0] = 0x1c;
m24_kbd->scan[1] = 0x53;
m24_kbd->scan[2] = 0x01;
@@ -767,7 +767,7 @@ ms_poll(void *priv)
m24_kbd_adddata(m24_kbd->scan[1] | 0x80);
m24_kbd->b = (m24_kbd->b & ~4) | (b & 4);
if (m24_kbd->mouse_mode) {
if (m24_kbd->mouse_input_mode) {
if (((key_queue_end - key_queue_start) & 0xf) > 12)
return 0xff;

View File

@@ -212,7 +212,7 @@ MainWindow::MainWindow(QWidget *parent)
ui->actionMCA_devices->setVisible(machine_has_bus(machine, MACHINE_BUS_MCA));
QApplication::setOverrideCursor(Qt::ArrowCursor);
#ifdef USE_WACOM
ui->menuTablet_tool->menuAction()->setVisible(mouse_mode >= 1);
ui->menuTablet_tool->menuAction()->setVisible(mouse_input_mode >= 1);
#else
ui->menuTablet_tool->menuAction()->setVisible(false);
#endif

View File

@@ -144,7 +144,7 @@ int ignoreNextMouseEvent = 1;
void
RendererStack::mouseReleaseEvent(QMouseEvent *event)
{
if (this->geometry().contains(event->pos()) && (event->button() == Qt::LeftButton) && !mouse_capture && (isMouseDown & 1) && (kbd_req_capture || (mouse_get_buttons() != 0)) && (mouse_mode == 0)) {
if (this->geometry().contains(event->pos()) && (event->button() == Qt::LeftButton) && !mouse_capture && (isMouseDown & 1) && (kbd_req_capture || (mouse_get_buttons() != 0)) && (mouse_input_mode == 0)) {
plat_mouse_capture(1);
this->setCursor(Qt::BlankCursor);
if (!ignoreNextMouseEvent)
@@ -158,16 +158,16 @@ RendererStack::mouseReleaseEvent(QMouseEvent *event)
isMouseDown &= ~1;
return;
}
if (mouse_capture || (mouse_mode >= 1)) {
if (mouse_capture || (mouse_input_mode >= 1)) {
#ifdef Q_OS_WINDOWS
if (((m_monitor_index >= 1) && (mouse_mode >= 1) && mousedata.mouse_tablet_in_proximity) ||
((m_monitor_index < 1) && (mouse_mode >= 1)))
if (((m_monitor_index >= 1) && (mouse_input_mode >= 1) && mousedata.mouse_tablet_in_proximity) ||
((m_monitor_index < 1) && (mouse_input_mode >= 1)))
#else
#ifndef __APPLE__
if (((m_monitor_index >= 1) && (mouse_mode >= 1) && mousedata.mouse_tablet_in_proximity) ||
if (((m_monitor_index >= 1) && (mouse_input_mode >= 1) && mousedata.mouse_tablet_in_proximity) ||
(m_monitor_index < 1))
#else
if ((m_monitor_index >= 1) && (mouse_mode >= 1) && mousedata.mouse_tablet_in_proximity)
if ((m_monitor_index >= 1) && (mouse_input_mode >= 1) && mousedata.mouse_tablet_in_proximity)
#endif
#endif
mouse_set_buttons_ex(mouse_get_buttons_ex() & ~event->button());
@@ -179,16 +179,16 @@ void
RendererStack::mousePressEvent(QMouseEvent *event)
{
isMouseDown |= 1;
if (mouse_capture || (mouse_mode >= 1)) {
if (mouse_capture || (mouse_input_mode >= 1)) {
#ifdef Q_OS_WINDOWS
if (((m_monitor_index >= 1) && (mouse_mode >= 1) && mousedata.mouse_tablet_in_proximity) ||
((m_monitor_index < 1) && (mouse_mode >= 1)))
if (((m_monitor_index >= 1) && (mouse_input_mode >= 1) && mousedata.mouse_tablet_in_proximity) ||
((m_monitor_index < 1) && (mouse_input_mode >= 1)))
#else
#ifndef __APPLE__
if (((m_monitor_index >= 1) && (mouse_mode >= 1) && mousedata.mouse_tablet_in_proximity) ||
if (((m_monitor_index >= 1) && (mouse_input_mode >= 1) && mousedata.mouse_tablet_in_proximity) ||
(m_monitor_index < 1))
#else
if ((m_monitor_index >= 1) && (mouse_mode >= 1) && mousedata.mouse_tablet_in_proximity)
if ((m_monitor_index >= 1) && (mouse_input_mode >= 1) && mousedata.mouse_tablet_in_proximity)
#endif
#endif
mouse_set_buttons_ex(mouse_get_buttons_ex() | event->button());
@@ -249,7 +249,7 @@ RendererStack::enterEvent(QEvent *event)
{
mousedata.mouse_tablet_in_proximity = 1;
if (mouse_mode == 1)
if (mouse_input_mode == 1)
QApplication::setOverrideCursor(Qt::BlankCursor);
}
@@ -258,7 +258,7 @@ RendererStack::leaveEvent(QEvent *event)
{
mousedata.mouse_tablet_in_proximity = 0;
if (mouse_mode == 1 && QApplication::overrideCursor())
if (mouse_input_mode == 1 && QApplication::overrideCursor())
QApplication::restoreOverrideCursor();
if (QApplication::platformName().contains("wayland")) {
event->accept();
@@ -528,7 +528,7 @@ RendererStack::event(QEvent* event)
QMouseEvent* mouse_event = (QMouseEvent*)event;
if (m_monitor_index >= 1) {
if (mouse_mode >= 1) {
if (mouse_input_mode >= 1) {
mouse_x_abs = (mouse_event->localPos().x()) / (long double)width();
mouse_y_abs = (mouse_event->localPos().y()) / (long double)height();
if (!mouse_tablet_in_proximity)
@@ -538,7 +538,7 @@ RendererStack::event(QEvent* event)
}
#ifdef Q_OS_WINDOWS
if (mouse_mode == 0) {
if (mouse_input_mode == 0) {
mouse_x_abs = (mouse_event->localPos().x()) / (long double)width();
mouse_y_abs = (mouse_event->localPos().y()) / (long double)height();
return QStackedWidget::event(event);