diff options
-rw-r--r-- | Ivy/IvySynchroWnd.h | 24 |
1 files changed, 16 insertions, 8 deletions
diff --git a/Ivy/IvySynchroWnd.h b/Ivy/IvySynchroWnd.h index 5abd3ff..fba864e 100644 --- a/Ivy/IvySynchroWnd.h +++ b/Ivy/IvySynchroWnd.h @@ -12,6 +12,8 @@ #include "IvyApplication.h"
+class IvySynchronousCallback;
+
class IvySynchroWnd //: public CWnd
{
// Construction
@@ -21,12 +23,10 @@ public: // Attributes
public:
+
// Operations
public:
- void PostMessageCB (IvyMessageCallback *target, IvyApplication *app, int argc, const char **argv );
- void PostApplicationConnectedCB( IvyApplicationCallback *target, IvyApplication *app);
- void PostApplicationDisconnectedCB( IvyApplicationCallback *target, IvyApplication *app);
-
+ void PostIvyCB( IvySynchronousCallback *cb );
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(IvySynchroWnd)
@@ -48,12 +48,13 @@ protected: WPARAM wParam, // first message parameter
LPARAM lParam // second message parameter
);
+ // Buffer Emission
+ CRITICAL_SECTION m_CritSection;
+ std::list<IvySynchronousCallback*> callbacklist;
protected:
- LRESULT OnMessageCB(WPARAM wParam, LPARAM lParam);
- LRESULT OnApplicationConnectedCB(WPARAM wParam, LPARAM lParam);
- LRESULT OnApplicationDisconnectedCB(WPARAM wParam, LPARAM lParam);
+ LRESULT OnIvyCB(WPARAM wParam, LPARAM lParam);
friend class IvySynchronousMessageCallback;
friend class IvySynchronousApplicationCallback;
@@ -64,12 +65,16 @@ protected: IvyApplication *app;
static IvySynchroWnd *m_synchro;
friend class Ivy;
+public:
+ virtual void CallCallback() = 0;
+
};
class IvySynchronousMessageCallback: public IvySynchronousCallback, public IvyMessageCallback
{
public:
IvySynchronousMessageCallback( IvyMessageCallback *cb );
virtual ~IvySynchronousMessageCallback();
+ virtual void CallCallback();
virtual void OnMessage (IvyApplication *app, int argc, const char **argv );
protected:
@@ -83,11 +88,14 @@ class IvySynchronousApplicationCallback: public IvySynchronousCallback, public {
public:
IvySynchronousApplicationCallback( IvyApplicationCallback *cb );
+ virtual void CallCallback();
virtual void OnApplicationConnected (IvyApplication *app);
virtual void OnApplicationDisconnected (IvyApplication *app);
protected:
IvyApplicationCallback *target;
-
+ typedef enum { CONNECTED_CB, DISCONNECTED_CB } CallbackType;
+ CallbackType type;
+
friend class IvySynchroWnd;
};
/////////////////////////////////////////////////////////////////////////////
|