]> gitweb.factorcode.org Git - factor.git/commitdiff
windows.dropfiles: move two words from windows.dragdrop-listener
authorAlexander Iljin <ajsoft@yandex.ru>
Mon, 21 Aug 2017 23:27:03 +0000 (02:27 +0300)
committerJohn Benediktsson <mrjbq7@gmail.com>
Mon, 22 Jan 2018 21:09:41 +0000 (13:09 -0800)
basis/windows/dragdrop-listener/dragdrop-listener.factor
basis/windows/dropfiles/dropfiles-docs.factor [new file with mode: 0644]
basis/windows/dropfiles/dropfiles.factor

index fb04ba5da83e7fd7a67ace661aa144c0aef4ffbc..879d989d7b918184acb1103245fd11f11ee690b3 100644 (file)
@@ -5,25 +5,13 @@ USING: accessors alien.accessors alien.data alien.strings
 classes.struct io.encodings.utf16n kernel make math namespaces
 prettyprint sequences specialized-arrays
 ui.gadgets.worlds ui.tools.listener windows.com
-windows.com.wrapper windows.kernel32 windows.ole32
-windows.shell32 windows.types ;
+windows.com.wrapper windows.dropfiles windows.kernel32
+windows.ole32 windows.shell32 windows.types ;
 SPECIALIZED-ARRAY: WCHAR
 IN: windows.dragdrop-listener
 
 CONSTANT: E_OUTOFMEMORY -2147024882 ! 0x8007000e
 
-: filecount-from-hdrop ( hdrop -- n )
-    0xFFFFFFFF f 0 DragQueryFile ;
-
-: filenames-from-hdrop ( hdrop -- filenames )
-    dup filecount-from-hdrop <iota>
-    [
-        2dup f 0 DragQueryFile 1 + ! get size of filename buffer
-        dup WCHAR <c-array>
-        [ swap DragQueryFile drop ] keep
-        utf16n alien>string
-    ] with map ;
-
 : handle-data-object ( handler:  ( hdrop -- x ) data-object -- filenames )
     FORMATETC <struct>
         CF_HDROP         >>cfFormat
diff --git a/basis/windows/dropfiles/dropfiles-docs.factor b/basis/windows/dropfiles/dropfiles-docs.factor
new file mode 100644 (file)
index 0000000..80292b3
--- /dev/null
@@ -0,0 +1,18 @@
+! Copyright (C) 2017 Alexander Ilin.
+! See http://factorcode.org/license.txt for BSD license.
+USING: help.markup help.syntax kernel windows.ole32 ;
+IN: windows.dropfiles
+
+HELP: filecount-from-hdrop
+{ $values
+    { "hdrop" null }
+    { "n" null }
+}
+{ $description "" } ;
+
+HELP: filenames-from-hdrop
+{ $values
+    { "hdrop" null }
+    { "filenames" null }
+}
+{ $description "" } ;
index 4f07275004effd0b6bddf31b33a63b020e638c20..ab4ec14c37cba3cbea06bf1d7950606eae40e821 100644 (file)
@@ -1,3 +1,17 @@
 ! Copyright (C) 2017 Alexander Ilin.
 ! See http://factorcode.org/license.txt for BSD license.
+USING: alien.data alien.strings io.encodings.utf16n kernel math
+sequences windows.messages windows.shell32 windows.types ;
 IN: windows.dropfiles
+
+: filecount-from-hdrop ( hdrop -- n )
+    0xFFFFFFFF f 0 DragQueryFile ;
+
+: filenames-from-hdrop ( hdrop -- filenames )
+    dup filecount-from-hdrop <iota>
+    [
+        2dup f 0 DragQueryFile 1 + ! get size of filename buffer
+        dup WCHAR <c-array>
+        [ swap DragQueryFile drop ] keep
+        utf16n alien>string
+    ] with map ;