/* * Author: Andrew Robberts * * Copyright (C) 2003 Atomic Blue (info@planeshift.it, http://www.atomicblue.org) * * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation (version 2 of the License) * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * */ #include #include "eedittoolboxmanager.h" #include "eeditglobals.h" #include "paws/pawsmanager.h" #include "paws/pawswidget.h" #include "paws/pawsborder.h" #include "eeditpositiontoolbox.h" #include "eedittargettoolbox.h" #include "eeditcameratoolbox.h" #include "eeditrendertoolbox.h" #include "eeditloadeffecttoolbox.h" #include "eeditediteffecttoolbox.h" #include "eeditloadmaptoolbox.h" #include "eediterrortoolbox.h" #include "eeditfpstoolbox.h" #include "eeditshortcutstoolbox.h" bool RegisterToolboxFactories() { pawsWidgetFactory * factory; factory = new EEditPositionToolboxFactory(); factory = new EEditTargetToolboxFactory(); factory = new EEditCameraToolboxFactory(); factory = new EEditRenderToolboxFactory(); factory = new EEditLoadEffectToolboxFactory(); factory = new EEditEditEffectToolboxFactory(); factory = new EEditLoadMapToolboxFactory(); factory = new EEditErrorToolboxFactory(); factory = new EEditFPSToolboxFactory(); factory = new EEditShortcutsToolboxFactory(); return true; } EEditToolboxManager::EEditToolboxManager() { for (int a=0; aUpdate(elapsed); } } bool EEditToolboxManager::LoadWidgets(PawsManager * paws) { bool succeeded = true; for (int a=0; aLoadWidget(widgetFiles[a])) { printf("Warning: Loading of '%s' failed!\n", widgetFiles[a]); succeeded = false; toolboxes[a] = 0; } else { pawsWidget * toolboxWidget = paws->FindWidget(widgetNames[a]); toolboxes[a] = dynamic_cast(toolboxWidget); if (!toolboxes[a]) { printf("Warning: Could not find widget: '%s' in '%s'!\n", widgetNames[a], widgetFiles[a]); succeeded = false; } else { pawsWidget * w = dynamic_cast(toolboxes[a]); w->SetAlwaysOnTop(true); } } } return succeeded; } bool EEditToolboxManager::RegisterFactories() const { return RegisterToolboxFactories(); } size_t EEditToolboxManager::GetToolboxCount() const { return EEditToolbox::T_COUNT; } EEditToolbox * EEditToolboxManager::GetToolbox(size_t type) const { return toolboxes[type]; } pawsWidget * EEditToolboxManager::GetToolboxWidget(size_t type) const { return dynamic_cast(toolboxes[type]); }