2019-07-16 15:35:30 +00:00
|
|
|
/*
|
|
|
|
* PROJECT: ReactOS On-Screen Keyboard
|
|
|
|
* LICENSE: GPL - See COPYING in the top level directory
|
|
|
|
* PURPOSE: Pre-compiled header
|
|
|
|
* COPYRIGHT: Denis ROBERT
|
2021-02-22 15:26:55 +00:00
|
|
|
* Copyright 2019 George Bișoc (george.bisoc@reactos.org)
|
2019-07-16 15:35:30 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef _OSK_PRECOMP_H
|
|
|
|
#define _OSK_PRECOMP_H
|
|
|
|
|
|
|
|
/* INCLUDES *******************************************************************/
|
|
|
|
|
|
|
|
#include <stdio.h>
|
|
|
|
|
|
|
|
#include <windows.h>
|
|
|
|
#include <debug.h>
|
|
|
|
#include "commctrl.h"
|
2021-08-11 19:36:30 +00:00
|
|
|
#include "strsafe.h"
|
2019-07-16 15:35:30 +00:00
|
|
|
|
|
|
|
#include "osk_res.h"
|
|
|
|
|
|
|
|
/* TYPES **********************************************************************/
|
|
|
|
|
2021-08-11 19:36:30 +00:00
|
|
|
typedef struct _KEY
|
|
|
|
{
|
|
|
|
LPCWSTR name;
|
|
|
|
INT_PTR scancode;
|
|
|
|
INT x;
|
|
|
|
INT y;
|
|
|
|
INT cx;
|
|
|
|
INT cy;
|
|
|
|
INT flags;
|
|
|
|
BOOL translate;
|
|
|
|
} KEY, *PKEY;
|
|
|
|
|
|
|
|
typedef struct _KEYBOARD_STRUCT
|
|
|
|
{
|
|
|
|
PKEY Keys;
|
|
|
|
INT KeyCount;
|
|
|
|
SIZE Size;
|
|
|
|
POINT LedTextStart;
|
|
|
|
SIZE LedTextSize;
|
|
|
|
INT LedTextOffset;
|
|
|
|
POINT LedStart;
|
|
|
|
SIZE LedSize;
|
|
|
|
INT LedGap;
|
|
|
|
} KEYBOARD_STRUCT, *PKEYBOARD_STRUCT;
|
|
|
|
|
2019-07-16 15:35:30 +00:00
|
|
|
typedef struct
|
|
|
|
{
|
|
|
|
HINSTANCE hInstance;
|
|
|
|
HWND hMainWnd;
|
|
|
|
HBRUSH hBrushGreenLed;
|
|
|
|
UINT_PTR iTimer;
|
2021-08-11 19:36:30 +00:00
|
|
|
PKEYBOARD_STRUCT Keyboard;
|
|
|
|
HWND* hKeys;
|
|
|
|
HFONT hFont;
|
|
|
|
WCHAR szTitle[MAX_PATH];
|
2019-07-16 15:35:30 +00:00
|
|
|
|
|
|
|
/* On-Screen Keyboard registry settings */
|
|
|
|
BOOL bShowWarning;
|
|
|
|
BOOL bIsEnhancedKeyboard;
|
|
|
|
BOOL bSoundClick;
|
|
|
|
BOOL bAlwaysOnTop;
|
|
|
|
INT PosX;
|
|
|
|
INT PosY;
|
2021-08-11 19:36:30 +00:00
|
|
|
WCHAR FontFaceName[LF_FACESIZE];
|
|
|
|
LONG FontHeight;
|
2019-07-16 15:35:30 +00:00
|
|
|
} OSK_GLOBALS;
|
|
|
|
|
2019-11-18 20:24:45 +00:00
|
|
|
typedef struct
|
|
|
|
{
|
|
|
|
INT vKey;
|
|
|
|
INT DlgResource;
|
|
|
|
WORD wScanCode;
|
|
|
|
BOOL bWasKeyPressed;
|
|
|
|
} OSK_KEYLEDINDICATOR;
|
|
|
|
|
2019-07-16 15:35:30 +00:00
|
|
|
/* PROTOTYPES *****************************************************************/
|
|
|
|
|
2021-08-11 19:36:30 +00:00
|
|
|
/* keyboard.c */
|
|
|
|
extern KEYBOARD_STRUCT StandardKeyboard;
|
|
|
|
extern KEYBOARD_STRUCT EnhancedKeyboard;
|
|
|
|
|
2019-07-16 15:35:30 +00:00
|
|
|
/* main.c */
|
|
|
|
int OSK_SetImage(int IdDlgItem, int IdResource);
|
2021-08-11 19:36:30 +00:00
|
|
|
LRESULT OSK_Create(HWND hwnd);
|
|
|
|
int OSK_Close(void);
|
|
|
|
int OSK_Timer(void);
|
|
|
|
BOOL OSK_Command(WPARAM wCommand, HWND hWndControl);
|
2019-07-16 15:35:30 +00:00
|
|
|
BOOL OSK_ReleaseKey(WORD ScanCode);
|
2021-08-11 19:36:30 +00:00
|
|
|
LRESULT APIENTRY OSK_WndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam);
|
2020-05-04 10:06:22 +00:00
|
|
|
DWORD WINAPI OSK_WarningDlgThread(LPVOID lpParameter);
|
2019-07-16 15:35:30 +00:00
|
|
|
int WINAPI wWinMain(HINSTANCE, HINSTANCE, LPWSTR, int);
|
|
|
|
VOID OSK_RestoreDlgPlacement(HWND hDlg);
|
2019-11-18 20:24:45 +00:00
|
|
|
VOID OSK_RefreshLEDKeys(VOID);
|
2019-12-11 23:25:55 +00:00
|
|
|
INT_PTR CALLBACK OSK_WarningProc(HWND hDlg, UINT Msg, WPARAM wParam, LPARAM lParam);
|
2019-07-16 15:35:30 +00:00
|
|
|
|
|
|
|
/* settings.c */
|
2021-08-11 19:36:30 +00:00
|
|
|
LONG LoadDWORDFromRegistry(IN LPCWSTR lpValueDataName,
|
|
|
|
OUT PDWORD pdwValueData);
|
|
|
|
|
|
|
|
LONG LoadStringFromRegistry(IN LPCWSTR lpValueDataName,
|
|
|
|
OUT LPWSTR lpValueData,
|
|
|
|
IN OUT LPUINT cchCount);
|
2019-12-11 23:25:55 +00:00
|
|
|
|
2021-08-11 19:36:30 +00:00
|
|
|
LONG SaveDWORDToRegistry(IN LPCWSTR lpValueDataName,
|
|
|
|
IN DWORD dwValueData);
|
|
|
|
|
|
|
|
LONG SaveStringToRegistry(IN LPCWSTR lpValueDataName,
|
|
|
|
IN LPCWSTR lpValueData,
|
|
|
|
IN UINT cchCount);
|
2019-12-11 23:25:55 +00:00
|
|
|
|
|
|
|
VOID LoadSettings(VOID);
|
|
|
|
VOID SaveSettings(VOID);
|
2019-07-16 15:35:30 +00:00
|
|
|
|
|
|
|
/* DEFINES ********************************************************************/
|
|
|
|
|
2021-08-11 19:36:30 +00:00
|
|
|
#define SCANCODE_MASK 0xFF
|
|
|
|
|
2019-07-16 15:35:30 +00:00
|
|
|
extern OSK_GLOBALS Globals;
|
|
|
|
|
2021-08-11 19:36:30 +00:00
|
|
|
#define OSK_CLASS L"OSKMainWindow"
|
|
|
|
#define DEFAULT_FONTSIZE 15
|
|
|
|
|
|
|
|
/* OSK_SetKeys reasons */
|
|
|
|
enum SetKeys_Reason
|
|
|
|
{
|
|
|
|
SETKEYS_INIT,
|
|
|
|
SETKEYS_LAYOUT,
|
|
|
|
SETKEYS_LANG
|
|
|
|
};
|
2019-07-16 15:35:30 +00:00
|
|
|
|
|
|
|
#endif /* _OSK_PRECOMP_H */
|
|
|
|
|
|
|
|
/* EOF */
|