Initial community commit
This commit is contained in:
parent
537bcbc862
commit
fc06254474
16440 changed files with 4239995 additions and 2 deletions
2
Src/Wasabi/api/dependency/api_dependent.cpp
Normal file
2
Src/Wasabi/api/dependency/api_dependent.cpp
Normal file
|
@ -0,0 +1,2 @@
|
|||
#include <precomp.h>
|
||||
#include "api_dependent.h"
|
54
Src/Wasabi/api/dependency/api_dependent.h
Normal file
54
Src/Wasabi/api/dependency/api_dependent.h
Normal file
|
@ -0,0 +1,54 @@
|
|||
#ifndef __WASABI_API_DEPENDENT_H
|
||||
#define __WASABI_API_DEPENDENT_H
|
||||
|
||||
#include <bfc/dispatch.h>
|
||||
#include "api_dependentviewer.h"
|
||||
|
||||
// we define some common event codes here. if your object needs more send
|
||||
// them as parameters to OBJECTSPECIFIC
|
||||
|
||||
// some system-level codes for cb param. You can implement your own events
|
||||
// with DEPCB_EVENT and the parameters
|
||||
namespace DependentCB
|
||||
{
|
||||
enum {
|
||||
DEPCB_NOP = 0,
|
||||
DEPCB_DELETED = 100, // object being deleted
|
||||
DEPCB_EVENT = 1000, // object-specific event. use param1 etc to send your messages
|
||||
};
|
||||
};
|
||||
|
||||
class NOVTABLE ifc_dependent : public Dispatchable
|
||||
{
|
||||
protected:
|
||||
ifc_dependent() {}
|
||||
~ifc_dependent() {}
|
||||
public:
|
||||
void dependent_regViewer(ifc_dependentviewer *viewer, int add) ;
|
||||
void *dependent_getInterface(const GUID *classguid);
|
||||
|
||||
DISPATCH_CODES
|
||||
{
|
||||
API_DEPENDENT_REGVIEWER = 10,
|
||||
API_DEPENDENT_GETINTERFACE = 20,
|
||||
};
|
||||
};
|
||||
|
||||
inline void ifc_dependent::dependent_regViewer(api_dependentviewer *viewer, int add)
|
||||
{
|
||||
_voidcall(API_DEPENDENT_REGVIEWER, viewer, add);
|
||||
}
|
||||
inline void *ifc_dependent::dependent_getInterface(const GUID *classguid)
|
||||
{
|
||||
return _call(API_DEPENDENT_GETINTERFACE, (void *)0, classguid);
|
||||
}
|
||||
|
||||
|
||||
// this is a helper for dependent_getInterface
|
||||
#define HANDLEGETINTERFACE(x) { \
|
||||
if (*classguid == *x::depend_getClassGuid()) return static_cast<x *>(this); \
|
||||
}
|
||||
|
||||
typedef ifc_dependent api_dependent;
|
||||
|
||||
#endif
|
2
Src/Wasabi/api/dependency/api_dependentviewer.cpp
Normal file
2
Src/Wasabi/api/dependency/api_dependentviewer.cpp
Normal file
|
@ -0,0 +1,2 @@
|
|||
#include <precomp.h>
|
||||
#include "api_dependentviewer.h"
|
30
Src/Wasabi/api/dependency/api_dependentviewer.h
Normal file
30
Src/Wasabi/api/dependency/api_dependentviewer.h
Normal file
|
@ -0,0 +1,30 @@
|
|||
#ifndef __WASABI_API_DEPENDENTVIEWER_H
|
||||
#define __WASABI_API_DEPENDENTVIEWER_H
|
||||
|
||||
#include <bfc/dispatch.h>
|
||||
#include <bfc/platform/types.h>
|
||||
class ifc_dependent;
|
||||
|
||||
class NOVTABLE ifc_dependentviewer : public Dispatchable
|
||||
{
|
||||
protected:
|
||||
ifc_dependentviewer() {}
|
||||
~ifc_dependentviewer() {}
|
||||
public:
|
||||
// item calls when it changes or disappears, or whatever
|
||||
int dependentViewer_callback(ifc_dependent *item, const GUID *classguid, int cb, intptr_t param1 = 0, intptr_t param2 = 0, void *ptr = NULL, size_t ptrlen = 0);
|
||||
|
||||
DISPATCH_CODES
|
||||
{
|
||||
DEPENDENTVIEWER_CALLBACK = 10,
|
||||
};
|
||||
};
|
||||
|
||||
inline int ifc_dependentviewer::dependentViewer_callback(ifc_dependent *item, const GUID *classguid, int cb, intptr_t param1 , intptr_t param2 , void *ptr , size_t ptrlen)
|
||||
{
|
||||
return _call(DEPENDENTVIEWER_CALLBACK, (int)0, item, classguid, cb, param1, param2, ptr, ptrlen);
|
||||
}
|
||||
|
||||
typedef ifc_dependentviewer api_dependentviewer;
|
||||
|
||||
#endif
|
Loading…
Add table
Add a link
Reference in a new issue