windows: FOO>bar is a section end FOO>, so use \FOO>bar for now.
parent
0319ff7920
commit
1fda1f7525
|
@ -44,8 +44,8 @@ MEMO:: (cache-font) ( name size bold? italic? -- HFONT )
|
|||
\ windows-fonts reset-memoized
|
||||
] "windows.fonts" add-startup-hook
|
||||
|
||||
: TEXTMETRIC>metrics ( TEXTMETRIC -- metrics )
|
||||
[ metrics new 0 >>width ] dip {
|
||||
: \TEXTMETRIC>metrics ( TEXTMETRIC -- metrics )
|
||||
[ metrics new 0 >>width ] dip {
|
||||
[ tmHeight>> >>height ]
|
||||
[ tmAscent>> >>ascent ]
|
||||
[ tmDescent>> >>descent ]
|
||||
|
|
|
@ -137,7 +137,7 @@ TUPLE: registry-enum-key ;
|
|||
max-value uint deref
|
||||
max-value-data uint deref
|
||||
security-descriptor uint deref
|
||||
last-write-time FILETIME>timestamp
|
||||
last-write-time \FILETIME>timestamp
|
||||
registry-info boa
|
||||
] [
|
||||
ret n>win32-error-string
|
||||
|
|
|
@ -2,6 +2,6 @@ USING: calendar calendar.windows kernel tools.test
|
|||
windows.time ;
|
||||
IN: windows.time.tests
|
||||
|
||||
[ t ] [ windows-1601 [ timestamp>FILETIME FILETIME>timestamp ] keep = ] unit-test
|
||||
[ t ] [ windows-time [ windows-time>FILETIME FILETIME>windows-time ] keep = ] unit-test
|
||||
[ t ] [ windows-1601 400 years time+ [ timestamp>FILETIME FILETIME>timestamp ] keep = ] unit-test
|
||||
[ t ] [ windows-1601 [ timestamp>FILETIME \FILETIME>timestamp ] keep = ] unit-test
|
||||
[ t ] [ windows-time [ windows-time>FILETIME \FILETIME>windows-time ] keep = ] unit-test
|
||||
[ t ] [ windows-1601 400 years time+ [ timestamp>FILETIME \FILETIME>timestamp ] keep = ] unit-test
|
||||
|
|
|
@ -10,7 +10,7 @@ IN: windows.time
|
|||
|
||||
: windows-1601 ( -- timestamp ) 1601 <year-gmt> ;
|
||||
|
||||
: FILETIME>windows-time ( FILETIME -- n )
|
||||
: \FILETIME>windows-time ( FILETIME -- n )
|
||||
[ dwLowDateTime>> ] [ dwHighDateTime>> ] bi >64bit ;
|
||||
|
||||
: windows-time>timestamp ( n -- timestamp )
|
||||
|
@ -18,7 +18,7 @@ IN: windows.time
|
|||
|
||||
: windows-time ( -- n )
|
||||
FILETIME <struct> [ GetSystemTimeAsFileTime ] keep
|
||||
FILETIME>windows-time ;
|
||||
\FILETIME>windows-time ;
|
||||
|
||||
: timestamp>windows-time ( timestamp -- n )
|
||||
! 64bit number representing # of nanoseconds since Jan 1, 1601 (UTC)
|
||||
|
@ -31,5 +31,5 @@ IN: windows.time
|
|||
: timestamp>FILETIME ( timestamp -- FILETIME/f )
|
||||
dup [ >gmt timestamp>windows-time windows-time>FILETIME ] when ;
|
||||
|
||||
: FILETIME>timestamp ( FILETIME -- timestamp/f )
|
||||
FILETIME>windows-time windows-time>timestamp ;
|
||||
: \FILETIME>timestamp ( FILETIME -- timestamp/f )
|
||||
\FILETIME>windows-time windows-time>timestamp ;
|
||||
|
|
|
@ -375,7 +375,7 @@ TYPEDEF: DWORD* LPCOLORREF
|
|||
|
||||
: color>RGB ( color -- COLORREF )
|
||||
>rgba-components drop [ 255 * >integer ] tri@ RGB ;
|
||||
: RGB>color ( COLORREF -- color )
|
||||
: \RGB>color ( COLORREF -- color )
|
||||
>RGB< [ 1/255. * >float ] tri@ 1.0 <rgba> ;
|
||||
|
||||
STRUCT: TEXTMETRICW
|
||||
|
|
|
@ -83,7 +83,7 @@ CONSTANT: ssa-dwFlags flags{ SSA_GLYPHS SSA_FALLBACK SSA_TAB }
|
|||
: dc-metrics ( dc -- metrics )
|
||||
TEXTMETRICW <struct>
|
||||
[ GetTextMetrics drop ] keep
|
||||
TEXTMETRIC>metrics ;
|
||||
\TEXTMETRIC>metrics ;
|
||||
|
||||
! DC limit is default soft-limited to 10,000 per process.
|
||||
: <script-string> ( font string -- script-string )
|
||||
|
|
Loading…
Reference in New Issue