1 | #!/usr/bin/perl |
1 | #!/usr/bin/perl |
2 | |
2 | |
3 | print <<EOF; |
3 | print <<EOF; |
4 | // THIS IS A GENERATED FILE, RUN callback.pl to regenerate it |
4 | // THIS IS A GENERATED FILE: RUN callback.pl to regenerate it |
5 | // THIS IS A GENERATED FILE, RUN callback.pl to regenerate it |
5 | // THIS IS A GENERATED FILE: callback.pl is part of the GVPE |
6 | // THIS IS A GENERATED FILE, RUN callback.pl to regenerate it |
6 | // THIS IS A GENERATED FILE: distribution. |
7 | // THIS IS A GENERATED FILE, RUN callback.pl to regenerate it |
|
|
8 | // THIS IS A GENERATED FILE, RUN callback.pl to regenerate it |
|
|
9 | // THIS IS A GENERATED FILE, RUN callback.pl to regenerate it |
|
|
10 | |
7 | |
11 | /* |
8 | /* |
12 | callback.h -- C++ callback mechanism |
9 | callback.h -- C++ callback mechanism |
13 | Copyright (C) 2003 Marc Lehmann <pcg\@goof.com> |
10 | Copyright (C) 2003-2005 Marc Lehmann <pcg\@goof.com> |
14 | |
11 | |
|
|
12 | This file is part of GVPE. |
|
|
13 | |
15 | This program is free software; you can redistribute it and/or modify |
14 | GVPE is free software; you can redistribute it and/or modify |
16 | it under the terms of the GNU General Public License as published by |
15 | it under the terms of the GNU General Public License as published by |
17 | the Free Software Foundation; either version 2 of the License, or |
16 | the Free Software Foundation; either version 2 of the License, or |
18 | (at your option) any later version. |
17 | (at your option) any later version. |
19 | |
18 | |
20 | This program is distributed in the hope that it will be useful, |
19 | This program is distributed in the hope that it will be useful, |
21 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
20 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
22 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
21 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
23 | GNU General Public License for more details. |
22 | GNU General Public License for more details. |
24 | |
23 | |
25 | You should have received a copy of the GNU General Public License |
24 | You should have received a copy of the GNU General Public License |
26 | along with this program; if not, write to the Free Software |
25 | along with gvpe; if not, write to the Free Software |
27 | Foundation, Inc. 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
26 | Foundation, Inc. 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA |
28 | */ |
27 | */ |
29 | |
28 | |
30 | #ifndef CALLBACK_H__ |
29 | #ifndef CALLBACK_H__ |
31 | #define CALLBACK_H__ |
30 | #define CALLBACK_H__ |
32 | |
31 | |
… | |
… | |
54 | }; |
53 | }; |
55 | template<class O1, class O2> |
54 | template<class O1, class O2> |
56 | struct proxy : proxy_base { |
55 | struct proxy : proxy_base { |
57 | virtual R call (void *obj, R (object::*meth)($TYPE)$_TYPEARG) |
56 | virtual R call (void *obj, R (object::*meth)($TYPE)$_TYPEARG) |
58 | { |
57 | { |
59 | ((reinterpret_cast<O1 *>(obj)) ->* (reinterpret_cast<R (O2::*)($TYPE)>(meth))) |
58 | return (R)((reinterpret_cast<O1 *>(obj)) ->* (reinterpret_cast<R (O2::*)($TYPE)>(meth))) |
60 | ($ARG); |
59 | ($ARG); |
61 | } |
60 | } |
62 | }; |
61 | }; |
63 | |
62 | |
64 | proxy_base *prxy; |
63 | proxy_base *prxy; |