wxMaxima
Dirstructure.h
Go to the documentation of this file.
1 // -*- mode: c++; c-file-style: "linux"; c-basic-offset: 2; indent-tabs-mode: nil -*-
2 // Copyright (C) 2004-2015 Andrej Vodopivec <andrej.vodopivec@gmail.com>
3 // (C) 2015 Gunter Königsmann <wxMaxima@physikbuch.de>
4 // (C) 2013 Doug Ilijev <doug.ilijev@gmail.com>
5 //
6 // This program is free software; you can redistribute it and/or modify
7 // it under the terms of the GNU General Public License as published by
8 // the Free Software Foundation; either version 2 of the License, or
9 // (at your option) any later version.
10 //
11 // This program is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 // GNU General Public License for more details.
15 //
16 //
17 // You should have received a copy of the GNU General Public License
18 // along with this program; if not, write to the Free Software
19 // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20 //
21 // SPDX-License-Identifier: GPL-2.0+
22 
29 #ifndef DIRSTRUCTURE_H
30 #define DIRSTRUCTURE_H
31 
32 
33 // This macro is used to mark the macports prefix, so that it can be easily patched
34 // The MacPorts port file for wxMaxima uses this, so don't remove this!
35 // Note: this is not done with a define passed through cmake because I didn't find a way
36 // to pass paths which need quoting through cmake.
37 #define OSX_MACPORTS_PREFIX "/opt/local"
38 // If set to 1, the macports path is put first into the search path (after app package paths).
39 // This could be done with a define but then it doesn't make sense to use a different method.
40 #define OSX_MACPORTS_PREFER 0
41 
42 #include "precomp.h"
43 #include <wx/wx.h>
44 #include <wx/string.h>
45 #include <wx/stdpaths.h>
46 #include <wx/utils.h>
47 
58 {
59 public:
61  Dirstructure();
62 
63 private:
65  wxString ResourcesDir() const;
66 
67 public:
69  static wxString UserConfDir() {return m_userConfDir;}
71  static void UserConfDir(wxString userConfDir);
72 
74  wxString DataDir() const;
75 
77  wxString FontDir() const {return DataDir()+wxT("/../fonts");}
78 
80  wxString HelpDir() const {return m_helpDir;}
82  void HelpDir(wxString helpDir){m_helpDir = helpDir;}
83 
87  wxString UserAutocompleteFile();
88 
90  wxString AutocompleteFile() const
91  { return DataDir() + wxT("/autocomplete.txt"); }
92 
97  wxString LocaleDir() const
98  { return ResourcesDir() + wxT("/locale"); }
99 
101  static wxString MaximaDefaultLocation();
102 
103  static wxString
104  AnchorsCacheFile()
105  {
106  return UserConfDir() + "/manual_anchors.xml";
107  }
108 
109  static Dirstructure *Get()
110  {
111  return m_dirStructure;
112  }
113 private:
114  wxString m_helpDir;
115  static wxString m_userConfDir;
116  static Dirstructure *m_dirStructure;
117 };
118 
119 #endif // DIRSTRUCTURE_H
Dirstructure::DataDir
wxString DataDir() const
The directory general data is stored in.
Definition: Dirstructure.cpp:136
Dirstructure::UserConfDir
static wxString UserConfDir()
The directory the user stores its data in.
Definition: Dirstructure.h:69
Dirstructure::FontDir
wxString FontDir() const
The directory our private fonts are stored in.
Definition: Dirstructure.h:77
Dirstructure::UserAutocompleteFile
wxString UserAutocompleteFile()
Definition: Dirstructure.cpp:255
Dirstructure::MaximaDefaultLocation
static wxString MaximaDefaultLocation()
The executable file path to the maxima executable (or .bat on Windows)
Definition: Dirstructure.cpp:147
Dirstructure::HelpDir
wxString HelpDir() const
The directory the help file is stored in.
Definition: Dirstructure.h:80
Dirstructure::AutocompleteFile
wxString AutocompleteFile() const
The path to wxMaxima's own AutoComplete file.
Definition: Dirstructure.h:90
Dirstructure::HelpDir
void HelpDir(wxString helpDir)
Set the directory the help file is stored in.
Definition: Dirstructure.h:82
Dirstructure::LocaleDir
wxString LocaleDir() const
Definition: Dirstructure.h:97
Dirstructure
Definition: Dirstructure.h:57
Dirstructure::Dirstructure
Dirstructure()
The constructor.
Definition: Dirstructure.cpp:39