X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=lily%2Finclude%2Funpure-pure-container.hh;h=5166f590a4bcfaae12524a35d8eb207c4f394e1c;hb=47db9a3883d726ca53e2133a3b2298f78dd6a32e;hp=1fd32d40bb68128d9a3a6c8ac650ff0accb7de1c;hpb=0b544cfb7332615ef809b71b57ab656741311ae1;p=lilypond.git diff --git a/lily/include/unpure-pure-container.hh b/lily/include/unpure-pure-container.hh index 1fd32d40bb..5166f590a4 100644 --- a/lily/include/unpure-pure-container.hh +++ b/lily/include/unpure-pure-container.hh @@ -1,7 +1,7 @@ /* This file is part of LilyPond, the GNU music typesetter. - Copyright (C) 2005--2014 Han-Wen Nienhuys + Copyright (C) 2005--2015 Han-Wen Nienhuys LilyPond is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -21,11 +21,25 @@ #define UNPURE_PURE_CONTAINER_HH #include "lily-guile.hh" - -bool is_unpure_pure_container (SCM s); -bool is_unchanging_unpure_pure_container (SCM s); -SCM unpure_pure_container_unpure_part (SCM smob); -SCM unpure_pure_container_pure_part (SCM smob); -SCM ly_make_unpure_pure_container (SCM, SCM); +#include "small-smobs.hh" + +class Unpure_pure_container : public Smob2 +{ +public: + static const char type_p_name_ []; + SCM unpure_part () const { return scm1 (); } + // A container that has the same callback for both 'pure' and 'unpure' lookups + // and which ignores the 'start' and 'end' columnns. + // Such a callback will give the same answer for tentative or final layouts. + bool is_unchanging () const { return SCM_UNBNDP (scm2 ()); } + SCM pure_part () const; + static SCM make_smob (SCM a, SCM b = SCM_UNDEFINED) + { + if (SCM_UNBNDP (b) && !ly_is_procedure (a)) + return Smob2::make_smob (a, a); + return Smob2::make_smob (a, b); + } + int print_smob (SCM, scm_print_state *); +}; #endif /* UNPURE_PURE_CONTAINER_HH */