File: GridBagSizer.xsp

package info (click to toggle)
libwx-perl 1%3A0.9909-1
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 3,912 kB
  • sloc: cpp: 9,728; perl: 8,182; ansic: 626; makefile: 41
file content (262 lines) | stat: -rw-r--r-- 7,819 bytes parent folder | download | duplicates (6)
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
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
#############################################################################
## Name:        XS/GridBagSizer.xsp
## Purpose:     XS for Wx::GridBagSizer
## Author:      Mattia Barbon
## Modified by:
## Created:     310/11/2003
## RCS-ID:      $Id: GridBagSizer.xsp 2969 2010-08-28 11:25:37Z mbarbon $
## Copyright:   (c) 2003, 2005-2007, 2010 Mattia Barbon
## Licence:     This program is free software; you can redistribute it and/or
##              modify it under the same terms as Perl itself
#############################################################################

%module{Wx};

#if WXPERL_W_VERSION_GE( 2, 5, 1 )

#define wxPlDefaultSpan (wxGBSpan*)&wxDefaultSpan

#include <wx/gbsizer.h>

## DECLARE_OVERLOAD( wgbp, Wx::GBPosition )
## DECLARE_OVERLOAD( wgbs, Wx::GBSpan )
## DECLARE_OVERLOAD( wgbi, Wx::GBSizerItem )

%typemap{wxGridBagSizer *}{simple};
%typemap{wxGBPosition *}{simple};
%typemap{wxGBSpan *}{simple};
%typemap{wxGBSizerItem *}{simple};
%typemap{const wxGBSizerItem&}{reference};
%typemap{wxGBPosition}{reference};
%typemap{const wxGBPosition&}{reference};
%typemap{wxGBSpan}{reference};
%typemap{const wxGBSpan&}{reference};

%name{Wx::GBPosition} class wxGBPosition
{
    wxGBPosition(int row = 0, int col = 0);

    int GetRow() const;
    int GetCol() const;
    void SetRow(int row);
    void SetCol(int col);
    
##    bool operator==(const wxGBPosition& p) const;
##    bool operator!=(const wxGBPosition& p) const;
};

%name{Wx::GBSpan} class wxGBSpan
{
    wxGBSpan(int rowspan = 1, int colspan = 1);

    int GetRowspan() const;
    int GetColspan() const;
    void SetRowspan(int rowspan);
    void SetColspan(int colspan);
    
##    bool operator==(const wxGBSpan& o) const;
##    bool operator!=(const wxGBSpan& o) const;
};

%name{Wx::GBSizerItem} class wxGBSizerItem
{
    wxGBPosition GetPos() const;
%{
void
wxGBSizerItem::GetPosXY()
  PPCODE:
    int x, y;
    THIS->GetPos( x, y );
    wxPli_push_2ints( x, y );
%}

    wxGBSpan GetSpan() const;
%{
void
wxGBSizerItem::GetSpanWH()
  PPCODE:
    int x, y;
    THIS->GetSpan( x, y );
    wxPli_push_2ints( x, y );
%}

    bool SetPos( const wxGBPosition& pos );
    bool SetSpan( const wxGBSpan& span );
    %name{IntersectsItem}
    bool Intersects(const wxGBSizerItem& other);
    %name{IntersectsPosition}
    bool Intersects(const wxGBPosition& pos, const wxGBSpan& span);
%{
void
wxGBSizerItem::Intersects( ... )
  PPCODE:
    BEGIN_OVERLOAD()
        MATCH_REDISP( wxPliOvl_wgbi, IntersectsItem )
        MATCH_REDISP( wxPliOvl_wgbp_wgbs, IntersectsPosition )
    END_OVERLOAD( Wx::GridBagSizer::Intersects )
%}

%{
void
wxGBSizerItem::GetEndPos()
  PPCODE:
    int x, y;
    THIS->GetEndPos( x, y );
    wxPli_push_2ints( x, y );
%}
    wxGridBagSizer* GetGBSizer() const;
    void SetGBSizer(wxGridBagSizer* sizer);
};

%name{Wx::GridBagSizer} class wxGridBagSizer
{
    wxGridBagSizer(int vgap = 0, int hgap = 0 );

    %name{AddWindow}
    bool Add( wxWindow *window,
              const wxGBPosition& pos,
              const wxGBSpan& span = wxPlDefaultSpan,
              int flag = 0,
              int border = 0,
              wxObject* userData = NULL );
    %name{AddSizer}
    bool Add( wxSizer *sizer,
              const wxGBPosition& pos,
              const wxGBSpan& span = wxPlDefaultSpan,
              int flag = 0,
              int border = 0,
              wxObject* userData = NULL );
    %name{AddSpace}
    bool Add( int width,
              int height,
              const wxGBPosition& pos,
              const wxGBSpan& span = wxPlDefaultSpan,
              int flag = 0,
              int border = 0,
              wxObject* userData = NULL );
    %name{AddItem}
    bool Add( wxGBSizerItem *item );

    wxSize GetEmptyCellSize() const;
    void SetEmptyCellSize(const wxSize& sz);
    wxSize GetCellSize(int row, int col) const;
    
    %name{GetItemPositionWindow} 
    wxGBPosition GetItemPosition(wxWindow *window);
    %name{GetItemPositionSizer}
    wxGBPosition GetItemPosition(wxSizer *sizer);
    %name{GetItemPositionIndex}
    wxGBPosition GetItemPosition(size_t index);
%{
void
wxGridBagSizer::GetItemPosition( ... )
  PPCODE:
    BEGIN_OVERLOAD()
        MATCH_REDISP( wxPliOvl_wwin, GetItemPositionWindow )
        MATCH_REDISP( wxPliOvl_wszr, GetItemPositionSizer )
        MATCH_REDISP( wxPliOvl_n, GetItemPositionIndex )
    END_OVERLOAD( Wx::GridBagSizer::GetItemPosition )
%}

    %name{SetItemPositionWindow}
    bool SetItemPosition(wxWindow *window, const wxGBPosition& pos);
    %name{SetItemPositionSizer}
    bool SetItemPosition(wxSizer *sizer, const wxGBPosition& pos);
    %name{SetItemPositionIndex}
    bool SetItemPosition(size_t index, const wxGBPosition& pos);
%{
void
wxGridBagSizer::SetItemPosition( ... )
  PPCODE:
    BEGIN_OVERLOAD()
        MATCH_REDISP( wxPliOvl_wwin_wgbp, SetItemPositionWindow )
        MATCH_REDISP( wxPliOvl_wszr_wgbp, SetItemPositionSizer )
        MATCH_REDISP( wxPliOvl_n_wgbp, SetItemPositionIndex )
    END_OVERLOAD( Wx::GridBagSizer::SetItemPosition )
%}

    %name{GetItemSpanWindow}
    wxGBSpan GetItemSpan(wxWindow *window);
    %name{GetItemSpanSizer}
    wxGBSpan GetItemSpan(wxSizer *sizer);
    %name{GetItemSpanIndex}
    wxGBSpan GetItemSpan(size_t index);
%{
void
wxGridBagSizer::GetItemSpan( ... )
  PPCODE:
    BEGIN_OVERLOAD()
        MATCH_REDISP( wxPliOvl_wwin, GetItemSpanWindow )
        MATCH_REDISP( wxPliOvl_wszr, GetItemSpanSizer )
        MATCH_REDISP( wxPliOvl_n, GetItemSpanIndex )
    END_OVERLOAD( Wx::GridBagSizer::GetItemSpan )
%}

    %name{SetItemSpanWindow}
    bool SetItemSpan(wxWindow *window, const wxGBSpan& span);
    %name{SetItemSpanSizer}
    bool SetItemSpan(wxSizer *sizer, const wxGBSpan& span);
    %name{SetItemSpanIndex}
    bool SetItemSpan(size_t index, const wxGBSpan& span);
%{
void
wxGridBagSizer::SetItemSpan( ... )
  PPCODE:
    BEGIN_OVERLOAD()
        MATCH_REDISP( wxPliOvl_wwin_wgbs, SetItemSpanWindow )
        MATCH_REDISP( wxPliOvl_wszr_wgbs, SetItemSpanSizer )
        MATCH_REDISP( wxPliOvl_n_wgbs, SetItemSpanIndex )
    END_OVERLOAD( Wx::GridBagSizer::SetItemSpan )
%}

    %name{FindItemWindow}
    wxGBSizerItem* FindItem(wxWindow* window);
    %name{FindItemSizer}
    wxGBSizerItem* FindItem(wxSizer* sizer);
%{
void
wxGridBagSizer::FindItem( ... )
  PPCODE:
    BEGIN_OVERLOAD()
        MATCH_REDISP( wxPliOvl_wwin, FindItemWindow )
        MATCH_REDISP( wxPliOvl_wszr, FindItemSizer )
    END_OVERLOAD( Wx::GridBagSizer::FindItem )
%}

    wxGBSizerItem* FindItemAtPosition(const wxGBPosition& pos);
    wxGBSizerItem* FindItemAtPoint(const wxPoint& pt);
##    wxGBSizerItem* FindItemWithData(const wxObject* userData);

    %name{CheckForIntersectionItem}
    bool CheckForIntersection(wxGBSizerItem* item,
                              wxGBSizerItem* excludeItem = NULL);
    %name{CheckForIntersectionPos}
    bool CheckForIntersection(const wxGBPosition& pos, const wxGBSpan& span,
                              wxGBSizerItem* excludeItem = NULL);
%{
void
wxGridBagSizer::CheckForIntersection( ... )
  PPCODE:
    BEGIN_OVERLOAD()
        MATCH_REDISP_COUNT_ALLOWMORE( wxPliOvl_wgbi_wgbi, CheckForIntersectionItem, 1 )
        MATCH_REDISP_COUNT_ALLOWMORE( wxPliOvl_wgbp_wgbs_wgbi, CheckForIntersectionPos, 2 )
    END_OVERLOAD( Wx::GridBagSizer::CheckForIntersection )
%}

};

{%
MODULE=Wx PACKAGE=Wx::GridBagSizer

void
wxGridBagSizer::Add( ... )
  PPCODE:
    BEGIN_OVERLOAD()
        MATCH_REDISP_COUNT_ALLOWMORE( wxPliOvl_wwin_wgbp_wgbs_n_n_s, AddWindow, 1 )
        MATCH_REDISP_COUNT_ALLOWMORE( wxPliOvl_wszr_wgbp_wgbs_n_n_s, AddSizer, 1 )
        MATCH_REDISP_COUNT_ALLOWMORE( wxPliOvl_n_n_wgbp_wgbs_n_n_s, AddSpace, 2 )
        MATCH_REDISP_COUNT( wxPliOvl_wgbi, AddItem, 1 )
    END_OVERLOAD( Wx::GridBagSizer::Add )
%}

#endif