2 context.hh -- declare Context
4 source file of the GNU LilyPond music typesetter
6 (c) 2004--2006 Han-Wen Nienhuys <hanwen@xs4all.nl>
13 #include "std-vector.hh"
15 #include "lily-proto.hh"
16 #include "virtual-methods.hh"
17 #include "context-key-manager.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;
34 Context *daddy_context_;
36 Context_key_manager key_manager_;
42 Translator_group *implementation_;
45 friend class Context_def;
46 void clear_key_disambiguations ();
50 Object_key const *get_grob_key (string name);
51 Object_key const *get_context_key (string name, string id);
53 Context *create_context (Context_def *, string, SCM);
54 string id_string () const { return id_string_; }
55 SCM children_contexts () const { return context_list_; }
56 SCM default_child_context_name () const;
58 Translator_group *implementation () const { return implementation_; }
59 Context *get_parent_context () const;
60 Context (Object_key const *);
63 SCM internal_get_property (SCM name_sym) const;
64 SCM properties_as_alist () const;
65 void internal_set_property (SCM var_sym, SCM value);
66 Context *where_defined (SCM name_sym, SCM *value) const;
67 void unset_property (SCM var_sym);
69 Context *remove_context (Context *trans);
70 void check_removal ();
71 string context_name () const;
72 SCM context_name_symbol () const;
73 Global_context *get_global_context () const;
75 virtual Score_context *get_score_context () const;
76 virtual Output_def *get_output_def () const;
77 virtual Moment now_mom () const;
78 virtual Context *get_default_interpreter ();
80 bool is_alias (SCM) const;
82 void add_context (Context *trans);
83 bool is_bottom_context () const;
84 bool is_removable () const;
85 bool try_music (Music *);
87 Context *find_create_context (SCM context_name,
89 Context *create_unique_context (SCM context_name, string context_id,
91 vector<Context*> path_to_acceptable_context (SCM alias,
99 void apply_property_operations (Context *tg, SCM pre_init_ops);
100 void execute_pushpop_property (Context *trg, SCM prop, SCM eltprop, SCM val);
101 void execute_general_pushpop_property (Context *context,
102 SCM context_property, SCM grob_property_path, SCM val);
103 SCM updated_grob_properties (Context *tg, SCM sym);
104 Context *find_context_below (Context *where,
105 SCM type_sym, string id);
106 bool melisma_busy (Context *);
108 Context *get_voice_to_lyrics (Context *lyrics);
109 Grob *get_current_note_head (Context *voice);
110 Grob *get_current_rest (Context *voice);
111 DECLARE_UNSMOB (Context, context);
113 Moment measure_position (Context const *context);
114 Rational measure_length (Context const *context);
115 void set_context_property_on_children (Context *trans, SCM sym, SCM val);
117 #endif /* CONTEXT_HH */