]> git.donarmstrong.com Git - lilypond.git/blob - lily/include/context.hh
* lily/include/context.hh (class Context): make members protected.
[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
25 protected:
26   Context * daddy_context_;
27   SCM definition_;
28   SCM properties_scm_;
29   SCM context_list_;
30   SCM accepts_list_;
31   SCM aliases_;
32
33   friend class Context_def;
34 public:
35   SCM children_contexts () const { return context_list_; }
36   SCM default_child_context_name () const;
37
38   Context * get_parent_context () const;
39   
40   Context ();
41   void execute_pushpop_property (SCM prop, SCM sym, SCM val);
42   SCM internal_get_property (SCM name_sym) const;
43
44   Context *remove_context (Context*trans);
45   void check_removal ();
46
47   SCM properties_as_alist () const;
48   void unset_property (SCM var_sym);
49   void internal_set_property (SCM var_sym, SCM value);  
50
51   Context *where_defined (SCM name_sym) const;
52   String context_name () const;
53   Global_context * get_global_context () const;
54   
55   virtual Score_context * get_score_context () const;  
56   bool is_alias (SCM) const;
57   void add_alias (SCM); 
58   void add_context (Context *trans);
59   bool is_bottom_context () const;
60   bool is_removable () const;
61   bool try_music (Music *);
62   
63   virtual Music_output_def *get_output_def () const;
64   virtual Moment now_mom () const;
65   Context *find_create_context (SCM context_name,
66                                 String id, SCM ops);
67   Link_array<Context> path_to_acceptable_context (SCM alias,
68                                                   Music_output_def*) const;
69   virtual Context *get_default_interpreter ();
70   String id_string_;
71
72   SCM implementation_;
73 private:
74   friend class Interpretation_context_handle;
75   int iterator_count_;
76   bool init_;
77 };
78
79 /*
80   Context arg? 
81  */
82
83 void apply_property_operations (Context*tg, SCM pre_init_ops);
84 void execute_pushpop_property (Context * trg, SCM prop, SCM eltprop, SCM val);
85 SCM updated_grob_properties (Context* tg, SCM sym);
86 Context * find_context_below (Context * where,
87                               SCM type_sym, String id);
88 bool melisma_busy (Context*);
89
90 Context *get_voice_to_lyrics (Context *lyrics);
91 Grob *get_current_note_head (Context * voice);
92 Context *unsmob_context (SCM);
93
94 DECLARE_UNSMOB(Context,context);
95
96 #endif /* CONTEXT_HH */
97