From 5683f076331d2831eb4720b65bb53e8d01ca33ee Mon Sep 17 00:00:00 2001 From: Einar Johan Trøan Sømåen Date: Sat, 21 Jul 2012 18:19:07 +0200 Subject: WINTERMUTE: Rename CamelCased filenames to prefixed_under_score-filenames This is mostly a lead-up to namespacing the Ad/Base folders, and then possibly removing the prefixes from the files, it also has the added benefit of getting rid of the odd case-typos that makes for issues on platforms that don't ignore case. --- engines/wintermute/base/base_script_holder.h | 74 ++++++++++++++++++++++++++++ 1 file changed, 74 insertions(+) create mode 100644 engines/wintermute/base/base_script_holder.h (limited to 'engines/wintermute/base/base_script_holder.h') diff --git a/engines/wintermute/base/base_script_holder.h b/engines/wintermute/base/base_script_holder.h new file mode 100644 index 0000000000..0e5bc1b7ec --- /dev/null +++ b/engines/wintermute/base/base_script_holder.h @@ -0,0 +1,74 @@ +/* ScummVM - Graphic Adventure Engine + * + * ScummVM is the legal property of its developers, whose names + * are too numerous to list here. Please refer to the COPYRIGHT + * file distributed with this source distribution. + * + * 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + */ + +/* + * This file is based on WME Lite. + * http://dead-code.org/redir.php?target=wmelite + * Copyright (c) 2011 Jan Nedoma + */ + +#ifndef WINTERMUTE_BSCRIPTHOLDER_H +#define WINTERMUTE_BSCRIPTHOLDER_H + +#include "engines/wintermute/coll_templ.h" +#include "engines/wintermute/persistent.h" +#include "engines/wintermute/base/base_scriptable.h" + +namespace WinterMute { + +class CBScriptHolder : public CBScriptable { +public: + DECLARE_PERSISTENT(CBScriptHolder, CBScriptable) + + CBScriptHolder(CBGame *inGame); + virtual ~CBScriptHolder(); + virtual CScScript *invokeMethodThread(const char *methodName); + virtual void makeFreezable(bool freezable); + bool canHandleEvent(const char *eventName); + virtual bool canHandleMethod(const char *eventMethod); + bool cleanup(); + bool removeScript(CScScript *script); + bool addScript(const char *filename); + virtual bool saveAsText(CBDynBuffer *buffer, int indent); + virtual bool listen(CBScriptHolder *param1, uint32 param2); + bool applyEvent(const char *eventName, bool unbreakable = false); + void setFilename(const char *filename); + bool parseProperty(byte *buffer, bool complete = true); + char *_filename; + bool _freezable; + bool _ready; + + CBArray _scripts; + // scripting interface + virtual CScValue *scGetProperty(const char *name); + virtual bool scSetProperty(const char *name, CScValue *value); + virtual bool scCallMethod(CScScript *script, CScStack *stack, CScStack *thisStack, const char *name); + virtual const char *scToString(); + virtual void scDebuggerDesc(char *buf, int bufSize); + // IWmeObject +public: + virtual bool sendEvent(const char *eventName); +}; + +} // end of namespace WinterMute + +#endif -- cgit v1.2.3 From b5a07fef8ebf29f7f44b15d9b34799c7e115fdad Mon Sep 17 00:00:00 2001 From: Einar Johan Trøan Sømåen Date: Sat, 21 Jul 2012 21:01:47 +0200 Subject: WINTERMUTE: Get rid of the C-prefix for class-definitions. --- engines/wintermute/base/base_script_holder.h | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) (limited to 'engines/wintermute/base/base_script_holder.h') diff --git a/engines/wintermute/base/base_script_holder.h b/engines/wintermute/base/base_script_holder.h index 0e5bc1b7ec..52711572c1 100644 --- a/engines/wintermute/base/base_script_holder.h +++ b/engines/wintermute/base/base_script_holder.h @@ -35,21 +35,21 @@ namespace WinterMute { -class CBScriptHolder : public CBScriptable { +class BaseScriptHolder : public BaseScriptable { public: - DECLARE_PERSISTENT(CBScriptHolder, CBScriptable) + DECLARE_PERSISTENT(BaseScriptHolder, BaseScriptable) - CBScriptHolder(CBGame *inGame); - virtual ~CBScriptHolder(); - virtual CScScript *invokeMethodThread(const char *methodName); + BaseScriptHolder(BaseGame *inGame); + virtual ~BaseScriptHolder(); + virtual ScScript *invokeMethodThread(const char *methodName); virtual void makeFreezable(bool freezable); bool canHandleEvent(const char *eventName); virtual bool canHandleMethod(const char *eventMethod); bool cleanup(); - bool removeScript(CScScript *script); + bool removeScript(ScScript *script); bool addScript(const char *filename); - virtual bool saveAsText(CBDynBuffer *buffer, int indent); - virtual bool listen(CBScriptHolder *param1, uint32 param2); + virtual bool saveAsText(BaseDynamicBuffer *buffer, int indent); + virtual bool listen(BaseScriptHolder *param1, uint32 param2); bool applyEvent(const char *eventName, bool unbreakable = false); void setFilename(const char *filename); bool parseProperty(byte *buffer, bool complete = true); @@ -57,11 +57,11 @@ public: bool _freezable; bool _ready; - CBArray _scripts; + BaseArray _scripts; // scripting interface - virtual CScValue *scGetProperty(const char *name); - virtual bool scSetProperty(const char *name, CScValue *value); - virtual bool scCallMethod(CScScript *script, CScStack *stack, CScStack *thisStack, const char *name); + virtual ScValue *scGetProperty(const char *name); + virtual bool scSetProperty(const char *name, ScValue *value); + virtual bool scCallMethod(ScScript *script, ScStack *stack, ScStack *thisStack, const char *name); virtual const char *scToString(); virtual void scDebuggerDesc(char *buf, int bufSize); // IWmeObject -- cgit v1.2.3 From f6a5a2a0d57d2e0829aa93ac0b30d3c0e1bf8838 Mon Sep 17 00:00:00 2001 From: Einar Johan Trøan Sømåen Date: Sun, 22 Jul 2012 22:55:54 +0200 Subject: WINTERMUTE: Wrap away base_script_holder's _filename field in getters/setters, avoiding direct writes. --- engines/wintermute/base/base_script_holder.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'engines/wintermute/base/base_script_holder.h') diff --git a/engines/wintermute/base/base_script_holder.h b/engines/wintermute/base/base_script_holder.h index 52711572c1..ef1c389dcb 100644 --- a/engines/wintermute/base/base_script_holder.h +++ b/engines/wintermute/base/base_script_holder.h @@ -52,8 +52,8 @@ public: virtual bool listen(BaseScriptHolder *param1, uint32 param2); bool applyEvent(const char *eventName, bool unbreakable = false); void setFilename(const char *filename); + const char *getFilename() { return _filename; } bool parseProperty(byte *buffer, bool complete = true); - char *_filename; bool _freezable; bool _ready; @@ -65,6 +65,8 @@ public: virtual const char *scToString(); virtual void scDebuggerDesc(char *buf, int bufSize); // IWmeObject +private: + char *_filename; public: virtual bool sendEvent(const char *eventName); }; -- cgit v1.2.3 From 4eda234611bd77f053defe9e61d592b308270eaa Mon Sep 17 00:00:00 2001 From: Einar Johan Trøan Sømåen Date: Thu, 26 Jul 2012 19:41:18 +0200 Subject: WINTERMUTE: Replace BaseArray with a templated subclass of Common::Array. This needs additional cleanup, but compiles and runs at this point. --- engines/wintermute/base/base_script_holder.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'engines/wintermute/base/base_script_holder.h') diff --git a/engines/wintermute/base/base_script_holder.h b/engines/wintermute/base/base_script_holder.h index ef1c389dcb..4162936ded 100644 --- a/engines/wintermute/base/base_script_holder.h +++ b/engines/wintermute/base/base_script_holder.h @@ -57,7 +57,7 @@ public: bool _freezable; bool _ready; - BaseArray _scripts; + BaseArray _scripts; // scripting interface virtual ScValue *scGetProperty(const char *name); virtual bool scSetProperty(const char *name, ScValue *value); -- cgit v1.2.3 From fed19cb66ae5b56dd7dc81b90edd5a0d15986678 Mon Sep 17 00:00:00 2001 From: Einar Johan Trøan Sømåen Date: Mon, 13 Aug 2012 03:42:30 +0200 Subject: WINTERMUTE: WinterMute -> Wintermute --- engines/wintermute/base/base_script_holder.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'engines/wintermute/base/base_script_holder.h') diff --git a/engines/wintermute/base/base_script_holder.h b/engines/wintermute/base/base_script_holder.h index 4162936ded..4f3d5f4ef9 100644 --- a/engines/wintermute/base/base_script_holder.h +++ b/engines/wintermute/base/base_script_holder.h @@ -33,7 +33,7 @@ #include "engines/wintermute/persistent.h" #include "engines/wintermute/base/base_scriptable.h" -namespace WinterMute { +namespace Wintermute { class BaseScriptHolder : public BaseScriptable { public: @@ -71,6 +71,6 @@ public: virtual bool sendEvent(const char *eventName); }; -} // end of namespace WinterMute +} // end of namespace Wintermute #endif -- cgit v1.2.3 From 07c27b775c8d3997bf40891c2772ae8859eb534d Mon Sep 17 00:00:00 2001 From: Einar Johan Trøan Sømåen Date: Fri, 31 Aug 2012 19:35:49 +0200 Subject: WINTERMUTE: Cleanup the header-guards. --- engines/wintermute/base/base_script_holder.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'engines/wintermute/base/base_script_holder.h') diff --git a/engines/wintermute/base/base_script_holder.h b/engines/wintermute/base/base_script_holder.h index 4f3d5f4ef9..cab0d4f693 100644 --- a/engines/wintermute/base/base_script_holder.h +++ b/engines/wintermute/base/base_script_holder.h @@ -26,8 +26,8 @@ * Copyright (c) 2011 Jan Nedoma */ -#ifndef WINTERMUTE_BSCRIPTHOLDER_H -#define WINTERMUTE_BSCRIPTHOLDER_H +#ifndef WINTERMUTE_BASE_SCRIPTHOLDER_H +#define WINTERMUTE_BASE_SCRIPTHOLDER_H #include "engines/wintermute/coll_templ.h" #include "engines/wintermute/persistent.h" -- cgit v1.2.3 From b4090ead4d4334e08725323ff72fd355c93b63d5 Mon Sep 17 00:00:00 2001 From: Willem Jan Palenstijn Date: Tue, 4 Sep 2012 22:17:23 +0200 Subject: WINTERMUTE: Convert CRLF to LF --- engines/wintermute/base/base_script_holder.h | 152 +++++++++++++-------------- 1 file changed, 76 insertions(+), 76 deletions(-) (limited to 'engines/wintermute/base/base_script_holder.h') diff --git a/engines/wintermute/base/base_script_holder.h b/engines/wintermute/base/base_script_holder.h index cab0d4f693..0c3d7a1a70 100644 --- a/engines/wintermute/base/base_script_holder.h +++ b/engines/wintermute/base/base_script_holder.h @@ -1,76 +1,76 @@ -/* ScummVM - Graphic Adventure Engine - * - * ScummVM is the legal property of its developers, whose names - * are too numerous to list here. Please refer to the COPYRIGHT - * file distributed with this source distribution. - * - * 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - */ - -/* - * This file is based on WME Lite. - * http://dead-code.org/redir.php?target=wmelite - * Copyright (c) 2011 Jan Nedoma - */ - -#ifndef WINTERMUTE_BASE_SCRIPTHOLDER_H -#define WINTERMUTE_BASE_SCRIPTHOLDER_H - -#include "engines/wintermute/coll_templ.h" -#include "engines/wintermute/persistent.h" -#include "engines/wintermute/base/base_scriptable.h" - -namespace Wintermute { - -class BaseScriptHolder : public BaseScriptable { -public: - DECLARE_PERSISTENT(BaseScriptHolder, BaseScriptable) - - BaseScriptHolder(BaseGame *inGame); - virtual ~BaseScriptHolder(); - virtual ScScript *invokeMethodThread(const char *methodName); - virtual void makeFreezable(bool freezable); - bool canHandleEvent(const char *eventName); - virtual bool canHandleMethod(const char *eventMethod); - bool cleanup(); - bool removeScript(ScScript *script); - bool addScript(const char *filename); - virtual bool saveAsText(BaseDynamicBuffer *buffer, int indent); - virtual bool listen(BaseScriptHolder *param1, uint32 param2); - bool applyEvent(const char *eventName, bool unbreakable = false); - void setFilename(const char *filename); - const char *getFilename() { return _filename; } - bool parseProperty(byte *buffer, bool complete = true); - bool _freezable; - bool _ready; - - BaseArray _scripts; - // scripting interface - virtual ScValue *scGetProperty(const char *name); - virtual bool scSetProperty(const char *name, ScValue *value); - virtual bool scCallMethod(ScScript *script, ScStack *stack, ScStack *thisStack, const char *name); - virtual const char *scToString(); - virtual void scDebuggerDesc(char *buf, int bufSize); - // IWmeObject -private: - char *_filename; -public: - virtual bool sendEvent(const char *eventName); -}; - -} // end of namespace Wintermute - -#endif +/* ScummVM - Graphic Adventure Engine + * + * ScummVM is the legal property of its developers, whose names + * are too numerous to list here. Please refer to the COPYRIGHT + * file distributed with this source distribution. + * + * 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + */ + +/* + * This file is based on WME Lite. + * http://dead-code.org/redir.php?target=wmelite + * Copyright (c) 2011 Jan Nedoma + */ + +#ifndef WINTERMUTE_BASE_SCRIPTHOLDER_H +#define WINTERMUTE_BASE_SCRIPTHOLDER_H + +#include "engines/wintermute/coll_templ.h" +#include "engines/wintermute/persistent.h" +#include "engines/wintermute/base/base_scriptable.h" + +namespace Wintermute { + +class BaseScriptHolder : public BaseScriptable { +public: + DECLARE_PERSISTENT(BaseScriptHolder, BaseScriptable) + + BaseScriptHolder(BaseGame *inGame); + virtual ~BaseScriptHolder(); + virtual ScScript *invokeMethodThread(const char *methodName); + virtual void makeFreezable(bool freezable); + bool canHandleEvent(const char *eventName); + virtual bool canHandleMethod(const char *eventMethod); + bool cleanup(); + bool removeScript(ScScript *script); + bool addScript(const char *filename); + virtual bool saveAsText(BaseDynamicBuffer *buffer, int indent); + virtual bool listen(BaseScriptHolder *param1, uint32 param2); + bool applyEvent(const char *eventName, bool unbreakable = false); + void setFilename(const char *filename); + const char *getFilename() { return _filename; } + bool parseProperty(byte *buffer, bool complete = true); + bool _freezable; + bool _ready; + + BaseArray _scripts; + // scripting interface + virtual ScValue *scGetProperty(const char *name); + virtual bool scSetProperty(const char *name, ScValue *value); + virtual bool scCallMethod(ScScript *script, ScStack *stack, ScStack *thisStack, const char *name); + virtual const char *scToString(); + virtual void scDebuggerDesc(char *buf, int bufSize); + // IWmeObject +private: + char *_filename; +public: + virtual bool sendEvent(const char *eventName); +}; + +} // end of namespace Wintermute + +#endif -- cgit v1.2.3 From afc21941e37a7481f5fe050d220968bdce43c873 Mon Sep 17 00:00:00 2001 From: Einar Johan Trøan Sømåen Date: Sat, 29 Sep 2012 00:47:12 +0200 Subject: WINTERMUTE: Make scGetProperty use Common::String& instead of const char* --- engines/wintermute/base/base_script_holder.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'engines/wintermute/base/base_script_holder.h') diff --git a/engines/wintermute/base/base_script_holder.h b/engines/wintermute/base/base_script_holder.h index 0c3d7a1a70..5fd0dbec9c 100644 --- a/engines/wintermute/base/base_script_holder.h +++ b/engines/wintermute/base/base_script_holder.h @@ -59,7 +59,7 @@ public: BaseArray _scripts; // scripting interface - virtual ScValue *scGetProperty(const char *name); + virtual ScValue *scGetProperty(const Common::String &name); virtual bool scSetProperty(const char *name, ScValue *value); virtual bool scCallMethod(ScScript *script, ScStack *stack, ScStack *thisStack, const char *name); virtual const char *scToString(); -- cgit v1.2.3