771
|
1 /* Unicode-encapsulation of Win32 library functions.
|
2367
|
2 Copyright (C) 2000, 2001, 2002, 2004 Ben Wing.
|
771
|
3
|
|
4 This file is part of XEmacs.
|
|
5
|
|
6 XEmacs is free software; you can redistribute it and/or modify it
|
|
7 under the terms of the GNU General Public License as published by the
|
|
8 Free Software Foundation; either version 2, or (at your option) any
|
|
9 later version.
|
|
10
|
|
11 XEmacs is distributed in the hope that it will be useful, but WITHOUT
|
|
12 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
13 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
|
14 for more details.
|
|
15
|
|
16 You should have received a copy of the GNU General Public License
|
|
17 along with XEmacs; see the file COPYING. If not, write to
|
|
18 the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
|
19 Boston, MA 02111-1307, USA. */
|
|
20
|
|
21 /* Synched up with: Not in FSF. */
|
|
22
|
|
23 /* Authorship:
|
|
24
|
|
25 Current primary author: Ben Wing <ben@xemacs.org>
|
|
26
|
|
27 Created summer 2000 by Ben Wing. Completed August 2001. Completely
|
|
28 written by Ben Wing.
|
|
29 */
|
|
30
|
|
31 #define NEED_MSWINDOWS_COMMCTRL
|
|
32 #define NEED_MSWINDOWS_SHLOBJ
|
|
33
|
|
34 #include <config.h>
|
|
35 #include "lisp.h"
|
|
36
|
|
37 #include "console-msw.h"
|
|
38
|
|
39 int no_mswin_unicode_lib_calls;
|
|
40
|
|
41
|
|
42 /************************************************************************/
|
|
43 /* auto-generation */
|
|
44 /************************************************************************/
|
|
45
|
|
46 /* we use a simple script to control the auto-generation.
|
|
47
|
|
48 \(The following is copied from lib-src/make-mswin-unicode.pl.)
|
|
49
|
|
50 file specifies a file to start reading from.
|
|
51 yes indicates a function to be automatically Unicode-encapsulated.
|
|
52 (All parameters either need no special processing or are LPTSTR or
|
|
53 LPCTSTR.)
|
|
54 soon indicates a function that should be automatically Unicode-encapsulated,
|
|
55 but we're not ready to process it yet.
|
|
56 no indicates a function we don't support (it will be #defined to cause
|
|
57 a compile error, with the text after the function included in the
|
|
58 erroneous definition to indicate why we don't support it).
|
|
59 skip indicates a function we support manually; only a comment about this
|
|
60 will be generated.
|
|
61 split indicates a function with a split structure (different versions
|
|
62 for Unicode and ANSI), but where the only difference is in pointer
|
|
63 types, and the actual size does not differ. The structure name
|
|
64 should follow the function name, and it will be automatically
|
|
65 Unicode-encapsulated with appropriate casts.
|
|
66 begin-bracket indicates a #if statement to be inserted here.
|
|
67 end-bracket indicates the corresponding #endif statement.
|
|
68 blank lines and lines beginning with // are ignored.
|
|
69
|
|
70 The generated files go into intl-auto-encap-win32.[ch].
|
|
71
|
|
72 To regenerate, go to the nt/ subdirectory and type
|
|
73
|
|
74 nmake -f xemacs.mak unicode-encapsulate
|
|
75
|
|
76 This does the following:
|
|
77
|
|
78 cd $(SRC)
|
|
79 perl ../lib-src/make-mswin-unicode.pl --c-output intl-auto-encap-win32.c --h-output intl-auto-encap-win32.h intl-encap-win32.c
|
|
80
|
|
81 */
|
|
82
|
|
83 /*
|
|
84
|
|
85 terminology used below:
|
|
86
|
|
87 "split-simple" means a structure where the A and W versions are the same
|
|
88 size, and the only differences are string pointer arguments. (This does NOT
|
|
89 include structures with a pointer to a split-sized structure within them.)
|
|
90 This can also refer to a function pointer whose only split arguments are
|
|
91 string pointers or split-simple structures.
|
|
92
|
|
93 "split-sized" means a structure where the A and W versions are different
|
|
94 sizes (typically because of an inline string argument), or where there's a
|
|
95 pointer to another split-sized structure.
|
|
96
|
|
97 "split-complex"
|
|
98
|
|
99 begin-unicode-encapsulation-script
|
|
100
|
800
|
101 // dir c:\Program Files\Microsoft Visual Studio\VC98\Include\
|
|
102
|
771
|
103 file WINBASE.H
|
|
104
|
|
105 yes GetBinaryType
|
|
106 yes GetShortPathName
|
1684
|
107 no GetLongPathName Win98/2K+ only
|
827
|
108 skip GetEnvironmentStrings misnamed ANSI version of the function
|
771
|
109 yes FreeEnvironmentStrings
|
|
110 yes FormatMessage
|
|
111 yes CreateMailslot
|
|
112 begin-bracket !defined (CYGWIN_HEADERS)
|
778
|
113 no EncryptFile Win2K+ only
|
|
114 no DecryptFile Win2K+ only
|
771
|
115 end-bracket
|
|
116 no OpenRaw error "The procedure entry point OpenRawW could not be located in the dynamic link library ADVAPI32.dll."
|
|
117 no QueryRecoveryAgents split-sized LPRECOVERY_AGENT_INFORMATION
|
|
118 yes lstrcmp
|
|
119 yes lstrcmpi
|
|
120 yes lstrcpyn
|
|
121 yes lstrcpy
|
|
122 yes lstrcat
|
|
123 yes lstrlen
|
|
124 yes CreateMutex
|
|
125 yes OpenMutex
|
|
126 yes CreateEvent
|
|
127 yes OpenEvent
|
|
128 yes CreateSemaphore
|
|
129 yes OpenSemaphore
|
|
130 yes CreateWaitableTimer
|
|
131 yes OpenWaitableTimer
|
|
132 yes CreateFileMapping
|
|
133 yes OpenFileMapping
|
|
134 yes GetLogicalDriveStrings
|
|
135 yes LoadLibrary
|
|
136 yes LoadLibraryEx
|
|
137 yes GetModuleFileName
|
|
138 yes GetModuleHandle
|
|
139 split CreateProcess LPSTARTUPINFO
|
|
140 yes FatalAppExit
|
|
141 split GetStartupInfo LPSTARTUPINFO
|
|
142 yes GetCommandLine
|
|
143 yes GetEnvironmentVariable
|
|
144 yes SetEnvironmentVariable
|
|
145 yes ExpandEnvironmentStrings
|
|
146 yes OutputDebugString
|
|
147 yes FindResource
|
|
148 yes FindResourceEx
|
|
149 yes EnumResourceTypes
|
|
150 yes EnumResourceNames
|
|
151 yes EnumResourceLanguages
|
|
152 yes BeginUpdateResource
|
|
153 yes UpdateResource
|
|
154 yes EndUpdateResource
|
|
155 yes GlobalAddAtom
|
|
156 yes GlobalFindAtom
|
|
157 yes GlobalGetAtomName
|
|
158 yes AddAtom
|
|
159 yes FindAtom
|
|
160 yes GetAtomName
|
|
161 yes GetProfileInt
|
|
162 yes GetProfileString
|
|
163 yes WriteProfileString
|
|
164 yes GetProfileSection
|
|
165 yes WriteProfileSection
|
|
166 yes GetPrivateProfileInt
|
|
167 yes GetPrivateProfileString
|
|
168 yes WritePrivateProfileString
|
|
169 yes GetPrivateProfileSection
|
|
170 yes WritePrivateProfileSection
|
|
171 yes GetPrivateProfileSectionNames
|
|
172 yes GetPrivateProfileStruct
|
|
173 yes WritePrivateProfileStruct
|
|
174 yes GetDriveType
|
|
175 yes GetSystemDirectory
|
|
176 yes GetTempPath
|
|
177 yes GetTempFileName
|
|
178 yes GetWindowsDirectory
|
|
179 yes SetCurrentDirectory
|
|
180 yes GetCurrentDirectory
|
|
181 yes GetDiskFreeSpace
|
|
182 yes GetDiskFreeSpaceEx
|
|
183 yes CreateDirectory
|
|
184 yes CreateDirectoryEx
|
|
185 yes RemoveDirectory
|
|
186 yes GetFullPathName
|
|
187 yes DefineDosDevice
|
|
188 yes QueryDosDevice
|
|
189 yes CreateFile
|
|
190 yes SetFileAttributes
|
|
191 yes GetFileAttributes
|
|
192 yes GetFileAttributesEx
|
|
193 yes GetCompressedFileSize
|
|
194 yes DeleteFile
|
|
195 no FindFirstFileEx split-sized LPWIN32_FIND_DATA; not used, NT 4.0+ only
|
|
196 skip FindFirstFile split-sized LPWIN32_FIND_DATA
|
|
197 skip FindNextFile split-sized LPWIN32_FIND_DATA
|
|
198 yes SearchPath
|
|
199 yes CopyFile
|
|
200 yes CopyFileEx NT 4.0+ only
|
|
201 yes MoveFile
|
|
202 yes MoveFileEx
|
|
203 no MoveFileWithProgress NT 5.0+ only
|
|
204 no CreateHardLink NT 5.0+ only
|
|
205 yes CreateNamedPipe
|
|
206 yes GetNamedPipeHandleState
|
|
207 yes CallNamedPipe
|
|
208 yes WaitNamedPipe
|
|
209 yes SetVolumeLabel
|
|
210 yes GetVolumeInformation
|
|
211 yes ClearEventLog
|
|
212 yes BackupEventLog
|
|
213 yes OpenEventLog
|
|
214 yes RegisterEventSource
|
|
215 yes OpenBackupEventLog
|
|
216 yes ReadEventLog
|
|
217 yes ReportEvent
|
|
218 yes AccessCheckAndAuditAlarm
|
|
219 no AccessCheckByTypeAndAuditAlarm NT 5.0+ only
|
|
220 no AccessCheckByTypeResultListAndAuditAlarm NT 5.0+ only
|
|
221 yes ObjectOpenAuditAlarm
|
|
222 yes ObjectPrivilegeAuditAlarm
|
|
223 yes ObjectCloseAuditAlarm
|
|
224 yes ObjectDeleteAuditAlarm
|
|
225 yes PrivilegedServiceAuditAlarm
|
|
226 yes SetFileSecurity
|
|
227 yes GetFileSecurity
|
|
228 yes FindFirstChangeNotification
|
|
229 no ReadDirectoryChanges Unicode-only
|
|
230 yes IsBadStringPtr
|
|
231 yes LookupAccountSid
|
|
232 yes LookupAccountName
|
|
233 yes LookupPrivilegeValue
|
|
234 yes LookupPrivilegeName
|
|
235 yes LookupPrivilegeDisplayName
|
|
236 yes BuildCommDCB
|
|
237 yes BuildCommDCBAndTimeouts
|
|
238 yes CommConfigDialog
|
|
239 yes GetDefaultCommConfig
|
|
240 yes SetDefaultCommConfig
|
|
241 yes GetComputerName
|
|
242 yes SetComputerName
|
|
243 yes GetUserName
|
|
244 yes LogonUser
|
|
245 split CreateProcessAsUser LPSTARTUPINFO
|
|
246 no GetCurrentHwProfile split-sized LPHW_PROFILE_INFO; NT 4.0+ only
|
|
247 no GetVersionEx split-sized LPOSVERSIONINFO
|
|
248 no CreateJobObject NT 5.0+ only
|
|
249 no OpenJobObject NT 5.0+ only
|
|
250
|
|
251 file WINUSER.H
|
|
252
|
|
253 skip MAKEINTRESOURCE macro
|
|
254 yes wvsprintf
|
|
255 no wsprintf varargs
|
|
256 yes LoadKeyboardLayout
|
|
257 yes GetKeyboardLayoutName
|
|
258 no CreateDesktop split-sized LPDEVMODE
|
|
259 yes OpenDesktop
|
|
260 split EnumDesktops DESKTOPENUMPROC // callback fun differs only in string pointer type
|
|
261 yes CreateWindowStation
|
|
262 yes OpenWindowStation
|
|
263 split EnumWindowStations WINSTAENUMPROC // callback fun differs only in string pointer type
|
|
264 yes GetUserObjectInformation
|
|
265 yes SetUserObjectInformation
|
|
266 yes RegisterWindowMessage
|
|
267 yes GetMessage
|
|
268 yes DispatchMessage
|
|
269 yes PeekMessage
|
|
270 skip SendMessage split messages and structures
|
|
271 yes SendMessageTimeout
|
|
272 yes SendNotifyMessage
|
|
273 yes SendMessageCallback
|
|
274 no BroadcastSystemMessage win95 version not split; NT 4.0+ only
|
|
275 no RegisterDeviceNotification NT 5.0+ only
|
|
276 yes PostMessage
|
|
277 yes PostThreadMessage
|
|
278 no PostAppMessage macro
|
|
279 skip DefWindowProc return value is conditionalized on _MAC, messes up parser
|
|
280 no CallWindowProc two versions, STRICT and non-STRICT
|
|
281 skip RegisterClass need to intercept so we can provide our own window procedure and handle split notify messages; split-simple WNDCLASS
|
|
282 skip UnregisterClass need to intercept for reasons related to RegisterClass
|
|
283 split GetClassInfo LPWNDCLASS
|
|
284 skip RegisterClassEx need to intercept so we can provide our own window procedure and handle split notify messages; split-simple WNDCLASSEX; NT 4.0+ only
|
|
285 split GetClassInfoEx LPWNDCLASSEX NT 4.0+ only
|
|
286 yes CreateWindowEx
|
|
287 skip CreateWindow macro
|
|
288 yes CreateDialogParam
|
|
289 split CreateDialogIndirectParam LPCDLGTEMPLATE error in Cygwin prototype (no split) but fixable with typedef
|
|
290 no CreateDialog macro
|
|
291 no CreateDialogIndirect macro w/split LPCDLGTEMPLATE
|
|
292 yes DialogBoxParam
|
|
293 split DialogBoxIndirectParam LPCDLGTEMPLATE error in Cygwin prototype (no split) but fixable with typedef
|
|
294 no DialogBox macro
|
|
295 no DialogBoxIndirect macro w/split LPCDLGTEMPLATE
|
|
296 yes SetDlgItemText
|
|
297 yes GetDlgItemText
|
|
298 yes SendDlgItemMessage
|
|
299 no DefDlgProc return value is conditionalized on _MAC, messes up parser
|
|
300 begin-bracket !defined (CYGWIN_HEADERS)
|
|
301 yes CallMsgFilter
|
|
302 end-bracket
|
|
303 yes RegisterClipboardFormat
|
|
304 yes GetClipboardFormatName
|
|
305 yes CharToOem
|
|
306 yes OemToChar
|
|
307 yes CharToOemBuff
|
|
308 yes OemToCharBuff
|
|
309 yes CharUpper
|
|
310 yes CharUpperBuff
|
|
311 yes CharLower
|
|
312 yes CharLowerBuff
|
|
313 yes CharNext
|
|
314 yes CharPrev
|
|
315 no IsCharAlpha split CHAR
|
|
316 no IsCharAlphaNumeric split CHAR
|
|
317 no IsCharUpper split CHAR
|
|
318 no IsCharLower split CHAR
|
|
319 yes GetKeyNameText
|
|
320 skip VkKeyScan split CHAR
|
|
321 no VkKeyScanEx split CHAR; NT 4.0+ only
|
|
322 yes MapVirtualKey
|
|
323 yes MapVirtualKeyEx NT 4.0+ only
|
|
324 yes LoadAccelerators
|
|
325 yes CreateAcceleratorTable
|
|
326 yes CopyAcceleratorTable
|
|
327 yes TranslateAccelerator
|
|
328 yes LoadMenu
|
|
329 split LoadMenuIndirect MENUTEMPLATE
|
|
330 yes ChangeMenu
|
|
331 yes GetMenuString
|
|
332 yes InsertMenu
|
|
333 yes AppendMenu
|
|
334 yes ModifyMenu
|
|
335 split InsertMenuItem LPCMENUITEMINFO NT 4.0+ only
|
|
336 split GetMenuItemInfo LPMENUITEMINFO NT 4.0+ only
|
|
337 split SetMenuItemInfo LPCMENUITEMINFO NT 4.0+ only
|
|
338 yes DrawText
|
|
339 yes DrawTextEx NT 4.0+ only
|
|
340 yes GrayString
|
|
341 yes DrawState NT 4.0+ only
|
|
342 yes TabbedTextOut
|
|
343 yes GetTabbedTextExtent
|
|
344 yes SetProp
|
|
345 yes GetProp
|
|
346 yes RemoveProp
|
|
347 split EnumPropsEx PROPENUMPROCEX // callback fun differs only in string pointer type
|
|
348 split EnumProps PROPENUMPROC // callback fun differs only in string pointer type
|
|
349 yes SetWindowText
|
|
350 yes GetWindowText
|
|
351 yes GetWindowTextLength
|
|
352 yes MessageBox
|
|
353 yes MessageBoxEx
|
|
354 split MessageBoxIndirect LPMSGBOXPARAMS NT 4.0+ only
|
|
355 yes GetWindowLong
|
|
356 yes SetWindowLong
|
|
357 yes GetClassLong
|
|
358 yes SetClassLong
|
|
359 yes FindWindow
|
|
360 yes FindWindowEx NT 4.0+ only
|
|
361 yes GetClassName
|
|
362 no SetWindowsHook obsolete; two versions, STRICT and non-STRICT
|
|
363 yes SetWindowsHookEx
|
|
364 yes LoadBitmap
|
|
365 yes LoadCursor
|
|
366 yes LoadCursorFromFile
|
|
367 yes LoadIcon
|
|
368 yes LoadImage NT 4.0+ only
|
|
369 yes LoadString
|
|
370 yes IsDialogMessage
|
|
371 yes DlgDirList
|
|
372 yes DlgDirSelectEx
|
|
373 yes DlgDirListComboBox
|
|
374 yes DlgDirSelectComboBoxEx
|
|
375 yes DefFrameProc
|
|
376 no DefMDIChildProc return value is conditionalized on _MAC, messes up parser
|
|
377
|
|
378 yes CreateMDIWindow
|
|
379 yes WinHelp
|
|
380 no ChangeDisplaySettings split-sized LPDEVMODE
|
|
381 no ChangeDisplaySettingsEx split-sized LPDEVMODE; NT 5.0/Win98+ only
|
|
382 no EnumDisplaySettings split-sized LPDEVMODE
|
|
383 no EnumDisplayDevices split-sized PDISPLAY_DEVICE; NT 5.0+ only, no Win98
|
|
384 yes SystemParametersInfo probs w/ICONMETRICS, NONCLIENTMETRICS
|
|
385 no GetMonitorInfo NT 5.0/Win98+ only
|
|
386 no GetWindowModuleFileName NT 5.0+ only
|
|
387 no RealGetWindowClass NT 5.0+ only
|
|
388 no GetAltTabInfo NT 5.0+ only
|
|
389
|
|
390 file WINGDI.H
|
|
391
|
|
392 // split-sized LOGCOLORSPACE
|
|
393 // split-sized TEXTMETRIC
|
|
394 // split-sized NEWTEXTMETRIC
|
|
395 // split-sized NEWTEXTMETRICEX
|
|
396 // split-sized LOGFONT
|
|
397 // split-sized ENUMLOGFONT
|
|
398 // split-sized ENUMLOGFONTEX
|
|
399 // split-sized EXTLOGFONT, used in EMREXTCREATEFONTINDIRECTW (Unicode-only) and (???) in DEVINFO (DDK structure)
|
|
400 // split-sized DEVMODE
|
|
401 // split-sized DISPLAY_DEVICE, used in EnumDisplayDevices
|
|
402 // split-sized OUTLINETEXTMETRIC
|
|
403 // split-simple POLYTEXT
|
|
404 // split-simple GCP_RESULTS
|
|
405 // split-sized function pointer OLDFONTENUMPROC, same as FONTENUMPROC
|
|
406 // split-sized function pointer FONTENUMPROC
|
|
407 yes AddFontResource
|
|
408 yes CopyMetaFile
|
|
409 skip CreateDC split-sized DEVMODE
|
|
410 skip CreateFontIndirect split-sized LOGFONT
|
|
411 yes CreateFont
|
|
412 skip CreateIC split-sized DEVMODE
|
|
413 yes CreateMetaFile
|
|
414 yes CreateScalableFontResource
|
|
415 skip DeviceCapabilities split-sized DEVMODE
|
|
416 skip EnumFontFamiliesEx split-complex FONTENUMPROC; NT 4.0+ only
|
|
417 no EnumFontFamilies split-complex FONTENUMPROC
|
|
418 no EnumFonts split-complex FONTENUMPROC
|
|
419 yes GetCharWidth
|
|
420 yes GetCharWidth32
|
|
421 yes GetCharWidthFloat
|
|
422 yes GetCharABCWidths
|
|
423 yes GetCharABCWidthsFloat
|
|
424 yes GetGlyphOutline
|
|
425 yes GetMetaFile
|
|
426 no GetOutlineTextMetrics split-sized LPOUTLINETEXTMETRIC
|
|
427 yes GetTextExtentPoint
|
|
428 yes GetTextExtentPoint32
|
|
429 yes GetTextExtentExPoint
|
|
430 split GetCharacterPlacement LPGCP_RESULTS NT 4.0+ only
|
|
431 no GetGlyphIndices NT 5.0+ only
|
|
432 no AddFontResourceEx NT 5.0+ only
|
|
433 no RemoveFontResourceEx NT 5.0+ only
|
|
434 // split-sized AXISINFO, used in AXESLIST; NT 5.0+ only
|
|
435 // split-sized AXESLIST, used in ENUMLOGFONTEXDV; NT 5.0+ only
|
|
436 // split-sized ENUMLOGFONTEXDV; NT 5.0+ only
|
|
437 no CreateFontIndirectEx split-sized ENUMLOGFONTEXDV; NT 5.0+ only
|
|
438 // split-sized ENUMTEXTMETRIC, returned in EnumFontFamExProc, on NT 5.0+; NT 5.0+ only
|
|
439 skip ResetDC split-sized DEVMODE
|
|
440 yes RemoveFontResource
|
|
441 yes CopyEnhMetaFile
|
|
442 yes CreateEnhMetaFile
|
|
443 yes GetEnhMetaFile
|
|
444 yes GetEnhMetaFileDescription
|
|
445 skip GetTextMetrics split-sized LPTEXTMETRIC
|
|
446 // split-simple DOCINFO
|
|
447 split StartDoc DOCINFO
|
|
448 skip GetObject split-sized LOGFONT
|
|
449 yes TextOut
|
|
450 yes ExtTextOut
|
|
451 split PolyTextOut POLYTEXT
|
|
452 yes GetTextFace
|
|
453 yes GetKerningPairs
|
|
454 // split-simple function pointer ICMENUMPROC
|
|
455 no GetLogColorSpace split-sized LPLOGCOLORSPACE; NT 4.0+ only
|
|
456 no CreateColorSpace split-sized LPLOGCOLORSPACE; NT 4.0+ only
|
|
457 skip GetICMProfile NT 4.0+ only, error in Cygwin prototype
|
|
458 yes SetICMProfile NT 4.0+ only
|
|
459 split EnumICMProfiles ICMENUMPROC NT 4.0+ only
|
|
460 skip UpdateICMRegKey NT 4.0+ only, error in Cygwin prototype
|
|
461 // non-split EMREXTTEXTOUT (A and W versions identical)
|
|
462 // non-split EMRPOLYTEXTOUT (A and W versions identical)
|
|
463 // Unicode-only EMREXTCREATEFONTINDIRECTW
|
|
464 no wglUseFontBitmaps causes link error
|
|
465 no wglUseFontOutlines causes link error
|
|
466
|
|
467 file WINSPOOL.H
|
|
468
|
|
469 begin-bracket defined (HAVE_MS_WINDOWS)
|
|
470 yes EnumPrinters #### problems with DEVMODE pointer in PRINTER_INFO_2
|
|
471 skip OpenPrinter split-sized DEVMODE pointer in split PRINTER_DEFAULTS
|
|
472 no ResetPrinter split-sized DEVMODE pointer in split PRINTER_DEFAULTS
|
|
473 no SetJob split-sized DEVMODE pointer in split JOB_INFO_2
|
|
474 no GetJob split-sized DEVMODE pointer in split JOB_INFO_2
|
|
475 no EnumJobs split-sized DEVMODE pointer in split JOB_INFO_2
|
|
476 no AddPrinter split-sized DEVMODE pointer in split PRINTER_INFO_2
|
|
477 no SetPrinter split-sized DEVMODE pointer in split PRINTER_INFO_2
|
|
478 no GetPrinter split-sized DEVMODE pointer in split PRINTER_INFO_2
|
|
479 // other than DocumentProperties below, we don't use any of the others,
|
|
480 // and they all pretty much have complicated interfaces with lots of
|
|
481 // split structures, etc.
|
|
482 no AddPrinterDriver not used, complicated interface with split structures
|
|
483 no AddPrinterDriverEx not used, complicated interface with split structures
|
|
484 no EnumPrinterDrivers not used, complicated interface with split structures
|
|
485 no GetPrinterDriver not used, complicated interface with split structures
|
|
486 no GetPrinterDriverDirectory not used, complicated interface with split structures
|
|
487 no DeletePrinterDriver not used, complicated interface with split structures
|
|
488 no DeletePrinterDriverEx not used, complicated interface with split structures
|
|
489 no AddPerMachineConnection not used, complicated interface with split structures
|
|
490 no DeletePerMachineConnection not used, complicated interface with split structures
|
|
491 no EnumPerMachineConnections not used, complicated interface with split structures
|
|
492 no AddPrintProcessor not used, complicated interface with split structures
|
|
493 no EnumPrintProcessors not used, complicated interface with split structures
|
|
494 no GetPrintProcessorDirectory not used, complicated interface with split structures
|
|
495 no EnumPrintProcessorDatatypes not used, complicated interface with split structures
|
|
496 no DeletePrintProcessor not used, complicated interface with split structures
|
|
497 no StartDocPrinter not used, complicated interface with split structures
|
|
498 no AddJob not used, complicated interface with split structures
|
|
499 skip DocumentProperties split-sized DEVMODE, error in Cygwin prototype
|
|
500 no AdvancedDocumentProperties not used, complicated interface with split structures
|
|
501 no GetPrinterData not used, complicated interface with split structures
|
|
502 no GetPrinterDataEx not used, complicated interface with split structures
|
|
503 no EnumPrinterData not used, complicated interface with split structures
|
|
504 no EnumPrinterDataEx not used, complicated interface with split structures
|
|
505 no EnumPrinterKey not used, complicated interface with split structures
|
|
506 no SetPrinterData not used, complicated interface with split structures
|
|
507 no SetPrinterDataEx not used, complicated interface with split structures
|
|
508 no DeletePrinterData not used, complicated interface with split structures
|
|
509 no DeletePrinterDataEx not used, complicated interface with split structures
|
|
510 no DeletePrinterKey not used, complicated interface with split structures
|
|
511 no PrinterMessageBox not used, complicated interface with split structures
|
|
512 no AddForm not used, complicated interface with split structures
|
|
513 no DeleteForm not used, complicated interface with split structures
|
|
514 no GetForm not used, complicated interface with split structures
|
|
515 no SetForm not used, complicated interface with split structures
|
|
516 no EnumForms not used, complicated interface with split structures
|
|
517 no EnumMonitors not used, complicated interface with split structures
|
|
518 no AddMonitor not used, complicated interface with split structures
|
|
519 no DeleteMonitor not used, complicated interface with split structures
|
|
520 no EnumPorts not used, complicated interface with split structures
|
|
521 no AddPort not used, complicated interface with split structures
|
|
522 no ConfigurePort not used, complicated interface with split structures
|
|
523 no DeletePort not used, complicated interface with split structures
|
|
524 no XcvData not used, complicated interface with split structures
|
|
525 no SetPort not used, complicated interface with split structures
|
|
526 no AddPrinterConnection not used, complicated interface with split structures
|
|
527 no DeletePrinterConnection not used, complicated interface with split structures
|
|
528 no AddPrintProvidor not used, complicated interface with split structures
|
|
529 no DeletePrintProvidor not used, complicated interface with split structures
|
|
530 no SetPrinterHTMLView not used, complicated interface with split structures
|
|
531 no GetPrinterHTMLView not used, complicated interface with split structures
|
|
532 end-bracket
|
|
533
|
|
534 file SHELLAPI.H
|
|
535
|
|
536 yes DragQueryFile
|
|
537 yes ShellExecute
|
|
538 yes FindExecutable
|
|
539 no CommandLineToArgv Unicode-only
|
|
540 yes ShellAbout
|
|
541 yes ExtractAssociatedIcon
|
|
542 yes ExtractIcon
|
|
543 // split-simple DRAGINFO, used ??? (docs say "Not currently supported")
|
|
544 begin-bracket !defined (CYGWIN_HEADERS)
|
|
545 yes DoEnvironmentSubst NT 4.0+ only
|
|
546 end-bracket
|
|
547 no FindEnvironmentString causes link error; NT 4.0+ only
|
|
548 skip ExtractIconEx NT 4.0+ only, error in Cygwin prototype
|
|
549 // split-simple SHFILEOPSTRUCT, used in SHFileOperation
|
|
550 // split-simple SHNAMEMAPPING, used in SHFileOperation
|
|
551 split SHFileOperation LPSHFILEOPSTRUCT NT 4.0+ only
|
|
552 // split-simple SHELLEXECUTEINFO, used in ShellExecuteEx
|
|
553 split ShellExecuteEx LPSHELLEXECUTEINFO NT 4.0+ only
|
|
554 no WinExecError causes link error; NT 4.0+ only
|
|
555 begin-bracket !defined (CYGWIN_HEADERS)
|
|
556 yes SHQueryRecycleBin NT 4.0+ only
|
|
557 yes SHEmptyRecycleBin NT 4.0+ only
|
|
558 end-bracket
|
|
559 // split-sized NOTIFYICONDATA, used in Shell_NotifyIcon
|
|
560 no Shell_NotifyIcon split-sized NOTIFYICONDATA, NT 4.0+ only
|
|
561 // split-sized SHFILEINFO, used in SHGetFileInfo
|
|
562 skip SHGetFileInfo split-sized SHFILEINFO, NT 4.0+ only
|
|
563 no SHGetDiskFreeSpace causes link error; NT 4.0+ only
|
|
564 begin-bracket !defined (CYGWIN_HEADERS)
|
|
565 yes SHGetNewLinkInfo NT 4.0+ only
|
|
566 yes SHInvokePrinterCommand NT 4.0+ only
|
|
567 end-bracket
|
|
568
|
|
569 end-unicode-encapsulation-script
|
|
570
|
|
571 file COMMCTRL.H
|
|
572
|
|
573 yes ImageList_LoadImage
|
|
574 WC_HEADER
|
|
575 HDITEM
|
|
576 LPHDITEM
|
|
577 HDM_INSERTITEM
|
|
578 HDM_GETITEM
|
|
579 HDM_SETITEM
|
|
580 HDN_ITEMCHANGING
|
|
581 HDN_ITEMCHANGED
|
|
582 HDN_ITEMCLICK
|
|
583 HDN_ITEMDBLCLICK
|
|
584 HDN_DIVIDERDBLCLICK
|
|
585 HDN_BEGINTRACK
|
|
586 HDN_ENDTRACK
|
|
587 HDN_TRACK
|
|
588 HDN_GETDISPINFO
|
|
589 NMHEADER
|
|
590 LPNMHEADER
|
|
591 NMHDDISPINFO
|
|
592 LPNMHDDISPINFO
|
|
593 TOOLBARCLASSNAME
|
|
594 TBSAVEPARAMS
|
|
595 LPTBSAVEPARAMS
|
|
596 TB_GETBUTTONTEXT
|
|
597 TB_SAVERESTORE
|
|
598 TB_ADDSTRING
|
|
599 TBBUTTONINFO
|
|
600 LPTBBUTTONINFO
|
|
601 TB_GETBUTTONINFO
|
|
602 TB_SETBUTTONINFO
|
|
603 TB_INSERTBUTTON
|
|
604 TB_ADDBUTTONS
|
|
605 TBN_GETINFOTIP
|
|
606 NMTBGETINFOTIP
|
|
607 LPNMTBGETINFOTIP
|
|
608 TBN_GETDISPINFO
|
|
609 LPNMTBDISPINFO
|
|
610 TBN_GETBUTTONINFO
|
|
611 NMTOOLBAR
|
|
612 LPNMTOOLBAR
|
|
613 REBARCLASSNAME
|
|
614 REBARBANDINFO
|
|
615 LPREBARBANDINFO
|
|
616 LPCREBARBANDINFO
|
|
617 RB_INSERTBAND
|
|
618 RB_SETBANDINFO
|
|
619 RB_GETBANDINFO
|
|
620 TOOLTIPS_CLASS
|
|
621 TTTOOLINFO
|
|
622 PTOOLINFO
|
|
623 LPTTTOOLINFO
|
|
624 TTM_ADDTOOL
|
|
625 TTM_DELTOOL
|
|
626 TTM_NEWTOOLRECT
|
|
627 TTM_GETTOOLINFO
|
|
628 TTM_SETTOOLINFO
|
|
629 TTM_HITTEST
|
|
630 TTM_GETTEXT
|
|
631 TTM_UPDATETIPTEXT
|
|
632 TTM_ENUMTOOLS
|
|
633 TTM_GETCURRENTTOOL
|
|
634 TTHITTESTINFO
|
|
635 LPTTHITTESTINFO
|
|
636 TTN_GETDISPINFO
|
|
637 NMTTDISPINFO
|
|
638 LPNMTTDISPINFO
|
|
639 CreateStatusWindow
|
|
640 DrawStatusText
|
|
641 STATUSCLASSNAME
|
|
642 SB_GETTEXT
|
|
643 SB_SETTEXT
|
|
644 SB_GETTEXTLENGTH
|
|
645 SB_SETTIPTEXT
|
|
646 SB_GETTIPTEXT
|
|
647 TRACKBAR_CLASS
|
|
648 UPDOWN_CLASS
|
|
649 PROGRESS_CLASS
|
|
650 HOTKEY_CLASS
|
|
651 WC_LISTVIEW
|
|
652 LVITEM
|
|
653 LPLVITEM
|
|
654 LPSTR_TEXTCALLBACK
|
|
655 LVM_GETITEM
|
|
656 LVM_SETITEM
|
|
657 LVM_INSERTITEM
|
|
658 LVFINDINFO
|
|
659 LVM_FINDITEM
|
|
660 LVM_GETSTRINGWIDTH
|
|
661 LVM_EDITLABEL
|
|
662 LVCOLUMN
|
|
663 LPLVCOLUMN
|
|
664 LVM_GETCOLUMN
|
|
665 LVM_SETCOLUMN
|
|
666 LVM_GETITEMTEXT
|
|
667 LVM_SETITEMTEXT
|
|
668 LVM_GETISEARCHSTRING
|
|
669 LVBKIMAGE
|
|
670 LPLVBKIMAGE
|
|
671 LVM_SETBKIMAGE
|
|
672 LVM_GETBKIMAGE
|
|
673 LVN_ODFINDITEM
|
|
674 LVN_BEGINLABELEDIT
|
|
675 LVN_ENDLABELEDIT
|
|
676 LVN_GETDISPINFO
|
|
677 LVN_SETDISPINFO
|
|
678 NMLVDISPINFO
|
|
679 LVN_GETINFOTIP
|
|
680 NMLVGETINFOTIP
|
|
681 LPNMLVGETINFOTIP
|
|
682 WC_TREEVIEW
|
|
683 TVITEM
|
|
684 LPTVITEM
|
|
685 TVINSERTSTRUCT
|
|
686 LPTVINSERTSTRUCT
|
|
687 TVM_INSERTITEM
|
|
688 TVM_GETITEM
|
|
689 TVM_SETITEM
|
|
690 TVM_EDITLABEL
|
|
691 TVM_GETISEARCHSTRING
|
|
692 NMTREEVIEW
|
|
693 LPNMTREEVIEW
|
|
694 NMTVDISPINFO
|
|
695 LPNMTVDISPINFO
|
|
696 TVN_SELCHANGING
|
|
697 TVN_SELCHANGED
|
|
698 TVN_GETDISPINFO
|
|
699 TVN_SETDISPINFO
|
|
700 TVN_ITEMEXPANDING
|
|
701 TVN_ITEMEXPANDED
|
|
702 TVN_BEGINDRAG
|
|
703 TVN_BEGINRDRAG
|
|
704 TVN_DELETEITEM
|
|
705 TVN_BEGINLABELEDIT
|
|
706 TVN_ENDLABELEDIT
|
|
707 TVN_GETINFOTIP
|
|
708 NMTVGETINFOTIP
|
|
709 LPNMTVGETINFOTIP
|
|
710 WC_COMBOBOXEX
|
|
711 COMBOBOXEXITEM
|
|
712 PCOMBOBOXEXITEM
|
|
713 PCCOMBOBOXEXITEM
|
|
714 CBEM_INSERTITEM
|
|
715 CBEM_SETITEM
|
|
716 CBEM_GETITEM
|
|
717 NMCOMBOBOXEX
|
|
718 PNMCOMBOBOXEX
|
|
719 CBEN_GETDISPINFO
|
|
720 CBEN_DRAGBEGIN
|
|
721 CBEN_ENDEDIT
|
|
722 NMCBEDRAGBEGIN
|
|
723 LPNMCBEDRAGBEGIN
|
|
724 PNMCBEDRAGBEGIN
|
|
725 NMCBEENDEDIT
|
|
726 LPNMCBEENDEDIT
|
|
727 PNMCBEENDEDIT
|
|
728 WC_TABCONTROL
|
|
729 TCITEMHEADER
|
|
730 LPTCITEMHEADER
|
|
731 TCITEM
|
|
732 LPTCITEM
|
|
733 TCM_GETITEM
|
|
734 TCM_SETITEM
|
|
735 TCM_INSERTITEM
|
|
736 ANIMATE_CLASS
|
|
737 ACM_OPEN
|
|
738 MONTHCAL_CLASS
|
|
739 DATETIMEPICK_CLASS
|
|
740 DTM_SETFORMAT
|
|
741 DTN_USERSTRING
|
|
742 NMDATETIMESTRING
|
|
743 LPNMDATETIMESTRING
|
|
744 DTN_WMKEYDOWN
|
|
745 NMDATETIMEWMKEYDOWN
|
|
746 LPNMDATETIMEWMKEYDOWN
|
|
747 DTN_FORMAT
|
|
748 NMDATETIMEFORMAT
|
|
749 LPNMDATETIMEFORMAT
|
|
750 DTN_FORMATQUERY
|
|
751 NMDATETIMEFORMATQUERY
|
|
752 LPNMDATETIMEFORMATQUERY
|
|
753 WC_IPADDRESS
|
|
754 WC_PAGESCROLLER
|
|
755 WC_NATIVEFONTCTL
|
|
756
|
|
757 begin-unicode-encapsulation-script
|
|
758
|
|
759 file COMMDLG.H
|
|
760
|
|
761 split GetOpenFileName LPOPENFILENAME
|
|
762 split GetSaveFileName LPOPENFILENAME
|
|
763 yes GetFileTitle
|
|
764 no CommDlg_OpenSave_GetSpec macro
|
|
765 no CommDlg_OpenSave_GetFilePath macro
|
|
766 no CommDlg_OpenSave_GetFolderPath macro
|
|
767 split ChooseColor LPCHOOSECOLOR
|
|
768 split FindText LPFINDREPLACE
|
|
769 split ReplaceText LPFINDREPLACE
|
|
770 no AfxReplaceText mac only
|
|
771 no ChooseFont split-sized LPLOGFONT in LPCHOOSEFONT
|
|
772 // LBSELCHSTRING
|
|
773 // SHAREVISTRING
|
|
774 // FILEOKSTRING
|
|
775 // COLOROKSTRING
|
|
776 // SETRGBSTRING
|
|
777 // HELPMSGSTRING
|
|
778 // FINDMSGSTRING
|
|
779 skip PrintDlg LPPRINTDLG with split-sized DEVMODE handle
|
|
780 skip PageSetupDlg LPPAGESETUPDLG with split-sized DEVMODE handle
|
|
781
|
|
782 file DDE.H
|
|
783
|
|
784 // nothing
|
|
785
|
|
786 file DDEML.H
|
|
787
|
|
788 yes DdeInitialize
|
1111
|
789 skip DdeCreateStringHandle error in Cygwin prototype
|
771
|
790 yes DdeQueryString
|
|
791 // #### split-sized (or split-simple??? not completely obvious) structure MONHSZSTRUCT, used when DDE event MF_HSZ_INFO is sent as part of the XTYP_MONITOR transaction sent to a DDE callback; not yet handled
|
|
792
|
|
793 file IMM.H
|
|
794
|
|
795 begin-bracket defined (HAVE_MS_WINDOWS)
|
|
796 yes ImmInstallIME
|
|
797 yes ImmGetDescription
|
|
798 yes ImmGetIMEFileName
|
|
799 yes ImmGetCompositionString
|
|
800 yes ImmSetCompositionString
|
|
801 yes ImmGetCandidateListCount
|
|
802 yes ImmGetCandidateList
|
|
803 yes ImmGetGuideLine
|
|
804 skip ImmGetCompositionFont split-sized LOGFONT
|
|
805 skip ImmSetCompositionFont split-sized LOGFONT
|
|
806 yes ImmConfigureIME // split-simple REGISTERWORD
|
|
807 yes ImmEscape // strings of various sorts
|
|
808 yes ImmGetConversionList
|
|
809 yes ImmIsUIMessage
|
|
810 yes ImmRegisterWord
|
|
811 yes ImmUnregisterWord
|
|
812 no ImmGetRegisterWordStyle split-sized STYLEBUF
|
|
813 split ImmEnumRegisterWord REGISTERWORDENUMPROC
|
|
814 no ImmGetImeMenuItems split-sized IMEMENUITEMINFO
|
|
815 end-bracket
|
|
816
|
|
817 file MMSYSTEM.H
|
|
818
|
|
819 yes sndPlaySound
|
|
820 yes PlaySound
|
|
821 no waveOutGetDevCaps split-sized LPWAVEOUTCAPS
|
|
822 yes waveOutGetErrorText
|
|
823 no waveInGetDevCaps split-sized LPWAVEINCAPS
|
|
824 yes waveInGetErrorText
|
|
825 no midiOutGetDevCaps split-sized LPMIDIOUTCAPS
|
|
826 yes midiOutGetErrorText
|
|
827 no midiInGetDevCaps split-sized LPMIDIOUTCAPS
|
|
828 yes midiInGetErrorText
|
|
829 no auxGetDevCaps split-sized LPAUXCAPS
|
|
830 no mixerGetDevCaps split-sized LPMIXERCAPS
|
|
831 no mixerGetLineInfo split-sized LPMIXERLINE
|
|
832 no mixerGetLineControls split-sized LPMIXERCONTROL
|
|
833 no mixerGetControlDetails split-sized LPMIXERCONTROL in LPMIXERLINECONTROLS in LPMIXERCONTROLDETAILS
|
|
834 no joyGetDevCaps split-sized LPJOYCAPS
|
|
835 yes mmioStringToFOURCC
|
|
836 yes mmioInstallIOProc
|
|
837 yes mmioOpen
|
|
838 yes mmioRename
|
|
839 yes mciSendCommand
|
|
840 yes mciSendString
|
|
841 yes mciGetDeviceID
|
|
842 begin-bracket !defined (MINGW)
|
778
|
843 no mciGetDeviceIDFromElementID missing from Win98se version of ADVAPI32.dll
|
771
|
844 end-bracket
|
|
845 yes mciGetErrorString
|
|
846
|
|
847 file WINNETWK.H
|
|
848
|
|
849 begin-bracket defined (HAVE_MS_WINDOWS)
|
|
850 yes WNetAddConnection
|
|
851 split WNetAddConnection2 LPNETRESOURCE
|
|
852 split WNetAddConnection3 LPNETRESOURCE
|
|
853 yes WNetCancelConnection
|
|
854 yes WNetCancelConnection2
|
|
855 yes WNetGetConnection
|
|
856 split WNetUseConnection LPNETRESOURCE
|
|
857 split WNetConnectionDialog1 LPCONNECTDLGSTRUCT contains split-simple LPNETRESOURCE
|
|
858 split WNetDisconnectDialog1 LPDISCDLGSTRUCT
|
|
859 split WNetOpenEnum LPNETRESOURCE
|
|
860 yes WNetEnumResource
|
|
861 yes WNetGetUniversalName
|
|
862 yes WNetGetUser
|
|
863 yes WNetGetProviderName
|
|
864 yes WNetGetNetworkInformation
|
|
865 // split-simple function pointer PFNGETPROFILEPATH
|
|
866 // split-simple function pointer PFNRECONCILEPROFILE
|
|
867 // split-simple function pointer PFNPROCESSPOLICIES
|
|
868 yes WNetGetLastError
|
|
869 split MultinetGetConnectionPerformance LPNETRESOURCE
|
|
870 end-bracket
|
|
871
|
|
872 file IME.H
|
|
873
|
|
874 no SendIMEMessageEx obsolete, no docs available
|
|
875
|
|
876 file OBJBASE.H
|
|
877
|
|
878 // nothing
|
|
879
|
|
880 file SHLOBJ.H
|
|
881
|
|
882 // #### split code for IContextMenu not yet written
|
|
883 // split flag constant GCS_VERB of IContextMenu::GetCommandString
|
|
884 // split flag constant GCS_HELPTEXT of IContextMenu::GetCommandString
|
|
885 // split flag constant GCS_VALIDATE of IContextMenu::GetCommandString
|
|
886 // split string constant CMDSTR_NEWFOLDER of CMINVOKECOMMANDINFO.lpVerb or CMINVOKECOMMANDINFOEX.lpVerbW of IContextMenu::InvokeCommand
|
|
887 // split string constant CMDSTR_VIEWLIST of same
|
|
888 // split string constant CMDSTR_VIEWDETAILS of same
|
|
889 // #### split code for IExtractIcon, IShellLink, IShellExecuteHook, INewShortcutHook, ICopyHook, IFileViewer not yet written
|
|
890 // split interface IExtractIcon
|
|
891 // split interface IShellLink
|
|
892 // split interface IShellExecuteHook
|
|
893 // split interface INewShortcutHook
|
|
894 // split interface ICopyHook
|
|
895 // split interface IFileViewer
|
|
896 yes SHGetPathFromIDList
|
|
897 skip SHGetSpecialFolderPath error in Cygwin prototype, missing from Cygwin libraries
|
|
898 // split-simple structure BROWSEINFO used in SHBrowseForFolder
|
|
899 skip SHBrowseForFolder need to intercept callback for SendMessage
|
|
900 // split message BFFM_SETSTATUSTEXT handled in qxeSendMessage
|
|
901 // split message BFFM_SETSELECTION handled in qxeSendMessage
|
|
902 // split message BFFM_VALIDATEFAILED handled in qxeSHBrowseForFolder intercept proc
|
|
903 // #### code to handle split clipboard formats not yet written. this will
|
|
904 // #### be tricky -- all functions that use such clipboard formats need to
|
|
905 // #### be split, and the data itself munged. this may be too much effort,
|
|
906 // #### and we may just need to require that the app itself does the
|
|
907 // #### splitting.
|
|
908 // split clipboard format CFSTR_FILEDESCRIPTOR
|
|
909 // split clipboard format CFSTR_FILENAME
|
|
910 // split clipboard format CFSTR_FILENAMEMAP
|
|
911 // split-sized structure FILEDESCRIPTOR
|
|
912 // split-sized structure FILEGROUPDESCRIPTOR
|
|
913 // split flag SHCNF_PATH; we intercept SHChangeNotify
|
|
914 // split flag SHCNF_PRINTER; we intercept SHChangeNotify
|
|
915 // split flag SHARD_PATH; we intercept SHAddToRecentDocs
|
|
916 skip SHGetDataFromIDList split-sized WIN32_FIND_DATA or split-simple NETRESOURCE, missing from Cygwin libraries
|
|
917
|
|
918 file WINNLS.H
|
|
919
|
798
|
920 no LOCALE_ENUMPROC not used, not examined yet
|
|
921 no CODEPAGE_ENUMPROC not used, not examined yet
|
|
922 no DATEFMT_ENUMPROC not used, not examined yet
|
|
923 no DATEFMT_ENUMPROCEX not used, not examined yet
|
|
924 no TIMEFMT_ENUMPROC not used, not examined yet
|
|
925 no CALINFO_ENUMPROC not used, not examined yet
|
|
926 no CALINFO_ENUMPROCEX not used, not examined yet
|
|
927 no GetCPInfoEx not used, not examined yet
|
|
928 no CompareString not used, not examined yet
|
|
929 no LCMapString not used, not examined yet
|
|
930 yes GetLocaleInfo
|
|
931 yes SetLocaleInfo
|
|
932 no GetTimeFormat not used, not examined yet
|
|
933 no GetDateFormat not used, not examined yet
|
|
934 no GetNumberFormat not used, not examined yet
|
|
935 no GetCurrencyFormat not used, not examined yet
|
|
936 no EnumCalendarInfo not used, not examined yet
|
|
937 no EnumCalendarInfoEx not used, not examined yet
|
|
938 no EnumTimeFormats not used, not examined yet
|
|
939 no EnumDateFormats not used, not examined yet
|
|
940 no EnumDateFormatsEx not used, not examined yet
|
|
941 no GetStringTypeEx not used, not examined yet
|
800
|
942 no GetStringType no such fun; A and W versions have different nos. of args
|
798
|
943 no FoldString not used, not examined yet
|
|
944 no EnumSystemLocales not used, not examined yet
|
|
945 no EnumSystemCodePages not used, not examined yet
|
|
946
|
|
947 end-unicode-encapsulation-script
|
771
|
948
|
|
949 file WINVER.H
|
|
950
|
|
951 VerFindFile
|
|
952 VerInstallFile
|
|
953 GetFileVersionInfoSize
|
|
954 GetFileVersionInfo
|
|
955 VerLanguageName
|
|
956 VerQueryValue
|
|
957
|
|
958 begin-unicode-encapsulation-script
|
|
959
|
|
960 file WINCON.H
|
|
961
|
|
962 yes PeekConsoleInput
|
|
963 yes ReadConsoleInput
|
|
964 yes WriteConsoleInput
|
|
965 yes ReadConsoleOutput
|
|
966 yes WriteConsoleOutput
|
|
967 yes ReadConsoleOutputCharacter
|
|
968 yes WriteConsoleOutputCharacter
|
|
969 no FillConsoleOutputCharacter split CHAR
|
|
970 yes ScrollConsoleScreenBuffer
|
|
971 yes GetConsoleTitle
|
|
972 yes SetConsoleTitle
|
|
973 yes ReadConsole
|
|
974 yes WriteConsole
|
|
975
|
|
976 file WINREG.H
|
|
977
|
|
978 skip RegConnectRegistry error in Cygwin prototype
|
|
979 yes RegCreateKey
|
|
980 yes RegCreateKeyEx
|
|
981 yes RegDeleteKey
|
|
982 yes RegDeleteValue
|
|
983 yes RegEnumKey
|
|
984 yes RegEnumKeyEx
|
|
985 yes RegEnumValue
|
|
986 yes RegLoadKey
|
|
987 yes RegOpenKey
|
|
988 yes RegOpenKeyEx
|
|
989 yes RegQueryInfoKey
|
|
990 yes RegQueryValue
|
|
991 split RegQueryMultipleValues PVALENT
|
|
992 yes RegQueryValueEx
|
|
993 yes RegReplaceKey
|
|
994 yes RegRestoreKey
|
|
995 yes RegSaveKey
|
|
996 yes RegSetValue
|
|
997 yes RegSetValueEx
|
|
998 yes RegUnLoadKey
|
|
999 yes InitiateSystemShutdown
|
|
1000 yes AbortSystemShutdown
|
|
1001
|
|
1002 file EXCPT.H
|
|
1003
|
|
1004 // nothing
|
|
1005
|
|
1006 file STDARG.H
|
|
1007
|
|
1008 // nothing
|
|
1009
|
|
1010 file CDERR.H
|
|
1011
|
|
1012 // nothing
|
|
1013
|
|
1014 file WINPERF.H
|
|
1015
|
|
1016 // nothing
|
|
1017
|
|
1018 file RPC.H
|
|
1019
|
|
1020 // nothing
|
|
1021
|
|
1022 file NB30.H
|
|
1023
|
|
1024 // nothing
|
|
1025
|
800
|
1026 end-unicode-encapsulation-script
|
|
1027
|
771
|
1028 file WINSOCK2.H
|
|
1029
|
|
1030 SO_PROTOCOL_INFO
|
|
1031 SERVICE_TYPE_VALUE_SAPID
|
|
1032 SERVICE_TYPE_VALUE_TCPPORT
|
|
1033 SERVICE_TYPE_VALUE_UDPPORT
|
|
1034 SERVICE_TYPE_VALUE_OBJECTID
|
|
1035 WSADuplicateSocket
|
|
1036 LPFN_WSADUPLICATESOCKET
|
|
1037 WSAEnumProtocols
|
|
1038 LPFN_WSAENUMPROTOCOLS
|
|
1039 WSASocket
|
|
1040 LPFN_WSASOCKET
|
|
1041 WSAAddressToString
|
|
1042 LPFN_WSAADDRESSTOSTRING
|
|
1043 WSAStringToAddress
|
|
1044 LPFN_WSASTRINGTOADDRESS
|
|
1045 WSALookupServiceBegin
|
|
1046 LPFN_WSALOOKUPSERVICEBEGIN
|
|
1047 WSALookupServiceNext
|
|
1048 LPFN_WSALOOKUPSERVICENEXT
|
|
1049 WSAInstallServiceClass
|
|
1050 LPFN_WSAINSTALLSERVICECLASS
|
|
1051 WSAGetServiceClassInfo
|
|
1052 LPFN_WSAGETSERVICECLASSINFO
|
|
1053 WSAEnumNameSpaceProviders
|
|
1054 LPFN_WSAENUMNAMESPACEPROVIDERS
|
|
1055 WSAGetServiceClassNameByClassId
|
|
1056 LPFN_WSAGETSERVICECLASSNAMEBYCLASSID
|
|
1057 WSASetService
|
|
1058 LPFN_WSASETSERVICE
|
|
1059
|
|
1060 file WINCRYPT.H
|
|
1061
|
|
1062 MS_DEF_PROV_
|
|
1063 MS_ENHANCED_PROV_
|
|
1064 MS_DEF_RSA_SIG_PROV_
|
|
1065 MS_DEF_RSA_SCHANNEL_PROV_
|
|
1066 MS_ENHANCED_RSA_SCHANNEL_PROV_
|
|
1067 MS_DEF_DSS_PROV_
|
|
1068 MS_DEF_DSS_DH_PROV_
|
|
1069 CryptAcquireContext
|
|
1070 CryptSignHash
|
|
1071 CryptVerifySignature
|
|
1072 CryptSetProvider
|
|
1073 CryptSetProviderEx
|
|
1074 CryptGetDefaultProvider
|
|
1075 CryptEnumProviderTypes
|
|
1076 CryptEnumProviders
|
|
1077 CERT_STORE_PROV_FILENAME_
|
|
1078 CERT_STORE_PROV_SYSTEM_
|
|
1079 sz_CERT_STORE_PROV_FILENAME_
|
|
1080 sz_CERT_STORE_PROV_SYSTEM_
|
|
1081 CERT_STORE_SAVE_TO_FILENAME_
|
|
1082 CERT_FIND_SUBJECT_STR_
|
|
1083 CERT_FIND_ISSUER_STR_
|
|
1084 CertRDNValueToStr
|
|
1085 CertNameToStr
|
|
1086 CertStrToName
|
|
1087 CertOpenSystemStore
|
|
1088 CertAddEncodedCertificateToSystemStore
|
|
1089
|
|
1090 */
|
|
1091
|
|
1092 /* the functions below are examples of hand-written Unicode-splitting
|
|
1093 code. note that it needs to be written very carefully and with
|
|
1094 intimate knowledge of the structures involved, and can sometimes be
|
|
1095 very hairy (EnumFontFamiliesEx is the most extreme example). it can
|
|
1096 be argued with some justification that this behind-the-scenes magic
|
|
1097 is confusing and potentially dangerous, and shouldn't be done. but
|
|
1098 making the calling code deal with the results in extremely hard-to-
|
|
1099 read code and is very error-prone. */
|
|
1100
|
|
1101
|
|
1102 /************************************************************************/
|
|
1103 /* would be encapsulatable but for parsing problems */
|
|
1104 /************************************************************************/
|
|
1105
|
|
1106 /* NOTE: return value is conditionalized on _MAC, messes up parser */
|
|
1107 LRESULT
|
|
1108 qxeDefWindowProc (HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam)
|
|
1109 {
|
|
1110 if (XEUNICODE_P)
|
|
1111 return DefWindowProcW (hWnd, Msg, wParam, lParam);
|
|
1112 else
|
|
1113 return DefWindowProcA (hWnd, Msg, wParam, lParam);
|
|
1114 }
|
|
1115
|
|
1116
|
|
1117 /* NOTE: two versions, STRICT and non-STRICT */
|
|
1118 LRESULT
|
|
1119 qxeCallWindowProc (WNDPROC lpPrevWndFunc, HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam)
|
|
1120 {
|
|
1121 if (XEUNICODE_P)
|
|
1122 return CallWindowProcW (lpPrevWndFunc, hWnd, Msg, wParam, lParam);
|
|
1123 else
|
|
1124 return CallWindowProcA (lpPrevWndFunc, hWnd, Msg, wParam, lParam);
|
|
1125 }
|
|
1126
|
|
1127 /* NOTE: return value is conditionalized on _MAC, messes up parser */
|
|
1128 LRESULT
|
|
1129 qxeDefDlgProc (HWND hDlg, UINT Msg, WPARAM wParam, LPARAM lParam)
|
|
1130 {
|
|
1131 if (XEUNICODE_P)
|
|
1132 return DefDlgProcW (hDlg, Msg, wParam, lParam);
|
|
1133 else
|
|
1134 return DefDlgProcA (hDlg, Msg, wParam, lParam);
|
|
1135 }
|
|
1136
|
|
1137 /* NOTE: return value is conditionalized on _MAC, messes up parser */
|
|
1138 LRESULT
|
|
1139 qxeDefMDIChildProc (HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
|
|
1140 {
|
|
1141 if (XEUNICODE_P)
|
|
1142 return DefMDIChildProcW (hWnd, uMsg, wParam, lParam);
|
|
1143 else
|
|
1144 return DefMDIChildProcA (hWnd, uMsg, wParam, lParam);
|
|
1145 }
|
|
1146
|
800
|
1147 /* This one has two entry points called GetEnvironmentStringsW and
|
|
1148 GetEnvironmentStrings. (misnamed A version) */
|
|
1149 Extbyte *
|
|
1150 qxeGetEnvironmentStrings (void)
|
|
1151 {
|
|
1152 if (XEUNICODE_P)
|
|
1153 return (Extbyte *) GetEnvironmentStringsW ();
|
|
1154 else
|
|
1155 return (Extbyte *) GetEnvironmentStrings ();
|
|
1156 }
|
|
1157
|
771
|
1158
|
|
1159 /************************************************************************/
|
|
1160 /* would be encapsulatable but for Cygwin problems */
|
|
1161 /************************************************************************/
|
|
1162
|
|
1163 LONG
|
|
1164 qxeRegConnectRegistry (const Extbyte * lpMachineName, HKEY hKey, PHKEY phkResult)
|
|
1165 {
|
|
1166 /* Cygwin mistakenly omits const in first argument. */
|
|
1167 if (XEUNICODE_P)
|
|
1168 return RegConnectRegistryW ((LPWSTR) lpMachineName, hKey, phkResult);
|
|
1169 else
|
|
1170 return RegConnectRegistryA ((LPSTR) lpMachineName, hKey, phkResult);
|
|
1171 }
|
|
1172
|
1111
|
1173 HSZ
|
|
1174 qxeDdeCreateStringHandle (DWORD idInst, const Extbyte * psz, int iCodePage)
|
|
1175 {
|
|
1176 /* Cygwin mistakenly omits const in second argument. */
|
|
1177 if (XEUNICODE_P)
|
|
1178 return DdeCreateStringHandleW (idInst, (LPWSTR) psz, iCodePage);
|
|
1179 else
|
|
1180 return DdeCreateStringHandleA (idInst, (LPSTR) psz, iCodePage);
|
|
1181 }
|
|
1182
|
771
|
1183 /* NOTE: NT 4.0+ only */
|
|
1184 UINT
|
|
1185 qxeExtractIconEx (const Extbyte * lpszFile, int nIconIndex, HICON FAR * phiconLarge, HICON FAR * phiconSmall, UINT nIcons)
|
|
1186 {
|
|
1187 /* Cygwin mistakenly declares the return type as HICON. */
|
|
1188 if (XEUNICODE_P)
|
|
1189 return (UINT) ExtractIconExW ((LPCWSTR) lpszFile, nIconIndex, phiconLarge, phiconSmall, nIcons);
|
|
1190 else
|
|
1191 return (UINT) ExtractIconExA ((LPCSTR) lpszFile, nIconIndex, phiconLarge, phiconSmall, nIcons);
|
|
1192 }
|
|
1193
|
|
1194 /* NOTE: NT 4.0+ only */
|
|
1195 BOOL
|
|
1196 qxeGetICMProfile (HDC arg1, LPDWORD arg2, Extbyte * arg3)
|
|
1197 {
|
|
1198 #ifdef CYGWIN_HEADERS
|
|
1199 /* Cygwin mistakenly declares the second argument as DWORD. */
|
|
1200 if (XEUNICODE_P)
|
|
1201 return GetICMProfileW (arg1, (DWORD) arg2, (LPWSTR) arg3);
|
|
1202 else
|
|
1203 return GetICMProfileA (arg1, (DWORD) arg2, (LPSTR) arg3);
|
|
1204 #else
|
|
1205 if (XEUNICODE_P)
|
|
1206 return GetICMProfileW (arg1, arg2, (LPWSTR) arg3);
|
|
1207 else
|
|
1208 return GetICMProfileA (arg1, arg2, (LPSTR) arg3);
|
|
1209 #endif /* CYGWIN_HEADERS */
|
|
1210 }
|
|
1211
|
|
1212 /* NOTE: NT 4.0+ only */
|
|
1213 BOOL
|
|
1214 qxeUpdateICMRegKey (DWORD arg1, Extbyte * arg2, Extbyte * arg3, UINT arg4)
|
|
1215 {
|
|
1216 #ifdef CYGWIN_HEADERS
|
|
1217 /* Cygwin mistakenly declares the second argument as DWORD. */
|
|
1218 if (XEUNICODE_P)
|
|
1219 return UpdateICMRegKeyW (arg1, (DWORD) arg2, (LPWSTR) arg3, arg4);
|
|
1220 else
|
|
1221 return UpdateICMRegKeyA (arg1, (DWORD) arg2, (LPSTR) arg3, arg4);
|
|
1222 #else
|
|
1223 if (XEUNICODE_P)
|
|
1224 return UpdateICMRegKeyW (arg1, (LPWSTR) arg2, (LPWSTR) arg3, arg4);
|
|
1225 else
|
|
1226 return UpdateICMRegKeyA (arg1, (LPSTR) arg2, (LPSTR) arg3, arg4);
|
|
1227 #endif /* CYGWIN_HEADERS */
|
|
1228 }
|
|
1229
|
|
1230 #ifndef CYGWIN /* present in headers but missing in shell32.a */
|
|
1231
|
|
1232 BOOL
|
|
1233 qxeSHGetSpecialFolderPath (HWND hwndOwner, Extbyte * lpszPath, int nFolder, BOOL fCreate)
|
|
1234 {
|
|
1235 #ifdef CYGWIN_HEADERS
|
|
1236 /* Cygwin mistakenly declares the second argument as LPSTR in both
|
|
1237 versions. */
|
|
1238 if (XEUNICODE_P)
|
|
1239 return SHGetSpecialFolderPathW (hwndOwner, (LPSTR) lpszPath, nFolder, fCreate);
|
|
1240 else
|
|
1241 return SHGetSpecialFolderPathA (hwndOwner, (LPSTR) lpszPath, nFolder, fCreate);
|
|
1242 #else
|
|
1243 if (XEUNICODE_P)
|
|
1244 return SHGetSpecialFolderPathW (hwndOwner, (LPWSTR) lpszPath, nFolder, fCreate);
|
|
1245 else
|
|
1246 return SHGetSpecialFolderPathA (hwndOwner, (LPSTR) lpszPath, nFolder, fCreate);
|
|
1247 #endif
|
|
1248 }
|
|
1249
|
|
1250 #endif /* not CYGWIN */
|
|
1251
|
|
1252
|
|
1253 /************************************************************************/
|
|
1254 /* files */
|
|
1255 /************************************************************************/
|
|
1256
|
|
1257 static void
|
|
1258 copy_win32_find_dataa_to_win32_find_dataw (const WIN32_FIND_DATAA *pa,
|
|
1259 WIN32_FIND_DATAW *pw)
|
|
1260 {
|
|
1261 /* the layout of WIN32_FIND_DATA is
|
|
1262
|
|
1263 non-split fields;
|
|
1264 TCHAR cFileName[...];
|
|
1265 TCHAR cAlternateFileName[...];
|
|
1266 */
|
|
1267
|
|
1268 xzero (*pw);
|
|
1269 memcpy (pw, pa, offsetof (WIN32_FIND_DATAA, cFileName));
|
|
1270 memcpy (pw->cFileName, pa->cFileName, sizeof (pa->cFileName));
|
|
1271 memcpy (pw->cAlternateFileName, pa->cAlternateFileName,
|
|
1272 sizeof (pa->cAlternateFileName));
|
|
1273 }
|
|
1274
|
|
1275 HANDLE
|
|
1276 qxeFindFirstFile (const Extbyte *lpFileName,
|
|
1277 WIN32_FIND_DATAW *lpFindFileData)
|
|
1278 {
|
|
1279 if (XEUNICODE_P)
|
|
1280 return FindFirstFileW ((LPCWSTR) lpFileName, lpFindFileData);
|
|
1281 else
|
|
1282 {
|
|
1283 WIN32_FIND_DATAA ansidat;
|
|
1284 HANDLE retval;
|
|
1285
|
|
1286 retval = FindFirstFileA ((LPCSTR) lpFileName, &ansidat);
|
|
1287 if (retval != INVALID_HANDLE_VALUE)
|
|
1288 copy_win32_find_dataa_to_win32_find_dataw (&ansidat, lpFindFileData);
|
|
1289 return retval;
|
|
1290 }
|
|
1291 }
|
|
1292
|
|
1293 BOOL
|
|
1294 qxeFindNextFile (HANDLE hFindFile, WIN32_FIND_DATAW *lpFindFileData)
|
|
1295 {
|
|
1296 if (XEUNICODE_P)
|
|
1297 return FindNextFileW (hFindFile, lpFindFileData);
|
|
1298 else
|
|
1299 {
|
|
1300 WIN32_FIND_DATAA ansidat;
|
|
1301 BOOL retval;
|
|
1302
|
|
1303 retval = FindNextFileA (hFindFile, &ansidat);
|
|
1304 if (retval)
|
|
1305 copy_win32_find_dataa_to_win32_find_dataw (&ansidat, lpFindFileData);
|
|
1306 return retval;
|
|
1307 }
|
|
1308 }
|
|
1309
|
|
1310
|
|
1311 /************************************************************************/
|
|
1312 /* shell */
|
|
1313 /************************************************************************/
|
|
1314
|
|
1315 static void
|
|
1316 copy_shfileinfoa_to_shfileinfow (const SHFILEINFOA *pa,
|
778
|
1317 SHFILEINFOW *pw, UINT sz)
|
771
|
1318 {
|
|
1319 /* the layout of SHFILEINFO is
|
|
1320
|
|
1321 non-split fields;
|
|
1322 TCHAR szDisplayName[...];
|
|
1323 TCHAR szTypeName[...];
|
|
1324 */
|
|
1325
|
778
|
1326 assert (sz >= sizeof (SHFILEINFOW));
|
771
|
1327 xzero (*pw);
|
|
1328 memcpy (pw, pa, offsetof (SHFILEINFOA, szDisplayName));
|
|
1329 memcpy (pw->szDisplayName, pa->szDisplayName, sizeof (pa->szDisplayName));
|
|
1330 memcpy (pw->szTypeName, pa->szTypeName, sizeof (pa->szTypeName));
|
|
1331 }
|
|
1332
|
|
1333 DWORD
|
|
1334 qxeSHGetFileInfo (const Extbyte *pszPath, DWORD dwFileAttributes,
|
|
1335 SHFILEINFOW *psfi, UINT cbFileInfo, UINT uFlags)
|
|
1336 {
|
|
1337 if (XEUNICODE_P)
|
|
1338 return SHGetFileInfoW ((LPCWSTR) pszPath, dwFileAttributes,
|
|
1339 psfi, cbFileInfo, uFlags);
|
|
1340 else
|
|
1341 {
|
|
1342 SHFILEINFOA ansidat;
|
|
1343 BOOL retval;
|
|
1344
|
|
1345 retval = SHGetFileInfoA ((LPCSTR) pszPath, dwFileAttributes,
|
778
|
1346 (SHFILEINFOA FAR *) &ansidat,
|
|
1347 cbFileInfo ? sizeof (ansidat) : 0, uFlags);
|
|
1348 if (retval && cbFileInfo)
|
|
1349 copy_shfileinfoa_to_shfileinfow (&ansidat, psfi, cbFileInfo);
|
771
|
1350 return retval;
|
|
1351 }
|
|
1352 }
|
|
1353
|
|
1354 struct intercepted_SHBrowseForFolder
|
|
1355 {
|
|
1356 BFFCALLBACK lpfn;
|
|
1357 LPARAM lParam;
|
|
1358 HWND hwnd;
|
|
1359 struct intercepted_SHBrowseForFolder *next;
|
|
1360 };
|
|
1361
|
|
1362 static struct intercepted_SHBrowseForFolder *SHBrowseForFolder_list;
|
|
1363
|
|
1364 static int
|
|
1365 CALLBACK intercepted_SHBrowseForFolder_proc (HWND hwnd, UINT msg,
|
|
1366 LPARAM lParam, LPARAM lpData)
|
|
1367 {
|
|
1368 struct intercepted_SHBrowseForFolder *s =
|
|
1369 (struct intercepted_SHBrowseForFolder *) lpData;
|
|
1370
|
|
1371 if (s->hwnd == 0)
|
|
1372 s->hwnd = hwnd;
|
|
1373 if (s->lpfn)
|
|
1374 {
|
|
1375 /* see below */
|
|
1376 if (XEUNICODE_P && msg == BFFM_VALIDATEFAILEDW)
|
|
1377 msg = BFFM_VALIDATEFAILEDA;
|
|
1378 else if (!XEUNICODE_P && msg == BFFM_VALIDATEFAILEDA)
|
|
1379 msg = BFFM_VALIDATEFAILEDW;
|
|
1380 return (s->lpfn) (hwnd, msg, lParam, s->lParam);
|
|
1381 }
|
|
1382 else
|
|
1383 return 0;
|
|
1384 }
|
|
1385
|
1204
|
1386 #ifdef HAVE_MS_WINDOWS
|
|
1387
|
771
|
1388 static int
|
|
1389 is_SHBrowseForFolder (HWND hwnd)
|
|
1390 {
|
|
1391 struct intercepted_SHBrowseForFolder *s;
|
|
1392
|
|
1393 for (s = SHBrowseForFolder_list; s; s = s->next)
|
|
1394 if (s->hwnd == hwnd)
|
|
1395 return 1;
|
|
1396 return 0;
|
|
1397 }
|
|
1398
|
1204
|
1399 #endif /* HAVE_MS_WINDOWS */
|
|
1400
|
771
|
1401 LPITEMIDLIST
|
|
1402 qxeSHBrowseForFolder (LPBROWSEINFOW lpbi)
|
|
1403 {
|
|
1404 struct intercepted_SHBrowseForFolder s;
|
|
1405 LPITEMIDLIST retval;
|
|
1406
|
|
1407 /* There are two outgoing Unicode-split messages:
|
|
1408
|
|
1409 BFFM_SETSELECTION
|
|
1410 BFFM_SETSTATUSTEXT
|
|
1411
|
|
1412 and one incoming:
|
|
1413
|
|
1414 BFFM_VALIDATEFAILED
|
|
1415
|
|
1416 To handle this, we need to intercept the callback. We handle the
|
|
1417 incoming message in the callback, and record the window; when
|
|
1418 qxeSendMessage() is called, we handle the outgoing messages. None of
|
|
1419 the messages have split-sized structures so we don't need to do
|
|
1420 anything complicated there. */
|
|
1421
|
|
1422 s.lParam = lpbi->lParam;
|
|
1423 s.lpfn = lpbi->lpfn;
|
|
1424 s.next = SHBrowseForFolder_list;
|
|
1425 s.hwnd = 0;
|
|
1426 SHBrowseForFolder_list = &s;
|
|
1427
|
|
1428 lpbi->lpfn = intercepted_SHBrowseForFolder_proc;
|
|
1429 lpbi->lParam = (LPARAM) &s;
|
|
1430
|
|
1431 if (XEUNICODE_P)
|
|
1432 retval = SHBrowseForFolderW (lpbi);
|
|
1433 else
|
|
1434 retval = SHBrowseForFolderA ((LPBROWSEINFOA) lpbi);
|
|
1435 SHBrowseForFolder_list = SHBrowseForFolder_list->next;
|
|
1436 return retval;
|
|
1437 }
|
|
1438
|
|
1439 VOID
|
|
1440 qxeSHAddToRecentDocs (UINT uFlags, LPCVOID pv)
|
|
1441 {
|
|
1442 /* pv can be a string pointer; this is handled by Unicode-splitting the
|
|
1443 flag SHARD_PATH rather than the function itself. Fix up the flag to
|
|
1444 be correct. We write it symmetrically so it doesn't matter whether
|
|
1445 UNICODE is defined. */
|
|
1446 if (XEUNICODE_P)
|
|
1447 {
|
|
1448 if (uFlags & SHARD_PATHA)
|
|
1449 {
|
|
1450 uFlags |= SHARD_PATHW;
|
|
1451 uFlags &= ~SHARD_PATHA;
|
|
1452 }
|
|
1453 }
|
|
1454 else
|
|
1455 {
|
|
1456 if (uFlags & SHARD_PATHW)
|
|
1457 {
|
|
1458 uFlags |= SHARD_PATHA;
|
|
1459 uFlags &= ~SHARD_PATHW;
|
|
1460 }
|
|
1461 }
|
|
1462 SHAddToRecentDocs (uFlags, pv);
|
|
1463 }
|
|
1464
|
|
1465 VOID
|
|
1466 qxeSHChangeNotify (LONG wEventId, UINT uFlags, LPCVOID dwItem1,
|
|
1467 LPCVOID dwItem2)
|
|
1468 {
|
|
1469 /* works like SHAddToRecentDocs */
|
|
1470 if (XEUNICODE_P)
|
|
1471 {
|
|
1472 if (uFlags & SHCNF_PATHA)
|
|
1473 {
|
|
1474 uFlags |= SHCNF_PATHW;
|
|
1475 uFlags &= ~SHCNF_PATHA;
|
|
1476 }
|
|
1477 if (uFlags & SHCNF_PRINTERA)
|
|
1478 {
|
|
1479 uFlags |= SHCNF_PRINTERW;
|
|
1480 uFlags &= ~SHCNF_PRINTERA;
|
|
1481 }
|
|
1482 }
|
|
1483 else
|
|
1484 {
|
|
1485 if (uFlags & SHCNF_PATHW)
|
|
1486 {
|
|
1487 uFlags |= SHCNF_PATHA;
|
|
1488 uFlags &= ~SHCNF_PATHW;
|
|
1489 }
|
|
1490 if (uFlags & SHCNF_PRINTERW)
|
|
1491 {
|
|
1492 uFlags |= SHCNF_PRINTERA;
|
|
1493 uFlags &= ~SHCNF_PRINTERW;
|
|
1494 }
|
|
1495 }
|
|
1496 SHChangeNotify (wEventId, uFlags, dwItem1, dwItem2);
|
|
1497 }
|
|
1498
|
|
1499 #ifndef CYGWIN /* present in headers but missing in shell32.a */
|
|
1500
|
|
1501 HRESULT
|
|
1502 qxeSHGetDataFromIDList (IShellFolder *psf, LPCITEMIDLIST pidl, int nFormat,
|
|
1503 PVOID pv, int cb)
|
|
1504 {
|
|
1505 if (XEUNICODE_P)
|
|
1506 return SHGetDataFromIDListW (psf, pidl, nFormat, pv, cb);
|
|
1507 else if (nFormat == SHGDFIL_FINDDATA)
|
|
1508 {
|
|
1509 WIN32_FIND_DATAA ansidat;
|
|
1510 BOOL retval;
|
|
1511
|
|
1512 retval = SHGetDataFromIDListA (psf, pidl, nFormat, &ansidat, cb);
|
|
1513 if (retval == NOERROR)
|
1204
|
1514 copy_win32_find_dataa_to_win32_find_dataw (&ansidat,
|
|
1515 (WIN32_FIND_DATAW *) pv);
|
771
|
1516 return retval;
|
|
1517 }
|
|
1518 else
|
|
1519 /* nFormat == SHGDFIL_NETRESOURCE, and pv is split-simple NETRESOURCE
|
|
1520 structure, but we don't need to worry about that currently since we
|
|
1521 don't translate strings */
|
|
1522 return SHGetDataFromIDListA (psf, pidl, nFormat, pv, cb);
|
|
1523 }
|
|
1524
|
|
1525 #endif /* not CYGWIN */
|
|
1526
|
|
1527
|
|
1528
|
|
1529 #ifdef HAVE_MS_WINDOWS
|
|
1530
|
|
1531 /************************************************************************/
|
|
1532 /* devmode */
|
|
1533 /************************************************************************/
|
|
1534
|
|
1535 /* These functions return globally allocated blocks because some
|
|
1536 callers (e.g. qxePrintDlg) want this. */
|
|
1537
|
|
1538 static HGLOBAL
|
|
1539 copy_devmodew_to_devmodea (const DEVMODEW *src, DEVMODEA *dst)
|
|
1540 {
|
|
1541 /* the layout of DEVMODE is
|
|
1542
|
|
1543 TCHAR dmDeviceName[...];
|
|
1544 non-split fields, including dmSize (size of structure; differs between
|
|
1545 Unicode and ANSI) and dmDriverExtra;
|
|
1546 TCHAR dmFormName[...];
|
|
1547 non-split fields;
|
|
1548 extra data, of size DEVMODE->dmDriverExtra
|
|
1549 */
|
|
1550 HGLOBAL hdst = NULL;
|
|
1551
|
|
1552 if (!dst)
|
|
1553 {
|
|
1554 hdst = GlobalAlloc (GHND, src->dmSize + src->dmDriverExtra -
|
|
1555 (sizeof (DEVMODEW) - sizeof (DEVMODEA)));
|
|
1556 dst = (DEVMODEA *) GlobalLock (hdst);
|
|
1557 }
|
|
1558
|
|
1559 memcpy (dst->dmDeviceName, src->dmDeviceName, sizeof (dst->dmDeviceName));
|
|
1560 memcpy ((char *) dst + sizeof (dst->dmDeviceName),
|
|
1561 (char *) src + sizeof (src->dmDeviceName),
|
|
1562 offsetof (DEVMODEA, dmFormName) - sizeof (dst->dmDeviceName));
|
|
1563 dst->dmSize -= sizeof (DEVMODEW) - sizeof (DEVMODEA);
|
|
1564 memcpy (dst->dmFormName, src->dmFormName, sizeof (dst->dmFormName));
|
|
1565 memcpy ((char *) dst + offsetof (DEVMODEA, dmFormName) +
|
|
1566 sizeof (dst->dmFormName),
|
|
1567 (char *) src + offsetof (DEVMODEW, dmFormName) +
|
|
1568 sizeof (src->dmFormName),
|
|
1569 dst->dmSize + dst->dmDriverExtra -
|
|
1570 (offsetof (DEVMODEA, dmFormName) + sizeof (dst->dmFormName)));
|
|
1571
|
|
1572 if (hdst)
|
|
1573 GlobalUnlock (hdst);
|
|
1574 return hdst;
|
|
1575 }
|
|
1576
|
|
1577 static HGLOBAL
|
|
1578 copy_devmodea_to_devmodew (const DEVMODEA *src, DEVMODEW *dst)
|
|
1579 {
|
|
1580 HGLOBAL hdst = NULL;
|
|
1581
|
|
1582 if (!dst)
|
|
1583 {
|
|
1584 hdst = GlobalAlloc (GHND, src->dmSize + src->dmDriverExtra +
|
|
1585 (sizeof (DEVMODEW) - sizeof (DEVMODEA)));
|
|
1586 dst = (DEVMODEW *) GlobalLock (hdst);
|
|
1587 }
|
|
1588
|
|
1589 memcpy (dst->dmDeviceName, src->dmDeviceName, sizeof (src->dmDeviceName));
|
|
1590 memcpy ((char *) dst + sizeof (dst->dmDeviceName),
|
|
1591 (char *) src + sizeof (src->dmDeviceName),
|
|
1592 offsetof (DEVMODEA, dmFormName) - sizeof (src->dmDeviceName));
|
|
1593 dst->dmSize += sizeof (DEVMODEW) - sizeof (DEVMODEA);
|
|
1594 memcpy (dst->dmFormName, src->dmFormName, sizeof (src->dmFormName));
|
|
1595 memcpy ((char *) dst + offsetof (DEVMODEW, dmFormName) +
|
|
1596 sizeof (dst->dmFormName),
|
|
1597 (char *) src + offsetof (DEVMODEA, dmFormName) +
|
|
1598 sizeof (src->dmFormName),
|
|
1599 src->dmSize + src->dmDriverExtra -
|
|
1600 (offsetof (DEVMODEA, dmFormName) + sizeof (src->dmFormName)));
|
|
1601
|
|
1602 if (hdst)
|
|
1603 GlobalUnlock (hdst);
|
|
1604 return hdst;
|
|
1605 }
|
|
1606
|
|
1607 HDC
|
|
1608 qxeCreateDC (const Extbyte *lpszDriver, const Extbyte *lpszDevice,
|
|
1609 const Extbyte *lpszOutput, CONST DEVMODEW *lpInitData)
|
|
1610 {
|
|
1611 if (XEUNICODE_P)
|
|
1612 return CreateDCW ((LPCWSTR) lpszDriver, (LPCWSTR) lpszDevice,
|
|
1613 (LPCWSTR) lpszOutput, lpInitData);
|
|
1614 else
|
|
1615 {
|
|
1616 HGLOBAL hInitData = NULL;
|
|
1617 DEVMODEA *lpInitDataa = NULL;
|
|
1618 HDC retval;
|
|
1619
|
|
1620 if (lpInitData)
|
|
1621 {
|
|
1622 hInitData = copy_devmodew_to_devmodea (lpInitData, NULL);
|
|
1623 lpInitDataa = (DEVMODEA *) GlobalLock (hInitData);
|
|
1624 }
|
|
1625 retval = CreateDCA ((LPCSTR) lpszDriver, (LPCSTR) lpszDevice,
|
|
1626 (LPCSTR) lpszOutput, lpInitDataa);
|
|
1627
|
|
1628 if (hInitData)
|
|
1629 {
|
|
1630 GlobalUnlock (hInitData);
|
|
1631 GlobalFree (hInitData);
|
|
1632 }
|
|
1633
|
|
1634 return retval;
|
|
1635 }
|
|
1636 }
|
|
1637
|
|
1638 HDC
|
|
1639 qxeResetDC (HDC hdc, CONST DEVMODEW *lpInitData)
|
|
1640 {
|
|
1641 if (XEUNICODE_P)
|
|
1642 return ResetDCW (hdc, lpInitData);
|
|
1643 else
|
|
1644 {
|
|
1645 HGLOBAL hInitData = NULL;
|
|
1646 DEVMODEA *lpInitDataa = NULL;
|
|
1647 HDC retval;
|
|
1648
|
|
1649 if (lpInitData)
|
|
1650 {
|
|
1651 hInitData = copy_devmodew_to_devmodea (lpInitData, NULL);
|
|
1652 lpInitDataa = (DEVMODEA *) GlobalLock (hInitData);
|
|
1653 }
|
|
1654 retval = ResetDCA (hdc, lpInitDataa);
|
|
1655
|
|
1656 if (hInitData)
|
|
1657 {
|
|
1658 GlobalUnlock (hInitData);
|
|
1659 GlobalFree (hInitData);
|
|
1660 }
|
|
1661
|
|
1662 return retval;
|
|
1663 }
|
|
1664 }
|
|
1665
|
|
1666 DWORD
|
|
1667 qxeOpenPrinter (Extbyte *pPrinterName, LPHANDLE phPrinter,
|
|
1668 LPPRINTER_DEFAULTSW pDefaultconst)
|
|
1669 {
|
|
1670 assert (!pDefaultconst); /* we don't split it, so let's make sure we
|
|
1671 don't try. */
|
|
1672 if (XEUNICODE_P)
|
|
1673 return OpenPrinterW ((LPWSTR) pPrinterName, phPrinter,
|
|
1674 pDefaultconst);
|
|
1675 else
|
|
1676 return OpenPrinterA ((LPSTR) pPrinterName, phPrinter,
|
|
1677 (LPPRINTER_DEFAULTSA) pDefaultconst);
|
|
1678 }
|
|
1679
|
|
1680 LONG
|
|
1681 qxeDocumentProperties (HWND hWnd, HANDLE hPrinter, Extbyte *pDeviceName,
|
|
1682 DEVMODEW *pDevModeOutput, DEVMODEW *pDevModeInput,
|
|
1683 DWORD fMode)
|
|
1684 {
|
|
1685 if (XEUNICODE_P)
|
2262
|
1686 #if defined (CYGWIN_HEADERS) && W32API_INSTALLED_VER < W32API_VER(3,1)
|
|
1687 /* Cygwin used to mistakenly declare the fourth and fifth arguments as
|
771
|
1688 PDEVMODEA. */
|
|
1689 return DocumentPropertiesW (hWnd, hPrinter, (LPWSTR) pDeviceName,
|
|
1690 (DEVMODEA *) pDevModeOutput,
|
|
1691 (DEVMODEA *) pDevModeInput, fMode);
|
|
1692 #else
|
|
1693 return DocumentPropertiesW (hWnd, hPrinter, (LPWSTR) pDeviceName,
|
|
1694 pDevModeOutput, pDevModeInput, fMode);
|
|
1695 #endif /* CYGWIN_HEADERS */
|
|
1696 else
|
|
1697 {
|
|
1698 HGLOBAL hDevModeInput = NULL;
|
|
1699 DEVMODEA *pDevModeInputa = NULL;
|
|
1700 LONG retval;
|
|
1701
|
|
1702 if (pDevModeInput)
|
|
1703 {
|
|
1704 hDevModeInput = copy_devmodew_to_devmodea (pDevModeInput, NULL);
|
|
1705 pDevModeInputa = (DEVMODEA *) GlobalLock (hDevModeInput);
|
|
1706 }
|
|
1707
|
|
1708 /* Here we cheat a bit to avoid a problem: If the output
|
|
1709 structure is given but not the input one, how do we know how
|
|
1710 big to allocate our shadow output structure? Since the
|
|
1711 shadow structure is ANSI and the original Unicode, we know
|
|
1712 the shadow structure is smaller than what's given, so we just
|
|
1713 write into the given structure and then fix. */
|
|
1714 retval = DocumentPropertiesA (hWnd, hPrinter, (LPSTR) pDeviceName,
|
|
1715 pDevModeOutput ?
|
|
1716 (DEVMODEA *) pDevModeOutput : 0,
|
|
1717 pDevModeInput ? pDevModeInputa : 0,
|
|
1718 fMode);
|
|
1719
|
|
1720 if (hDevModeInput)
|
|
1721 {
|
|
1722 GlobalUnlock (hDevModeInput);
|
|
1723 GlobalFree (hDevModeInput);
|
|
1724 }
|
|
1725
|
|
1726 if (retval >= 0 && pDevModeOutput)
|
|
1727 {
|
|
1728 /* copy the shadow structure out of the way and then put the
|
|
1729 right contents back. */
|
|
1730 DEVMODEA *shadow = (DEVMODEA *) pDevModeOutput;
|
|
1731 DEVMODEA *newshadow = alloca_array (DEVMODEA, shadow->dmSize +
|
|
1732 shadow->dmDriverExtra);
|
|
1733
|
|
1734 memcpy (newshadow, shadow, shadow->dmSize + shadow->dmDriverExtra);
|
|
1735 copy_devmodea_to_devmodew (newshadow, pDevModeOutput);
|
|
1736 }
|
|
1737
|
|
1738 if (fMode == 0)
|
|
1739 retval += (sizeof (DEVMODEW) - sizeof (DEVMODEA));
|
|
1740 return retval;
|
|
1741 }
|
|
1742 }
|
|
1743
|
|
1744 static BOOL
|
|
1745 ansi_printer_dialog_1 (void *strucked, HGLOBAL *devmode_inout, int do_PrintDlg)
|
|
1746 {
|
|
1747 HGLOBAL hdma = NULL;
|
|
1748 HGLOBAL hdmw = *devmode_inout;
|
|
1749 DEVMODEW *dmw = NULL;
|
|
1750 BOOL retval;
|
|
1751
|
|
1752 if (hdmw != NULL)
|
|
1753 {
|
|
1754 /* copy to shadow in structure if needed */
|
|
1755 dmw = (DEVMODEW *) GlobalLock (hdmw);
|
|
1756 hdma = copy_devmodew_to_devmodea (dmw, NULL);
|
|
1757 *devmode_inout = hdma;
|
|
1758 }
|
|
1759
|
|
1760 if (do_PrintDlg)
|
|
1761 retval = PrintDlgA ((PRINTDLGA *) strucked);
|
|
1762 else
|
|
1763 retval = PageSetupDlgA ((PAGESETUPDLGA *) strucked);
|
|
1764
|
|
1765 if (retval)
|
|
1766 {
|
|
1767 /* copy the shadow output structure back to original, or
|
|
1768 allocate new one. */
|
|
1769 if (*devmode_inout)
|
|
1770 {
|
|
1771 DEVMODEA *newdma = (DEVMODEA *) GlobalLock (*devmode_inout);
|
|
1772 if (dmw)
|
|
1773 {
|
|
1774 copy_devmodea_to_devmodew (newdma, dmw);
|
|
1775 GlobalUnlock (hdmw);
|
|
1776 }
|
|
1777 else
|
|
1778 hdmw = copy_devmodea_to_devmodew (newdma, NULL);
|
|
1779 GlobalUnlock (*devmode_inout);
|
|
1780 GlobalFree (*devmode_inout);
|
|
1781 *devmode_inout = hdmw;
|
|
1782 }
|
|
1783 else if (hdma)
|
|
1784 /* #### can this happen? */
|
|
1785 GlobalFree (hdma);
|
|
1786 }
|
|
1787
|
|
1788 return retval;
|
|
1789 }
|
|
1790
|
|
1791 BOOL
|
|
1792 qxePrintDlg (PRINTDLGW *lppd)
|
|
1793 {
|
|
1794 if (XEUNICODE_P)
|
|
1795 return PrintDlgW (lppd);
|
|
1796 else
|
|
1797 return ansi_printer_dialog_1 (lppd, &lppd->hDevMode, 1);
|
|
1798 }
|
|
1799
|
|
1800 BOOL
|
|
1801 qxePageSetupDlg (PAGESETUPDLGW *lppd)
|
|
1802 {
|
|
1803 if (XEUNICODE_P)
|
|
1804 return PageSetupDlgW (lppd);
|
|
1805 else
|
|
1806 return ansi_printer_dialog_1 (lppd, &lppd->hDevMode, 0);
|
|
1807 }
|
|
1808
|
|
1809
|
|
1810 /************************************************************************/
|
|
1811 /* fonts */
|
|
1812 /************************************************************************/
|
|
1813
|
|
1814 static void
|
|
1815 copy_logfonta_to_logfontw (const LOGFONTA *src, LOGFONTW *dst)
|
|
1816 {
|
|
1817 /* the layout of LOGFONT is
|
|
1818
|
|
1819 non-split fields;
|
|
1820 TCHAR lfFaceName[...];
|
|
1821 */
|
|
1822 memcpy (dst, src, sizeof (LOGFONTA));
|
|
1823 }
|
|
1824
|
|
1825 static void
|
|
1826 copy_logfontw_to_logfonta (const LOGFONTW *src, LOGFONTA *dst)
|
|
1827 {
|
|
1828 memcpy (dst, src, sizeof (LOGFONTA));
|
|
1829 }
|
|
1830
|
872
|
1831 #if 0 /* unused */
|
|
1832
|
771
|
1833 static void
|
|
1834 copy_enumlogfonta_to_enumlogfontw (const ENUMLOGFONTA *src, ENUMLOGFONTW *dst)
|
|
1835 {
|
|
1836 /* the layout of ENUMLOGFONT is
|
|
1837
|
|
1838 LOGFONT elfLogFont;
|
|
1839 TCHAR elfFullName[...];
|
|
1840 TCHAR elfStyle[...];
|
|
1841 */
|
|
1842 xzero (*dst);
|
|
1843 copy_logfonta_to_logfontw (&src->elfLogFont, &dst->elfLogFont);
|
|
1844 memcpy (dst->elfFullName, src->elfFullName, sizeof (src->elfFullName));
|
|
1845 memcpy (dst->elfStyle, src->elfStyle, sizeof (src->elfStyle));
|
|
1846 }
|
|
1847
|
872
|
1848 #endif /* 0 */
|
|
1849
|
771
|
1850 static void
|
|
1851 copy_enumlogfontexa_to_enumlogfontexw (const ENUMLOGFONTEXA *src,
|
|
1852 ENUMLOGFONTEXW *dst)
|
|
1853 {
|
|
1854 /* the layout of ENUMLOGFONT is
|
|
1855
|
|
1856 LOGFONT elfLogFont;
|
|
1857 TCHAR elfFullName[...];
|
|
1858 TCHAR elfStyle[...];
|
|
1859 TCHAR elfScript[...];
|
|
1860 */
|
|
1861 xzero (*dst);
|
|
1862 copy_logfonta_to_logfontw (&src->elfLogFont, &dst->elfLogFont);
|
|
1863 memcpy (dst->elfFullName, src->elfFullName, sizeof (src->elfFullName));
|
|
1864 memcpy (dst->elfStyle, src->elfStyle, sizeof (src->elfStyle));
|
|
1865 memcpy (dst->elfScript, src->elfScript, sizeof (src->elfScript));
|
|
1866 }
|
|
1867
|
|
1868 static void
|
|
1869 copy_newtextmetrica_to_newtextmetricw (const NEWTEXTMETRICA *src,
|
|
1870 NEWTEXTMETRICW *dst)
|
|
1871 {
|
|
1872 /* the layout of NEWTEXTMETRIC is
|
|
1873
|
|
1874 non-split fields;
|
|
1875 WCHAR/BYTE tmFirstChar;
|
|
1876 WCHAR/BYTE tmLastChar;
|
|
1877 WCHAR/BYTE tmDefaultChar;
|
|
1878 WCHAR/BYTE tmBreakChar;
|
|
1879 BYTE tmItalic;
|
|
1880 non-split fields;
|
|
1881 */
|
|
1882 xzero (*dst);
|
|
1883 memcpy ((char *) dst, (char *) src,
|
|
1884 offsetof (NEWTEXTMETRICA, tmFirstChar));
|
|
1885 memcpy ((char *) dst + offsetof (NEWTEXTMETRICW, tmItalic),
|
|
1886 (char *) src + offsetof (NEWTEXTMETRICA, tmItalic),
|
|
1887 sizeof (NEWTEXTMETRICA) - offsetof (NEWTEXTMETRICA, tmItalic));
|
|
1888 dst->tmFirstChar = (WCHAR) src->tmFirstChar;
|
|
1889 dst->tmLastChar = (WCHAR) src->tmLastChar;
|
|
1890 dst->tmDefaultChar = (WCHAR) src->tmDefaultChar;
|
|
1891 dst->tmBreakChar = (WCHAR) src->tmBreakChar;
|
|
1892 }
|
|
1893
|
|
1894 static void
|
|
1895 copy_newtextmetricexa_to_newtextmetricexw (const NEWTEXTMETRICEXA *src,
|
|
1896 NEWTEXTMETRICEXW *dst)
|
|
1897 {
|
|
1898 /* the layout of NEWTEXTMETRICEX is
|
|
1899
|
|
1900 NEWTEXTMETRICA/W ntmTm;
|
|
1901 FONTSIGNATURE ntmFontSig;
|
|
1902 */
|
|
1903 copy_newtextmetrica_to_newtextmetricw (&src->ntmTm, &dst->ntmTm);
|
|
1904 dst->ntmFontSig = src->ntmFontSig;
|
|
1905 }
|
|
1906
|
872
|
1907 #if 0 /* unused */
|
|
1908
|
771
|
1909 static void
|
|
1910 copy_textmetricw_to_textmetrica (const TEXTMETRICW *src,
|
|
1911 TEXTMETRICA *dst)
|
|
1912 {
|
|
1913 /* the layout of TEXTMETRIC is like NEWTEXTMETRIC; see above. */
|
|
1914 xzero (*dst);
|
|
1915 memcpy ((char *) dst, (char *) src,
|
|
1916 offsetof (TEXTMETRICA, tmFirstChar));
|
|
1917 memcpy ((char *) dst + offsetof (TEXTMETRICA, tmItalic),
|
|
1918 (char *) src + offsetof (TEXTMETRICW, tmItalic),
|
|
1919 sizeof (TEXTMETRICA) - offsetof (TEXTMETRICA, tmItalic));
|
|
1920 dst->tmFirstChar = (BYTE) src->tmFirstChar;
|
|
1921 dst->tmLastChar = (BYTE) src->tmLastChar;
|
|
1922 dst->tmDefaultChar = (BYTE) src->tmDefaultChar;
|
|
1923 dst->tmBreakChar = (BYTE) src->tmBreakChar;
|
|
1924 }
|
|
1925
|
872
|
1926 #endif /* 0 */
|
|
1927
|
771
|
1928 static void
|
|
1929 copy_textmetrica_to_textmetricw (const TEXTMETRICA *src,
|
|
1930 TEXTMETRICW *dst)
|
|
1931 {
|
|
1932 /* the layout of TEXTMETRIC is like NEWTEXTMETRIC; see above. */
|
|
1933 xzero (*dst);
|
|
1934 memcpy ((char *) dst, (char *) src,
|
|
1935 offsetof (TEXTMETRICA, tmFirstChar));
|
|
1936 memcpy ((char *) dst + offsetof (TEXTMETRICW, tmItalic),
|
|
1937 (char *) src + offsetof (TEXTMETRICA, tmItalic),
|
|
1938 sizeof (TEXTMETRICA) - offsetof (TEXTMETRICA, tmItalic));
|
|
1939 dst->tmFirstChar = (WCHAR) src->tmFirstChar;
|
|
1940 dst->tmLastChar = (WCHAR) src->tmLastChar;
|
|
1941 dst->tmDefaultChar = (WCHAR) src->tmDefaultChar;
|
|
1942 dst->tmBreakChar = (WCHAR) src->tmBreakChar;
|
|
1943 }
|
|
1944
|
|
1945 typedef int (CALLBACK *qxeEnumFontFamExProcW) (ENUMLOGFONTEXW *lpelfe,
|
|
1946 NEWTEXTMETRICEXW *lpntme,
|
|
1947 DWORD FontType,
|
|
1948 LPARAM lParam);
|
|
1949
|
|
1950 struct qxeEnumFontFamExProcA_wrapper_t
|
|
1951 {
|
|
1952 qxeEnumFontFamExProcW orig_proc;
|
|
1953 LPARAM orig_lparam;
|
|
1954 };
|
|
1955
|
|
1956 static int CALLBACK
|
|
1957 qxeEnumFontFamExProcA_wrapper (ENUMLOGFONTEXA *lpelfe,
|
|
1958 NEWTEXTMETRICEXA *lpntme,
|
|
1959 DWORD fontType,
|
|
1960 struct qxeEnumFontFamExProcA_wrapper_t
|
|
1961 *closure)
|
|
1962 {
|
|
1963 ENUMLOGFONTEXW lpelfew;
|
|
1964 NEWTEXTMETRICEXW lpntmew;
|
|
1965
|
|
1966 /* #### if we're on Windows 2000 or above, lpelfe is actually an
|
|
1967 ENUMLOGFONTEXDV structure, and lpntme is an ENUMTEXTMETRIC structure
|
|
1968 when TRUETYPE_FONTTYPE. both are split-sized and need their own copy
|
|
1969 functions. need to handle. */
|
|
1970 copy_enumlogfontexa_to_enumlogfontexw (lpelfe, &lpelfew);
|
|
1971 if (fontType & TRUETYPE_FONTTYPE)
|
|
1972 copy_newtextmetricexa_to_newtextmetricexw (lpntme, &lpntmew);
|
|
1973 else
|
|
1974 {
|
|
1975 /* see docs of EnumFontFamExProc */
|
|
1976 xzero (lpntmew);
|
|
1977 copy_textmetrica_to_textmetricw ((TEXTMETRICA *) lpntme,
|
|
1978 (TEXTMETRICW *) &lpntmew);
|
|
1979 }
|
|
1980 return (closure->orig_proc) (&lpelfew, &lpntmew, fontType,
|
|
1981 closure->orig_lparam);
|
|
1982 }
|
|
1983
|
|
1984 int
|
|
1985 qxeEnumFontFamiliesEx (HDC hdc, LOGFONTW *lpLogfont,
|
|
1986 FONTENUMPROCW lpEnumFontFamProc, LPARAM lParam,
|
|
1987 DWORD dwFlags)
|
|
1988 {
|
|
1989 if (XEUNICODE_P)
|
|
1990 return EnumFontFamiliesExW (hdc, lpLogfont, lpEnumFontFamProc, lParam,
|
|
1991 dwFlags);
|
|
1992 else
|
|
1993 {
|
|
1994 struct qxeEnumFontFamExProcA_wrapper_t closure;
|
|
1995 LOGFONTA lfa;
|
|
1996
|
|
1997 closure.orig_proc = (qxeEnumFontFamExProcW) lpEnumFontFamProc;
|
|
1998 closure.orig_lparam = lParam;
|
|
1999 copy_logfontw_to_logfonta (lpLogfont, &lfa);
|
|
2000 return EnumFontFamiliesExA (hdc, &lfa,
|
|
2001 (FONTENUMPROCA)
|
|
2002 qxeEnumFontFamExProcA_wrapper,
|
|
2003 (LPARAM) &closure, dwFlags);
|
|
2004 }
|
|
2005 }
|
|
2006
|
|
2007 HFONT
|
|
2008 qxeCreateFontIndirect (CONST LOGFONTW *lplf)
|
|
2009 {
|
|
2010 if (XEUNICODE_P)
|
|
2011 return CreateFontIndirectW (lplf);
|
|
2012 else
|
|
2013 {
|
|
2014 LOGFONTA lfa;
|
|
2015
|
|
2016 copy_logfontw_to_logfonta (lplf, &lfa);
|
|
2017 return CreateFontIndirectA (&lfa);
|
|
2018 }
|
|
2019 }
|
|
2020
|
|
2021 BOOL
|
|
2022 qxeImmSetCompositionFont (HIMC imc, LOGFONTW *lplf)
|
|
2023 {
|
|
2024 if (XEUNICODE_P)
|
|
2025 return ImmSetCompositionFontW (imc, lplf);
|
|
2026 else
|
|
2027 {
|
|
2028 LOGFONTA lfa;
|
|
2029
|
|
2030 copy_logfontw_to_logfonta (lplf, &lfa);
|
|
2031 return ImmSetCompositionFontA (imc, &lfa);
|
|
2032 }
|
|
2033 }
|
|
2034
|
|
2035 BOOL
|
|
2036 qxeImmGetCompositionFont (HIMC imc, LOGFONTW *lplf)
|
|
2037 {
|
|
2038 if (XEUNICODE_P)
|
|
2039 return ImmGetCompositionFontW (imc, lplf);
|
|
2040 else
|
|
2041 {
|
|
2042 LOGFONTA lfa;
|
|
2043 BOOL retval = ImmGetCompositionFontA (imc, &lfa);
|
|
2044
|
|
2045 if (retval)
|
|
2046 copy_logfonta_to_logfontw (&lfa, lplf);
|
|
2047 return retval;
|
|
2048 }
|
|
2049 }
|
|
2050
|
|
2051 int
|
|
2052 qxeGetObject (HGDIOBJ hgdiobj, int cbBuffer, LPVOID lpvObject)
|
|
2053 {
|
|
2054 if (XEUNICODE_P)
|
|
2055 return GetObjectW (hgdiobj, cbBuffer, lpvObject);
|
|
2056 else
|
|
2057 {
|
|
2058 if (cbBuffer == sizeof (LOGFONTW))
|
|
2059 {
|
|
2060 LOGFONTA lfa;
|
|
2061 int retval = GetObjectA (hgdiobj, sizeof (LOGFONTA), &lfa);
|
|
2062
|
|
2063 if (!retval)
|
|
2064 return retval;
|
|
2065 copy_logfonta_to_logfontw (&lfa, (LOGFONTW *) lpvObject);
|
|
2066 return retval;
|
|
2067 }
|
|
2068 else
|
|
2069 return GetObjectA (hgdiobj, cbBuffer, lpvObject);
|
|
2070 }
|
|
2071 }
|
|
2072
|
|
2073 BOOL
|
|
2074 qxeGetTextMetrics (HDC hdc, LPTEXTMETRICW lptm)
|
|
2075 {
|
|
2076 if (XEUNICODE_P)
|
|
2077 return GetTextMetricsW (hdc, lptm);
|
|
2078 else
|
|
2079 {
|
|
2080 TEXTMETRICA tma;
|
|
2081 BOOL retval = GetTextMetricsA (hdc, &tma);
|
|
2082
|
|
2083 if (retval)
|
|
2084 copy_textmetrica_to_textmetricw (&tma, lptm);
|
|
2085 return retval;
|
|
2086 }
|
|
2087 }
|
|
2088
|
|
2089
|
|
2090 /************************************************************************/
|
|
2091 /* windows */
|
|
2092 /************************************************************************/
|
|
2093
|
|
2094 typedef struct Intercepted_wnd_proc
|
|
2095 {
|
|
2096 WNDPROC proc;
|
|
2097 Extbyte *name;
|
|
2098 int is_ansi;
|
|
2099 } Intercepted_wnd_proc;
|
|
2100
|
|
2101 typedef struct
|
|
2102 {
|
|
2103 Dynarr_declare (Intercepted_wnd_proc);
|
|
2104 } Intercepted_wnd_proc_dynarr;
|
|
2105
|
|
2106 static Intercepted_wnd_proc_dynarr *intercepted_wnd_procs;
|
|
2107
|
|
2108 static Intercepted_wnd_proc *
|
|
2109 find_window_class (const Extbyte *name, int is_ansi)
|
|
2110 {
|
|
2111 int i;
|
|
2112
|
|
2113 if (!intercepted_wnd_procs)
|
|
2114 intercepted_wnd_procs = Dynarr_new (Intercepted_wnd_proc);
|
|
2115
|
|
2116 for (i = 0; i < Dynarr_length (intercepted_wnd_procs); i++)
|
|
2117 {
|
|
2118 Intercepted_wnd_proc *s = Dynarr_atp (intercepted_wnd_procs, i);
|
|
2119
|
|
2120 if (s->is_ansi == is_ansi && (is_ansi ? !strcmp (s->name, name) :
|
|
2121 !wcscmp ((wchar_t *) s->name,
|
|
2122 (wchar_t *) name)))
|
|
2123 return s;
|
|
2124 }
|
|
2125
|
|
2126 return 0;
|
|
2127 }
|
|
2128
|
|
2129 /* ####
|
|
2130
|
|
2131 check problem with cutting and pasting in my current mule -- if i cut,
|
|
2132 then go to another application, then switch back to this one and
|
|
2133 paste, it seems to get confused -- loses the size or something?
|
|
2134
|
|
2135 other things: split flags on CreateProcess and DDE stuff should be
|
|
2136 handled by us.
|
|
2137 */
|
|
2138
|
|
2139 static LRESULT WINAPI
|
|
2140 intercepted_wnd_proc (HWND hwnd, UINT message_, WPARAM wParam, LPARAM lParam)
|
|
2141 {
|
|
2142 Intercepted_wnd_proc *s;
|
|
2143 int is_ansi = XEUNICODE_P ? !IsWindowUnicode (hwnd) : 1;
|
|
2144 Extbyte *classname;
|
|
2145 int size = 100;
|
|
2146
|
|
2147 /* Just in case XEUNICODE_P changes during the execution of the program
|
|
2148 (admittedly, unlikely), check whether the window is Unicode and keep
|
|
2149 track of this in the list of classes. */
|
|
2150 while (1)
|
|
2151 {
|
|
2152 classname = alloca_extbytes (size * XETCHAR_SIZE);
|
|
2153 if ((is_ansi ? GetClassNameA (hwnd, (LPSTR) classname, size) :
|
|
2154 GetClassNameW (hwnd, (LPWSTR) classname, size)) < size - 1)
|
|
2155 break;
|
|
2156 size *= 2;
|
|
2157 }
|
|
2158
|
|
2159 s = find_window_class (classname, is_ansi);
|
|
2160
|
|
2161 assert (s);
|
|
2162
|
|
2163 if (message_ == WM_NOTIFY)
|
|
2164 {
|
|
2165 LPNMHDR nmhdr = (LPNMHDR) lParam;
|
|
2166 int putback = nmhdr->code;
|
|
2167 int do_putback = 0;
|
|
2168
|
|
2169 #define FROB(msg) \
|
|
2170 case msg##W: \
|
|
2171 /* split structures are the same size, so no conversion necessary */ \
|
|
2172 nmhdr->code = (UINT) msg##A; \
|
|
2173 do_putback = 1; \
|
|
2174 break;
|
|
2175 switch (nmhdr->code)
|
|
2176 {
|
|
2177 /* NMHEADER */
|
|
2178 FROB (HDN_ITEMCHANGING);
|
|
2179 FROB (HDN_ITEMCHANGED);
|
|
2180 FROB (HDN_ITEMCLICK);
|
|
2181 FROB (HDN_ITEMDBLCLICK);
|
|
2182 FROB (HDN_DIVIDERDBLCLICK);
|
|
2183 FROB (HDN_BEGINTRACK);
|
|
2184 FROB (HDN_ENDTRACK);
|
|
2185 FROB (HDN_TRACK);
|
|
2186 /* NMDISPINFO */
|
|
2187 FROB (HDN_GETDISPINFO);
|
|
2188 /* NMTBGETINFOTIP */
|
|
2189 FROB (TBN_GETINFOTIP);
|
|
2190 /* NMTBDISPINFO */
|
|
2191 FROB (TBN_GETDISPINFO);
|
|
2192 /* NMTOOLBAR */
|
|
2193 FROB (TBN_GETBUTTONINFO);
|
|
2194
|
|
2195 /* split-sized NMTTDISPINFO */
|
|
2196 FROB (TTN_GETDISPINFO); /* handle the ...W case; then handle the
|
|
2197 ...A case specially, since we need to
|
|
2198 mess with the structure */
|
|
2199 case TTN_GETDISPINFOA: /* same as TTN_NEEDTEXTA */
|
|
2200 {
|
|
2201 NMTTDISPINFOW *nmw = alloca_new (NMTTDISPINFOW);
|
|
2202 NMTTDISPINFOA *nma = (NMTTDISPINFOA *) lParam;
|
|
2203 LRESULT retval;
|
|
2204 /* the layout of NMTTDISPINFO is
|
|
2205
|
|
2206 non-split fields;
|
|
2207 TCHAR szText[...];
|
|
2208 non-split fields;
|
|
2209 */
|
|
2210
|
|
2211 xzero (*nmw);
|
|
2212 /* copy to ...W struct for Unicode code */
|
|
2213 memcpy ((char *) nmw, (char *) nma,
|
|
2214 offsetof (NMTTDISPINFOA, szText));
|
|
2215 memcpy ((char *) nmw + offsetof (NMTTDISPINFOW, szText) +
|
|
2216 sizeof (nmw->szText),
|
|
2217 (char *) nma + offsetof (NMTTDISPINFOA, szText) +
|
|
2218 sizeof (nma->szText),
|
|
2219 sizeof (NMTTDISPINFOA) -
|
|
2220 (offsetof (NMTTDISPINFOA, szText) + sizeof (nma->szText)));
|
|
2221 memcpy (nmw->szText, nma->szText, sizeof (nma->szText));
|
|
2222 retval = (s->proc) (hwnd, message_, wParam, lParam);
|
|
2223 /* copy back to ...A struct */
|
|
2224 xzero (*nma);
|
|
2225 memcpy ((char *) nma, (char *) nmw,
|
|
2226 offsetof (NMTTDISPINFOA, szText));
|
|
2227 memcpy ((char *) nma + offsetof (NMTTDISPINFOA, szText) +
|
|
2228 sizeof (nma->szText),
|
|
2229 (char *) nmw + offsetof (NMTTDISPINFOW, szText) +
|
|
2230 sizeof (nmw->szText),
|
|
2231 sizeof (NMTTDISPINFOA) -
|
|
2232 (offsetof (NMTTDISPINFOA, szText) + sizeof (nma->szText)));
|
|
2233 memcpy (nma->szText, nmw->szText, sizeof (nma->szText));
|
|
2234 return retval;
|
|
2235 }
|
|
2236
|
|
2237 /* NMLVFINDITEM */
|
|
2238 FROB (LVN_ODFINDITEM);
|
|
2239 /* NMLVDISPINFO */
|
|
2240 FROB (LVN_BEGINLABELEDIT);
|
|
2241 FROB (LVN_ENDLABELEDIT);
|
|
2242 FROB (LVN_GETDISPINFO);
|
|
2243 FROB (LVN_SETDISPINFO);
|
|
2244 /* NMLVGETINFOTIP */
|
|
2245 FROB (LVN_GETINFOTIP);
|
|
2246 /* NMTREEVIEW */
|
|
2247 FROB (TVN_SELCHANGING);
|
|
2248 FROB (TVN_SELCHANGED);
|
|
2249 FROB (TVN_ITEMEXPANDING);
|
|
2250 FROB (TVN_ITEMEXPANDED);
|
|
2251 FROB (TVN_BEGINDRAG);
|
|
2252 FROB (TVN_BEGINRDRAG);
|
|
2253 FROB (TVN_DELETEITEM);
|
|
2254 /* NMTVDISPINFO */
|
|
2255 FROB (TVN_GETDISPINFO);
|
|
2256 FROB (TVN_SETDISPINFO);
|
|
2257 FROB (TVN_BEGINLABELEDIT);
|
|
2258 FROB (TVN_ENDLABELEDIT);
|
|
2259 /* NMTVGETINFOTIP */
|
|
2260 FROB (TVN_GETINFOTIP);
|
|
2261 /* NMCOMBOBOXEX */
|
|
2262 FROB (CBEN_GETDISPINFO);
|
|
2263
|
|
2264 /* split-sized NMCBEDRAGBEGIN */
|
|
2265 FROB (CBEN_DRAGBEGIN); /* handle the ...W case; then handle the
|
|
2266 ...A case specially, since we need to
|
|
2267 mess with the structure */
|
|
2268 {
|
|
2269 NMCBEDRAGBEGINW *nmw = alloca_new (NMCBEDRAGBEGINW);
|
|
2270 NMCBEDRAGBEGINA *nma = (NMCBEDRAGBEGINA *) lParam;
|
|
2271 LRESULT retval;
|
|
2272 /* the layout of NNMCBEDRAGBEGIN is
|
|
2273
|
|
2274 non-split fields;
|
|
2275 TCHAR szText[...];
|
|
2276 */
|
|
2277
|
|
2278 xzero (*nmw);
|
|
2279 /* copy to ...W struct for Unicode code */
|
|
2280 memcpy ((char *) nmw, (char *) nma,
|
|
2281 sizeof (*nma));
|
|
2282 retval = (s->proc) (hwnd, message_, wParam, lParam);
|
|
2283 /* copy back to ...A struct */
|
|
2284 xzero (*nma);
|
|
2285 memcpy ((char *) nma, (char *) nmw,
|
|
2286 sizeof (*nma));
|
|
2287 return retval;
|
|
2288 }
|
|
2289
|
|
2290 /* split-sized NMCBEENDEDIT */
|
|
2291 FROB (CBEN_ENDEDIT); /* handle the ...W case; then handle the
|
|
2292 ...A case specially, since we need to
|
|
2293 mess with the structure */
|
|
2294 {
|
|
2295 NMCBEENDEDITW *nmw = alloca_new (NMCBEENDEDITW);
|
|
2296 NMCBEENDEDITA *nma = (NMCBEENDEDITA *) lParam;
|
|
2297 LRESULT retval;
|
|
2298 /* the layout of NMCBEENDEDIT is
|
|
2299
|
|
2300 non-split fields;
|
|
2301 TCHAR szText[...];
|
|
2302 non-split fields;
|
|
2303 */
|
|
2304
|
|
2305 xzero (*nmw);
|
|
2306 /* copy to ...W struct for Unicode code */
|
|
2307 memcpy ((char *) nmw, (char *) nma,
|
|
2308 offsetof (NMCBEENDEDITA, szText));
|
|
2309 memcpy ((char *) nmw + offsetof (NMCBEENDEDITW, szText) +
|
|
2310 sizeof (nmw->szText),
|
|
2311 (char *) nma + offsetof (NMCBEENDEDITA, szText) +
|
|
2312 sizeof (nma->szText),
|
|
2313 sizeof (NMCBEENDEDITA) -
|
|
2314 (offsetof (NMCBEENDEDITA, szText) + sizeof (nma->szText)));
|
|
2315 memcpy (nmw->szText, nma->szText, sizeof (nma->szText));
|
|
2316 retval = (s->proc) (hwnd, message_, wParam, lParam);
|
|
2317 /* copy back to ...A struct */
|
|
2318 xzero (*nma);
|
|
2319 memcpy ((char *) nma, (char *) nmw,
|
|
2320 offsetof (NMCBEENDEDITA, szText));
|
|
2321 memcpy ((char *) nma + offsetof (NMCBEENDEDITA, szText) +
|
|
2322 sizeof (nma->szText),
|
|
2323 (char *) nmw + offsetof (NMCBEENDEDITW, szText) +
|
|
2324 sizeof (nmw->szText),
|
|
2325 sizeof (NMCBEENDEDITA) -
|
|
2326 (offsetof (NMCBEENDEDITA, szText) + sizeof (nma->szText)));
|
|
2327 memcpy (nma->szText, nmw->szText, sizeof (nma->szText));
|
|
2328 return retval;
|
|
2329 }
|
|
2330
|
|
2331 /* NMDATETIMESTRING */
|
|
2332 FROB (DTN_USERSTRING);
|
|
2333 /* NMDATETIMEWMKEYDOWN */
|
|
2334 FROB (DTN_WMKEYDOWN);
|
|
2335
|
|
2336 /* split-sized NMDATETIMEFORMAT */
|
|
2337 FROB (DTN_FORMAT); /* handle the ...W case; then handle the
|
|
2338 ...A case specially, since we need to
|
|
2339 mess with the structure */
|
|
2340 {
|
|
2341 NMDATETIMEFORMATW *nmw = alloca_new (NMDATETIMEFORMATW);
|
|
2342 NMDATETIMEFORMATA *nma = (NMDATETIMEFORMATA *) lParam;
|
|
2343 LRESULT retval;
|
|
2344 /* the layout of NMDATETIMEFORMAT is
|
|
2345
|
|
2346 non-split fields;
|
|
2347 TCHAR szText[...];
|
|
2348 */
|
|
2349
|
|
2350 xzero (*nmw);
|
|
2351 /* copy to ...W struct for Unicode code */
|
|
2352 memcpy ((char *) nmw, (char *) nma,
|
|
2353 sizeof (*nma));
|
|
2354 retval = (s->proc) (hwnd, message_, wParam, lParam);
|
|
2355 /* copy back to ...A struct */
|
|
2356 xzero (*nma);
|
|
2357 memcpy ((char *) nma, (char *) nmw,
|
|
2358 sizeof (*nma));
|
|
2359 return retval;
|
|
2360 }
|
|
2361
|
|
2362 /* NMDATETIMEFORMATQUERY */
|
|
2363 FROB (DTN_FORMATQUERY);
|
|
2364 default: break;
|
|
2365 }
|
|
2366 #undef FROB
|
|
2367 if (do_putback)
|
|
2368 {
|
|
2369 LRESULT retval = (s->proc) (hwnd, message_, wParam, lParam);
|
|
2370 ((LPNMHDR) lParam)->code = putback;
|
|
2371 return retval;
|
|
2372 }
|
|
2373 }
|
|
2374
|
|
2375 return (s->proc) (hwnd, message_, wParam, lParam);
|
|
2376 }
|
|
2377
|
|
2378 ATOM
|
|
2379 qxeRegisterClass (CONST WNDCLASSW * lpWndClass)
|
|
2380 {
|
|
2381 Intercepted_wnd_proc *s =
|
|
2382 find_window_class ((Extbyte *) lpWndClass->lpszClassName, !XEUNICODE_P);
|
|
2383 WNDCLASSW classnew;
|
|
2384
|
|
2385 if (s)
|
|
2386 {
|
|
2387 s->proc = lpWndClass->lpfnWndProc;
|
|
2388 s->name = (Extbyte *) lpWndClass->lpszClassName;
|
|
2389 s->is_ansi = !XEUNICODE_P;
|
|
2390 }
|
|
2391 else
|
|
2392 {
|
|
2393 Intercepted_wnd_proc news;
|
|
2394 news.proc = lpWndClass->lpfnWndProc;
|
|
2395 news.name = (Extbyte *) lpWndClass->lpszClassName;
|
|
2396 news.is_ansi = !XEUNICODE_P;
|
|
2397 Dynarr_add (intercepted_wnd_procs, news);
|
|
2398 }
|
|
2399 classnew = *lpWndClass;
|
|
2400 classnew.lpfnWndProc = intercepted_wnd_proc;
|
|
2401 if (XEUNICODE_P)
|
|
2402 return RegisterClassW (&classnew);
|
|
2403 else
|
2367
|
2404 /* The intermediate cast fools gcc into not outputting strict-aliasing
|
|
2405 complaints */
|
|
2406 return RegisterClassA ((CONST WNDCLASSA *) (void *) &classnew);
|
771
|
2407 }
|
|
2408
|
|
2409 BOOL
|
|
2410 qxeUnregisterClass (const Extbyte * lpClassName, HINSTANCE hInstance)
|
|
2411 {
|
|
2412 Intercepted_wnd_proc *s =
|
|
2413 find_window_class (lpClassName, !XEUNICODE_P);
|
|
2414
|
|
2415 if (s)
|
|
2416 Dynarr_delete_by_pointer (intercepted_wnd_procs, s);
|
|
2417 if (XEUNICODE_P)
|
|
2418 return UnregisterClassW ((LPCWSTR) lpClassName, hInstance);
|
|
2419 else
|
|
2420 return UnregisterClassA ((LPCSTR) lpClassName, hInstance);
|
|
2421 }
|
|
2422
|
|
2423 /* NOTE: NT 4.0+ only */
|
|
2424 ATOM
|
|
2425 qxeRegisterClassEx (CONST WNDCLASSEXW *lpWndClass)
|
|
2426 {
|
|
2427 Intercepted_wnd_proc *s =
|
|
2428 find_window_class ((Extbyte *) lpWndClass->lpszClassName, !XEUNICODE_P);
|
|
2429 WNDCLASSEXW classnew;
|
|
2430
|
|
2431 if (s)
|
|
2432 {
|
|
2433 s->proc = lpWndClass->lpfnWndProc;
|
|
2434 s->name = (Extbyte *) lpWndClass->lpszClassName;
|
|
2435 s->is_ansi = !XEUNICODE_P;
|
|
2436 }
|
|
2437 else
|
|
2438 {
|
|
2439 Intercepted_wnd_proc news;
|
|
2440 news.proc = lpWndClass->lpfnWndProc;
|
|
2441 news.name = (Extbyte *) lpWndClass->lpszClassName;
|
|
2442 news.is_ansi = !XEUNICODE_P;
|
|
2443 Dynarr_add (intercepted_wnd_procs, news);
|
|
2444 }
|
|
2445 classnew = *lpWndClass;
|
|
2446 classnew.lpfnWndProc = intercepted_wnd_proc;
|
|
2447 if (XEUNICODE_P)
|
|
2448 return RegisterClassExW (&classnew);
|
|
2449 else
|
2367
|
2450 /* The intermediate cast fools gcc into not outputting strict-aliasing
|
|
2451 complaints */
|
|
2452 return RegisterClassExA ((CONST WNDCLASSEXA *) (void *) &classnew);
|
771
|
2453 }
|
|
2454
|
|
2455
|
|
2456 /************************************************************************/
|
|
2457 /* COMMCTRL.H */
|
|
2458 /************************************************************************/
|
|
2459
|
|
2460 /* there are only four structures in commctrl.h that cannot be cast
|
|
2461 between Unicode/ANSI versions:
|
|
2462
|
|
2463 NMTTDISPINFO aka TOOLTIPTEXT
|
|
2464 NMCBEDRAGBEGIN
|
|
2465 NMCBEENDEDIT
|
|
2466 NMDATETIMEFORMAT
|
|
2467
|
|
2468 these are all notify structures, and we handle them above in
|
|
2469 intercepted_wnd_proc().
|
|
2470
|
|
2471 in addition, this constant is weird, being a struct size of one of these:
|
|
2472
|
|
2473 NMTTDISPINFO_V1_SIZE
|
|
2474 */
|
|
2475
|
|
2476 /*
|
|
2477 split class names:
|
|
2478
|
|
2479 WC_HEADER
|
|
2480 TOOLBARCLASSNAME
|
|
2481 REBARCLASSNAME
|
|
2482 TOOLTIPS_CLASS
|
|
2483 STATUSCLASSNAME
|
|
2484 TRACKBAR_CLASS
|
|
2485 UPDOWN_CLASS
|
|
2486 PROGRESS_CLASS
|
|
2487 HOTKEY_CLASS
|
|
2488 WC_LISTVIEW
|
|
2489 WC_TREEVIEW
|
|
2490 WC_COMBOBOXEX
|
|
2491 WC_TABCONTROL
|
|
2492 ANIMATE_CLASS
|
|
2493 MONTHCAL_CLASS
|
|
2494 DATETIMEPICK_CLASS
|
|
2495 WC_IPADDRESS
|
|
2496 WC_PAGESCROLLER
|
|
2497 WC_NATIVEFONTCTL
|
|
2498 */
|
|
2499
|
|
2500 /*
|
|
2501 SendMessage split messages:
|
|
2502
|
|
2503 HDM_INSERTITEM
|
|
2504 HDM_GETITEM
|
|
2505 HDM_SETITEM
|
|
2506 TB_GETBUTTONTEXT
|
|
2507 TB_SAVERESTORE
|
|
2508 TB_ADDSTRING
|
|
2509 TB_GETBUTTONINFO
|
|
2510 TB_SETBUTTONINFO
|
|
2511 TB_INSERTBUTTON
|
|
2512 TB_ADDBUTTONS
|
|
2513 RB_INSERTBAND
|
|
2514 RB_SETBANDINFO
|
|
2515 RB_GETBANDINFO
|
|
2516 TTM_ADDTOOL
|
|
2517 TTM_DELTOOL
|
|
2518 TTM_NEWTOOLRECT
|
|
2519 TTM_GETTOOLINFO
|
|
2520 TTM_SETTOOLINFO
|
|
2521 TTM_HITTEST
|
|
2522 TTM_GETTEXT
|
|
2523 TTM_UPDATETIPTEXT
|
|
2524 TTM_ENUMTOOLS
|
|
2525 TTM_GETCURRENTTOOL
|
|
2526 SB_GETTEXT
|
|
2527 SB_SETTEXT
|
|
2528 SB_GETTEXTLENGTH
|
|
2529 SB_SETTIPTEXT
|
|
2530 SB_GETTIPTEXT
|
|
2531 LVM_GETITEM
|
|
2532 LVM_SETITEM
|
|
2533 LVM_INSERTITEM
|
|
2534 LVM_FINDITEM
|
|
2535 LVM_GETSTRINGWIDTH
|
|
2536 LVM_EDITLABEL
|
|
2537 LVM_GETCOLUMN
|
|
2538 LVM_SETCOLUMN
|
|
2539 LVM_GETITEMTEXT
|
|
2540 LVM_SETITEMTEXT
|
|
2541 LVM_GETISEARCHSTRING
|
|
2542 LVM_SETBKIMAGE
|
|
2543 LVM_GETBKIMAGE
|
|
2544 TVM_INSERTITEM
|
|
2545 TVM_GETITEM
|
|
2546 TVM_SETITEM
|
|
2547 TVM_EDITLABEL
|
|
2548 TVM_GETISEARCHSTRING
|
|
2549 CBEM_INSERTITEM
|
|
2550 CBEM_SETITEM
|
|
2551 CBEM_GETITEM
|
|
2552 TCM_GETITEM
|
|
2553 TCM_SETITEM
|
|
2554 TCM_INSERTITEM
|
|
2555 ACM_OPEN
|
|
2556 DTM_SETFORMAT
|
|
2557 BFFM_SETSTATUSTEXT
|
|
2558 BFFM_SETSELECTION
|
|
2559 */
|
|
2560
|
|
2561 /*
|
|
2562 split notify messages:
|
|
2563
|
|
2564 HDN_ITEMCHANGING
|
|
2565 HDN_ITEMCHANGED
|
|
2566 HDN_ITEMCLICK
|
|
2567 HDN_ITEMDBLCLICK
|
|
2568 HDN_DIVIDERDBLCLICK
|
|
2569 HDN_BEGINTRACK
|
|
2570 HDN_ENDTRACK
|
|
2571 HDN_TRACK
|
|
2572 HDN_GETDISPINFO
|
|
2573 TBN_GETINFOTIP
|
|
2574 TBN_GETDISPINFO
|
|
2575 TBN_GETBUTTONINFO
|
|
2576 TTN_GETDISPINFO
|
|
2577 TTN_NEEDTEXTW
|
|
2578 LVN_ODFINDITEM
|
|
2579 LVN_BEGINLABELEDIT
|
|
2580 LVN_ENDLABELEDIT
|
|
2581 LVN_GETDISPINFO
|
|
2582 LVN_SETDISPINFO
|
|
2583 LVN_GETINFOTIP
|
|
2584 TVN_SELCHANGING
|
|
2585 TVN_SELCHANGED
|
|
2586 TVN_GETDISPINFO
|
|
2587 TVN_SETDISPINFO
|
|
2588 TVN_ITEMEXPANDING
|
|
2589 TVN_ITEMEXPANDED
|
|
2590 TVN_BEGINDRAG
|
|
2591 TVN_BEGINRDRAG
|
|
2592 TVN_DELETEITEM
|
|
2593 TVN_BEGINLABELEDIT
|
|
2594 TVN_ENDLABELEDIT
|
|
2595 TVN_GETINFOTIP
|
|
2596 CBEN_GETDISPINFO
|
|
2597 CBEN_DRAGBEGIN
|
|
2598 CBEN_ENDEDIT
|
|
2599 DTN_USERSTRING
|
|
2600 DTN_WMKEYDOWN
|
|
2601 DTN_FORMAT
|
|
2602 DTN_FORMATQUERY
|
|
2603 BFFM_VALIDATEFAILED (send to SHBrowseForFolder procedure)
|
|
2604 */
|
|
2605
|
|
2606 /*
|
|
2607 split structures:
|
|
2608
|
|
2609 TV_INSERTSTRUCT (simple-split, though -- just cast)
|
|
2610 TC_ITEM (simple-split, though -- just cast)
|
|
2611
|
|
2612 ####
|
|
2613 */
|
|
2614
|
|
2615 /*
|
|
2616 split macros or macros needing splitting:
|
|
2617
|
|
2618 ####
|
|
2619 */
|
|
2620
|
|
2621 LRESULT
|
|
2622 qxeSendMessage (HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam)
|
|
2623 {
|
|
2624 #define FROB(msg) \
|
|
2625 case msg##A: \
|
|
2626 /* split structures are the same size, so no conversion necessary */ \
|
|
2627 Msg = msg##W; \
|
|
2628 break;
|
|
2629
|
|
2630 if (XEUNICODE_P)
|
|
2631 {
|
|
2632 WCHAR classname[100];
|
|
2633 /* the name for SHBrowseForFolder windows is non-obvious so we have
|
|
2634 to intercept the callback */
|
|
2635 if (is_SHBrowseForFolder (hWnd))
|
|
2636 {
|
|
2637 switch (Msg)
|
|
2638 {
|
|
2639 FROB (BFFM_SETSELECTION);
|
|
2640 FROB (BFFM_SETSTATUSTEXT);
|
|
2641 default: break;
|
|
2642 }
|
|
2643 }
|
|
2644 else if (!GetClassNameW (hWnd, classname, 100))
|
|
2645 ;
|
|
2646 /* luckily, subclassing leaves the name alone, so we can still
|
|
2647 determine fairly easily the correct class to switch on */
|
|
2648 else if (!wcscmp (classname, WC_HEADERW))
|
|
2649 {
|
|
2650 switch (Msg)
|
|
2651 {
|
|
2652 FROB (HDM_INSERTITEM);
|
|
2653 FROB (HDM_GETITEM);
|
|
2654 FROB (HDM_SETITEM);
|
|
2655 default: break;
|
|
2656 }
|
|
2657 }
|
|
2658 else if (!wcscmp (classname, TOOLBARCLASSNAMEW))
|
|
2659 {
|
|
2660 switch (Msg)
|
|
2661 {
|
|
2662 FROB (TB_GETBUTTONTEXT);
|
|
2663 FROB (TB_SAVERESTORE);
|
|
2664 FROB (TB_ADDSTRING);
|
|
2665 FROB (TB_GETBUTTONINFO);
|
|
2666 FROB (TB_SETBUTTONINFO);
|
|
2667 FROB (TB_INSERTBUTTON);
|
|
2668 FROB (TB_ADDBUTTONS);
|
|
2669 default: break;
|
|
2670 }
|
|
2671 }
|
|
2672 else if (!wcscmp (classname, REBARCLASSNAMEW))
|
|
2673 {
|
|
2674 switch (Msg)
|
|
2675 {
|
|
2676 FROB (RB_INSERTBAND);
|
|
2677 FROB (RB_SETBANDINFO);
|
|
2678 FROB (RB_GETBANDINFO);
|
|
2679 default: break;
|
|
2680 }
|
|
2681 }
|
|
2682 else if (!wcscmp (classname, TOOLTIPS_CLASSW))
|
|
2683 {
|
|
2684 switch (Msg)
|
|
2685 {
|
|
2686 FROB (TTM_ADDTOOL);
|
|
2687 FROB (TTM_DELTOOL);
|
|
2688 FROB (TTM_NEWTOOLRECT);
|
|
2689 FROB (TTM_GETTOOLINFO);
|
|
2690 FROB (TTM_SETTOOLINFO);
|
|
2691 FROB (TTM_HITTEST);
|
|
2692 FROB (TTM_GETTEXT);
|
|
2693 FROB (TTM_UPDATETIPTEXT);
|
|
2694 FROB (TTM_ENUMTOOLS);
|
|
2695 FROB (TTM_GETCURRENTTOOL);
|
|
2696 default: break;
|
|
2697 }
|
|
2698 }
|
|
2699 else if (!wcscmp (classname, STATUSCLASSNAMEW))
|
|
2700 {
|
|
2701 switch (Msg)
|
|
2702 {
|
|
2703 FROB (SB_GETTEXT);
|
|
2704 FROB (SB_SETTEXT);
|
|
2705 FROB (SB_GETTEXTLENGTH);
|
|
2706 FROB (SB_SETTIPTEXT);
|
|
2707 FROB (SB_GETTIPTEXT);
|
|
2708 default: break;
|
|
2709 }
|
|
2710 }
|
|
2711 else if (!wcscmp (classname, WC_LISTVIEWW))
|
|
2712 {
|
|
2713 switch (Msg)
|
|
2714 {
|
|
2715 FROB (LVM_GETITEM);
|
|
2716 FROB (LVM_SETITEM);
|
|
2717 FROB (LVM_INSERTITEM);
|
|
2718 FROB (LVM_FINDITEM);
|
|
2719 FROB (LVM_GETSTRINGWIDTH);
|
|
2720 FROB (LVM_EDITLABEL);
|
|
2721 FROB (LVM_GETCOLUMN);
|
|
2722 FROB (LVM_SETCOLUMN);
|
|
2723 FROB (LVM_GETITEMTEXT);
|
|
2724 FROB (LVM_SETITEMTEXT);
|
|
2725 FROB (LVM_GETISEARCHSTRING);
|
|
2726 FROB (LVM_SETBKIMAGE);
|
|
2727 FROB (LVM_GETBKIMAGE);
|
|
2728 default: break;
|
|
2729 }
|
|
2730 }
|
|
2731 else if (!wcscmp (classname, WC_TREEVIEWW))
|
|
2732 {
|
|
2733 switch (Msg)
|
|
2734 {
|
|
2735 FROB (TVM_INSERTITEM); /* no need to split TV_INSERTSTRUCT */
|
|
2736 FROB (TVM_GETITEM);
|
|
2737 FROB (TVM_SETITEM);
|
|
2738 FROB (TVM_EDITLABEL);
|
|
2739 FROB (TVM_GETISEARCHSTRING);
|
|
2740 default: break;
|
|
2741 }
|
|
2742 }
|
|
2743 else if (!wcscmp (classname, WC_COMBOBOXEXW))
|
|
2744 {
|
|
2745 switch (Msg)
|
|
2746 {
|
|
2747 FROB (CBEM_INSERTITEM);
|
|
2748 FROB (CBEM_SETITEM);
|
|
2749 FROB (CBEM_GETITEM);
|
|
2750 default: break;
|
|
2751 }
|
|
2752 }
|
|
2753 else if (!wcscmp (classname, WC_TABCONTROLW))
|
|
2754 {
|
|
2755 switch (Msg)
|
|
2756 {
|
|
2757 FROB (TCM_GETITEM);
|
|
2758 FROB (TCM_SETITEM);
|
|
2759 FROB (TCM_INSERTITEM); /* no need to split TC_ITEM */
|
|
2760 default: break;
|
|
2761 }
|
|
2762 }
|
|
2763 else if (!wcscmp (classname, ANIMATE_CLASSW))
|
|
2764 {
|
|
2765 switch (Msg)
|
|
2766 {
|
|
2767 FROB (ACM_OPEN);
|
|
2768 default: break;
|
|
2769 }
|
|
2770 }
|
|
2771 else if (!wcscmp (classname, DATETIMEPICK_CLASSW))
|
|
2772 {
|
|
2773 switch (Msg)
|
|
2774 {
|
|
2775 FROB (DTM_SETFORMAT);
|
|
2776 default: break;
|
|
2777 }
|
|
2778 }
|
|
2779 }
|
|
2780
|
|
2781 if (XEUNICODE_P)
|
|
2782 return SendMessageW (hWnd, Msg, wParam, lParam);
|
|
2783 else
|
|
2784 return SendMessageA (hWnd, Msg, wParam, lParam);
|
|
2785
|
|
2786 #undef FROB
|
|
2787 }
|
|
2788
|
|
2789 #endif /* HAVE_MS_WINDOWS */
|
|
2790
|
|
2791
|