Move CommandFactory class from command.h to command_factory.h.

This commit is contained in:
David Capello 2011-01-20 20:02:54 -03:00
parent 8e8ac7aa50
commit af3c4e9fba
2 changed files with 37 additions and 17 deletions

View File

@ -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

View File

@ -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