/*
request.hh -- declare Request baseclasses.
- source file of the LilyPond music typesetter
+ source file of the GNU LilyPond music typesetter
- (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
+ (c) 1997--1998 Han-Wen Nienhuys <hanwen@cs.uu.nl>
*/
#ifndef REQUEST_HH
#define REQUEST_HH
-// LilyPond's second egg of columbus!
-#include "glob.hh"
+
#include "string.hh"
#include "moment.hh"
-#include "class-name.hh"
+#include "virtual-methods.hh"
+#include "input.hh"
+#include "music.hh"
+#include "direction.hh"
+
+#define DEFAULTACCESSOR(T) virtual T *access_ ## T () { return 0; }
+
/**
- a voice element wants something printed.
+ An atom of musical information .
Hungarian postfix: req
@see lilygut manpage
*/
-class Request {
+class Request : public Music {
+
public:
- Voice_element*elt_l_;
- char const* defined_ch_c_l_;
- /* *************** */
- Voice * voice_l();
- Request();
- Request(Request const&);
- virtual ~Request(){}
-
- NAME_MEMBERS(Request);
- virtual Request* clone() const { return new Request(*this); }
- void print()const ;
+ /* *************** */
+
+ virtual ~Request(){}
+
+ DECLARE_MY_RUNTIME_TYPEINFO;
+ VIRTUAL_COPY_CONS(Request,Music);
+
+ virtual MInterval time_int() const;
+ virtual Moment duration() const { return 0; }
+
+ /* accessors for children
+ maybe checkout RTTI
+ */
+
+ DEFAULTACCESSOR(Barcheck_req)
+ DEFAULTACCESSOR(Script_req)
+ DEFAULTACCESSOR(Span_req)
+ DEFAULTACCESSOR(Spacing_req)
+ DEFAULTACCESSOR(Musical_req)
+ DEFAULTACCESSOR(Command_req)
- virtual void transpose(Melodic_req const &){}
- virtual Moment duration() const { return 0; }
-
- /* accessors for children
- maybe checkout RTTI
- */
- virtual Barcheck_req *barcheck() { return 0; }
- virtual Note_req *note() { return 0;}
- virtual Script_req *script() { return 0;}
- virtual Stem_req *stem() { return 0;}
- virtual Text_req*text() { return 0; }
- virtual Rest_req *rest() { return 0; }
- virtual Span_req *span() { return 0; }
- virtual Beam_req *beam() { return 0 ; }
- virtual Plet_req* plet() { return 0; }
- virtual Slur_req *slur() { return 0 ; }
- virtual Rhythmic_req*rhythmic() { return 0; }
- virtual Lyric_req* lreq_l() { return 0; }
- virtual Melodic_req *melodic() { return 0; }
- virtual Terminate_voice_req *terminate() {return 0;}
- virtual Group_change_req * groupchange() { return 0;}
- virtual Group_feature_req * groupfeature() { return 0; }
- virtual Spacing_req * spacing() { return 0; }
- virtual Blank_req * blank() { return 0; }
- virtual Musical_req *musical() { return 0; }
- virtual Command_req * command() { return 0; }
+ bool equal_b (Request*) const;
protected:
- virtual void do_print()const ;
+ virtual bool do_equal_b (Request*) const;
+ virtual void do_print() const;
};
-#define REQUESTMETHODS(T,accessor) \
-virtual T * accessor() { return this;}\
-NAME_MEMBERS(T);\
-virtual Request *clone() const { return new T(*this); } \
+
+#define REQUESTMETHODS(T) \
+virtual T * access_ ## T() { return this;}\
+DECLARE_MY_RUNTIME_TYPEINFO;\
+VIRTUAL_COPY_CONS(T, Request);\
virtual void do_print() const
+
+
+/** Put a script above or below this ``note'' or bar. eg upbow, downbow. Why
+ a request? These symbols may conflict with slurs and brackets, so
+ this also a request */
+
+class Script_req : public virtual Request {
+public:
+ Direction dir_;
+ General_script_def *scriptdef_p_;
+
+ bool do_equal_b (Request*) const;
+
+ Script_req();
+ REQUESTMETHODS(Script_req);
+ ~Script_req();
+ Script_req (Script_req const&);
+};
+
+
#endif