]> gitweb.factorcode.org Git - factor.git/blobdiff - basis/windows/types/types.factor
windows.types: fix using
[factor.git] / basis / windows / types / types.factor
index 3490e8083d3792adb655ea475c949cd7746435ac..1b846076568f10c31e3c0fe9d7d36b63a80fb6db 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.utf16n 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
@@ -129,10 +131,9 @@ 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
@@ -271,7 +272,7 @@ TYPEDEF: void* PAINTSTRUCT
 
 STRUCT: POINT
     { x LONG }
-    { y LONG } ; 
+    { y LONG } ;
 
 STRUCT: SIZE
     { cx LONG }
@@ -368,9 +369,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 ;