Add libwx-perl
[pkg-perl] / deb-src / libwx-perl / libwx-perl-0.96 / ext / socket / XS / SockAddress.xsp
1 #############################################################################
2 ## Name:        ext/socket/XS/SockAddress.xsp
3 ## Purpose:     XS++ for Wx::SockAddress and derived classes
4 ## Author:      Mattia Barbon
5 ## Created:     24/01/2004
6 ## RCS-ID:      $Id: SockAddress.xsp 2565 2009-05-17 13:34:37Z mbarbon $
7 ## Copyright:   (c) 2004, 2007, 2009 Mattia Barbon
8 ## Licence:     This program is free software; you can redistribute it and/or
9 ##              modify it under the same terms as Perl itself
10 #############################################################################
11
12 %module{Wx};
13
14 %typemap{wxSockAddress*}{simple};
15 %typemap{wxIPaddress*}{simple};
16 %typemap{wxIPV4address*}{simple};
17 %typemap{wxIPV6address*}{simple};
18 %typemap{wxUNIXaddress*}{simple};
19
20 %name{Wx::SockAddress} class wxSockAddress
21 {
22 %{
23 static void
24 wxSockAddress::CLONE()
25   CODE:
26     wxPli_thread_sv_clone( aTHX_ CLASS, (wxPliCloneSV)wxPli_detach_object );
27 %}
28     ## // thread OK
29     ~wxSockAddress()
30         %code{% wxPli_thread_sv_unregister( aTHX_ wxPli_get_class( aTHX_ ST(0) ), THIS, ST(0) );
31                 delete THIS;
32                 %};
33
34     void Clear();
35     int Type();
36 };
37
38 #if WXPERL_W_VERSION_GE( 2, 5, 1 )
39
40 %name{Wx::IPaddress} class wxIPaddress
41 {
42     %name{SetHostname} bool Hostname(const wxString& name);
43     %name{SetService} bool Service(const wxString& port);
44     bool IsLocalHost();
45
46     %name{SetAnyAddress} bool AnyAddress();
47     %name{GetIPAddress} wxString IPAddress();
48
49     %name{GetHostname} wxString Hostname();
50     %name{GetService} unsigned short Service();
51 };
52
53 #endif
54
55 %name{Wx::IPV4address} class wxIPV4address
56 {
57     wxIPV4address();
58
59     %name{GetOrigHostname} wxString OrigHostname();
60
61 #if WXPERL_W_VERSION_GE( 2, 9, 0 )
62     %name{SetBroadcastAddress} bool BroadcastAddress();
63 #endif
64 };
65
66 #if wxUSE_IPV6
67
68 %name{Wx::IPV6address} class wxIPV6address
69 {
70     wxIPV6address();
71 };
72
73 #endif
74
75 #ifdef __UNIX__
76
77 %name{Wx::UNIXaddress} class wxUNIXaddress
78 {
79     wxUNIXaddress();
80
81     %name{GetFilename} wxString Filename();
82     %name{SetFilename} void Filename(const wxString& filename);
83 };
84
85 #endif