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 PluginUI::singleton = this;
40 // Instantiate and register the Set S/T Scale dialog. We need a non-generic
41 // handle on this one too, because it will be used as input to the Get Info
42 // dialog constructor below.
43 SmartPointer<SetScaleDialog> setScaleDialog(
44 new SetScaleDialog("SetScale"));
45 SmartPointer<GenericDialog> setScaleDialogGeneric(setScaleDialog);
46 RegisterDialog(setScaleDialogGeneric);
47 // Instantiate and register the Get Info dialog. Constructor needs a handle
48 // on the Set S/T Scale dialog (since it may need to send texture info to
50 SmartPointer<GenericDialog> getInfoDialogGeneric(
51 new GetInfoDialog("GetInfo", setScaleDialog));
52 RegisterDialog(getInfoDialogGeneric);
53 // Instantiate and register the General Function dialog.
54 SmartPointer<GenericDialog> genFuncDialogGeneric(
55 new GeneralFunctionDialog("GeneralFunction"));
56 RegisterDialog(genFuncDialogGeneric);
57 // Instantiate and register the main menu. Constructor needs generic
58 // handles on all dialogs (since it may need to raise them).
59 SmartPointer<GenericMainMenu> mainMenuGeneric(
60 new ::MainMenu(setScaleDialogGeneric,
62 genFuncDialogGeneric));
63 RegisterMainMenu(mainMenuGeneric);
73 PluginUI* PluginUI::singleton = 0;
75 * Get the singleton instance of the UI manager. Note that callers should
76 * almost certainly invoke the UIInstance global function instead of using
79 * @return Handle to the UI manager instance.
84 //static PluginUI singleton;
87 singleton = new PluginUI();
92 * Get the singleton instance of the UI manager.
94 * @return Reference to a singleton that implements GenericPluginUI.
96 GenericPluginUI& UIInstance()
98 return PluginUI::Instance();