123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136 |
- #include "precomp.h"
- #include "feedwatch.h"
- #include "FeedWatcherSO.h"
- static FeedWatcherScriptController _feedWatcherScriptController;FeedWatcherScriptController *feedWatcherScriptController = &_feedWatcherScriptController;
- function_descriptor_struct FeedWatcherScriptController::exportedFunctions[] = {
- { L"setFeed", 1, script_setFeed },
- { L"releaseFeed", 0, script_releaseFeed },
- { L"onFeedChange", 1, script_feedwatcher_onFeedChange },
- };
- FeedWatcherScriptObject::FeedWatcherScriptObject() {
- if (!getScriptObject()) return;
- feedWatcherScriptObject_init();
- }
- FeedWatcherScriptObject::~FeedWatcherScriptObject() {
- }
- void FeedWatcherScriptObject::feedWatcherScriptObject_init() {
-
- getScriptObject()->vcpu_setInterface(FeedWatcherGuid, (void *)static_cast<FeedWatcher*>(this));
-
- getScriptObject()->vcpu_setClassName(L"FeedWatcher");
-
- getScriptObject()->vcpu_setController(feedWatcherScriptController);
- }
- void FeedWatcherScriptObject::feedwatcher_onFeedChange(const wchar_t *data) {
- FeedWatcherScriptController::script_feedwatcher_onFeedChange(SCRIPT_CALL, getScriptObject(), MAKE_SCRIPT_STRING(data));
- }
- scriptVar FeedWatcherScriptController::script_setFeed(SCRIPT_FUNCTION_PARAMS, ScriptObject *_pSO, scriptVar feedid) {
-
- SCRIPT_FUNCTION_INIT;
-
- FeedWatcher*_pObj = static_cast<FeedWatcher*>(_pSO->vcpu_getInterface(FeedWatcherGuid));
- if (_pObj) {
- return MAKE_SCRIPT_INT(_pObj->setFeed(GET_SCRIPT_STRING(feedid)));
- }
- RETURN_SCRIPT_ZERO;
- }
- scriptVar FeedWatcherScriptController::script_releaseFeed(SCRIPT_FUNCTION_PARAMS, ScriptObject *_pSO) {
-
- SCRIPT_FUNCTION_INIT;
-
- FeedWatcher*_pObj = static_cast<FeedWatcher*>(_pSO->vcpu_getInterface(FeedWatcherGuid));
- if (_pObj) {
-
- _pObj->releaseFeed();
- }
- RETURN_SCRIPT_VOID;
- }
- scriptVar FeedWatcherScriptController::script_feedwatcher_onFeedChange(SCRIPT_FUNCTION_PARAMS, ScriptObject *_pSO, scriptVar data) {
-
- SCRIPT_FUNCTION_INIT;
-
- PROCESS_HOOKS1(_pSO, feedWatcherScriptController, data);
-
- SCRIPT_FUNCTION_CHECKABORTEVENT;
-
- SCRIPT_EXEC_EVENT1(_pSO, data);
- }
- const wchar_t *FeedWatcherScriptController::getClassName() {
- return L"FeedWatcher";
- }
- const wchar_t *FeedWatcherScriptController::getAncestorClassName() {
- return FEEDWATCHER_SCRIPTPARENTCLASS;
- }
- ScriptObjectController *FeedWatcherScriptController::getAncestorController() {
-
- return NULL;
- }
- int FeedWatcherScriptController::getNumFunctions() {
- return sizeof(exportedFunctions) / sizeof(function_descriptor_struct);
- }
- const function_descriptor_struct *FeedWatcherScriptController::getExportedFunctions() {
- return exportedFunctions;
- }
- GUID FeedWatcherScriptController::getClassGuid() {
- return FeedWatcherGuid;
- }
- ScriptObject *FeedWatcherScriptController::instantiate() {
- FeedWatcher*_pObj = new FeedWatcher();
- ASSERT(_pObj != NULL);
- return _pObj->getScriptObject();
- }
- void FeedWatcherScriptController::destroy(ScriptObject *o) {
- FeedWatcher*_pObj = static_cast<FeedWatcher*>(o->vcpu_getInterface(FeedWatcherGuid));
- ASSERT(_pObj != NULL);
- delete _pObj;
- }
- void *FeedWatcherScriptController::encapsulate(ScriptObject *o) {
-
- return NULL;
- }
- void FeedWatcherScriptController::deencapsulate(void *o) {
- }
|