From: Han-Wen Nienhuys Date: Thu, 11 Jan 2007 01:07:05 +0000 (+0100) Subject: more key cutting. X-Git-Tag: release/2.11.11-1~15 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=03f6455a0f48b59f3efe77a553ce036015aa3034;p=lilypond.git more key cutting. --- diff --git a/lily/include/lilypond-key.hh b/lily/include/lilypond-key.hh deleted file mode 100644 index b15328f2c7..0000000000 --- a/lily/include/lilypond-key.hh +++ /dev/null @@ -1,77 +0,0 @@ -/* - lilypond-key.hh -- declare Lilypond_{grob, context}_key - - source file of the GNU LilyPond music typesetter - - (c) 2004--2007 Han-Wen Nienhuys -*/ - -#ifndef LILYPOND_KEY_HH -#define LILYPOND_KEY_HH - -#include "object-key.hh" -#include "lily-proto.hh" -#include "moment.hh" - -class Lilypond_grob_key : public Object_key -{ - Object_key const *context_; - Moment creation_moment_; - string grob_name_; - int disambiguation_count_; - -public: - Lilypond_grob_key (Object_key const *context, - Moment start, - string name, int); - - static Object_key *from_scheme (SCM); -protected: - virtual int get_type () const; - virtual void derived_mark () const; - virtual int do_compare (Object_key const *a) const; - virtual SCM as_scheme () const; -}; - -class Lilypond_context_key : public Object_key -{ - Object_key const *parent_context_; - Moment start_moment_; - string context_name_; - string id_; - int disambiguation_count_; - -public: - Lilypond_context_key (Object_key const *parent, - Moment start, - string type, - string id, - int count); - - static Object_key *from_scheme (SCM); -protected: - virtual int get_type () const; - virtual int do_compare (Object_key const *a) const; - virtual void derived_mark () const; - virtual SCM as_scheme () const; -}; - -class Lilypond_general_key : public Object_key -{ - Object_key const *parent_; - string name_; - int disambiguation_count_; -public: - Lilypond_general_key (Object_key const *parent, string name, - int count); - - static Object_key *from_scheme (SCM); -protected: - virtual int get_type () const; - virtual int do_compare (Object_key const *a) const; - virtual void derived_mark () const; - virtual SCM as_scheme () const; -}; - -#endif /* LILYPOND_KEY_HH */ - diff --git a/lily/include/object-key.hh b/lily/include/object-key.hh deleted file mode 100644 index e772c73673..0000000000 --- a/lily/include/object-key.hh +++ /dev/null @@ -1,75 +0,0 @@ -/* - object-key.hh -- declare Object_key - - source file of the GNU LilyPond music typesetter - - (c) 2004--2007 Han-Wen Nienhuys -*/ - -#ifndef OBJECT_KEY_HH -#define OBJECT_KEY_HH - -#include "smobs.hh" - -/* - Object_keys are read-only values, suitable for storing references to - transient objects (such as grobs or contexts) on disk. - - In the future, they might also act as handles for external processes - requesting notation to be drawn. -*/ -class Object_key -{ - DECLARE_SMOBS (Object_key); - -protected: - Object_key (); - virtual void derived_mark () const; - virtual int get_type () const; - virtual int do_compare (Object_key const *other) const; -public: - virtual SCM as_scheme () const; - static Object_key *from_scheme (SCM); - static Object_key *undump (SCM); - int compare (Object_key const *other) const; - SCM dump () const; -}; - -enum Object_key_type - { - BASE_KEY, - COPIED_KEY, - GENERAL_KEY, - GROB_KEY, - CONTEXT_KEY, - KEY_COUNT, - }; - -class Copied_key : public Object_key -{ - -private: - Object_key const *original_; - int copy_count_; - -protected: - virtual void derived_mark () const; - virtual int get_type () const; - virtual int do_compare (Object_key const *other) const; - virtual SCM as_scheme () const; -public: - static Object_key *from_scheme (SCM); - Copied_key (Object_key const *, int); -}; - -DECLARE_UNSMOB (Object_key, key); - -struct Object_key_less -{ - bool operator () (Object_key const *const &t1, Object_key const *const &t2) const - { - return t1->compare (t2); - } -}; - -#endif /* OBJECT_KEY_HH */