summaryrefslogtreecommitdiff
path: root/plugins/ChangeKeyboardLayout/src/stdafx.h
blob: ee2cb8bdecaac04ab455f276ff0a640b8856d172 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
#ifndef M_CKL_COMMONHEADERS_H
#define M_CKL_COMMONHEADERS_H

#include <windows.h>
#include <commctrl.h>
#include <richedit.h>

#include <newpluginapi.h>
#include <m_options.h>
#include <m_langpack.h>
#include <m_utils.h>
#include <m_system.h>
#include <m_skin.h>
#include <m_popup.h>
#include <m_utils.h>
#include <m_icolib.h>
#include <win2k.h>

#include <m_ieview.h>
#include <m_changekeyboardlayout.h>

#include "resource.h"
#include "options.h"
#include "hook_events.h"
#include "text_operations.h"
#include "version.h"

#define MaxTextSize 64000
#define MODULENAME  LPGEN("ChangeKeyboardLayout")
#define ModuleNameW LPGENW("ChangeKeyboardLayout")

struct CMPlugin : public PLUGIN<CMPlugin>
{
	HKL hklEng = (HKL)0x04090409;

	CMPlugin();

	int Load() override;
	int Unload() override;
};

// History++ API
#define MS_HPP_EG_WINDOW			"History++/ExtGrid/NewWindow"
#define MS_HPP_EG_EVENT				"History++/ExtGrid/Event"
#define MS_HPP_EG_NAVIGATE			"History++/ExtGrid/Navigate"
#define MS_HPP_EG_OPTIONSCHANGED	"History++/ExtGrid/OptionsChanged"

// Типы окон
#define WTYPE_Unknown		0
#define WTYPE_HistoryPP		1
#define WTYPE_IEView		2
#define WTYPE_RichEdit		3
#define WTYPE_Edit			4

//Тип операции над текстом
#define TOT_Layout 0
#define TOT_Case 1

// Имена звуков
#define SND_ChangeLayout "ChangingLayout"
#define SND_ChangeCase   "ChangingCase"

//Цвета попапов
#define PPC_POPUP		0
#define PPC_WINDOWS		1
#define PPC_CUSTOM		2

//Таймаут попапов
#define PPT_POPUP			0
#define PPT_PERMANENT		1
#define PPT_CUSTOM			2


typedef struct  
{
	DWORD dwHotkey_Layout;
	DWORD dwHotkey_Layout2;
	DWORD dwHotkey_Case;
	BOOL CurrentWordLayout;
	BOOL CurrentWordLayout2;
	BOOL CurrentWordCase;
	BOOL TwoWay;
	BOOL ChangeSystemLayout;
	BOOL CopyToClipboard;
	BOOL ShowPopup;
	BYTE bCaseOperations;
} MainOptions;

typedef struct  
{
	BYTE bColourType;
	COLORREF crTextColour;
	COLORREF crBackColour;
	BYTE bTimeoutType;
	BYTE bTimeout;
	BYTE bLeftClick;
	BYTE bRightClick;
	POPUPACTION paActions[1];
} PopupOptions;

extern HICON hPopupIcon, hCopyIcon;

extern int bLayNum;
extern HKL hklLayouts[20];
extern wchar_t *ptszLayStrings[20];

extern LPCTSTR ptszSeparators;

extern HHOOK kbHook_All;

extern MainOptions moOptions;
extern PopupOptions poOptions;

LRESULT CALLBACK Keyboard_Hook(int code, WPARAM wParam, LPARAM lParam);
int OnIconsChanged(WPARAM wParam, LPARAM lParam);

#endif