3 * Implements the PluginUI class.
8 * Copyright 2012 Joel Baxter
10 * This file is part of MeshTex.
12 * MeshTex is free software: you can redistribute it and/or modify
13 * it under the terms of the GNU General Public License as published by
14 * the Free Software Foundation, either version 2 of the License, or
15 * (at your option) any later version.
17 * MeshTex is distributed in the hope that it will be useful,
18 * but WITHOUT ANY WARRANTY; without even the implied warranty of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 * GNU General Public License for more details.
22 * You should have received a copy of the GNU General Public License
23 * along with MeshTex. If not, see <http://www.gnu.org/licenses/>.
27 #include "SetScaleDialog.h"
28 #include "GetInfoDialog.h"
29 #include "GeneralFunctionDialog.h"
34 * Default constructor. Instantiate and register the UI elements (main menu
39 // Instantiate and register the Set S/T Scale dialog. We need a non-generic
40 // handle on this one too, because it will be used as input to the Get Info
41 // dialog constructor below.
42 SmartPointer<SetScaleDialog> setScaleDialog(
43 new SetScaleDialog("SetScale"));
44 SmartPointer<GenericDialog> setScaleDialogGeneric(setScaleDialog);
45 RegisterDialog(setScaleDialogGeneric);
46 // Instantiate and register the Get Info dialog. Constructor needs a handle
47 // on the Set S/T Scale dialog (since it may need to send texture info to
49 SmartPointer<GenericDialog> getInfoDialogGeneric(
50 new GetInfoDialog("GetInfo", setScaleDialog));
51 RegisterDialog(getInfoDialogGeneric);
52 // Instantiate and register the General Function dialog.
53 SmartPointer<GenericDialog> genFuncDialogGeneric(
54 new GeneralFunctionDialog("GeneralFunction"));
55 RegisterDialog(genFuncDialogGeneric);
56 // Instantiate and register the main menu. Constructor needs generic
57 // handles on all dialogs (since it may need to raise them).
58 SmartPointer<GenericMainMenu> mainMenuGeneric(
59 new ::MainMenu(setScaleDialogGeneric,
61 genFuncDialogGeneric));
62 RegisterMainMenu(mainMenuGeneric);
73 * Get the singleton instance of the UI manager. Note that callers should
74 * almost certainly invoke the UIInstance global function instead of using
77 * @return Handle to the UI manager instance.
82 static PluginUI singleton;
87 * Get the singleton instance of the UI manager.
89 * @return Reference to a singleton that implements GenericPluginUI.
91 GenericPluginUI& UIInstance()
93 return PluginUI::Instance();