2 context.hh -- declare Context
4 source file of the GNU LilyPond music typesetter
6 (c) 2004--2006 Han-Wen Nienhuys <hanwen@xs4all.nl>
16 #include "lily-proto.hh"
17 #include "virtual-methods.hh"
21 Scheme_hash_table *properties_dict () const;
22 Context (Context const &src);
24 DECLARE_SMOBS (Context, dummy);
25 DECLARE_CLASSNAME(Context);
29 friend class Context_handle;
33 map<String, int> grob_counts_;
34 map<String, int> context_counts_;
37 Object_key const *key_;
38 Context *daddy_context_;
45 Translator_group *implementation_;
48 friend class Context_def;
49 void clear_key_disambiguations ();
52 Object_key const *key () const { return key_; }
54 Object_key const *create_grob_key (String);
55 Object_key const *get_grob_key (String);
56 Object_key const *get_context_key (String, String);
58 Context *create_context (Context_def *, String, SCM);
59 String id_string () const { return id_string_; }
60 SCM children_contexts () const { return context_list_; }
61 SCM default_child_context_name () const;
63 Translator_group *implementation () const { return implementation_; }
64 Context *get_parent_context () const;
65 Context (Object_key const *);
68 SCM internal_get_property (SCM name_sym) const;
69 SCM properties_as_alist () const;
70 void internal_set_property (SCM var_sym, SCM value);
71 Context *where_defined (SCM name_sym, SCM *value) const;
72 void unset_property (SCM var_sym);
74 Context *remove_context (Context *trans);
75 void check_removal ();
76 String context_name () const;
77 SCM context_name_symbol () const;
78 Global_context *get_global_context () const;
80 virtual Score_context *get_score_context () const;
81 virtual Output_def *get_output_def () const;
82 virtual Moment now_mom () const;
83 virtual Context *get_default_interpreter ();
85 bool is_alias (SCM) const;
87 void add_context (Context *trans);
88 bool is_bottom_context () const;
89 bool is_removable () const;
90 bool try_music (Music *);
92 Context *find_create_context (SCM context_name,
94 Context *create_unique_context (SCM context_name,
96 Link_array<Context> path_to_acceptable_context (SCM alias,
104 void apply_property_operations (Context *tg, SCM pre_init_ops);
105 void execute_pushpop_property (Context *trg, SCM prop, SCM eltprop, SCM val);
106 void execute_general_pushpop_property (Context *context,
107 SCM context_property, SCM grob_property_path, SCM val);
108 SCM updated_grob_properties (Context *tg, SCM sym);
109 Context *find_context_below (Context *where,
110 SCM type_sym, String id);
111 bool melisma_busy (Context *);
113 Context *get_voice_to_lyrics (Context *lyrics);
114 Grob *get_current_note_head (Context *voice);
115 Grob *get_current_rest (Context *voice);
116 DECLARE_UNSMOB (Context, context);
118 Moment measure_position (Context const *context);
119 Rational measure_length (Context const *context);
120 void set_context_property_on_children (Context *trans, SCM sym, SCM val);
122 #endif /* CONTEXT_HH */