Add libwx-perl
[pkg-perl] / deb-src / libwx-perl / libwx-perl-0.96 / XS / Brush.xs
1 #############################################################################
2 ## Name:        XS/Brush.xs
3 ## Purpose:     XS for Wx::Brush
4 ## Author:      Mattia Barbon
5 ## Modified by:
6 ## Created:     08/11/2000
7 ## RCS-ID:      $Id: Brush.xs 2340 2008-03-25 22:25:07Z mbarbon $
8 ## Copyright:   (c) 2000-2004, 2006-2008 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/colour.h>
14 #include <wx/bitmap.h>
15 #include <wx/brush.h>
16 #include "cpp/overload.h"
17
18 MODULE=Wx PACKAGE=Wx::Brush
19
20 void
21 wxBrush::new( ... )
22   PPCODE:
23     BEGIN_OVERLOAD()
24         MATCH_REDISP( wxPliOvl_wbmp, newBitmap )
25         MATCH_REDISP( wxPliOvl_wcol_n, newColour )
26         MATCH_REDISP( wxPliOvl_s_n, newName )
27     END_OVERLOAD( Wx::Brush::new )
28
29 wxBrush*
30 newColour( CLASS, colour, style )
31     SV* CLASS
32     wxColour* colour
33     wxBrushStyle style
34   CODE:
35     RETVAL = new wxBrush( *colour, style );
36   OUTPUT:
37     RETVAL
38
39 wxBrush*
40 newName( CLASS, name, style )
41     SV* CLASS
42     wxString name
43     wxBrushStyle style
44   CODE:
45     RETVAL = new wxBrush( name, style );
46   OUTPUT:
47     RETVAL
48
49 wxBrush*
50 newBitmap( CLASS, stipple )
51     SV* CLASS
52     wxBitmap* stipple
53   CODE:
54     RETVAL = new wxBrush( *stipple );
55   OUTPUT:
56     RETVAL
57
58 static void
59 wxBrush::CLONE()
60   CODE:
61     wxPli_thread_sv_clone( aTHX_ CLASS, (wxPliCloneSV)wxPli_detach_object );
62
63 ## // thread OK
64 void
65 wxBrush::DESTROY()
66   CODE:
67     wxPli_thread_sv_unregister( aTHX_ "Wx::Brush", THIS, ST(0) );
68     delete THIS;
69
70 wxColour*
71 wxBrush::GetColour()
72   CODE:
73     RETVAL = new wxColour( THIS->GetColour() );
74   OUTPUT:
75     RETVAL
76
77 wxBitmap*
78 wxBrush::GetStipple()
79   CODE:
80     RETVAL = new wxBitmap( *THIS->GetStipple() );
81   OUTPUT:
82     RETVAL
83
84 wxBrushStyle
85 wxBrush::GetStyle()
86
87 bool
88 wxBrush::Ok()
89
90 #if WXPERL_W_VERSION_GE( 2, 8, 0 )
91
92 bool
93 wxBrush::IsOk()
94
95 #endif
96
97 #if WXPERL_W_VERSION_GE( 2, 6, 0 )
98
99 bool
100 wxBrush::IsHatch()
101
102 #endif
103
104 void
105 wxBrush::SetColour( ... )
106   PPCODE:
107     BEGIN_OVERLOAD()
108         MATCH_REDISP( wxPliOvl_n_n_n, SetColourRGB )
109         MATCH_REDISP( wxPliOvl_wcol, SetColourColour )
110         MATCH_REDISP( wxPliOvl_s, SetColourName )
111     END_OVERLOAD( Wx::Brush::SetColour )
112
113 void
114 wxBrush::SetColourColour( colour )
115     wxColour* colour
116   CODE:
117     THIS->SetColour( *colour );
118
119 void
120 wxBrush::SetColourName( name )
121     wxString name
122   CODE:
123     THIS->SetColour( name );
124
125 void
126 wxBrush::SetColourRGB( r, g, b )
127     int r
128     int g
129     int b
130   CODE:
131     THIS->SetColour( r, g, b );
132
133 void
134 wxBrush::SetStipple( stipple )
135     wxBitmap* stipple
136   CODE:
137     THIS->SetStipple( *stipple );
138
139 void
140 wxBrush::SetStyle( style )
141     wxBrushStyle style