]> gitweb.factorcode.org Git - factor.git/commitdiff
update windows.* for <c-array> change
authorJoe Groff <arcata@gmail.com>
Mon, 31 Aug 2009 14:58:27 +0000 (09:58 -0500)
committerJoe Groff <arcata@gmail.com>
Mon, 31 Aug 2009 14:58:27 +0000 (09:58 -0500)
basis/windows/dragdrop-listener/dragdrop-listener.factor
basis/windows/errors/errors.factor
basis/windows/shell32/shell32.factor

index e9c4930b6402d986189b7ac06b9d99c7f0d8e7f2..91dfddbbff28202781bf9ceb09aedaf791ee804e 100644 (file)
@@ -1,16 +1,19 @@
-USING: windows.com windows.com.wrapper combinators\r
-windows.kernel32 windows.ole32 windows.shell32 kernel accessors\r
+USING: alien.strings io.encodings.utf16n windows.com\r
+windows.com.wrapper combinators windows.kernel32 windows.ole32\r
+windows.shell32 kernel accessors\r
 prettyprint namespaces ui.tools.listener ui.tools.workspace\r
 alien.c-types alien sequences math ;\r
 IN: windows.dragdrop-listener\r
 \r
+<< "WCHAR" require-c-arrays >>\r
+\r
 : filenames-from-hdrop ( hdrop -- filenames )\r
     dup HEX: FFFFFFFF f 0 DragQueryFile ! get count of files\r
     [\r
         2dup f 0 DragQueryFile 1 + ! get size of filename buffer\r
         dup "WCHAR" <c-array>\r
         [ swap DragQueryFile drop ] keep\r
-        alien>u16-string\r
+        utf16n alien>string\r
     ] with map ;\r
 \r
 : filenames-from-data-object ( data-object -- filenames )\r
index 8bdbb9f1e99838bbcd812d1afce3966d2f73ce03..5551d34028f6c3fc20b329d6f62f3e10b0793501 100644 (file)
@@ -4,6 +4,8 @@ io.encodings.string io.encodings.utf16n alien.strings
 arrays literals ;
 IN: windows.errors
 
+<< "TCHAR" require-c-arrays >>
+
 CONSTANT: ERROR_SUCCESS                               0
 CONSTANT: ERROR_INVALID_FUNCTION                      1
 CONSTANT: ERROR_FILE_NOT_FOUND                        2
index 016f5ab149dc2a5cb0fe810423969f5c440600cb..a1915fff1687cccf661561e1751cebbd1d89d36d 100644 (file)
@@ -1,9 +1,10 @@
 ! Copyright (C) 2006, 2008 Doug Coleman.
 ! See http://factorcode.org/license.txt for BSD license.
 USING: alien alien.c-types alien.strings alien.syntax
-combinators io.encodings.utf16n io.files io.pathnames kernel
-windows.errors windows.com windows.com.syntax windows.user32
-windows.ole32 windows ;
+classes.struct combinators io.encodings.utf16n io.files
+io.pathnames kernel windows.errors windows.com
+windows.com.syntax windows.user32 windows.ole32 windows
+specialized-arrays.ushort ;
 IN: windows.shell32
 
 CONSTANT: CSIDL_DESKTOP HEX: 00
@@ -90,7 +91,7 @@ ALIAS: ShellExecute ShellExecuteW
 
 : shell32-directory ( n -- str )
     f swap f SHGFP_TYPE_DEFAULT
-    MAX_UNICODE_PATH "ushort" <c-array>
+    MAX_UNICODE_PATH <ushort-array>
     [ SHGetFolderPath drop ] keep utf16n alien>string ;
 
 : desktop ( -- str )
@@ -194,10 +195,13 @@ CONSTANT: STRRET_WSTR 0
 CONSTANT: STRRET_OFFSET 1
 CONSTANT: STRRET_CSTR 2
 
-C-UNION: STRRET-union "LPWSTR" "LPSTR" "UINT" "char[260]" ;
-C-STRUCT: STRRET
-    { "int" "uType" }
-    { "STRRET-union" "union" } ;
+UNION-STRUCT: STRRET-union
+    { pOleStr LPWSTR }
+    { uOffset UINT }
+    { cStr char[260] } ;
+STRUCT: STRRET
+    { uType int }
+    { value STRRET-union } ;
 
 COM-INTERFACE: IEnumIDList IUnknown {000214F2-0000-0000-C000-000000000046}
     HRESULT Next ( ULONG celt, LPITEMIDLIST* rgelt, ULONG* pceltFetched )