]> git.donarmstrong.com Git - lilypond.git/blob - lily/mark-engraver.cc
release: 1.3.6
[lilypond.git] / lily / mark-engraver.cc
1 /*
2   mark-engraver.cc -- implement Mark_engraver
3
4   source file of the GNU LilyPond music typesetter
5
6  (c) 1998--1999 Jan Nieuwenhuizen <janneke@gnu.org>
7 */
8 #include "command-request.hh"
9 #include "mark-engraver.hh"
10 #include "engraver-group-engraver.hh"
11 #include "text-item.hh"
12
13
14 ADD_THIS_TRANSLATOR (Mark_engraver);
15
16 Mark_engraver::Mark_engraver ()
17 {
18   mark_req_l_ = 0;
19   axis_ = Y_AXIS;
20   type_ = "mark";
21   visibility_lambda_ = ly_eval_str ("mark-visibility");
22 }
23
24 void
25 Mark_engraver::do_post_move_processing ()
26 {
27   mark_req_l_ = 0;
28 }
29
30
31 bool
32 Mark_engraver::do_try_music (Music* r_l)
33 {
34   if (Mark_req *mr = dynamic_cast <Mark_req *> (r_l))
35     {
36       mark_req_l_ = mr;
37       return true;
38     }
39   return false;
40 }
41
42 void
43 Mark_engraver::do_process_requests ()
44 {
45   if (mark_req_l_)
46     {
47       create_items (mark_req_l_);
48       text_p_->text_str_ = mark_req_l_->str_;
49       SCM st = ly_str02scm ((text_p_->text_str_.index_any_i ("0123456789")  >= 0 )
50                             ? "mark" : "large");
51       text_p_->set_elt_property ("style",  st);
52     }
53 }
54