go-tg-screenshot-bot

Форк
0
1273 строки · 37.8 Кб
1
// Copyright 2010 The win Authors. All rights reserved.
2
// Use of this source code is governed by a BSD-style
3
// license that can be found in the LICENSE file.
4

5
// +build windows
6

7
package win
8

9
const (
10
	// NOTE:  MSFTEDIT.DLL only registers MSFTEDIT_CLASS.  If an application wants
11
	// to use the following RichEdit classes, it needs to load riched20.dll.
12
	// Otherwise, CreateWindow with RICHEDIT_CLASS will fail.
13
	// This also applies to any dialog that uses RICHEDIT_CLASS
14
	// RichEdit 2.0 Window Class
15
	MSFTEDIT_CLASS = "RICHEDIT50W"
16
	RICHEDIT_CLASS = "RichEdit20W"
17
)
18

19
// RichEdit messages
20
const (
21
	EM_CANPASTE           = WM_USER + 50
22
	EM_DISPLAYBAND        = WM_USER + 51
23
	EM_EXGETSEL           = WM_USER + 52
24
	EM_EXLIMITTEXT        = WM_USER + 53
25
	EM_EXLINEFROMCHAR     = WM_USER + 54
26
	EM_EXSETSEL           = WM_USER + 55
27
	EM_FINDTEXT           = WM_USER + 56
28
	EM_FORMATRANGE        = WM_USER + 57
29
	EM_GETCHARFORMAT      = WM_USER + 58
30
	EM_GETEVENTMASK       = WM_USER + 59
31
	EM_GETOLEINTERFACE    = WM_USER + 60
32
	EM_GETPARAFORMAT      = WM_USER + 61
33
	EM_GETSELTEXT         = WM_USER + 62
34
	EM_HIDESELECTION      = WM_USER + 63
35
	EM_PASTESPECIAL       = WM_USER + 64
36
	EM_REQUESTRESIZE      = WM_USER + 65
37
	EM_SELECTIONTYPE      = WM_USER + 66
38
	EM_SETBKGNDCOLOR      = WM_USER + 67
39
	EM_SETCHARFORMAT      = WM_USER + 68
40
	EM_SETEVENTMASK       = WM_USER + 69
41
	EM_SETOLECALLBACK     = WM_USER + 70
42
	EM_SETPARAFORMAT      = WM_USER + 71
43
	EM_SETTARGETDEVICE    = WM_USER + 72
44
	EM_STREAMIN           = WM_USER + 73
45
	EM_STREAMOUT          = WM_USER + 74
46
	EM_GETTEXTRANGE       = WM_USER + 75
47
	EM_FINDWORDBREAK      = WM_USER + 76
48
	EM_SETOPTIONS         = WM_USER + 77
49
	EM_GETOPTIONS         = WM_USER + 78
50
	EM_FINDTEXTEX         = WM_USER + 79
51
	EM_GETWORDBREAKPROCEX = WM_USER + 80
52
	EM_SETWORDBREAKPROCEX = WM_USER + 81
53
)
54

55
// RichEdit 2.0 messages
56
const (
57
	EM_SETUNDOLIMIT    = WM_USER + 82
58
	EM_REDO            = WM_USER + 84
59
	EM_CANREDO         = WM_USER + 85
60
	EM_GETUNDONAME     = WM_USER + 86
61
	EM_GETREDONAME     = WM_USER + 87
62
	EM_STOPGROUPTYPING = WM_USER + 88
63

64
	EM_SETTEXTMODE = WM_USER + 89
65
	EM_GETTEXTMODE = WM_USER + 90
66
)
67

68
type TEXTMODE int32
69

70
const (
71
	TM_PLAINTEXT       TEXTMODE = 1
72
	TM_RICHTEXT                 = 2 // Default behavior
73
	TM_SINGLELEVELUNDO          = 4
74
	TM_MULTILEVELUNDO           = 8 // Default behavior
75
	TM_SINGLECODEPAGE           = 16
76
	TM_MULTICODEPAGE            = 32 // Default behavior
77
)
78

79
const (
80
	EM_AUTOURLDETECT = WM_USER + 91
81
)
82

83
// RichEdit 8.0 messages
84
const (
85
	AURL_ENABLEURL          = 1
86
	AURL_ENABLEEMAILADDR    = 2
87
	AURL_ENABLETELNO        = 4
88
	AURL_ENABLEEAURLS       = 8
89
	AURL_ENABLEDRIVELETTERS = 16
90
	AURL_DISABLEMIXEDLGC    = 32 // Disable mixed Latin Greek Cyrillic IDNs
91
)
92

93
const (
94
	EM_GETAUTOURLDETECT = WM_USER + 92
95
	EM_SETPALETTE       = WM_USER + 93
96
	EM_GETTEXTEX        = WM_USER + 94
97
	EM_GETTEXTLENGTHEX  = WM_USER + 95
98
	EM_SHOWSCROLLBAR    = WM_USER + 96
99
	EM_SETTEXTEX        = WM_USER + 97
100
)
101

102
// East Asia specific messages
103
const (
104
	EM_SETPUNCTUATION  = WM_USER + 100
105
	EM_GETPUNCTUATION  = WM_USER + 101
106
	EM_SETWORDWRAPMODE = WM_USER + 102
107
	EM_GETWORDWRAPMODE = WM_USER + 103
108
	EM_SETIMECOLOR     = WM_USER + 104
109
	EM_GETIMECOLOR     = WM_USER + 105
110
	EM_SETIMEOPTIONS   = WM_USER + 106
111
	EM_GETIMEOPTIONS   = WM_USER + 107
112
	EM_CONVPOSITION    = WM_USER + 108
113
)
114

115
const (
116
	EM_SETLANGOPTIONS = WM_USER + 120
117
	EM_GETLANGOPTIONS = WM_USER + 121
118
	EM_GETIMECOMPMODE = WM_USER + 122
119

120
	EM_FINDTEXTW   = WM_USER + 123
121
	EM_FINDTEXTEXW = WM_USER + 124
122
)
123

124
// RE3.0 FE messages
125
const (
126
	EM_RECONVERSION   = WM_USER + 125
127
	EM_SETIMEMODEBIAS = WM_USER + 126
128
	EM_GETIMEMODEBIAS = WM_USER + 127
129
)
130

131
// BiDi specific messages
132
const (
133
	EM_SETBIDIOPTIONS = WM_USER + 200
134
	EM_GETBIDIOPTIONS = WM_USER + 201
135

136
	EM_SETTYPOGRAPHYOPTIONS = WM_USER + 202
137
	EM_GETTYPOGRAPHYOPTIONS = WM_USER + 203
138
)
139

140
// Extended edit style specific messages
141
const (
142
	EM_SETEDITSTYLE = WM_USER + 204
143
	EM_GETEDITSTYLE = WM_USER + 205
144
)
145

146
// Extended edit style masks
147
const (
148
	SES_EMULATESYSEDIT    = 1
149
	SES_BEEPONMAXTEXT     = 2
150
	SES_EXTENDBACKCOLOR   = 4
151
	SES_MAPCPS            = 8 // Obsolete (never used)
152
	SES_HYPERLINKTOOLTIPS = 8
153
	SES_EMULATE10         = 16 // Obsolete (never used)
154
	SES_DEFAULTLATINLIGA  = 16
155
	SES_USECRLF           = 32 // Obsolete (never used)
156
	SES_NOFOCUSLINKNOTIFY = 32
157
	SES_USEAIMM           = 64
158
	SES_NOIME             = 128
159

160
	SES_ALLOWBEEPS         = 256
161
	SES_UPPERCASE          = 512
162
	SES_LOWERCASE          = 1024
163
	SES_NOINPUTSEQUENCECHK = 2048
164
	SES_BIDI               = 4096
165
	SES_SCROLLONKILLFOCUS  = 8192
166
	SES_XLTCRCRLFTOCR      = 16384
167
	SES_DRAFTMODE          = 32768
168

169
	SES_USECTF               = 0x00010000
170
	SES_HIDEGRIDLINES        = 0x00020000
171
	SES_USEATFONT            = 0x00040000
172
	SES_CUSTOMLOOK           = 0x00080000
173
	SES_LBSCROLLNOTIFY       = 0x00100000
174
	SES_CTFALLOWEMBED        = 0x00200000
175
	SES_CTFALLOWSMARTTAG     = 0x00400000
176
	SES_CTFALLOWPROOFING     = 0x00800000
177
	SES_LOGICALCARET         = 0x01000000
178
	SES_WORDDRAGDROP         = 0x02000000
179
	SES_SMARTDRAGDROP        = 0x04000000
180
	SES_MULTISELECT          = 0x08000000
181
	SES_CTFNOLOCK            = 0x10000000
182
	SES_NOEALINEHEIGHTADJUST = 0x20000000
183
	SES_MAX                  = 0x20000000
184
)
185

186
// Options for EM_SETLANGOPTIONS and EM_GETLANGOPTIONS
187
const (
188
	IMF_AUTOKEYBOARD        = 0x0001
189
	IMF_AUTOFONT            = 0x0002
190
	IMF_IMECANCELCOMPLETE   = 0x0004 // High completes comp string when aborting, low cancels
191
	IMF_IMEALWAYSSENDNOTIFY = 0x0008
192
	IMF_AUTOFONTSIZEADJUST  = 0x0010
193
	IMF_UIFONTS             = 0x0020
194
	IMF_NOIMPLICITLANG      = 0x0040
195
	IMF_DUALFONT            = 0x0080
196
	IMF_NOKBDLIDFIXUP       = 0x0200
197
	IMF_NORTFFONTSUBSTITUTE = 0x0400
198
	IMF_SPELLCHECKING       = 0x0800
199
	IMF_TKBPREDICTION       = 0x1000
200
	IMF_IMEUIINTEGRATION    = 0x2000
201
)
202

203
// Values for EM_GETIMECOMPMODE
204
const (
205
	ICM_NOTOPEN    = 0x0000
206
	ICM_LEVEL3     = 0x0001
207
	ICM_LEVEL2     = 0x0002
208
	ICM_LEVEL2_5   = 0x0003
209
	ICM_LEVEL2_SUI = 0x0004
210
	ICM_CTF        = 0x0005
211
)
212

213
// Options for EM_SETTYPOGRAPHYOPTIONS
214
const (
215
	TO_ADVANCEDTYPOGRAPHY   = 0x0001
216
	TO_SIMPLELINEBREAK      = 0x0002
217
	TO_DISABLECUSTOMTEXTOUT = 0x0004
218
	TO_ADVANCEDLAYOUT       = 0x0008
219
)
220

221
// Pegasus outline mode messages (RE 3.0)
222
const (
223
	// Outline mode message
224
	EM_OUTLINE = WM_USER + 220
225

226
	// Message for getting and restoring scroll pos
227
	EM_GETSCROLLPOS = WM_USER + 221
228
	EM_SETSCROLLPOS = WM_USER + 222
229

230
	// Change fontsize in current selection by wParam
231
	EM_SETFONTSIZE = WM_USER + 223
232
	EM_GETZOOM     = WM_USER + 224
233
	EM_SETZOOM     = WM_USER + 225
234
	EM_GETVIEWKIND = WM_USER + 226
235
	EM_SETVIEWKIND = WM_USER + 227
236
)
237

238
// RichEdit 4.0 messages
239
const (
240
	EM_GETPAGE          = WM_USER + 228
241
	EM_SETPAGE          = WM_USER + 229
242
	EM_GETHYPHENATEINFO = WM_USER + 230
243
	EM_SETHYPHENATEINFO = WM_USER + 231
244

245
	EM_GETPAGEROTATE    = WM_USER + 235
246
	EM_SETPAGEROTATE    = WM_USER + 236
247
	EM_GETCTFMODEBIAS   = WM_USER + 237
248
	EM_SETCTFMODEBIAS   = WM_USER + 238
249
	EM_GETCTFOPENSTATUS = WM_USER + 240
250
	EM_SETCTFOPENSTATUS = WM_USER + 241
251
	EM_GETIMECOMPTEXT   = WM_USER + 242
252
	EM_ISIME            = WM_USER + 243
253
	EM_GETIMEPROPERTY   = WM_USER + 244
254
)
255

256
// These messages control what rich edit does when it comes accross
257
// OLE objects during RTF stream in.  Normally rich edit queries the client
258
// application only after OleLoad has been called.  With these messages it is possible to
259
// set the rich edit control to a mode where it will query the client application before
260
// OleLoad is called
261
const (
262
	EM_GETQUERYRTFOBJ = WM_USER + 269
263
	EM_SETQUERYRTFOBJ = WM_USER + 270
264
)
265

266
// EM_SETPAGEROTATE wparam values
267
const (
268
	EPR_0   = 0 // Text flows left to right and top to bottom
269
	EPR_270 = 1 // Text flows top to bottom and right to left
270
	EPR_180 = 2 // Text flows right to left and bottom to top
271
	EPR_90  = 3 // Text flows bottom to top and left to right
272
	EPR_SE  = 5 // Text flows top to bottom and left to right (Mongolian text layout)
273
)
274

275
// EM_SETCTFMODEBIAS wparam values
276
const (
277
	CTFMODEBIAS_DEFAULT               = 0x0000
278
	CTFMODEBIAS_FILENAME              = 0x0001
279
	CTFMODEBIAS_NAME                  = 0x0002
280
	CTFMODEBIAS_READING               = 0x0003
281
	CTFMODEBIAS_DATETIME              = 0x0004
282
	CTFMODEBIAS_CONVERSATION          = 0x0005
283
	CTFMODEBIAS_NUMERIC               = 0x0006
284
	CTFMODEBIAS_HIRAGANA              = 0x0007
285
	CTFMODEBIAS_KATAKANA              = 0x0008
286
	CTFMODEBIAS_HANGUL                = 0x0009
287
	CTFMODEBIAS_HALFWIDTHKATAKANA     = 0x000A
288
	CTFMODEBIAS_FULLWIDTHALPHANUMERIC = 0x000B
289
	CTFMODEBIAS_HALFWIDTHALPHANUMERIC = 0x000C
290
)
291

292
// EM_SETIMEMODEBIAS lparam values
293
const (
294
	IMF_SMODE_PLAURALCLAUSE = 0x0001
295
	IMF_SMODE_NONE          = 0x0002
296
)
297

298
// EM_GETIMECOMPTEXT wparam structure
299
type IMECOMPTEXT struct {
300
	// count of bytes in the output buffer.
301
	Cb int32
302

303
	// value specifying the composition string type.
304
	//	Currently only support ICT_RESULTREADSTR
305
	Flags uint32
306
}
307

308
const ICT_RESULTREADSTR = 1
309

310
// Outline mode wparam values
311
const (
312
	// Enter normal mode,  lparam ignored
313
	EMO_EXIT = 0
314

315
	// Enter outline mode, lparam ignored
316
	EMO_ENTER = 1
317

318
	// LOWORD(lparam) == 0 ==>
319
	//	promote  to body-text
320
	// LOWORD(lparam) != 0 ==>
321
	//	promote/demote current selection
322
	//	by indicated number of levels
323
	EMO_PROMOTE = 2
324

325
	// HIWORD(lparam) = EMO_EXPANDSELECTION
326
	//	-> expands selection to level
327
	//	indicated in LOWORD(lparam)
328
	//	LOWORD(lparam) = -1/+1 corresponds
329
	//	to collapse/expand button presses
330
	//	in winword (other values are
331
	//	equivalent to having pressed these
332
	//	buttons more than once)
333
	//	HIWORD(lparam) = EMO_EXPANDDOCUMENT
334
	//	-> expands whole document to
335
	//	indicated level
336
	EMO_EXPAND = 3
337

338
	// LOWORD(lparam) != 0 -> move current
339
	//	selection up/down by indicated amount
340
	EMO_MOVESELECTION = 4
341

342
	// Returns VM_NORMAL or VM_OUTLINE
343
	EMO_GETVIEWMODE = 5
344
)
345

346
// EMO_EXPAND options
347
const (
348
	EMO_EXPANDSELECTION = 0
349
	EMO_EXPANDDOCUMENT  = 1
350
)
351

352
const (
353
	// Agrees with RTF \viewkindN
354
	VM_NORMAL = 4
355

356
	VM_OUTLINE = 2
357

358
	// Screen page view (not print layout)
359
	VM_PAGE = 9
360
)
361

362
// New messages as of Win8
363
const (
364
	EM_INSERTTABLE = WM_USER + 232
365
)
366

367
// Data type defining table rows for EM_INSERTTABLE
368
// Note: The Richedit.h is completely #pragma pack(4)-ed
369
type TABLEROWPARMS struct { // EM_INSERTTABLE wparam is a (TABLEROWPARMS *)
370
	CbRow        uint32 // Count of bytes in this structure
371
	CbCell       uint32 // Count of bytes in TABLECELLPARMS
372
	CCell        uint32 // Count of cells
373
	CRow         uint32 // Count of rows
374
	DxCellMargin int32  // Cell left/right margin (\trgaph)
375
	DxIndent     int32  // Row left (right if fRTL indent (similar to \trleft)
376
	DyHeight     int32  // Row height (\trrh)
377

378
	// nAlignment:3   Row alignment (like PARAFORMAT::bAlignment, \trql, trqr, \trqc)
379
	// fRTL:1         Display cells in RTL order (\rtlrow)
380
	// fKeep:1        Keep row together (\trkeep}
381
	// fKeepFollow:1  Keep row on same page as following row (\trkeepfollow)
382
	// fWrap:1        Wrap text to right/left (depending on bAlignment) (see \tdfrmtxtLeftN, \tdfrmtxtRightN)
383
	// fIdentCells:1  lparam points at single struct valid for all cells
384
	Flags uint32
385

386
	CpStartRow  int32  // cp where to insert table (-1 for selection cp) (can be used for either TRD by EM_GETTABLEPARMS)
387
	BTableLevel uint32 // Table nesting level (EM_GETTABLEPARMS only)
388
	ICell       uint32 // Index of cell to insert/delete (EM_SETTABLEPARMS only)
389
}
390

391
// Data type defining table cells for EM_INSERTTABLE
392
// Note: The Richedit.h is completely #pragma pack(4)-ed
393
type TABLECELLPARMS struct { // EM_INSERTTABLE lparam is a (TABLECELLPARMS *)
394
	DxWidth int32 // Cell width (\cellx)
395

396
	// nVertAlign:2   Vertical alignment (0/1/2 = top/center/bottom \clvertalt (def), \clvertalc, \clvertalb)
397
	// fMergeTop:1    Top cell for vertical merge (\clvmgf)
398
	// fMergePrev:1   Merge with cell above (\clvmrg)
399
	// fVertical:1    Display text top to bottom, right to left (\cltxtbrlv)
400
	// fMergeStart:1  Start set of horizontally merged cells (\clmgf)
401
	// fMergeCont:1   Merge with previous cell (\clmrg)
402
	Flags uint32
403

404
	WShading uint32 // Shading in .01%		(\clshdng) e.g., 10000 flips fore/back
405

406
	DxBrdrLeft   int32 // Left border width	(\clbrdrl\brdrwN) (in twips)
407
	DyBrdrTop    int32 // Top border width 	(\clbrdrt\brdrwN)
408
	DxBrdrRight  int32 // Right border width	(\clbrdrr\brdrwN)
409
	DyBrdrBottom int32 // Bottom border width	(\clbrdrb\brdrwN)
410

411
	CrBrdrLeft   COLORREF // Left border color	(\clbrdrl\brdrcf)
412
	CrBrdrTop    COLORREF // Top border color 	(\clbrdrt\brdrcf)
413
	CrBrdrRight  COLORREF // Right border color	(\clbrdrr\brdrcf)
414
	CrBrdrBottom COLORREF // Bottom border color	(\clbrdrb\brdrcf)
415
	CrBackPat    COLORREF // Background color 	(\clcbpat)
416
	CrForePat    COLORREF // Foreground color 	(\clcfpat)
417
}
418

419
const (
420
	EM_GETAUTOCORRECTPROC  = WM_USER + 233
421
	EM_SETAUTOCORRECTPROC  = WM_USER + 234
422
	EM_CALLAUTOCORRECTPROC = WM_USER + 255
423
)
424

425
// AutoCorrect callback
426
type AutoCorrectProc func(langid LANGID, pszBefore *uint16, pszAfter *uint16, cchAfter int32, pcchReplaced *int32) int
427

428
const (
429
	ATP_NOCHANGE       = 0
430
	ATP_CHANGE         = 1
431
	ATP_NODELIMITER    = 2
432
	ATP_REPLACEALLTEXT = 4
433
)
434

435
const (
436
	EM_GETTABLEPARMS = WM_USER + 265
437

438
	EM_SETEDITSTYLEEX = WM_USER + 275
439
	EM_GETEDITSTYLEEX = WM_USER + 276
440
)
441

442
// wparam values for EM_SETEDITSTYLEEX/EM_GETEDITSTYLEEX
443
// All unused bits are reserved.
444
const (
445
	SES_EX_NOTABLE            = 0x00000004
446
	SES_EX_NOMATH             = 0x00000040
447
	SES_EX_HANDLEFRIENDLYURL  = 0x00000100
448
	SES_EX_NOTHEMING          = 0x00080000
449
	SES_EX_NOACETATESELECTION = 0x00100000
450
	SES_EX_USESINGLELINE      = 0x00200000
451
	SES_EX_MULTITOUCH         = 0x08000000 // Only works under Win8+
452
	SES_EX_HIDETEMPFORMAT     = 0x10000000
453
	SES_EX_USEMOUSEWPARAM     = 0x20000000 // Use wParam when handling WM_MOUSEMOVE message and do not call GetAsyncKeyState
454
)
455

456
const (
457
	EM_GETSTORYTYPE = WM_USER + 290
458
	EM_SETSTORYTYPE = WM_USER + 291
459

460
	EM_GETELLIPSISMODE = WM_USER + 305
461
	EM_SETELLIPSISMODE = WM_USER + 306
462
)
463

464
// uint32: *lparam for EM_GETELLIPSISMODE, lparam for EM_SETELLIPSISMODE
465
const (
466
	ELLIPSIS_MASK = 0x00000003 // all meaningful bits
467
	ELLIPSIS_NONE = 0x00000000 // ellipsis disabled
468
	ELLIPSIS_END  = 0x00000001 // ellipsis at the end (forced break)
469
	ELLIPSIS_WORD = 0x00000003 // ellipsis at the end (word break)
470
)
471

472
const (
473
	EM_SETTABLEPARMS = WM_USER + 307
474

475
	EM_GETTOUCHOPTIONS  = WM_USER + 310
476
	EM_SETTOUCHOPTIONS  = WM_USER + 311
477
	EM_INSERTIMAGE      = WM_USER + 314
478
	EM_SETUIANAME       = WM_USER + 320
479
	EM_GETELLIPSISSTATE = WM_USER + 322
480
)
481

482
// Values for EM_SETTOUCHOPTIONS/EM_GETTOUCHOPTIONS
483
const (
484
	RTO_SHOWHANDLES    = 1
485
	RTO_DISABLEHANDLES = 2
486
	RTO_READINGMODE    = 3
487
)
488

489
// lparam for EM_INSERTIMAGE
490
type RICHEDIT_IMAGE_PARAMETERS struct {
491
	XWidth            int32 // Units are HIMETRIC
492
	YHeight           int32 // Units are HIMETRIC
493
	Ascent            int32 // Units are HIMETRIC
494
	Type              int32 // Valid values are TA_TOP, TA_BOTTOM and TA_BASELINE
495
	PwszAlternateText *uint16
496
	PIStream          uintptr
497
}
498

499
// New notifications
500
const (
501
	EN_MSGFILTER         = 0x0700
502
	EN_REQUESTRESIZE     = 0x0701
503
	EN_SELCHANGE         = 0x0702
504
	EN_DROPFILES         = 0x0703
505
	EN_PROTECTED         = 0x0704
506
	EN_CORRECTTEXT       = 0x0705 // PenWin specific
507
	EN_STOPNOUNDO        = 0x0706
508
	EN_IMECHANGE         = 0x0707 // East Asia specific
509
	EN_SAVECLIPBOARD     = 0x0708
510
	EN_OLEOPFAILED       = 0x0709
511
	EN_OBJECTPOSITIONS   = 0x070a
512
	EN_LINK              = 0x070b
513
	EN_DRAGDROPDONE      = 0x070c
514
	EN_PARAGRAPHEXPANDED = 0x070d
515
	EN_PAGECHANGE        = 0x070e
516
	EN_LOWFIRTF          = 0x070f
517
	EN_ALIGNLTR          = 0x0710 // BiDi specific notification
518
	EN_ALIGNRTL          = 0x0711 // BiDi specific notification
519
	EN_CLIPFORMAT        = 0x0712
520
	EN_STARTCOMPOSITION  = 0x0713
521
	EN_ENDCOMPOSITION    = 0x0714
522
)
523

524
// Notification structure for EN_ENDCOMPOSITION
525
type ENDCOMPOSITIONNOTIFY struct {
526
	Nmhdr  NMHDR
527
	DwCode uint32
528
}
529

530
// Constants for ENDCOMPOSITIONNOTIFY dwCode
531
const (
532
	ECN_ENDCOMPOSITION = 0x0001
533
	ECN_NEWTEXT        = 0x0002
534
)
535

536
// Event notification masks
537
const (
538
	ENM_NONE              = 0x00000000
539
	ENM_CHANGE            = 0x00000001
540
	ENM_UPDATE            = 0x00000002
541
	ENM_SCROLL            = 0x00000004
542
	ENM_SCROLLEVENTS      = 0x00000008
543
	ENM_DRAGDROPDONE      = 0x00000010
544
	ENM_PARAGRAPHEXPANDED = 0x00000020
545
	ENM_PAGECHANGE        = 0x00000040
546
	ENM_CLIPFORMAT        = 0x00000080
547
	ENM_KEYEVENTS         = 0x00010000
548
	ENM_MOUSEEVENTS       = 0x00020000
549
	ENM_REQUESTRESIZE     = 0x00040000
550
	ENM_SELCHANGE         = 0x00080000
551
	ENM_DROPFILES         = 0x00100000
552
	ENM_PROTECTED         = 0x00200000
553
	ENM_CORRECTTEXT       = 0x00400000 // PenWin specific
554
	ENM_IMECHANGE         = 0x00800000 // Used by RE1.0 compatibility
555
	ENM_LANGCHANGE        = 0x01000000
556
	ENM_OBJECTPOSITIONS   = 0x02000000
557
	ENM_LINK              = 0x04000000
558
	ENM_LOWFIRTF          = 0x08000000
559
	ENM_STARTCOMPOSITION  = 0x10000000
560
	ENM_ENDCOMPOSITION    = 0x20000000
561
	ENM_GROUPTYPINGCHANGE = 0x40000000
562
	ENM_HIDELINKTOOLTIP   = 0x80000000
563
)
564

565
// New edit control styles
566
const (
567
	ES_SAVESEL         = 0x00008000
568
	ES_SUNKEN          = 0x00004000
569
	ES_DISABLENOSCROLL = 0x00002000
570
	ES_SELECTIONBAR    = 0x01000000 // Same as WS_MAXIMIZE, but that doesn't make sense so we re-use the value
571
	ES_NOOLEDRAGDROP   = 0x00000008 // Same as ES_UPPERCASE, but re-used to completely disable OLE drag'n'drop
572
)
573

574
// Obsolete Edit Style
575
const (
576
	ES_EX_NOCALLOLEINIT = 0x00000000 // Not supported in RE 2.0/3.0
577
)
578

579
// These flags are used in FE Windows
580
const (
581
	ES_VERTICAL = 0x00400000 // Not supported in RE 2.0/3.0
582
	ES_NOIME    = 0x00080000
583
	ES_SELFIME  = 0x00040000
584
)
585

586
// Edit control options
587
const (
588
	ECO_AUTOWORDSELECTION = 0x00000001
589
	ECO_AUTOVSCROLL       = 0x00000040
590
	ECO_AUTOHSCROLL       = 0x00000080
591
	ECO_NOHIDESEL         = 0x00000100
592
	ECO_READONLY          = 0x00000800
593
	ECO_WANTRETURN        = 0x00001000
594
	ECO_SAVESEL           = 0x00008000
595
	ECO_SELECTIONBAR      = 0x01000000
596
	ECO_VERTICAL          = 0x00400000 // FE specific
597
)
598

599
// ECO operations
600
const (
601
	ECOOP_SET = 0x0001
602
	ECOOP_OR  = 0x0002
603
	ECOOP_AND = 0x0003
604
	ECOOP_XOR = 0x0004
605
)
606

607
// New word break function actions
608
const (
609
	WB_CLASSIFY      = 3
610
	WB_MOVEWORDLEFT  = 4
611
	WB_MOVEWORDRIGHT = 5
612
	WB_LEFTBREAK     = 6
613
	WB_RIGHTBREAK    = 7
614
)
615

616
// East Asia specific flags
617
const (
618
	WB_MOVEWORDPREV = 4
619
	WB_MOVEWORDNEXT = 5
620
	WB_PREVBREAK    = 6
621
	WB_NEXTBREAK    = 7
622

623
	PC_FOLLOWING  = 1
624
	PC_LEADING    = 2
625
	PC_OVERFLOW   = 3
626
	PC_DELIMITER  = 4
627
	WBF_WORDWRAP  = 0x010
628
	WBF_WORDBREAK = 0x020
629
	WBF_OVERFLOW  = 0x040
630
	WBF_LEVEL1    = 0x080
631
	WBF_LEVEL2    = 0x100
632
	WBF_CUSTOM    = 0x200
633
)
634

635
// East Asia specific flags
636
const (
637
	IMF_FORCENONE         = 0x0001
638
	IMF_FORCEENABLE       = 0x0002
639
	IMF_FORCEDISABLE      = 0x0004
640
	IMF_CLOSESTATUSWINDOW = 0x0008
641
	IMF_VERTICAL          = 0x0020
642
	IMF_FORCEACTIVE       = 0x0040
643
	IMF_FORCEINACTIVE     = 0x0080
644
	IMF_FORCEREMEMBER     = 0x0100
645
	IMF_MULTIPLEEDIT      = 0x0400
646
)
647

648
// Word break flags (used with WB_CLASSIFY)
649
const (
650
	WBF_CLASS      byte = 0x0F
651
	WBF_ISWHITE    byte = 0x10
652
	WBF_BREAKLINE  byte = 0x20
653
	WBF_BREAKAFTER byte = 0x40
654
)
655

656
type CHARFORMAT struct {
657
	CbSize          uint32
658
	DwMask          uint32
659
	DwEffects       uint32
660
	YHeight         int32
661
	YOffset         int32
662
	CrTextColor     COLORREF
663
	BCharSet        byte
664
	BPitchAndFamily byte
665
	SzFaceName      [LF_FACESIZE]uint16
666
}
667

668
type CHARFORMAT2 struct {
669
	CHARFORMAT
670
	WWeight         uint16   // Font weight (LOGFONT value)
671
	SSpacing        int16    // Amount to space between letters
672
	CrBackColor     COLORREF // Background color
673
	Lcid            LCID     // Locale ID
674
	DwCookie        uint32   // Client cookie opaque to RichEdit
675
	SStyle          int16    // Style handle
676
	WKerning        uint16   // Twip size above which to kern char pair
677
	BUnderlineType  byte     // Underline type
678
	BAnimation      byte     // Animated text like marching ants
679
	BRevAuthor      byte     // Revision author index
680
	BUnderlineColor byte     // Underline color
681
}
682

683
// CHARFORMAT masks
684
const (
685
	CFM_BOLD      = 0x00000001
686
	CFM_ITALIC    = 0x00000002
687
	CFM_UNDERLINE = 0x00000004
688
	CFM_STRIKEOUT = 0x00000008
689
	CFM_PROTECTED = 0x00000010
690
	CFM_LINK      = 0x00000020 // Exchange hyperlink extension
691
	CFM_SIZE      = 0x80000000
692
	CFM_COLOR     = 0x40000000
693
	CFM_FACE      = 0x20000000
694
	CFM_OFFSET    = 0x10000000
695
	CFM_CHARSET   = 0x08000000
696
)
697

698
// CHARFORMAT effects
699
const (
700
	CFE_BOLD      = 0x00000001
701
	CFE_ITALIC    = 0x00000002
702
	CFE_UNDERLINE = 0x00000004
703
	CFE_STRIKEOUT = 0x00000008
704
	CFE_PROTECTED = 0x00000010
705
	CFE_LINK      = 0x00000020
706
	CFE_AUTOCOLOR = 0x40000000 // NOTE: this corresponds to CFM_COLOR, which controls it
707

708
	// Masks and effects defined for CHARFORMAT2 -- an (*) indicates that the data is stored by RichEdit 2.0/3.0, but not displayed
709
	CFM_SMALLCAPS = 0x00000040 // (*)
710
	CFM_ALLCAPS   = 0x00000080 // Displayed by 3.0
711
	CFM_HIDDEN    = 0x00000100 // Hidden by 3.0
712
	CFM_OUTLINE   = 0x00000200 // (*)
713
	CFM_SHADOW    = 0x00000400 // (*)
714
	CFM_EMBOSS    = 0x00000800 // (*)
715
	CFM_IMPRINT   = 0x00001000 // (*)
716
	CFM_DISABLED  = 0x00002000
717
	CFM_REVISED   = 0x00004000
718

719
	CFM_REVAUTHOR     = 0x00008000
720
	CFE_SUBSCRIPT     = 0x00010000 // Superscript and subscript are
721
	CFE_SUPERSCRIPT   = 0x00020000 //	mutually exclusive
722
	CFM_ANIMATION     = 0x00040000 // (*)
723
	CFM_STYLE         = 0x00080000 // (*)
724
	CFM_KERNING       = 0x00100000
725
	CFM_SPACING       = 0x00200000 // Displayed by 3.0
726
	CFM_WEIGHT        = 0x00400000
727
	CFM_UNDERLINETYPE = 0x00800000 // Many displayed by 3.0
728
	CFM_COOKIE        = 0x01000000 // RE 6.0
729
	CFM_LCID          = 0x02000000
730
	CFM_BACKCOLOR     = 0x04000000 // Higher mask bits defined above
731

732
	CFM_SUBSCRIPT   = (CFE_SUBSCRIPT | CFE_SUPERSCRIPT)
733
	CFM_SUPERSCRIPT = CFM_SUBSCRIPT
734

735
	// CHARFORMAT "ALL" masks
736
	CFM_EFFECTS  = CFM_BOLD | CFM_ITALIC | CFM_UNDERLINE | CFM_COLOR | CFM_STRIKEOUT | CFE_PROTECTED | CFM_LINK
737
	CFM_ALL      = CFM_EFFECTS | CFM_SIZE | CFM_FACE | CFM_OFFSET | CFM_CHARSET
738
	CFM_EFFECTS2 = CFM_EFFECTS | CFM_DISABLED | CFM_SMALLCAPS | CFM_ALLCAPS | CFM_HIDDEN | CFM_OUTLINE | CFM_SHADOW | CFM_EMBOSS | CFM_IMPRINT | CFM_REVISED | CFM_SUBSCRIPT | CFM_SUPERSCRIPT | CFM_BACKCOLOR
739
	CFM_ALL2     = CFM_ALL | CFM_EFFECTS2 | CFM_BACKCOLOR | CFM_LCID | CFM_UNDERLINETYPE | CFM_WEIGHT | CFM_REVAUTHOR | CFM_SPACING | CFM_KERNING | CFM_STYLE | CFM_ANIMATION | CFM_COOKIE
740

741
	CFE_SMALLCAPS = CFM_SMALLCAPS
742
	CFE_ALLCAPS   = CFM_ALLCAPS
743
	CFE_HIDDEN    = CFM_HIDDEN
744
	CFE_OUTLINE   = CFM_OUTLINE
745
	CFE_SHADOW    = CFM_SHADOW
746
	CFE_EMBOSS    = CFM_EMBOSS
747
	CFE_IMPRINT   = CFM_IMPRINT
748
	CFE_DISABLED  = CFM_DISABLED
749
	CFE_REVISED   = CFM_REVISED
750

751
	// CFE_AUTOCOLOR and CFE_AUTOBACKCOLOR correspond to CFM_COLOR and
752
	// CFM_BACKCOLOR, respectively, which control them
753
	CFE_AUTOBACKCOLOR = CFM_BACKCOLOR
754

755
	CFM_FONTBOUND     = 0x00100000
756
	CFM_LINKPROTECTED = 0x00800000 // Word hyperlink field
757
	CFM_EXTENDED      = 0x02000000
758
	CFM_MATHNOBUILDUP = 0x08000000
759
	CFM_MATH          = 0x10000000
760
	CFM_MATHORDINARY  = 0x20000000
761

762
	CFM_ALLEFFECTS = (CFM_EFFECTS2 | CFM_FONTBOUND | CFM_EXTENDED | CFM_MATHNOBUILDUP | CFM_MATH | CFM_MATHORDINARY)
763

764
	CFE_FONTBOUND     = 0x00100000 // Font chosen by binder, not user
765
	CFE_LINKPROTECTED = 0x00800000
766
	CFE_EXTENDED      = 0x02000000
767
	CFE_MATHNOBUILDUP = 0x08000000
768
	CFE_MATH          = 0x10000000
769
	CFE_MATHORDINARY  = 0x20000000
770

771
	// Underline types. RE 1.0 displays only CFU_UNDERLINE
772
	CFU_CF1UNDERLINE             = 0xFF // Map charformat's bit underline to CF2
773
	CFU_INVERT                   = 0xFE // For IME composition fake a selection
774
	CFU_UNDERLINETHICKLONGDASH   = 18   // (*) display as dash
775
	CFU_UNDERLINETHICKDOTTED     = 17   // (*) display as dot
776
	CFU_UNDERLINETHICKDASHDOTDOT = 16   // (*) display as dash dot dot
777
	CFU_UNDERLINETHICKDASHDOT    = 15   // (*) display as dash dot
778
	CFU_UNDERLINETHICKDASH       = 14   // (*) display as dash
779
	CFU_UNDERLINELONGDASH        = 13   // (*) display as dash
780
	CFU_UNDERLINEHEAVYWAVE       = 12   // (*) display as wave
781
	CFU_UNDERLINEDOUBLEWAVE      = 11   // (*) display as wave
782
	CFU_UNDERLINEHAIRLINE        = 10   // (*) display as single
783
	CFU_UNDERLINETHICK           = 9
784
	CFU_UNDERLINEWAVE            = 8
785
	CFU_UNDERLINEDASHDOTDOT      = 7
786
	CFU_UNDERLINEDASHDOT         = 6
787
	CFU_UNDERLINEDASH            = 5
788
	CFU_UNDERLINEDOTTED          = 4
789
	CFU_UNDERLINEDOUBLE          = 3 // (*) display as single
790
	CFU_UNDERLINEWORD            = 2 // (*) display as single
791
	CFU_UNDERLINE                = 1
792
	CFU_UNDERLINENONE            = 0
793
)
794

795
const YHeightCharPtsMost = 1638
796

797
const (
798
	// EM_SETCHARFORMAT wParam masks
799
	SCF_SELECTION       = 0x0001
800
	SCF_WORD            = 0x0002
801
	SCF_DEFAULT         = 0x0000 // Set default charformat or paraformat
802
	SCF_ALL             = 0x0004 // Not valid with SCF_SELECTION or SCF_WORD
803
	SCF_USEUIRULES      = 0x0008 // Modifier for SCF_SELECTION; says that came from a toolbar, etc., and  UI formatting rules should be instead of literal formatting
804
	SCF_ASSOCIATEFONT   = 0x0010 // Associate fontname with bCharSet (one possible for each of Western, ME, FE, Thai)
805
	SCF_NOKBUPDATE      = 0x0020 // Do not update KB layout for this change even if autokeyboard is on
806
	SCF_ASSOCIATEFONT2  = 0x0040 // Associate plane-2 (surrogate) font
807
	SCF_SMARTFONT       = 0x0080 // Apply font only if it can handle script (5.0)
808
	SCF_CHARREPFROMLCID = 0x0100 // Get character repertoire from lcid (5.0)
809

810
	SPF_DONTSETDEFAULT = 0x0002 // Suppress setting default on empty control
811
	SPF_SETDEFAULT     = 0x0004 // Set the default paraformat
812
)
813

814
type CHARRANGE struct {
815
	CpMin int32
816
	CpMax int32
817
}
818

819
type TEXTRANGE struct {
820
	Chrg      CHARRANGE
821
	LpstrText *uint16 // Allocated by caller, zero terminated by RichEdit
822
}
823

824
type EDITSTREAM struct {
825
	DwCookie    uintptr // User value passed to callback as first parameter
826
	DwError     uint32  // Last error
827
	PfnCallback uintptr
828
}
829

830
const (
831
	// Stream formats. Flags are all in low word, since high word gives possible codepage choice.
832
	SF_TEXT      = 0x0001
833
	SF_RTF       = 0x0002
834
	SF_RTFNOOBJS = 0x0003 // Write only
835
	SF_TEXTIZED  = 0x0004 // Write only
836

837
	SF_UNICODE        = 0x0010 // Unicode file (UCS2 little endian)
838
	SF_USECODEPAGE    = 0x0020 // CodePage given by high word
839
	SF_NCRFORNONASCII = 0x40   // Output \uN for nonASCII
840
	SFF_WRITEXTRAPAR  = 0x80   // Output \par at end
841

842
	// Flag telling stream operations to operate on selection only
843
	// EM_STREAMIN	replaces current selection
844
	// EM_STREAMOUT streams out current selection
845
	SFF_SELECTION = 0x8000
846

847
	// Flag telling stream operations to ignore some FE control words having to do with FE word breaking and horiz vs vertical text.
848
	// Not used in RichEdit 2.0 and later
849
	SFF_PLAINRTF = 0x4000
850

851
	// Flag telling file stream output (SFF_SELECTION flag not set) to persist // \viewscaleN control word.
852
	SFF_PERSISTVIEWSCALE = 0x2000
853

854
	// Flag telling file stream input with SFF_SELECTION flag not set not to // close the document
855
	SFF_KEEPDOCINFO = 0x1000
856

857
	// Flag telling stream operations to output in Pocket Word format
858
	SFF_PWD = 0x0800
859

860
	// 3-bit field specifying the value of N - 1 to use for \rtfN or \pwdN
861
	SF_RTFVAL = 0x0700
862
)
863

864
type FINDTEXT struct {
865
	Chrg      CHARRANGE
866
	LpstrText *uint16
867
}
868

869
type FINDTEXTEX struct {
870
	chrg      CHARRANGE
871
	lpstrText *uint16
872
	chrgText  CHARRANGE
873
}
874

875
type FORMATRANGE struct {
876
	hdc       HDC
877
	hdcTarget HDC
878
	rc        RECT
879
	rcPage    RECT
880
	chrg      CHARRANGE
881
}
882

883
// All paragraph measurements are in twips
884
const (
885
	MAX_TAB_STOPS   = 32
886
	LDefaultTab     = 720
887
	MAX_TABLE_CELLS = 63
888
)
889

890
type PARAFORMAT struct {
891
	CbSize        uint32
892
	DwMask        uint32
893
	WNumbering    uint16
894
	WEffects      uint16
895
	DxStartIndent int32
896
	DxRightIndent int32
897
	DxOffset      int32
898
	WAlignment    uint16
899
	CTabCount     int16
900
	RgxTabs       [MAX_TAB_STOPS]int32
901
}
902

903
type PARAFORMAT2 struct {
904
	PARAFORMAT
905
	DySpaceBefore    int32  // Vertical spacing before para
906
	DySpaceAfter     int32  // Vertical spacing after para
907
	DyLineSpacing    int32  // Line spacing depending on Rule
908
	SStyle           int16  // Style handle
909
	BLineSpacingRule byte   // Rule for line spacing (see tom.doc)
910
	BOutlineLevel    byte   // Outline level
911
	WShadingWeight   uint16 // Shading in hundredths of a per cent
912
	WShadingStyle    uint16 // Nibble 0: style, 1: cfpat, 2: cbpat
913
	WNumberingStart  uint16 // Starting value for numbering
914
	WNumberingStyle  uint16 // Alignment, roman/arabic, (), ), ., etc.
915
	WNumberingTab    uint16 // Space bet FirstIndent & 1st-line text
916
	WBorderSpace     uint16 // Border-text spaces (nbl/bdr in pts)
917
	WBorderWidth     uint16 // Pen widths (nbl/bdr in half pts)
918
	WBorders         uint16 // Border styles (nibble/border)
919
}
920

921
const (
922
	// PARAFORMAT mask values
923
	PFM_STARTINDENT  = 0x00000001
924
	PFM_RIGHTINDENT  = 0x00000002
925
	PFM_OFFSET       = 0x00000004
926
	PFM_ALIGNMENT    = 0x00000008
927
	PFM_TABSTOPS     = 0x00000010
928
	PFM_NUMBERING    = 0x00000020
929
	PFM_OFFSETINDENT = 0x80000000
930

931
	// PARAFORMAT 2.0 masks and effects
932
	PFM_SPACEBEFORE    = 0x00000040
933
	PFM_SPACEAFTER     = 0x00000080
934
	PFM_LINESPACING    = 0x00000100
935
	PFM_STYLE          = 0x00000400
936
	PFM_BORDER         = 0x00000800 // (*)
937
	PFM_SHADING        = 0x00001000 // (*)
938
	PFM_NUMBERINGSTYLE = 0x00002000 // RE 3.0
939
	PFM_NUMBERINGTAB   = 0x00004000 // RE 3.0
940
	PFM_NUMBERINGSTART = 0x00008000 // RE 3.0
941

942
	PFM_RTLPARA         = 0x00010000
943
	PFM_KEEP            = 0x00020000 // (*)
944
	PFM_KEEPNEXT        = 0x00040000 // (*)
945
	PFM_PAGEBREAKBEFORE = 0x00080000 // (*)
946
	PFM_NOLINENUMBER    = 0x00100000 // (*)
947
	PFM_NOWIDOWCONTROL  = 0x00200000 // (*)
948
	PFM_DONOTHYPHEN     = 0x00400000 // (*)
949
	PFM_SIDEBYSIDE      = 0x00800000 // (*)
950

951
	// The following two paragraph-format properties are read only
952
	PFM_COLLAPSED         = 0x01000000 // RE 3.0
953
	PFM_OUTLINELEVEL      = 0x02000000 // RE 3.0
954
	PFM_BOX               = 0x04000000 // RE 3.0
955
	PFM_RESERVED2         = 0x08000000 // RE 4.0
956
	PFM_TABLEROWDELIMITER = 0x10000000 // RE 4.0
957
	PFM_TEXTWRAPPINGBREAK = 0x20000000 // RE 3.0
958
	PFM_TABLE             = 0x40000000 // RE 3.0
959

960
	// PARAFORMAT "ALL" masks
961
	PFM_ALL = PFM_STARTINDENT | PFM_RIGHTINDENT | PFM_OFFSET | PFM_ALIGNMENT | PFM_TABSTOPS | PFM_NUMBERING | PFM_OFFSETINDENT | PFM_RTLPARA
962

963
	// Note: PARAFORMAT has no effects (BiDi RichEdit 1.0 does have PFE_RTLPARA)
964
	PFM_EFFECTS = PFM_RTLPARA | PFM_KEEP | PFM_KEEPNEXT | PFM_TABLE | PFM_PAGEBREAKBEFORE | PFM_NOLINENUMBER | PFM_NOWIDOWCONTROL | PFM_DONOTHYPHEN | PFM_SIDEBYSIDE | PFM_TABLE | PFM_TABLEROWDELIMITER
965

966
	PFM_ALL2 = PFM_ALL | PFM_EFFECTS | PFM_SPACEBEFORE | PFM_SPACEAFTER | PFM_LINESPACING | PFM_STYLE | PFM_SHADING | PFM_BORDER | PFM_NUMBERINGTAB | PFM_NUMBERINGSTART | PFM_NUMBERINGSTYLE
967

968
	PFE_RTLPARA           = PFM_RTLPARA >> 16
969
	PFE_KEEP              = PFM_KEEP >> 16              // (*)
970
	PFE_KEEPNEXT          = PFM_KEEPNEXT >> 16          // (*)
971
	PFE_PAGEBREAKBEFORE   = PFM_PAGEBREAKBEFORE >> 16   // (*)
972
	PFE_NOLINENUMBER      = PFM_NOLINENUMBER >> 16      // (*)
973
	PFE_NOWIDOWCONTROL    = PFM_NOWIDOWCONTROL >> 16    // (*)
974
	PFE_DONOTHYPHEN       = PFM_DONOTHYPHEN >> 16       // (*)
975
	PFE_SIDEBYSIDE        = PFM_SIDEBYSIDE >> 16        // (*)
976
	PFE_TEXTWRAPPINGBREAK = PFM_TEXTWRAPPINGBREAK >> 16 // (*)
977

978
	// The following four effects are read only
979
	PFE_COLLAPSED         = PFM_COLLAPSED >> 16         // (+)
980
	PFE_BOX               = PFM_BOX >> 16               // (+)
981
	PFE_TABLE             = PFM_TABLE >> 16             // Inside table row. RE 3.0
982
	PFE_TABLEROWDELIMITER = PFM_TABLEROWDELIMITER >> 16 // Table row start. RE 4.0
983

984
	// PARAFORMAT numbering options
985
	PFN_BULLET = 1 // tomListBullet
986

987
	// PARAFORMAT2 wNumbering options
988
	PFN_ARABIC   = 2 // tomListNumberAsArabic:	0, 1, 2,	...
989
	PFN_LCLETTER = 3 // tomListNumberAsLCLetter: a, b, c,	...
990
	PFN_UCLETTER = 4 // tomListNumberAsUCLetter: A, B, C,	...
991
	PFN_LCROMAN  = 5 // tomListNumberAsLCRoman:	i, ii, iii, ...
992
	PFN_UCROMAN  = 6 // tomListNumberAsUCRoman:	I, II, III, ...
993

994
	// PARAFORMAT2 wNumberingStyle options
995
	PFNS_PAREN    = 0x000 // default, e.g.,				  1)
996
	PFNS_PARENS   = 0x100 // tomListParentheses/256, e.g., (1)
997
	PFNS_PERIOD   = 0x200 // tomListPeriod/256, e.g., 	  1.
998
	PFNS_PLAIN    = 0x300 // tomListPlain/256, e.g.,		  1
999
	PFNS_NONUMBER = 0x400 // Used for continuation w/o number
1000

1001
	PFNS_NEWNUMBER = 0x8000 // Start new number with wNumberingStart
1002
	// (can be combined with other PFNS_xxx)
1003
	// PARAFORMAT alignment options
1004
	PFA_LEFT   = 1
1005
	PFA_RIGHT  = 2
1006
	PFA_CENTER = 3
1007

1008
	// PARAFORMAT2 alignment options
1009
	PFA_JUSTIFY        = 4 // New paragraph-alignment option 2.0 (*)
1010
	PFA_FULL_INTERWORD = 4 // These are supported in 3.0 with advanced
1011
)
1012

1013
type MSGFILTER struct {
1014
	Nmhdr  NMHDR
1015
	Msg    uint32
1016
	WParam uintptr
1017
	LParam uintptr
1018
}
1019

1020
type REQRESIZE struct {
1021
	Nmhdr NMHDR
1022
	Rc    RECT
1023
}
1024

1025
type SELCHANGE struct {
1026
	Nmhdr  NMHDR
1027
	Chrg   CHARRANGE
1028
	Seltyp uint16
1029
}
1030

1031
type GROUPTYPINGCHANGE struct {
1032
	Nmhdr        NMHDR
1033
	FGroupTyping BOOL
1034
}
1035

1036
type CLIPBOARDFORMAT struct {
1037
	Nmhdr NMHDR
1038
	Cf    CLIPFORMAT
1039
}
1040

1041
const (
1042
	SEL_EMPTY       = 0x0000
1043
	SEL_TEXT        = 0x0001
1044
	SEL_OBJECT      = 0x0002
1045
	SEL_MULTICHAR   = 0x0004
1046
	SEL_MULTIOBJECT = 0x0008
1047
)
1048

1049
const (
1050
	// Used with IRichEditOleCallback::GetContextMenu, this flag will be passed as a "selection type".  It indicates that a context menu for a right-mouse drag drop should be generated.  The IOleObject parameter will really be the IDataObject for the drop
1051
	GCM_RIGHTMOUSEDROP = 0x8000
1052
)
1053

1054
type GETCONTEXTMENUEX struct {
1055
	Chrg       CHARRANGE
1056
	DwFlags    uint32
1057
	Pt         POINT
1058
	PvReserved uintptr
1059
}
1060

1061
const (
1062
	// bits for GETCONTEXTMENUEX::dwFlags
1063
	GCMF_GRIPPER   = 0x00000001
1064
	GCMF_SPELLING  = 0x00000002 // pSpellingSuggestions is valid and points to the list of spelling suggestions
1065
	GCMF_TOUCHMENU = 0x00004000
1066
	GCMF_MOUSEMENU = 0x00002000
1067
)
1068

1069
type ENDROPFILES struct {
1070
	Nmhdr      NMHDR
1071
	HDrop      HANDLE
1072
	Cp         int32
1073
	FProtected BOOL
1074
}
1075

1076
type ENPROTECTED struct {
1077
	Nmhdr  NMHDR
1078
	Msg    uint32
1079
	WParam uintptr
1080
	LParam uintptr
1081
	Chrg   CHARRANGE
1082
}
1083

1084
type ENSAVECLIPBOARD struct {
1085
	Nmhdr        NMHDR
1086
	CObjectCount int32
1087
	Cch          int32
1088
}
1089

1090
type ENOLEOPFAILED struct {
1091
	Nmhdr NMHDR
1092
	Iob   int32
1093
	LOper int32
1094
	Hr    HRESULT
1095
}
1096

1097
const OLEOP_DOVERB = 1
1098

1099
type OBJECTPOSITIONS struct {
1100
	Nmhdr        NMHDR
1101
	CObjectCount int32
1102
	PcpPositions *int32
1103
}
1104

1105
type ENLINK struct {
1106
	Nmhdr  NMHDR
1107
	Msg    uint32
1108
	WParam uintptr
1109
	LParam uintptr
1110
	Chrg   CHARRANGE
1111
}
1112

1113
type ENLOWFIRTF struct {
1114
	Nmhdr     NMHDR
1115
	SzControl *byte
1116
}
1117

1118
// PenWin specific
1119
type ENCORRECTTEXT struct {
1120
	Nmhdr  NMHDR
1121
	Chrg   CHARRANGE
1122
	Seltyp uint16
1123
}
1124

1125
// East Asia specific
1126
type PUNCTUATION struct {
1127
	ISize         uint32
1128
	SzPunctuation *byte
1129
}
1130

1131
// East Asia specific
1132
type COMPCOLOR struct {
1133
	CrText       COLORREF
1134
	CrBackground COLORREF
1135
	DwEffects    uint32
1136
}
1137

1138
const (
1139
	// Clipboard formats - use as parameter to RegisterClipboardFormat()
1140
	CF_RTF       = "Rich Text Format"
1141
	CF_RTFNOOBJS = "Rich Text Format Without Objects"
1142
	CF_RETEXTOBJ = "RichEdit Text and Objects"
1143
)
1144

1145
// Paste Special
1146
type REPASTESPECIAL struct {
1147
	DwAspect uint32
1148
	DwParam  uintptr
1149
}
1150

1151
//	UndoName info
1152
type UNDONAMEID int32
1153

1154
const (
1155
	UID_UNKNOWN   UNDONAMEID = 0
1156
	UID_TYPING               = 1
1157
	UID_DELETE               = 2
1158
	UID_DRAGDROP             = 3
1159
	UID_CUT                  = 4
1160
	UID_PASTE                = 5
1161
	UID_AUTOTABLE            = 6
1162
)
1163

1164
const (
1165
	// Flags for the SETEXTEX data structure
1166
	ST_DEFAULT   = 0
1167
	ST_KEEPUNDO  = 1
1168
	ST_SELECTION = 2
1169
	ST_NEuint16S = 4
1170
	ST_UNICODE   = 8
1171
)
1172

1173
// EM_SETTEXTEX info; this struct is passed in the wparam of the message
1174
type SETTEXTEX struct {
1175
	Flags    uint32 // Flags (see the ST_XXX defines)
1176
	Codepage uint32 // Code page for translation (CP_ACP for sys default, 1200 for Unicode, -1 for control default)
1177
}
1178

1179
const (
1180
	// Flags for the GETEXTEX data structure
1181
	GT_DEFAULT      = 0
1182
	GT_USECRLF      = 1
1183
	GT_SELECTION    = 2
1184
	GT_RAWTEXT      = 4
1185
	GT_NOHIDDENTEXT = 8
1186
)
1187

1188
// EM_GETTEXTEX info; this struct is passed in the wparam of the message
1189
type GETTEXTEX struct {
1190
	Cb            uint32 // Count of bytes in the string
1191
	Flags         uint32 // Flags (see the GT_XXX defines
1192
	Codepage      uint32 // Code page for translation (CP_ACP for sys default, 1200 for Unicode, -1 for control default)
1193
	LpDefaultChar *byte  // Replacement for unmappable chars
1194
	LpUsedDefChar *BOOL  // Pointer to flag set when def char used
1195
}
1196

1197
const (
1198
	// Flags for the GETTEXTLENGTHEX data structure
1199
	GTL_DEFAULT  = 0  // Do default (return # of chars)
1200
	GTL_USECRLF  = 1  // Compute answer using CRLFs for paragraphs
1201
	GTL_PRECISE  = 2  // Compute a precise answer
1202
	GTL_CLOSE    = 4  // Fast computation of a "close" answer
1203
	GTL_NUMCHARS = 8  // Return number of characters
1204
	GTL_NUMBYTES = 16 // Return number of _bytes_
1205
)
1206

1207
// EM_GETTEXTLENGTHEX info; this struct is passed in the wparam of the msg
1208
type GETTEXTLENGTHEX struct {
1209
	Flags    uint32 // Flags (see GTL_XXX defines)
1210
	Codepage uint32 // Code page for translation (CP_ACP for default, 1200 for Unicode)
1211
}
1212

1213
// BiDi specific features
1214
type BIDIOPTIONS struct {
1215
	CbSize   uint32
1216
	WMask    uint16
1217
	WEffects uint16
1218
}
1219

1220
const (
1221
	// BIDIOPTIONS masks
1222
	BOM_NEUTRALOVERRIDE  = 0x0004 // Override neutral layout (obsolete)
1223
	BOM_CONTEXTREADING   = 0x0008 // Context reading order
1224
	BOM_CONTEXTALIGNMENT = 0x0010 // Context alignment
1225
	BOM_LEGACYBIDICLASS  = 0x0040 // Legacy Bidi classification (obsolete)
1226
	BOM_UNICODEBIDI      = 0x0080 // Use Unicode BiDi algorithm
1227

1228
	// BIDIOPTIONS effects
1229
	BOE_NEUTRALOVERRIDE  = 0x0004 // Override neutral layout (obsolete)
1230
	BOE_CONTEXTREADING   = 0x0008 // Context reading order
1231
	BOE_CONTEXTALIGNMENT = 0x0010 // Context alignment
1232
	BOE_FORCERECALC      = 0x0020 // Force recalc and redraw
1233
	BOE_LEGACYBIDICLASS  = 0x0040 // Legacy Bidi classification (obsolete)
1234
	BOE_UNICODEBIDI      = 0x0080 // Use Unicode BiDi algorithm
1235

1236
	// Additional EM_FINDTEXT[EX] flags
1237
	FR_MATCHDIAC      = 0x20000000
1238
	FR_MATCHKASHIDA   = 0x40000000
1239
	FR_MATCHALEFHAMZA = 0x80000000
1240

1241
	// UNICODE embedding character
1242
	WCH_EMBEDDING uint16 = 0xFFFC
1243
)
1244

1245
// khyph - Kind of hyphenation
1246
type KHYPH int32
1247

1248
const (
1249
	KhyphNil          KHYPH = iota // No Hyphenation
1250
	KhyphNormal                    // Normal Hyphenation
1251
	KhyphAddBefore                 // Add letter before hyphen
1252
	KhyphChangeBefore              // Change letter before hyphen
1253
	KhyphDeleteBefore              // Delete letter before hyphen
1254
	KhyphChangeAfter               // Change letter after hyphen
1255
	KhyphDelAndChange              // Delete letter before hyphen and change letter preceding hyphen
1256
)
1257

1258
type HYPHRESULT struct {
1259
	Khyph   KHYPH  // Kind of hyphenation
1260
	IchHyph int32  // Character which was hyphenated
1261
	ChHyph  uint16 // Depending on hyphenation type, character added, changed, etc.
1262
}
1263

1264
type HYPHENATEINFO struct {
1265
	CbSize          int16 // Size of HYPHENATEINFO structure
1266
	DxHyphenateZone int16 // If a space character is closer to the margin than this value, don't hyphenate (in TWIPs)
1267
	PfnHyphenate    uintptr
1268
}
1269

1270
const (
1271
	// Additional class for Richedit 6.0
1272
	RICHEDIT60_CLASS = "RICHEDIT60W"
1273
)
1274

Использование cookies

Мы используем файлы cookie в соответствии с Политикой конфиденциальности и Политикой использования cookies.

Нажимая кнопку «Принимаю», Вы даете АО «СберТех» согласие на обработку Ваших персональных данных в целях совершенствования нашего веб-сайта и Сервиса GitVerse, а также повышения удобства их использования.

Запретить использование cookies Вы можете самостоятельно в настройках Вашего браузера.