steve.cook...@sca-uk.com wrote:

  Hi,

Well I've wrapped the wxRichTextPrintout modules and they seem to work. Do you want to include them in the main wxPerl distribution? If so, how will you determine if the quality is OK and they are bug-free?

It depends. Apart from basic unit testing (which you added) I try to add a new wxDemo module, but it is not a requirement.

What is the process for migration if you are happy with the changes?

  If you could send me a patch that'd be great, just use

    svn diff > wxperl.patch

I should let you know at this stage that there are a few issues, which are probably more to do with wxWidgets than this wrap, for instance, GetDC inherited from wxPrintout, doesn't fail (so the inheritance is working), but appears to return null. Additionally, there seems to be insufficient functionality to make the wrap really useful - I'm hoping that this situation will improve if I wrap more stuff. However, it does seem to sort out some minor irritations, like being able to use the SetZoom method and wxNO_BORDER style on preview, which have been bugging me for a while.

It's OK if there is missing stuff, but please add a comment detailing what's missing.

I am going to cut and paste the changes to the foot of this email and you can have a think about what you would like to do. Please let me know what you think.

The changes look OK to me (apart from some minor nits). Please send them as a patch.

Thanks,
Mattia

CHANGES
>
ext/richtext/lib/Wx/RichText.pm

package Wx::RichTextPrintout;  @ISA = qw(Wx::Printout);

You should not need this, since you declared the base class in the XS++ file.

%typemap{wxRichTextPrintout*}{simple};
%typemap{int}{simple};

  The two above should not be necessary.

%typemap{wxDC*}{simple};
%typemap{wxRect&}{reference};

/home/steve/trunk/ext/richtext/t/03_threads.t - added the following:

my $rtp2 = Wx::RichTextPrintout->new;
$rtp2 -> GetDC();         # Inheritance
#$rtp2 -> SetRichTextBuffer(wxRichTextBuffer* buffer);
#$rtp2 -> SetHeaderFooterData(const wxRichTextHeaderFooterData& data) ;
$rtp2 -> SetMargins(254, 254, 254, 254);
#$rtp2 -> CalculateScaling(wxDC* dc, wxRect& textRect, wxRect& headerRect, wxRect& footerRect);
#$rtp2 -> OnPrintPage(int page);
$rtp2 -> HasPage(1);
#$rtp2 -> OnBeginDocument(int startPage, int endPage);
#$rtp2 -> OnPreparePrinting();
#$rtp2 -> GetRichTextBuffer();     # Member methods.
#$rtp2 -> GetHeaderFooterData(); # Member methods.
#$rtp2 -> OnPreparePrinting();     # Member methods.

The 03_thread.t test should only test the thread cloning behaviour; if you really want an API test, please add a new file, or better a new wxDemo module (or modify an existing one).


Reply via email to