Small changes for app-windows
part of darcs patch Wed Sep 21 20:50:24 EEST 2005 Martin Gasbichler <gasbichl@informatik.uni-tuebingen.de>
This commit is contained in:
		
							parent
							
								
									35ec8720e1
								
							
						
					
					
						commit
						889fa445f1
					
				| 
						 | 
				
			
			@ -1,5 +1,5 @@
 | 
			
		|||
(define-record-type app-window :app-window
 | 
			
		||||
  (make-app-window x y width height curses-win)
 | 
			
		||||
  (really-make-app-window x y width height curses-win)
 | 
			
		||||
  app-window?
 | 
			
		||||
  (x app-window-x)
 | 
			
		||||
  (y app-window-y)
 | 
			
		||||
| 
						 | 
				
			
			@ -7,6 +7,9 @@
 | 
			
		|||
  (height app-window-height)
 | 
			
		||||
  (curses-win app-window-curses-win set-app-window-curses-win!))
 | 
			
		||||
 | 
			
		||||
(define (make-app-window x y width height)
 | 
			
		||||
  (really-make-app-window x y width height #f))
 | 
			
		||||
 | 
			
		||||
(define-record-discloser :app-window
 | 
			
		||||
  (lambda (rec)
 | 
			
		||||
    `(app-window 
 | 
			
		||||
| 
						 | 
				
			
			@ -72,30 +75,29 @@
 | 
			
		|||
  (make-app-window (+ (app-window-x outer-window) 1)
 | 
			
		||||
		   (+ (app-window-y outer-window) 1)
 | 
			
		||||
		   (- (app-window-width outer-window) 2)
 | 
			
		||||
		   (- (app-window-height outer-window) 2)
 | 
			
		||||
		   #f))
 | 
			
		||||
		   (- (app-window-height outer-window) 2)))
 | 
			
		||||
 | 
			
		||||
(define (window-init-curses-win! window)
 | 
			
		||||
(define (app-window-init-curses-win! window)
 | 
			
		||||
  (set-app-window-curses-win!
 | 
			
		||||
   window
 | 
			
		||||
   (newwin (app-window-height window) (app-window-width window)
 | 
			
		||||
	   (app-window-y window) (app-window-x window))))
 | 
			
		||||
 | 
			
		||||
(define (delete-app-window! window)
 | 
			
		||||
  (delwin (app-window-curses-win window)))
 | 
			
		||||
 | 
			
		||||
(define (init-windows!)
 | 
			
		||||
  (set! *bar-1*
 | 
			
		||||
	(make-app-window 1 1 
 | 
			
		||||
			 (- (COLS) 2) 2 
 | 
			
		||||
			 #f))
 | 
			
		||||
			 (- (COLS) 2) 2))
 | 
			
		||||
  (debug-message '*bar-1* *bar-1*)
 | 
			
		||||
  (set! *active-command-window*
 | 
			
		||||
	(make-app-window 1 (+ (round (/ (LINES) 3)) 2)
 | 
			
		||||
			 (- (COLS) 2) 3
 | 
			
		||||
			 #f))
 | 
			
		||||
			 (- (COLS) 2) 3))
 | 
			
		||||
  (debug-message '*active-command-window* *active-command-window*)
 | 
			
		||||
  (set! *command-frame-window*
 | 
			
		||||
	(make-app-window 1 2
 | 
			
		||||
			 (- (COLS) 2) (- (app-window-y (active-command-window)) 2)
 | 
			
		||||
			 #f))
 | 
			
		||||
			 (- (COLS) 2) (- (app-window-y (active-command-window)) 2)))
 | 
			
		||||
  (debug-message '*command-frame-window* *command-frame-window*)
 | 
			
		||||
  (set! *command-window*
 | 
			
		||||
	(make-inlying-app-window (command-frame-window)))
 | 
			
		||||
| 
						 | 
				
			
			@ -103,8 +105,7 @@
 | 
			
		|||
  (set! *result-frame-window*
 | 
			
		||||
	(make-app-window 1 (+ (app-window-y (active-command-window)) 3)
 | 
			
		||||
			 (- (COLS) 2)
 | 
			
		||||
			 (- (- (LINES) 6) (app-window-height (command-frame-window)))
 | 
			
		||||
			 #f))
 | 
			
		||||
			 (- (- (LINES) 6) (app-window-height (command-frame-window)))))
 | 
			
		||||
  (debug-message '*result-frame-window* *result-frame-window*)
 | 
			
		||||
  (set! *result-window*
 | 
			
		||||
	(make-inlying-app-window (result-frame-window)))
 | 
			
		||||
| 
						 | 
				
			
			@ -114,7 +115,7 @@
 | 
			
		|||
	 (list (bar-1) (active-command-window)
 | 
			
		||||
	       (command-frame-window) (command-window)
 | 
			
		||||
	       (result-frame-window) (result-window))))
 | 
			
		||||
    (for-each window-init-curses-win! all-windows)
 | 
			
		||||
    (for-each app-window-init-curses-win! all-windows)
 | 
			
		||||
 | 
			
		||||
    (set-result-buffer-num-lines! 
 | 
			
		||||
     *result-buffer* (- (app-window-height (result-window)) 2))
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue