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