Merge branch 'master' of git://factorcode.org/git/factor into new-alien-pointers
commit
338edac16c
|
@ -1,7 +1,7 @@
|
|||
! (c)2009 Joe Groff bsd license
|
||||
USING: accessors alien.c-types alien.parser alien.syntax
|
||||
tools.test vocabs.parser parser eval vocabs.parser debugger
|
||||
continuations ;
|
||||
tools.test vocabs.parser parser eval debugger kernel
|
||||
continuations words ;
|
||||
IN: alien.parser.tests
|
||||
|
||||
TYPEDEF: char char2
|
||||
|
@ -30,6 +30,11 @@ CONSTANT: eleven 11
|
|||
[ "not-word" parse-c-type ] [ error>> no-word-error? ] must-fail-with
|
||||
] with-file-vocabs
|
||||
|
||||
FUNCTION: void* alien-parser-effect-test ( int *arg1 float arg2 ) ;
|
||||
[ (( arg1 arg2 -- void* )) ] [
|
||||
\ alien-parser-effect-test "declared-effect" word-prop
|
||||
] unit-test
|
||||
|
||||
! Reported by mnestic
|
||||
TYPEDEF: int alien-parser-test-int ! reasonably unique name...
|
||||
|
||||
|
|
|
@ -73,10 +73,10 @@ IN: alien.parser
|
|||
: function-quot ( return library function types -- quot )
|
||||
'[ _ _ _ _ alien-invoke ] ;
|
||||
|
||||
:: make-function ( return! library function! parameters -- word quot effect )
|
||||
return function normalize-c-arg function! return!
|
||||
:: make-function ( return library function parameters -- word quot effect )
|
||||
return function normalize-c-arg :> ( return-c-type function )
|
||||
function create-in dup reset-generic
|
||||
return library function
|
||||
return-c-type library function
|
||||
parameters return parse-arglist [ function-quot ] dip ;
|
||||
|
||||
: parse-arg-tokens ( -- tokens )
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
! Copyright (C) 2008 Doug Coleman.
|
||||
! See http://factorcode.org/license.txt for BSD license.
|
||||
USING: help.markup help.syntax kernel strings words vocabs ;
|
||||
USING: help.markup help.syntax kernel strings words vocabs sequences ;
|
||||
IN: tools.scaffold
|
||||
|
||||
HELP: developer-name
|
||||
|
@ -23,6 +23,30 @@ HELP: scaffold-undocumented
|
|||
|
||||
{ scaffold-help scaffold-undocumented } related-words
|
||||
|
||||
HELP: scaffold-authors
|
||||
{ $values
|
||||
{ "vocab" "a vocabulary specifier" }
|
||||
}
|
||||
{ $description "Creates an authors.txt file using the value in " { $link developer-name } ". This word only works if no authors.txt file yet exists." } ;
|
||||
|
||||
HELP: scaffold-summary
|
||||
{ $values
|
||||
{ "vocab" "a vocabulary specifier" } { "summary" string }
|
||||
}
|
||||
{ $description "Creates a summary.txt file with the given summary. This word only works if no summary.txt file yet exists." } ;
|
||||
|
||||
HELP: scaffold-tags
|
||||
{ $values
|
||||
{ "vocab" "a vocabulary specifier" } { "tags" string }
|
||||
}
|
||||
{ $description "Creates a tags.txt file with the given tags. This word only works if no tags.txt file yet exists." } ;
|
||||
|
||||
HELP: scaffold-tests
|
||||
{ $values
|
||||
{ "vocab" "a vocabulary specifier" }
|
||||
}
|
||||
{ $description "Takes an existing vocabulary and creates an empty tests file help for each word. This word only works if no tests file yet exists." } ;
|
||||
|
||||
HELP: scaffold-vocab
|
||||
{ $values
|
||||
{ "vocab-root" "a vocabulary root string" } { "string" string } }
|
||||
|
|
|
@ -59,6 +59,9 @@ M: bad-developer-name summary
|
|||
: vocab-root/vocab/suffix>path ( vocab-root vocab suffix -- path )
|
||||
[ vocab-root/vocab>path dup file-name append-path ] dip append ;
|
||||
|
||||
: vocab/file>path ( vocab file -- path )
|
||||
[ vocab>path ] dip append-path ;
|
||||
|
||||
: vocab/suffix>path ( vocab suffix -- path )
|
||||
[ vocab>path dup file-name append-path ] dip append ;
|
||||
|
||||
|
@ -100,16 +103,17 @@ M: bad-developer-name summary
|
|||
2drop
|
||||
] if ;
|
||||
|
||||
: scaffold-authors ( vocab-root vocab -- )
|
||||
developer-name get [
|
||||
"authors.txt" vocab-root/vocab/file>path scaffolding? [
|
||||
developer-name get swap utf8 set-file-contents
|
||||
: scaffold-metadata ( vocab file contents -- )
|
||||
[ ensure-vocab-exists ] 2dip
|
||||
[
|
||||
[ vocab/file>path ] dip swap scaffolding? [
|
||||
utf8 set-file-contents
|
||||
] [
|
||||
drop
|
||||
2drop
|
||||
] if
|
||||
] [
|
||||
2drop
|
||||
] if ;
|
||||
] if* ;
|
||||
|
||||
: lookup-type ( string -- object/string ? )
|
||||
"new" ?head drop [ { [ CHAR: ' = ] [ digit? ] } 1|| ] trim-tail
|
||||
|
@ -254,12 +258,21 @@ PRIVATE>
|
|||
: scaffold-undocumented ( string -- )
|
||||
[ interesting-words. ] [ link-vocab ] bi ;
|
||||
|
||||
: scaffold-authors ( vocab -- )
|
||||
"authors.txt" developer-name get scaffold-metadata ;
|
||||
|
||||
: scaffold-tags ( vocab tags -- )
|
||||
[ "tags.txt" ] dip scaffold-metadata ;
|
||||
|
||||
: scaffold-summary ( vocab summary -- )
|
||||
[ "summary.txt" ] dip scaffold-metadata ;
|
||||
|
||||
: scaffold-vocab ( vocab-root string -- )
|
||||
{
|
||||
[ scaffold-directory ]
|
||||
[ scaffold-main ]
|
||||
[ scaffold-authors ]
|
||||
[ nip require ]
|
||||
[ nip scaffold-authors ]
|
||||
} 2cleave ;
|
||||
|
||||
: scaffold-core ( string -- ) "resource:core" swap scaffold-vocab ;
|
||||
|
|
|
@ -1,6 +1,14 @@
|
|||
USING: help.markup help.syntax strings ;
|
||||
IN: vocabs.files
|
||||
|
||||
HELP: vocab-tests-file
|
||||
{ $values { "vocab" "a vocabulary specifier" } { "path" "pathname string to test file" } }
|
||||
{ $description "Outputs a pathname where the unit test file is located." } ;
|
||||
|
||||
HELP: vocab-tests-dir
|
||||
{ $values { "vocab" "a vocabulary specifier" } { "paths" "a sequence of pathname strings" } }
|
||||
{ $description "Outputs a sequence of pathnames for the tests in the test directory." } ;
|
||||
|
||||
HELP: vocab-files
|
||||
{ $values { "vocab" "a vocabulary specifier" } { "seq" "a sequence of pathname strings" } }
|
||||
{ $description "Outputs a sequence of files comprising this vocabulary, or " { $link f } " if the vocabulary does not have a directory on disk." } ;
|
||||
|
|
|
@ -4,8 +4,6 @@ USING: io.directories io.files io.pathnames kernel make
|
|||
sequences vocabs.loader ;
|
||||
IN: vocabs.files
|
||||
|
||||
<PRIVATE
|
||||
|
||||
: vocab-tests-file ( vocab -- path )
|
||||
dup "-tests.factor" vocab-dir+ vocab-append-path dup
|
||||
[ dup exists? [ drop f ] unless ] [ drop f ] if ;
|
||||
|
@ -18,8 +16,6 @@ IN: vocabs.files
|
|||
] [ drop f ] if
|
||||
] [ drop f ] if ;
|
||||
|
||||
PRIVATE>
|
||||
|
||||
: vocab-tests ( vocab -- tests )
|
||||
[
|
||||
[ vocab-tests-file [ , ] when* ]
|
||||
|
|
|
@ -0,0 +1 @@
|
|||
Erik Charlebois
|
|
@ -0,0 +1,805 @@
|
|||
! Copyright (C) 2010 Erik Charlebois.
|
||||
! See http://factorcode.org/license.txt for BSD license.
|
||||
USING: alien.c-types alien.libraries alien.syntax classes.struct
|
||||
kernel math windows.types windows.ole32 ;
|
||||
IN: windows.ddk.hid
|
||||
|
||||
<< "hid" "hid.dll" "stdcall" add-library >>
|
||||
LIBRARY: hid
|
||||
|
||||
TYPEDEF: LONG NTSTATUS
|
||||
TYPEDEF: USHORT USAGE
|
||||
TYPEDEF: USAGE* PUSAGE
|
||||
|
||||
CONSTANT: HID_USAGE_PAGE_UNDEFINED HEX: 00
|
||||
CONSTANT: HID_USAGE_PAGE_GENERIC HEX: 01
|
||||
CONSTANT: HID_USAGE_PAGE_SIMULATION HEX: 02
|
||||
CONSTANT: HID_USAGE_PAGE_VR HEX: 03
|
||||
CONSTANT: HID_USAGE_PAGE_SPORT HEX: 04
|
||||
CONSTANT: HID_USAGE_PAGE_GAME HEX: 05
|
||||
CONSTANT: HID_USAGE_PAGE_KEYBOARD HEX: 07
|
||||
CONSTANT: HID_USAGE_PAGE_LED HEX: 08
|
||||
CONSTANT: HID_USAGE_PAGE_BUTTON HEX: 09
|
||||
CONSTANT: HID_USAGE_PAGE_ORDINAL HEX: 0A
|
||||
CONSTANT: HID_USAGE_PAGE_TELEPHONY HEX: 0B
|
||||
CONSTANT: HID_USAGE_PAGE_CONSUMER HEX: 0C
|
||||
CONSTANT: HID_USAGE_PAGE_DIGITIZER HEX: 0D
|
||||
CONSTANT: HID_USAGE_PAGE_UNICODE HEX: 10
|
||||
CONSTANT: HID_USAGE_PAGE_ALPHANUMERIC HEX: 14
|
||||
|
||||
CONSTANT: HID_USAGE_PAGE_MICROSOFT_BLUETOOTH_HANDSFREE HEX: FFF3
|
||||
|
||||
CONSTANT: HID_USAGE_GENERIC_POINTER HEX: 01
|
||||
CONSTANT: HID_USAGE_GENERIC_MOUSE HEX: 02
|
||||
CONSTANT: HID_USAGE_GENERIC_JOYSTICK HEX: 04
|
||||
CONSTANT: HID_USAGE_GENERIC_GAMEPAD HEX: 05
|
||||
CONSTANT: HID_USAGE_GENERIC_KEYBOARD HEX: 06
|
||||
CONSTANT: HID_USAGE_GENERIC_KEYPAD HEX: 07
|
||||
CONSTANT: HID_USAGE_GENERIC_SYSTEM_CTL HEX: 80
|
||||
|
||||
CONSTANT: HID_USAGE_GENERIC_X HEX: 30
|
||||
CONSTANT: HID_USAGE_GENERIC_Y HEX: 31
|
||||
CONSTANT: HID_USAGE_GENERIC_Z HEX: 32
|
||||
CONSTANT: HID_USAGE_GENERIC_RX HEX: 33
|
||||
CONSTANT: HID_USAGE_GENERIC_RY HEX: 34
|
||||
CONSTANT: HID_USAGE_GENERIC_RZ HEX: 35
|
||||
CONSTANT: HID_USAGE_GENERIC_SLIDER HEX: 36
|
||||
CONSTANT: HID_USAGE_GENERIC_DIAL HEX: 37
|
||||
CONSTANT: HID_USAGE_GENERIC_WHEEL HEX: 38
|
||||
CONSTANT: HID_USAGE_GENERIC_HATSWITCH HEX: 39
|
||||
CONSTANT: HID_USAGE_GENERIC_COUNTED_BUFFER HEX: 3A
|
||||
CONSTANT: HID_USAGE_GENERIC_BYTE_COUNT HEX: 3B
|
||||
CONSTANT: HID_USAGE_GENERIC_MOTION_WAKEUP HEX: 3C
|
||||
CONSTANT: HID_USAGE_GENERIC_VX HEX: 40
|
||||
CONSTANT: HID_USAGE_GENERIC_VY HEX: 41
|
||||
CONSTANT: HID_USAGE_GENERIC_VZ HEX: 42
|
||||
CONSTANT: HID_USAGE_GENERIC_VBRX HEX: 43
|
||||
CONSTANT: HID_USAGE_GENERIC_VBRY HEX: 44
|
||||
CONSTANT: HID_USAGE_GENERIC_VBRZ HEX: 45
|
||||
CONSTANT: HID_USAGE_GENERIC_VNO HEX: 46
|
||||
CONSTANT: HID_USAGE_GENERIC_SYSCTL_POWER HEX: 81
|
||||
CONSTANT: HID_USAGE_GENERIC_SYSCTL_SLEEP HEX: 82
|
||||
CONSTANT: HID_USAGE_GENERIC_SYSCTL_WAKE HEX: 83
|
||||
CONSTANT: HID_USAGE_GENERIC_SYSCTL_CONTEXT_MENU HEX: 84
|
||||
CONSTANT: HID_USAGE_GENERIC_SYSCTL_MAIN_MENU HEX: 85
|
||||
CONSTANT: HID_USAGE_GENERIC_SYSCTL_APP_MENU HEX: 86
|
||||
CONSTANT: HID_USAGE_GENERIC_SYSCTL_HELP_MENU HEX: 87
|
||||
CONSTANT: HID_USAGE_GENERIC_SYSCTL_MENU_EXIT HEX: 88
|
||||
CONSTANT: HID_USAGE_GENERIC_SYSCTL_MENU_SELECT HEX: 89
|
||||
CONSTANT: HID_USAGE_GENERIC_SYSCTL_MENU_RIGHT HEX: 8A
|
||||
CONSTANT: HID_USAGE_GENERIC_SYSCTL_MENU_LEFT HEX: 8B
|
||||
CONSTANT: HID_USAGE_GENERIC_SYSCTL_MENU_UP HEX: 8C
|
||||
CONSTANT: HID_USAGE_GENERIC_SYSCTL_MENU_DOWN HEX: 8D
|
||||
|
||||
CONSTANT: HID_USAGE_SIMULATION_RUDDER HEX: BA
|
||||
CONSTANT: HID_USAGE_SIMULATION_THROTTLE HEX: BB
|
||||
|
||||
CONSTANT: HID_USAGE_KEYBOARD_NOEVENT HEX: 00
|
||||
CONSTANT: HID_USAGE_KEYBOARD_ROLLOVER HEX: 01
|
||||
CONSTANT: HID_USAGE_KEYBOARD_POSTFAIL HEX: 02
|
||||
CONSTANT: HID_USAGE_KEYBOARD_UNDEFINED HEX: 03
|
||||
|
||||
CONSTANT: HID_USAGE_KEYBOARD_aA HEX: 04
|
||||
CONSTANT: HID_USAGE_KEYBOARD_zZ HEX: 1D
|
||||
CONSTANT: HID_USAGE_KEYBOARD_ONE HEX: 1E
|
||||
CONSTANT: HID_USAGE_KEYBOARD_ZERO HEX: 27
|
||||
CONSTANT: HID_USAGE_KEYBOARD_LCTRL HEX: E0
|
||||
CONSTANT: HID_USAGE_KEYBOARD_LSHFT HEX: E1
|
||||
CONSTANT: HID_USAGE_KEYBOARD_LALT HEX: E2
|
||||
CONSTANT: HID_USAGE_KEYBOARD_LGUI HEX: E3
|
||||
CONSTANT: HID_USAGE_KEYBOARD_RCTRL HEX: E4
|
||||
CONSTANT: HID_USAGE_KEYBOARD_RSHFT HEX: E5
|
||||
CONSTANT: HID_USAGE_KEYBOARD_RALT HEX: E6
|
||||
CONSTANT: HID_USAGE_KEYBOARD_RGUI HEX: E7
|
||||
CONSTANT: HID_USAGE_KEYBOARD_SCROLL_LOCK HEX: 47
|
||||
CONSTANT: HID_USAGE_KEYBOARD_NUM_LOCK HEX: 53
|
||||
CONSTANT: HID_USAGE_KEYBOARD_CAPS_LOCK HEX: 39
|
||||
CONSTANT: HID_USAGE_KEYBOARD_F1 HEX: 3A
|
||||
CONSTANT: HID_USAGE_KEYBOARD_F12 HEX: 45
|
||||
CONSTANT: HID_USAGE_KEYBOARD_RETURN HEX: 28
|
||||
CONSTANT: HID_USAGE_KEYBOARD_ESCAPE HEX: 29
|
||||
CONSTANT: HID_USAGE_KEYBOARD_DELETE HEX: 2A
|
||||
CONSTANT: HID_USAGE_KEYBOARD_PRINT_SCREEN HEX: 46
|
||||
|
||||
CONSTANT: HID_USAGE_LED_NUM_LOCK HEX: 01
|
||||
CONSTANT: HID_USAGE_LED_CAPS_LOCK HEX: 02
|
||||
CONSTANT: HID_USAGE_LED_SCROLL_LOCK HEX: 03
|
||||
CONSTANT: HID_USAGE_LED_COMPOSE HEX: 04
|
||||
CONSTANT: HID_USAGE_LED_KANA HEX: 05
|
||||
CONSTANT: HID_USAGE_LED_POWER HEX: 06
|
||||
CONSTANT: HID_USAGE_LED_SHIFT HEX: 07
|
||||
CONSTANT: HID_USAGE_LED_DO_NOT_DISTURB HEX: 08
|
||||
CONSTANT: HID_USAGE_LED_MUTE HEX: 09
|
||||
CONSTANT: HID_USAGE_LED_TONE_ENABLE HEX: 0A
|
||||
CONSTANT: HID_USAGE_LED_HIGH_CUT_FILTER HEX: 0B
|
||||
CONSTANT: HID_USAGE_LED_LOW_CUT_FILTER HEX: 0C
|
||||
CONSTANT: HID_USAGE_LED_EQUALIZER_ENABLE HEX: 0D
|
||||
CONSTANT: HID_USAGE_LED_SOUND_FIELD_ON HEX: 0E
|
||||
CONSTANT: HID_USAGE_LED_SURROUND_FIELD_ON HEX: 0F
|
||||
CONSTANT: HID_USAGE_LED_REPEAT HEX: 10
|
||||
CONSTANT: HID_USAGE_LED_STEREO HEX: 11
|
||||
CONSTANT: HID_USAGE_LED_SAMPLING_RATE_DETECT HEX: 12
|
||||
CONSTANT: HID_USAGE_LED_SPINNING HEX: 13
|
||||
CONSTANT: HID_USAGE_LED_CAV HEX: 14
|
||||
CONSTANT: HID_USAGE_LED_CLV HEX: 15
|
||||
CONSTANT: HID_USAGE_LED_RECORDING_FORMAT_DET HEX: 16
|
||||
CONSTANT: HID_USAGE_LED_OFF_HOOK HEX: 17
|
||||
CONSTANT: HID_USAGE_LED_RING HEX: 18
|
||||
CONSTANT: HID_USAGE_LED_MESSAGE_WAITING HEX: 19
|
||||
CONSTANT: HID_USAGE_LED_DATA_MODE HEX: 1A
|
||||
CONSTANT: HID_USAGE_LED_BATTERY_OPERATION HEX: 1B
|
||||
CONSTANT: HID_USAGE_LED_BATTERY_OK HEX: 1C
|
||||
CONSTANT: HID_USAGE_LED_BATTERY_LOW HEX: 1D
|
||||
CONSTANT: HID_USAGE_LED_SPEAKER HEX: 1E
|
||||
CONSTANT: HID_USAGE_LED_HEAD_SET HEX: 1F
|
||||
CONSTANT: HID_USAGE_LED_HOLD HEX: 20
|
||||
CONSTANT: HID_USAGE_LED_MICROPHONE HEX: 21
|
||||
CONSTANT: HID_USAGE_LED_COVERAGE HEX: 22
|
||||
CONSTANT: HID_USAGE_LED_NIGHT_MODE HEX: 23
|
||||
CONSTANT: HID_USAGE_LED_SEND_CALLS HEX: 24
|
||||
CONSTANT: HID_USAGE_LED_CALL_PICKUP HEX: 25
|
||||
CONSTANT: HID_USAGE_LED_CONFERENCE HEX: 26
|
||||
CONSTANT: HID_USAGE_LED_STAND_BY HEX: 27
|
||||
CONSTANT: HID_USAGE_LED_CAMERA_ON HEX: 28
|
||||
CONSTANT: HID_USAGE_LED_CAMERA_OFF HEX: 29
|
||||
CONSTANT: HID_USAGE_LED_ON_LINE HEX: 2A
|
||||
CONSTANT: HID_USAGE_LED_OFF_LINE HEX: 2B
|
||||
CONSTANT: HID_USAGE_LED_BUSY HEX: 2C
|
||||
CONSTANT: HID_USAGE_LED_READY HEX: 2D
|
||||
CONSTANT: HID_USAGE_LED_PAPER_OUT HEX: 2E
|
||||
CONSTANT: HID_USAGE_LED_PAPER_JAM HEX: 2F
|
||||
CONSTANT: HID_USAGE_LED_REMOTE HEX: 30
|
||||
CONSTANT: HID_USAGE_LED_FORWARD HEX: 31
|
||||
CONSTANT: HID_USAGE_LED_REVERSE HEX: 32
|
||||
CONSTANT: HID_USAGE_LED_STOP HEX: 33
|
||||
CONSTANT: HID_USAGE_LED_REWIND HEX: 34
|
||||
CONSTANT: HID_USAGE_LED_FAST_FORWARD HEX: 35
|
||||
CONSTANT: HID_USAGE_LED_PLAY HEX: 36
|
||||
CONSTANT: HID_USAGE_LED_PAUSE HEX: 37
|
||||
CONSTANT: HID_USAGE_LED_RECORD HEX: 38
|
||||
CONSTANT: HID_USAGE_LED_ERROR HEX: 39
|
||||
CONSTANT: HID_USAGE_LED_SELECTED_INDICATOR HEX: 3A
|
||||
CONSTANT: HID_USAGE_LED_IN_USE_INDICATOR HEX: 3B
|
||||
CONSTANT: HID_USAGE_LED_MULTI_MODE_INDICATOR HEX: 3C
|
||||
CONSTANT: HID_USAGE_LED_INDICATOR_ON HEX: 3D
|
||||
CONSTANT: HID_USAGE_LED_INDICATOR_FLASH HEX: 3E
|
||||
CONSTANT: HID_USAGE_LED_INDICATOR_SLOW_BLINK HEX: 3F
|
||||
CONSTANT: HID_USAGE_LED_INDICATOR_FAST_BLINK HEX: 40
|
||||
CONSTANT: HID_USAGE_LED_INDICATOR_OFF HEX: 41
|
||||
CONSTANT: HID_USAGE_LED_FLASH_ON_TIME HEX: 42
|
||||
CONSTANT: HID_USAGE_LED_SLOW_BLINK_ON_TIME HEX: 43
|
||||
CONSTANT: HID_USAGE_LED_SLOW_BLINK_OFF_TIME HEX: 44
|
||||
CONSTANT: HID_USAGE_LED_FAST_BLINK_ON_TIME HEX: 45
|
||||
CONSTANT: HID_USAGE_LED_FAST_BLINK_OFF_TIME HEX: 46
|
||||
CONSTANT: HID_USAGE_LED_INDICATOR_COLOR HEX: 47
|
||||
CONSTANT: HID_USAGE_LED_RED HEX: 48
|
||||
CONSTANT: HID_USAGE_LED_GREEN HEX: 49
|
||||
CONSTANT: HID_USAGE_LED_AMBER HEX: 4A
|
||||
CONSTANT: HID_USAGE_LED_GENERIC_INDICATOR HEX: 4B
|
||||
|
||||
CONSTANT: HID_USAGE_TELEPHONY_PHONE HEX: 01
|
||||
CONSTANT: HID_USAGE_TELEPHONY_ANSWERING_MACHINE HEX: 02
|
||||
CONSTANT: HID_USAGE_TELEPHONY_MESSAGE_CONTROLS HEX: 03
|
||||
CONSTANT: HID_USAGE_TELEPHONY_HANDSET HEX: 04
|
||||
CONSTANT: HID_USAGE_TELEPHONY_HEADSET HEX: 05
|
||||
CONSTANT: HID_USAGE_TELEPHONY_KEYPAD HEX: 06
|
||||
CONSTANT: HID_USAGE_TELEPHONY_PROGRAMMABLE_BUTTON HEX: 07
|
||||
CONSTANT: HID_USAGE_TELEPHONY_REDIAL HEX: 24
|
||||
CONSTANT: HID_USAGE_TELEPHONY_TRANSFER HEX: 25
|
||||
CONSTANT: HID_USAGE_TELEPHONY_DROP HEX: 26
|
||||
CONSTANT: HID_USAGE_TELEPHONY_LINE HEX: 2A
|
||||
CONSTANT: HID_USAGE_TELEPHONY_RING_ENABLE HEX: 2D
|
||||
CONSTANT: HID_USAGE_TELEPHONY_SEND HEX: 31
|
||||
CONSTANT: HID_USAGE_TELEPHONY_KEYPAD_0 HEX: B0
|
||||
CONSTANT: HID_USAGE_TELEPHONY_KEYPAD_D HEX: BF
|
||||
CONSTANT: HID_USAGE_TELEPHONY_HOST_AVAILABLE HEX: F1
|
||||
|
||||
CONSTANT: HID_USAGE_MS_BTH_HF_DIALNUMBER HEX: 21
|
||||
CONSTANT: HID_USAGE_MS_BTH_HF_DIALMEMORY HEX: 22
|
||||
|
||||
CONSTANT: HID_USAGE_CONSUMERCTRL HEX: 01
|
||||
CONSTANT: HID_USAGE_DIGITIZER_PEN HEX: 02
|
||||
CONSTANT: HID_USAGE_DIGITIZER_IN_RANGE HEX: 32
|
||||
CONSTANT: HID_USAGE_DIGITIZER_TIP_SWITCH HEX: 42
|
||||
CONSTANT: HID_USAGE_DIGITIZER_BARREL_SWITCH HEX: 44
|
||||
|
||||
CONSTANT: HIDP_LINK_COLLECTION_ROOT -1
|
||||
CONSTANT: HIDP_LINK_COLLECTION_UNSPECIFIED 0
|
||||
|
||||
C-ENUM:
|
||||
HidP_Input
|
||||
HidP_Output
|
||||
HidP_Feature ;
|
||||
TYPEDEF: int HIDP_REPORT_TYPE
|
||||
|
||||
STRUCT: USAGE_AND_PAGE
|
||||
{ Usage USAGE }
|
||||
{ UsagePage USAGE } ;
|
||||
TYPEDEF: USAGE_AND_PAGE* PUSAGE_AND_PAGE
|
||||
|
||||
: HidP_IsSameUsageAndPage ( u1 u2 -- ? ) = ; inline
|
||||
|
||||
STRUCT: HIDP_BUTTONS_CAPS_range
|
||||
{ UsageMin USAGE }
|
||||
{ UsageMax USAGE }
|
||||
{ StringMin USHORT }
|
||||
{ StringMax USHORT }
|
||||
{ DesignatorMin USHORT }
|
||||
{ DesignatorMax USHORT }
|
||||
{ DataIndexMin USHORT }
|
||||
{ DataIndexMax USHORT } ;
|
||||
|
||||
STRUCT: HIDP_BUTTONS_CAPS_not_range
|
||||
{ Usage USAGE }
|
||||
{ Reserved1 USAGE }
|
||||
{ StringIndex USHORT }
|
||||
{ Reserved2 USHORT }
|
||||
{ DesignatorIndex USHORT }
|
||||
{ Reserved3 USHORT }
|
||||
{ DataIndex USHORT }
|
||||
{ Reserved4 USHORT } ;
|
||||
|
||||
UNION-STRUCT: HIDP_BUTTONS_CAPS_union
|
||||
{ Range HIDP_BUTTONS_CAPS_range }
|
||||
{ NotRange HIDP_BUTTONS_CAPS_not_range } ;
|
||||
|
||||
STRUCT: HIDP_BUTTON_CAPS
|
||||
{ UsagePage USAGE }
|
||||
{ ReportID UCHAR }
|
||||
{ IsAlias BOOLEAN }
|
||||
{ BitField USHORT }
|
||||
{ LinkCollection USHORT }
|
||||
{ LinkUsage USAGE }
|
||||
{ LinkUsagePage USAGE }
|
||||
{ IsRange BOOLEAN }
|
||||
{ IsStringRange BOOLEAN }
|
||||
{ IsDesignatorRange BOOLEAN }
|
||||
{ IsAbsolute BOOLEAN }
|
||||
{ Reserved ULONG[10] }
|
||||
{ Union HIDP_BUTTONS_CAPS_union } ;
|
||||
TYPEDEF: HIDP_BUTTON_CAPS* PHIDP_BUTTON_CAPS
|
||||
|
||||
STRUCT: HIDP_VALUE_CAPS_range
|
||||
{ UsageMin USAGE }
|
||||
{ UsageMax USAGE }
|
||||
{ StringMin USHORT }
|
||||
{ StringMax USHORT }
|
||||
{ DesignatorMin USHORT }
|
||||
{ DesignatorMax USHORT }
|
||||
{ DataIndexMin USHORT }
|
||||
{ DataIndexMax USHORT } ;
|
||||
|
||||
STRUCT: HIDP_VALUE_CAPS_not_range
|
||||
{ Usage USAGE }
|
||||
{ Reserved1 USAGE }
|
||||
{ StringIndex USHORT }
|
||||
{ Reserved2 USHORT }
|
||||
{ DesignatorIndex USHORT }
|
||||
{ Reserved3 USHORT }
|
||||
{ DataIndex USHORT }
|
||||
{ Reserved4 USHORT } ;
|
||||
|
||||
UNION-STRUCT: HIDP_VALUE_CAPS_union
|
||||
{ Range HIDP_VALUE_CAPS_range }
|
||||
{ NotRange HIDP_VALUE_CAPS_not_range } ;
|
||||
|
||||
STRUCT: HIDP_VALUE_CAPS
|
||||
{ UsagePage USAGE }
|
||||
{ ReportID UCHAR }
|
||||
{ IsAlias BOOLEAN }
|
||||
{ BitField USHORT }
|
||||
{ LinkCollection USHORT }
|
||||
{ LinkUsage USAGE }
|
||||
{ LinkUsagePage USAGE }
|
||||
{ IsRange BOOLEAN }
|
||||
{ IsStringRange BOOLEAN }
|
||||
{ IsDesignatorRange BOOLEAN }
|
||||
{ IsAbsolute BOOLEAN }
|
||||
{ HasNull BOOLEAN }
|
||||
{ Reserved UCHAR }
|
||||
{ BitSize USHORT }
|
||||
{ ReportCount USHORT }
|
||||
{ Reserved2 USHORT[5] }
|
||||
{ UnitsExp ULONG }
|
||||
{ Units ULONG }
|
||||
{ LogicalMin LONG }
|
||||
{ LogicalMax LONG }
|
||||
{ PhysicalMin LONG }
|
||||
{ PhysicalMax LONG }
|
||||
{ Union HIDP_VALUE_CAPS_union } ;
|
||||
TYPEDEF: HIDP_VALUE_CAPS* PHIDP_VALUE_CAPS
|
||||
|
||||
STRUCT: HIDP_LINK_COLLECTION_NODE
|
||||
{ LinkUsage USAGE }
|
||||
{ LinkUsagePage USAGE }
|
||||
{ Parent USHORT }
|
||||
{ NumberOfChildren USHORT }
|
||||
{ NextSibling USHORT }
|
||||
{ FirstChild USHORT }
|
||||
{ CollectionTypeIsAliasBitfield ULONG }
|
||||
{ UserContext PVOID } ;
|
||||
TYPEDEF: HIDP_LINK_COLLECTION_NODE* PHIDP_LINK_COLLECTION_NODE
|
||||
|
||||
TYPEDEF: PUCHAR PHIDP_REPORT_DESCRIPTOR
|
||||
C-TYPE: HIDP_PREPARSED_DATA
|
||||
TYPEDEF: HIDP_PREPARSED_DATA* PHIDP_PREPARSED_DATA
|
||||
|
||||
STRUCT: HIDP_CAPS
|
||||
{ Usage USAGE }
|
||||
{ UsagePage USAGE }
|
||||
{ InputReportByteLength USHORT }
|
||||
{ OutputReportByteLength USHORT }
|
||||
{ FeatureReportByteLength USHORT }
|
||||
{ Reserved USHORT[17] }
|
||||
{ NumberLinkCollectionNodes USHORT }
|
||||
{ NumberInputButtonCaps USHORT }
|
||||
{ NumberInputValueCaps USHORT }
|
||||
{ NumberInputDataIndices USHORT }
|
||||
{ NumberOutputButtonCaps USHORT }
|
||||
{ NumberOutputValueCaps USHORT }
|
||||
{ NumberOutputDataIndices USHORT }
|
||||
{ NumberFeatureButtonCaps USHORT }
|
||||
{ NumberFeatureValueCaps USHORT }
|
||||
{ NumberFeatureDataIndices USHORT } ;
|
||||
TYPEDEF: HIDP_CAPS* PHIDP_CAPS
|
||||
|
||||
STRUCT: HIDP_DATA
|
||||
{ DataIndex USHORT }
|
||||
{ Reserved USHORT }
|
||||
{ RawValue ULONG } ;
|
||||
TYPEDEF: HIDP_DATA* PHIDP_DATA
|
||||
|
||||
STRUCT: HIDP_UNKNOWN_TOKEN
|
||||
{ Token UCHAR }
|
||||
{ Reserved UCHAR[3] }
|
||||
{ BitField ULONG } ;
|
||||
TYPEDEF: HIDP_UNKNOWN_TOKEN* PHIDP_UNKNOWN_TOKEN
|
||||
|
||||
STRUCT: HIDP_EXTENDED_ATTRIBUTES
|
||||
{ NumGlobalUnknowns UCHAR }
|
||||
{ Reserved UCHAR[3] }
|
||||
{ GlobalUnknowns PHIDP_UNKNOWN_TOKEN }
|
||||
{ Data ULONG[1] } ;
|
||||
TYPEDEF: HIDP_EXTENDED_ATTRIBUTES* PHIDP_EXTENDED_ATTRIBUTES
|
||||
|
||||
FUNCTION: NTSTATUS
|
||||
HidP_GetCaps (
|
||||
PHIDP_PREPARSED_DATA PreparsedData,
|
||||
PHIDP_CAPS Capabilities
|
||||
) ;
|
||||
|
||||
FUNCTION: NTSTATUS
|
||||
HidP_GetLinkCollectionNodes (
|
||||
PHIDP_LINK_COLLECTION_NODE LinkCollectionNodes,
|
||||
PULONG LinkCollectionNodesLength,
|
||||
PHIDP_PREPARSED_DATA PreparsedData
|
||||
) ;
|
||||
|
||||
FUNCTION: NTSTATUS
|
||||
HidP_GetSpecificButtonCaps (
|
||||
HIDP_REPORT_TYPE ReportType,
|
||||
USAGE UsagePage,
|
||||
USHORT LinkCollection,
|
||||
USAGE Usage,
|
||||
PHIDP_BUTTON_CAPS ButtonCaps,
|
||||
PUSHORT ButtonCapsLength,
|
||||
PHIDP_PREPARSED_DATA PreparsedData
|
||||
) ;
|
||||
|
||||
FUNCTION: NTSTATUS
|
||||
HidP_GetButtonCaps (
|
||||
HIDP_REPORT_TYPE ReportType,
|
||||
PHIDP_BUTTON_CAPS ButtonCaps,
|
||||
PUSHORT ButtonCapsLength,
|
||||
PHIDP_PREPARSED_DATA PreparsedData
|
||||
) ;
|
||||
|
||||
FUNCTION: NTSTATUS
|
||||
HidP_GetSpecificValueCaps (
|
||||
HIDP_REPORT_TYPE ReportType,
|
||||
USAGE UsagePage,
|
||||
USHORT LinkCollection,
|
||||
USAGE Usage,
|
||||
PHIDP_VALUE_CAPS ValueCaps,
|
||||
PUSHORT ValueCapsLength,
|
||||
PHIDP_PREPARSED_DATA PreparsedData
|
||||
) ;
|
||||
|
||||
FUNCTION: NTSTATUS
|
||||
HidP_GetValueCaps (
|
||||
HIDP_REPORT_TYPE ReportType,
|
||||
PHIDP_VALUE_CAPS ValueCaps,
|
||||
PUSHORT ValueCapsLength,
|
||||
PHIDP_PREPARSED_DATA PreparsedData
|
||||
) ;
|
||||
|
||||
FUNCTION: NTSTATUS
|
||||
HidP_GetExtendedAttributes (
|
||||
HIDP_REPORT_TYPE ReportType,
|
||||
USHORT DataIndex,
|
||||
PHIDP_PREPARSED_DATA PreparsedData,
|
||||
PHIDP_EXTENDED_ATTRIBUTES Attributes,
|
||||
PULONG LengthAttributes
|
||||
) ;
|
||||
|
||||
FUNCTION: NTSTATUS
|
||||
HidP_InitializeReportForID (
|
||||
HIDP_REPORT_TYPE ReportType,
|
||||
UCHAR ReportID,
|
||||
PHIDP_PREPARSED_DATA PreparsedData,
|
||||
PCHAR Report,
|
||||
ULONG ReportLength
|
||||
) ;
|
||||
|
||||
FUNCTION: NTSTATUS
|
||||
HidP_SetData (
|
||||
HIDP_REPORT_TYPE ReportType,
|
||||
PHIDP_DATA DataList,
|
||||
PULONG DataLength,
|
||||
PHIDP_PREPARSED_DATA PreparsedData,
|
||||
PCHAR Report,
|
||||
ULONG ReportLength
|
||||
) ;
|
||||
|
||||
FUNCTION: NTSTATUS
|
||||
HidP_GetData (
|
||||
HIDP_REPORT_TYPE ReportType,
|
||||
PHIDP_DATA DataList,
|
||||
PULONG DataLength,
|
||||
PHIDP_PREPARSED_DATA PreparsedData,
|
||||
PCHAR Report,
|
||||
ULONG ReportLength
|
||||
) ;
|
||||
|
||||
FUNCTION: ULONG
|
||||
HidP_MaxDataListLength (
|
||||
HIDP_REPORT_TYPE ReportType,
|
||||
PHIDP_PREPARSED_DATA PreparsedData
|
||||
) ;
|
||||
|
||||
FUNCTION: NTSTATUS
|
||||
HidP_SetUsages (
|
||||
HIDP_REPORT_TYPE ReportType,
|
||||
USAGE UsagePage,
|
||||
USHORT LinkCollection,
|
||||
PUSAGE UsageList,
|
||||
PULONG UsageLength,
|
||||
PHIDP_PREPARSED_DATA PreparsedData,
|
||||
PCHAR Report,
|
||||
ULONG ReportLength
|
||||
) ;
|
||||
ALIAS: HidP_SetButtons HidP_SetUsages
|
||||
|
||||
FUNCTION: NTSTATUS
|
||||
HidP_UnsetUsages (
|
||||
HIDP_REPORT_TYPE ReportType,
|
||||
USAGE UsagePage,
|
||||
USHORT LinkCollection,
|
||||
PUSAGE UsageList,
|
||||
PULONG UsageLength,
|
||||
PHIDP_PREPARSED_DATA PreparsedData,
|
||||
PCHAR Report,
|
||||
ULONG ReportLength
|
||||
) ;
|
||||
ALIAS: HidP_UnsetButtons HidP_UnsetUsages
|
||||
|
||||
FUNCTION: NTSTATUS
|
||||
HidP_GetUsages (
|
||||
HIDP_REPORT_TYPE ReportType,
|
||||
USAGE UsagePage,
|
||||
USHORT LinkCollection,
|
||||
PUSAGE UsageList,
|
||||
PULONG UsageLength,
|
||||
PHIDP_PREPARSED_DATA PreparsedData,
|
||||
PCHAR Report,
|
||||
ULONG ReportLength
|
||||
) ;
|
||||
ALIAS: HidP_GetButtons HidP_GetUsages
|
||||
|
||||
FUNCTION: NTSTATUS
|
||||
HidP_GetUsagesEx (
|
||||
HIDP_REPORT_TYPE ReportType,
|
||||
USHORT LinkCollection,
|
||||
PUSAGE_AND_PAGE ButtonList,
|
||||
ULONG* UsageLength,
|
||||
PHIDP_PREPARSED_DATA PreparsedData,
|
||||
PCHAR Report,
|
||||
ULONG ReportLength
|
||||
) ;
|
||||
ALIAS: HidP_GetButtonsEx HidP_GetUsagesEx
|
||||
|
||||
FUNCTION: ULONG
|
||||
HidP_MaxUsageListLength (
|
||||
HIDP_REPORT_TYPE ReportType,
|
||||
USAGE UsagePage,
|
||||
PHIDP_PREPARSED_DATA PreparsedData
|
||||
) ;
|
||||
|
||||
FUNCTION: NTSTATUS
|
||||
HidP_SetUsageValue (
|
||||
HIDP_REPORT_TYPE ReportType,
|
||||
USAGE UsagePage,
|
||||
USHORT LinkCollection,
|
||||
USAGE Usage,
|
||||
ULONG UsageValue,
|
||||
PHIDP_PREPARSED_DATA PreparsedData,
|
||||
PCHAR Report,
|
||||
ULONG ReportLength
|
||||
) ;
|
||||
|
||||
FUNCTION: NTSTATUS
|
||||
HidP_SetScaledUsageValue (
|
||||
HIDP_REPORT_TYPE ReportType,
|
||||
USAGE UsagePage,
|
||||
USHORT LinkCollection,
|
||||
USAGE Usage,
|
||||
LONG UsageValue,
|
||||
PHIDP_PREPARSED_DATA PreparsedData,
|
||||
PCHAR Report,
|
||||
ULONG ReportLength
|
||||
) ;
|
||||
|
||||
FUNCTION: NTSTATUS
|
||||
HidP_SetUsageValueArray (
|
||||
HIDP_REPORT_TYPE ReportType,
|
||||
USAGE UsagePage,
|
||||
USHORT LinkCollection,
|
||||
USAGE Usage,
|
||||
PCHAR UsageValue,
|
||||
USHORT UsageValueByteLength,
|
||||
PHIDP_PREPARSED_DATA PreparsedData,
|
||||
PCHAR Report,
|
||||
ULONG ReportLength
|
||||
) ;
|
||||
|
||||
|
||||
FUNCTION: NTSTATUS
|
||||
HidP_GetUsageValue (
|
||||
HIDP_REPORT_TYPE ReportType,
|
||||
USAGE UsagePage,
|
||||
USHORT LinkCollection,
|
||||
USAGE Usage,
|
||||
PULONG UsageValue,
|
||||
PHIDP_PREPARSED_DATA PreparsedData,
|
||||
PCHAR Report,
|
||||
ULONG ReportLength
|
||||
) ;
|
||||
|
||||
FUNCTION: NTSTATUS
|
||||
HidP_GetScaledUsageValue (
|
||||
HIDP_REPORT_TYPE ReportType,
|
||||
USAGE UsagePage,
|
||||
USHORT LinkCollection,
|
||||
USAGE Usage,
|
||||
PLONG UsageValue,
|
||||
PHIDP_PREPARSED_DATA PreparsedData,
|
||||
PCHAR Report,
|
||||
ULONG ReportLength
|
||||
) ;
|
||||
|
||||
FUNCTION: NTSTATUS
|
||||
HidP_GetUsageValueArray (
|
||||
HIDP_REPORT_TYPE ReportType,
|
||||
USAGE UsagePage,
|
||||
USHORT LinkCollection,
|
||||
USAGE Usage,
|
||||
PCHAR UsageValue,
|
||||
USHORT UsageValueByteLength,
|
||||
PHIDP_PREPARSED_DATA PreparsedData,
|
||||
PCHAR Report,
|
||||
ULONG ReportLength
|
||||
) ;
|
||||
|
||||
FUNCTION: NTSTATUS
|
||||
HidP_UsageListDifference (
|
||||
PUSAGE PreviousUsageList,
|
||||
PUSAGE CurrentUsageList,
|
||||
PUSAGE BreakUsageList,
|
||||
PUSAGE MakeUsageList,
|
||||
ULONG UsageListLength
|
||||
) ;
|
||||
|
||||
FUNCTION: NTSTATUS
|
||||
HidP_UsageAndPageListDifference (
|
||||
PUSAGE_AND_PAGE PreviousUsageList,
|
||||
PUSAGE_AND_PAGE CurrentUsageList,
|
||||
PUSAGE_AND_PAGE BreakUsageList,
|
||||
PUSAGE_AND_PAGE MakeUsageList,
|
||||
ULONG UsageListLength
|
||||
) ;
|
||||
|
||||
C-ENUM:
|
||||
HidP_Keyboard_Break
|
||||
HidP_Keyboard_Make ;
|
||||
TYPEDEF: int HIDP_KEYBOARD_DIRECTION
|
||||
|
||||
STRUCT: HIDP_KEYBOARD_MODIFIER_STATE
|
||||
{ ul ULONG } ;
|
||||
TYPEDEF: HIDP_KEYBOARD_MODIFIER_STATE* PHIDP_KEYBOARD_MODIFIER_STATE
|
||||
|
||||
CALLBACK: BOOLEAN PHIDP_INSERT_SCANCODES (
|
||||
PVOID Context,
|
||||
PCHAR NewScanCodes,
|
||||
ULONG Length ) ;
|
||||
|
||||
FUNCTION: NTSTATUS
|
||||
HidP_TranslateUsageAndPagesToI8042ScanCodes (
|
||||
PUSAGE_AND_PAGE ChangedUsageList,
|
||||
ULONG UsageListLength,
|
||||
HIDP_KEYBOARD_DIRECTION KeyAction,
|
||||
PHIDP_KEYBOARD_MODIFIER_STATE ModifierState,
|
||||
PHIDP_INSERT_SCANCODES InsertCodesProcedure,
|
||||
PVOID InsertCodesContext
|
||||
) ;
|
||||
|
||||
|
||||
FUNCTION: NTSTATUS
|
||||
HidP_TranslateUsagesToI8042ScanCodes (
|
||||
PUSAGE ChangedUsageList,
|
||||
ULONG UsageListLength,
|
||||
HIDP_KEYBOARD_DIRECTION KeyAction,
|
||||
PHIDP_KEYBOARD_MODIFIER_STATE ModifierState,
|
||||
PHIDP_INSERT_SCANCODES InsertCodesProcedure,
|
||||
PVOID InsertCodesContext
|
||||
) ;
|
||||
|
||||
CONSTANT: FACILITY_HID_ERROR_CODE HEX: 11
|
||||
: HIDP_ERROR_CODES ( SEV CODE -- HRESULT )
|
||||
[ 28 shift ] dip bitor FACILITY_HID_ERROR_CODE 16 shift bitor ; inline
|
||||
: HIDP_STATUS_SUCCESS ( -- HRESULT ) HEX: 0 HEX: 0 HIDP_ERROR_CODES ; inline
|
||||
: HIDP_STATUS_NULL ( -- HRESULT ) HEX: 8 HEX: 1 HIDP_ERROR_CODES ; inline
|
||||
: HIDP_STATUS_INVALID_PREPARSED_DATA ( -- HRESULT ) HEX: C HEX: 1 HIDP_ERROR_CODES ; inline
|
||||
: HIDP_STATUS_INVALID_REPORT_TYPE ( -- HRESULT ) HEX: C HEX: 2 HIDP_ERROR_CODES ; inline
|
||||
: HIDP_STATUS_INVALID_REPORT_LENGTH ( -- HRESULT ) HEX: C HEX: 3 HIDP_ERROR_CODES ; inline
|
||||
: HIDP_STATUS_USAGE_NOT_FOUND ( -- HRESULT ) HEX: C HEX: 4 HIDP_ERROR_CODES ; inline
|
||||
: HIDP_STATUS_VALUE_OUT_OF_RANGE ( -- HRESULT ) HEX: C HEX: 5 HIDP_ERROR_CODES ; inline
|
||||
: HIDP_STATUS_BAD_LOG_PHY_VALUES ( -- HRESULT ) HEX: C HEX: 6 HIDP_ERROR_CODES ; inline
|
||||
: HIDP_STATUS_BUFFER_TOO_SMALL ( -- HRESULT ) HEX: C HEX: 7 HIDP_ERROR_CODES ; inline
|
||||
: HIDP_STATUS_INTERNAL_ERROR ( -- HRESULT ) HEX: C HEX: 8 HIDP_ERROR_CODES ; inline
|
||||
: HIDP_STATUS_I8042_TRANS_UNKNOWN ( -- HRESULT ) HEX: C HEX: 9 HIDP_ERROR_CODES ; inline
|
||||
: HIDP_STATUS_INCOMPATIBLE_REPORT_ID ( -- HRESULT ) HEX: C HEX: A HIDP_ERROR_CODES ; inline
|
||||
: HIDP_STATUS_NOT_VALUE_ARRAY ( -- HRESULT ) HEX: C HEX: B HIDP_ERROR_CODES ; inline
|
||||
: HIDP_STATUS_IS_VALUE_ARRAY ( -- HRESULT ) HEX: C HEX: C HIDP_ERROR_CODES ; inline
|
||||
: HIDP_STATUS_DATA_INDEX_NOT_FOUND ( -- HRESULT ) HEX: C HEX: D HIDP_ERROR_CODES ; inline
|
||||
: HIDP_STATUS_DATA_INDEX_OUT_OF_RANGE ( -- HRESULT ) HEX: C HEX: E HIDP_ERROR_CODES ; inline
|
||||
: HIDP_STATUS_BUTTON_NOT_PRESSED ( -- HRESULT ) HEX: C HEX: F HIDP_ERROR_CODES ; inline
|
||||
: HIDP_STATUS_REPORT_DOES_NOT_EXIST ( -- HRESULT ) HEX: C HEX: 10 HIDP_ERROR_CODES ; inline
|
||||
: HIDP_STATUS_NOT_IMPLEMENTED ( -- HRESULT ) HEX: C HEX: 20 HIDP_ERROR_CODES ; inline
|
||||
: HIDP_STATUS_I8242_TRANS_UNKNOWN ( -- HRESULT ) HIDP_STATUS_I8042_TRANS_UNKNOWN ; inline
|
||||
|
||||
STRUCT: HIDD_CONFIGURATION
|
||||
{ cookie PVOID }
|
||||
{ size ULONG }
|
||||
{ RingBufferSize ULONG } ;
|
||||
TYPEDEF: HIDD_CONFIGURATION* PHIDD_CONFIGURATION
|
||||
|
||||
STRUCT: HIDD_ATTRIBUTES
|
||||
{ Size ULONG }
|
||||
{ VendorID USHORT }
|
||||
{ ProductID USHORT }
|
||||
{ VersionNumber USHORT } ;
|
||||
TYPEDEF: HIDD_ATTRIBUTES* PHIDD_ATTRIBUTES
|
||||
|
||||
FUNCTION: BOOLEAN
|
||||
HidD_GetAttributes (
|
||||
HANDLE HidDeviceObject,
|
||||
PHIDD_ATTRIBUTES Attributes
|
||||
) ;
|
||||
|
||||
FUNCTION: void
|
||||
HidD_GetHidGuid (
|
||||
LPGUID HidGuid
|
||||
) ;
|
||||
|
||||
FUNCTION: BOOLEAN
|
||||
HidD_GetPreparsedData (
|
||||
HANDLE HidDeviceObject,
|
||||
PHIDP_PREPARSED_DATA* PreparsedData
|
||||
) ;
|
||||
|
||||
FUNCTION: BOOLEAN
|
||||
HidD_FreePreparsedData (
|
||||
PHIDP_PREPARSED_DATA PreparsedData
|
||||
) ;
|
||||
|
||||
FUNCTION: BOOLEAN
|
||||
HidD_FlushQueue (
|
||||
HANDLE HidDeviceObject
|
||||
) ;
|
||||
|
||||
FUNCTION: BOOLEAN
|
||||
HidD_GetConfiguration (
|
||||
HANDLE HidDeviceObject,
|
||||
PHIDD_CONFIGURATION Configuration,
|
||||
ULONG ConfigurationLength
|
||||
) ;
|
||||
|
||||
FUNCTION: BOOLEAN
|
||||
HidD_SetConfiguration (
|
||||
HANDLE HidDeviceObject,
|
||||
PHIDD_CONFIGURATION Configuration,
|
||||
ULONG ConfigurationLength
|
||||
) ;
|
||||
|
||||
FUNCTION: BOOLEAN
|
||||
HidD_GetFeature (
|
||||
HANDLE HidDeviceObject,
|
||||
PVOID ReportBuffer,
|
||||
ULONG ReportBufferLength
|
||||
) ;
|
||||
|
||||
FUNCTION: BOOLEAN
|
||||
HidD_SetFeature (
|
||||
HANDLE HidDeviceObject,
|
||||
PVOID ReportBuffer,
|
||||
ULONG ReportBufferLength
|
||||
) ;
|
||||
|
||||
FUNCTION: BOOLEAN
|
||||
HidD_GetInputReport (
|
||||
HANDLE HidDeviceObject,
|
||||
PVOID ReportBuffer,
|
||||
ULONG ReportBufferLength
|
||||
) ;
|
||||
|
||||
FUNCTION: BOOLEAN
|
||||
HidD_SetOutputReport (
|
||||
HANDLE HidDeviceObject,
|
||||
PVOID ReportBuffer,
|
||||
ULONG ReportBufferLength
|
||||
) ;
|
||||
|
||||
FUNCTION: BOOLEAN
|
||||
HidD_GetNumInputBuffers (
|
||||
HANDLE HidDeviceObject,
|
||||
PULONG NumberBuffers
|
||||
) ;
|
||||
|
||||
FUNCTION: BOOLEAN
|
||||
HidD_SetNumInputBuffers (
|
||||
HANDLE HidDeviceObject,
|
||||
ULONG NumberBuffers
|
||||
) ;
|
||||
|
||||
FUNCTION: BOOLEAN
|
||||
HidD_GetPhysicalDescriptor (
|
||||
HANDLE HidDeviceObject,
|
||||
PVOID Buffer,
|
||||
ULONG BufferLength
|
||||
) ;
|
||||
|
||||
FUNCTION: BOOLEAN
|
||||
HidD_GetManufacturerString (
|
||||
HANDLE HidDeviceObject,
|
||||
PVOID Buffer,
|
||||
ULONG BufferLength
|
||||
) ;
|
||||
|
||||
FUNCTION: BOOLEAN
|
||||
HidD_GetProductString (
|
||||
HANDLE HidDeviceObject,
|
||||
PVOID Buffer,
|
||||
ULONG BufferLength
|
||||
) ;
|
||||
|
||||
FUNCTION: BOOLEAN
|
||||
HidD_GetIndexedString (
|
||||
HANDLE HidDeviceObject,
|
||||
ULONG StringIndex,
|
||||
PVOID Buffer,
|
||||
ULONG BufferLength
|
||||
) ;
|
||||
|
||||
FUNCTION: BOOLEAN
|
||||
HidD_GetSerialNumberString (
|
||||
HANDLE HidDeviceObject,
|
||||
PVOID Buffer,
|
||||
ULONG BufferLength
|
||||
) ;
|
||||
|
||||
FUNCTION: BOOLEAN
|
||||
HidD_GetMsGenreDescriptor (
|
||||
HANDLE HidDeviceObject,
|
||||
PVOID Buffer,
|
||||
ULONG BufferLength
|
||||
) ;
|
|
@ -3,7 +3,8 @@
|
|||
|
||||
USING: accessors assocs compiler.units continuations fuel.eval fuel.help
|
||||
fuel.remote fuel.xref help.topics io.pathnames kernel namespaces parser
|
||||
sequences tools.scaffold vocabs.loader vocabs.parser words ;
|
||||
sequences tools.scaffold vocabs.loader vocabs.parser words vocabs.files
|
||||
vocabs.metadata ;
|
||||
|
||||
IN: fuel
|
||||
|
||||
|
@ -145,6 +146,22 @@ PRIVATE>
|
|||
[ fuel-scaffold-name dup require dup scaffold-help ] with-scope
|
||||
vocab-docs-path absolute-path fuel-eval-set-result ;
|
||||
|
||||
: fuel-scaffold-tests ( name devname -- )
|
||||
[ fuel-scaffold-name dup require dup scaffold-tests ] with-scope
|
||||
vocab-tests-file absolute-path fuel-eval-set-result ;
|
||||
|
||||
: fuel-scaffold-authors ( name devname -- )
|
||||
[ fuel-scaffold-name dup require dup scaffold-authors ] with-scope
|
||||
[ vocab-authors-path ] keep swap vocab-append-path absolute-path fuel-eval-set-result ;
|
||||
|
||||
: fuel-scaffold-tags ( name tags -- )
|
||||
[ scaffold-tags ]
|
||||
[ drop [ vocab-tags-path ] keep swap vocab-append-path absolute-path fuel-eval-set-result ] 2bi ;
|
||||
|
||||
: fuel-scaffold-summary ( name summary -- )
|
||||
[ scaffold-summary ]
|
||||
[ drop [ vocab-summary-path ] keep swap vocab-append-path absolute-path fuel-eval-set-result ] 2bi ;
|
||||
|
||||
: fuel-scaffold-get-root ( name -- ) find-vocab-root fuel-eval-set-result ;
|
||||
|
||||
! Remote connection
|
||||
|
|
|
@ -245,11 +245,11 @@ code in the buffer."
|
|||
(defsubst factor-mode--in-tests (&optional file)
|
||||
(factor-mode--code-file "tests"))
|
||||
|
||||
(defun factor-mode-visit-other-file (&optional skip)
|
||||
(defun factor-mode-visit-other-file (&optional create)
|
||||
"Cycle between code, tests and docs factor files.
|
||||
With prefix, non-existing files will be skipped."
|
||||
With prefix, non-existing files will be created."
|
||||
(interactive "P")
|
||||
(let ((file (factor-mode--cycle-next (buffer-file-name) skip)))
|
||||
(let ((file (factor-mode--cycle-next (buffer-file-name) (not create))))
|
||||
(unless file (error "No other file found"))
|
||||
(find-file file)
|
||||
(unless (file-exists-p file)
|
||||
|
|
|
@ -192,12 +192,15 @@ With prefix, you're teletransported to the listener's buffer."
|
|||
(comint-send-string nil "\"Refreshing loaded vocabs...\" write nl flush")
|
||||
(comint-send-string nil " refresh-all \"Done!\" write nl flush\n")))
|
||||
|
||||
(defun fuel-test-vocab (vocab)
|
||||
"Run the unit tests for the specified vocabulary."
|
||||
(interactive (list (fuel-completion--read-vocab nil (fuel-syntax--current-vocab))))
|
||||
(comint-send-string (fuel-listener--process)
|
||||
(concat "\"" vocab "\" reload nl flush\n"
|
||||
"\"" vocab "\" test nl flush\n")))
|
||||
(defun fuel-test-vocab (&optional arg)
|
||||
"Run the unit tests for the current vocabulary. With prefix argument, ask for
|
||||
the vocabulary name."
|
||||
(interactive "P")
|
||||
(let* ((vocab (or (and (not arg) (fuel-syntax--current-vocab))
|
||||
(fuel-completion--read-vocab nil))))
|
||||
(comint-send-string (fuel-listener--process)
|
||||
(concat "\"" vocab "\" reload nl flush\n"
|
||||
"\"" vocab "\" test nl flush\n"))))
|
||||
|
||||
|
||||
;;; Completion support
|
||||
|
|
|
@ -79,6 +79,23 @@ IN: %s
|
|||
"fuel")))
|
||||
(fuel-eval--send/wait cmd)))
|
||||
|
||||
(defsubst fuel-scaffold--create-tests (vocab)
|
||||
(let ((cmd `(:fuel* (,vocab ,fuel-scaffold-developer-name fuel-scaffold-tests)
|
||||
"fuel")))
|
||||
(fuel-eval--send/wait cmd)))
|
||||
|
||||
(defsubst fuel-scaffold--create-authors (vocab)
|
||||
(let ((cmd `(:fuel* (,vocab ,fuel-scaffold-developer-name fuel-scaffold-authors) "fuel")))
|
||||
(fuel-eval--send/wait cmd)))
|
||||
|
||||
(defsubst fuel-scaffold--create-tags (vocab tags)
|
||||
(let ((cmd `(:fuel* (,vocab ,tags fuel-scaffold-tags) "fuel")))
|
||||
(fuel-eval--send/wait cmd)))
|
||||
|
||||
(defsubst fuel-scaffold--create-summary (vocab summary)
|
||||
(let ((cmd `(:fuel* (,vocab ,summary fuel-scaffold-summary) "fuel")))
|
||||
(fuel-eval--send/wait cmd)))
|
||||
|
||||
(defun fuel-scaffold--help (parent)
|
||||
(when (and parent (fuel-scaffold--check-auto fuel-scaffold-help-autoinsert-p))
|
||||
(let* ((ret (fuel-scaffold--create-docs (fuel-scaffold--vocab parent)))
|
||||
|
@ -102,7 +119,8 @@ IN: %s
|
|||
|
||||
(defun fuel-scaffold-vocab (&optional other-window name-hint root-hint)
|
||||
"Creates a directory in the given root for a new vocabulary and
|
||||
adds source, tests and authors.txt files.
|
||||
adds source and authors.txt files. Prompts the user for optional summary,
|
||||
tags, help, and test file creation.
|
||||
|
||||
You can configure `fuel-scaffold-developer-name' (set by default to
|
||||
`user-full-name') for the name to be inserted in the generated files."
|
||||
|
@ -111,12 +129,24 @@ You can configure `fuel-scaffold-developer-name' (set by default to
|
|||
(root (completing-read "Vocab root: "
|
||||
(fuel-scaffold--vocab-roots)
|
||||
nil t (or root-hint "resource:")))
|
||||
(summary (read-string "Vocab summary (empty for none): "))
|
||||
(tags (read-string "Vocab tags (empty for none): "))
|
||||
(help (y-or-n-p "Scaffold help? "))
|
||||
(tests (y-or-n-p "Scaffold tests? "))
|
||||
(cmd `(:fuel* ((,root ,name ,fuel-scaffold-developer-name)
|
||||
(fuel-scaffold-vocab)) "fuel"))
|
||||
(ret (fuel-eval--send/wait cmd))
|
||||
(file (fuel-eval--retort-result ret)))
|
||||
(unless file
|
||||
(error "Error creating vocab (%s)" (car (fuel-eval--retort-error ret))))
|
||||
(when (not (equal "" summary))
|
||||
(fuel-scaffold--create-summary name summary))
|
||||
(when (not (equal "" tags))
|
||||
(fuel-scaffold--create-tags name tags))
|
||||
(when help
|
||||
(fuel-scaffold--create-docs name))
|
||||
(when tests
|
||||
(fuel-scaffold--create-tests name))
|
||||
(if other-window (find-file-other-window file) (find-file file))
|
||||
(goto-char (point-max))
|
||||
name))
|
||||
|
@ -137,6 +167,60 @@ You can configure `fuel-scaffold-developer-name' (set by default to
|
|||
(error "Error creating help file" (car (fuel-eval--retort-error ret))))
|
||||
(find-file file)))
|
||||
|
||||
(defun fuel-scaffold-tests (&optional arg)
|
||||
"Creates, if it does not already exist, a tests file for the current vocabulary.
|
||||
|
||||
With prefix argument, ask for the vocabulary name.
|
||||
You can configure `fuel-scaffold-developer-name' (set by default to
|
||||
`user-full-name') for the name to be inserted in the generated file."
|
||||
(interactive "P")
|
||||
(let* ((vocab (or (and (not arg) (fuel-syntax--current-vocab))
|
||||
(fuel-completion--read-vocab nil)))
|
||||
(ret (fuel-scaffold--create-tests vocab))
|
||||
(file (fuel-eval--retort-result ret)))
|
||||
(unless file
|
||||
(error "Error creating tests file" (car (fuel-eval--retort-error ret))))
|
||||
(find-file file)))
|
||||
|
||||
(defun fuel-scaffold-authors (&optional arg)
|
||||
"Creates, if it does not already exist, an authors file for the current vocabulary.
|
||||
|
||||
With prefix argument, ask for the vocabulary name.
|
||||
You can configure `fuel-scaffold-developer-name' (set by default to
|
||||
`user-full-name') for the name to be inserted in the generated file."
|
||||
(interactive "P")
|
||||
(let* ((vocab (or (and (not arg) (fuel-syntax--current-vocab))
|
||||
(fuel-completion--read-vocab nil)))
|
||||
(ret (fuel-scaffold--create-authors vocab))
|
||||
(file (fuel-eval--retort-result ret)))
|
||||
(unless file
|
||||
(error "Error creating authors file" (car (fuel-eval--retort-error ret))))
|
||||
(find-file file)))
|
||||
|
||||
(defun fuel-scaffold-tags (&optional arg)
|
||||
"Creates, if it does not already exist, a tags file for the current vocabulary."
|
||||
(interactive "P")
|
||||
(let* ((vocab (or (and (not arg) (fuel-syntax--current-vocab))
|
||||
(fuel-completion--read-vocab nil)))
|
||||
(tags (read-string "Tags: "))
|
||||
(ret (fuel-scaffold--create-tags vocab tags))
|
||||
(file (fuel-eval--retort-result ret)))
|
||||
(unless file
|
||||
(error "Error creating tags file" (car (fuel-eval--retort-error ret))))
|
||||
(find-file file)))
|
||||
|
||||
(defun fuel-scaffold-summary (&optional arg)
|
||||
"Creates, if it does not already exist, a summary file for the current vocabulary."
|
||||
(interactive "P")
|
||||
(let* ((vocab (or (and (not arg ) (fuel-syntax--current-vocab))
|
||||
(fuel-completion--read-vocab nil)))
|
||||
(summary (read-string "Summary: "))
|
||||
(ret (fuel-scaffold--create-summary vocab summary))
|
||||
(file (fuel-eval--retort-result ret)))
|
||||
(unless file
|
||||
(error "Error creating summary file" (car (fuel-eval--retort-error ret))))
|
||||
(find-file file)))
|
||||
|
||||
|
||||
(provide 'fuel-scaffold)
|
||||
;;; fuel-scaffold.el ends here
|
||||
|
|
|
@ -63,7 +63,7 @@
|
|||
"read-only" "RENAME:" "REQUIRE:" "REQUIRES:"
|
||||
"SINGLETON:" "SINGLETONS:" "SLOT:" "SPECIALIZED-ARRAY:" "SPECIALIZED-ARRAYS:" "STRING:" "STRUCT:" "SYMBOL:" "SYMBOLS:" "SYNTAX:"
|
||||
"TUPLE:" "t" "t?" "TYPEDEF:" "TYPED:" "TYPED::"
|
||||
"UNIFORM-TUPLE:" "UNION:" "USE:" "USING:"
|
||||
"UNIFORM-TUPLE:" "UNION:" "UNION-STRUCT:" "USE:" "USING:"
|
||||
"VARS:" "VERTEX-FORMAT:"))
|
||||
|
||||
(defconst fuel-syntax--parsing-words-regex
|
||||
|
@ -125,7 +125,7 @@
|
|||
|
||||
(defconst fuel-syntax--type-definition-regex
|
||||
(fuel-syntax--second-word-regex
|
||||
'("C-STRUCT:" "C-UNION:" "MIXIN:" "TUPLE:" "SINGLETON:" "SPECIALIZED-ARRAY:" "STRUCT:" "UNION:")))
|
||||
'("C-STRUCT:" "C-UNION:" "MIXIN:" "TUPLE:" "SINGLETON:" "SPECIALIZED-ARRAY:" "STRUCT:" "UNION:" "UNION-STRUCT:")))
|
||||
|
||||
(defconst fuel-syntax--tuple-decl-regex
|
||||
"^TUPLE: +\\([^ \n]+\\) +< +\\([^ \n]+\\)\\_>")
|
||||
|
|
Loading…
Reference in New Issue