X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=lily%2Finclude%2Fstream-event.hh;h=9f226f48db8d66017bcac533c21f06655a17ecdc;hb=6a3360c40308285434e06a1de031efb073c015fa;hp=9966a35eb96dc5a3abe6245d57f7ff7a74c265ff;hpb=2a8dcc4faa8a16229774d3414eedbf46feceac84;p=lilypond.git diff --git a/lily/include/stream-event.hh b/lily/include/stream-event.hh index 9966a35eb9..9f226f48db 100644 --- a/lily/include/stream-event.hh +++ b/lily/include/stream-event.hh @@ -13,44 +13,30 @@ #include "smobs.hh" #include "prob.hh" -class Stream_event +class Stream_event : public Prob { - void init (); - SCM property_alist_; - Input *origin_; - public: Stream_event (); + VIRTUAL_COPY_CONSTRUCTOR (Stream_event, Stream_event); + + Stream_event (SCM event_class, SCM mutable_props=SCM_EOL); + Stream_event (SCM class_name, Input *); + Input *origin () const; + void set_spot (Input *i); + bool internal_in_event_class (SCM class_name); + + virtual SCM copy_mutable_properties () const; DECLARE_SCHEME_CALLBACK (undump, (SCM)); DECLARE_SCHEME_CALLBACK (dump, (SCM)); - // 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); - - SCM internal_get_property (SCM) const; - void internal_set_property (SCM prop, SCM val); - -protected: - DECLARE_SMOBS (Stream_event,); }; -DECLARE_UNSMOB (Stream_event, stream_event); -DECLARE_TYPE_P (Stream_event); +#define in_event_class(class_name) internal_in_event_class (ly_symbol2scm (class_name)) -#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)) +Stream_event *unsmob_stream_event (SCM); +DECLARE_TYPE_P (Stream_event); +SCM ly_event_deep_copy (SCM); #endif /* STREAM_EVENT_HH */