Add libwx-perl
[pkg-perl] / deb-src / libwx-perl / libwx-perl-0.96 / ext / dnd / cpp / droptarget.h
1 /////////////////////////////////////////////////////////////////////////////
2 // Name:        ext/dnd/cpp/droptarget.h
3 // Purpose:     c++ wrapper for wxPli*DropTarget
4 // Author:      Mattia Barbon
5 // Modified by:
6 // Created:     16/08/2001
7 // RCS-ID:      $Id: droptarget.h 2057 2007-06-18 23:03:00Z mbarbon $
8 // Copyright:   (c) 2001-2002, 2004 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 <wx/dnd.h>
14 #include "cpp/v_cback.h"
15
16 class wxPliDropTarget:public wxDropTarget
17 {
18     WXPLI_DECLARE_V_CBACK();
19 public:
20     wxPliDropTarget( const char* package, wxDataObject* data = 0 )
21         :wxDropTarget( data ),
22          m_callback( "Wx::DropTarget" )
23     {
24         dTHX;
25         // this is necessary because the SV returned to
26         // the perl program _is not_ this one!
27         // so _this_ SV must not delete the object,
28         // this is responsibility of the program's one!
29         SV* sv = wxPli_make_object( this, package );
30         wxPli_object_set_deleteable( aTHX_ sv, false );
31         m_callback.SetSelf( sv );
32     }
33
34     DEC_V_CBACK_WXDRAGRESULT__WXCOORD_WXCOORD_WXDRAGRESULT( OnData );
35     DEC_V_CBACK_BOOL__WXCOORD_WXCOORD( OnDrop );
36     DEC_V_CBACK_VOID__VOID( OnLeave );
37     DEC_V_CBACK_WXDRAGRESULT__WXCOORD_WXCOORD_WXDRAGRESULT( OnEnter );
38     DEC_V_CBACK_WXDRAGRESULT__WXCOORD_WXCOORD_WXDRAGRESULT( OnDragOver );
39 };
40
41 DEF_V_CBACK_WXDRAGRESULT__WXCOORD_WXCOORD_WXDRAGRESULT_pure( wxPliDropTarget, wxDropTarget, OnData );
42 DEF_V_CBACK_BOOL__WXCOORD_WXCOORD( wxPliDropTarget, wxDropTarget, OnDrop );
43 DEF_V_CBACK_VOID__VOID( wxPliDropTarget, wxDropTarget, OnLeave );
44 DEF_V_CBACK_WXDRAGRESULT__WXCOORD_WXCOORD_WXDRAGRESULT( wxPliDropTarget, wxDropTarget, OnEnter );
45 DEF_V_CBACK_WXDRAGRESULT__WXCOORD_WXCOORD_WXDRAGRESULT( wxPliDropTarget, wxDropTarget, OnDragOver );
46
47 class wxPliTextDropTarget:public wxTextDropTarget
48 {
49     WXPLI_DECLARE_V_CBACK();
50 public:
51     wxPliTextDropTarget( const char* package )
52         :wxTextDropTarget(),
53          m_callback( "Wx::TextDropTarget" )
54     {
55         dTHX;
56         SV* sv = wxPli_make_object( this, package );
57         wxPli_object_set_deleteable( aTHX_ sv, false );
58         m_callback.SetSelf( sv );
59     }
60
61     DEC_V_CBACK_BOOL__WXCOORD_WXCOORD_WXSTRING( OnDropText );
62 };
63
64 DEF_V_CBACK_BOOL__WXCOORD_WXCOORD_WXSTRING_pure( wxPliTextDropTarget, wxTextDropTarget, OnDropText );
65
66 class wxPliFileDropTarget:public wxFileDropTarget
67 {
68     WXPLI_DECLARE_V_CBACK();
69 public:
70     wxPliFileDropTarget( const char* package )
71         :wxFileDropTarget(),
72          m_callback( "Wx::FileDropTarget" )
73     {
74         dTHX;
75         SV* sv = wxPli_make_object( this, package );
76         wxPli_object_set_deleteable( aTHX_ sv, false );
77         m_callback.SetSelf( sv );
78     }
79
80     DEC_V_CBACK_BOOL__WXCOORD_WXCOORD_WXARRAYSTRING( OnDropFiles );
81 };
82
83 DEF_V_CBACK_BOOL__WXCOORD_WXCOORD_WXARRAYSTRING_pure( wxPliFileDropTarget, wxFileDropTarget, OnDropFiles );
84
85 // Local variables: //
86 // mode: c++ //
87 // End: //
88