use main-collects-relative for paths
svn: r4854
This commit is contained in:
parent
d58bc352f1
commit
df0734f09e
|
@ -1,9 +1,11 @@
|
||||||
(module include-bitmap mzscheme
|
(module include-bitmap mzscheme
|
||||||
(require (lib "mred.ss" "mred")
|
(require (lib "mred.ss" "mred")
|
||||||
(lib "class.ss")
|
(lib "class.ss")
|
||||||
(lib "file.ss"))
|
(lib "file.ss")
|
||||||
|
(lib "main-collects.ss" "setup"))
|
||||||
(require-for-syntax (lib "path-spec.ss" "syntax")
|
(require-for-syntax (lib "path-spec.ss" "syntax")
|
||||||
(lib "cm-accomplice.ss"))
|
(lib "cm-accomplice.ss")
|
||||||
|
(lib "main-collects.ss" "setup"))
|
||||||
|
|
||||||
(provide include-bitmap
|
(provide include-bitmap
|
||||||
include-bitmap/relative-to)
|
include-bitmap/relative-to)
|
||||||
|
@ -26,9 +28,9 @@
|
||||||
(read-bytes (file-size c-file)))))])
|
(read-bytes (file-size c-file)))))])
|
||||||
(register-external-file c-file)
|
(register-external-file c-file)
|
||||||
(with-syntax ([content content]
|
(with-syntax ([content content]
|
||||||
[c-file (path->bytes c-file)])
|
[c-file (path->main-collects-relative c-file)])
|
||||||
(syntax/loc stx
|
(syntax/loc stx
|
||||||
(get-or-load-bitmap content c-file type))))]))
|
(get-or-load-bitmap content 'c-file type))))]))
|
||||||
|
|
||||||
(define-syntax (include-bitmap/relative-to stx)
|
(define-syntax (include-bitmap/relative-to stx)
|
||||||
(syntax-case stx ()
|
(syntax-case stx ()
|
||||||
|
@ -61,6 +63,6 @@
|
||||||
(unless (send bm ok?)
|
(unless (send bm ok?)
|
||||||
(error 'include-bitmap
|
(error 'include-bitmap
|
||||||
"unable to parse image, originated from: ~a"
|
"unable to parse image, originated from: ~a"
|
||||||
(path->string (bytes->path orig))))
|
(path->string (main-collects-relative->path orig))))
|
||||||
(hash-table-put! cached (cons content type) bm)
|
(hash-table-put! cached (cons content type) bm)
|
||||||
bm)))))
|
bm)))))
|
||||||
|
|
Loading…
Reference in New Issue
Block a user