]> git.saurik.com Git - wxWidgets.git/blame_incremental - docs/latex/wx/stdpaths.tex
Always draw the selection of selected items, not just when they have
[wxWidgets.git] / docs / latex / wx / stdpaths.tex
... / ...
CommitLineData
1%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2%% Name: stdpaths.tex
3%% Purpose: wxStandardPaths documentation
4%% Author: Vadim Zeitlin
5%% Modified by:
6%% Created: 2004-10-17
7%% RCS-ID: $Id$
8%% Copyright: (c) 2004 Vadim Zeitlin <vadim@wxwindows.org>
9%% License: wxWindows license
10%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11
12\section{\class{wxStandardPaths}}\label{wxstandardpaths}
13
14wxStandardPaths returns the standard locations in the file system and should be
15used by applications to find their data files in a portable way.
16
17In the description of the methods below, the example return values are given
18for the Unix, Windows and Mac OS X systems, however please note that these are
19just the examples and the actual values may differ. For example, under Windows:
20the system administrator may change the standard directories locations, i.e.
21the Windows directory may be named \texttt{W:$\backslash$Win2003} instead of
22the default \texttt{C:$\backslash$Windows}.
23
24The strings \texttt{\textit{appname}} and \texttt{\textit{username}} should be
25replaced with the value returned by \helpref{wxApp::GetAppName}{wxappgetappname}
26and the name of the currently logged in user, respectively. The string
27\texttt{\textit{prefix}} is only used under Unix and is \texttt{/usr/local} by
28default but may be changed using \helpref{SetInstallPrefix}{wxstandardpathssetinstallprefix}.
29
30The directories returned by the methods of this class may or may not exist. If
31they don't exist, it's up to the caller to create them, wxStandardPaths doesn't
32do it.
33
34Finally note that these functions only work with standardly packaged
35applications. I.e. under Unix you should follow the standard installation
36conventions and under Mac you should create your application bundle according
37to the Apple guidelines. Again, this class doesn't help you to do it.
38
39This class is MT-safe: its methods may be called concurrently from different
40threads without additional locking.
41
42\wxheading{Derived from}
43
44No base class
45
46\wxheading{Include files}
47
48<wx/stdpaths.h>
49
50
51\latexignore{\rtfignore{\wxheading{Members}}}
52
53
54\membersection{wxStandardPaths::Get}\label{wxstandardpathsget}
55
56\func{static wxStandardPathsBase\&}{Get}{\void}
57
58Returns reference to the unique global standard paths object.
59
60
61\membersection{wxStandardPaths::GetConfigDir}\label{wxstandardpathsgetconfigdir}
62
63\constfunc{wxString}{GetConfigDir}{\void}
64
65Return the directory containing the system config files.
66
67Example return values:
68\begin{itemize}
69 \item Unix: \texttt{/etc}
70 \item Windows: \texttt{C:$\backslash$Documents and Settings$\backslash$All Users$\backslash$Application Data}
71 \item Mac: \texttt{/Library/Preferences}
72\end{itemize}
73
74\wxheading{See also}
75
76\helpref{wxFileConfig}{wxfileconfig}
77
78
79\membersection{wxStandardPaths::GetDataDir}\label{wxstandardpathsgetdatadir}
80
81\constfunc{wxString}{GetDataDir}{\void}
82
83Return the location of the applications global, i.e. not user-specific,
84data files.
85
86Example return values:
87\begin{itemize}
88 \item Unix: \texttt{\textit{prefix}/share/\textit{appname}}
89 \item Windows: the directory where the executable file is located
90 \item Mac: \texttt{\textit{appname}.app/Contents/SharedSupport} bundle subdirectory
91\end{itemize}
92
93\wxheading{See also}
94
95\helpref{GetLocalDataDir}{wxstandardpathsgetlocaldatadir}
96
97
98\membersection{wxStandardPaths::GetDocumentsDir}\label{wxstandardpathsgetdocumentsdir}
99
100\constfunc{wxString}{GetDocumentsDir}{\void}
101
102Return the directory containing the current user's documents.
103
104Example return values:
105\begin{itemize}
106 \item Unix: \tt{~} (the home directory)
107 \item Windows: \texttt{C:$\backslash$Documents and Settings$\backslash$\textit{username}$\backslash$Documents}
108 \item Mac: \texttt{~/Documents}
109\end{itemize}
110
111\newsince{2.7.0}
112
113
114\membersection{wxStandardPaths::GetInstallPrefix}\label{wxstandardpathsgetinstallprefix}
115
116\constfunc{wxString}{GetInstallPrefix}{\void}
117
118\textbf{Note: } This function is only available under Unix.
119
120Return the program installation prefix, e.g. \texttt{/usr}, \texttt{/opt} or
121\texttt{/home/zeitlin}.
122
123If the prefix had been previously by
124\helpref{SetInstallPrefix}{wxstandardpathssetinstallprefix}, returns that
125value, otherwise tries to determine it automatically (Linux only right
126now) and finally returns the default \texttt{/usr/local} value if it failed.
127
128
129\membersection{wxStandardPaths::GetLocalDataDir}\label{wxstandardpathsgetlocaldatadir}
130
131\constfunc{wxString}{GetLocalDataDir}{\void}
132
133Return the location for application data files which are host-specific and
134can't, or shouldn't, be shared with the other machines.
135
136This is the same as \helpref{GetDataDir()}{wxstandardpathsgetdatadir} except
137under Unix where it returns \texttt{/etc/\textit{appname}}.
138
139
140\membersection{wxStandardPaths::GetLocalizedResourcesDir}\label{wxstandardpathsgetlocalizedresourcesdir}
141
142\constfunc{wxString}{GetLocalizedResourcesDir}{\param{const wxChar*}{ lang}, \param{ResourceCat}{ category = ResourceCat\_None}}
143
144Return the localized resources directory containing the resource files of the
145specified category for the given language.
146
147In general this is just the same as \arg{lang} subdirectory of
148\helpref{GetResourcesDir()}{wxstandardpathsgetresourcesdir} (or
149\texttt{\arg{lang}.lproj} under Mac OS X) but is something quite
150different for message catalog category under Unix where it returns the standard
151\texttt{\textit{prefix}/share/locale/\arg{lang}/LC\_MESSAGES} directory.
152
153\newsince{2.7.0}
154
155
156\membersection{wxStandardPaths::GetPluginsDir}\label{wxstandardpathsgetpluginsdir}
157
158\constfunc{wxString}{GetPluginsDir}{\void}
159
160Return the directory where the loadable modules (plugins) live.
161
162Example return values:
163\begin{itemize}
164 \item Unix: \texttt{\textit{prefix}/share/\textit{appname}}
165 \item Windows: the directory where the executable file is located
166 \item Mac: \texttt{\textit{appname}.app/Contents/Resources} bundle subdirectory
167\end{itemize}
168
169\wxheading{See also}
170
171\helpref{wxDynamicLibrary}{wxdynamiclibrary}
172
173
174\membersection{wxStandardPaths::GetResourcesDir}\label{wxstandardpathsgetresourcesdir}
175
176\constfunc{wxString}{GetResourcesDir}{\void}
177
178Return the directory where the application resource files are located. The
179resources are the auxiliary data files needed for the application to run and
180include, for example, image and sound files it might use.
181
182This function is the same as \helpref{GetDataDir}{wxstandardpathsgetdatadir} for
183all platforms except Mac OS X.
184
185Example return values:
186\begin{itemize}
187 \item Unix: \texttt{\textit{prefix}/lib/\textit{appname}}
188 \item Windows: the directory of the executable file
189 \item Mac: \texttt{\textit{appname}.app/Contents/PlugIns} bundle subdirectory
190\end{itemize}
191
192\newsince{2.7.0}
193
194
195\wxheading{See also}
196
197\helpref{GetLocalizedResourcesDir}{wxstandardpathsgetlocalizedresourcesdir}
198
199\membersection{wxStandardPaths::GetTempDir}\label{wxstandardpathsgettempdir}
200
201\constfunc{wxString}{GetTempDir}{\void}
202
203Return the directory for storing temporary files. To create unique temporary files,
204it is best to use \helpref{wxFileName::CreateTempFileName}{wxfilenamecreatetempfilename} for correct behaviour when
205multiple processes are attempting to create temporary files.
206
207\newsince{2.7.2}
208
209\membersection{wxStandardPaths::GetUserConfigDir}\label{wxstandardpathsgetuserconfigdir}
210
211\constfunc{wxString}{GetUserConfigDir}{\void}
212
213Return the directory for the user config files:
214\begin{itemize}
215 \item Unix: \tt{~} (the home directory)
216 \item Windows: \tt{C:$\backslash$Documents and Settings$\backslash$\textit{username}$\backslash$Application Data}
217 \item Mac: \tt{~/Library/Preferences}
218\end{itemize}
219
220Only use this method if you have a single configuration file to put in this
221directory, otherwise \helpref{GetUserDataDir()}{wxstandardpathsgetuserdatadir} is
222more appropriate.
223
224
225\membersection{wxStandardPaths::GetUserDataDir}\label{wxstandardpathsgetuserdatadir}
226
227\constfunc{wxString}{GetUserDataDir}{\void}
228
229Return the directory for the user-dependent application data files:
230\begin{itemize}
231 \item Unix: \tt{~/.\textit{appname}}
232 \item Windows: \tt{C:$\backslash$Documents and Settings$\backslash$\textit{username}$\backslash$Application Data$\backslash$\textit{appname}}
233 \item Mac: \tt{~/Library/Application Support/\textit{appname}}
234\end{itemize}
235
236
237\membersection{wxStandardPaths::GetUserLocalDataDir}\label{wxstandardpathsgetuserlocaldatadir}
238
239\constfunc{wxString}{GetUserLocalDataDir}{\void}
240
241Return the directory for user data files which shouldn't be shared with
242the other machines.
243
244This is the same as \helpref{GetUserDataDir()}{wxstandardpathsgetuserdatadir} for
245all platforms except Windows where it returns
246\texttt{C:$\backslash$Documents and Settings$\backslash$\textit{username}$\backslash$Local Settings$\backslash$Application Data$\backslash$\textit{appname}}
247
248
249\membersection{wxStandardPaths::SetInstallPrefix}\label{wxstandardpathssetinstallprefix}
250
251\func{void}{SetInstallPrefix}{\param{const wxString\& }{prefix}}
252
253\textbf{Note:} This function is only available under Unix.
254
255Lets wxStandardPaths know about the real program installation prefix on a Unix
256system. By default, the value returned by
257\helpref{GetInstallPrefix}{wxstandardpathsgetinstallprefix} is used.
258
259Although under Linux systems the program prefix may usually be determined
260automatically, portable programs should call this function. Usually the prefix
261is set during program configuration if using GNU autotools and so it is enough
262to pass its value defined in \texttt{config.h} to this function.
263