Archived
1
0
This repository has been archived on 2024-10-17. You can view files and clone it, but cannot push or open issues or pull requests.
winamp/Src/Wasabi/api/skin/widgets/xuicustomobject.cpp

65 lines
2.0 KiB
C++
Raw Normal View History

2024-09-24 12:54:57 +00:00
#include <precomp.h>
#include "xuicustomobject.h"
#include <api/wnd/notifmsg.h>
// -----------------------------------------------------------------------
const wchar_t CustomObjectXuiObjectStr[] = L"CustomObject"; // This is the xml tag
char CustomObjectXuiSvcName[] = "CustomObject xui object";
XMLParamPair XuiCustomObject::params[] = {
{CUSTOMOBJECT_SETGROUP, L"GROUPID"},
};
// -----------------------------------------------------------------------
XuiCustomObject::XuiCustomObject()
{
myxuihandle = newXuiHandle();
CreateXMLParameters(myxuihandle);
ScriptObject *o = getGuiObject()->guiobject_getScriptObject();
o->vcpu_setInterface(customObjectGuid, static_cast<CustomObject *>(this));
}
void XuiCustomObject::CreateXMLParameters(int master_handle)
{
//CUSTOMOBJECT_PARENT::CreateXMLParameters(master_handle);
int numParams = sizeof(params) / sizeof(params[0]);
hintNumberOfParams(myxuihandle, numParams);
for (int i = 0;i < numParams;i++)
addParam(myxuihandle, params[i], XUI_ATTRIBUTE_IMPLIED);
}
// -----------------------------------------------------------------------
XuiCustomObject::~XuiCustomObject() {
}
// -----------------------------------------------------------------------
int XuiCustomObject::setXuiParam(int xuihandle, int xmlattributeid, const wchar_t *xmlattributename, const wchar_t *value) {
if (xuihandle != myxuihandle)
return CUSTOMOBJECT_PARENT::setXuiParam(xuihandle, xmlattributeid, xmlattributename, value);
switch (xmlattributeid) {
case CUSTOMOBJECT_SETGROUP:
setContent(value);
break;
default:
return 0;
}
return 1;
}
// -----------------------------------------------------------------------
void XuiCustomObject::setGroup(const wchar_t *elementname) {
setContent(elementname);
}
// -----------------------------------------------------------------------
void XuiCustomObject::customobject_setRootWnd(ifc_window *w) {
rootwndholder_setRootWnd(NULL);
groupid = L"";
setContent(groupid);
if (w != NULL) rootwndholder_setRootWnd(w);
notifyParent(ChildNotify::AUTOWHCHANGED);
}