File: _stockobjs.i

package info (click to toggle)
wxwidgets2.6 2.6.3.2.1.5%2Betch1
  • links: PTS
  • area: main
  • in suites: etch
  • size: 83,228 kB
  • ctags: 130,941
  • sloc: cpp: 820,043; ansic: 113,030; python: 107,485; makefile: 42,996; sh: 10,305; lex: 194; yacc: 128; xml: 95; pascal: 74
file content (160 lines) | stat: -rw-r--r-- 4,069 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
/////////////////////////////////////////////////////////////////////////////
// Name:        _stockobjs.i
// Purpose:     SWIG interface defining "stock" GDI objects
//
// Author:      Robin Dunn
//
// Created:     13-Sept-2003
// RCS-ID:      $Id: _stockobjs.i,v 1.8 2005/04/02 03:46:42 RD Exp $
// Copyright:   (c) 2003 by Total Control Software
// Licence:     wxWindows license
/////////////////////////////////////////////////////////////////////////////

// Not a %module


//---------------------------------------------------------------------------
%newgroup


// See also wxPy_ReinitStockObjects in helpers.cpp
%immutable;

wxFont* const wxNORMAL_FONT;
wxFont* const wxSMALL_FONT;
wxFont* const wxITALIC_FONT;
wxFont* const wxSWISS_FONT;

wxPen* const wxRED_PEN;
wxPen* const wxCYAN_PEN;
wxPen* const wxGREEN_PEN;
wxPen* const wxBLACK_PEN;
wxPen* const wxWHITE_PEN;
wxPen* const wxTRANSPARENT_PEN;
wxPen* const wxBLACK_DASHED_PEN;
wxPen* const wxGREY_PEN;
wxPen* const wxMEDIUM_GREY_PEN;
wxPen* const wxLIGHT_GREY_PEN;

wxBrush* const wxBLUE_BRUSH;
wxBrush* const wxGREEN_BRUSH;
wxBrush* const wxWHITE_BRUSH;
wxBrush* const wxBLACK_BRUSH;
wxBrush* const wxTRANSPARENT_BRUSH;
wxBrush* const wxCYAN_BRUSH;
wxBrush* const wxRED_BRUSH;
wxBrush* const wxGREY_BRUSH;
wxBrush* const wxMEDIUM_GREY_BRUSH;
wxBrush* const wxLIGHT_GREY_BRUSH;

wxColour* const wxBLACK;
wxColour* const wxWHITE;
wxColour* const wxRED;
wxColour* const wxBLUE;
wxColour* const wxGREEN;
wxColour* const wxCYAN;
wxColour* const wxLIGHT_GREY;

wxCursor* const wxSTANDARD_CURSOR;
wxCursor* const wxHOURGLASS_CURSOR;
wxCursor* const wxCROSS_CURSOR;


const wxBitmap wxNullBitmap;
const wxIcon   wxNullIcon;
const wxCursor wxNullCursor;
const wxPen    wxNullPen;
const wxBrush  wxNullBrush;
const wxPalette wxNullPalette;
const wxFont   wxNullFont;
const wxColour wxNullColour;

%mutable;


//---------------------------------------------------------------------------

class wxPenList : public wxObject {
public:

    void AddPen(wxPen* pen);
    wxPen* FindOrCreatePen(const wxColour& colour, int width, int style);
    void RemovePen(wxPen* pen);

    int GetCount();
};


//---------------------------------------------------------------------------

class wxBrushList : public wxObject {
public:

    void AddBrush(wxBrush *brush);
    wxBrush * FindOrCreateBrush(const wxColour& colour, int style=wxSOLID);
    void RemoveBrush(wxBrush *brush);

    int GetCount();
};

//---------------------------------------------------------------------------

MustHaveApp(wxColourDatabase);

class wxColourDatabase : public wxObject {
public:
    wxColourDatabase();
    ~wxColourDatabase();

    // find colour by name or name for the given colour
    wxColour Find(const wxString& name) const;
    wxString FindName(const wxColour& colour) const;
    %pythoncode { FindColour = Find }
    
    // add a new colour to the database
    void AddColour(const wxString& name, const wxColour& colour);

    %extend {
        void Append(const wxString& name, int red, int green, int blue) {
            self->AddColour(name, wxColour(red, green, blue));
        }
    }
};

//---------------------------------------------------------------------------

class wxFontList : public wxObject {
public:

    void AddFont(wxFont* font);
    wxFont * FindOrCreateFont(int point_size, int family, int style, int weight,
                              bool underline = false, const wxString& facename = wxPyEmptyString,
                              wxFontEncoding encoding = wxFONTENCODING_DEFAULT);
    void RemoveFont(wxFont *font);

    int GetCount();
};

//---------------------------------------------------------------------------
%newgroup



// See also wxPy_ReinitStockObjects in helpers.cpp
%immutable;

wxFontList*       const wxTheFontList;
wxPenList*        const wxThePenList;
wxBrushList*      const wxTheBrushList;
wxColourDatabase* const wxTheColourDatabase;

%mutable;


//---------------------------------------------------------------------------
 
%pythoncode { NullColor = NullColour }