Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 14 additions & 17 deletions drracket/browser/private/bullet.rkt
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@

(define bullet-size
(make-parameter
(let ([s (send (send (send (make-object text%) get-style-list) basic-style)
get-size)])
(let ([s (send+ (make-object text%) (get-style-list) (basic-style) (get-size))])
(max 7 (quotient s 2)))))

(define (get-bullet-width)
Expand Down Expand Up @@ -51,16 +50,15 @@
[(0) (values (lambda (x y w h) (send dc draw-ellipse x y w h)) #t)]
[(1) (values (lambda (x y w h) (send dc draw-ellipse x y w h)) #f)]
[else (values (lambda (x y w h) (send dc draw-rectangle x y w h)) #f)])])
(let ([b (send dc get-brush)])
(send dc set-brush
(if solid?
(send the-brush-list
find-or-create-brush
(send (send dc get-pen) get-color)
'solid)
transparent-brush))
(draw x y bsize bsize)
(send dc set-brush b)))))]
(define b (send dc get-brush))
(send
dc
set-brush
(if solid?
(send the-brush-list find-or-create-brush (send (send dc get-pen) get-color) 'solid)
transparent-brush))
(draw x y bsize bsize)
(send dc set-brush b))))]
[define/override copy
(lambda ()
(make-object bullet-snip% depth))]
Expand All @@ -69,11 +67,10 @@
(send stream put depth))]
[define/override get-text
(lambda (offset num flattened?)
(if (< num 1)
""
(if flattened?
"* "
"*")))]
(cond
[(< num 1) ""]
[flattened? "* "]
[else "*"]))]
(super-new)
(set-snipclass bullet-snip-class)
(set-count 1)))
Expand Down
2 changes: 1 addition & 1 deletion drracket/browser/private/entity-names.rkt
Original file line number Diff line number Diff line change
Expand Up @@ -256,6 +256,6 @@
(euro . 8364)))

(define (entity-name->integer s)
(hash-ref table s (lambda () #f)))
(hash-ref table s #f))


44 changes: 22 additions & 22 deletions drracket/browser/private/option-snip.rkt
Original file line number Diff line number Diff line change
Expand Up @@ -31,40 +31,40 @@
(set! current-option (cons o v)))
(set! w #f)
(set! h #f)
(let ([a (get-admin)])
(when a
(send a resized this #t))))
(define a (get-admin))
(when a
(send a resized this #t)))

(define/public (get-value)
(with-handlers ([exn:fail? (lambda (x) #f)])
(cdr (or current-option
(car options)))))

(define/public (set-value v)
(let ([o (ormap (lambda (o) (and (equal? v (cdr o)) o)) options)])
(if o
(set! current-option o)
(set! look-for-option (box v)))))
(define o (ormap (lambda (o) (and (equal? v (cdr o)) o)) options))
(if o
(set! current-option o)
(set! look-for-option (box v))))

(override*
[get-extent ; called by an editor to get the snip's size
(lambda (dc x y wbox hbox descentbox spacebox lspacebox rspacebox)
(unless w
(let ([font (send (get-style) get-font)])
(let ([w+h+ds
(map (lambda (o)
(let-values ([(tw th td ta) (send dc get-text-extent (car o) font)])
(list tw th td)))
options)])
(if (null? w+h+ds)
(begin
(set! w 10)
(set! h 10)
(set! d 2))
(begin
(set! w (+ (* 2 inset) arrow-sep 2 (* 2 arrow-height) (apply max (map car w+h+ds))))
(set! h (+ (* 2 inset) 1 (apply max arrow-height (map cadr w+h+ds))))
(set! d (+ inset 1 (apply max (map caddr w+h+ds)))))))))
(define font (send (get-style) get-font))
(define w+h+ds
(map (lambda (o)
(let-values ([(tw th td ta) (send dc get-text-extent (car o) font)])
(list tw th td)))
options))
(if (null? w+h+ds)
(begin
(set! w 10)
(set! h 10)
(set! d 2))
(begin
(set! w (+ (* 2 inset) arrow-sep 2 (* 2 arrow-height) (apply max (map car w+h+ds))))
(set! h (+ (* 2 inset) 1 (apply max arrow-height (map cadr w+h+ds))))
(set! d (+ inset 1 (apply max (map caddr w+h+ds)))))))
(when hbox
(set-box! hbox h))
(when wbox
Expand Down
70 changes: 33 additions & 37 deletions drracket/drracket/drracket.rkt
Original file line number Diff line number Diff line change
Expand Up @@ -24,17 +24,15 @@
(flush-output))

(define (run-trace-thread)
(let ([evt (make-log-receiver (current-logger) 'info)])
(void
(thread
(λ ()
(let loop ()
(define vec (sync evt))
(define str (vector-ref vec 1))
(when (regexp-match #rx"^cm: *compil(ing|ed)" str)
(display str)
(newline))
(loop)))))))
(define evt (make-log-receiver (current-logger) 'info))
(void (thread (λ ()
(let loop ()
(define vec (sync evt))
(define str (vector-ref vec 1))
(when (regexp-match #rx"^cm: *compil(ing|ed)" str)
(display str)
(newline))
(loop))))))

(cond
[debugging?
Expand All @@ -57,14 +55,14 @@
(run-trace-thread)))]
[install-cm?
(flprintf "PLTDRCM: loading compilation manager\n")
(let ([make-compilation-manager-load/use-compiled-handler
(parameterize ([current-namespace (make-base-empty-namespace)])
(dynamic-require 'compiler/cm 'make-compilation-manager-load/use-compiled-handler))])
(flprintf "PLTDRCM: installing compilation manager\n")
(current-load/use-compiled (make-compilation-manager-load/use-compiled-handler))
(when cm-trace?
(flprintf "PLTDRCM: enabling CM tracing\n")
(run-trace-thread)))]
(define make-compilation-manager-load/use-compiled-handler
(parameterize ([current-namespace (make-base-empty-namespace)])
(dynamic-require 'compiler/cm 'make-compilation-manager-load/use-compiled-handler)))
(flprintf "PLTDRCM: installing compilation manager\n")
(current-load/use-compiled (make-compilation-manager-load/use-compiled-handler))
(when cm-trace?
(flprintf "PLTDRCM: enabling CM tracing\n")
(run-trace-thread))]
[first-parallel?
(flprintf "PLTDRPAR: loading compilation manager\n")
(define tools? (not (getenv "PLTNOTOOLS")))
Expand All @@ -90,19 +88,17 @@
(define (tool-files id)
(apply
append
(map
(λ (x)
(define proc (get-info/full x))
(if proc
(map (λ (dirs)
(apply build-path
x
(if (list? dirs)
dirs
(list dirs))))
(proc id (λ () '())))
'()))
(find-relevant-directories (list id)))))
(for/list ([x (in-list (find-relevant-directories (list id)))])
(define proc (get-info/full x))
(if proc
(map (λ (dirs)
(apply build-path
x
(if (list? dirs)
dirs
(list dirs))))
(proc id (λ () '())))
'()))))

(define make-compilation-manager-load/use-compiled-handler
(parameterize ([current-namespace (make-base-empty-namespace)])
Expand Down Expand Up @@ -146,11 +142,11 @@
;; it creates a new custodian and installs it, but the
;; original eventspace was created on the original custodian
;; and this code does not create a new eventspace.
(let ([orig-cust (current-custodian)]
[orig-eventspace (current-eventspace)]
[new-cust (make-custodian)])
(current-custodian new-cust)
((dynamic-require 'drracket/private/profile-drs 'start-profile) orig-cust)))
(define orig-cust (current-custodian))
(current-eventspace)
(define new-cust (make-custodian))
(current-custodian new-cust)
((dynamic-require 'drracket/private/profile-drs 'start-profile) orig-cust))

(dynamic-require 'drracket/private/drracket-normal #f)

Expand Down
Loading