Add libwx-perl
[pkg-perl] / deb-src / libwx-perl / libwx-perl-0.96 / ext / html / cpp / htmlwindow.h
1 /////////////////////////////////////////////////////////////////////////////
2 // Name:        ext/html/cpp/htmlwindow.h
3 // Purpose:     C++ wrapper for Wx::HtmlWindow
4 // Author:      Mattia Barbon
5 // Modified by:
6 // Created:     18/03/2001
7 // RCS-ID:      $Id: htmlwindow.h 2057 2007-06-18 23:03:00Z mbarbon $
8 // Copyright:   (c) 2001-2002, 2004, 2007 Mattia Barbon
9 // Licence:     This program is free software; you can redistribute it and/or
10 //              modify it under the same terms as Perl itself
11 /////////////////////////////////////////////////////////////////////////////
12
13 #include "cpp/v_cback.h"
14
15 class wxPliHtmlWindow:public wxHtmlWindow
16 {
17     WXPLI_DECLARE_DYNAMIC_CLASS( wxPliHtmlWindow );
18     WXPLI_DECLARE_V_CBACK();
19 public:
20     WXPLI_DEFAULT_CONSTRUCTOR( wxPliHtmlWindow, "Wx::HtmlWindow", true );
21
22     // this fixes the crashes, for some reason
23     wxPliHtmlWindow( const char* package, wxWindow* _arg1, wxWindowID _arg2,
24                      const wxPoint& _arg3, const wxSize& _arg4, long _arg5,
25                      const wxString& _arg6 )
26         : wxHtmlWindow( _arg1, _arg2, _arg3, _arg4, _arg5, _arg6 ),
27           m_callback( "Wx::HtmlWindow" )
28      {
29          m_callback.SetSelf( wxPli_make_object( this, package ), true );
30      }
31
32     void OnLinkClicked( const wxHtmlLinkInfo& info );
33     void OnSetTitle( const wxString& title );
34 };
35
36 void wxPliHtmlWindow::OnLinkClicked( const wxHtmlLinkInfo& info )
37 {
38     dTHX;
39     if( wxPliVirtualCallback_FindCallback( aTHX_ &m_callback,
40                                            "OnLinkClicked" ) )
41     {
42         wxPliVirtualCallback_CallCallback( aTHX_ &m_callback,
43                                            G_SCALAR|G_DISCARD, "o", &info,
44                                            "Wx::HtmlLinkInfo" );
45     } else
46         wxHtmlWindow::OnLinkClicked( info );
47 }
48
49 void wxPliHtmlWindow::OnSetTitle( const wxString& title )
50 {
51     dTHX;
52     if( wxPliVirtualCallback_FindCallback( aTHX_ &m_callback, "OnSetTitle" ) )
53     {
54         wxPliVirtualCallback_CallCallback( aTHX_ &m_callback,
55                                            G_SCALAR|G_DISCARD,
56                                            "P", &title );
57     } else
58         wxHtmlWindow::OnSetTitle( title );
59 }
60
61 WXPLI_IMPLEMENT_DYNAMIC_CLASS( wxPliHtmlWindow, wxHtmlWindow );
62
63 // Local variables: //
64 // mode: c++ //
65 // End: //