"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "TeXmacs/progs/graphics/graphics-kbd.scm" between
TeXmacs-1.99.4-src.tar.gz and TeXmacs-1.99.5-src.tar.gz

About: GNU TeXmacs is a what-you-see-is-what-you-get scientific text editor, which was both inspired by TeX and GNU Emacs.

graphics-kbd.scm  (TeXmacs-1.99.4-src):graphics-kbd.scm  (TeXmacs-1.99.5-src)
skipping to change at line 28 skipping to change at line 28
(graphics graphics-main) (graphics graphics-main)
(graphics graphics-edit))) (graphics graphics-edit)))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Various contexts ;; Various contexts
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(define (in-active-graphics?) (define (in-active-graphics?)
(and (in-graphics?) (== (get-env "preamble") "false"))) (and (in-graphics?) (== (get-env "preamble") "false")))
(define (in-beamer-graphics?)
(and (in-active-graphics?) (in-screens?)))
(define (graphics-context? t) (define (graphics-context? t)
(tree-is? t 'graphics)) (tree-is? t 'graphics))
(define (inside-graphics-context? t) (define (inside-graphics-context? t)
(tree-search-upwards t graphics-context?)) (tree-search-upwards t graphics-context?))
(define (inside-graphical-text-context? t) (define (inside-graphical-text-context? t)
(and-with p (tree-ref t :up) (and-with p (tree-ref t :up)
(and-with u (tree-search-upwards p graphical-text-context?) (and-with u (tree-search-upwards p graphical-text-context?)
(inside-graphics-context? u)))) (inside-graphics-context? u))))
skipping to change at line 94 skipping to change at line 97
(graphics-change-extents "0cm" "+1cm")) (graphics-change-extents "0cm" "+1cm"))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Keyboard handling ;; Keyboard handling
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(kbd-map (kbd-map
(:mode in-active-graphics?) (:mode in-active-graphics?)
("+" (graphics-zoom-in)) ("+" (graphics-zoom-in))
("-" (graphics-zoom-out)) ("-" (graphics-zoom-out))
("0" (graphics-set-zoom 0.5))
("1" (graphics-set-zoom 1.0)) ("1" (graphics-set-zoom 1.0))
("2" (graphics-set-zoom 2.0)) ("2" (graphics-set-zoom 2.0))
("3" (graphics-set-zoom 3.0)) ("3" (graphics-set-zoom 3.0))
("4" (graphics-set-zoom 4.0)) ("4" (graphics-set-zoom 4.0))
("5" (graphics-set-zoom 5.0)) ("5" (graphics-set-zoom 5.0))
("6" (graphics-set-zoom 6.0)) ("6" (graphics-set-zoom 6.0))
("7" (graphics-set-zoom 7.0)) ("7" (graphics-set-zoom 7.0))
("8" (graphics-set-zoom 8.0)) ("8" (graphics-set-zoom 8.0))
("9" (graphics-set-zoom 9.0)) ("9" (graphics-set-zoom 9.0))
("left" (graphics-move-origin-left)) ("left" (graphics-move-origin-left))
skipping to change at line 115 skipping to change at line 119
("down" (graphics-move-origin-down)) ("down" (graphics-move-origin-down))
("up" (graphics-move-origin-up)) ("up" (graphics-move-origin-up))
("S-left" (graphics-move-origin-left-fast)) ("S-left" (graphics-move-origin-left-fast))
("S-right" (graphics-move-origin-right-fast)) ("S-right" (graphics-move-origin-right-fast))
("S-down" (graphics-move-origin-down-fast)) ("S-down" (graphics-move-origin-down-fast))
("S-up" (graphics-move-origin-up-fast)) ("S-up" (graphics-move-origin-up-fast))
("home" (graphics-zmove 'foreground)) ("home" (graphics-zmove 'foreground))
("end" (graphics-zmove 'background)) ("end" (graphics-zmove 'background))
("pageup" (graphics-zmove 'closer)) ("pageup" (graphics-zmove 'closer))
("pagedown" (graphics-zmove 'farther)) ("pagedown" (graphics-zmove 'farther))
("return" (graphics-apply-props-at-mouse))
("S-return" (graphics-get-props-at-mouse))
("A-left" (graphics-decrease-hsize)) ("A-left" (graphics-decrease-hsize))
("A-right" (graphics-increase-hsize)) ("A-right" (graphics-increase-hsize))
("A-down" (graphics-increase-vsize)) ("A-down" (graphics-increase-vsize))
("A-up" (graphics-decrease-vsize)) ("A-up" (graphics-decrease-vsize))
("A-S-left" (graphics-decrease-hsize-fast)) ("A-S-left" (graphics-decrease-hsize-fast))
("A-S-right" (graphics-increase-hsize-fast)) ("A-S-right" (graphics-increase-hsize-fast))
("A-S-down" (graphics-increase-vsize-fast)) ("A-S-down" (graphics-increase-vsize-fast))
("A-S-up" (graphics-decrease-vsize-fast)) ("A-S-up" (graphics-decrease-vsize-fast))
("backspace" (graphics-kbd-remove #f)) ("backspace" (graphics-kbd-remove #f))
("delete" (graphics-kbd-remove #t)) ("delete" (graphics-kbd-remove #t))
("C-g" (graphics-toggle-grid #f)) ("C-g" (graphics-toggle-grid #f))
("C-G" (graphics-toggle-grid #t)) ("C-G" (graphics-toggle-grid #t))
("C-left" (graphics-rotate-xz -0.1)) ("C-left" (graphics-rotate-xz -0.1))
("C-right" (graphics-rotate-xz 0.1)) ("C-right" (graphics-rotate-xz 0.1))
("C-up" (graphics-rotate-yz 0.1)) ("C-up" (graphics-rotate-yz 0.1))
("C-down" (graphics-rotate-yz -0.1))) ("C-down" (graphics-rotate-yz -0.1))
("C-home" (graphics-zmove 'foreground))
("C-end" (graphics-zmove 'background))
("C-pageup" (graphics-zmove 'closer))
("C-pagedown" (graphics-zmove 'farther)))
(kbd-map
(:mode in-beamer-graphics?)
("pageup" (screens-switch-to :previous))
("pagedown" (screens-switch-to :next)))
(define graphics-keys (define graphics-keys
'("+" "-" "1" "2" "3" "4" "5" "6" "7" "8" "9" '("+" "-" "1" "2" "3" "4" "5" "6" "7" "8" "9" "0"
"left" "right" "down" "up" "home" "end" "pageup" "pagedown" "left" "right" "down" "up" "home" "end" "pageup" "pagedown"
"backspace" "delete" "tab")) "return" "backspace" "delete" "tab"
"F1" "F2" "F3" "F4" "F9" "F10" "F11" "F12"))
(tm-define (keyboard-press key time) (tm-define (keyboard-press key time)
(:mode in-active-graphics?) (:mode in-active-graphics?)
(cond ((string-occurs? "-" key) (key-press key)) (cond ((string-occurs? "-" key) (key-press key))
((in? key graphics-keys) (key-press key)))) ((in? key graphics-keys) (key-press key))))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Overriding standard structured editing commands ;; Overriding standard structured editing commands
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
skipping to change at line 201 skipping to change at line 217
(let* ((old (graphical-get-attribute t "text-at-halign")) (let* ((old (graphical-get-attribute t "text-at-halign"))
(new (if forwards? (new (if forwards?
(cond ((== old "right") "center") (cond ((== old "right") "center")
(else "left")) (else "left"))
(cond ((== old "left") "center") (cond ((== old "left") "center")
(else "right"))))) (else "right")))))
(graphical-set-attribute t "text-at-halign" new))) (graphical-set-attribute t "text-at-halign" new)))
(tm-define (geometry-vertical t down?) (tm-define (geometry-vertical t down?)
(:require (graphical-text-context? t)) (:require (graphical-text-context? t))
(let* ((old (graphical-get-attribute t "text-at-valign")) (display* t ", " (graphics-valign-var t) "\n")
(let* ((valign-var (graphics-valign-var t))
(old (graphical-get-attribute t valign-var))
(new (if down? (new (if down?
(cond ((== old "bottom") "base") (cond ((== old "bottom") "base")
((== old "base") "axis") ((== old "base") "axis")
((== old "axis") "center") ((== old "axis") "center")
(else "top")) (else "top"))
(cond ((== old "top") "center") (cond ((== old "top") "center")
((== old "center") "axis") ((== old "center") "axis")
((== old "axis") "base") ((== old "axis") "base")
(else "bottom"))))) (else "bottom")))))
(graphical-set-attribute t "text-at-valign" new))) (graphical-set-attribute t valign-var new)))
(tm-define (geometry-extremal t forwards?) (tm-define (geometry-extremal t forwards?)
(:require (graphical-text-context? t)) (:require (graphical-text-context? t))
(graphical-set-attribute t "text-at-halign" (graphical-set-attribute t "text-at-halign"
(if forwards? "left" "right"))) (if forwards? "left" "right")))
(tm-define (geometry-incremental t down?) (tm-define (geometry-incremental t down?)
(:require (graphical-text-context? t)) (:require (graphical-text-context? t))
(graphical-set-attribute t "text-at-valign" (graphical-set-attribute t (graphics-valign-var t)
(if down? "top" "bottom"))) (if down? "top" "bottom")))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Draw over / draw under ;; Draw over / draw under
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(tm-define (inside-draw-over/under?)
(or (inside? 'draw-over) (inside? 'draw-under)))
(tm-define (graphics-toggle-draw-over/under)
(with-innermost t (lambda (x) (tree-in? x '(draw-over draw-under)))
(if (tree-is? t 'draw-over)
(begin
(tree-assign-node! t 'draw-under)
(tree-go-to t 0 :end))
(begin
(tree-assign-node! t 'draw-over)
(if (tree-is? (tree-ref t 1) 'with)
(tree-go-to t 1 (- (tree-arity (tree-ref t 1)) 1) :end)
(tree-go-to t 1 :end))))))
(kbd-map (kbd-map
(:mode inside-draw-over/under?) (:mode inside-graphical-over-under?)
("C-*" (graphics-toggle-draw-over/under))) ("C-*" (graphics-toggle-over-under)))
 End of changes. 11 change blocks. 
21 lines changed or deleted 24 lines changed or added

Home  |  About  |  All  |  Newest  |  Fossies Dox  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTPS