Skip to content

Commit 75ca3ff

Browse files
committed
Specify root-path as constant, update to v2.2.2
1 parent 2c28d64 commit 75ca3ff

File tree

9 files changed

+36
-36
lines changed

9 files changed

+36
-36
lines changed

Makefile.posix

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
DESTDIR = /usr/local
2-
DOCDIR = "$(DESTDIR)/share/doc/ivy-2.2.1"
2+
DOCDIR = "$(DESTDIR)/share/doc/ivy-2.2.2"
33
MANDIR = "$(DESTDIR)/share/man/man1"
44

55
RACO = raco

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ tracked solely by the application.
1212
- [gif-image](https://github.com/lehitoskin/gif-image)
1313
- [png-image](https://github.com/lehitoskin/png-image)
1414
- [racquel](https://github.com/brown131/racquel)
15-
- [riff](https://github.com/lehitoskin/riff) (which uses FLIF, see below)
15+
- [riff](https://github.com/lehitoskin/riff) v0.2 (which uses FLIF v0.3, see below)
1616
- [rsvg](https://github.com/takikawa/rsvg) (which uses librsvg)
1717
- [sugar](https://github.com/mbutterick/sugar)
1818
- [txexpr](https://github.com/mbutterick/txexpr)

base.rkt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,12 +39,12 @@
3939
(define (macosx?)
4040
(eq? (system-type) 'macosx))
4141

42-
(define root-path
42+
(define +root-path+
4343
(if (eq? (system-type) 'windows)
4444
(build-path "C:\\")
4545
(build-path "/")))
4646
; path of the currently displayed image
47-
(define image-path (make-parameter root-path))
47+
(define image-path (make-parameter +root-path+))
4848
; master bitmap of loaded image-path
4949
(define image-bmp-master (make-bitmap 50 50))
5050
; pict of the currently displayed image
@@ -137,7 +137,7 @@
137137
; parameter listof path
138138
; if pfs is empty, attempting to append a single image would
139139
; make pfs just that image, rather than a list of length 1
140-
(define pfs (make-parameter (list root-path)))
140+
(define pfs (make-parameter (list +root-path+)))
141141

142142
(define (string->taglist str)
143143
(cond [(string-null? str) empty]
@@ -938,7 +938,7 @@
938938
; curried procedure to abstract loading an image in a collection
939939
; mmm... curry
940940
(define ((load-image-in-collection direction))
941-
(unless (equal? (image-path) root-path)
941+
(unless (equal? (image-path) +root-path+)
942942
; kill the animation thread, if applicable
943943
(unless (or (false? (animation-thread)) (thread-dead? (animation-thread)))
944944
(kill-thread (animation-thread)))

doc/ivy.1.bz2

39 Bytes
Binary file not shown.

doc/ivy.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
% IVY(1) Ivy Image Viewer | Version 2.2.1
1+
% IVY(1) Ivy Image Viewer | Version 2.2.2
22

33
# NAME
44
Ivy Image Viewer

files.rkt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
racket/file)
77
(provide (all-defined-out))
88

9-
(define ivy-version "2.2.1")
9+
(define ivy-version "2.2.2")
1010

1111
; base directory where ivy will put all of its files
1212
(define ivy-path

frame.rkt

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@
201201
(when paths
202202
(cond
203203
; empty collection, adding images and load the first in the list
204-
[(equal? (first (pfs)) root-path)
204+
[(equal? (first (pfs)) +root-path+)
205205
(define img-path (first paths))
206206
(define-values (base name dir?) (split-path img-path))
207207
(image-dir base)
@@ -267,7 +267,7 @@
267267
(unless (empty? paths)
268268
(cond
269269
; empty collection, adding images and load the first in the list
270-
[(equal? (first (pfs)) root-path)
270+
[(equal? (first (pfs)) +root-path+)
271271
(define img-path (first paths))
272272
(define-values (base name dir?) (split-path img-path))
273273
(image-dir base)
@@ -310,8 +310,8 @@
310310
(flif-destroy-decoder! (decoder))
311311
(decoder #f))
312312
(image-dir (find-system-path 'home-dir))
313-
(pfs (list root-path))
314-
(image-path root-path)
313+
(pfs (list +root-path+))
314+
(image-path +root-path+)
315315
(send (ivy-canvas) set-on-paint!
316316
(λ (canvas dc)
317317
(send canvas set-canvas-background color-black)))
@@ -448,7 +448,7 @@
448448
[checked (want-animation?)]
449449
[callback (λ (i e)
450450
(want-animation? (send i is-checked?))
451-
(when (and (not (equal? (image-path) root-path))
451+
(when (and (not (equal? (image-path) +root-path+))
452452
(or (and (gif? (image-path))
453453
(gif-animated? (image-path)))
454454
(and (flif? (image-path))
@@ -484,7 +484,7 @@
484484
[parent ivy-menu-bar-view-zoom-to]
485485
[label (format "~a%" n)]
486486
[callback (λ (i e)
487-
(unless (equal? (image-path) root-path)
487+
(unless (equal? (image-path) +root-path+)
488488
(collect-garbage 'incremental)
489489
(if (empty? image-lst-master)
490490
(load-image (bitmap image-bmp-master) n)
@@ -496,7 +496,7 @@
496496
[label "Rotate left"]
497497
[help-string "Rotate the image left."]
498498
[callback (λ (i e)
499-
(unless (equal? (image-path) root-path)
499+
(unless (equal? (image-path) +root-path+)
500500
(collect-garbage 'incremental)
501501
(load-image (rotate image-pict (/ pi 2)) 'same)))]))
502502

@@ -506,7 +506,7 @@
506506
[label "Rotate right"]
507507
[help-string "Rotate the image right."]
508508
[callback (λ (i e)
509-
(unless (equal? (image-path) root-path)
509+
(unless (equal? (image-path) +root-path+)
510510
(collect-garbage 'incremental)
511511
(load-image (rotate image-pict (- (/ pi 2))) 'same)))]))
512512

@@ -516,7 +516,7 @@
516516
[label "Flip horizontal"]
517517
[help-string "Flip the image horizontally."]
518518
[callback (λ (i e)
519-
(unless (equal? (image-path) root-path)
519+
(unless (equal? (image-path) +root-path+)
520520
(define flo
521521
(flomap-flip-horizontal (bitmap->flomap (pict->bitmap image-pict))))
522522
(collect-garbage 'incremental)
@@ -528,7 +528,7 @@
528528
[label "Flip vertical"]
529529
[help-string "Flip the image vertically."]
530530
[callback (λ (i e)
531-
(unless (equal? (image-path) root-path)
531+
(unless (equal? (image-path) +root-path+)
532532
(define flo
533533
(flomap-flip-vertical (bitmap->flomap (pict->bitmap image-pict))))
534534
(collect-garbage 'incremental)
@@ -540,7 +540,7 @@
540540
[label "Sort Alphabetically"]
541541
[help-string "Sort the current collection alphabetically."]
542542
[callback (λ (i e)
543-
(unless (equal? (image-path) root-path)
543+
(unless (equal? (image-path) +root-path+)
544544
(define new-pfs (sort (pfs) path<?))
545545
(pfs new-pfs)
546546
(send (status-bar-position)
@@ -555,7 +555,7 @@
555555
[label "Sort by High Rating"]
556556
[help-string "Sort the current collection by highest Rating."]
557557
[callback (λ (i e)
558-
(unless (equal? (image-path) root-path)
558+
(unless (equal? (image-path) +root-path+)
559559
; read the database entries for ratings
560560
(define ratings
561561
(for/list ([img (in-list (map path->string (pfs)))])
@@ -580,7 +580,7 @@
580580
[label "Sort by Low Rating"]
581581
[help-string "Sort the current collection by lowest Rating."]
582582
[callback (λ (i e)
583-
(unless (equal? (image-path) root-path)
583+
(unless (equal? (image-path) +root-path+)
584584
; read the database entries for ratings
585585
(define ratings
586586
(for/list ([img (in-list (map path->string (pfs)))])
@@ -687,7 +687,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>."
687687
[label (pict->bitmap (hc-append -12 (circle 15) (text "+ ")))]
688688
[callback (λ (button event)
689689
; do nothing if we've pressed ctrl+n
690-
(unless (equal? (image-path) root-path)
690+
(unless (equal? (image-path) +root-path+)
691691
(collect-garbage 'incremental)
692692
(if (and image-pict
693693
(empty? image-lst))
@@ -700,7 +700,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>."
700700
[label (pict->bitmap (hc-append -10 (circle 15) (text "- ")))]
701701
[callback (λ (button event)
702702
; do nothing if we've pressed ctrl+n
703-
(unless (equal? (image-path) root-path)
703+
(unless (equal? (image-path) +root-path+)
704704
(collect-garbage 'incremental)
705705
(if (and image-pict
706706
(empty? image-lst))
@@ -713,7 +713,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>."
713713
[label (pict->bitmap (rectangle 15 15))]
714714
[callback (λ (button event)
715715
; do nothing if we've pressed ctrl+n
716-
(unless (equal? (image-path) root-path)
716+
(unless (equal? (image-path) +root-path+)
717717
(collect-garbage 'incremental)
718718
(if (empty? image-lst)
719719
(load-image image-bmp-master 'none)
@@ -725,7 +725,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>."
725725
[label (pict->bitmap (hc-append -3 (frame (circle 15)) (text " ")))]
726726
[callback (λ (button event)
727727
; do nothing if we've pressed ctrl+n
728-
(unless (equal? (image-path) root-path)
728+
(unless (equal? (image-path) +root-path+)
729729
(collect-garbage 'incremental)
730730
(if (empty? image-lst)
731731
(load-image image-bmp-master)
@@ -744,7 +744,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>."
744744
[callback (λ (choice evt)
745745
; do nothing if we've pressed ctrl+n or if the
746746
; image cannot embed metadata
747-
(unless (or (equal? (image-path) root-path)
747+
(unless (or (equal? (image-path) +root-path+)
748748
(not (embed-support? (image-path))))
749749
(define img (image-path))
750750

@@ -794,7 +794,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>."
794794
(thread set-xmp:rating!))])))]))
795795

796796
(define (on-escape-key tfield)
797-
(unless (equal? (image-path) root-path)
797+
(unless (equal? (image-path) +root-path+)
798798
(send tfield set-field-background color-white)
799799
(define-values (base name-path must-be-dir?) (split-path (image-path)))
800800
(if (string=? (send tfield get-value) (incoming-tags))
@@ -822,7 +822,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>."
822822
[stretchable-height #f]
823823
[callback
824824
(λ (tf evt)
825-
(unless (equal? (image-path) root-path)
825+
(unless (equal? (image-path) +root-path+)
826826
(define img (image-path))
827827
(define img-str (path->string img))
828828
(define-values (base name-path must-be-dir?) (split-path img))
@@ -870,7 +870,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>."
870870
[label "Set"]
871871
[callback
872872
(λ (button event)
873-
(unless (equal? (image-path) root-path)
873+
(unless (equal? (image-path) +root-path+)
874874
(define img (image-path))
875875
(define img-str (path->string img))
876876
(define-values (base name-path must-be-dir?) (split-path (image-path)))
@@ -937,7 +937,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>."
937937
(cond
938938
; empty collection, adding 1 image
939939
; like file-open, but only open the single image
940-
[(equal? (first (pfs)) root-path)
940+
[(equal? (first (pfs)) +root-path+)
941941
(define-values (base name dir?) (split-path pathname))
942942
(image-dir base)
943943
(pfs (list pathname))
@@ -968,15 +968,15 @@ along with this program. If not, see <http://www.gnu.org/licenses/>."
968968
(case type
969969
[(wheel-down)
970970
; do nothing if we've pressed ctrl+n
971-
(unless (equal? (image-path) root-path)
971+
(unless (equal? (image-path) +root-path+)
972972
(collect-garbage 'incremental)
973973
(if (and image-pict
974974
(empty? image-lst))
975975
(load-image image-pict 'wheel-smaller)
976976
(load-image image-lst 'wheel-smaller)))]
977977
[(wheel-up)
978978
; do nothing if we've pressed ctrl+n
979-
(unless (equal? (image-path) root-path)
979+
(unless (equal? (image-path) +root-path+)
980980
(collect-garbage 'incremental)
981981
(if (and image-pict
982982
(empty? image-lst))

meta-editor.rkt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@
122122
[else empty]))
123123

124124
(define (ok-callback)
125-
(unless (equal? (image-path) root-path)
125+
(unless (equal? (image-path) +root-path+)
126126
(define type (send xmp-lbox get-string-selection))
127127
(when type
128128
(define elems (send dc-tfield get-value))
@@ -229,7 +229,7 @@
229229
[choices (append dublin-core xmp-base)]
230230
[selection 11]
231231
[callback (λ (lbox evt)
232-
(unless (or (equal? (image-path) root-path)
232+
(unless (or (equal? (image-path) +root-path+)
233233
(not (embed-support? (image-path))))
234234
(define str (send lbox get-string-selection))
235235
; just in case get-string-selection returns #f
@@ -381,7 +381,7 @@
381381
(define (show-meta-frame)
382382
(fields-defaults)
383383
(define img (image-path))
384-
(when (and (not (equal? img root-path))
384+
(when (and (not (equal? img +root-path+))
385385
(embed-support? img))
386386
; wait for any previous xmp-threads to complete
387387
(let loop ()

thumbnails.rkt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@
1616
"files.rkt")
1717
(provide path->md5 generate-thumbnails)
1818

19+
; convert the path-string to a valid URI
1920
(define/contract (path->uri path)
2021
(path-string? . -> . string?)
21-
; convert the path-string to a valid URI
2222
(define path-lst (explode-path path))
2323
; the first entry is going to be garbled, so omit that part
2424
(define encoded (map (compose1 uri-encode path->string) (rest path-lst)))

0 commit comments

Comments
 (0)