]> gitweb.factorcode.org Git - factor.git/blobdiff - basis/windows/shell32/shell32.factor
factor: FUNCTION: rename by hand...
[factor.git] / basis / windows / shell32 / shell32.factor
index 68ec7359790c85c03f004fb50b252ec010c38e85..c7b04cc2069a57d9d81aef2cff937d1704a1ce6d 100644 (file)
@@ -1,12 +1,11 @@
 ! Copyright (C) 2006, 2008 Doug Coleman.
 ! See http://factorcode.org/license.txt for BSD license.
 USING: alien alien.c-types alien.data alien.strings
-alien.syntax classes.struct combinators io.backend io.files
-io.pathnames kernel math sequences specialized-arrays
-ui.backend.windows windows windows.com windows.com.syntax
-windows.errors windows.kernel32 windows.ole32 windows.types
-windows.user32 io.files.info ;
-SPECIALIZED-ARRAY: ushort
+alien.syntax classes.struct io.backend kernel
+specialized-arrays
+specialized-arrays.instances.alien.c-types.ushort windows
+windows.com windows.com.syntax windows.kernel32 windows.ole32
+windows.types ;
 IN: windows.shell32
 
 CONSTANT: CSIDL_DESKTOP 0x00
@@ -82,10 +81,10 @@ CONSTANT: SHGFP_TYPE_DEFAULT 1
 
 LIBRARY: shell32
 
-FUNCTION: HRESULT SHGetFolderPathW ( HWND hwndOwner, int nFolder, HANDLE hToken, DWORD dwReserved, LPTSTR pszPath ) ;
+FUNCTION: HRESULT SHGetFolderPathW ( HWND hwndOwner, int nFolder, HANDLE hToken, DWORD dwReserved, LPTSTR pszPath )
 ALIAS: SHGetFolderPath SHGetFolderPathW
 
-FUNCTION: HINSTANCE ShellExecuteW ( HWND hwnd, LPCTSTR lpOperation, LPCTSTR lpFile, LPCTSTR lpParameters, LPCTSTR lpDirectory, INT nShowCmd ) ;
+FUNCTION: HINSTANCE ShellExecuteW ( HWND hwnd, LPCTSTR lpOperation, LPCTSTR lpFile, LPCTSTR lpParameters, LPCTSTR lpDirectory, INT nShowCmd )
 ALIAS: ShellExecute ShellExecuteW
 
 CONSTANT: SHGFI_ICON 0x000000100
@@ -120,7 +119,7 @@ FUNCTION: DWORD_PTR SHGetFileInfoW (
     SHFILEINFO *psfi,
     UINT cbFileInfo,
     UINT uFlags
-) ;
+)
 
 : shell32-file-info ( path -- err struct )
     normalize-path
@@ -142,31 +141,6 @@ INSTANCE: +win32-vxd-executable+ windows-executable  ! le
 INSTANCE: +win32-os2-executable+ windows-executable  ! ne
 INSTANCE: +win32-nt-executable+ windows-executable   ! pe
 
-: file-executable-type ( path -- executable/f )
-    normalize-path dup
-    0
-    f
-    ! hi is zero means old style executable
-    0 SHGFI_EXETYPE SHGetFileInfoW
-    [
-        file-info drop f
-    ] [
-        nip >lo-hi first2 zero? [
-            {
-                { 0x5A4D [ +dos-executable+ ] }
-                { 0x4550 [ +win32-console-executable+ ] }
-                [ drop f ]
-            } case
-        ] [
-            {
-                { 0x454C [ +win32-vxd-executable+ ] }
-                { 0x454E [ +win32-os2-executable+ ] }
-                { 0x4550 [ +win32-nt-executable+ ] }
-                [ drop f ]
-            } case
-        ] if
-    ] if-zero ;
-
 : shell32-directory ( n -- str )
     f swap f SHGFP_TYPE_DEFAULT
     MAX_UNICODE_PATH ushort <c-array>
@@ -198,7 +172,7 @@ INSTANCE: +win32-nt-executable+ windows-executable   ! pe
 
 : program-files-common-x86 ( -- str )
     CSIDL_PROGRAM_FILES_COMMONX86 shell32-directory ;
-    
+
 
 CONSTANT: SHCONTF_FOLDERS 32
 CONSTANT: SHCONTF_NONFOLDERS 64
@@ -300,9 +274,9 @@ COM-INTERFACE: IShellFolder IUnknown {000214E6-0000-0000-C000-000000000046}
     HRESULT GetDisplayNameOf ( LPCITEMIDLIST pidl, SHGDNF uFlags, STRRET* lpName )
     HRESULT SetNameOf ( HWND hwnd, LPCITEMIDLIST pidl, LPCOLESTR lpszName, SHGDNF uFlags, LPITEMIDLIST* ppidlOut ) ;
 
-FUNCTION: HRESULT SHGetDesktopFolder ( IShellFolder** ppshf ) ;
+FUNCTION: HRESULT SHGetDesktopFolder ( IShellFolder** ppshf )
 
-FUNCTION: UINT DragQueryFileW ( HDROP hDrop, UINT iFile, LPWSTR lpszFile, UINT cch ) ;
+FUNCTION: UINT DragQueryFileW ( HDROP hDrop, UINT iFile, LPWSTR lpszFile, UINT cch )
 ALIAS: DragQueryFile DragQueryFileW
 
-FUNCTION: BOOL IsUserAnAdmin ( ) ;
+FUNCTION: BOOL IsUserAnAdmin ( )