File: pseudodc.py

package info (click to toggle)
wxpython4.0 4.2.3%2Bdfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 221,752 kB
  • sloc: cpp: 962,555; python: 230,573; ansic: 170,731; makefile: 51,756; sh: 9,342; perl: 1,564; javascript: 584; php: 326; xml: 200
file content (687 lines) | stat: -rw-r--r-- 33,481 bytes parent folder | download | duplicates (2)
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
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
#---------------------------------------------------------------------------
# Name:        etg/pseudodc.py
# Author:      Robin Dunn
#
# Created:     26-Jul-2016
# Copyright:   (c) 2016-2020 by Total Control Software
# License:     wxWindows License
#---------------------------------------------------------------------------

import etgtools
import etgtools.tweaker_tools as tools
from etgtools.extractors import ClassDef, MethodDef, ParamDef


PACKAGE   = "wx"
MODULE    = "_adv"
NAME      = "pseudodc"   # Base name of the file to generate to for this script
DOCSTRING = ""

# The classes and/or the basename of the Doxygen XML files to be processed by
# this script.
ITEMS  = [ ]

OTHERDEPS = [ 'src/pseudodc.h',
              'src/pseudodc.cpp',
              ]

#---------------------------------------------------------------------------

def run():
    # Parse the XML file(s) building a collection of Extractor objects
    module = etgtools.ModuleDef(PACKAGE, MODULE, NAME, DOCSTRING)
    etgtools.parseDoxyXML(module, ITEMS)

    #-----------------------------------------------------------------
    # Tweak the parsed meta objects in the module object as needed for
    # customizing the generated code and docstrings.

    # The PseudoDC class is not in wxWidgets, so there is no Doxygen XML for
    # them. That means we'll have to construct the extractor objects here,
    # from scratch.

    module.addHeaderCode('#include "pseudodc.h"')
    module.includeCppCode('src/pseudodc.cpp')



    cls = ClassDef(name='wxPseudoDC', bases=['wxObject'],
        briefDoc="""\
            A PseudoDC is an object that can be used much like real
            :class:`wx.DC`, however it provides some additional features for
            object recording and manipulation beyond what a ``wx.DC`` can
            provide.

            All commands issued to the ``PseudoDC`` are stored in a list.  You
            can then play these commands back to a real DC object as often as
            needed, using the :meth:`DrawToDC` method or one of the similar
            methods.  Commands in the command list can be tagged by an ID. You
            can use this ID to clear the operations associated with a single
            ID, redraw the objects associated with that ID, grey them, adjust
            their position, etc.
            """,
        items=[
            # ----------------------------------------------
            # Constructor and Destructor

            MethodDef(name='wxPseudoDC', isCtor=True, items=[],
                briefDoc="""\
                    Constructs a new Pseudo device context for recording and
                    replaying DC operations."""),

            MethodDef(name='~wxPseudoDC', isDtor=True),


            # ----------------------------------------------
            # PseudoDC-specific functionality

            MethodDef(type='void', name='RemoveAll', items=[],
                briefDoc="Removes all objects and operations from the recorded list."),

            MethodDef(type='int', name='GetLen', items=[],
                briefDoc="Returns the number of operations in the recorded list."),

            MethodDef(type='void', name='SetId',
                items=[ParamDef(type='int', name='id')],
                briefDoc="Sets the id to be associated with subsequent operations."),

            MethodDef(type='void', name='ClearId',
                items=[ParamDef(type='int', name='id')],
                briefDoc="Removes all operations associated with id so the object can be redrawn."),

            MethodDef(type='void', name='RemoveId',
                items=[ParamDef(type='int', name='id')],
                briefDoc="Remove the object node (and all operations) associated with an id."),

            MethodDef(type='void', name='TranslateId',
                items=[ParamDef(type='int', name='id'),
                       ParamDef(type='wxCoord', name='dx'),
                       ParamDef(type='wxCoord', name='dy'),
                       ],
                briefDoc="Translate the position of the operations of tag `id` by (`dx`, `dy`)."),

            MethodDef(type='void', name='SetIdGreyedOut',
                items=[ParamDef(type='int', name='id'),
                       ParamDef(type='bool', name='greyout'),
                       ],
                briefDoc="Set whether the set of objects with tag `id` are drawn greyed out or not."),

            MethodDef(type='bool', name='GetIdGreyedOut',
                items=[ParamDef(type='int', name='id')],
                briefDoc="Get whether the set of objects with tag `id` are drawn greyed out or not."),


            MethodDef(type='PyObject*', name='FindObjects',
                items=[ ParamDef(type='wxCoord', name='x'),
                        ParamDef(type='wxCoord', name='y'),
                        ParamDef(type='wxCoord', name='radius', default='1'),
                        ParamDef(type='const wxColour &', name='bg', default='*wxWHITE'),
                        ],
                briefDoc="""\
                    Returns a list of all the id's that draw a pixel with
                    color not equal to bg within radius of (x,y). Returns an
                    empty list if nothing is found.  The list is in reverse
                    drawing order so list[0] is the top id."""),


            MethodDef(type='PyObject*', name='FindObjectsByBBox',
                items=[ ParamDef(type='wxCoord', name='x'),
                        ParamDef(type='wxCoord', name='y')],
                briefDoc="""\
                    Returns a list of all the id's whose bounding boxes include (x,y).
                    Returns an empty list if nothing is found.  The list is in
                    reverse drawing order so list[0] is the top id."""),


            MethodDef(type='void', name='DrawIdToDC',
                items=[ ParamDef(type='int', name='id'),
                        ParamDef(type='wxDC *', name='dc')],
                briefDoc="Draw recorded operations tagged with id to dc."),


            MethodDef(type='void', name='SetIdBounds',
                items=[ ParamDef(type='int', name='id'),
                        ParamDef(type='wxRect &', name='rect')],
                briefDoc="""\
                    Set the bounding rect of a given object.
                    This will create an object node if one doesn't exist."""),


            MethodDef(type='wxRect', name='GetIdBounds',
                items=[ParamDef(type='int', name='id')],
                briefDoc="""\
                    Returns the bounding rectangle previously set with `SetIdBounds`.
                    If no bounds have been set, it returns wx.Rect(0,0,0,0)."""),


            MethodDef(type='void', name='DrawToDCClipped',
                items=[ ParamDef(type='wxDC *', name='dc'),
                        ParamDef(type='const wxRect &', name='rect')],
                briefDoc="""\
                    Draws the recorded operations to dc,
                    unless the operation is known to be outside of rect."""),

            MethodDef(type='void', name='DrawToDCClippedRgn',
                      items=[ParamDef(type='wxDC *', name='dc'),
                             ParamDef(type='const wxRegion &', name='region')],
                      briefDoc="""\
                    Draws the recorded operations to dc,
                    unless the operation is known to be outside the given region."""),

            MethodDef(type='void', name='DrawToDC',
                      items=[ParamDef(type='wxDC *', name='dc')],
                      briefDoc="Draws the recorded operations to dc."),


            #----------------------------------------------
            # Methods which mirror the wxDC API


            MethodDef(type='void', name='FloodFill',
                items=[ ParamDef(type='wxCoord', name='x'),
                        ParamDef(type='wxCoord', name='y'),
                        ParamDef(type='const wxColour &', name='col'),
                        ParamDef(type='wxFloodFillStyle', name='style', default='wxFLOOD_SURFACE')],
                briefDoc="""\
                    Flood fills the device context starting from the given point,
                    using the current brush colour, and using a style:

                        - ``wx.FLOOD_SURFACE``: the flooding occurs until a colour other than the given colour is encountered.

                        - ``wx.FLOOD_BORDER``: the area to be flooded is bounded by the given colour.
                    """,
                overloads=[
                    MethodDef(type='void', name='FloodFill',
                        items=[ ParamDef(type='const wxPoint &', name='pt'),
                                ParamDef(type='const wxColour &', name='col'),
                                ParamDef(type='wxFloodFillStyle', name='style', default='wxFLOOD_SURFACE')]),
                ]),


            MethodDef(type='void', name='DrawLine',
                items=[ ParamDef(type='wxCoord', name='x1'),
                        ParamDef(type='wxCoord', name='y1'),
                        ParamDef(type='wxCoord', name='x2'),
                        ParamDef(type='wxCoord', name='y2')],
                briefDoc="""\
                    Draws a line from the first point to the second.
                    The current pen is used for drawing the line. Note that
                    the second point is *not* part of the line and is not
                    drawn by this function (this is consistent with the
                    behaviour of many other toolkits).
                    """,
                overloads=[
                    MethodDef(type='void', name='DrawLine',
                        items=[ ParamDef(type='const wxPoint &', name='pt1'),
                                ParamDef(type='const wxPoint &', name='pt2')])
                ]),

            MethodDef(type='void', name='CrossHair',
                items=[ ParamDef(type='wxCoord', name='x'),
                        ParamDef(type='wxCoord', name='y')],
                briefDoc="""\
                    Displays a cross hair using the current pen. This is a
                    vertical and horizontal line the height and width of the
                    window, centred on the given point.""",
                overloads=[
                    MethodDef(type='void', name='CrossHair',
                        items=[ ParamDef(type='const wxPoint &', name='pt') ])
                ]),


            MethodDef(type='void', name='DrawArc',
                items=[ ParamDef(type='wxCoord', name='x1'),
                        ParamDef(type='wxCoord', name='y1'),
                        ParamDef(type='wxCoord', name='x2'),
                        ParamDef(type='wxCoord', name='y2'),
                        ParamDef(type='wxCoord', name='xc'),
                        ParamDef(type='wxCoord', name='yc'),],
                briefDoc="""\
                    Draws an arc of a circle, centred on the *center* point
                    (xc, yc), from the first point to the second. The current
                    pen is used for the outline and the current brush for
                    filling the shape.

                    The arc is drawn in an anticlockwise direction from the
                    start point to the end point.
                    """,
                overload=[
                    MethodDef(type='void', name='DrawArc',
                              items=[ParamDef(type='wxCoord', name='x1'),
                                     ParamDef(type='wxCoord', name='xc'),
                                     ParamDef(type='wxCoord', name='yc'), ]),
                    ]),


            MethodDef(type='void', name='DrawCheckMark',
                items=[ ParamDef(type='wxCoord', name='x'),
                        ParamDef(type='wxCoord', name='y'),
                        ParamDef(type='wxCoord', name='width'),
                        ParamDef(type='wxCoord', name='height')],
                briefDoc="Draws a check mark inside the given rectangle",
                overloads=[
                    MethodDef(type='void', name='DrawCheckMark',
                        items=[ ParamDef(type='const wxRect &', name='rect') ])
                    ]),


            MethodDef(type='void', name='DrawEllipticArc',
                items=[ ParamDef(type='wxCoord', name='x'),
                        ParamDef(type='wxCoord', name='y'),
                        ParamDef(type='wxCoord', name='w'),
                        ParamDef(type='wxCoord', name='h'),
                        ParamDef(type='double', name='start'),
                        ParamDef(type='double', name='end')],
                briefDoc="""\
                    Draws an arc of an ellipse, with the given rectangle
                    defining the bounds of the ellipse. The current pen is
                    used for drawing the arc and the current brush is used for
                    drawing the pie.

                    The *start* and *end* parameters specify the start and end
                    of the arc relative to the three-o'clock position from the
                    center of the rectangle. Angles are specified in degrees
                    (360 is a complete circle). Positive values mean
                    counter-clockwise motion. If start is equal to end, a
                    complete ellipse will be drawn.""",
                overloads=[
                    MethodDef(type='void', name='DrawEllipticArc',
                        items=[ ParamDef(type='const wxPoint &', name='pt'),
                                ParamDef(type='const wxSize &', name='sz'),
                                ParamDef(type='double', name='start'),
                                ParamDef(type='double', name='end')])
                    ]),


            MethodDef(type='void', name='DrawPoint',
                items=[ParamDef(type='wxCoord', name='x'),
                       ParamDef(type='wxCoord', name='y')],
                briefDoc="Draws a point using the current pen.",
                overloads=[
                    MethodDef(type='void', name='DrawPoint',
                        items=[ParamDef(type='const wxPoint &', name='pt') ])
                ]),


            MethodDef(type='void', name='DrawRectangle',
                items=[ ParamDef(type='wxCoord', name='x'),
                        ParamDef(type='wxCoord', name='y'),
                        ParamDef(type='wxCoord', name='width'),
                        ParamDef(type='wxCoord', name='height') ],
                briefDoc="""\
                    Draws a rectangle with the given top left corner, and with
                    the given size. The current pen is used for the outline
                    and the current brush for filling the shape.
                    """,
                overloads=[
                    MethodDef(type='void', name='DrawRectangle',
                        items=[ ParamDef(type='const wxRect &', name='rect') ]),
                    MethodDef(type='void', name='DrawRectangle',
                        items=[ ParamDef(type='const wxPoint &', name='pt'),
                                ParamDef(type='const wxSize &', name='sz') ])
                ]),




            MethodDef(type='void', name='DrawRoundedRectangle',
                items=[ ParamDef(type='wxCoord', name='x'),
                        ParamDef(type='wxCoord', name='y'),
                        ParamDef(type='wxCoord', name='width'),
                        ParamDef(type='wxCoord', name='height'),
                        ParamDef(type='double', name='radius')],
                briefDoc="""\
                    Draws a rectangle with the given top left corner, and with
                    the given size. The current pen is used for the outline
                    and the current brush for filling the shape.
                    """,
                overloads=[
                    MethodDef(type='void', name='DrawRoundedRectangle',
                        items=[ ParamDef(type='const wxRect &', name='rect'),
                                ParamDef(type='double', name='radius') ]),
                    MethodDef(type='void', name='DrawRoundedRectangle',
                        items=[ ParamDef(type='const wxPoint &', name='pt'),
                                ParamDef(type='const wxSize &', name='sz'),
                                ParamDef(type='double', name='radius') ])
                ]),


            MethodDef(type='void', name='DrawCircle',
                items=[ ParamDef(type='wxCoord', name='x'),
                        ParamDef(type='wxCoord', name='y'),
                        ParamDef(type='wxCoord', name='radius'),],
                briefDoc="""\
                    Draws a circle with the given center point and radius.
                    The current pen is used for the outline and the current
                    brush for filling the shape.

                    :see: `DrawEllipse`
                    """,
                overloads=[
                    MethodDef(type='void', name='DrawCircle',
                        items=[ ParamDef(type='const wxPoint &', name='pt'),
                                ParamDef(type='wxCoord', name='radius') ]),
                    ]),


            MethodDef(type='void', name='DrawEllipse',
                items=[ ParamDef(type='wxCoord', name='x'),
                        ParamDef(type='wxCoord', name='y'),
                        ParamDef(type='wxCoord', name='width'),
                        ParamDef(type='wxCoord', name='height')],
                briefDoc="""\
                    Draws an ellipse contained in the specified rectangle. The current pen
                    is used for the outline and the current brush for filling the shape.", "

                    :see: `DrawCircle`
                    """,
                overloads=[
                    MethodDef(type='void', name='DrawEllipse',
                        items=[ ParamDef(type='const wxRect &', name='rect') ]),
                    MethodDef(type='void', name='DrawEllipse',
                        items=[ ParamDef(type='const wxPoint &', name='pt'),
                                ParamDef(type='const wxSize &', name='sz') ])
                ]),


            MethodDef(type='void', name='DrawIcon',
                items=[ ParamDef(type='const wxIcon &', name='icon'),
                        ParamDef(type='wxCoord', name='x'),
                        ParamDef(type='wxCoord', name='y')
                        ],
                briefDoc="Draw an icon on the display at the given position.",
                overloads=[
                    MethodDef(type='void', name='DrawIcon',
                              items=[ ParamDef(type='const wxIcon &', name='icon'),
                                      ParamDef(type='const wxPoint &', name='pt') ])
                                     ]),


            MethodDef(type='void', name='DrawBitmap',
                items=[ ParamDef(type='const wxBitmap &', name='bmp'),
                        ParamDef(type='wxCoord', name='x'),
                        ParamDef(type='wxCoord', name='y'),
                        ParamDef(type='bool', name='useMask', default='false') ],
                briefDoc="""\
                    Draw a bitmap on the device context at the specified
                    point. If *useMask* is true and the bitmap has a
                    transparency mask, (or alpha channel on the platforms that
                    support it) then the bitmap will be drawn transparently.

                    When drawing a mono-bitmap, the current text foreground
                    colour will be used to draw the foreground of the bitmap
                    (all bits set to 1), and the current text background
                    colour to draw the background (all bits set to 0).

                    :see: `SetTextForeground`, `SetTextBackground` and `wx.MemoryDC`
                    """,
                overloads=[
                    MethodDef(type='void', name='DrawBitmap',
                        items=[ ParamDef(type='const wxBitmap &', name='bmp'),
                                ParamDef(type='const wxPoint &', name='pt'),
                                ParamDef(type='bool', name='useMask', default='false') ])
                    ]),


            MethodDef(type='void', name='DrawText',
                items=[ ParamDef(type='const wxString &', name='text'),
                        ParamDef(type='wxCoord', name='x'),
                        ParamDef(type='wxCoord', name='y') ],
                briefDoc="""\
                    Draws a text string at the specified point, using the
                    current text font, and the current text foreground and
                    background colours.

                    The coordinates refer to the top-left corner of the
                    rectangle bounding the string. See `wx.DC.GetTextExtent`
                    for how to get the dimensions of a text string, which can
                    be used to position the text more precisely, (you will
                    need to use a real DC with GetTextExtent as wx.PseudoDC
                    does not implement it.)

                    **NOTE**: under wxGTK the current logical function is used
                    *by this function but it is ignored by wxMSW. Thus, you
                    *should avoid using logical functions with this function
                    *in portable programs.", "

                    :see: `DrawRotatedText`
                    """,
                overloads=[
                    MethodDef(type='void', name='DrawText',
                        items=[ ParamDef(type='const wxString &', name='text'),
                                ParamDef(type='const wxPoint &', name='pt') ])
                    ]),


            MethodDef(type='void', name='DrawRotatedText',
                items=[ ParamDef(type='const wxString &', name='text'),
                        ParamDef(type='wxCoord', name='x'),
                        ParamDef(type='wxCoord', name='y'),
                        ParamDef(type='double', name='angle') ],
                briefDoc="Draws the text rotated by *angle* degrees, if supported by the platform.",
                overloads=[
                    MethodDef(type='void', name='DrawRotatedText',
                        items=[ ParamDef(type='const wxString &', name='text'),
                                ParamDef(type='const wxPoint &', name='pt'),
                                ParamDef(type='double', name='angle') ])
                    ]),


            MethodDef(type='void', name='DrawLabel',
                items=[ ParamDef(type='const wxString &', name='text'),
                        ParamDef(type='const wxRect &', name='rect'),
                        ParamDef(type='int', name='alignment', default='wxALIGN_LEFT|wxALIGN_TOP'),
                        ParamDef(type='int', name='indexAccel', default='-1'),
                        ],
                briefDoc="""\
                    Draw *text* within the specified rectangle, abiding by the
                    alignment flags.  Will additionally emphasize the
                    character at *indexAccel* if it is not -1.
                    """,
                overloads=[
                    MethodDef(type='void', name='DrawLabel',
                    items=[ ParamDef(type='const wxString &', name='text'),
                            ParamDef(type='const wxBitmap &', name='image'),
                            ParamDef(type='const wxRect &', name='rect'),
                            ParamDef(type='int', name='alignment', default='wxALIGN_LEFT|wxALIGN_TOP'),
                            ParamDef(type='int', name='indexAccel', default='-1'),
                            ],
                briefDoc="""\
                    Draw *text* and an image (which may be ``wx.NullBitmap`` to skip
                    drawing it) within the specified rectangle, abiding by the alignment
                    flags.  Will additionally emphasize the character at *indexAccel* if
                    it is not -1.
                    """)]
                ),



            MethodDef(type='void', name='Clear',
                items=[],
                briefDoc="Clears the device context using the current background brush.",
                overloads=[]),


            MethodDef(type='void', name='SetFont',
                items=[ ParamDef(type='const wxFont &', name='font') ],
                briefDoc="""\
                    Sets the current font for the DC. It must be a valid font, in
                    particular you should not pass ``wx.NullFont`` to this method.

                    :see: `wx.Font`
                    """,
                overloads=[]),

            MethodDef(type='void', name='SetPen',
                items=[ParamDef(type='const wxPen &', name='pen')],
                briefDoc="""\
                    Sets the current pen for the DC.

                    If the argument is ``wx.NullPen``, the current pen is selected out of the
                    device context, and the original pen restored.

                    :see: `wx.Pen`
                    """,
                overloads=[]),


            MethodDef(type='void', name='SetBrush',
                items=[ParamDef(type='const wxBrush &', name='brush')],
                briefDoc="""\
                    Sets the current brush for the DC.

                    If the argument is ``wx.NullBrush``, the current brush is selected out
                    of the device context, and the original brush restored, allowing the
                    current brush to be destroyed safely.

                    :see: `wx.Brush`
                    """,
                overloads=[]),


            MethodDef(type='void', name='SetBackground',
                items=[ ParamDef(type='const wxBrush &', name='brush') ],
                briefDoc="Sets the current background brush for the DC.",
                overloads=[]),


            MethodDef(type='void', name='SetBackgroundMode',
                items=[ ParamDef(type='int', name='mode') ],
                briefDoc="""\
                    The *mode* parameter may be one of ``wx.SOLID`` and
                    ``wx.TRANSPARENT``. This setting determines whether text
                    will be drawn with a background colour or not.
                    """,
                overloads=[]),


            MethodDef(type='void', name='SetTextForeground',
                items=[ ParamDef(type='const wxColour &', name='colour') ],
                briefDoc="Sets the current text foreground colour for the DC.",
                overloads=[]),


            MethodDef(type='void', name='SetTextBackground',
                items=[ ParamDef(type='const wxColour&', name='colour') ],
                briefDoc="Sets the current text background colour for the DC.",
                overloads=[]),


            MethodDef(type='void', name='SetLogicalFunction',
                items=[ ParamDef(type='wxRasterOperationMode', name='function') ],
                briefDoc="""\
                    Sets the current logical function for the device context. This
                    determines how a source pixel (from a pen or brush colour, combines
                    with a destination pixel in the current device context.

                    The possible values and their meaning in terms of source and
                    destination pixel values are defined in the :ref:`wx.RasterOperationMode`
                    enumeration.

                    The default is wx.COPY, which simply draws with the current
                    colour. The others combine the current colour and the background using
                    a logical operation. wx.INVERT is commonly used for drawing rubber
                    bands or moving outlines, since drawing twice reverts to the original
                    colour.
                    """,
                overloads=[]),


            MethodDef(type='void', name='DrawLines',
                items=[ ParamDef(type='const wxPointList *', name='points'),
                        ParamDef(type='wxCoord', name='xoffset', default='0'),
                        ParamDef(type='wxCoord', name='yoffset', default='0')],
                briefDoc="""\
                    Draws lines using a sequence of `wx.Point` objects, adding the
                    optional offset coordinate. The current pen is used for drawing the
                    lines.
                    """,
                overloads=[]),


            MethodDef(type='void', name='DrawPolygon',
                items=[ ParamDef(type='const wxPointList *', name='points'),
                        ParamDef(type='wxCoord', name='xoffset', default='0'),
                        ParamDef(type='wxCoord', name='yoffset', default='0'),
                        ParamDef(type='wxPolygonFillMode', name='fillStyle', default='wxODDEVEN_RULE'),
                        ],
                briefDoc="""\
                    Draws a filled polygon using a sequence of `wx.Point` objects, adding
                    the optional offset coordinate.  The last argument specifies the fill
                    rule: ``wx.ODDEVEN_RULE`` (the default) or ``wx.WINDING_RULE``.

                    The current pen is used for drawing the outline, and the current brush
                    for filling the shape. Using a transparent brush suppresses
                    filling. Note that wxWidgets automatically closes the first and last
                    points.
                    """,
                overloads=[]),


            MethodDef(type='void', name='DrawSpline',
                items=[ ParamDef(type='const wxPointList *', name='points') ],
                briefDoc="""\
                    Draws a spline between all given control points, (a list of `wx.Point`
                    objects) using the current pen. The spline is drawn using a series of
                    lines, using an algorithm taken from the X drawing program 'XFIG'.
                    """,
                overloads=[]),

        ])

    # add deprecation warnings for the old method names
    cls.addPyCode("""\
        PseudoDC.BeginDrawing = wx.deprecated(lambda *args: None, 'BeginDrawing has been removed.')
        PseudoDC.EndDrawing = wx.deprecated(lambda *args: None, 'EndDrawing has been removed.')
        PseudoDC.FloodFillPoint = wx.deprecated(PseudoDC.FloodFill, 'Use FloodFill instead.')
        PseudoDC.DrawLinePoint = wx.deprecated(PseudoDC.DrawLine, 'Use DrawLine instead.')
        PseudoDC.CrossHairPoint = wx.deprecated(PseudoDC.CrossHair, 'Use CrossHair instead.')
        PseudoDC.DrawArcPoint = wx.deprecated(PseudoDC.DrawArc, 'Use DrawArc instead.')
        PseudoDC.DrawCheckMarkRect = wx.deprecated(PseudoDC.DrawCheckMark, 'Use DrawArc instead.')
        PseudoDC.DrawEllipticArcPointSize = wx.deprecated(PseudoDC.DrawEllipticArc, 'Use DrawEllipticArc instead.')
        PseudoDC.DrawPointPoint = wx.deprecated(PseudoDC.DrawPoint, 'Use DrawPoint instead.')
        PseudoDC.DrawRectangleRect = wx.deprecated(PseudoDC.DrawRectangle, 'Use DrawRectangle instead.')
        PseudoDC.DrawRectanglePointSize = wx.deprecated(PseudoDC.DrawRectangle, 'Use DrawRectangle instead.')
        PseudoDC.DrawRoundedRectangleRect = wx.deprecated(PseudoDC.DrawRoundedRectangle, 'Use DrawRectangle instead.')
        PseudoDC.DrawRoundedRectanglePointSize = wx.deprecated(PseudoDC.DrawRoundedRectangle, 'Use DrawRectangle instead.')
        PseudoDC.DrawCirclePoint = wx.deprecated(PseudoDC.DrawCircle, 'Use DrawCircle instead.')
        PseudoDC.DrawEllipseRect = wx.deprecated(PseudoDC.DrawEllipse, 'Use DrawEllipse instead.')
        PseudoDC.DrawEllipsePointSize = wx.deprecated(PseudoDC.DrawEllipse, 'Use DrawEllipse instead.')
        PseudoDC.DrawIconPoint = wx.deprecated(PseudoDC.DrawIcon, 'Use DrawIcon instead.')
        PseudoDC.DrawBitmapPoint = wx.deprecated(PseudoDC.DrawBitmap, 'Use DrawBitmap instead.')
        PseudoDC.DrawTextPoint = wx.deprecated(PseudoDC.DrawText, 'Use DrawText instead.')
        PseudoDC.DrawRotatedTextPoint = wx.deprecated(PseudoDC.DrawRotatedText, 'Use DrawRotatedText instead.')
        PseudoDC.DrawImageLabel = wx.deprecated(PseudoDC.DrawLabel, 'Use DrawLabel instead.')
        """)



    # Other stuff not wrapped yet
    # // Figure out a good typemap for this...
    # //        Convert the first 3 args from a sequence of sequences?
    # //     void DrawPolyPolygon(int n, int count[], wxPoint points[],
    # //                           wxCoord xoffset = 0, wxCoord yoffset = 0,
    # //                           int fillStyle = wxODDEVEN_RULE);
    #
    #
    # DocDeclStr(
    #     virtual void , SetPalette(const wxPalette& palette),
    #     "If this is a window DC or memory DC, assigns the given palette to the
    #     window or bitmap associated with the DC. If the argument is
    #     ``wx.NullPalette``, the current palette is selected out of the device
    #     context, and the original palette restored.", "
    #
    #     :see: `wx.Palette`");


    module.addItem(cls)

    #-----------------------------------------------------------------
    tools.doCommonTweaks(module)
    tools.runGenerators(module)


#---------------------------------------------------------------------------
if __name__ == '__main__':
    run()