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_; }
53 Object_key const *get_grob_key (String);
54 Object_key const *get_context_key (String, String);
56 Context *create_context (Context_def *, String, SCM);
57 String id_string () const { return id_string_; }
58 SCM children_contexts () const { return context_list_; }
59 SCM default_child_context_name () const;
61 Translator_group *implementation () const { return implementation_; }
62 Context *get_parent_context () const;
63 Context (Object_key const *);
66 SCM internal_get_property (SCM name_sym) const;
67 SCM properties_as_alist () const;
68 void internal_set_property (SCM var_sym, SCM value);
69 Context *where_defined (SCM name_sym, SCM *value) const;
70 void unset_property (SCM var_sym);
72 Context *remove_context (Context *trans);
73 void check_removal ();
74 String context_name () const;
75 SCM context_name_symbol () const;
76 Global_context *get_global_context () const;
78 virtual Score_context *get_score_context () const;
79 virtual Output_def *get_output_def () const;
80 virtual Moment now_mom () const;
81 virtual Context *get_default_interpreter ();
83 bool is_alias (SCM) const;
85 void add_context (Context *trans);
86 bool is_bottom_context () const;
87 bool is_removable () const;
88 bool try_music (Music *);
90 Context *find_create_context (SCM context_name,
92 Context *create_unique_context (SCM context_name,
94 Link_array<Context> path_to_acceptable_context (SCM alias,
102 void apply_property_operations (Context *tg, SCM pre_init_ops);
103 void execute_pushpop_property (Context *trg, SCM prop, SCM eltprop, SCM val);
104 void execute_general_pushpop_property (Context *context,
105 SCM context_property, SCM grob_property_path, SCM val);
106 SCM updated_grob_properties (Context *tg, SCM sym);
107 Context *find_context_below (Context *where,
108 SCM type_sym, String id);
109 bool melisma_busy (Context *);
111 Context *get_voice_to_lyrics (Context *lyrics);
112 Grob *get_current_note_head (Context *voice);
113 Grob *get_current_rest (Context *voice);
114 DECLARE_UNSMOB (Context, context);
116 Moment measure_position (Context const *context);
117 Rational measure_length (Context const *context);
118 void set_context_property_on_children (Context *trans, SCM sym, SCM val);
120 #endif /* CONTEXT_HH */