xref: /reactos/base/applications/osk/precomp.h (revision 47f3a4e1)
184e162e6SBișoc George /*
284e162e6SBișoc George  * PROJECT:         ReactOS On-Screen Keyboard
384e162e6SBișoc George  * LICENSE:         GPL - See COPYING in the top level directory
484e162e6SBișoc George  * PURPOSE:         Pre-compiled header
584e162e6SBișoc George  * COPYRIGHT:       Denis ROBERT
6b00ecdcaSGeorge Bișoc  *                  Copyright 2019 George Bișoc (george.bisoc@reactos.org)
784e162e6SBișoc George  */
884e162e6SBișoc George 
984e162e6SBișoc George #ifndef _OSK_PRECOMP_H
1084e162e6SBișoc George #define _OSK_PRECOMP_H
1184e162e6SBișoc George 
1284e162e6SBișoc George /* INCLUDES *******************************************************************/
1384e162e6SBișoc George 
1484e162e6SBișoc George #include <stdio.h>
1584e162e6SBișoc George 
1684e162e6SBișoc George #include <windows.h>
1784e162e6SBișoc George #include <debug.h>
1884e162e6SBișoc George #include "commctrl.h"
19*a1faa1ccSBaruch Rutman #include "strsafe.h"
2084e162e6SBișoc George 
2184e162e6SBișoc George #include "osk_res.h"
2284e162e6SBișoc George 
2384e162e6SBișoc George /* TYPES **********************************************************************/
2484e162e6SBișoc George 
25*a1faa1ccSBaruch Rutman typedef struct _KEY
26*a1faa1ccSBaruch Rutman {
27*a1faa1ccSBaruch Rutman     LPCWSTR name;
28*a1faa1ccSBaruch Rutman     INT_PTR scancode;
29*a1faa1ccSBaruch Rutman     INT x;
30*a1faa1ccSBaruch Rutman     INT y;
31*a1faa1ccSBaruch Rutman     INT cx;
32*a1faa1ccSBaruch Rutman     INT cy;
33*a1faa1ccSBaruch Rutman     INT flags;
34*a1faa1ccSBaruch Rutman     BOOL translate;
35*a1faa1ccSBaruch Rutman } KEY, *PKEY;
36*a1faa1ccSBaruch Rutman 
37*a1faa1ccSBaruch Rutman typedef struct _KEYBOARD_STRUCT
38*a1faa1ccSBaruch Rutman {
39*a1faa1ccSBaruch Rutman     PKEY Keys;
40*a1faa1ccSBaruch Rutman     INT KeyCount;
41*a1faa1ccSBaruch Rutman     SIZE Size;
42*a1faa1ccSBaruch Rutman     POINT LedTextStart;
43*a1faa1ccSBaruch Rutman     SIZE LedTextSize;
44*a1faa1ccSBaruch Rutman     INT LedTextOffset;
45*a1faa1ccSBaruch Rutman     POINT LedStart;
46*a1faa1ccSBaruch Rutman     SIZE LedSize;
47*a1faa1ccSBaruch Rutman     INT LedGap;
48*a1faa1ccSBaruch Rutman } KEYBOARD_STRUCT, *PKEYBOARD_STRUCT;
49*a1faa1ccSBaruch Rutman 
5084e162e6SBișoc George typedef struct
5184e162e6SBișoc George {
5284e162e6SBișoc George     HINSTANCE  hInstance;
5384e162e6SBișoc George     HWND       hMainWnd;
5484e162e6SBișoc George     HBRUSH     hBrushGreenLed;
5584e162e6SBișoc George     UINT_PTR   iTimer;
56*a1faa1ccSBaruch Rutman     PKEYBOARD_STRUCT Keyboard;
57*a1faa1ccSBaruch Rutman     HWND*      hKeys;
58*a1faa1ccSBaruch Rutman     HFONT      hFont;
59*a1faa1ccSBaruch Rutman     WCHAR      szTitle[MAX_PATH];
6084e162e6SBișoc George 
6184e162e6SBișoc George     /* On-Screen Keyboard registry settings */
6284e162e6SBișoc George     BOOL       bShowWarning;
6384e162e6SBișoc George     BOOL       bIsEnhancedKeyboard;
6484e162e6SBișoc George     BOOL       bSoundClick;
6584e162e6SBișoc George     BOOL       bAlwaysOnTop;
6684e162e6SBișoc George     INT        PosX;
6784e162e6SBișoc George     INT        PosY;
68*a1faa1ccSBaruch Rutman     WCHAR      FontFaceName[LF_FACESIZE];
69*a1faa1ccSBaruch Rutman     LONG       FontHeight;
7084e162e6SBișoc George } OSK_GLOBALS;
7184e162e6SBișoc George 
72411a5996SBișoc George typedef struct
73411a5996SBișoc George {
74411a5996SBișoc George     INT vKey;
75411a5996SBișoc George     INT DlgResource;
76411a5996SBișoc George     WORD wScanCode;
77411a5996SBișoc George     BOOL bWasKeyPressed;
78411a5996SBișoc George } OSK_KEYLEDINDICATOR;
79411a5996SBișoc George 
8084e162e6SBișoc George /* PROTOTYPES *****************************************************************/
8184e162e6SBișoc George 
82*a1faa1ccSBaruch Rutman /* keyboard.c */
83*a1faa1ccSBaruch Rutman extern KEYBOARD_STRUCT StandardKeyboard;
84*a1faa1ccSBaruch Rutman extern KEYBOARD_STRUCT EnhancedKeyboard;
85*a1faa1ccSBaruch Rutman 
8684e162e6SBișoc George /* main.c */
8784e162e6SBișoc George int OSK_SetImage(int IdDlgItem, int IdResource);
88*a1faa1ccSBaruch Rutman LRESULT OSK_Create(HWND hwnd);
89*a1faa1ccSBaruch Rutman int OSK_Close(void);
90*a1faa1ccSBaruch Rutman int OSK_Timer(void);
91*a1faa1ccSBaruch Rutman BOOL OSK_Command(WPARAM wCommand, HWND hWndControl);
9284e162e6SBișoc George BOOL OSK_ReleaseKey(WORD ScanCode);
93*a1faa1ccSBaruch Rutman LRESULT APIENTRY OSK_WndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam);
94aea948a7SGeorge Bișoc DWORD WINAPI OSK_WarningDlgThread(LPVOID lpParameter);
9584e162e6SBișoc George int WINAPI wWinMain(HINSTANCE, HINSTANCE, LPWSTR, int);
9684e162e6SBișoc George VOID OSK_RestoreDlgPlacement(HWND hDlg);
97411a5996SBișoc George VOID OSK_RefreshLEDKeys(VOID);
9814ebc0baSBișoc George INT_PTR CALLBACK OSK_WarningProc(HWND hDlg, UINT Msg, WPARAM wParam, LPARAM lParam);
9984e162e6SBișoc George 
10084e162e6SBișoc George /* settings.c */
101*a1faa1ccSBaruch Rutman LONG LoadDWORDFromRegistry(IN LPCWSTR lpValueDataName,
10214ebc0baSBișoc George                            OUT PDWORD pdwValueData);
10314ebc0baSBișoc George 
104*a1faa1ccSBaruch Rutman LONG LoadStringFromRegistry(IN LPCWSTR lpValueDataName,
105*a1faa1ccSBaruch Rutman                             OUT LPWSTR lpValueData,
106*a1faa1ccSBaruch Rutman                             IN OUT LPUINT cchCount);
107*a1faa1ccSBaruch Rutman 
108*a1faa1ccSBaruch Rutman LONG SaveDWORDToRegistry(IN LPCWSTR lpValueDataName,
10914ebc0baSBișoc George                          IN DWORD dwValueData);
11014ebc0baSBișoc George 
111*a1faa1ccSBaruch Rutman LONG SaveStringToRegistry(IN LPCWSTR lpValueDataName,
112*a1faa1ccSBaruch Rutman                           IN LPCWSTR lpValueData,
113*a1faa1ccSBaruch Rutman                           IN UINT cchCount);
114*a1faa1ccSBaruch Rutman 
11514ebc0baSBișoc George VOID LoadSettings(VOID);
11614ebc0baSBișoc George VOID SaveSettings(VOID);
11784e162e6SBișoc George 
11884e162e6SBișoc George /* DEFINES ********************************************************************/
11984e162e6SBișoc George 
120*a1faa1ccSBaruch Rutman #define SCANCODE_MASK 0xFF
121*a1faa1ccSBaruch Rutman 
12284e162e6SBișoc George extern OSK_GLOBALS Globals;
12384e162e6SBișoc George 
124*a1faa1ccSBaruch Rutman #define OSK_CLASS L"OSKMainWindow"
125*a1faa1ccSBaruch Rutman #define DEFAULT_FONTSIZE 15
126*a1faa1ccSBaruch Rutman 
127*a1faa1ccSBaruch Rutman /* OSK_SetKeys reasons */
128*a1faa1ccSBaruch Rutman enum SetKeys_Reason
129*a1faa1ccSBaruch Rutman {
130*a1faa1ccSBaruch Rutman     SETKEYS_INIT,
131*a1faa1ccSBaruch Rutman     SETKEYS_LAYOUT,
132*a1faa1ccSBaruch Rutman     SETKEYS_LANG
133*a1faa1ccSBaruch Rutman };
13484e162e6SBișoc George 
13584e162e6SBișoc George #endif /* _OSK_PRECOMP_H */
13684e162e6SBișoc George 
13784e162e6SBișoc George /* EOF */
138