mirror of
https://github.com/WinampDesktop/winamp.git
synced 2025-06-10 11:59:58 -05:00
Initial community commit
This commit is contained in:
53
Src/Wasabi/api/wnd/wndclass/svcwndhold.cpp
Normal file
53
Src/Wasabi/api/wnd/wndclass/svcwndhold.cpp
Normal file
@ -0,0 +1,53 @@
|
||||
#include <precomp.h>
|
||||
|
||||
#include "svcwndhold.h"
|
||||
|
||||
#include <bfc/common.h>
|
||||
|
||||
#include <api/service/svcs/svc_wndcreate.h>
|
||||
|
||||
#include <api/wnd/wndclass/blankwnd.h>
|
||||
|
||||
ServiceWndHolder::ServiceWndHolder(ifc_window *_child, svc_windowCreate *_svc) :
|
||||
child(NULL), svc(NULL)
|
||||
{
|
||||
setChild(_child, _svc);
|
||||
}
|
||||
|
||||
ServiceWndHolder::~ServiceWndHolder()
|
||||
{
|
||||
if (svc != NULL)
|
||||
{
|
||||
svc->destroyWindow(child);
|
||||
if (!svc->refcount())
|
||||
WASABI_API_SVC->service_release(svc);
|
||||
} else {
|
||||
delete static_cast<BaseWnd*>(child);
|
||||
}
|
||||
}
|
||||
|
||||
int ServiceWndHolder::setChild(ifc_window *_child, svc_windowCreate *_svc)
|
||||
{
|
||||
if (child == _child && svc == _svc) return 0;
|
||||
|
||||
if (child != NULL) {
|
||||
if (svc != NULL) {
|
||||
svc->destroyWindow(child);
|
||||
if (!svc->refcount())
|
||||
WASABI_API_SVC->service_release(svc);
|
||||
svc = NULL;
|
||||
} else {
|
||||
delete static_cast<BaseWnd*>(child);
|
||||
}
|
||||
child = NULL;
|
||||
}
|
||||
|
||||
child = _child;
|
||||
svc = _svc;
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
ifc_window *ServiceWndHolder::rootwndholder_getRootWnd() {
|
||||
return child ? child : SERVICEWNDHOLDER_PARENT::rootwndholder_getRootWnd();
|
||||
}
|
Reference in New Issue
Block a user