Hi,

On 22/03/2012 22:36, Steve Cookson wrote:
It uses Wx::XSP::Driver.pm, but I can only find Wx::Overload::Driver.pm
with your name and mugshot (hat and cigar included) where was the photo
taken? There is also build::Wx::XSP::Overload. That's quite a lot of
similar names.

Having my mugshot attached is a side effect of uploading the latest release to CPAN. So, having contributed a tiny fraction of the code, new folks sometimes assume I wrote it. Not much I can do about it other than correct the assumption when I come across it. But the POD and source code give correct attribution and having uploaded a release I should take responsibility for ensuring everything still works together.

Wx::XSP::Driver was replaced some time ago by the generic external module ExtUtils::XSpp.

As a brief background, when you write XS code, Perl uses ExtUtils::ParseXS to parse the code and turn it into C output suitable for input to your C compiler.

wxWidgets is a C++ toolkit. ExtUtils::XSpp provides XS++ or XS for C++. It does that as a thin layer over XS. That is to say, it pre-processes the C++ code and outputs XS code. This is then used like any other XS code (i.e parsed by ExtUtils::ParseXS ).

ExtUtils::XSpp has a plugin model, so in the Wx code below the build folder,

build::Wx::XSP::Enum
build::Wx::XSP::Event
build::Wx::XSP::Overload
build::Wx::XSP::Virtual

are all Wx specific plugins for ExtUtils::XSpp. They're not usable from outside of Wx build itself at the moment. I'd have to ask Mattia if that's intentional or just not implemented. They get installed as 'Wx::XSP::Enum' etc so would just need @Wx::XSP::Enum::ISA = qw( build::Wx::XSP::Enum ) to seemingly work but I may have missed something important.

I have had a quick look at the Wx::PdfDocument source and if all you had to do was accommodate ExtUtils::XSpp, then in PdfDocument.xs, you would change the line

INCLUDE: perl script/wx_xspp.pl -t typemap.xsp XS/PdfDocument.xsp |

to

INCLUDE_COMMAND: $^X -MExtUtils::XSpp::Cmd -e xspp -- -t typemap.xsp XS/PdfDocument.xsp

In the Wx source , the files

build/Wx/Overload/Driver.pm
build/Wx/Overload/Handle.pm

are a different set of beasties that are used to parse your source for DECLARE_OVERLOAD statements and write appropriate header files that then get included in your XS code. These handle the overload system for XS code.

build::Wx::XSP::Overload is an overload plugin for ExtUtils::XSpp. So one is for XS and the other for XS++.

(I should just point out that by 'overload' I'm referring to the C /C++ practice of overloading the same function name with several different versions accepting different parameters. At the C / C++ level this is fine as although the functions have the same name, their actual signatures are different. We have to do a bit of hoop jumping at the Perl glue level to accommodate overloaded calls from Perl code at the XS level - hence these modules.)


You will note in the Wx::PdfDocument source / POD that building Wx::PdfDocument has as a requirement - an installed version of wxPdfDocument :-)

So, my suggested route on this is

Alien::wxPdfDocument
 builds and installs wxPdfDocument using an installed Alien::wxWidgets

Wx::PdfDocument
 relies on Alien::wxPdfDocument

If you like, I would happily do a first wrap of this and then hand over to you to test, debug and fix the thing and perhaps build a Wx::Demo addin. I'd be able to respond to any bug fixes you require or change / add anything that real usage flags up. I don't have the spare time to actually learn how to use the thing at the moment so the hard work of weeding out problems would be down to you. I've been thinking that an updated Wx::PdfDocument would be really nice for some time so if I can offer a kick start by doing an initial wrap, then that would be great.

If you are interested then let me know. Also, if you feel you want to tackle this from scratch, then obviously please say so. I'm just offering to do a first wrap as the quickest way of showing how you might go about it.

The hat! - it was purchased on a working trip to Arizona a couple of years back. My hosts felt I needed that or some snake skin boots. I went with the hat. The hat box wouldn't fit through airport security, wouldn't fit in the overhead locker, wouldn't fit under the seat.

In the end I took the advice of the hat salesman ( who had determined my true ethnic origin and much of my life story from the shape of my head) and wore the hat. The photo was taken on return to UK as at that point I was quite attached to it. It all went sour when a Taxi (cab) driver asked me if I was going line dancing. His brother was a real enthusiast and got his hat from a supplier in Barnsley.

The hat has a new box now where it lives most of the time. It comes out from time to time to remind me of the happy visit or just to make my daughter's boyfriend nervous.

Cheers

Mark

























Reply via email to