aboutsummaryrefslogtreecommitdiffstats
path: root/vncviewer/win32.c
diff options
context:
space:
mode:
authorPierre Ossman <ossman@cendio.se>2021-07-19 17:22:43 +0200
committerPierre Ossman <ossman@cendio.se>2021-07-19 17:22:43 +0200
commit1bb96132376c3039903d13b78196e75cdf22c14b (patch)
tree53a232de6c86e5cd6aad9c86e0cc74be757fd02f /vncviewer/win32.c
parent11ca86b9432bfb1e7d2ba586b4dc6da60329bf92 (diff)
downloadtigervnc-1bb96132376c3039903d13b78196e75cdf22c14b.tar.gz
tigervnc-1bb96132376c3039903d13b78196e75cdf22c14b.zip
Clean up style in recent monitor code
Fix some indentation issues and make sure everything* uses CamelCase. * MonitorArrangement is left as snake_case in order to pretend it is an independent FLTK widget class.
Diffstat (limited to 'vncviewer/win32.c')
-rw-r--r--vncviewer/win32.c70
1 files changed, 35 insertions, 35 deletions
diff --git a/vncviewer/win32.c b/vncviewer/win32.c
index dc8cb602..9032f36a 100644
--- a/vncviewer/win32.c
+++ b/vncviewer/win32.c
@@ -421,52 +421,52 @@ int win32_has_altgr(void)
}
typedef struct {
- int x, y, w, h;
- char* name;
- size_t name_len;
- int bytes_written;
+ int x, y, w, h;
+ char* name;
+ size_t name_len;
+ int bytes_written;
} EnumCallbackData;
static BOOL CALLBACK EnumDisplayMonitorsCallback(
- HMONITOR monitor, HDC deviceContext, LPRECT rect, LPARAM userData)
+ HMONITOR monitor, HDC deviceContext, LPRECT rect, LPARAM userData)
{
- EnumCallbackData *data = (EnumCallbackData *)userData;
- MONITORINFOEX info;
- info.cbSize = sizeof(info);
- GetMonitorInfo(monitor, (LPMONITORINFO)&info);
+ EnumCallbackData *data = (EnumCallbackData *)userData;
+ MONITORINFOEX info;
+ info.cbSize = sizeof(info);
+ GetMonitorInfo(monitor, (LPMONITORINFO)&info);
- int x = info.rcMonitor.left;
- int y = info.rcMonitor.top;
- int w = info.rcMonitor.right - info.rcMonitor.left;
- int h = info.rcMonitor.bottom - info.rcMonitor.top;
+ int x = info.rcMonitor.left;
+ int y = info.rcMonitor.top;
+ int w = info.rcMonitor.right - info.rcMonitor.left;
+ int h = info.rcMonitor.bottom - info.rcMonitor.top;
- if ((data->x == x) && (data->y == y) && (data->w == w) && (data->h == h)) {
- data->bytes_written = snprintf(data->name, data->name_len,
- "%.*s", (int)(data->name_len - 1), info.szDevice);
+ if ((data->x == x) && (data->y == y) && (data->w == w) && (data->h == h)) {
+ data->bytes_written = snprintf(data->name, data->name_len,
+ "%.*s", (int)(data->name_len - 1), info.szDevice);
- if (data->bytes_written < 0)
- return FALSE;
+ if (data->bytes_written < 0)
+ return FALSE;
- // Stop the iteration.
- return FALSE;
- }
+ // Stop the iteration.
+ return FALSE;
+ }
- // Keep iterating.
- return TRUE;
+ // Keep iterating.
+ return TRUE;
}
int win32_get_monitor_name(int x, int y, int w, int h, char name[], size_t name_len)
{
- EnumCallbackData data = {
- .x = x,
- .y = y,
- .w = w,
- .h = h,
- .name = name,
- .name_len = name_len,
- .bytes_written = -1
- };
-
- EnumDisplayMonitors(NULL, NULL, EnumDisplayMonitorsCallback, (LPARAM) &data);
- return data.bytes_written;
+ EnumCallbackData data = {
+ .x = x,
+ .y = y,
+ .w = w,
+ .h = h,
+ .name = name,
+ .name_len = name_len,
+ .bytes_written = -1
+ };
+
+ EnumDisplayMonitors(NULL, NULL, EnumDisplayMonitorsCallback, (LPARAM) &data);
+ return data.bytes_written;
}