]> git.saurik.com Git - wxWidgets.git/blame - utils/wxPython/src/utils.i
minimal now works in Unicode mode
[wxWidgets.git] / utils / wxPython / src / utils.i
CommitLineData
b8b8dda7
RD
1/////////////////////////////////////////////////////////////////////////////
2// Name: utils.i
3// Purpose: SWIG definitions of various utility classes classes
4//
5// Author: Robin Dunn
6//
7// Created: 25-nov-1998
8// RCS-ID: $Id$
9// Copyright: (c) 1998 by Total Control Software
10// Licence: wxWindows license
11/////////////////////////////////////////////////////////////////////////////
12
13
14%module utils
15
16%{
17#include "helpers.h"
18#include <wx/config.h>
19%}
20
21//---------------------------------------------------------------------------
22
23%include typemaps.i
24%include my_typemaps.i
25
26
b8b8dda7 27%{
0699c864 28#ifdef SEPARATE
b8b8dda7 29 static wxString wxPyEmptyStr("");
b8b8dda7 30#endif
0699c864 31%}
b8b8dda7
RD
32
33
34%{
35 static PyObject* __EnumerationHelper(bool flag, wxString& str, long index) {
36 PyObject* ret = PyTuple_New(3);
37 if (ret) {
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));
41 }
42 return ret;
43 }
44%}
45
46//---------------------------------------------------------------------------
47
48class wxConfig {
49public:
50 wxConfig(const wxString& appName = wxPyEmptyStr,
51 const wxString& vendorName = wxPyEmptyStr,
52 const wxString& localFilename = wxPyEmptyStr,
53 const wxString& globalFilename = wxPyEmptyStr,
54 long style = 0);
55 ~wxConfig();
56
57 //static wxConfigBase * Create();
58 //static wxConfigBase * Get();
59 //static wxConfigBase * Set(wxConfigBase *pConfig);
60
61
62
63 void DontCreateOnDemand();
af309447 64 bool DeleteAll(); // This is supposed to have been fixed...
b8b8dda7
RD
65 bool DeleteEntry(const wxString& key, bool bDeleteGroupIfEmpty = TRUE);
66 bool DeleteGroup(const wxString& key);
67 bool Exists(wxString& strName);
68 bool Flush(bool bCurrentOnly = FALSE);
69 wxString GetAppName();
70
71
72 // Each of these enumeration methods return a 3-tuple consisting of
73 // the continue flag, the value string, and the index for the next call.
74 %addmethods {
75 PyObject* GetFirstGroup() {
76 bool cont;
77 long index = 0;
78 wxString value;
79
80 cont = self->GetFirstGroup(value, index);
81 return __EnumerationHelper(cont, value, index);
82 }
83
84 PyObject* GetFirstEntry() {
85 bool cont;
86 long index = 0;
87 wxString value;
88
89 cont = self->GetFirstEntry(value, index);
90 return __EnumerationHelper(cont, value, index);
91 }
92
93 PyObject* GetNextGroup(long index) {
94 bool cont;
95 wxString value;
96
97 cont = self->GetNextGroup(value, index);
98 return __EnumerationHelper(cont, value, index);
99 }
100
101 PyObject* GetNextEntry(long index) {
102 bool cont;
103 wxString value;
104
105 cont = self->GetNextEntry(value, index);
106 return __EnumerationHelper(cont, value, index);
107 }
108 }
109
110
111 int GetNumberOfEntries(bool bRecursive = FALSE);
112 int GetNumberOfGroups(bool bRecursive = FALSE);
113 wxString GetPath();
114 wxString GetVendorName();
115 bool HasEntry(wxString& strName);
116 bool HasGroup(const wxString& strName);
117 bool IsExpandingEnvVars();
118 bool IsRecordingDefaults();
119
120 wxString Read(const wxString& key, const wxString& defaultVal = wxPyEmptyStr);
121 %name(ReadInt)long Read(const wxString& key, long defaultVal = 0);
122 %name(ReadFloat)double Read(const wxString& key, double defaultVal = 0.0);
123
124 void SetAppName(const wxString& appName);
125 void SetExpandEnvVars (bool bDoIt = TRUE);
126 void SetPath(const wxString& strPath);
127 void SetRecordDefaults(bool bDoIt = TRUE);
128 void SetVendorName(const wxString& vendorName);
129
130 bool Write(const wxString& key, const wxString& value);
131 %name(WriteInt)bool Write(const wxString& key, long value);
132 %name(WriteFloat)bool Write(const wxString& key, double value);
133
134};
135
136
137//---------------------------------------------------------------------------
138/////////////////////////////////////////////////////////////////////////////
139//
140// $Log$
0699c864
RD
141// Revision 1.3 1999/02/25 07:08:36 RD
142// wxPython version 2.0b5
143//
af309447
RD
144// Revision 1.2 1999/02/20 09:03:02 RD
145// Added wxWindow_FromHWND(hWnd) for wxMSW to construct a wxWindow from a
146// window handle. If you can get the window handle into the python code,
147// it should just work... More news on this later.
148//
149// Added wxImageList, wxToolTip.
150//
151// Re-enabled wxConfig.DeleteAll() since it is reportedly fixed for the
152// wxRegConfig class.
153//
154// As usual, some bug fixes, tweaks, etc.
155//
b8b8dda7
RD
156// Revision 1.1 1998/12/15 20:41:23 RD
157// Changed the import semantics from "from wxPython import *" to "from
158// wxPython.wx import *" This is for people who are worried about
159// namespace pollution, they can use "from wxPython import wx" and then
160// prefix all the wxPython identifiers with "wx."
161//
162// Added wxTaskbarIcon for wxMSW.
163//
164// Made the events work for wxGrid.
165//
166// Added wxConfig.
167//
168// Added wxMiniFrame for wxGTK, (untested.)
169//
170// Changed many of the args and return values that were pointers to gdi
171// objects to references to reflect changes in the wxWindows API.
172//
173// Other assorted fixes and additions.
174//