1//---------------------------------------------------------------------------
2// This file is generated by wxPython's SIP generator.  Do not edit by hand.
3//
4// Copyright: (c) 2018 by Total Control Software
5// License:   wxWindows License
6//
7// This file will be included by _core.sip
8//
9//---------------------------------------------------------------------------
10
11//---------------------------------------------------------------------------
12
13struct wxVideoMode
14{
15    %Docstring
16        VideoMode(width=0, height=0, depth=0, freq=0)
17
18        Determines the sizes and locations of displays connected to the
19        system.
20    %End
21    %TypeHeaderCode
22        #include <wx/vidmode.h>
23    %End
24
25    wxVideoMode(
26        int width = 0,
27        int height = 0,
28        int depth = 0,
29        int freq = 0
30    );
31
32    int w;
33
34    int h;
35
36    int bpp;
37
38    int refresh;
39
40    bool Matches(
41        const wxVideoMode & other
42    ) const;
43    %Docstring
44        Matches(other) -> bool
45
46        Returns true if this mode matches the other one in the sense that all
47        non zero fields of the other mode have the same value in this one
48        (except for refresh which is allowed to have a greater value).
49    %End
50
51    int GetWidth() const;
52    %Docstring
53        GetWidth() -> int
54
55        Returns the screen width in pixels (e.g. 640), 0 means unspecified.
56    %End
57
58    int GetHeight() const;
59    %Docstring
60        GetHeight() -> int
61
62        Returns the screen height in pixels (e.g. 480), 0 means unspecified.
63    %End
64
65    int GetDepth() const;
66    %Docstring
67        GetDepth() -> int
68
69        Returns bits per pixel (e.g. 32), 1 is monochrome and 0 means
70        unspecified/known.
71    %End
72
73    bool IsOk() const;
74    %Docstring
75        IsOk() -> bool
76
77        Returns true if the object has been initialized.
78    %End
79
80    bool operator==(
81        const wxVideoMode & m
82    ) const;
83
84    bool operator!=(
85        const wxVideoMode & mode
86    ) const;
87
88    int __nonzero__();
89    %Docstring
90        __nonzero__() -> int
91    %End
92    %MethodCode
93        PyErr_Clear();
94        Py_BEGIN_ALLOW_THREADS
95        sipRes = _wxVideoMode___nonzero__(sipCpp);
96        Py_END_ALLOW_THREADS
97        if (PyErr_Occurred()) sipIsErr = 1;
98    %End
99    %TypeCode
100    int _wxVideoMode___nonzero__(wxVideoMode* self)
101    {
102        return self->IsOk();
103    }
104    %End
105
106    int __bool__();
107    %Docstring
108        __bool__() -> int
109    %End
110    %MethodCode
111        PyErr_Clear();
112        Py_BEGIN_ALLOW_THREADS
113        sipRes = _wxVideoMode___bool__(sipCpp);
114        Py_END_ALLOW_THREADS
115        if (PyErr_Occurred()) sipIsErr = 1;
116    %End
117    %TypeCode
118    int _wxVideoMode___bool__(wxVideoMode* self)
119    {
120        return self->IsOk();
121    }
122    %End
123
124    public:
125
126
127    %Property(name=Depth, get=GetDepth)
128    %Property(name=Height, get=GetHeight)
129    %Property(name=Width, get=GetWidth)
130};  // end of class wxVideoMode
131
132
133const wxVideoMode wxDefaultVideoMode;
134
135class wxArrayVideoModes
136{
137public:
138    SIP_SSIZE_T __len__();
139    %MethodCode
140        sipRes = sipCpp->GetCount();
141    %End
142
143            wxVideoMode& __getitem__(long index);
144        %MethodCode
145            if (0 > index)
146                index += sipCpp->GetCount();
147
148            if ((index < sipCpp->GetCount()) && (0 <= index)) {
149                sipRes = &sipCpp->Item(index);
150            }
151            else {
152                wxPyErr_SetString(PyExc_IndexError, "sequence index out of range");
153                sipError = sipErrorFail;
154            }
155        %End
156
157
158    int __contains__(wxVideoMode& obj);
159    %MethodCode
160        int idx = sipCpp->Index(*obj, false);
161        sipRes = idx != wxNOT_FOUND;
162    %End
163
164    void append(wxVideoMode& obj);
165    %MethodCode
166        sipCpp->Add(*obj);
167    %End
168
169    // TODO:  add support for index(value, [start, [stop]])
170    int index(wxVideoMode& obj);
171    %MethodCode
172        int idx = sipCpp->Index(*obj, false);
173        if (idx == wxNOT_FOUND) {
174            sipError = sipErrorFail;
175            wxPyErr_SetString(PyExc_ValueError,
176                              "sequence.index(x): x not in sequence");
177            }
178        sipRes = idx;
179    %End
180};
181
182%Extract(id=pycode_core)
183def _ArrayVideoModes___repr__(self):
184    return "ArrayVideoModes: " + repr(list(self))
185ArrayVideoModes.__repr__ = _ArrayVideoModes___repr__
186del _ArrayVideoModes___repr__
187%End
188
189
190
191//---------------------------------------------------------------------------
192
193