Initial community commit
This commit is contained in:
parent
537bcbc862
commit
fc06254474
16440 changed files with 4239995 additions and 2 deletions
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();
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue