diff --git a/src/commands/command.h b/src/commands/command.h index 659104dcd..23c70021d 100644 --- a/src/commands/command.h +++ b/src/commands/command.h @@ -19,6 +19,8 @@ #ifndef COMMANDS_COMMAND_H_INCLUDED #define COMMANDS_COMMAND_H_INCLUDED +#include "commands/command_factory.h" + enum CommandFlags { CmdUIOnlyFlag = 0x00000001, CmdRecordableFlag = 0x00000002, @@ -27,9 +29,6 @@ enum CommandFlags { class Context; class Params; -////////////////////////////////////////////////////////////////////// -// Command - class Command { const char* m_short_name; @@ -58,18 +57,4 @@ protected: virtual void onExecute(Context* context); }; -////////////////////////////////////////////////////////////////////// -// CommandFactory - -class CommandFactory -{ -public: - #undef FOR_EACH_COMMAND - #define FOR_EACH_COMMAND(name) \ - static Command* create_##name##_command(); - - #include "commands/commands_list.h" - #undef FOR_EACH_COMMAND -}; - #endif diff --git a/src/commands/command_factory.h b/src/commands/command_factory.h new file mode 100644 index 000000000..ef3ce310f --- /dev/null +++ b/src/commands/command_factory.h @@ -0,0 +1,35 @@ +/* ASE - Allegro Sprite Editor + * Copyright (C) 2001-2011 David Capello + * + * 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; either version 2 of the License, or + * (at your option) any later version. + * + * 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 + */ + +#ifndef COMMANDS_COMMAND_FACTORY_H_INCLUDED +#define COMMANDS_COMMAND_FACTORY_H_INCLUDED + +class Command; + +class CommandFactory +{ +public: + #undef FOR_EACH_COMMAND + #define FOR_EACH_COMMAND(name) \ + static Command* create_##name##_command(); + + #include "commands/commands_list.h" + #undef FOR_EACH_COMMAND +}; + +#endif