/usr/share/racket/pkgs/mysterx/mysterx.rkt is in racket-common 6.1-4.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 | #lang racket/base
(require ffi/com
ffi/com-registry)
;; Methods and Properties:
(provide com-all-coclasses
com-all-controls
cocreate-instance-from-coclass
cci/coclass
cocreate-instance-from-progid
cci/progid
com-get-active-object-from-coclass
gao/coclass
coclass
progid
set-coclass!
set-coclass-from-progid!
com-methods
(rename-out [mx:com-method-type com-method-type])
com-invoke
com-get-properties
(rename-out [mx:com-get-property-type com-get-property-type])
com-get-property
com-set-properties
(rename-out [mx:com-set-property-type com-set-property-type])
com-set-property!
com-help
mx-version)
;; COM types:
(provide com-object?
com-object-type
com-is-a?
com-object-eq?
com-currency?
com-currency->number
number->com-currency
com-date?
com-date->date
date->com-date
com-scode?
com-scode->number
number->com-scode
com-iunknown?
com-omit)
;; Events:
(provide com-events
(rename-out [mx:com-event-type com-event-type])
com-register-event-handler
com-unregister-event-handler)
(define (coclass->clsid* who coclass)
(or (coclass->clsid coclass)
(error who "coclass not found: ~e" coclass)))
(define (cocreate-instance-from-coclass coclass [where 'local])
(com-create-instance (coclass->clsid* 'cocreate-instance-from-coclass coclass) where))
(define (cci/coclass coclass [where 'local])
(cocreate-instance-from-coclass coclass where))
(define (cocreate-instance-from-progid progid [where 'local])
(com-create-instance progid where))
(define (cci/progid progid [where 'local])
(cocreate-instance-from-progid progid where))
(define (com-get-active-object-from-coclass coclass)
(com-get-active-object (coclass->clsid* 'com-get-active-object-from-coclass coclass)))
(define (gao/coclass coclass)
(com-get-active-object-from-coclass coclass))
(define (coclass obj)
(clsid->coclass (com-object-clsid obj)))
(define (progid obj)
(clsid->progid (com-object-clsid obj)))
(define (set-coclass! obj coclass)
(com-object-set-clsid! obj (coclass->clsid* 'set-coclass! coclass)))
(define (set-coclass-from-progid! obj progid)
(com-object-set-clsid! obj (progid->clsid progid)))
(define (com-help obj [topic ""])
(void))
(define (com-is-a? obj type)
(com-type=? (com-object-type obj) type))
(define (com-currency? obj)
(and (number? obj)
(exact? obj)
(integer? (* 10000 obj))))
(define (com-currency->number c) c)
(define (number->com-currency n)
(define nn (if (real? n)
(* (round (* 10000 (inexact->exact n))) 1/10000)
n))
(if (com-currency? nn)
nn
(error 'number->com-currency "cannot convert: ~e" nn)))
(define (com-date? d) (date? d))
(define (com-date->date d) d)
(define (date->com-date d) d)
(define (com-scode? v) (exact-integer? v))
(define (com-scode->number sc) sc)
(define (number->com-scode n) n)
(define (com-register-event-handler obj ev f)
(define exec (com-make-event-executor))
(thread (lambda () ((sync exec))))
(com-register-event-callback obj
ev
f
exec))
(define (com-unregister-event-handler obj ev)
(com-unregister-event-callback obj ev))
(define (mx-version) (version))
(define (reorder t)
(if (and (pair? t)
(eq? (car t) '->))
(append (cadr t) (list '-> (caddr t)))
t))
(define (mx:com-method-type obj name)
(reorder (com-method-type obj name)))
(define (mx:com-get-property-type obj name)
(reorder (com-get-property-type obj name)))
(define (mx:com-set-property-type obj name)
(reorder (com-set-property-type obj name)))
(define (mx:com-event-type obj name)
(reorder (com-event-type obj name)))
|