1 /////////////////////////////////////////////////////////////////////////////
2 // Name: ext/dnd/cpp/droptarget.h
3 // Purpose: c++ wrapper for wxPli*DropTarget
4 // Author: Mattia Barbon
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 /////////////////////////////////////////////////////////////////////////////
14 #include "cpp/v_cback.h"
16 class wxPliDropTarget:public wxDropTarget
18 WXPLI_DECLARE_V_CBACK();
20 wxPliDropTarget( const char* package, wxDataObject* data = 0 )
21 :wxDropTarget( data ),
22 m_callback( "Wx::DropTarget" )
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 );
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 );
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 );
47 class wxPliTextDropTarget:public wxTextDropTarget
49 WXPLI_DECLARE_V_CBACK();
51 wxPliTextDropTarget( const char* package )
53 m_callback( "Wx::TextDropTarget" )
56 SV* sv = wxPli_make_object( this, package );
57 wxPli_object_set_deleteable( aTHX_ sv, false );
58 m_callback.SetSelf( sv );
61 DEC_V_CBACK_BOOL__WXCOORD_WXCOORD_WXSTRING( OnDropText );
64 DEF_V_CBACK_BOOL__WXCOORD_WXCOORD_WXSTRING_pure( wxPliTextDropTarget, wxTextDropTarget, OnDropText );
66 class wxPliFileDropTarget:public wxFileDropTarget
68 WXPLI_DECLARE_V_CBACK();
70 wxPliFileDropTarget( const char* package )
72 m_callback( "Wx::FileDropTarget" )
75 SV* sv = wxPli_make_object( this, package );
76 wxPli_object_set_deleteable( aTHX_ sv, false );
77 m_callback.SetSelf( sv );
80 DEC_V_CBACK_BOOL__WXCOORD_WXCOORD_WXARRAYSTRING( OnDropFiles );
83 DEF_V_CBACK_BOOL__WXCOORD_WXCOORD_WXARRAYSTRING_pure( wxPliFileDropTarget, wxFileDropTarget, OnDropFiles );
85 // Local variables: //