File: DocManager.xs

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 (457 lines) | stat: -rw-r--r-- 9,036 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
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
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
#############################################################################
## Name:        ext/docview/XS/DocManager.xs
## Purpose:     XS for wxDocument ( Document / View Framework )
## Author:      Simon Flack
## Modified by:
## Created:     11/09/2002
## RCS-ID:      $Id: DocManager.xs 2453 2008-08-31 11:09:40Z mbarbon $
## Copyright:   (c) 2002-2008 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 PACKAGE=Wx::DocManager

wxDocManager*
wxDocManager::new( flags = wxDEFAULT_DOCMAN_FLAGS, initialize = true )
    long flags
    bool initialize
  CODE:
    RETVAL=new wxPliDocManager(CLASS, flags, initialize);
  OUTPUT:
    RETVAL

bool
wxDocManager::Clear( force )
    bool force

bool
wxDocManager::Initialize()

wxFileHistory*
wxDocManager::OnCreateFileHistory()

wxFileHistory*
wxDocManager::GetFileHistory()

void
wxDocManager::SetMaxDocsOpen(n)
    int n

int
wxDocManager::GetMaxDocsOpen()

SV*
wxDocManager::GetDocuments()
  CODE:
    AV* arrDocs = wxPli_objlist_2_av( aTHX_ THIS->GetDocuments() );
    RETVAL = newRV_noinc( (SV*)arrDocs  );
  OUTPUT: RETVAL

SV*
wxDocManager::GetTemplates()
  CODE:
    AV* arrDocs = wxPli_objlist_2_av( aTHX_ THIS->GetTemplates() );
    RETVAL = newRV_noinc( (SV*)arrDocs  );
  OUTPUT: RETVAL

wxString
wxDocManager::GetLastDirectory()

void
wxDocManager::SetLastDirectory( dir )
    wxString dir

void
wxDocManager::OnFileClose( event )
    wxCommandEvent* event
  CODE:
    THIS->OnFileClose( *event );

void
wxDocManager::OnFileCloseAll( event )
    wxCommandEvent* event
  CODE:
    THIS->OnFileCloseAll( *event );

void
wxDocManager::OnFileNew( event )
    wxCommandEvent* event
  CODE:
    THIS->OnFileNew( *event );

void
wxDocManager::OnFileOpen( event )
    wxCommandEvent* event
  CODE:
    THIS->OnFileOpen( *event );

void
wxDocManager::OnFileRevert( event )
    wxCommandEvent* event
  CODE:
    THIS->OnFileRevert( *event );

void
wxDocManager::OnFileSave( event )
    wxCommandEvent* event
  CODE:
    THIS->OnFileSave( *event );

void
wxDocManager::OnFileSaveAs( event )
    wxCommandEvent* event
  CODE:
    THIS->OnFileSaveAs( *event );

void
wxDocManager::OnPrint( event )
    wxCommandEvent* event
  CODE:
    THIS->OnPrint( *event );

#if WXPERL_W_VERSION_LE( 2, 5, 2 )

void
wxDocManager::OnPrintSetup( event )
    wxCommandEvent* event
  CODE:
    THIS->OnPrintSetup( *event );

#endif

void
wxDocManager::OnPreview( event )
    wxCommandEvent* event
  CODE:
    THIS->OnPreview( *event );

void
wxDocManager::OnUndo( event )
    wxCommandEvent* event
  CODE:
    THIS->OnUndo( *event );

void
wxDocManager::OnRedo( event )
    wxCommandEvent* event
  CODE:
    THIS->OnRedo( *event );

void
wxDocManager::OnUpdateFileOpen( event )
    wxUpdateUIEvent* event
  CODE:
    THIS->OnUpdateFileOpen( *event );

#if WXPERL_W_VERSION_LT( 2, 9, 0 )

void
wxDocManager::OnUpdateFileClose( event )
    wxUpdateUIEvent* event
  CODE:
    THIS->OnUpdateFileClose( *event );

void
wxDocManager::OnUpdateFileRevert( event )
    wxUpdateUIEvent* event
  CODE:
    THIS->OnUpdateFileRevert( *event );

#endif

void
wxDocManager::OnUpdateFileNew( event )
    wxUpdateUIEvent* event
  CODE:
    THIS->OnUpdateFileNew( *event );

void
wxDocManager::OnUpdateFileSave( event )
    wxUpdateUIEvent* event
  CODE:
    THIS->OnUpdateFileSave( *event );

#if WXPERL_W_VERSION_LT( 2, 9, 0 )

void
wxDocManager::OnUpdateFileSaveAs( event )
    wxUpdateUIEvent* event
  CODE:
    THIS->OnUpdateFileSaveAs( *event );

#endif

void
wxDocManager::OnUpdateUndo( event )
    wxUpdateUIEvent* event
  CODE:
    THIS->OnUpdateUndo( *event );

void
wxDocManager::OnUpdateRedo( event )
    wxUpdateUIEvent* event
  CODE:
    THIS->OnUpdateRedo( *event );

#if WXPERL_W_VERSION_LT( 2, 9, 0 )

void
wxDocManager::OnUpdatePrint( event )
    wxUpdateUIEvent* event
  CODE:
    THIS->OnUpdatePrint( *event );

#endif

#if WXPERL_W_VERSION_LE( 2, 5, 2 )

void
wxDocManager::OnUpdatePrintSetup( event )
    wxUpdateUIEvent* event
  CODE:
    THIS->OnUpdatePrintSetup( *event );

#endif

#if WXPERL_W_VERSION_LT( 2, 9, 0 )

void
wxDocManager::OnUpdatePreview( event )
    wxUpdateUIEvent* event
  CODE:
    THIS->OnUpdatePreview( *event );

#endif

wxView *
wxDocManager::GetCurrentView()

wxDocument *
wxDocManager::CreateDocument( path, flags = 0 )
    wxString path
    long flags


wxView *
wxDocManager::CreateView( doc, flags = 0 )
    wxDocument* doc
    long flags

void
wxDocManager::DeleteTemplate( temp, flags = 0 )
    wxDocTemplate* temp
    long flags

bool
wxDocManager::FlushDoc( doc )
    wxDocument* doc

wxDocument *
wxDocManager::GetCurrentDocument()

#if WXPERL_W_VERSION_GE( 2, 9, 0 )

wxString
wxDocManager::MakeNewDocumentName()

#else

bool
wxDocManager::MakeDefaultName( name )
    wxString name

#endif

wxString
wxDocManager::MakeFrameTitle( doc )
    wxDocument* doc

wxDocTemplate *
wxDocManager::MatchTemplate( path )
    wxString path

void
wxDocManager::AddFileToHistory( file )
    wxString file

void
wxDocManager::RemoveFileFromHistory( i )
    int i


wxString
wxDocManager::GetHistoryFile( i )
    int i

void
wxDocManager::FileHistoryUseMenu( menu )
    wxMenu* menu

void
wxDocManager::FileHistoryRemoveMenu( menu )
    wxMenu* menu


#if wxUSE_CONFIG

## Need wxConfigBase& in typemap

void
wxDocManager::FileHistoryLoad( config )
    wxConfigBase* config
  C_ARGS: *config

void
wxDocManager::FileHistorySave( config )
    wxConfigBase* config
  C_ARGS: *config

#endif

void
wxDocManager::FileHistoryAddFilesToMenu( ... )
  CASE: items == 1
    CODE:
      THIS->FileHistoryAddFilesToMenu();
  CASE: items == 2
    INPUT:
      wxMenu* menu = NO_INIT
    CODE:
      THIS->FileHistoryAddFilesToMenu( menu );
  CASE:
    CODE:
      croak( "Usage: Wx::FileHistory::AddfilesToMenu(THIS [, menu ] )" );

#if WXPERL_W_VERSION_GE( 2, 5, 1 )

size_t
wxDocManager::GetHistoryFilesCount()

#else

int
wxDocManager::GetNoHistoryFiles()
        
#endif

wxDocTemplate *
wxDocManager::FindTemplateForPath( path )
    wxString path

wxDocTemplate *
wxDocManager::SelectDocumentPath( templates, noTemplates, path, flags, save = false)
    AV* templates
    int noTemplates
    wxString path
    long flags
    bool save
  PREINIT:
    int tmpl_n;
    int i;
    wxDocTemplate **pltemplates;
    wxDocTemplate *thistemplate;
  CODE:
    tmpl_n = av_len(templates) + 1;
    pltemplates = new wxDocTemplate *[ tmpl_n ];
    for(i = 0; i < tmpl_n; i++)
    {
      SV** pltemplate = av_fetch( (AV*) templates, i, 0 );
      wxDocTemplate* thistemplate = (wxDocTemplate *)
                      wxPli_sv_2_object( aTHX_ *pltemplate, "Wx::DocTemplate" );
      pltemplates[i] = thistemplate;
    }
    RETVAL = THIS->SelectDocumentPath(pltemplates, noTemplates, path, flags, save);
    delete[] pltemplates;
  OUTPUT:
    RETVAL

wxDocTemplate *
wxDocManager::SelectDocumentType( templates, noTemplates, sort = false)
    AV* templates
    int noTemplates
    bool sort
  PREINIT:
    int tmpl_n;
    int i;
    wxDocTemplate **pltemplates;
    wxDocTemplate *thistemplate;
  CODE:
    tmpl_n = av_len(templates) + 1;
    pltemplates = new wxDocTemplate *[ tmpl_n ];
    for(i = 0; i < tmpl_n; i++)
    {
      SV** pltemplate = av_fetch( (AV*) templates, i, 0 );
      wxDocTemplate* thistemplate = (wxDocTemplate *)
                      wxPli_sv_2_object( aTHX_ *pltemplate, "Wx::DocTemplate" );
      pltemplates[i] = thistemplate;
    }
    RETVAL = THIS->SelectDocumentType(pltemplates, noTemplates, sort);
    delete[] pltemplates;
  OUTPUT:
    RETVAL



wxDocTemplate *
wxDocManager::SelectViewType( templates, noTemplates, sort = false)
    AV* templates
    int noTemplates
    bool sort
  PREINIT:
    int tmpl_n;
    int i;
    wxDocTemplate **pltemplates;
    wxDocTemplate *thistemplate;
  CODE:
    tmpl_n = av_len(templates) + 1;
    pltemplates = new wxDocTemplate *[ tmpl_n ];
    for(i = 0; i < tmpl_n; i++)
    {
      SV** pltemplate = av_fetch( (AV*) templates, i, 0 );
      wxDocTemplate* thistemplate = (wxDocTemplate *)
                      wxPli_sv_2_object( aTHX_ *pltemplate, "Wx::DocTemplate" );
      pltemplates[i] = thistemplate;
    }
    RETVAL = THIS->SelectViewType(pltemplates, noTemplates, sort);
    delete[] pltemplates;
  OUTPUT:
    RETVAL

void
wxDocManager::AssociateTemplate( temp )
    wxDocTemplate* temp

void
wxDocManager::DisassociateTemplate( temp )
    wxDocTemplate* temp

void
wxDocManager::AddDocument( doc )
    wxDocument* doc

void
wxDocManager::RemoveDocument( doc )
    wxDocument* doc

bool
wxDocManager::CloseDocuments( force = true )
    bool force

#if WXPERL_W_VERSION_GE( 2, 5, 1 )

void
wxDocManager::ActivateView( view, activate = true )
    wxView* view
    bool activate

#else

void
wxDocManager::ActivateView( view, activate = true, deleting = false )
    wxView* view
    bool activate
    bool deleting

#endif