Skip to content

Commit 4cbaaad

Browse files
committed
Some reformating
1 parent b472581 commit 4cbaaad

File tree

5 files changed

+11
-13
lines changed

5 files changed

+11
-13
lines changed

src/win/WinApp.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ LRESULT CALLBACK WindowProc (HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
3737
return DefWindowProc(hwnd, msg, wParam, lParam);
3838
}
3939

40-
int RunWindowsApp() {
40+
int RunWindowsApp ( ) {
4141
g_hInstance = GetModuleHandle(NULL);
4242

4343
// Initialize keybinds & settings
@@ -47,7 +47,7 @@ int RunWindowsApp() {
4747
wc.lpfnWndProc = WindowProc;
4848
wc.hInstance = g_hInstance;
4949
wc.lpszClassName = WINDOW_CLASS;
50-
RegisterClass(&wc);
50+
RegisterClass(& wc);
5151

5252
HWND hwnd = CreateWindowEx(0, WINDOW_CLASS, "Split Loaf", 0, 0, 0, 0, 0, NULL, NULL, g_hInstance, NULL);
5353

@@ -59,9 +59,9 @@ int RunWindowsApp() {
5959
DWORD result = MsgWaitForMultipleObjects(0, NULL, FALSE, 1, QS_ALLINPUT);
6060

6161
if (result == WAIT_OBJECT_0) {
62-
while (PeekMessage(&msg, NULL, 0, 0, PM_REMOVE)) {
63-
TranslateMessage(&msg);
64-
DispatchMessage(&msg);
62+
while (PeekMessage(& msg, NULL, 0, 0, PM_REMOVE)) {
63+
TranslateMessage(& msg);
64+
DispatchMessage(& msg);
6565

6666
if (msg.message == WM_QUIT) {
6767
Platform::shutdown();

src/win/WinBackend.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
#define CMD_SETTINGS 1001
1010
#define CMD_EXIT 1002
1111

12-
1312
static HHOOK keyboardHook = NULL;
1413
static HWND targetWindow = NULL;
1514
static bool locked = false;
@@ -29,15 +28,15 @@ bool & WinHooks_GetTargetFocusFlag ( ) {
2928
}
3029

3130
void WinBackend::init ( ) { // Sets up the keyboard hook.
32-
keyboardHook = SetWindowsHookEx(WH_KEYBOARD_LL,LowLevelKeyboardProc,GetModuleHandle(NULL),0);
31+
keyboardHook = SetWindowsHookEx(WH_KEYBOARD_LL, LowLevelKeyboardProc,GetModuleHandle(NULL),0);
3332
}
3433

3534
void WinBackend::shutdown ( ) { // Removes the hook when closed.
3635
UnhookWindowsHookEx(keyboardHook);
3736
}
3837

3938
void WinBackend::setTargetWindow (WindowHandle w) {
40-
targetWindow = (HWND)w; // Sets the target window.
39+
targetWindow = (HWND) w; // Sets the target window.
4140
}
4241

4342
void WinBackend::lockInput ( ) {

src/win/WinHooks.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
#include <stdio.h>
66
#include <string>
77
#include <algorithm>
8-
98
#include "WinSettings.h"
109

1110
const Keybind targetBind = WinSettings_GetTargetBind();
@@ -47,7 +46,7 @@ bool IsKeybindPressed(const Keybind & bind, KBDLLHOOKSTRUCT * kbd) {
4746
bool shiftDown = (GetAsyncKeyState(VK_SHIFT) & 0x8000) != 0;
4847
bool altDown = (GetAsyncKeyState(VK_MENU) & 0x8000) != 0; // ALT
4948

50-
return (kbd->vkCode == bind.key) && (ctrlDown == bind.ctrl) && (shiftDown == bind.shift) && (altDown == bind.alt);
49+
return (kbd -> vkCode == bind.key) && (ctrlDown == bind.ctrl) && (shiftDown == bind.shift) && (altDown == bind.alt);
5150
}
5251

5352

@@ -62,7 +61,7 @@ LRESULT CALLBACK LowLevelKeyboardProc (int nCode, WPARAM wParam, LPARAM lParam)
6261
auto & locked = WinHooks_GetLockedFlag();
6362
auto & targetHasFocus = WinHooks_GetTargetFocusFlag();
6463

65-
KBDLLHOOKSTRUCT * kbd = (KBDLLHOOKSTRUCT *)lParam;
64+
KBDLLHOOKSTRUCT * kbd = (KBDLLHOOKSTRUCT *) lParam;
6665

6766
if (kbd -> flags & LLKHF_INJECTED) {
6867
return CallNextHookEx(NULL, nCode, wParam, lParam);

src/win/WinSettings.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,5 @@ const Keybind & WinSettings_GetLockBind ( );
1414
const Keybind & WinSettings_GetUnlockBind ( );
1515

1616
void OpenSettingsWindow (HINSTANCE hInstance, HWND parent);
17-
void WinSettings_Init ();
17+
void WinSettings_Init ( );
1818

src/win/WinTray.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ void InitTrayIcon (HWND hwnd) { // Create the system tray icon.
1818
nid.uCallbackMessage = WM_USER + 1;
1919

2020
// Use load image as the icon one doesn't seem to work.
21-
HICON hIcon = (HICON)LoadImage(GetModuleHandle(NULL),MAKEINTRESOURCE(IDI_APP_ICON),IMAGE_ICON,GetSystemMetrics(SM_CXICON),GetSystemMetrics(SM_CYICON),LR_DEFAULTCOLOR);
21+
HICON hIcon = (HICON) LoadImage(GetModuleHandle(NULL),MAKEINTRESOURCE(IDI_APP_ICON),IMAGE_ICON,GetSystemMetrics(SM_CXICON),GetSystemMetrics(SM_CYICON),LR_DEFAULTCOLOR);
2222

2323
nid.hIcon = hIcon;
2424
strncpy_s(nid.szTip, "Split Loaf - Idle", sizeof(nid.szTip));

0 commit comments

Comments
 (0)