X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=lily%2Fdispatcher.cc;h=856090fdb1e1167114ed0d98b960a40e7bece2c4;hb=42ae342ba877dc8f26cabb5cc3937a6d3cdb4066;hp=64062139b0d133ce598da861aefb9fc3b100ec96;hpb=3f8485925e8c879fe4c9ae86acef9804126c3b91;p=lilypond.git diff --git a/lily/dispatcher.cc b/lily/dispatcher.cc index 64062139b0..856090fdb1 100644 --- a/lily/dispatcher.cc +++ b/lily/dispatcher.cc @@ -1,9 +1,20 @@ /* - dispatcher.cc -- implement Dispatcher + This file is part of LilyPond, the GNU music typesetter. - source file of the GNU LilyPond music typesetter + Copyright (C) 2005--2011 Erik Sandberg - (c) 2005-2006 Erik Sandberg + LilyPond is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + LilyPond is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with LilyPond. If not, see . */ #include "dispatcher.hh" @@ -13,7 +24,7 @@ #include "warn.hh" IMPLEMENT_SMOBS (Dispatcher); -IMPLEMENT_TYPE_P (Dispatcher, "dispatcher"); +IMPLEMENT_TYPE_P (Dispatcher, "ly:dispatcher?"); IMPLEMENT_DEFAULT_EQUAL_P (Dispatcher); Dispatcher::~Dispatcher () @@ -68,7 +79,7 @@ Dispatcher::dispatch (SCM sev) SCM class_symbol = ev->get_property ("class"); if (!scm_symbol_p (class_symbol)) { - warning (_f ("Event class should be a symbol")); + warning (_ ("Event class should be a symbol")); return; } @@ -174,7 +185,7 @@ Dispatcher::internal_add_listener (Listener l, SCM ev_class, int priority) SCM list = scm_hashq_ref (listeners_, ev_class, SCM_EOL); if (!scm_is_pair (list)) { - /* Tell all dispatchers that we listen to, that we want to hear ev_class + /* Tell all dispatchers that we listen to, that we want to hear ev_class events */ for (SCM disp = dispatchers_; scm_is_pair (disp); disp = scm_cdr (disp)) { @@ -184,7 +195,7 @@ Dispatcher::internal_add_listener (Listener l, SCM ev_class, int priority) } listen_classes_ = scm_cons (ev_class, listen_classes_); } - SCM entry = scm_cons (scm_int2num (priority), l.smobbed_copy ()); + SCM entry = scm_cons (scm_from_int (priority), l.smobbed_copy ()); list = scm_merge (list, scm_list_1 (entry), ly_lily_module_constant ("car<")); scm_hashq_set_x (listeners_, ev_class, list); } @@ -244,7 +255,7 @@ Dispatcher::register_as_listener (Dispatcher *disp) return; } - dispatchers_ = scm_acons (disp->self_scm (), scm_int2num (priority), dispatchers_); + dispatchers_ = scm_acons (disp->self_scm (), scm_from_int (priority), dispatchers_); Listener list = GET_LISTENER (dispatch); for (SCM cl = listen_classes_; scm_is_pair (cl); cl = scm_cdr (cl))