mirror of
https://github.com/WinampDesktop/winamp.git
synced 2024-12-04 21:51:02 -05:00
179 lines
6 KiB
C++
179 lines
6 KiB
C++
/* This file was generated by Maki Compiler, do not edit manually */
|
|
|
|
#include <precomp.h>
|
|
|
|
#include "c_container.h"
|
|
#include <api/script/objcontroller.h>
|
|
|
|
C_Container::C_Container(ScriptObject *object) : C_RootObject(object) {
|
|
inited = 0;
|
|
obj = NULL;
|
|
C_hook(object);
|
|
}
|
|
|
|
C_Container::C_Container() {
|
|
inited = 0;
|
|
obj = NULL;
|
|
}
|
|
|
|
void C_Container::C_hook(ScriptObject *object) {
|
|
ASSERT(!inited);
|
|
ScriptObjectController *controller = object->vcpu_getController();
|
|
obj = controller->cast(object, containerGuid);
|
|
if (obj != object && obj != NULL)
|
|
controller = obj->vcpu_getController();
|
|
else
|
|
obj = NULL;
|
|
|
|
int iter = WASABI_API_APP->app_getInitCount();
|
|
if (!loaded || loaded != iter) {
|
|
loaded = iter;
|
|
onswitchtolayout_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"onSwitchToLayout", this);
|
|
onbeforeswitchtolayout_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"onBeforeSwitchToLayout", this);
|
|
setxmlparam_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"setXmlParam", this);
|
|
onhidelayout_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"onHideLayout", this);
|
|
onshowlayout_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"onShowLayout", this);
|
|
getlayout_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"getLayout", this);
|
|
getnumlayouts_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"getNumLayouts", this);
|
|
enumlayout_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"enumLayout", this);
|
|
switchtolayout_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"switchToLayout", this);
|
|
show_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"show", this);
|
|
hide_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"hide", this);
|
|
close_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"close", this);
|
|
toggle_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"toggle", this);
|
|
isdynamic_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"isDynamic", this);
|
|
setname_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"setName", this);
|
|
getcurlayout_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"getCurLayout", this);
|
|
}
|
|
inited = 1;
|
|
}
|
|
|
|
C_Container::~C_Container() {
|
|
}
|
|
|
|
ScriptObject *C_Container::getScriptObject() {
|
|
if (obj != NULL) return obj;
|
|
return C_CONTAINER_PARENT::getScriptObject();
|
|
}
|
|
|
|
void C_Container::onSwitchToLayout(ScriptObject *newlayout) {
|
|
ASSERT(inited);
|
|
scriptVar a = MAKE_SCRIPT_OBJECT(newlayout);
|
|
scriptVar *params[1] = {&a};
|
|
WASABI_API_MAKI->maki_callFunction(getScriptObject(), onswitchtolayout_id, params);
|
|
}
|
|
|
|
void C_Container::onBeforeSwitchToLayout(ScriptObject *oldlayout, ScriptObject *newlayout) {
|
|
ASSERT(inited);
|
|
scriptVar a = MAKE_SCRIPT_OBJECT(oldlayout);
|
|
scriptVar b = MAKE_SCRIPT_OBJECT(newlayout);
|
|
scriptVar *params[2] = {&a, &b};
|
|
WASABI_API_MAKI->maki_callFunction(getScriptObject(), onbeforeswitchtolayout_id, params);
|
|
}
|
|
|
|
void C_Container::setXmlParam(const wchar_t *param, const wchar_t *value)
|
|
{
|
|
ASSERT(inited);
|
|
scriptVar a = MAKE_SCRIPT_STRING(param);
|
|
scriptVar b = MAKE_SCRIPT_STRING(value);
|
|
scriptVar *params[2] = {&a, &b};
|
|
WASABI_API_MAKI->maki_callFunction(getScriptObject(), setxmlparam_id, params);
|
|
}
|
|
|
|
void C_Container::onHideLayout(ScriptObject *_layout) {
|
|
ASSERT(inited);
|
|
scriptVar a = MAKE_SCRIPT_OBJECT(_layout);
|
|
scriptVar *params[1] = {&a};
|
|
WASABI_API_MAKI->maki_callFunction(getScriptObject(), onhidelayout_id, params);
|
|
}
|
|
|
|
void C_Container::onShowLayout(ScriptObject *_layout) {
|
|
ASSERT(inited);
|
|
scriptVar a = MAKE_SCRIPT_OBJECT(_layout);
|
|
scriptVar *params[1] = {&a};
|
|
WASABI_API_MAKI->maki_callFunction(getScriptObject(), onshowlayout_id, params);
|
|
}
|
|
|
|
ScriptObject *C_Container::getLayout(const wchar_t *layout_id)
|
|
{
|
|
ASSERT(inited);
|
|
scriptVar a = MAKE_SCRIPT_STRING(layout_id);
|
|
scriptVar *params[1] = {&a};
|
|
return GET_SCRIPT_OBJECT(WASABI_API_MAKI->maki_callFunction(getScriptObject(), getlayout_id, params));
|
|
}
|
|
|
|
int C_Container::getNumLayouts() {
|
|
ASSERT(inited);
|
|
return GET_SCRIPT_INT(WASABI_API_MAKI->maki_callFunction(getScriptObject(), getnumlayouts_id, NULL));
|
|
}
|
|
|
|
ScriptObject *C_Container::enumLayout(int num) {
|
|
ASSERT(inited);
|
|
scriptVar a = MAKE_SCRIPT_INT(num);
|
|
scriptVar *params[1] = {&a};
|
|
return GET_SCRIPT_OBJECT(WASABI_API_MAKI->maki_callFunction(getScriptObject(), enumlayout_id, params));
|
|
}
|
|
|
|
void C_Container::switchToLayout(const wchar_t *layout_id)
|
|
{
|
|
ASSERT(inited);
|
|
scriptVar a = MAKE_SCRIPT_STRING(layout_id);
|
|
scriptVar *params[1] = {&a};
|
|
WASABI_API_MAKI->maki_callFunction(getScriptObject(), switchtolayout_id, params);
|
|
}
|
|
|
|
void C_Container::show() {
|
|
ASSERT(inited);
|
|
WASABI_API_MAKI->maki_callFunction(getScriptObject(), show_id, NULL);
|
|
}
|
|
|
|
void C_Container::hide() {
|
|
ASSERT(inited);
|
|
WASABI_API_MAKI->maki_callFunction(getScriptObject(), hide_id, NULL);
|
|
}
|
|
|
|
void C_Container::close() {
|
|
ASSERT(inited);
|
|
WASABI_API_MAKI->maki_callFunction(getScriptObject(), close_id, NULL);
|
|
}
|
|
|
|
void C_Container::toggle() {
|
|
ASSERT(inited);
|
|
WASABI_API_MAKI->maki_callFunction(getScriptObject(), toggle_id, NULL);
|
|
}
|
|
|
|
int C_Container::isDynamic() {
|
|
ASSERT(inited);
|
|
return GET_SCRIPT_INT(WASABI_API_MAKI->maki_callFunction(getScriptObject(), isdynamic_id, NULL));
|
|
}
|
|
|
|
void C_Container::setName(const wchar_t *name)
|
|
{
|
|
ASSERT(inited);
|
|
scriptVar a = MAKE_SCRIPT_STRING(name);
|
|
scriptVar *params[1] = {&a};
|
|
WASABI_API_MAKI->maki_callFunction(getScriptObject(), setname_id, params);
|
|
}
|
|
|
|
ScriptObject *C_Container::getCurLayout() {
|
|
ASSERT(inited);
|
|
return GET_SCRIPT_OBJECT(WASABI_API_MAKI->maki_callFunction(getScriptObject(), getcurlayout_id, NULL));
|
|
}
|
|
|
|
int C_Container::loaded=0;
|
|
int C_Container::onswitchtolayout_id=0;
|
|
int C_Container::onbeforeswitchtolayout_id=0;
|
|
int C_Container::setxmlparam_id=0;
|
|
int C_Container::onhidelayout_id=0;
|
|
int C_Container::onshowlayout_id=0;
|
|
int C_Container::getlayout_id=0;
|
|
int C_Container::getnumlayouts_id=0;
|
|
int C_Container::enumlayout_id=0;
|
|
int C_Container::switchtolayout_id=0;
|
|
int C_Container::show_id=0;
|
|
int C_Container::hide_id=0;
|
|
int C_Container::close_id=0;
|
|
int C_Container::toggle_id=0;
|
|
int C_Container::isdynamic_id=0;
|
|
int C_Container::setname_id=0;
|
|
int C_Container::getcurlayout_id=0;
|