/*
This file is part of LilyPond, the GNU music typesetter.
- Copyright (C) 1997--2014 Han-Wen Nienhuys <hanwen@xs4all.nl>
+ Copyright (C) 1997--2015 Han-Wen Nienhuys <hanwen@xs4all.nl>
LilyPond is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
#include "unpure-pure-container.hh"
#include "warn.hh"
-#include "ly-smobs.icc"
Grob *
Grob::clone () const
{
/* FIXME: default should be no callback. */
- self_scm_ = SCM_EOL;
layout_ = 0;
original_ = 0;
interfaces_ = SCM_EOL;
set_property ("X-extent", Grob::stencil_width_proc);
if (get_property_data ("Y-extent") == SCM_EOL)
set_property ("Y-extent",
- ly_make_unpure_pure_container (Grob::stencil_height_proc,
- Grob::pure_stencil_height_proc));
+ Unpure_pure_container::make_smob (Grob::stencil_height_proc,
+ Grob::pure_stencil_height_proc));
if (get_property_data ("vertical-skylines") == SCM_EOL)
set_property ("vertical-skylines",
- ly_make_unpure_pure_container (Grob::simple_vertical_skylines_from_extents_proc,
- Grob::pure_simple_vertical_skylines_from_extents_proc));
+ Unpure_pure_container::make_smob (Grob::simple_vertical_skylines_from_extents_proc,
+ Grob::pure_simple_vertical_skylines_from_extents_proc));
if (get_property_data ("horizontal-skylines") == SCM_EOL)
set_property ("horizontal-skylines",
- ly_make_unpure_pure_container (Grob::simple_horizontal_skylines_from_extents_proc,
- Grob::pure_simple_horizontal_skylines_from_extents_proc));
+ Unpure_pure_container::make_smob (Grob::simple_horizontal_skylines_from_extents_proc,
+ Grob::pure_simple_horizontal_skylines_from_extents_proc));
}
Grob::Grob (Grob const &s)
+ : Smob<Grob> ()
{
original_ = (Grob *) & s;
- self_scm_ = SCM_EOL;
immutable_property_alist_ = s.immutable_property_alist_;
mutable_property_alist_ = SCM_EOL;
UGH: can't fold next 2 statements together. Apparently GCC thinks
dim_cache_[a].offset_ is unaliased.
*/
- Real off = robust_scm2double (internal_get_property (sym), 0.0);
+ Real off = robust_scm2double (get_property (sym), 0.0);
if (me->dim_cache_[a].offset_)
{
*me->dim_cache_[a].offset_ += off;
/*
Order is significant: ?-extent may trigger suicide.
*/
- SCM ext_sym
- = (a == X_AXIS)
- ? ly_symbol2scm ("X-extent")
- : ly_symbol2scm ("Y-extent");
-
- SCM ext = internal_get_property (ext_sym);
+ SCM ext = (a == X_AXIS)
+ ? get_property ("X-extent")
+ : get_property ("Y-extent");
if (is_number_pair (ext))
real_ext.unite (ly_scm2interval (ext));
- SCM min_ext_sym
- = (a == X_AXIS)
- ? ly_symbol2scm ("minimum-X-extent")
- : ly_symbol2scm ("minimum-Y-extent");
- SCM min_ext = internal_get_property (min_ext_sym);
+ SCM min_ext = (a == X_AXIS)
+ ? get_property ("minimum-X-extent")
+ : get_property ("minimum-Y-extent");
if (is_number_pair (min_ext))
real_ext.unite (ly_scm2interval (min_ext));
cause = g->get_property ("cause");
/* ES TODO: cause can't be Music*/
- if (Music *m = unsmob_music (cause))
+ if (Music *m = Music::unsmob (cause))
m->origin ()->programming_error (s);
- else if (Stream_event *ev = unsmob_stream_event (cause))
+ else if (Stream_event *ev = Stream_event::unsmob (cause))
ev->origin ()->programming_error (s);
else
::programming_error (s);
cause = g->get_property ("cause");
/* ES TODO: cause can't be Music*/
- if (Music *m = unsmob_music (cause))
+ if (Music *m = Music::unsmob (cause))
m->origin ()->warning (s);
- else if (Stream_event *ev = unsmob_stream_event (cause))
+ else if (Stream_event *ev = Stream_event::unsmob (cause))
ev->origin ()->warning (s);
else
::warning (s);
Grob::pure_stencil_height (SCM smob, SCM /* beg */, SCM /* end */)
{
Grob *me = Grob::unsmob (smob);
- if (Stencil::unsmob (me->get_property_data ("stencil")))
+ if (Stencil::is_smob (me->get_property_data ("stencil")))
return grob_stencil_extent (me, Y_AXIS);
return ly_interval2scm (Interval ());