Initial community commit

This commit is contained in:
Jef 2024-09-24 14:54:57 +02:00
parent 537bcbc862
commit fc06254474
16440 changed files with 4239995 additions and 2 deletions

View file

@ -0,0 +1,20 @@
#ifndef __WASABI_AUTHCB_H
#define __WASABI_AUTHCB_H
#if defined(_MSC_VER) && (_MSC_VER >= 1020)
#pragma once
#endif
#include <api/syscb/callbacks/syscb.h>
namespace AuthCallback
{
enum
{
CREDENTIALS_CHANGED=10, //param1 = (api_auth*)auth; param2 = (const GUID*)realm; no return value.
CREDENTIALS_ABOUTTOCHANGE=20, //param1 = (api_auth*)auth; param2 = (const GUID*)realm; no return value.
};
};
#endif //__WASABI_AUTHCB_H

View file

@ -0,0 +1,2 @@
#include <precomp.h>
#include "browsercb.h"

View file

@ -0,0 +1,11 @@
#ifndef __WASABI_BROWSERCB_H
#define __WASABI_BROWSERCB_H
#include <api/syscb/callbacks/syscb.h>
namespace BrowserCallback {
enum {
ONOPENURL=10,
};
};
#endif

View file

@ -0,0 +1,32 @@
#ifndef NULLSOFT_WASABI_BROWSERCBI_H
#define NULLSOFT_WASABI_BROWSERCBI_H
#include "syscbi.h"
#include "browsercb.h"
class waServiceFactory;
#define SVCCALLBACK_PARENT SysCallbackI
class BrowserCallbackI : public SVCCALLBACK_PARENT {
protected:
BrowserCallbackI() { }
public:
// set *override = true to prevent the URL from being opened
// leave it alone otherwise (in case someone else wanted to override it)
virtual void browsercb_onOpenURL(wchar_t *url, bool *override) { }
private:
virtual FOURCC syscb_getEventType() { return SysCallback::BROWSER; }
virtual int syscb_notify(int msg, intptr_t param1, intptr_t param2) {
switch (msg) {
case BrowserCallback::ONOPENURL:
browsercb_onOpenURL(reinterpret_cast<wchar_t*>(param1), reinterpret_cast<bool *>(param2));
break;
default: return 0;
}
return 1;
}
};
#endif

View file

@ -0,0 +1,14 @@
#include <precomp.h>
#if 0
#include "consolecb.h"
using namespace ConsoleCallback;
int ConsoleCallbackI::syscb_notify(int msg, int param1, int param2) {
switch (msg) {
case DEBUGMESSAGE:
return consolecb_outputString(param1, reinterpret_cast<const char *>(param2));
}
return 0;
}
#endif

View file

@ -0,0 +1,24 @@
#ifndef _CONSOLECB_H
#define _CONSOLECB_H
#include <api/syscb/callbacks/syscbi.h>
namespace ConsoleCallback {
enum {
DEBUGMESSAGE=10,
};
};
/*
#define CONSOLECALLBACKI_PARENT SysCallbackI
class ConsoleCallbackI : public CONSOLECALLBACKI_PARENT {
public:
virtual FOURCC syscb_getEventType() { return SysCallback::CONSOLE; }
protected:
virtual int consolecb_outputString(int severity, const char *string)=0;
private:
virtual int syscb_notify(int msg, intptr_t param1 = 0, intptr_t param2 = 0);
};
*/
#endif

View file

@ -0,0 +1,79 @@
#include <precomp.h>
#include "corecbi.h"
#define CBCLASS CoreCallbackI
START_DISPATCH;
CB(CCB_NOTIFY, ccb_notify);
END_DISPATCH;
int CoreCallbackI::ccb_notify(int msg, intptr_t param1, intptr_t param2) {
ReentryFilter f(&filter, msg);
if (f.mustLeave()) return 0;
switch (msg) {
case STARTED:
return corecb_onStarted();
case STOPPED:
return corecb_onStopped();
case PAUSED:
return corecb_onPaused();
case UNPAUSED:
return corecb_onUnpaused();
case SEEKED:
return corecb_onSeeked(param1);
case VOLCHANGE:
return corecb_onVolumeChange(param1);
case PANCHANGE:
return corecb_onPanChange(param1);
case EQSTATUSCHANGE:
return corecb_onEQStatusChange(param1);
case EQPREAMPCHANGE:
return corecb_onEQPreampChange(param1);
case EQBANDCHANGE:
return corecb_onEQBandChange(param1, param2);
case EQFREQCHANGE:
return corecb_onEQFreqChange(param1);
case EQAUTOCHANGE:
return corecb_onEQAutoChange(param1);
case STATUSMSG:
return corecb_onStatusMsg((const wchar_t *)param1);
case WARNINGMSG:
return corecb_onWarningMsg((const wchar_t *)param1);
case ERRORMSG:
return corecb_onErrorMsg((const wchar_t *)param1);
case TITLECHANGE:
return corecb_onTitleChange((const wchar_t *)param1);
case TITLE2CHANGE:
return corecb_onTitle2Change((const wchar_t *)param1);
case INFOCHANGE:
return corecb_onInfoChange((const wchar_t *)param1);
case URLCHANGE:
return corecb_onUrlChange((const wchar_t *)param1);
case LENGTHCHANGE:
return corecb_onLengthChange(param1);
case NEXTFILE:
return corecb_onNextFile();
case NEEDNEXTFILE:
return corecb_onNeedNextFile(param1);
case SETNEXTFILE:
return corecb_onSetNextFile((const wchar_t *)param1);
case ERROROCCURED:
return corecb_onErrorOccured(param1, (const wchar_t *)param2);
case ABORTCURRENTSONG:
return corecb_onAbortCurrentSong();
case ENDOFDECODE:
return corecb_onEndOfDecode();
case ONFILECOMPLETE:
return corecb_onFileComplete((const wchar_t *)param1);
case CONVERTERSCHAINREBUILT:
return corecb_onConvertersChainRebuilt();
case MEDIAFAMILYCHANGE:
return corecb_onMediaFamilyChange((const wchar_t *)param1);
case BITRATECHANGE:
return corecb_onBitrateChange(param1);
case SAMPLERATECHANGE:
return corecb_onSampleRateChange(param1);
case CHANNELSCHANGE:
return corecb_onChannelsChange(param1);
}
return 0;
}

View file

@ -0,0 +1,71 @@
#ifndef _CORECB_H
#define _CORECB_H
#include <bfc/dispatch.h>
// don't derive from this
class NOVTABLE CoreCallback : public Dispatchable
{
protected:
CoreCallback() {}
public:
int ccb_notify(int msg, intptr_t param1=0, intptr_t param2=0) {
return _call(CCB_NOTIFY, 0, msg, param1, param2);
}
// class Dispatchable codes
enum {
CCB_NOTIFY = 100,
};
// various ccb_notify notifications. these are *not* the Dispatchable codes
enum {
REGISTER = 100,
DEREGISTER = 200,
NEXTFILE = 300,
STARTED = 500,
STOPPED = 600,
PAUSED = 700,
UNPAUSED = 800,
SEEKED = 900,
VOLCHANGE = 2000,
EQSTATUSCHANGE = 2100,
EQPREAMPCHANGE = 2200,
EQBANDCHANGE = 2300,
EQFREQCHANGE = 2310,
EQAUTOCHANGE = 2400,
PANCHANGE = 2500,
STATUSMSG = 3000,
WARNINGMSG = 3100,
ERRORMSG = 3200,
ERROROCCURED = 3300,
TITLECHANGE = 4000,
TITLE2CHANGE = 4100,
INFOCHANGE = 4200,
SAMPLERATECHANGE = 4210,
BITRATECHANGE = 4220,
CHANNELSCHANGE = 4230,
URLCHANGE = 4300,
LENGTHCHANGE = 4400,
NEEDNEXTFILE = 5100,
SETNEXTFILE = 5200,
ABORTCURRENTSONG= 6000,
ENDOFDECODE = 7000,
ONFILECOMPLETE = 8000,
CONVERTERSCHAINREBUILT = 9000,
MEDIAFAMILYCHANGE = 10000,
};
};
#endif

View file

@ -0,0 +1,67 @@
#ifndef __WASABI_CORECBI_H
#define __WASABI_CORECBI_H
#include <bfc/wasabi_std.h>
#include <api/syscb/callbacks/corecb.h>
#include <bfc/reentryfilter.h>
// this class does NOT automatically deregister itself when you destruct it
// that is up to you, and obviously, if you fail to do so, you'll crash the
// whole app. and they'll all laugh at you. see class CoreHandle
class NOVTABLE CoreCallbackI : public CoreCallback {
protected:
CoreCallbackI() { } // no instantiating this on its own
public:
virtual int corecb_onStarted() { return 0; }
virtual int corecb_onStopped() { return 0; }
virtual int corecb_onPaused() { return 0; }
virtual int corecb_onUnpaused() { return 0; }
virtual int corecb_onSeeked(int newpos) { return 0; }
virtual int corecb_onVolumeChange(int newvol) { return 0; }
virtual int corecb_onPanChange(int newpan) { return 0; }
virtual int corecb_onEQStatusChange(int newval) { return 0; }
virtual int corecb_onEQPreampChange(int newval) { return 0; }
virtual int corecb_onEQBandChange(int band, int newval) { return 0; }
virtual int corecb_onEQFreqChange(int newval) { return 0; }
virtual int corecb_onEQAutoChange(int newval) { return 0; }
virtual int corecb_onStatusMsg(const wchar_t *text) { return 0; }
virtual int corecb_onWarningMsg(const wchar_t *text) { return 0; }
virtual int corecb_onErrorMsg(const wchar_t *text) { return 0; }
virtual int corecb_onTitleChange(const wchar_t *title) { return 0; }
virtual int corecb_onTitle2Change(const wchar_t *title2) { return 0; }
virtual int corecb_onInfoChange(const wchar_t *info) { return 0; }
virtual int corecb_onBitrateChange(int kbps) { return 0; }
virtual int corecb_onSampleRateChange(int khz) { return 0; }
virtual int corecb_onChannelsChange(int nch) { return 0; }
virtual int corecb_onUrlChange(const wchar_t *url) { return 0; }
virtual int corecb_onLengthChange(int newlength) { return 0; }
virtual int corecb_onNextFile() { return 0; }
virtual int corecb_onNeedNextFile(int fileid) { return 0; }
virtual int corecb_onSetNextFile(const wchar_t *playstring) { return 0; }
virtual int corecb_onErrorOccured(int severity, const wchar_t *text) { return 0; }
// return 1 in this callback to make the current callback chain to abort
virtual int corecb_onAbortCurrentSong() { return 0; }
virtual int corecb_onEndOfDecode() { return 0; }
virtual int corecb_onFileComplete(const wchar_t *playstring) { return 0; }
virtual int corecb_onConvertersChainRebuilt() { return 0; }
virtual int corecb_onMediaFamilyChange(const wchar_t *newfamily) { return 0; }
virtual int ccb_notify(int msg, intptr_t param1=0, intptr_t param2=0);
protected:
RECVS_DISPATCH;
ReentryFilterObject filter;
};
#endif

View file

@ -0,0 +1,31 @@
#ifndef _GCCB_H
#define _GCCB_H
#include "syscbi.h"
namespace GarbageCollectCallback {
enum {
GARBAGECOLLECT=1,
};
};
#define GARBAGECOLLECTCALLBACK_PARENT SysCallbackI
class GarbageCollectCallbackI : public GARBAGECOLLECTCALLBACK_PARENT {
protected:
GarbageCollectCallbackI() {}
public:
virtual int gccb_onGarbageCollect() { return 0; }
private:
virtual FOURCC syscb_getEventType() { return SysCallback::GC; }
virtual int syscb_notify(int msg, intptr_t param1=0, intptr_t param2=0) {
switch (msg) {
case GarbageCollectCallback::GARBAGECOLLECT:
return gccb_onGarbageCollect();
}
return 0;
}
};
#endif

View file

@ -0,0 +1,41 @@
#pragma once
#include <api/syscb/callbacks/syscbi.h>
namespace MetadataCallback {
enum {
FILE_UPDATED = 10,
ART_UPDATED = 20,
FILE_MAY_UPDATE = 30,
};
};
#define METADATACALLBACK_PARENT SysCallbackI
class MetadataCallbackI : public METADATACALLBACK_PARENT
{
protected:
MetadataCallbackI() { }
public:
virtual void metacb_FileUpdated(const wchar_t *filename) { }
virtual void metacb_ArtUpdated(const wchar_t *filename) { }
virtual void metacb_FileMayUpdate(const wchar_t *filename) { }
private:
virtual FOURCC syscb_getEventType() { return SysCallback::META; }
virtual int syscb_notify(int msg, intptr_t param1, intptr_t param2) {
switch (msg) {
case MetadataCallback::FILE_UPDATED:
metacb_FileUpdated((const wchar_t *)param1);
break;
case MetadataCallback::ART_UPDATED:
metacb_ArtUpdated((const wchar_t *)param1);
break;
case MetadataCallback::FILE_MAY_UPDATE:
metacb_FileMayUpdate((const wchar_t *)param1);
break;
default: return 0;
}
return 1;
}
};

View file

@ -0,0 +1,10 @@
#include "playlistcb.h"
int PlaylistCallbackI::syscb_notify(int msg, intptr_t param1, intptr_t param2)
{
switch (msg) {
case api_playlists::PLAYLIST_ADDED: return playlistcb_added(static_cast<size_t>(param1));
case api_playlists::PLAYLIST_SAVED: return playlistcb_saved(static_cast<size_t>(param1));
}
return 0;
}

View file

@ -0,0 +1,26 @@
#ifndef NULLSOFT_AGAVE_PLAYLISTCB_H
#define NULLSOFT_AGAVE_PLAYLISTCB_H
#include "../playlist/api_playlists.h"
#include "api/syscb/callbacks/syscbi.h"
#define PLAYLISTCALLBACKI_PARENT SysCallbackI
class PlaylistCallbackI : public PLAYLISTCALLBACKI_PARENT
{
public:
virtual FOURCC syscb_getEventType() { return api_playlists::SYSCALLBACK; }
protected:
// override these
virtual int playlistcb_added( size_t index ) { return 0; }
virtual int playlistcb_saved( size_t index ) { return 0; }
private:
virtual int syscb_notify( int msg, intptr_t param1 = 0, intptr_t param2 = 0 );
};
#endif

View file

@ -0,0 +1,39 @@
#ifndef _RUNLEVELCB_H
#define _RUNLEVELCB_H
#include <api/syscb/callbacks/syscbi.h>
#include <api/service/service.h>
#define RUNLEVELCALLBACKI_PARENT SysCallbackI
class RunlevelCallbackI : public RUNLEVELCALLBACKI_PARENT {
public:
virtual FOURCC syscb_getEventType() { return SysCallback::RUNLEVEL; }
// override these
virtual void runlevelcb_onStartup() {}
virtual void runlevelcb_onAppRunning() {}
virtual void runlevelcb_onShutdown() {}
virtual void runlevelcb_onBeforeShutdown() {}
private:
virtual int syscb_notify(int msg, intptr_t param1=0, intptr_t param2=0) {
switch (msg) {
case SvcNotify::ONSTARTUP:
runlevelcb_onStartup();
break;
case SvcNotify::ONAPPRUNNING:
runlevelcb_onAppRunning();
break;
case SvcNotify::ONSHUTDOWN:
runlevelcb_onShutdown();
break;
case SvcNotify::ONBEFORESHUTDOWN:
runlevelcb_onBeforeShutdown();
break;
default: return 0;
}
return 1;
}
};
#endif

View file

@ -0,0 +1,20 @@
#include <precomp.h>
#include "skincb.h"
int SkinCallbackI::syscb_notify(int msg, intptr_t param1, intptr_t param2) {
switch (msg) {
case SkinCallback::UNLOADING: return skincb_onUnloading();
case SkinCallback::RESET: return skincb_onReset();
case SkinCallback::RELOAD: return skincb_onReload();
case SkinCallback::BEFORELOADINGELEMENTS: return skincb_onBeforeLoadingElements();
case SkinCallback::GUILOADED: return skincb_onGuiLoaded();
case SkinCallback::LOADED: return skincb_onLoaded();
case SkinCallback::COLORTHEMECHANGED: return skincb_onColorThemeChanged(WASABI_API_SKIN->colortheme_getColorSet());
case SkinCallback::COLORTHEMESLISTCHANGED: return skincb_onColorThemesListChanged();
case SkinCallback::CHECKPREVENTSWITCH: {
int r = skincb_onCheckPreventSwitch((const wchar_t *)param1);
if (r && param2)
*(int *)param2 = r;
}
}
return 0;
}

View file

@ -0,0 +1,41 @@
#ifndef _SKINCB_H
#define _SKINCB_H
#include <api/syscb/callbacks/syscbi.h>
namespace SkinCallback {
enum {
UNLOADING=100, // beginning, haven't killed anything yet
RESET=200, // skin is gone
RELOAD=300, // stuff is loading
BEFORELOADINGELEMENTS=350,
GUILOADED=400, // skin gui objects loaded from xml
LOADED=500, // all done, new skin in place
CHECKPREVENTSWITCH=600, // we're about to switch skin, wanna abort ? return 1 if so
COLORTHEMECHANGED=700, // color theme has been changed, trap this if you're not using automaticly themed widgets
COLORTHEMESLISTCHANGED=710, // color theme list has been modified, trap this if you're showing a list of the colorthemes and you want to mirror changes
};
};
#define SKINCALLBACKI_PARENT SysCallbackI
class SkinCallbackI : public SKINCALLBACKI_PARENT {
public:
virtual FOURCC syscb_getEventType() { return SysCallback::SKINCB; }
protected:
// override these
virtual int skincb_onUnloading() { return 0; }
virtual int skincb_onReset() { return 0; }
virtual int skincb_onReload() { return 0; }
virtual int skincb_onBeforeLoadingElements() { return 0; }
virtual int skincb_onGuiLoaded() { return 0; }
virtual int skincb_onLoaded() { return 0; }
virtual int skincb_onCheckPreventSwitch(const wchar_t *skinname) { return 0; }
virtual int skincb_onColorThemeChanged(const wchar_t *newcolortheme) { return 0; }
virtual int skincb_onColorThemesListChanged() { return 0; }
private:
virtual int syscb_notify(int msg, intptr_t param1=0, intptr_t param2=0);
};
#endif

View file

@ -0,0 +1,12 @@
#ifndef _SVCCB_H
#define _SVCCB_H
#include <api/syscb/callbacks/syscb.h>
namespace SvcCallback {
enum {
ONREGISTER=10,
ONDEREGISTER=20,
};
};
#endif

View file

@ -0,0 +1,34 @@
#ifndef NULLSOFT_WASABI_SVCCBI_H
#define NULLSOFT_WASABI_SVCCBI_H
#include "syscbi.h"
#include "svccb.h"
class waServiceFactory;
#define SVCCALLBACK_PARENT SysCallbackI
class SvcCallbackI : public SVCCALLBACK_PARENT {
protected:
SvcCallbackI() { }
public:
virtual void svccb_onSvcRegister(FOURCC type, waServiceFactory *svc) { }
virtual void svccb_onSvcDeregister(FOURCC type, waServiceFactory *svc) { }
private:
virtual FOURCC syscb_getEventType() { return SysCallback::SERVICE; }
virtual int syscb_notify(int msg, intptr_t param1, intptr_t param2) {
switch (msg) {
case SvcCallback::ONREGISTER:
svccb_onSvcRegister((FOURCC)param1, reinterpret_cast<waServiceFactory*>(param1));
break;
case SvcCallback::ONDEREGISTER:
svccb_onSvcRegister((FOURCC)param1, reinterpret_cast<waServiceFactory*>(param1));
break;
default: return 0;
}
return 1;
}
};
#endif

View file

@ -0,0 +1,12 @@
// ----------------------------------------------------------------------------
// Generated by InterfaceFactory [Wed May 07 00:58:36 2003]
//
// File : syscb.cpp
// Class : SysCallback
// class layer : Dispatchable Interface
// ----------------------------------------------------------------------------
#include <precomp.h>
#include "syscb.h"

View file

@ -0,0 +1,73 @@
// ----------------------------------------------------------------------------
// Generated by InterfaceFactory [Wed May 07 00:58:36 2003]
//
// File : syscb.h
// Class : SysCallback
// class layer : Dispatchable Interface
// ----------------------------------------------------------------------------
#ifndef __SYSCALLBACK_H
#define __SYSCALLBACK_H
#include <bfc/dispatch.h>
#include <bfc/platform/types.h>
//#include <bfc/common.h>
#include <bfc/std_mkncc.h>
#include <stddef.h>
// ----------------------------------------------------------------------------
class SysCallback: public Dispatchable {
protected:
SysCallback() {}
~SysCallback() {}
public:
public:
// -- begin generated - edit in syscbi.h
enum { // event types
NONE = 0,
RUNLEVEL = MK4CC('r','u','n','l'), // system runlevel
CONSOLE = MK3CC('c','o','n'), // debug messages
SKINCB = MK4CC('s','k','i','n'), // skin unloading/loading
DB = MK2CC('d','b'), // database change messages
WINDOW = MK3CC('w','n','d'), // window events
GC = MK2CC('g','c'), // garbage collection event
POPUPEXIT = MK4CC('p','o','p','x'), // popup exit
CMDLINE = MK4CC('c','m','d','l'), // command line sent (possibly from outside)
SYSMEM = MK4CC('s','y','s','m'), // api->sysMalloc/sysFree
SERVICE = MK3CC('s','v','c'),
BROWSER = MK3CC('u','r','l'), // browser open requests
META = MK4CC('m','e','t','a'), // metadata changes
AUTH = MK4CC('a','u','t','h'), // credentials change
};
// -- end generated
public:
FOURCC getEventType();
int notify(int msg, intptr_t param1 = 0, intptr_t param2 = 0);
protected:
enum {
SYSCALLBACK_GETEVENTTYPE = 101,
SYSCALLBACK_NOTIFY = 200,
};
};
// ----------------------------------------------------------------------------
inline FOURCC SysCallback::getEventType() {
FOURCC __retval = _call(SYSCALLBACK_GETEVENTTYPE, (FOURCC)NULL);
return __retval;
}
#pragma warning(push)
#pragma warning(disable:4244)
inline int SysCallback::notify(int msg, intptr_t param1, intptr_t param2) {
int __retval = _call(SYSCALLBACK_NOTIFY, (int)0, msg, param1, param2);
return __retval;
}
#pragma warning(pop)
// ----------------------------------------------------------------------------
#endif // __SYSCALLBACK_H

View file

@ -0,0 +1,4 @@
#include "precomp.h"
#include "syscbi.h"

View file

@ -0,0 +1,46 @@
#ifndef _SYSCBI_H
#define _SYSCBI_H
//<?<autoheader/>
#include "syscb.h"
#include "syscbx.h"
//?>
#include <bfc/dispatch.h>
#include <bfc/platform/platform.h>
//#include <bfc/common.h>
//derive from this one (see skincb.h for a good example)
class SysCallbackI : public SysCallbackX {
public:
DISPATCH(101) FOURCC getEventType() { return syscb_getEventType(); }
DISPATCH(200) int notify(int msg, intptr_t param1 = 0, intptr_t param2 = 0) { return syscb_notify(msg, param1, param2); }
protected:
NODISPATCH virtual FOURCC syscb_getEventType()=0;
NODISPATCH virtual int syscb_notify(int msg, intptr_t param1 = 0, intptr_t param2 = 0)=0;
// This is where you should edit the enum block
/*[interface]
public:
// -- begin generated - edit in syscbi.h
enum { // event types
NONE = 0,
RUNLEVEL = MK4CC('r','u','n','l'), // system runlevel
CONSOLE = MK3CC('c','o','n'), // debug messages
SKINCB = MK4CC('s','k','i','n'), // skin unloading/loading
DB = MK2CC('d','b'), // database change messages
WINDOW = MK3CC('w','n','d'), // window events
GC = MK2CC('g','c'), // garbage collection event
POPUPEXIT = MK4CC('p','o','p','x'), // popup exit
CMDLINE = MK4CC('c','m','d','l'), // command line sent (possibly from outside)
SYSMEM = MK4CC('s','y','s','m'), // api->sysMalloc/sysFree
SERVICE = MK3CC('s','v','c'),
};
// -- end generated
*/
};
#endif // _SYSCB_I

View file

@ -0,0 +1,21 @@
// ----------------------------------------------------------------------------
// Generated by InterfaceFactory [Wed May 07 00:58:36 2003]
//
// File : syscbx.cpp
// Class : SysCallback
// class layer : Dispatchable Receiver
// ----------------------------------------------------------------------------
#include "precomp.h"
#include "syscbx.h"
#ifdef CBCLASS
#undef CBCLASS
#endif
#define CBCLASS SysCallbackX
START_DISPATCH;
CB(SYSCALLBACK_GETEVENTTYPE, getEventType);
CB(SYSCALLBACK_NOTIFY, notify);
END_DISPATCH;
#undef CBCLASS

View file

@ -0,0 +1,30 @@
// ----------------------------------------------------------------------------
// Generated by InterfaceFactory [Wed May 07 00:58:36 2003]
//
// File : syscbx.h
// Class : SysCallback
// class layer : Dispatchable Receiver
// ----------------------------------------------------------------------------
#ifndef __SYSCALLBACKX_H
#define __SYSCALLBACKX_H
#include "syscb.h"
// ----------------------------------------------------------------------------
class SysCallbackX : public SysCallback {
protected:
SysCallbackX() {}
public:
virtual FOURCC getEventType()=0;
virtual int notify(int msg, intptr_t param1 = 0, intptr_t param2 = 0)=0;
protected:
RECVS_DISPATCH;
};
#endif // __SYSCALLBACKX_H

View file

@ -0,0 +1,53 @@
#ifndef _SYSMEMCB_H
#define _SYSMEMCB_H
namespace SysMemCallback {
enum {
ONMALLOC=10,
ONFREE=20,
ONREALLOC=30,
ONCHANGE=40,
};
};
#include <api/syscb/callbacks/syscbi.h>
#define SYSMEMCALLBACK_PARENT SysCallbackI
class SysMemCallbackI : public SYSMEMCALLBACK_PARENT {
protected:
SysMemCallbackI() { }
public:
virtual void sysmem_onMalloc(void *memory, int size)=0;
virtual void sysmem_onFree(void *memory)=0;
virtual void sysmem_onRealloc(void *prev_memory, void *new_memory, int new_size)=0;
virtual void sysmem_onChange(void *memory)=0;
private:
virtual FOURCC syscb_getEventType() { return SysCallback::SYSMEM; }
virtual int syscb_notify(int msg, intptr_t param1=0, intptr_t param2=0) {
switch (msg) {
case SysMemCallback::ONMALLOC:
sysmem_onMalloc((void *)param1, param2);
break;
case SysMemCallback::ONFREE:
sysmem_onFree((void *)param1);
break;
case SysMemCallback::ONREALLOC: {
void **ptrs = (void **)param1;
sysmem_onRealloc(ptrs[0], ptrs[1], param2);
}
break;
case SysMemCallback::ONCHANGE:
sysmem_onChange((void *)param1);
break;
default: return 0;
}
return 1;
}
};
#endif

View file

@ -0,0 +1,36 @@
#include "precomp.h"
#include "wndcb.h"
using namespace WndCallback;
int WndCallbackI::syscb_notify(int msg, intptr_t param1, intptr_t param2)
{
switch (msg)
{
case SHOWWINDOW:
{
WndInfo *i = reinterpret_cast<WndInfo *>((void *)param1);
if (!i) return 0;
return onShowWindow(i->c, i->guid, i->groupid);
}
case HIDEWINDOW:
{
WndInfo *i = reinterpret_cast<WndInfo *>((void *)param1);
if (!i) return 0;
return onHideWindow(i->c, i->guid, i->groupid);
}
case GROUPCHANGE:
{
WndInfo *i = reinterpret_cast<WndInfo *>((void *)param1);
if (!i) return 0;
return onGroupChange(i->groupid);
}
case TYPECHANGE:
{
WndInfo *i = reinterpret_cast<WndInfo *>((void *)param1);
if (!i) return 0;
return onTypeChange(i->wndtype);
}
}
return 0;
}

View file

@ -0,0 +1,43 @@
#ifndef _WNDCB_H
#define _WNDCB_H
#include <api/syscb/callbacks/syscbi.h>
#include <bfc/common.h>
class Container;
class ifc_window;
class WndInfo {
public:
GUID guid;
const wchar_t *groupid;
const wchar_t *wndtype;
Container *c;
};
namespace WndCallback {
enum {
SHOWWINDOW=10,
HIDEWINDOW=20,
GROUPCHANGE=30,
TYPECHANGE=40,
};
};
#define WNDCALLBACKI_PARENT SysCallbackI
class WndCallbackI : public WNDCALLBACKI_PARENT {
public:
virtual FOURCC syscb_getEventType() { return SysCallback::WINDOW; }
protected:
virtual int onShowWindow(Container *c, GUID guid, const wchar_t *groupid) { return 0; }
virtual int onHideWindow(Container *c, GUID guid, const wchar_t *groupid) { return 0; }
virtual int onGroupChange(const wchar_t *groupid) { return 0; }
virtual int onTypeChange(const wchar_t *type) { return 0; }
private:
virtual int syscb_notify(int msg, intptr_t param1=0, intptr_t param2=0);
};
#endif