Skip to content

Commit

Permalink
Coding standards cleanup of libmythfreemheg
Browse files Browse the repository at this point in the history
  • Loading branch information
stuartm committed Aug 21, 2011
1 parent e6dfefb commit 1067f8c
Show file tree
Hide file tree
Showing 41 changed files with 6,201 additions and 2,242 deletions.
533 changes: 396 additions & 137 deletions mythtv/libs/libmythfreemheg/Actions.cpp

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion mythtv/libs/libmythfreemheg/Actions.h
Expand Up @@ -27,7 +27,7 @@ class MHElemAction;

class MHActionSequence: public MHOwnPtrSequence<MHElemAction>
{
public:
public:
MHActionSequence() {}
virtual ~MHActionSequence() {}
virtual void Initialise(MHParseNode *p, MHEngine *engine);
Expand Down
8 changes: 4 additions & 4 deletions mythtv/libs/libmythfreemheg/BaseActions.cpp
Expand Up @@ -38,8 +38,8 @@ void MHElemAction::PrintMe(FILE *fd, int nTabs) const
{
PrintTabs(fd, nTabs);
fprintf(fd, "%s (", m_ActionName);
m_Target.PrintMe(fd, nTabs+1);
PrintArgs(fd, nTabs+1); // Any other arguments must be handled by the subclass.
m_Target.PrintMe(fd, nTabs + 1);
PrintArgs(fd, nTabs + 1); // Any other arguments must be handled by the subclass.
fprintf(fd, ")\n");
}

Expand Down Expand Up @@ -152,8 +152,8 @@ void MHActionInt6::PrintArgs(FILE *fd, int /*nTabs*/) const

void MHActionInt6::Perform(MHEngine *engine)
{
CallAction(engine, Target(engine), m_Argument1.GetValue(engine), m_Argument2.GetValue(engine), m_Argument3.GetValue(engine),
m_Argument4.GetValue(engine), m_Argument5.GetValue(engine), m_Argument6.GetValue(engine));
CallAction(engine, Target(engine), m_Argument1.GetValue(engine), m_Argument2.GetValue(engine), m_Argument3.GetValue(engine),
m_Argument4.GetValue(engine), m_Argument5.GetValue(engine), m_Argument6.GetValue(engine));
}


Expand Down
44 changes: 22 additions & 22 deletions mythtv/libs/libmythfreemheg/BaseActions.h
Expand Up @@ -30,16 +30,16 @@ class MHRoot;
// Abstract base class for MHEG elementary actions.
// The first argument of most (all?) actions is an object reference which is
// the target of the action so we can handle some of the parsing and printing
// within this class rather than the derived classes.
class MHElemAction
// within this class rather than the derived classes.
class MHElemAction
{
public:
public:
MHElemAction(const char *name): m_ActionName(name) {}
virtual ~MHElemAction() {}
virtual void Initialise(MHParseNode *p, MHEngine *engine);
virtual void PrintMe(FILE *fd, int nTabs) const;
virtual void Perform(MHEngine *engine) = 0; // Perform the action.
protected:
protected:
virtual void PrintArgs(FILE *, int) const {}
MHRoot *Target(MHEngine *engine); // Look up the target
const char *m_ActionName;
Expand All @@ -50,103 +50,103 @@ class MHElemAction
// Base class for actions with a single integer argument.
class MHActionInt: public MHElemAction
{
public:
public:
MHActionInt(const char *name): MHElemAction(name) {}
virtual void Initialise(MHParseNode *p, MHEngine *engine);
virtual void PrintArgs(FILE *fd, int) const { m_Argument.PrintMe(fd, 0); }
virtual void Perform(MHEngine *engine);
virtual void CallAction(MHEngine *engine, MHRoot *pTarget, int nArg) = 0;
protected:
protected:
MHGenericInteger m_Argument;
};

// Base class for actions with a pair of integer arguments.
class MHActionIntInt: public MHElemAction
{
public:
public:
MHActionIntInt(const char *name): MHElemAction(name) {}
virtual void Initialise(MHParseNode *p, MHEngine *engine);
virtual void PrintArgs(FILE *fd, int/* nTabs*/) const { m_Argument1.PrintMe(fd, 0); m_Argument2.PrintMe(fd, 0); }
virtual void Perform(MHEngine *engine);
virtual void CallAction(MHEngine *engine, MHRoot *pTarget, int nArg1, int nArg2) = 0;
protected:
protected:
MHGenericInteger m_Argument1, m_Argument2;
};

// Base class for actions with three integers. Used for SetSliderParameters
class MHActionInt3: public MHElemAction
{
public:
public:
MHActionInt3(const char *name): MHElemAction(name) {}
virtual void Initialise(MHParseNode *p, MHEngine *engine);
virtual void PrintArgs(FILE *fd, int nTabs) const;
virtual void Perform(MHEngine *engine);
virtual void CallAction(MHEngine *engine, MHRoot *pTarget, int nArg1, int nArg2, int nArg3) = 0;
protected:
protected:
MHGenericInteger m_Argument1, m_Argument2, m_Argument3;
};

// Base class for actions with four integers. Used in the DynamicLineArt class
class MHActionInt4: public MHElemAction
{
public:
public:
MHActionInt4(const char *name): MHElemAction(name) {}
virtual void Initialise(MHParseNode *p, MHEngine *engine);
virtual void PrintArgs(FILE *fd, int nTabs) const;
virtual void Perform(MHEngine *engine);
virtual void CallAction(MHEngine *engine, MHRoot *pTarget, int nArg1, int nArg2, int nArg3, int nArg4) = 0;
protected:
protected:
MHGenericInteger m_Argument1, m_Argument2, m_Argument3, m_Argument4;
};

// Base class for actions with six integers. Used in the DynamicLineArt class
class MHActionInt6: public MHElemAction
{
public:
public:
MHActionInt6(const char *name): MHElemAction(name) {}
virtual void Initialise(MHParseNode *p, MHEngine *engine);
virtual void PrintArgs(FILE *fd, int nTabs) const;
virtual void Perform(MHEngine *engine);
virtual void CallAction(MHEngine *engine, MHRoot *pTarget, int nArg1, int nArg2, int nArg3, int nArg4, int nArg5, int nArg6) = 0;
protected:
protected:
MHGenericInteger m_Argument1, m_Argument2, m_Argument3, m_Argument4, m_Argument5, m_Argument6;
};


// An action with an object reference as an argument.
class MHActionObjectRef: public MHElemAction
{
public:
public:
MHActionObjectRef(const char *name): MHElemAction(name) {}
virtual void Initialise(MHParseNode *p, MHEngine *engine);
virtual void Perform(MHEngine *engine);
virtual void CallAction(MHEngine *engine, MHRoot *pTarget, MHRoot *pArg) = 0;
private:
private:
virtual void PrintArgs(FILE *fd, int/* nTabs*/) const { m_ResultVar.PrintMe(fd, 0); }
MHObjectRef m_ResultVar;
};

// An action with two object references as an argument.
class MHActionObjectRef2: public MHElemAction
{
public:
public:
MHActionObjectRef2(const char *name): MHElemAction(name) {}
virtual void Initialise(MHParseNode *p, MHEngine *engine);
virtual void Perform(MHEngine *engine);
virtual void CallAction(MHEngine *engine, MHRoot *pTarget, MHRoot *pArg1, MHRoot *pArg2) = 0;
private:
private:
virtual void PrintArgs(FILE *fd, int/* nTabs*/) const { m_ResultVar1.PrintMe(fd, 0); m_ResultVar2.PrintMe(fd, 0);}
MHObjectRef m_ResultVar1, m_ResultVar2;
};

class MHActionGenericObjectRef: public MHElemAction
{
public:
public:
MHActionGenericObjectRef(const char *name): MHElemAction(name) {}
virtual void Initialise(MHParseNode *p, MHEngine *engine);
virtual void Perform(MHEngine *engine);
virtual void CallAction(MHEngine *engine, MHRoot *pTarget, MHRoot *pObj) = 0;
protected:
protected:
virtual void PrintArgs(FILE *fd, int/* nTabs*/) const { m_RefObject.PrintMe(fd, 0); }
MHGenericObjectRef m_RefObject;
};
Expand All @@ -155,13 +155,13 @@ class MHActionGenericObjectRef: public MHElemAction
// Base class for actions with a single boolean argument.
class MHActionBool: public MHElemAction
{
public:
public:
MHActionBool(const char *name): MHElemAction(name) {}
virtual void Initialise(MHParseNode *p, MHEngine *engine);
virtual void PrintArgs(FILE *fd, int) const { m_Argument.PrintMe(fd, 0); }
virtual void Perform(MHEngine *engine);
virtual void CallAction(MHEngine *engine, MHRoot *pTarget, bool fArg) = 0;
protected:
protected:
MHGenericBoolean m_Argument;
};

Expand Down

0 comments on commit 1067f8c

Please sign in to comment.