]> git.donarmstrong.com Git - lilypond.git/blob - lily/include/context.hh
* scripts/convert-ly.py (conv): add rule for breakAlignOrder.
[lilypond.git] / lily / include / context.hh
1 /*   
2      context.hh -- declare  Context
3
4      source file of the GNU LilyPond music typesetter
5
6      (c) 2004 Han-Wen Nienhuys <hanwen@xs4all.nl>
7  */
8
9 #ifndef CONTEXT_HH
10 #define CONTEXT_HH
11
12 #include "moment.hh"
13 #include "lily-proto.hh"
14
15
16 class Context
17 {
18   Scheme_hash_table *properties_dict () const;
19   Context (Context const &src);
20   
21   DECLARE_SMOBS (Context, dummy);
22
23   void terminate ();
24 public:
25   SCM definition_;
26   SCM properties_scm_;
27   SCM context_list_;
28   SCM accepts_list_;
29   SCM aliases_;
30
31   Context * daddy_context_;
32   
33   Context ();
34   void execute_pushpop_property (SCM prop, SCM sym, SCM val);
35   SCM internal_get_property (SCM name_sym) const;
36
37   Context *remove_context (Context*trans);
38   void check_removal ();
39
40   SCM properties_as_alist () const;
41   void unset_property (SCM var_sym);
42   void internal_set_property (SCM var_sym, SCM value);  
43
44   Context *where_defined (SCM name_sym) const;
45   String context_name () const;
46   Global_context * get_global_context () const;
47   
48   virtual Score_context * get_score_context () const;  
49   bool is_alias (SCM) const;
50   void add_alias (SCM); 
51   void add_context (Context *trans);
52   bool is_bottom_context () const;
53   bool is_removable () const;
54   bool try_music (Music *);
55   
56   virtual Music_output_def *get_output_def () const;
57   virtual Moment now_mom () const;
58   Context *find_existing_context (SCM context_name, String id);
59   Context *find_create_context (SCM context_name,
60                                             String id, SCM ops);
61   Link_array<Context> path_to_acceptable_context (SCM alias,
62                                                   Music_output_def*) const;
63   virtual Context *get_default_interpreter ();
64   String id_string_;
65
66   SCM implementation_;
67 private:
68   friend class Interpretation_context_handle;
69   int iterator_count_;
70   bool init_;
71 };
72
73 /*
74   Context arg? 
75  */
76
77 void apply_property_operations (Context*tg, SCM pre_init_ops);
78 void execute_pushpop_property (Context * trg, SCM prop, SCM eltprop, SCM val);
79 SCM updated_grob_properties (Context* tg, SCM sym);
80 Context * find_context_below (Context * where,
81                     String type, String id);
82 bool melisma_busy (Context*);
83
84 Context *get_voice_to_lyrics (Context *lyrics);
85 Grob *get_current_note_head (Context * voice);
86 Context *unsmob_context (SCM);
87
88 DECLARE_UNSMOB(Context,context);
89
90 #endif /* CONTEXT_HH */
91