]> git.donarmstrong.com Git - lilypond.git/commitdiff
(LY_DEFINE): remove ly:paper-system-{extent,stencil}
authorHan-Wen Nienhuys <hanwen@xs4all.nl>
Sat, 1 Oct 2005 23:31:34 +0000 (23:31 +0000)
committerHan-Wen Nienhuys <hanwen@xs4all.nl>
Sat, 1 Oct 2005 23:31:34 +0000 (23:31 +0000)
ChangeLog
lily/include/paper-system.hh
lily/paper-system-scheme.cc
lily/paper-system.cc
scm/framework-tex.scm
scm/lily-library.scm
scm/output-lib.scm
scm/page-layout.scm
scm/safe-lily.scm

index 8b6786cca9b875a9665acc032f37beeed6c8bde4..1c65215b0d3704e3ff2a8ad98e11701b86c43830 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,7 @@
 2005-10-02  Han-Wen Nienhuys  <hanwen@xs4all.nl>
 
+       * lily/paper-system-scheme.cc (LY_DEFINE): remove ly:paper-system-{extent,stencil}
+
        * Documentation/user/global.itely (Paper size): explain how to add
        sizes.
 
index b86077cc7d2c3186eaf20284b20918c8aafe9448..f98c09c9add9b4ab8c892772fe36c90541c0e115 100644 (file)
@@ -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;
 };
 
index 9d887213c027339c053c248df938554fb22d71a7..f61c5a05340d00a7bdaf7aa0702ccdfa376f6f87 100644 (file)
@@ -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",
index b99458ec5b48a8abd28630e8722aab836bad18a6..66b04c38b29de142f9d56e282d4cf7a14973698d 100644 (file)
@@ -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
index 2012acd19ce567d379b3c92bcdef3f5127b24c3c..7da550ef6a085d3723945554247267cfd45a4852 100644 (file)
    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
index 3b16305577c8929b12e155a44235a344fba455db..93af42793ac0cb843b71042ad2c5164a81005886 100644 (file)
     ))
 
 
-(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)
index f8ad46a1763a78787d736bbc87d03d9411d4c9b8..96cc55cdd62260915b25a41b9f18713364eab4c6 100644 (file)
@@ -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)))
 
 
index 11219da49ac807288f4159fabe1481c022656006..50dfbcd9d8b4dcb86e548d33f71cc7fdfc33e4d4 100644 (file)
@@ -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))
                  '()))))
index 023b553147994e6ead1c7a2411fa364f02b6d4f1..2ef10c89a2e888bb0f9b8d4cdbff513dca8cc6df 100644 (file)
    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