From 0f2f6a5e7a2f484ea54b20e5642825667c91ec7f Mon Sep 17 00:00:00 2001 From: David Kastrup Date: Sun, 27 Jul 2014 16:24:57 +0200 Subject: [PATCH] Manual cleanup after unsmob_xxx -> Xxx:unsmob conversion --- Documentation/contributor/programming-work.itexi | 2 +- lily/include/engraver.hh | 2 +- lily/include/global-context.hh | 3 ++- lily/include/grob.hh | 4 ---- lily/include/input.hh | 6 +++--- lily/include/item.hh | 2 ++ lily/include/music-output.hh | 2 -- lily/include/music.hh | 2 +- lily/include/paper-score.hh | 2 ++ lily/include/performance.hh | 2 ++ lily/include/performer.hh | 3 +-- lily/include/spanner.hh | 2 ++ lily/include/stream-event.hh | 3 ++- 13 files changed, 19 insertions(+), 16 deletions(-) diff --git a/Documentation/contributor/programming-work.itexi b/Documentation/contributor/programming-work.itexi index 447f553ea4..a02910b768 100644 --- a/Documentation/contributor/programming-work.itexi +++ b/Documentation/contributor/programming-work.itexi @@ -2149,7 +2149,7 @@ Test whether the type of @var{s} is [type]. often than not, the code checks Lilypond specific C++-implemented types using -@subsubheading [type *] unsmob_[type] (SCM s) +@subsubheading [Type *] Type::unsmob (SCM s) This tries converting a Scheme object to a pointer of the desired kind. If the Scheme object is of the wrong type, a pointer value diff --git a/lily/include/engraver.hh b/lily/include/engraver.hh index 76da2049a8..2cb28292fc 100644 --- a/lily/include/engraver.hh +++ b/lily/include/engraver.hh @@ -65,13 +65,13 @@ public: override other ctor */ TRANSLATOR_DECLARATIONS (Engraver); + static Engraver *unsmob (SCM eng); }; #define make_item(x, cause) internal_make_item (ly_symbol2scm (x), cause, x, __FILE__, __LINE__, __FUNCTION__) #define make_spanner(x, cause) internal_make_spanner (ly_symbol2scm (x), cause, x, __FILE__, __LINE__, __FUNCTION__) #define make_paper_column(x) internal_make_column (ly_symbol2scm (x), x, __FILE__, __LINE__, __FUNCTION__) -Engraver *Engraver::unsmob (SCM eng); bool ly_is_grob_cause (SCM obj); #endif // ENGRAVER_HH diff --git a/lily/include/global-context.hh b/lily/include/global-context.hh index 28a89b25d3..31e2190bc2 100644 --- a/lily/include/global-context.hh +++ b/lily/include/global-context.hh @@ -48,6 +48,8 @@ public: virtual Moment now_mom () const; virtual Context *get_default_interpreter (const string &context_id = ""); + static Global_context *unsmob (SCM x); + Moment previous_moment () const; protected: Moment prev_mom_; @@ -55,6 +57,5 @@ protected: }; SCM ly_format_output (SCM); -Global_context *Global_context::unsmob (SCM x); #endif // GLOBAL_CONTEXT_HH diff --git a/lily/include/grob.hh b/lily/include/grob.hh index bac9538a85..2aec0fa909 100644 --- a/lily/include/grob.hh +++ b/lily/include/grob.hh @@ -171,10 +171,6 @@ public: static SCM internal_skylines_from_element_stencils (SCM, Axis); }; -/* smob utilities */ -Spanner *Spanner::unsmob (SCM); -Item *Item::unsmob (SCM); - /* unification */ void uniquify (vector &); diff --git a/lily/include/input.hh b/lily/include/input.hh index 5b0641ef6e..5a2992fdbe 100644 --- a/lily/include/input.hh +++ b/lily/include/input.hh @@ -21,6 +21,7 @@ #define INPUT_HH #include "lily-proto.hh" +#include "smobs.hh" /** Base class for anything that records its poisition in the parse file. @@ -35,6 +36,8 @@ public: char const *start () const; char const *end () const; + static Input *unsmob (SCM); + void set (Source_file *, char const *, char const *); void error (const string&) const; void programming_error (const string&) const; @@ -66,10 +69,7 @@ protected: string message_string (const string &msg) const; }; -#include "smobs.hh" - SCM make_input (Input spot); -Input *Input::unsmob (SCM); extern Input dummy_input_global; diff --git a/lily/include/item.hh b/lily/include/item.hh index bae549594c..ac945eac41 100644 --- a/lily/include/item.hh +++ b/lily/include/item.hh @@ -36,6 +36,8 @@ public: Item (SCM); Item (Item const &); + static Item *unsmob (SCM); + virtual Grob *clone () const; static bool is_non_musical (Grob *); diff --git a/lily/include/music-output.hh b/lily/include/music-output.hh index 836233f7d1..73d2ac94c6 100644 --- a/lily/include/music-output.hh +++ b/lily/include/music-output.hh @@ -38,6 +38,4 @@ public: virtual void process (); }; -Paper_score *Paper_score::unsmob (SCM); -Performance *Performance::unsmob (SCM); #endif /* MUSIC_OUTPUT_HH */ diff --git a/lily/include/music.hh b/lily/include/music.hh index 0774fac255..e59f82c758 100644 --- a/lily/include/music.hh +++ b/lily/include/music.hh @@ -47,6 +47,7 @@ public: Moment get_length () const; Moment start_mom () const; void print () const; + static Music *unsmob (SCM); /// Transpose, with the interval central C to #p# void transpose (Pitch p); @@ -69,7 +70,6 @@ protected: friend SCM ly_extended_make_music (SCM, SCM); }; -Music *Music::unsmob (SCM); Music *make_music_by_name (SCM sym); SCM ly_music_deep_copy (SCM); SCM ly_camel_case_2_lisp_identifier (SCM name_sym); diff --git a/lily/include/paper-score.hh b/lily/include/paper-score.hh index c44634b2c9..05933d49f3 100644 --- a/lily/include/paper-score.hh +++ b/lily/include/paper-score.hh @@ -39,6 +39,8 @@ public: DECLARE_CLASSNAME (Paper_score); + static Paper_score *unsmob (SCM); + Output_def *layout () const; System *root_system () const; diff --git a/lily/include/performance.hh b/lily/include/performance.hh index 8b5de86331..f3093f82c5 100644 --- a/lily/include/performance.hh +++ b/lily/include/performance.hh @@ -31,6 +31,8 @@ public: ~Performance (); DECLARE_CLASSNAME (Performance); + static Performance *unsmob (SCM); + void add_element (Audio_element *p); virtual void process (); void remap_grace_durations (); diff --git a/lily/include/performer.hh b/lily/include/performer.hh index bf40ea0fa5..aa9b098d34 100644 --- a/lily/include/performer.hh +++ b/lily/include/performer.hh @@ -33,6 +33,7 @@ public: VIRTUAL_COPY_CONSTRUCTOR (Translator, Performer); friend class Performer_group; Performer_group *get_daddy_performer () const; + static Performer *unsmob (SCM perf); protected: virtual void announce_element (Audio_element_info); @@ -40,7 +41,5 @@ protected: virtual void create_audio_elements (); }; -Performer *Performer::unsmob (SCM perf); - #endif /* PERFORMER_HH */ diff --git a/lily/include/spanner.hh b/lily/include/spanner.hh index 40b3473dca..b56cc2264d 100644 --- a/lily/include/spanner.hh +++ b/lily/include/spanner.hh @@ -52,6 +52,8 @@ public: DECLARE_SCHEME_CALLBACK (bounds_width, (SCM)); DECLARE_SCHEME_CALLBACK (kill_zero_spanned_time, (SCM)); + static Spanner *unsmob (SCM); + vector broken_intos_; vsize get_break_index () const; diff --git a/lily/include/stream-event.hh b/lily/include/stream-event.hh index cba4611c30..14a8af41dc 100644 --- a/lily/include/stream-event.hh +++ b/lily/include/stream-event.hh @@ -30,6 +30,8 @@ public: Stream_event (); VIRTUAL_COPY_CONSTRUCTOR (Stream_event, Stream_event); + static Stream_event *unsmob (SCM); + Stream_event (SCM event_class, SCM immutable_props = SCM_EOL); Stream_event (SCM class_name, Input *); @@ -46,7 +48,6 @@ public: #define in_event_class(class_name) internal_in_event_class (ly_symbol2scm (class_name)) -Stream_event *Stream_event::unsmob (SCM); SCM ly_event_deep_copy (SCM); #endif /* STREAM_EVENT_HH */ -- 2.39.2