]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/include/stream-event.hh
Run grand-replace (issue 3765)
[lilypond.git] / lily / include / stream-event.hh
index 9966a35eb96dc5a3abe6245d57f7ff7a74c265ff..3234c03d9f039b50332107d2ba15b829cf005731 100644 (file)
@@ -1,9 +1,20 @@
 /*
-  stream-event.hh -- declare Stream_event
+  This file is part of LilyPond, the GNU music typesetter.
 
-  source file of the GNU LilyPond music typesetter
+  Copyright (C) 2005--2014 Erik Sandberg <mandolaerik@gmail.com>
 
-  (c) 2005-2006 Erik Sandberg <mandolaerik@gmail.com>
+  LilyPond is free software: you can redistribute it and/or modify
+  it under the terms of the GNU General Public License as published by
+  the Free Software Foundation, either version 3 of the License, or
+  (at your option) any later version.
+
+  LilyPond is distributed in the hope that it will be useful,
+  but WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+  GNU General Public License for more details.
+
+  You should have received a copy of the GNU General Public License
+  along with LilyPond.  If not, see <http://www.gnu.org/licenses/>.
 */
 
 #ifndef STREAM_EVENT_HH
 #include "smobs.hh"
 #include "prob.hh"
 
-class Stream_event
+class Stream_event : public Prob
 {
-  void init ();
-  SCM property_alist_;
-  Input *origin_;
-
 public:
   Stream_event ();
-  Input *origin () const;
+  VIRTUAL_COPY_CONSTRUCTOR (Stream_event, Stream_event);
 
-  DECLARE_SCHEME_CALLBACK (undump, (SCM));
-  DECLARE_SCHEME_CALLBACK (dump, (SCM));
+  Stream_event (SCM event_class, SCM immutable_props = SCM_EOL);
+  Stream_event (SCM class_name, Input *);
 
-  // todo: make Input mandatory.
-  Stream_event (SCM property_alist);
-  Stream_event (Context *c, SCM class_name);
-  Stream_event (Context *c, Input *);
-  Stream_event (Stream_event *ev);
+  Input *origin () const;
+  void set_spot (Input *i);
+  bool internal_in_event_class (SCM class_name);
+  void make_transposable ();
 
-  SCM internal_get_property (SCM) const;
-  void internal_set_property (SCM prop, SCM val);
+  virtual SCM copy_mutable_properties () const;
 
-protected:
-  DECLARE_SMOBS (Stream_event,);
+  DECLARE_SCHEME_CALLBACK (undump, (SCM));
+  DECLARE_SCHEME_CALLBACK (dump, (SCM));
 };
 
-DECLARE_UNSMOB (Stream_event, stream_event);
-DECLARE_TYPE_P (Stream_event);
-
-#define SEND_EVENT_TO_CONTEXT(ctx, cl, ...)                            \
-  {                                                                    \
-    Stream_event *_e_ = new Stream_event (ctx, ly_symbol2scm (cl));    \
-    __VA_ARGS__;                                                       \
-    ctx->event_source ()->distribute (_e_);                            \
-    scm_gc_unprotect_object (_e_->self_scm ());                                \
-  }
-  
-#define EVENT_PROPERTY(prop, val)      \
-  (_e_->set_property (prop, val))
+#define in_event_class(class_name) internal_in_event_class (ly_symbol2scm (class_name))
+
+Stream_event *unsmob_stream_event (SCM);
+SCM ly_event_deep_copy (SCM);
 
 #endif /* STREAM_EVENT_HH */