X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=scm%2Fframework-gnome.scm;h=9e8cf4510d955dcd123aca45a1fd85927ab79072;hb=d5954664d0443ab7681aa40a36bd3ba2f45bd29b;hp=d8a9699c36987071bba072f6ff4b6d093f15ae73;hpb=a5a4028d46d8ff4c9f35b3c8f3ed510b120cbd95;p=lilypond.git diff --git a/scm/framework-gnome.scm b/scm/framework-gnome.scm index d8a9699c36..9e8cf4510d 100644 --- a/scm/framework-gnome.scm +++ b/scm/framework-gnome.scm @@ -2,14 +2,18 @@ ;;;; ;;;; source file of the GNU LilyPond music typesetter ;;;; -;;;; (c) 2004--2005 Jan Nieuwenhuizen +;;;; (c) 2004--2006 Jan Nieuwenhuizen ;;;; See output-gnome.scm for usage information. (define-module (scm framework-gnome)) -(use-modules (guile) (oop goops) (lily)) +(use-modules (guile) + (oop goops) + (scm page) + (scm paper-system) + (lily)) (use-modules (srfi srfi-2) @@ -107,12 +111,12 @@ (define (gnome-main book name) (let* ((paper (ly:paper-book-paper book)) - (hsize (ly:output-def-lookup paper 'hsize)) - (vsize (ly:output-def-lookup paper 'vsize)) - (page-width (inexact->exact (ceiling (* OUTPUT-SCALE hsize)))) - (page-height (inexact->exact (ceiling (* OUTPUT-SCALE vsize)))) - ;;(page-width (inexact->exact (ceiling hsize))) - ;;(page-height (inexact->exact (ceiling vsize))) + (paper-width (ly:output-def-lookup paper 'paper-width)) + (paper-height (ly:output-def-lookup paper 'paper-height)) + (page-width (inexact->exact (ceiling (* OUTPUT-SCALE paper-width)))) + (page-height (inexact->exact (ceiling (* OUTPUT-SCALE paper-height)))) + ;;(page-width (inexact->exact (ceiling paper-width))) + ;;(page-height (inexact->exact (ceiling paper-height))) (screen-width (gdk-screen-width)) (screen-height (gdk-screen-height)) @@ -120,7 +124,7 @@ (go (make #:name name - #:page-stencils (list->vector (ly:paper-book-pages book)) + #:page-stencils (list->vector (map page-stencil (ly:paper-book-pages book))) #:canvas-width page-width #:canvas-height page-height #:window-width @@ -177,8 +181,9 @@ (define (spawn-editor location) (let* ((file-name (car location)) (line (cadr location)) - (column (caddr location)) - (command (get-editor-command file line column))) + (char (caddr location)) + (column (cadddr location)) + (command (get-editor-command file line char column))) (debugf "spawning: ~s\n" command) (if (= (primitive-fork) 0) (let ((command-list (string-split command #\ )));; (get-ifs)))) @@ -188,18 +193,22 @@ (define location-callback spawn-editor) (define (get-location grob) - (and-let* ((p? (procedure? point-and-click)) + (and-let* ((p (procedure? point-and-click)) (g grob) (cause (ly:grob-property grob 'cause)) - (music-origin (if (ly:music? cause) - (ly:music-property cause 'origin) - ;; How come # [and '()] + (music-origin (if (ly:event? cause) + (ly:event-property cause 'origin) + ;; How come # [and '()] ;; are #t? :-( #f))) (if (ly:input-location? music-origin) (ly:input-location music-origin) #f))) +;; todo: how to integrate nicely? +;(define-public (tweak-grob-property grob sym val) +; (set! (ly:grob-property grob sym) val)) + (define-method (tweak (go ) item offset) (let* ((grob (hashq-ref (item-grobs go) item #f))