Add libwx-perl
[pkg-perl] / deb-src / libwx-perl / libwx-perl-0.96 / ext / dnd / XS / DropTarget.xs
1 #############################################################################
2 ## Name:        ext/dnd/XS/DropTarget.xs
3 ## Purpose:     XS for Wx::*DropTarget
4 ## Author:      Mattia Barbon
5 ## Modified by:
6 ## Created:     16/08/2001
7 ## RCS-ID:      $Id: DropTarget.xs 2285 2007-11-11 21:31:54Z mbarbon $
8 ## Copyright:   (c) 2001-2002, 2004, 2006-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 <wx/dnd.h>
14 #include "cpp/droptarget.h"
15
16 MODULE=Wx PACKAGE=Wx::DropTarget
17
18 #!sub OnData
19
20 SV*
21 wxDropTarget::new( data = 0 )
22     wxDataObject* data
23   CODE:
24     wxPliDropTarget* retval = new wxPliDropTarget( CLASS, data );
25     RETVAL = newRV_noinc( SvRV( retval->m_callback.GetSelf() ) );
26     wxPli_thread_sv_register( aTHX_ "Wx::DropTarget", retval, RETVAL );
27   OUTPUT:
28     RETVAL
29
30 static void
31 wxDropTarget::CLONE()
32   CODE:
33     wxPli_thread_sv_clone( aTHX_ CLASS, (wxPliCloneSV)wxPli_detach_object );
34
35 ## // thread OK
36 void
37 DESTROY( THIS )
38     wxDropTarget* THIS
39   CODE:
40     wxPli_thread_sv_unregister( aTHX_ "Wx::DropTarget", THIS, ST(0) );
41     if( wxPli_object_is_deleteable( aTHX_ ST(0) ) )
42         delete THIS;
43   
44 void
45 wxDropTarget::GetData()
46
47 void
48 wxDropTarget::SetDataObject( data )
49     wxDataObject* data
50   CODE:
51     wxPli_object_set_deleteable( aTHX_ ST(1), false );
52     SvREFCNT_inc( SvRV( ST(1) ) ); // at this point the scalar must not go away
53     THIS->SetDataObject( data );
54
55 # callbacks
56
57 # wxDragResult
58 # wxDropTarget::OnData( x, y, def )
59 #     wxCoord x
60 #     wxCoord y
61 #     wxDragResult def
62 #   CODE:
63 #     RETVAL = THIS->wxDropTarget::OnData( x, y, def );
64 #   OUTPUT:
65 #     RETVAL
66
67 wxDragResult
68 wxDropTarget::OnEnter( x, y, def )
69     wxCoord x
70     wxCoord y
71     wxDragResult def
72   CODE:
73     RETVAL = THIS->wxDropTarget::OnEnter( x, y, def );
74   OUTPUT:
75     RETVAL
76
77 wxDragResult
78 wxDropTarget::OnDragOver( x, y, def )
79     wxCoord x
80     wxCoord y
81     wxDragResult def
82   CODE:
83     RETVAL = THIS->wxDropTarget::OnDragOver( x, y, def );
84   OUTPUT:
85     RETVAL
86
87 bool
88 wxDropTarget::OnDrop( x, y )
89     wxCoord x
90     wxCoord y
91   CODE:
92     RETVAL = THIS->wxDropTarget::OnDrop( x, y );
93   OUTPUT:
94     RETVAL
95
96 void
97 wxDropTarget::OnLeave()
98   CODE:
99     THIS->wxDropTarget::OnLeave();
100
101 MODULE=Wx PACKAGE=Wx::TextDropTarget
102
103 SV*
104 wxTextDropTarget::new()
105   CODE:
106     wxPliTextDropTarget* retval = new wxPliTextDropTarget( CLASS );
107     RETVAL = retval->m_callback.GetSelf();
108     SvREFCNT_inc( RETVAL );
109   OUTPUT:
110     RETVAL
111
112 #!sub OnDropText
113
114 MODULE=Wx PACKAGE=Wx::FileDropTarget
115
116 SV*
117 wxFileDropTarget::new()
118   CODE:
119     wxPliFileDropTarget* retval = new wxPliFileDropTarget( CLASS );
120     RETVAL = retval->m_callback.GetSelf();
121     SvREFCNT_inc( RETVAL );
122   OUTPUT:
123     RETVAL
124
125 #!sub OnDropFiles