Add libwx-perl
[pkg-perl] / deb-src / libwx-perl / libwx-perl-0.96 / ext / grid / Grid.xs
1 /////////////////////////////////////////////////////////////////////////////
2 // Name:        ext/grid/Grid.xs
3 // Purpose:     XS for Wx::Grid
4 // Author:      Mattia Barbon
5 // Modified by:
6 // Created:     04/12/2001
7 // RCS-ID:      $Id: Grid.xs 2610 2009-09-20 13:28:54Z mbarbon $
8 // Copyright:   (c) 2001-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 #define PERL_NO_GET_CONTEXT
14
15 #include "cpp/wxapi.h"
16
17 #undef THIS
18
19 #include <wx/control.h>
20 #include <wx/grid.h>
21 #include <wx/generic/gridctrl.h>
22
23 typedef wxGrid::wxGridSelectionModes wxGridSelectionModes;
24 typedef wxGridCellAttr::wxAttrKind wxAttrKind;
25
26 // event macros
27 #define SEVT( NAME, ARGS )    wxPli_StdEvent( NAME, ARGS )
28 #define EVT( NAME, ARGS, ID ) wxPli_Event( NAME, ARGS, ID )
29
30 // !package: Wx::Event
31 // !tag:
32 // !parser: sub { $_[0] =~ m<^\s*S?EVT\(\s*(\w+)\s*\,> }
33
34 static wxPliEventDescription evts[] =
35 {
36     EVT( EVT_GRID_CMD_CELL_LEFT_CLICK, 3, wxEVT_GRID_CELL_LEFT_CLICK )
37     EVT( EVT_GRID_CMD_CELL_RIGHT_CLICK, 3, wxEVT_GRID_CELL_RIGHT_CLICK )
38     EVT( EVT_GRID_CMD_CELL_LEFT_DCLICK, 3, wxEVT_GRID_CELL_LEFT_DCLICK )
39     EVT( EVT_GRID_CMD_CELL_RIGHT_DCLICK, 3, wxEVT_GRID_CELL_RIGHT_DCLICK )
40     EVT( EVT_GRID_CMD_LABEL_LEFT_CLICK, 3, wxEVT_GRID_LABEL_LEFT_CLICK )
41     EVT( EVT_GRID_CMD_LABEL_RIGHT_CLICK, 3, wxEVT_GRID_LABEL_RIGHT_CLICK )
42     EVT( EVT_GRID_CMD_LABEL_LEFT_DCLICK, 3, wxEVT_GRID_LABEL_LEFT_DCLICK )
43     EVT( EVT_GRID_CMD_LABEL_RIGHT_DCLICK, 3, wxEVT_GRID_LABEL_RIGHT_DCLICK )
44     EVT( EVT_GRID_CMD_ROW_SIZE, 3, wxEVT_GRID_ROW_SIZE )
45     EVT( EVT_GRID_CMD_COL_SIZE, 3, wxEVT_GRID_COL_SIZE )
46     EVT( EVT_GRID_CMD_RANGE_SELECT, 3, wxEVT_GRID_RANGE_SELECT )
47 #if WXPERL_W_VERSION_LT( 2, 9, 0 )
48     EVT( EVT_GRID_CMD_CELL_CHANGE, 3, wxEVT_GRID_CELL_CHANGE )
49 #endif
50     EVT( EVT_GRID_CMD_SELECT_CELL, 3, wxEVT_GRID_SELECT_CELL )
51     EVT( EVT_GRID_CMD_EDITOR_SHOWN, 3, wxEVT_GRID_EDITOR_SHOWN )
52     EVT( EVT_GRID_CMD_EDITOR_HIDDEN, 3, wxEVT_GRID_EDITOR_HIDDEN )
53     EVT( EVT_GRID_CMD_EDITOR_CREATED, 3, wxEVT_GRID_EDITOR_CREATED )
54     EVT( EVT_GRID_CMD_CELL_BEGIN_DRAG, 3, wxEVT_GRID_CELL_BEGIN_DRAG )
55     SEVT( EVT_GRID_CELL_LEFT_CLICK, 2 )
56     SEVT( EVT_GRID_CELL_RIGHT_CLICK, 2 )
57     SEVT( EVT_GRID_CELL_LEFT_DCLICK, 2 )
58     SEVT( EVT_GRID_CELL_RIGHT_DCLICK, 2 )
59     SEVT( EVT_GRID_LABEL_LEFT_CLICK, 2 )
60     SEVT( EVT_GRID_LABEL_RIGHT_CLICK, 2 )
61     SEVT( EVT_GRID_LABEL_LEFT_DCLICK, 2 )
62     SEVT( EVT_GRID_LABEL_RIGHT_DCLICK, 2 )
63     SEVT( EVT_GRID_ROW_SIZE, 2 )
64     SEVT( EVT_GRID_COL_SIZE, 2 )
65     SEVT( EVT_GRID_RANGE_SELECT, 2 )
66 #if WXPERL_W_VERSION_LT( 2, 9, 0 )
67     SEVT( EVT_GRID_CELL_CHANGE, 2 )
68 #endif
69     SEVT( EVT_GRID_SELECT_CELL, 2 )
70     SEVT( EVT_GRID_EDITOR_SHOWN, 2 )
71     SEVT( EVT_GRID_EDITOR_HIDDEN, 2 )
72     SEVT( EVT_GRID_EDITOR_CREATED, 2 )
73     SEVT( EVT_GRID_CELL_BEGIN_DRAG, 2 )
74     { 0, 0, 0 }
75 };
76
77 MODULE=Wx__Grid
78
79 BOOT:
80   INIT_PLI_HELPERS( wx_pli_helpers );
81
82 INCLUDE: XS/Grid.xs
83 INCLUDE: XS/GridCellAttr.xs
84 INCLUDE: XS/GridEvent.xs
85 INCLUDE: XS/GridCellRenderer.xs
86 INCLUDE: XS/GridCellEditor.xs
87
88 INCLUDE: perl -MExtUtils::XSpp::Cmd -e xspp -- -t ../../typemap.xsp XS/GridTable.xsp |
89
90 INCLUDE: perl -MExtUtils::XSpp::Cmd -e xspp -- -t ../../typemap.xsp XS/GridTableMessage.xsp |
91
92 MODULE=Wx__Grid PACKAGE=Wx::Grid
93
94 void
95 SetEvents()
96   CODE:
97     wxPli_set_events( evts );
98
99 #include "cpp/gr_constants.cpp"
100
101 #  //FIXME//tricky
102 #if defined(__WXMSW__)
103 #undef XS
104 #define XS( name ) WXXS( name )
105 #endif
106
107 MODULE=Wx__Grid