acme
Foundational cross-platform layer of the ca2 framework
Loading...
Searching...
No Matches
aaa_shell.h
1#pragma once
2
3//#define WH_SHSTDAPI(type) type
4//
5//
6//namespace linux
7//{
8//
9//
10// class CLASS_DECL_ACME shell
11// {
12// public:
13//
14//
15// shell();
16// virtual ~shell();
17//
18//
19// static shell theLinuxShell;
20//
21// static bool Initialize();
22//
25//
27//
29//
30// static ::u32 WINAPI _GetFullPathName(const wide_character * pFileName, ::u32 nBufferLength, wide_character * lpBuffer, wide_character * * lpFilePart);
31//
32// static WCHAR * __cdecl __fullpath(WCHAR *UserBuf, const WCHAR *path, size_t maxlen);
33// static i32_bool WINAPI _GetVolumeInformation(
34// const wide_character * pRootPathName, // root directory
35//
36// wide_character * pVolumeNameBuffer, // volume name buffer
37//
38// ::u32 nVolumeNameSize, // length of name buffer
39// LPDWORD pVolumeSerialNumber, // volume serial number
40//
41// LPDWORD pMaximumComponentLength, // maximum file name length
42//
43// LPDWORD pFileSystemFlags, // file system options
44//
45// wide_character * pFileSystemNameBuffer, // file system name buffer
46//
47// ::u32 nFileSystemNameSize); // length of file system name buffer
49// // xxx const wide_character * pszPath,
50// // xxx ::u32 dwFileAttributes,
51// // xxx SHFILEINFOW *psfi,
52// // xxx ::u32 cbFileInfo,
53// // xxx ::u32 uFlags);
54// static i32_bool __stdcall _GetStringTypeEx(
55// LCID Locale,
56// ::u32 dwInfoType,
57// const wide_character * pSrcStr,
58//
59// ::i32 cchSrc,
60// LPWORD pCharType);
61//
62// static ::u32 WINAPI _GetTempPath(
63// ::u32 nBufferLength,
64// wide_character * pBuffer);
65//
66// static ::u32 WINAPI _GetTempFileName(
67// const wide_character * pszPath,
68//
69// const wide_character * pszPrefix,
70//
71// ::u32 uUnique,
72// wide_character * pTempFileName);
73//
74// static HANDLE WINAPI _CreateFile(
75// const wide_character * pFileName,
76//
77// ::u32 dwDesiredAccess,
78// ::u32 dwShareMode,
79// LPSECURITY_ATTRIBUTES pSecurityAttributes,
80//
81// ::u32 dwCreationDisposition,
82// ::u32 dwFlagsAndAttributes,
83// HANDLE hTemplateFile
84// );
85// static ::u32 WINAPI _GetModuleFileName(
86// HMODULE hModule,
87// wide_character * pFilename,
88//
89// ::u32 nSize
90// );
94//
96//
98// // xxx const WNDCLASSW *puserinteractionclass);
99//
100//
101// static oswindow WINAPI _CreateWindowEx(
102// ::u32 dwExStyle,
103// const wide_character * pClassName,
104//
105// const wide_character * pWindowName,
106//
107// ::u32 dwStyle,
108// ::i32 x,
109// ::i32 y,
110// ::i32 nWidth,
111// ::i32 nHeight,
112// oswindow hWndParent,
113// HMENU hMenu,
114// HINSTANCE hInstance,
115// LPVOID pParam);
116//
117//
120//
122//
123// i32_bool (WINAPI * m_pfnMoveFile)(const wide_character * pExistingFileName, const wide_character * lpNewFileName);
124//
125// WCHAR * (__cdecl * m_pfn_fullpath)(WCHAR *UserBuf, const WCHAR *path, size_t maxlen);
126// ::u32 (WINAPI * m_pfnGetFullPathName)(const wide_character * pFileName, ::u32 nBufferLength, wide_character * lpBuffer, wide_character * * lpFilePart);
127//
128// i32_bool (WINAPI * m_pfnGetVolumeInformation)(
129// const wide_character * pRootPathName, // root directory
130//
131// wide_character * pVolumeNameBuffer, // volume name buffer
132//
133// ::u32 nVolumeNameSize, // length of name buffer
134// LPDWORD pVolumeSerialNumber, // volume serial number
135//
136// LPDWORD pMaximumComponentLength, // maximum file name length
137//
138// LPDWORD pFileSystemFlags, // file system options
139//
140// wide_character * pFileSystemNameBuffer, // file system name buffer
141//
142// ::u32 nFileSystemNameSize); // length of file system name buffer
143//
150// i32_bool (__stdcall * m_pfnGetStringTypeEx)(
151// LCID Locale,
152// ::u32 dwInfoType,
153// const wide_character * pSrcStr,
154//
155// ::i32 cchSrc,
156// LPWORD pCharType);
157//
158// ::u32 (WINAPI * m_pfnGetTempPath)(
159// ::u32 nBufferLength,
160// wide_character * pBuffer);
161//
162// ::u32 (WINAPI * m_pfnGetTempFileName)(
163// const wide_character * pszPath,
164//
165// const wide_character * pszPrefix,
166//
167// ::u32 uUnique,
168// wide_character * pTempFileName);
169//
170// HANDLE (WINAPI * m_pfnCreateFile)(
171// const wide_character * pFileName,
172//
173// ::u32 dwDesiredAccess,
174// ::u32 dwShareMode,
175// LPSECURITY_ATTRIBUTES pSecurityAttributes,
176//
177// ::u32 dwCreationDisposition,
178// ::u32 dwFlagsAndAttributes,
179// HANDLE hTemplateFile
180// );
181//
182// ::u32 (WINAPI * m_pfnGetModuleFileName)(
183// HMODULE hModule,
184// wide_character * pFilename,
185//
186// ::u32 nSize
187// );
188//
190// // xxx HINSTANCE hInstance ,
192//
194//
195//
196// // xxx ATOM (WINAPI * m_pfnRegisterClass)(
197// // xxx const WNDCLASSW *puserinteractionclass);
198//
199//
200// oswindow (WINAPI * m_pfnCreateWindowEx)(
201// ::u32 dwExStyle,
202// const wide_character * pClassName,
203//
204// const wide_character * pWindowName,
205//
206// ::u32 dwStyle,
207// ::i32 x,
208// ::i32 y,
209// ::i32 nWidth,
210// ::i32 nHeight,
211// oswindow hWndParent,
212// HMENU hMenu,
213// HINSTANCE hInstance,
214// LPVOID pParam);
215//
219//
221//
222// static i32_bool MoveFile(const wide_character * pExistingFileName, const wide_character * lpNewFileName);
223//
224// static WCHAR * __cdecl _fullpath(WCHAR *UserBuf, const WCHAR *path, size_t maxlen);
225// static ::u32 GetFullPathName(const wide_character * pFileName, ::u32 nBufferLength, wide_character * lpBuffer, wide_character * * lpFilePart);
226//
227// static i32_bool GetVolumeInformation(
228// const wide_character * pRootPathName, // root directory
229//
230// wide_character * pVolumeNameBuffer, // volume name buffer
231//
232// ::u32 nVolumeNameSize, // length of name buffer
233// LPDWORD pVolumeSerialNumber, // volume serial number
234//
235// LPDWORD pMaximumComponentLength, // maximum file name length
236//
237// LPDWORD pFileSystemFlags, // file system options
238//
239// wide_character * pFileSystemNameBuffer, // file system name buffer
240//
241// ::u32 nFileSystemNameSize); // length of file system name buffer
242//
249//
250// static i32_bool GetStringTypeEx(
251// LCID Locale,
252// ::u32 dwInfoType,
253// const_char_pointer pSrcStr,
254//
255// ::i32 cchSrc,
256// LPWORD pCharType);
257//
258//
259// static ::u32 GetTempPathW(
260// ::u32 nBufferLength,
261// wide_character * pBuffer);
262//
263//
264// static ::u32 GetTempFileNameW(
265// const wide_character * pszPath,
266//
267// const wide_character * pszPrefix,
268//
269// ::u32 uUnique,
270// wide_character * pTempFileName);
271//
272//
273// static HANDLE CreateFile(
274// const wide_character * pFileName,
275//
276// ::u32 dwDesiredAccess,
277// ::u32 dwShareMode,
278// LPSECURITY_ATTRIBUTES pSecurityAttributes,
279//
280// ::u32 dwCreationDisposition,
281// ::u32 dwFlagsAndAttributes,
282// HANDLE hTemplateFile);
283//
284// static ::u32 WINAPI GetModuleFileName(
285// HMODULE hModule,
286// wide_character * pFilename,
287//
288// ::u32 nSize
289// );
290//
294//
296//
297//
300//
301//
302// static oswindow WINAPI CreateWindowEx(
303// ::u32 dwExStyle,
304// const wide_character * pClassName,
305//
306// const wide_character * pWindowName,
307//
308// ::u32 dwStyle,
309// ::i32 x,
310// ::i32 y,
311// ::i32 nWidth,
312// ::i32 nHeight,
313// oswindow hWndParent,
314// HMENU hMenu,
315// HINSTANCE hInstance,
316// LPVOID pParam);
317//
318//
319//
326//
327// static ::u32 GetTempPath(string & str);
328//
329// static ::u32 GetTempFileName(
330// const ::file::path & path,
331//
332// const ::scoped_string & scopedstrPrefix,
333//
334// ::u32 uUnique,
335// string & str);
336//
337// static i32_bool MoveFile(const_char_pointer pExistingFileName, const_char_pointer lpNewFileName);
338//
339//*/
340//};
341//
342//
343//
345//{
346// wide_character * pwszPath = (wide_character * ) malloc(sizeof(unichar) * MAX_PATH * 4);
347// if(!(*theLinuxShell.m_pfnSHGetPathFromIDList)(pidl, pwszPath))
348// {
349// free(pwszPath);
350// return false;
351// }
352// unicode_to_utf8(str, pwszPath);
353// free(pwszPath);
354// return true;
355//}
356//*/
358//
359//inline i32_bool shell::SHGetPathFromIDList(LPCITEMIDLIST pidl, wide_character * pszPath)
360//{
361// return (*theLinuxShell.m_pfnSHGetPathFromIDList)(pidl, pszPath);
362//}
363//*/
365//inline HANDLE shell::FindFirstFile(const wide_character * pcsz, WIN32_FIND_DATAW * pdata)
366//
367//{
368// return (*theLinuxShell.m_pfnFindFirstFile)(pcsz, pdata);
369//
370//}
371//
372//inline i32_bool shell::FindNextFile(HANDLE handle, WIN32_FIND_DATAW * pdata)
373//
374//{
375// return (*theLinuxShell.m_pfnFindNextFile)(handle, pdata);
376//
377//}
378//
379//*/
380//
382//inline WCHAR * shell::_fullpath(WCHAR *UserBuf, const WCHAR *path, size_t maxlen)
383//{
384// return (*theLinuxShell.m_pfn_fullpath)(UserBuf, path, maxlen);
385//}
386//
387//inline ::u32 shell::GetFullPathName(const wide_character * pFileName, ::u32 nBufferLength, wide_character * lpBuffer, wide_character * * lpFilePart)
388//
389//{
390// return (*theLinuxShell.m_pfnGetFullPathName)(pFileName, nBufferLength, lpBuffer, lpFilePart);
391//
392//}
393//
394//
395//inline i32_bool shell::MoveFile(const wide_character * pExistingFileName, const wide_character * lpNewFileName)
396//
397//{
398// return (*theLinuxShell.m_pfnMoveFile)(pExistingFileName, lpNewFileName);
399//
400//}
401//
402//inline i32_bool shell::GetVolumeInformation(
403// const wide_character * pRootPathName, // root directory
404//
405// wide_character * pVolumeNameBuffer, // volume name buffer
406//
407// ::u32 nVolumeNameSize, // length of name buffer
408// LPDWORD pVolumeSerialNumber, // volume serial number
409//
410// LPDWORD pMaximumComponentLength, // maximum file name length
411//
412// LPDWORD pFileSystemFlags, // file system options
413//
414// wide_character * pFileSystemNameBuffer, // file system name buffer
415//
416// ::u32 nFileSystemNameSize) // length of file system name buffer
417//{
418// return (*theLinuxShell.m_pfnGetVolumeInformation)(
419// pRootPathName, // root directory
420//
421// pVolumeNameBuffer, // volume name buffer
422//
423// nVolumeNameSize, // length of name buffer
424// pVolumeSerialNumber, // volume serial number
425//
426// pMaximumComponentLength, // maximum file name length
427//
428// pFileSystemFlags, // file system options
429//
430// pFileSystemNameBuffer, // file system name buffer
431//
432// nFileSystemNameSize); // length of file system name buffer
433//}
434//
435//*/
436//
438//inline ::u32 shell::SHGetFileInfo(
439// const wide_character * pszPath,
440// ::u32 dwFileAttributes,
441// SHFILEINFOW *psfi,
442// ::u32 cbFileInfo,
443// ::u32 uFlags)
444//{
445// return (*theLinuxShell.m_pfnSHGetFileInfo)(
446// pszPath,
447// dwFileAttributes,
448// psfi,
449// cbFileInfo,
450// uFlags);
451//}
452//*/
454//inline ::u32 shell::GetTempPathW(
455// ::u32 nBufferLength,
456// wide_character * pBuffer)
457//
458//{
459// return (*theLinuxShell.m_pfnGetTempPath)(
460// nBufferLength,
461// pBuffer);
462//
463//}
464//
465//inline ::u32 shell::GetTempFileNameW(
466// const wide_character * pszPath,
467//
468// const wide_character * pszPrefix,
469//
470// ::u32 uUnique,
471// wide_character * pTempFileName)
472//
473//{
474// return (*theLinuxShell.m_pfnGetTempFileName)(
475// pszPath,
476//
477// pszPrefix,
478//
479// uUnique,
480// pTempFileName);
481//
482//}
483//
484//inline HANDLE shell::CreateFile(
485// const wide_character * pFileName,
486//
487// ::u32 dwDesiredAccess,
488// ::u32 dwShareMode,
489// LPSECURITY_ATTRIBUTES pSecurityAttributes,
490//
491// ::u32 dwCreationDisposition,
492// ::u32 dwFlagsAndAttributes,
493// HANDLE hTemplateFile)
494//{
495// return (*theLinuxShell.m_pfnCreateFile)(
496// pFileName,
497//
498// dwDesiredAccess,
499// dwShareMode,
500// pSecurityAttributes,
501//
502// dwCreationDisposition,
503// dwFlagsAndAttributes,
504// hTemplateFile);
505//}
506//
507//inline ::u32 shell::GetModuleFileName(
508// HMODULE hModule,
509// wide_character * pFilename,
510//
511// ::u32 nSize
512// )
513//{
514// return (*theLinuxShell.m_pfnGetModuleFileName)(
515// hModule,
516// pFilename,
517//
518// nSize);
519//}
520//
521//*/
522//
524//
525//inline i32_bool shell::GetClassInfo(
526// HINSTANCE hInstance ,
527// const wide_character * pClassName,
528//
529// LPWNDCLASSW puserinteractionclass)
530//
531//{
532// return (*theLinuxShell.m_pfnGetClassInfo)(
533// hInstance ,
534// pClassName,
535//
536// puserinteractionclass);
537//
538//}
539//
540//inline ATOM shell::RegisterClass(
541// const WNDCLASSW *puserinteractionclass)
542//
543//{
544// return (*theLinuxShell.m_pfnRegisterClass)(
545// puserinteractionclass);
546//
547//}*/
549//inline oswindow shell::CreateWindowEx(
550// ::u32 dwExStyle,
551// const wide_character * pClassName,
552//
553// const wide_character * pWindowName,
554//
555// ::u32 dwStyle,
556// ::i32 x,
557// ::i32 y,
558// ::i32 nWidth,
559// ::i32 nHeight,
560// oswindow hWndParent,
561// HMENU hMenu,
562// HINSTANCE hInstance,
563// LPVOID pParam)
564//
565//{
566// return (*theLinuxShell.m_pfnCreateWindowEx)(
567// dwExStyle,
568// pClassName,
569//
570// pWindowName,
571//
572// dwStyle,
573// x,
574// y,
575// nWidth,
576// nHeight,
577// hWndParent,
578// hMenu,
579// hInstance,
580// pParam);
581//
582//
583//}
584//
585//inline ::u32 shell::GetTempPath(string & str)
586//{
587// wide_character * pwsz = (wide_character * ) malloc(sizeof(unichar) * MAX_PATH * 4);
588// ::u32 dwResult = (*theLinuxShell.m_pfnGetTempPath)(sizeof(unichar) * MAX_PATH * 4, pwsz);
589// unicode_to_utf8(str, pwsz);
590// free(pwsz);
591// return dwResult;
592//}
593//
594//inline ::u32 shell::GetTempFileName(const ::file::path & path, const ::scoped_string & scopedstrPrefix, ::u32 uUnique, string & str)
595//
596//{
597// wstring wstrPathName = utf8_to_unicode(scopedstrPath);
598//
599// wstring wstrPrefixString = utf8_to_unicode(scopedstrPrefix);
600//
601// wstring wstr;
602// wstr.get_buffer(MAX_PATH * 4);
603// ::u32 uResult = (*theLinuxShell.m_pfnGetTempFileName)(
604// wstrPathName,
605// wstrPrefixString,
606// uUnique,
607// wstr);
608// unicode_to_utf8(str, wstr);
609// return uiResult;
610//}
611//
612//inline i32_bool shell::MoveFile(const_char_pointer pExistingFileName, const_char_pointer lpNewFileName)
613//
614//{
615// return MoveFile(utf8_to_unicode(pExistingFileName), utf8_to_unicode(lpNewFileName));
616//
617//}
618//
619//*/
620//
621//
622//} // namespace linux
623//