]> git.donarmstrong.com Git - lilypond.git/blob - lily/clef-item.cc
patch::: 1.3.14.hwn1
[lilypond.git] / lily / clef-item.cc
1 /*
2   clef-item.cc -- implement Clef_item
3
4   source file of the GNU LilyPond music typesetter
5
6   (c)  1997--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
7 */
8
9 #include <ctype.h>
10 #include "clef-item.hh"
11 #include "string.hh"
12 #include "molecule.hh"
13 #include "paper-def.hh"
14 #include "lookup.hh"
15 #include "text-item.hh"
16 #include "paper-score.hh"
17 #include "dimension-cache.hh"
18 #include "side-position-interface.hh"
19
20 void
21 Clef_item::do_pre_processing()
22 {
23   SCM style_sym =get_elt_property ("style");
24   String style;
25   if (gh_string_p (style_sym))
26     style = ly_scm2string (style_sym);
27   
28   if (break_status_dir() != RIGHT && style != "fullSizeChanges")
29     symbol_ += "_change";
30   
31   if (style == "transparent")   // UGH. JUNKME
32     {
33       set_elt_property ("transparent", SCM_BOOL_T);
34       set_empty (X_AXIS);
35     }
36 }
37
38 /*
39   JUNKME
40 */
41 Clef_item::Clef_item()
42 {
43   symbol_ = "treble";
44 }
45
46 void
47 Clef_item::do_add_processing ()
48 {
49   if (!break_status_dir ())     // broken stuff takes care of their own texts
50     {
51       Text_item *g =0;
52
53       SCM octave_dir = remove_elt_property ("octave-dir");
54       if (isdir_b (octave_dir))
55         {
56           g = new Text_item;
57           Side_position_interface spi (g);
58           spi.set_axis (Y_AXIS);
59           
60           pscore_l_->typeset_element (g);
61       
62           g->text_str_ = "8";
63           g->set_elt_property ("style", gh_str02scm ("italic"));
64           g->set_parent (this, Y_AXIS);
65           g->set_parent (this, X_AXIS);   
66           g->set_elt_property ("direction", octave_dir);
67           
68           add_dependency (g);   // just to be sure.
69           SCM my_vis = get_elt_property ("visibility-lambda");
70           if (gh_procedure_p (my_vis))
71             g->set_elt_property ("visibility-lambda", my_vis);
72                         
73         }
74
75     }
76 }
77
78 Molecule*
79 Clef_item::do_brew_molecule_p() const
80 {
81   Molecule*output = new Molecule (lookup_l ()->afm_find (String ("clefs-" + symbol_)));
82
83   return output;
84 }
85
86
87
88