Add libwx-perl
[pkg-perl] / deb-src / libwx-perl / libwx-perl-0.96 / XS / FontEnumerator.xs
1 #############################################################################
2 ## Name:        XS/FontEnumerator.xs
3 ## Purpose:     XS for Wx::FontEnumerator
4 ## Author:      Mattia Barbon
5 ## Modified by:
6 ## Created:     13/09/2002
7 ## RCS-ID:      $Id: FontEnumerator.xs 2274 2007-11-10 22:37:30Z mbarbon $
8 ## Copyright:   (c) 2002, 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/fontenum.h>
14
15 MODULE=Wx PACKAGE=Wx::FontEnumerator
16
17 wxFontEnumerator*
18 wxFontEnumerator::new()
19
20 static void
21 wxFontEnumerator::CLONE()
22   CODE:
23     wxPli_thread_sv_clone( aTHX_ CLASS, (wxPliCloneSV)wxPli_detach_object );
24
25 ## // thread OK
26 void
27 wxFontEnumerator::DESTROY()
28   CODE:
29     wxPli_thread_sv_unregister( aTHX_ "Wx::FontEnumerator", THIS, ST(0) );
30     delete THIS;
31
32 bool
33 wxFontEnumerator::EnumerateFacenames( encoding = wxFONTENCODING_SYSTEM, fixedWidth = false )
34     wxFontEncoding encoding
35     bool fixedWidth
36
37 bool
38 wxFontEnumerator::EnumerateEncodings( font = wxEmptyString )
39     wxString font
40
41 void
42 wxFontEnumerator::GetEncodings()
43   PREINIT:
44 #if WXPERL_W_VERSION_GE( 2, 7, 0 )
45     wxArrayString enc;
46 #else
47     wxArrayString* enc;
48 #endif
49   PPCODE:
50     enc = THIS->GetEncodings();
51 #if WXPERL_W_VERSION_LT( 2, 7, 0 )
52     if( enc )
53 #endif
54     {
55         PUTBACK;
56 #if WXPERL_W_VERSION_GE( 2, 7, 0 )
57         wxPli_stringarray_push( aTHX_ enc );
58 #else
59         wxPli_stringarray_push( aTHX_ *enc );
60 #endif
61         SPAGAIN;
62     }
63
64 void
65 wxFontEnumerator::GetFacenames()
66   PREINIT:
67 #if WXPERL_W_VERSION_GE( 2, 7, 0 )
68     wxArrayString enc;
69 #else
70     wxArrayString* enc;
71 #endif
72   PPCODE:
73     enc = THIS->GetFacenames();
74 #if WXPERL_W_VERSION_LT( 2, 7, 0 )
75     if( enc )
76 #endif
77     {
78         PUTBACK;
79 #if WXPERL_W_VERSION_GE( 2, 7, 0 )
80         wxPli_stringarray_push( aTHX_ enc );
81 #else
82         wxPli_stringarray_push( aTHX_ *enc );
83 #endif
84         SPAGAIN;
85     }
86
87 #if WXPERL_W_VERSION_GE( 2, 7, 2 )
88
89 bool
90 IsValidFacename( facename )
91     wxString facename
92   CODE:
93     RETVAL = wxFontEnumerator::IsValidFacename( facename );
94   OUTPUT: RETVAL
95
96 #endif