]> git.saurik.com Git - wxWidgets.git/blame - docs/latex/wx/stdpaths.tex
added wxMenu::AppendSubMenu() to avoid having to specify a dummy id when adding a...
[wxWidgets.git] / docs / latex / wx / stdpaths.tex
CommitLineData
1ee445c7 1%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
96e2aec5
VZ
2%% Name: stdpaths.tex
3%% Purpose: wxStandardPaths documentation
1ee445c7
VZ
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>
8795498c 9%% License: wxWindows license
1ee445c7
VZ
10%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11
48713afd 12\section{\class{wxStandardPaths}}\label{wxstandardpaths}
1ee445c7 13
96e2aec5 14wxStandardPaths returns the standard locations in the file system and should be
dceb1c09 15used by applications to find their data files in a portable way.
1ee445c7 16
1ee445c7
VZ
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
48713afd
VZ
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}.
1ee445c7
VZ
23
24The strings \texttt{\textit{appname}} and \texttt{\textit{username}} should be
6cd6ec63
WS
25replaced with the value returned by \helpref{wxApp::GetAppName}{wxappgetappname}
26and the name of the currently logged in user, respectively. The string
48713afd
VZ
27\texttt{\textit{prefix}} is only used under Unix and is \texttt{/usr/local} by
28default but may be changed using \helpref{SetInstallPrefix}{wxstandardpathssetinstallprefix}.
1ee445c7
VZ
29
30The directories returned by the methods of this class may or may not exist. If
96e2aec5 31they don't exist, it's up to the caller to create them, wxStandardPaths doesn't
1ee445c7
VZ
32do it.
33
48713afd
VZ
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.
1ee445c7 38
b36d022a
VZ
39This class is MT-safe: its methods may be called concurrently from different
40threads without additional locking.
41
1ee445c7
VZ
42\wxheading{Derived from}
43
44No base class
45
46\wxheading{Include files}
47
08acda4f 48<wx/stdpaths.h>
1ee445c7
VZ
49
50
51\latexignore{\rtfignore{\wxheading{Members}}}
52
53
effdccd8
VZ
54\membersection{wxStandardPaths::Get}\label{wxstandardpathsget}
55
8648883b 56\func{static wxStandardPathsBase\&}{Get}{\void}
effdccd8
VZ
57
58Returns reference to the unique global standard paths object.
59
60
48713afd 61\membersection{wxStandardPaths::GetConfigDir}\label{wxstandardpathsgetconfigdir}
1ee445c7 62
effdccd8 63\func{wxString}{GetConfigDir}{\void}
1ee445c7
VZ
64
65Return the directory containing the system config files.
66
67Example return values:
68\begin{itemize}
69 \item Unix: \texttt{/etc}
b36d022a 70 \item Windows: \texttt{C:$\backslash$Documents and Settings$\backslash$All Users$\backslash$Application Data}
1ee445c7
VZ
71 \item Mac: \texttt{/Library/Preferences}
72\end{itemize}
73
74\wxheading{See also}
75
76\helpref{wxFileConfig}{wxfileconfig}
77
78
48713afd 79\membersection{wxStandardPaths::GetDataDir}\label{wxstandardpathsgetdatadir}
1ee445c7 80
effdccd8 81\func{wxString}{GetDataDir}{\void}
1ee445c7
VZ
82
83Return the location of the applications global, i.e. not user-specific,
84data files.
85
86Example return values:
87\begin{itemize}
48713afd 88 \item Unix: \texttt{\textit{prefix}/share/\textit{appname}}
90537299 89 \item Windows: the directory where the executable file is located
48713afd 90 \item Mac: \texttt{\textit{appname}.app/Contents/SharedSupport} bundle subdirectory
1ee445c7
VZ
91\end{itemize}
92
93\wxheading{See also}
94
48713afd
VZ
95\helpref{GetLocalDataDir}{wxstandardpathsgetlocaldatadir}
96
97
98\membersection{wxStandardPaths::GetInstallPrefix}\label{wxstandardpathsgetinstallprefix}
99
effdccd8 100\func{wxString}{GetInstallPrefix}{\void}
48713afd
VZ
101
102\textbf{Note: } This function is only available under Unix.
103
6cd6ec63 104Return the program installation prefix, e.g. \texttt{/usr}, \texttt{/opt} or
48713afd 105\texttt{/home/zeitlin}.
1ee445c7 106
6cd6ec63 107If the prefix had been previously by
48713afd
VZ
108\helpref{SetInstallPrefix}{wxstandardpathssetinstallprefix}, returns that
109value, otherwise tries to determine it automatically (Linux only right
110now) and finally returns the default \texttt{/usr/local} value if it failed.
1ee445c7 111
48713afd
VZ
112
113\membersection{wxStandardPaths::GetLocalDataDir}\label{wxstandardpathsgetlocaldatadir}
1ee445c7 114
effdccd8 115\func{wxString}{GetLocalDataDir}{\void}
1ee445c7
VZ
116
117Return the location for application data files which are host-specific and
118can't, or shouldn't, be shared with the other machines.
119
48713afd 120This is the same as \helpref{GetDataDir()}{wxstandardpathsgetdatadir} except
1ee445c7
VZ
121under Unix where it returns \texttt{/etc/\textit{appname}}.
122
123
f3b0f8ad
VZ
124\membersection{wxStandardPaths::GetLocalizedResourcesDir}\label{wxstandardpathsgetlocalizedresourcesdir}
125
6cd6ec63 126\func{wxString}{GetLocalizedResourcesDir}{\param{const wxChar*}{ lang}, \param{ResourceCat}{ category = ResourceCat\_None}}
f3b0f8ad
VZ
127
128Return the localized resources directory containing the resource files of the
129specified category for the given language.
130
6cd6ec63
WS
131In general this is just the same as \arg{lang} subdirectory of
132\helpref{GetResourcesDir()}{wxstandardpathsgetresourcesdir} (or
f3b0f8ad 133\texttt{\arg{lang}.lproj} under Mac OS X) but is something quite
6cd6ec63 134different for message catalog category under Unix where it returns the standard
f3b0f8ad
VZ
135\texttt{\textit{prefix}/share/locale/\arg{lang}/LC\_MESSAGES} directory.
136
137
48713afd 138\membersection{wxStandardPaths::GetPluginsDir}\label{wxstandardpathsgetpluginsdir}
1ee445c7 139
effdccd8 140\func{wxString}{GetPluginsDir}{\void}
1ee445c7
VZ
141
142Return the directory where the loadable modules (plugins) live.
143
f3b0f8ad
VZ
144Example return values:
145\begin{itemize}
146 \item Unix: \texttt{\textit{prefix}/share/\textit{appname}}
147 \item Windows: the directory where the executable file is located
148 \item Mac: \texttt{\textit{appname}.app/Contents/Resources} bundle subdirectory
149\end{itemize}
150
151\wxheading{See also}
152
153\helpref{wxDynamicLibrary}{wxdynamiclibrary}
154
155
156\membersection{wxStandardPaths::GetResourcesDir}\label{wxstandardpathsgetresourcesdir}
157
158\func{wxString}{GetResourcesDir}{\void}
159
160Return the directory where the application resource files are located. The
161resources are the auxiliary data files needed for the application to run and
162include, for example, image and sound files it might use.
163
164This function is the same as \helpref{GetDataDir}{wxstandardpathsgetdatadir} for
165all platforms except Mac OS X.
166
1ee445c7
VZ
167Example return values:
168\begin{itemize}
48713afd 169 \item Unix: \texttt{\textit{prefix}/lib/\textit{appname}}
1ee445c7 170 \item Windows: the directory of the executable file
48713afd 171 \item Mac: \texttt{\textit{appname}.app/Contents/PlugIns} bundle subdirectory
1ee445c7
VZ
172\end{itemize}
173
174\wxheading{See also}
175
f3b0f8ad 176\helpref{GetLocalizedResourcesDir}{wxstandardpathsgetlocalizedresourcesdir}
1ee445c7
VZ
177
178
48713afd 179\membersection{wxStandardPaths::GetUserConfigDir}\label{wxstandardpathsgetuserconfigdir}
1ee445c7 180
effdccd8 181\func{wxString}{GetUserConfigDir}{\void}
1ee445c7
VZ
182
183Return the directory for the user config files:
184\begin{itemize}
0d2b62c5 185 \item Unix: \tt{~} (the home directory)
6fdd4565 186 \item Windows: \tt{C:$\backslash$Documents and Settings$\backslash$\textit{username}}
0d2b62c5 187 \item Mac: \tt{~/Library/Preferences}
1ee445c7
VZ
188\end{itemize}
189
190Only use this method if you have a single configuration file to put in this
48713afd 191directory, otherwise \helpref{GetUserDataDir()}{wxstandardpathsgetuserdatadir} is
1ee445c7
VZ
192more appropriate.
193
194
48713afd 195\membersection{wxStandardPaths::GetUserDataDir}\label{wxstandardpathsgetuserdatadir}
1ee445c7 196
effdccd8 197\func{wxString}{GetUserDataDir}{\void}
1ee445c7
VZ
198
199Return the directory for the user-dependent application data files:
200\begin{itemize}
0d2b62c5 201 \item Unix: \tt{~/.\textit{appname}}
6fdd4565 202 \item Windows: \tt{C:$\backslash$Documents and Settings$\backslash$\textit{username}$\backslash$Application Data$\backslash$\textit{appname}}
0d2b62c5 203 \item Mac: \tt{~/Library/Application Support/\textit{appname}}
1ee445c7
VZ
204\end{itemize}
205
206
48713afd 207\membersection{wxStandardPaths::GetUserLocalDataDir}\label{wxstandardpathsgetuserlocaldatadir}
1ee445c7 208
effdccd8 209\func{wxString}{GetUserLocalDataDir}{\void}
1ee445c7
VZ
210
211Return the directory for user data files which shouldn't be shared with
212the other machines.
213
48713afd 214This is the same as \helpref{GetUserDataDir()}{wxstandardpathsgetuserdatadir} for
6cd6ec63 215all platforms except Windows where it returns
96e2aec5 216\texttt{C:$\backslash$Documents and Settings$\backslash$\textit{username}$\backslash$Local Settings$\backslash$Application Data$\backslash$\textit{appname}}
1ee445c7
VZ
217
218
48713afd
VZ
219\membersection{wxStandardPaths::SetInstallPrefix}\label{wxstandardpathssetinstallprefix}
220
effdccd8 221\func{void}{SetInstallPrefix}{\param{const wxString\& }{prefix}}
48713afd 222
dceb1c09 223\textbf{Note:} This function is only available under Unix.
48713afd
VZ
224
225Lets wxStandardPaths know about the real program installation prefix on a Unix
6cd6ec63 226system. By default, the value returned by
48713afd
VZ
227\helpref{GetInstallPrefix}{wxstandardpathsgetinstallprefix} is used.
228
229Although under Linux systems the program prefix may usually be determined
230automatically, portable programs should call this function. Usually the prefix
231is set during program configuration if using GNU autotools and so it is enough
232to pass its value defined in \texttt{config.h} to this function.
233
234