]> gitweb.factorcode.org Git - factor.git/blobdiff - basis/windows/types/types.factor
io.encodings.utf16: add a utf16n word for native utf16 type.
[factor.git] / basis / windows / types / types.factor
index 3490e8083d3792adb655ea475c949cd7746435ac..af25decc5e2c6f31362814ae66948a0db23b63f8 100644 (file)
@@ -1,8 +1,8 @@
 ! Copyright (C) 2005, 2006 Doug Coleman.
 ! See http://factorcode.org/license.txt for BSD license.
-USING: alien alien.c-types alien.syntax namespaces kernel words
-sequences math math.bitwise math.vectors colors
-io.encodings.utf16n classes.struct accessors ;
+USING: alien.c-types alien.syntax classes.struct colors
+io.encodings.utf16 io.encodings.utf8 kernel math math.bitwise
+math.vectors sequences ;
 FROM: alien.c-types => float short ;
 IN: windows.types
 
@@ -72,6 +72,8 @@ TYPEDEF: size_t SIZE_T
 TYPEDEF: ptrdiff_t SSIZE_T
 
 TYPEDEF: { c-string utf16n } LPCSTR
+TYPEDEF: { c-string utf16n } LPTCSTR
+
 TYPEDEF: { c-string utf16n } LPWSTR
 TYPEDEF: WCHAR       TCHAR
 TYPEDEF: LPWSTR      LPTCH
@@ -126,13 +128,13 @@ TYPEDEF: DWORD               LGRPID
 TYPEDEF: LONG_PTR            LPARAM
 TYPEDEF: BOOL*               LPBOOL
 TYPEDEF: BYTE*               LPBYTE
+
 TYPEDEF: { c-string utf16n } LPCWSTR
 ! TYPEDEF: WCHAR*              LPWSTR
 
-TYPEDEF: { c-string utf16n } LPSTR
+TYPEDEF: { c-string utf8 } LPSTR
 TYPEDEF: { c-string utf16n } LPCTSTR
 TYPEDEF: { c-string utf16n } LPWTSTR
-
 TYPEDEF: { c-string utf16n } LPTSTR
 TYPEDEF: LPCSTR      PCTSTR
 TYPEDEF: LPSTR       PTSTR
@@ -191,6 +193,8 @@ TYPEDEF: LPVOID              SC_LOCK
 TYPEDEF: HANDLE              SERVICE_STATUS_HANDLE
 TYPEDEF: LONGLONG            USN
 TYPEDEF: UINT_PTR            WPARAM
+TYPEDEF: DWORD               ACCESS_MASK
+TYPEDEF: ACCESS_MASK*        PACCESS_MASK
 
 TYPEDEF: size_t socklen_t
 
@@ -271,7 +275,8 @@ TYPEDEF: void* PAINTSTRUCT
 
 STRUCT: POINT
     { x LONG }
-    { y LONG } ; 
+    { y LONG } ;
+TYPEDEF: POINT* LPPOINT
 
 STRUCT: SIZE
     { cx LONG }
@@ -368,9 +373,9 @@ TYPEDEF: DWORD* LPCOLORREF
 : RGB ( r g b -- COLORREF )
     { 16 8 0 } bitfield ; inline
 : >RGB< ( COLORREF -- r g b )
-    [           HEX: ff bitand ]
-    [  -8 shift HEX: ff bitand ]
-    [ -16 shift HEX: ff bitand ] tri ;
+    [           0xff bitand ]
+    [  -8 shift 0xff bitand ]
+    [ -16 shift 0xff bitand ] tri ;
 
 : color>RGB ( color -- COLORREF )
     >rgba-components drop [ 255 * >integer ] tri@ RGB ;
@@ -402,3 +407,6 @@ STRUCT: TEXTMETRICW
 TYPEDEF: TEXTMETRICW* LPTEXTMETRIC
 
 TYPEDEF: ULONG PROPID
+
+CALLBACK: BOOL WNDENUMPROC ( HWND hWnd, LPARAM lParam )
+CALLBACK: LRESULT HOOKPROC ( int nCode, WPARAM wParam, LPARAM lParam )