diff options
Diffstat (limited to 'Ivy/IvySynchroWnd.h')
-rw-r--r-- | Ivy/IvySynchroWnd.h | 109 |
1 files changed, 109 insertions, 0 deletions
diff --git a/Ivy/IvySynchroWnd.h b/Ivy/IvySynchroWnd.h new file mode 100644 index 0000000..ffa44ba --- /dev/null +++ b/Ivy/IvySynchroWnd.h @@ -0,0 +1,109 @@ +//
+// SynchroWnd.h : header file
+//
+#pragma once
+/////////////////////////////////////////////////////////////////////////////
+// IvySynchroWnd window
+
+#include "IvyApplication.h"
+
+class IvySynchronousCallback;
+
+class IvySynchroWnd
+{
+// Construction
+public:
+ IvySynchroWnd();
+
+// Attributes
+public:
+
+
+// Operations
+public:
+ void PostIvyCB( IvySynchronousCallback *cb );
+
+// Implementation
+public:
+ virtual ~IvySynchroWnd();
+protected:
+ HWND m_hWnd;
+
+protected:
+ // Unique instance of this class
+ static IvySynchroWnd *m_synchro;
+ // Generated message map functions
+ static LRESULT CALLBACK WindowProc(
+ HWND hwnd, // handle to window
+ UINT uMsg, // message identifier
+ WPARAM wParam, // first message parameter
+ LPARAM lParam // second message parameter
+ );
+ // Buffer Emission
+ CRITICAL_SECTION m_CritSection;
+ typedef ivy::list<IvySynchronousCallback*> IvySynchronousCallbackList;
+ IvySynchronousCallbackList callbacklist;
+
+protected:
+
+ LRESULT OnIvyCB(WPARAM wParam, LPARAM lParam);
+ friend class IvySynchronousMessageCallback;
+ friend class IvySynchronousApplicationCallback;
+
+};
+class IvySynchronousCallback
+{
+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:
+ IvyMessageCallback *target;
+ int argc;
+ char **argv;
+
+ friend class IvySynchroWnd;
+};
+class IvySynchronousApplicationCallback: public IvySynchronousCallback, public IvyApplicationCallback
+{
+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;
+};
+class IvySynchronousBindingCallback: public IvySynchronousCallback, public IvyBindingCallback
+{
+public:
+ IvySynchronousBindingCallback( IvyBindingCallback *cb );
+ virtual void CallCallback();
+ virtual void OnAddBind (IvyApplication *app, int id, const char *regexp);
+ virtual void OnRemoveBind (IvyApplication *app, int id, const char *regexp);
+ virtual void OnFilterBind (IvyApplication *app, int id, const char *regexp);
+protected:
+ IvyBindingCallback *target;
+ typedef enum { ADD_CB, REMOVE_CB, FILTER_CB } CallbackType;
+ CallbackType type;
+ int id;
+ const char *regexp;
+
+ friend class IvySynchroWnd;
+};
|