From: hanwen Date: Sat, 1 Oct 2005 23:31:34 +0000 (+0000) Subject: (LY_DEFINE): remove ly:paper-system-{extent,stencil} X-Git-Tag: release/2.7.16^2~129 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=bef3aa10eb7ba0bbb1ee681fbf1ee7e39fc1a865;p=lilypond.git (LY_DEFINE): remove ly:paper-system-{extent,stencil} --- diff --git a/ChangeLog b/ChangeLog index 8b6786cca9..1c65215b0d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,7 @@ 2005-10-02 Han-Wen Nienhuys + * lily/paper-system-scheme.cc (LY_DEFINE): remove ly:paper-system-{extent,stencil} + * Documentation/user/global.itely (Paper size): explain how to add sizes. diff --git a/lily/include/paper-system.hh b/lily/include/paper-system.hh index b86077cc7d..f98c09c9ad 100644 --- a/lily/include/paper-system.hh +++ b/lily/include/paper-system.hh @@ -20,7 +20,6 @@ class Paper_system { DECLARE_SMOBS (Paper_system,); - Stencil stencil_; SCM mutable_property_alist_; SCM immutable_property_alist_; @@ -28,12 +27,8 @@ class Paper_system public: Paper_system (Stencil, SCM); - Stencil to_stencil () const; - SCM stencils () const; SCM internal_get_property (SCM sym) const; void internal_set_property (SCM sym, SCM val); - bool is_title () const; - Real break_before_penalty () const; }; diff --git a/lily/paper-system-scheme.cc b/lily/paper-system-scheme.cc index 9d887213c0..f61c5a0534 100644 --- a/lily/paper-system-scheme.cc +++ b/lily/paper-system-scheme.cc @@ -8,26 +8,6 @@ #include "paper-system.hh" -LY_DEFINE (ly_paper_system_height, "ly:paper-system-extent", - 2, 0, 0, (SCM system, SCM axis), - "Return the extent of @var{system}.") -{ - Paper_system *ps = unsmob_paper_system (system); - SCM_ASSERT_TYPE (ps, system, SCM_ARG1, __FUNCTION__, "paper-system"); - SCM_ASSERT_TYPE (is_axis (axis), axis, SCM_ARG2, __FUNCTION__, "axis"); - Axis ax = (Axis)scm_to_int (axis); - return ly_interval2scm (ps->to_stencil ().extent (ax)); -} - -LY_DEFINE (ly_paper_system_stencil, "ly:paper-system-stencil", - 1, 0, 0, (SCM system), - "Return the height of @var{system}.") -{ - Paper_system *ps = unsmob_paper_system (system); - SCM_ASSERT_TYPE (ps, system, SCM_ARG1, __FUNCTION__, "paper-system"); - return ps->to_stencil ().smobbed_copy (); -} - LY_DEFINE (ly_paper_system_property, "ly:paper-system-property", diff --git a/lily/paper-system.cc b/lily/paper-system.cc index b99458ec5b..66b04c38b2 100644 --- a/lily/paper-system.cc +++ b/lily/paper-system.cc @@ -20,10 +20,19 @@ Paper_system::Paper_system (Stencil s, SCM immutable_init) mutable_property_alist_ = SCM_EOL; immutable_property_alist_ = immutable_init; smobify_self (); - stencil_ = s; - init_vars (); -} + SCM yext = get_property ("Y-extent"); + + if (is_number_pair (yext)) + { + + Box b = s.extent_box(); + b[Y_AXIS] = ly_scm2interval (yext); + + s = Stencil (b, s.expr ()); + } + set_property ("stencil", s.smobbed_copy ()); +} Paper_system::~Paper_system () { @@ -34,8 +43,7 @@ Paper_system::mark_smob (SCM smob) { Paper_system *system = (Paper_system *) SCM_CELL_WORD_1 (smob); scm_gc_mark (system->mutable_property_alist_); - scm_gc_mark (system->immutable_property_alist_); - return system->stencil_.expr (); + return system->immutable_property_alist_; } int @@ -51,25 +59,10 @@ Paper_system::print_smob (SCM smob, SCM port, scm_print_state*) return 1; } - -Stencil -Paper_system::to_stencil () const -{ - return stencil_; -} - void Paper_system::init_vars () { - SCM yext = get_property ("Y-extent"); - if (is_number_pair (yext)) - { - Box b = stencil_.extent_box(); - b[Y_AXIS] = ly_scm2interval (yext); - - stencil_ = Stencil (b, stencil_.expr ()); - } } SCM diff --git a/scm/framework-tex.scm b/scm/framework-tex.scm index 2012acd19c..7da550ef6a 100644 --- a/scm/framework-tex.scm +++ b/scm/framework-tex.scm @@ -218,9 +218,9 @@ putter (format "\\lybox{~a}{~a}{%\n" (ly:number->string - (max 0 (interval-end (ly:paper-system-extent line X)))) + (max 0 (interval-end (paper-system-extent line X)))) (ly:number->string - (interval-length (ly:paper-system-extent line Y))))) + (interval-length (paper-system-extent line Y))))) (ly:outputter-dump-stencil putter (ly:paper-system-stencil line)) (ly:outputter-dump-string diff --git a/scm/lily-library.scm b/scm/lily-library.scm index 3b16305577..93af42793a 100644 --- a/scm/lily-library.scm +++ b/scm/lily-library.scm @@ -116,10 +116,13 @@ )) -(define-public (paper-system-title? ps) - (equal? #t (ly:paper-system-property ps 'is-title) +(define-public (paper-system-title? system) + (equal? #t (ly:paper-system-property system 'is-title) )) +(define-public (paper-system-extent system axis) + (ly:stencil-extent (ly:paper-system-property system 'stencil) axis)) + ;;;;;;;;;;;;;;;; ;; alist (define-public assoc-get ly:assoc-get) diff --git a/scm/output-lib.scm b/scm/output-lib.scm index f8ad46a176..96cc55cdd6 100644 --- a/scm/output-lib.scm +++ b/scm/output-lib.scm @@ -221,7 +221,8 @@ centered, X==1 is at the right, X == -1 is at the left." (define-public (shift-right-at-line-begin g) "Shift an item to the right, but only at the start of the line." - (if (and (ly:item? g) (equal? (ly:item-break-dir g) RIGHT)) + (if (and (ly:item? g) + (equal? (ly:item-break-dir g) RIGHT)) (ly:grob-translate-axis! g 3.5 X))) diff --git a/scm/page-layout.scm b/scm/page-layout.scm index 11219da49a..50dfbcd9d8 100644 --- a/scm/page-layout.scm +++ b/scm/page-layout.scm @@ -36,6 +36,7 @@ (define-public (paper-system-staff-extents ps) (ly:paper-system-property ps 'refpoint-Y-extent '(0 . 0))) + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (define (page-headfoot layout scopes number sym sepsym dir last?) @@ -256,7 +257,7 @@ is what have collected so far, and has ascending page numbers." (list->vector (append (map - (lambda (sys) (ly:paper-system-extent sys Y)) lines) + (lambda (sys) (paper-system-extent sys Y)) lines) (if (= (length lines) 1) '((0 . 0)) '())))) diff --git a/scm/safe-lily.scm b/scm/safe-lily.scm index 023b553147..2ef10c89a2 100644 --- a/scm/safe-lily.scm +++ b/scm/safe-lily.scm @@ -100,7 +100,6 @@ ly:layout-def? ly:paper-get-font ly:paper-get-number - ly:paper-system-extent ly:paper-system-stencil ly:paper-system? ly:output-def-lookup