File: Palette.xs

package info (click to toggle)
libwx-perl 0.9702-1
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 3,240 kB
  • ctags: 1,812
  • sloc: cpp: 8,988; perl: 6,366; makefile: 38; ansic: 1
file content (100 lines) | stat: -rwxr-xr-x 2,176 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
#############################################################################
## Name:        XS/Palette.xs
## Purpose:     XS for Wx::Palette
## Author:      Mattia Barbon
## Modified by:
## Created:     09/01/2000
## RCS-ID:      $Id: Palette.xs 2069 2007-07-08 15:33:40Z mbarbon $
## Copyright:   (c) 2001-2002, 2004, 2006-2007 Mattia Barbon
## Licence:     This program is free software; you can redistribute it and/or
##              modify it under the same terms as Perl itself
#############################################################################

#include <wx/palette.h>

MODULE=Wx PACKAGE=Wx::Palette

wxPalette*
wxPalette::new( r, g, b )
    SV* r
    SV* g
    SV* b
  PREINIT:
    unsigned char* red;
    unsigned char* green;
    unsigned char* blue;
    int rn, gn, bn;
  CODE:
    rn = wxPli_av_2_uchararray( aTHX_ r, &red );
    gn = wxPli_av_2_uchararray( aTHX_ g, &green );
    bn = wxPli_av_2_uchararray( aTHX_ b, &blue );

    if( rn != gn || gn != bn )
    {
      croak( "arrays must be of the same size" );
    }

    RETVAL = new wxPalette( rn, red, green, blue );

    delete[] red;
    delete[] green;
    delete[] blue;
  OUTPUT:
    RETVAL

static void
wxPalette::CLONE()
  CODE:
    wxPli_thread_sv_clone( aTHX_ CLASS, (wxPliCloneSV)wxPli_detach_object );

## // thread OK
void
wxPalette::DESTROY()
  CODE:
    wxPli_thread_sv_unregister( aTHX_ "Wx::Palette", THIS, ST(0) );
    delete THIS;

#if WXPERL_W_VERSION_GE( 2, 6, 1 )

int
wxPalette::GetColoursCount()

#endif

int
wxPalette::GetPixel( red, green, blue )
    unsigned char red
    unsigned char green
    unsigned char blue

void
wxPalette::GetRGB( pixel )
    int pixel
  PREINIT:
    unsigned char red, green, blue;
  PPCODE:
    if( THIS->GetRGB( pixel, &red, &green, &blue ) ) 
    {
      EXTEND( SP, 3 );
      PUSHs( sv_2mortal( newSVuv( red ) ) );
      PUSHs( sv_2mortal( newSVuv( green ) ) );
      PUSHs( sv_2mortal( newSVuv( blue ) ) ); 
    }
    else
    {
      EXTEND( SP, 3 );
      PUSHs( &PL_sv_undef );
      PUSHs( &PL_sv_undef );
      PUSHs( &PL_sv_undef );
    }

bool
wxPalette::Ok()

#if WXPERL_W_VERSION_GE( 2, 8, 0 )

bool
wxPalette::IsOk()

#endif