Add types for ps-setup%

Closes PR 14902
This commit is contained in:
Asumu Takikawa 2015-01-09 14:02:22 -05:00
parent 101333abb1
commit 96731d3dfd
2 changed files with 31 additions and 1 deletions

View File

@ -14,6 +14,7 @@
racket/draw/private/gl-context
racket/draw/private/gradient
racket/draw/private/pen
racket/draw/private/ps-setup
racket/draw/private/record-dc
racket/draw/private/region
(for-syntax (only-in (rep type-rep) make-Instance))
@ -53,6 +54,7 @@
Pen-Cap-Style
Pen-Join-Style
Point%
PS-Setup%
Radial-Gradient%
Region%))
@ -82,10 +84,11 @@
[gl-config% (parse-type #'GL-Config%)]
[linear-gradient% (parse-type #'Linear-Gradient%)]
[pen% (parse-type #'Pen%)]
[ps-setup% (parse-type #'PS-Setup%)]
[radial-gradient% (parse-type #'Radial-Gradient%)]
[region% (parse-type #'Region%)]
;; 26 Drawing Functions
; current-ps-setup
[current-ps-setup (-Param (-inst (parse-type #'PS-Setup%)))]
[get-face-list (->optkey [(one-of/c 'mono 'all)]
#:all-variants? Univ #f
(-lst -String))]

View File

@ -30,6 +30,7 @@
Pen-Cap-Style
Pen-Join-Style
Point%
PS-Setup%
Radial-Gradient%
Region%)
@ -424,6 +425,32 @@
[set-x (Real -> Void)]
[set-y (Real -> Void)]))
(define-type PS-Setup%
(Class (init)
[copy-from (-> (Instance PS-Setup%) Any Void)]
[get-command (-> String)]
[get-editor-margin (-> (Boxof Nonnegative-Real) (Boxof Nonnegative-Real) Void)]
[get-file (-> (U Path-String #f))]
[get-level-2 (-> Boolean)]
[get-margin (-> (Boxof Nonnegative-Real) (Boxof Nonnegative-Real) Void)]
[get-mode (-> (U 'preview 'file 'printer))]
[get-orientation (-> (U 'portrait 'landscape))]
[get-paper-name (-> String)]
[get-preview-command (-> String)]
[get-scaling (-> (Boxof Nonnegative-Real) (Boxof Nonnegative-Real) Void)]
[get-translation (-> (Boxof Nonnegative-Real) (Boxof Nonnegative-Real) Void)]
[set-command (-> String Void)]
[set-editor-margin (-> Natural Natural Void)]
[set-file (-> (U Path-String #f) Void)]
[set-level-2 (-> Any Void)]
[set-margin (-> Nonnegative-Real Nonnegative-Real Void)]
[set-mode (-> (U 'preview 'file 'printer) Void)]
[set-orientation (-> (U 'portrait 'landscape) Void)]
[set-paper-name (-> String Void)]
[set-preview-command (-> String Void)]
[set-scaling (-> Nonnegative-Real Nonnegative-Real Void)]
[set-translation (-> Real Real Void)]))
(define-type GL-Config%
(Class [get-accum-size (-> Natural)]
[get-depth-size (-> Natural)]