]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/include/context.hh
(LY_DEFINE): use scm_c_make_hash_table().
[lilypond.git] / lily / include / context.hh
index 6413d8b49f14689f5a60db0e85e960d0cbb4b0cb..060fe9c22f1307fbea1d0e98a5ebbfe0a865da6a 100644 (file)
@@ -1,14 +1,16 @@
-/*   
-     context.hh -- declare  Context
-
-     source file of the GNU LilyPond music typesetter
-
-     (c) 2004 Han-Wen Nienhuys <hanwen@xs4all.nl>
- */
+/*
+  context.hh -- declare  Context
+  
+  source file of the GNU LilyPond music typesetter
+  
+  (c) 2004 Han-Wen Nienhuys <hanwen@xs4all.nl>
+*/
 
 #ifndef CONTEXT_HH
 #define CONTEXT_HH
 
+#include <map>
+
 #include "moment.hh"
 #include "lily-proto.hh"
 
@@ -26,8 +28,12 @@ private:
   friend class Interpretation_context_handle;
   int iterator_count_;
   bool init_;
-  
+
+  std::map<String, int> grob_counts_;
+  std::map<String, int> context_counts_;
+
 protected:
+  Object_key const * key_;
   Context * daddy_context_;
   SCM definition_;
   SCM properties_scm_;
@@ -38,18 +44,23 @@ protected:
   String id_string_;
 
   friend class Context_def;
+  void clear_key_disambiguations ();
+
 public:
+  Object_key const *get_key () const;
+  Object_key const *get_grob_key (String);
+  Object_key const *get_context_key (String, String);
+
+  Context *create_context (Context_def*, String, SCM); 
   String id_string () const { return id_string_; } 
   SCM children_contexts () const { return context_list_; }
   SCM default_child_context_name () const;
 
   Translator_group* implementation () const;
-  Context * get_parent_context () const;
-  Context ();
-
-  /*
-    properties:
-   */
+  Context *get_parent_context () const;
+  Context (Object_key const*);
+  
+  /* properties:  */
   void execute_pushpop_property (SCM prop, SCM sym, SCM val);
   SCM internal_get_property (SCM name_sym) const;
   SCM properties_as_alist () const;
@@ -58,13 +69,14 @@ public:
   void unset_property (SCM var_sym);
 
   
-  Context *remove_context (Context*trans);
+  Context *remove_context (Context *trans);
   void check_removal ();
   String context_name () const;
-  Global_context * get_global_context () const;
+  SCM context_name_symbol () const;
+  Global_context *get_global_context () const;
   
   virtual Score_context * get_score_context () const;  
-  virtual Music_output_def *get_output_def () const;
+  virtual Output_def *get_output_def () const;
   virtual Moment now_mom () const;
   virtual Context *get_default_interpreter ();
 
@@ -77,8 +89,10 @@ public:
 
   Context *find_create_context (SCM context_name,
                                String id, SCM ops);
+  Context *create_unique_context (SCM context_name,
+                                  SCM ops);
   Link_array<Context> path_to_acceptable_context (SCM alias,
-                                                 Music_output_def*) const;
+                                                 Output_def*) const;
 
 };
 
@@ -86,18 +100,17 @@ public:
   Context arg? 
  */
 
-void apply_property_operations (Context*tg, SCM pre_init_ops);
-void execute_pushpop_property (Context * trg, SCM prop, SCM eltprop, SCM val);
-SCM updated_grob_properties (Contexttg, SCM sym);
-Context * find_context_below (Context * where,
+void apply_property_operations (Context *tg, SCM pre_init_ops);
+void execute_pushpop_property (Context *trg, SCM prop, SCM eltprop, SCM val);
+SCM updated_grob_properties (Context *tg, SCM sym);
+Context *find_context_below (Context *where,
                              SCM type_sym, String id);
-bool melisma_busy (Context*);
+bool melisma_busy (Context *);
 
 Context *get_voice_to_lyrics (Context *lyrics);
-Grob *get_current_note_head (Context * voice);
-Context *unsmob_context (SCM);
-
-DECLARE_UNSMOB(Context,context);
+Grob *get_current_note_head (Context *voice);
+Grob *get_current_rest (Context *voice);
+DECLARE_UNSMOB(Context, context);
 
 #endif /* CONTEXT_HH */