Add libwx-perl
[pkg-perl] / deb-src / libwx-perl / libwx-perl-0.96 / ext / dnd / XS / DropSource.xs
1 #############################################################################
2 ## Name:        ext/dnd/XS/DropSource.xs
3 ## Purpose:     XS for Wx::DropSource
4 ## Author:      Mattia Barbon
5 ## Modified by:
6 ## Created:     16/08/2001
7 ## RCS-ID:      $Id: DropSource.xs 2285 2007-11-11 21:31:54Z mbarbon $
8 ## Copyright:   (c) 2001-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 <wx/dnd.h>
14 #include "cpp/dropsource.h"
15
16 MODULE=Wx PACKAGE=Wx::DropSource
17
18 #!sub GiveFeedback
19
20 #if defined( __WXMSW__ ) || defined( __WXMAC__ )
21
22 wxDropSource*
23 newCursorEmpty( CLASS, win = 0, cursorCopy = (wxCursor*)&wxNullCursor, cursorMove = (wxCursor*)&wxNullCursor, cursorStop = (wxCursor*)&wxNullCursor )
24     SV* CLASS 
25     wxWindow* win
26     wxCursor* cursorCopy
27     wxCursor* cursorMove
28     wxCursor* cursorStop
29   CODE:
30     RETVAL = new wxPliDropSource( wxPli_get_class( aTHX_ CLASS ), win,
31                                   *cursorCopy, *cursorMove,
32         *cursorStop );
33   OUTPUT:
34     RETVAL
35
36 wxDropSource*
37 newCursorData( CLASS, data, win = 0, cursorCopy = (wxCursor*)&wxNullCursor, cursorMove = (wxCursor*)&wxNullCursor, cursorStop = (wxCursor*)&wxNullCursor )
38     SV* CLASS
39     wxDataObject* data
40     wxWindow* win
41     wxCursor* cursorCopy
42     wxCursor* cursorMove
43     wxCursor* cursorStop
44   CODE:
45     RETVAL = new wxPliDropSource( wxPli_get_class( aTHX_ CLASS ), *data, win,
46                                   *cursorCopy, *cursorMove,
47         *cursorStop );
48   OUTPUT:
49     RETVAL
50
51 #else
52
53 wxDropSource*
54 newIconEmpty( CLASS, win = 0, iconCopy = (wxIcon*)&wxNullIcon, iconMove = (wxIcon*)&wxNullIcon, iconStop = (wxIcon*)&wxNullIcon )
55     SV* CLASS
56     wxWindow* win
57     wxIcon* iconCopy
58     wxIcon* iconMove
59     wxIcon* iconStop
60   CODE:
61     RETVAL = new wxPliDropSource( wxPli_get_class( aTHX_ CLASS ), win,
62                                   *iconCopy, *iconMove, *iconStop );
63   OUTPUT:
64     RETVAL
65
66 wxDropSource*
67 newIconData( CLASS, data, win = 0, iconCopy = (wxIcon*)&wxNullIcon, iconMove = (wxIcon*)&wxNullIcon, iconStop = (wxIcon*)&wxNullIcon )
68     SV* CLASS
69     wxDataObject* data
70     wxWindow* win
71     wxIcon* iconCopy
72     wxIcon* iconMove
73     wxIcon* iconStop
74   CODE:
75     RETVAL = new wxPliDropSource( wxPli_get_class( aTHX_ CLASS ), *data, win,
76                                   *iconCopy, *iconMove, *iconStop );
77   OUTPUT:
78     RETVAL
79
80 #endif
81
82 wxDragResult
83 wxDropSource::DoDragDrop( flags = wxDrag_CopyOnly )
84     int flags
85
86 void
87 wxDropSource::SetData( data )
88     wxDataObject* data
89   CODE:
90     THIS->SetData( *data );
91
92 wxDataObject*
93 wxDropSource::GetDataObject()
94   CODE:
95     RETVAL = THIS->GetDataObject();
96   OUTPUT:
97     RETVAL
98   CLEANUP:
99     wxPli_object_set_deleteable( aTHX_ ST(0), false );
100
101 void
102 wxDropSource::SetCursor( res, cursor )
103     wxDragResult res
104     wxCursor* cursor
105   CODE:
106     THIS->SetCursor( res, *cursor );