2 context.hh -- declare Context
4 source file of the GNU LilyPond music typesetter
6 (c) 2004--2006 Han-Wen Nienhuys <hanwen@xs4all.nl>
14 #include "lily-proto.hh"
15 #include "virtual-methods.hh"
16 #include "context-key-manager.hh"
20 Scheme_hash_table *properties_dict () const;
21 Context (Context const &src);
23 DECLARE_SMOBS (Context, dummy);
24 DECLARE_CLASSNAME(Context);
28 friend class Context_handle;
33 Context *daddy_context_;
35 Context_key_manager key_manager_;
41 Translator_group *implementation_;
44 friend class Context_def;
45 void clear_key_disambiguations ();
49 Object_key const *get_grob_key (string name);
50 Object_key const *get_context_key (string name, string id);
52 Context *create_context (Context_def *, string, SCM);
53 string id_string () const { return id_string_; }
54 SCM children_contexts () const { return context_list_; }
55 SCM default_child_context_name () const;
57 Translator_group *implementation () const { return implementation_; }
58 Context *get_parent_context () const;
59 Context (Object_key const *);
62 SCM internal_get_property (SCM name_sym) const;
63 SCM properties_as_alist () const;
64 void internal_set_property (SCM var_sym, SCM value);
65 Context *where_defined (SCM name_sym, SCM *value) const;
66 void unset_property (SCM var_sym);
68 Context *remove_context (Context *trans);
69 void check_removal ();
70 string context_name () const;
71 SCM context_name_symbol () const;
72 Global_context *get_global_context () const;
74 virtual Score_context *get_score_context () const;
75 virtual Output_def *get_output_def () const;
76 virtual Moment now_mom () const;
77 virtual Context *get_default_interpreter ();
79 bool is_alias (SCM) const;
81 void add_context (Context *trans);
82 bool is_bottom_context () const;
83 bool is_removable () const;
84 bool try_music (Music *);
86 Context *find_create_context (SCM context_name,
88 Context *create_unique_context (SCM context_name, string context_id,
90 vector<Context*> path_to_acceptable_context (SCM alias,
98 void apply_property_operations (Context *tg, SCM pre_init_ops);
99 void execute_pushpop_property (Context *trg, SCM prop, SCM eltprop, SCM val);
100 void execute_general_pushpop_property (Context *context,
101 SCM context_property, SCM grob_property_path, SCM val);
102 SCM updated_grob_properties (Context *tg, SCM sym);
103 Context *find_context_below (Context *where,
104 SCM type_sym, string id);
105 bool melisma_busy (Context *);
107 Context *get_voice_to_lyrics (Context *lyrics);
108 Grob *get_current_note_head (Context *voice);
109 Grob *get_current_rest (Context *voice);
110 DECLARE_UNSMOB (Context, context);
112 Moment measure_position (Context const *context);
113 Rational measure_length (Context const *context);
114 void set_context_property_on_children (Context *trans, SCM sym, SCM val);
116 #endif /* CONTEXT_HH */