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