-
Notifications
You must be signed in to change notification settings - Fork 3
/
UEditWin.h
257 lines (229 loc) · 8.27 KB
/
UEditWin.h
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
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
#ifndef UEDITWIN_H
#define UEDITWIN_H 1
#include <windows.h>
#include <winnls.h>
#include "CDoUndoManage.h"
#include "UYGString.h"
#include "UMessageBox.h"
#include "UCommon.h"
#include "UBidiLine.h"
#include "ortaq.h"
#define _CLSName TEXT("UEDITWIN")
#define HEADS0 TEXT("<html")
#define HEADS1 TEXT(">\n<head>\n<meta http-equiv=\"Content-Type\" content=\"text/html; charset=")
#define HEADS2 TEXT("\">\n<meta name=\"GENERATOR\" content=\"UyghurEdit By Gheyret T.Kenji\">\n<style type=\"text/css\">\n<!--\np{\n\tfont-size: 120%;\n\tfont-family: Boghda Tuz, UKIJ Nasq, UKIJ Tuz, UKIJ Basma, UKIJ Zilwa, Arial Unicode MS,Tahoma;\n\ttext-align: justify;\n}\n-->\n</style>\n<title>")
#define HEADS3 TEXT("</title>\n</head>\n<body>\n<p>")
enum YEZIQ{NODETC,UEY,ULY,USY,OTY,UMY};
class UEditWin
{
private:
HWND m_hWnd;
HINSTANCE mhInstance;
HWND mhWndParent;
HDC UBeginPaint(LPPAINTSTRUCT ps);
BOOL UEndPaint(LPPAINTSTRUCT ps);
TCHAR m_UFileName[MAX_PATH];
ULONG m_USelPos;
ULONG m_USelS,m_USelE;
CDoUndoManage *m_UnReDO;
BOOL m_Qisturush;
int m_NurKeng;
UINT m_VY;
UINT m_VX;
UNOTIFY m_UNotify;
HFONT m_UUyghurFont; // Ekranda Ishlitiliwatqan Uyghurche Heriplerning
HFONT m_ULocalFont; // Ekranda Ishlitiliwatqan Uyghurchidin bashqisining
int m_UQurIgizligi;
UINT m_BetQurSani;
ULONG m_JemiQurSani;
ULONG m_JemiQurSaniZap;
UINT m_BetKeng;
UINT m_EngKeng;
wchar_t* m_UFirstLine; // Ekranda Korsitilgen birinchi qurning Adresi
UINT m_HazirqiQur; // Nur belgisi Turghan Qur
UINT m_HazirqiHerip; // Nur Belgisi Turghan ston
UINT m_esliQur;
int m_Boshluq; // Ramka girwigidin bashlap heripni korsitidighan boshluq
BOOL m_UTextChanged;
BOOL m_UMouseBesildi;
void UCreateFont();
void USetScroll(void);
UYGString m_UBuffer;
UEDIT m_UEdit;
HBRUSH m_UEkranReng;
HBRUSH m_UTalReng;
wchar_t *m_UCurLine;
HCURSOR m_oldCursor;
HMENU m_UPopMenu;
void UYengiHojjet();
// void UShowInfo(wchar_t *msgKey);
// int UShowAgahlandurush(wchar_t *msgKey,UINT mb);
void UUpdateHorScroll();
void UOnTizishAbzas();
void UOnTizishHemme();
void UChaplaStr(wchar_t *clipData);
int m_SaveCodePage;
BOOL m_BaseCode;
BOOL m_BOM;
void UOnDeleteKey();
void UOnBackspaceKey();
void UOnHomeKey();
void UOnEndKey();
void UOnUpKey();
void UOnDownKey();
void UOnLeftKey();
void UOnRightKey();
void UOnReturnKey();
void UOnPageUpKey();
void UOnPageDownKey();
void UOnToULY();
void UOnToUEY_TXT();
void UOnToUEY_PRG();
void UOnToUEY_INF();
void UOnBesish(LPARAM lp);
void UOnSetFont();
KUNUPKA USetKunupka(KUNUPKA val);
int UGetPoss(wchar_t *line,int *sPos); //Qosh tirnaq bilen qorshalghan tekistni tapidu
int UGetTengPoss(wchar_t *line,int *sPos); //Tenglik Belgisining Ornini we tenglik belgisidin keyinki mezmunning uzunliqini tapidu
int UGetUyghurTizma(wchar_t *line,int *sPos);
void UOnToUyghurLatinInf();
void USozgeParchila(bool qosh);
void USozgeParchila_Tekshurme();
void UAbsazni_Sort();
UMessageBox m_UMsgBox;
IZDESH m_UIzdesh;
void UOnIzdesh();
void UOnIzdeshDawam();
void UIzdesh();
void UAlmashturush();
wchar_t *UUlash(wchar_t *qurBeshi,long qurLen,long *newLen);
char *m_USelSt;
wchar_t *m_UShowLine;
long UMakeShowBuffer(wchar_t *qurBeshi,long qurLen,wchar_t *selS,wchar_t *selE);
unsigned long UGetAsasKod(wchar_t *esliBuf,wchar_t *asasBuf);
void UOutTextCurLine(ULONG lineNum,bool useBidi); // Nur Belgisi Turghan qurni qayta ekrangha yazidu
UBidiLine m_UBidi;
wchar_t* UTizmaTap(wchar_t *curPos, wchar_t *strSrc,QANDAQ qan);
UINT ImlaTekshurushULY(UINT ope);
UINT ImlaTekshurushUEY(UINT ope);
UINT ImlaTekshurushAlahide(UINT ope);
//Bu Eslibuf tiki UEY diki mezmunni, UYghur_XATA.dic ti npaydilinip aptomatik toghrilaydu
void Toghrila(wchar_t *EsliBuf,wchar_t *newBuf);
//Yengidin UyghurEdit ni qozghitidu, (Memorydiki tekistni yengi ramkida korsitidu)
void UNewUyghurEdit();
BOOL UCalSelPos(void);
void MewhumToUyghur(void);
void UAlahide2Latin(void);
void UyghurToMewhum(void);
BOOL UAlahideKodBarmu();
BOOL m_Alahide;
void Alhide2Uyghurwekochur(void);
UINT AptomatikToghrilaAlahide(void);
UINT AptomatikToghrilaULY(void);
UINT AptomatikToghrilaUEY(void);
void UAptomatikToghrila(void);
YEZIQ DetectYeziq(wchar_t *buf);
public:
void UOnImlaTekshur(WPARAM wParam, LPARAM lParam);
UEditWin(HINSTANCE hInstance,HWND par);
~UEditWin();
BOOL UShowWindow(int nCmdShow);
BOOL UUpdateWindow();
void USetFocus();
HWND UCreate();
LRESULT UOnPaint(WPARAM wParam, LPARAM lParam);
LRESULT UOnCreate(WPARAM wParam, LPARAM lParam);
void UOnChar(WPARAM wParam, LPARAM lParam);
void UOnImeChar(WPARAM wParam, LPARAM lParam);
void UOnSize(WPARAM wParam, LPARAM lParam);
BOOL UTuzitildimu();
void UCreateCaret();
void UDestroyCaret();
//Sinaq uchun
void USetText(wchar_t *txt);
void UOnHScroll(UINT nSBCode,int pos);
void UOnVScroll(UINT nSBCode,int pos);
UINT UGetHeripPosFromX(UINT curLine,int x);
UINT UGetXFromHeripPos(wchar_t *pcurLine, int HeripPos);
BOOL UIsEmpty(void);
int UGetHerpKeng(wchar_t Herp , HDC dc);
void UOnImeInput(WPARAM wp,LPARAM lp);
int UGetHeripTizmisiWidth(HDC dc,wchar_t *buf,UINT len);
ULONG UTengshesh(wchar_t *oldBuf,ULONG bufLen,wchar_t *newBuf,ULONG kenglik,ULONG oldOffset);
ULONG UTengsheshAbzas(wchar_t *oldBuf,UINT bufLen,wchar_t *newBuf,UINT kenglik,ULONG oldOffset);
void UBeginWaitCursor();
void UEndWaitCursor();
void UShowCaret();
BOOL UKorundighanEkran(int Type);
void USetImePos();
void UOnLButtonDown(int x,int y);
void UOnLButtonUp(int x, int y);
void UOnMouseMove(int x, int y);
void UOnLDoubleClick(int x, int y);
void UOnRButtonUp(int mx, int my);
void UOnMouseWheel(WPARAM wp,LPARAM lp);
BOOL UOnKeyDown(WPARAM wParam, LPARAM lParam);
BOOL UIsTextSelected(void);
wchar_t *UGetSelectionText(BOOL remove=FALSE);
BOOL UClearSelection(BOOL Delete);
void UAddUnDO(wchar_t *_esli, wchar_t *_yengi);
void UInvalidate();
UINT UTextOutLine(HDC dc,int qur,wchar_t * aLine,int lineLen,wchar_t* talBeshi,wchar_t *talAxiri,bool useBidi);
void USetRTL(BOOL val);
BOOL UBuyruq(WPARAM wParam,LPARAM lParam);
void ULYKunupka(UINT kun);
KUNUPKA UGetKunupka();
void UILangChanged();
ULONG UGetQurSani(wchar_t* Str);
void UOnRedo();
void UOnUndo();
BOOL UCanUndo();
BOOL UCanRedo();
BOOL UIsFileNameEmpty();
BOOL UIsRTL();
wchar_t *UGetFileName();
void USetFileName(wchar_t * filenm);
int USaveFile();
int USaveFileAsHTML(wchar_t *filenm,int CodePage, BOOL baseCode, BOOL bom);
UINTERFACE_LANG UGetInterfaceLang();
void USetInterfaceLang(UINTERFACE_LANG lang);
void USetSaveCodePage(int codePage);
void USetSaveBaseCode(BOOL baseCode);
void USetSaveBOM(BOOL bom);
BOOL UGetSaveBOM();
void UReadFromCodePage(int codePage);
void UOnKochurush();
void USetToClipboard();
void UOnChaplash();
void UOnKesish();
void UOnOchurush();
void UOnToUyghurLatin();
void UOnToUyghurArabic();
void UOnToUyghurSlawiyan();
void UOnSlawiyanToUyghurArabic();
void UOnToTurk();
void UOnTurkToUyghurArabic();
void UOnToUyghurArabic_Program();
void UOnToChong();
void UOnToKichik();
void UOnKochurushAll();
void UOnChaplashBashqa(UINT );
void USetSelPos(ULONG Pos);
ULONG UGetSelPos();
BOOL UAutoQatla();
// Towendikiler Putkul Hojjetni aylanduridu
void UOnUyghurToSlawiyan();
void UOnSlawiyanToUyghur();
void UOnUyghurToTurk();
void UOnTurkToUyghur();
void UAtalghularniTap();
BOOL UAtalghuBarmu(wchar_t *Qur);
void UGeAylandur(UINT buy, YEZIQ yez);
void ToUyghur(BOOL sel, YEZIQ hazir, wchar_t *esliText);
void ToLatin(BOOL sel, YEZIQ hazir, wchar_t *esliText);
void ToSlawiyan(BOOL sel, YEZIQ hazir, wchar_t *esliText);
void ToTurk(BOOL sel, YEZIQ hazir, wchar_t *esliText);
void ToMewhum(BOOL sel, YEZIQ hazir, wchar_t *esliText);
void UDelEnter();
};
#endif