Add libwx-perl
[pkg-perl] / deb-src / libwx-perl / libwx-perl-0.96 / XS / Cursor.xs
1 #############################################################################
2 ## Name:        XS/Cursor.xs
3 ## Purpose:     XS for Wx::Cursor
4 ## Author:      Mattia Barbon
5 ## Modified by:
6 ## Created:     29/10/2000
7 ## RCS-ID:      $Id: Cursor.xs 2635 2009-10-20 19:17:01Z mbarbon $
8 ## Copyright:   (c) 2000-2004, 2006-2009 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/cursor.h>
14
15 MODULE=Wx PACKAGE=Wx::Cursor
16
17 void
18 wxCursor::new( ... )
19   PPCODE:
20     BEGIN_OVERLOAD()
21         MATCH_REDISP( wxPliOvl_n, newId )
22         MATCH_REDISP( wxPliOvl_wimg, newImage )
23         MATCH_REDISP_COUNT_ALLOWMORE( wxPliOvl_s_n_n_n, newFile, 2 )
24     END_OVERLOAD( Wx::Cursor::new )
25         
26 #if defined( __WXMSW__ ) || defined( __WXPERL_FORCE__ )
27
28 wxCursor*
29 newFile( CLASS, name, type, hsx = -1, hsy = -1 )
30     SV* CLASS
31     wxString name
32     wxBitmapType type
33     int hsx
34     int hsy
35   CODE:
36     RETVAL = new wxCursor( name, type, hsx, hsy );
37   OUTPUT:
38     RETVAL
39
40 #endif
41
42 wxCursor*
43 newId( CLASS, id )
44     SV* CLASS
45     wxStockCursor id
46   CODE:
47     RETVAL = new wxCursor( id );
48   OUTPUT:
49     RETVAL
50
51 #if !defined(__WXMAC__)
52
53 wxCursor*
54 newImage( CLASS, img )
55     SV* CLASS
56     wxImage* img
57   CODE:
58     RETVAL = new wxCursor( *img );
59   OUTPUT:
60     RETVAL
61
62 #endif
63
64 #if !defined( __WXGTK__ ) && !defined(__WXMAC__) \
65     && WXPERL_W_VERSION_LT( 2, 9, 0 )
66
67 wxCursor*
68 newData( CLASS, bits, width, height, hotSpotX = -1, hotSpotY = -1, maskBits = 0 )
69     SV* CLASS
70     SV* bits
71     int width
72     int height
73     int hotSpotX
74     int hotSpotY
75     SV* maskBits
76   PREINIT:
77     char* data = SvPV_nolen( bits );
78     char* mask = maskBits ? SvPV_nolen( maskBits ) : 0;
79   CODE:
80     RETVAL = new wxCursor( data, width, height, hotSpotX, hotSpotY, mask );
81   OUTPUT:
82     RETVAL
83
84 #endif
85
86 static void
87 wxCursor::CLONE()
88   CODE:
89     wxPli_thread_sv_clone( aTHX_ CLASS, (wxPliCloneSV)wxPli_detach_object );
90
91 ## // thread OK
92 void
93 wxCursor::DESTROY()
94   CODE:
95     wxPli_thread_sv_unregister( aTHX_ "Wx::Cursor", THIS, ST(0) );
96     delete THIS;
97
98 bool
99 wxCursor::Ok()
100
101 #if WXPERL_W_VERSION_GE( 2, 8, 0 )
102
103 bool
104 wxCursor::IsOk()
105
106 #endif