1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: SWIG definitions of various utility classes
7 // Created: 25-nov-1998
9 // Copyright: (c) 1998 by Total Control Software
10 // Licence: wxWindows license
11 /////////////////////////////////////////////////////////////////////////////
18 #include <wx/config.h>
21 //---------------------------------------------------------------------------
24 %include my_typemaps.i
29 static wxString wxPyEmptyStr("");
35 static PyObject* __EnumerationHelper(bool flag, wxString& str, long index) {
36 PyObject* ret = PyTuple_New(3);
38 PyTuple_SET_ITEM(ret, 0, PyInt_FromLong(flag));
39 PyTuple_SET_ITEM(ret, 1, PyString_FromString(str));
40 PyTuple_SET_ITEM(ret, 2, PyInt_FromLong(index));
46 //---------------------------------------------------------------------------
50 wxConfig(const wxString& appName = wxPyEmptyStr,
51 const wxString& vendorName = wxPyEmptyStr,
52 const wxString& localFilename = wxPyEmptyStr,
53 const wxString& globalFilename = wxPyEmptyStr,
58 void DontCreateOnDemand();
59 bool DeleteAll(); // This is supposed to have been fixed...
60 bool DeleteEntry(const wxString& key, bool bDeleteGroupIfEmpty = TRUE);
61 bool DeleteGroup(const wxString& key);
62 bool Exists(wxString& strName);
63 bool Flush(bool bCurrentOnly = FALSE);
64 wxString GetAppName();
67 // Each of these enumeration methods return a 3-tuple consisting of
68 // the continue flag, the value string, and the index for the next call.
70 PyObject* GetFirstGroup() {
75 cont = self->GetFirstGroup(value, index);
76 return __EnumerationHelper(cont, value, index);
79 PyObject* GetFirstEntry() {
84 cont = self->GetFirstEntry(value, index);
85 return __EnumerationHelper(cont, value, index);
88 PyObject* GetNextGroup(long index) {
92 cont = self->GetNextGroup(value, index);
93 return __EnumerationHelper(cont, value, index);
96 PyObject* GetNextEntry(long index) {
100 cont = self->GetNextEntry(value, index);
101 return __EnumerationHelper(cont, value, index);
106 int GetNumberOfEntries(bool bRecursive = FALSE);
107 int GetNumberOfGroups(bool bRecursive = FALSE);
109 wxString GetVendorName();
110 bool HasEntry(wxString& strName);
111 bool HasGroup(const wxString& strName);
112 bool IsExpandingEnvVars();
113 bool IsRecordingDefaults();
115 wxString Read(const wxString& key, const wxString& defaultVal = wxPyEmptyStr);
116 %name(ReadInt)long Read(const wxString& key, long defaultVal = 0);
117 %name(ReadFloat)double Read(const wxString& key, double defaultVal = 0.0);
119 void SetExpandEnvVars (bool bDoIt = TRUE);
120 void SetPath(const wxString& strPath);
121 void SetRecordDefaults(bool bDoIt = TRUE);
123 bool Write(const wxString& key, const wxString& value);
124 %name(WriteInt)bool Write(const wxString& key, long value);
125 %name(WriteFloat)bool Write(const wxString& key, double value);
130 //---------------------------------------------------------------------------
131 /////////////////////////////////////////////////////////////////////////////
134 // Revision 1.4 1999/04/30 03:29:19 RD
135 // wxPython 2.0b9, first phase (win32)
136 // Added gobs of stuff, see wxPython/README.txt for details
138 // Revision 1.3.4.1 1999/03/27 23:29:15 RD
141 // Python thread support
142 // various minor additions
143 // various minor fixes
145 // Revision 1.3 1999/02/25 07:08:36 RD
147 // wxPython version 2.0b5
149 // Revision 1.2 1999/02/20 09:03:02 RD
150 // Added wxWindow_FromHWND(hWnd) for wxMSW to construct a wxWindow from a
151 // window handle. If you can get the window handle into the python code,
152 // it should just work... More news on this later.
154 // Added wxImageList, wxToolTip.
156 // Re-enabled wxConfig.DeleteAll() since it is reportedly fixed for the
157 // wxRegConfig class.
159 // As usual, some bug fixes, tweaks, etc.
161 // Revision 1.1 1998/12/15 20:41:23 RD
162 // Changed the import semantics from "from wxPython import *" to "from
163 // wxPython.wx import *" This is for people who are worried about
164 // namespace pollution, they can use "from wxPython import wx" and then
165 // prefix all the wxPython identifiers with "wx."
167 // Added wxTaskbarIcon for wxMSW.
169 // Made the events work for wxGrid.
173 // Added wxMiniFrame for wxGTK, (untested.)
175 // Changed many of the args and return values that were pointers to gdi
176 // objects to references to reflect changes in the wxWindows API.
178 // Other assorted fixes and additions.