[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Redesign listeners using templates (issue 235790043 by address@hidde
From: |
dak |
Subject: |
Re: Redesign listeners using templates (issue 235790043 by address@hidden) |
Date: |
Thu, 30 Apr 2015 19:14:37 +0000 |
Reviewers: benko.pal,
https://codereview.appspot.com/235790043/diff/1/lily/include/listener.hh
File lily/include/listener.hh (right):
https://codereview.appspot.com/235790043/diff/1/lily/include/listener.hh#newcode27
lily/include/listener.hh:27: register a method as an event handler in a
dispatcher, then you
On 2015/04/30 18:48:41, benko.pal wrote:
this whole comment is probably to be deleted; IIUC the my_listen
example below
replaces it.
Uhm. That's what happens if you convert the documentation along with
the actual code using sed scripts. The contained examples are pretty
much ok but no longer fit the description. I'll rework this comment.
Description:
Redesign listeners using templates
This is actually just a start since it does not touch most of the
infrastructure for translators.
Contains the following commits in reverse order:
Remove Scheme listeners as they are just callbacks now.
Reimplement Listener around generic SCM callback and instance
Run preparatory script replacing listener macros
This script is
for i in $(git grep -l 'IMPLEMENT_LISTENER (')
do
sed -i '/IMPLEMENT_LISTENER ([^)]*$/{N;s/\n\s*/ /}' $i
sedscript=$(git grep -h 'IMPLEMENT_LISTENER (' $i|
sed 's|^.*IMPLEMENT_LISTENER (\([^,]*\),
\([^)]*\)).*$|s/GET_LISTENER (\\([_a-z]\\+->\\)\\?\2)/\\1GET_LISTENER
(\1, \2)/|')
sed -i "$sedscript" $i
done
sed -i '/IMPLEMENT_LISTENER (/d' $(git grep -l 'IMPLEMENT_LISTENER (')
sed -i 's/DECLARE_LISTENER (\([^)]*\));\?/void \1 (SCM);/' $(git grep -l
'DECLARE_LISTENER (')
Make dispatchers callable for dispatching
Move self_scm_ into non-templated Smob_core base class.
Please review this at https://codereview.appspot.com/235790043/
Affected files (+245, -393 lines):
M lily/context.cc
M lily/dispatcher.cc
M lily/dispatcher-scheme.cc
M lily/engraver-group.cc
M lily/global-context.cc
M lily/grace-engraver.cc
M lily/include/context.hh
M lily/include/dispatcher.hh
M lily/include/engraver-group.hh
M lily/include/global-context.hh
M lily/include/listener.hh
D lily/include/scheme-listener.hh
M lily/include/score-engraver.hh
M lily/include/score-performer.hh
M lily/include/smobs.hh
M lily/include/translator.hh
M lily/include/translator.icc
M lily/include/translator-group.hh
M lily/listener.cc
M lily/lyric-combine-music-iterator.cc
M lily/midi-control-function-performer.cc
M lily/part-combine-iterator.cc
M lily/scheme-engraver.cc
D lily/scheme-listener.cc
D lily/scheme-listener-scheme.cc
M lily/score-engraver.cc
M lily/score-performer.cc
M lily/smobs.cc
M lily/translator-group.cc
M scm/part-combiner.scm
M scm/scheme-engravers.scm
- Re: Redesign listeners using templates (issue 235790043 by address@hidden),
dak <=