| 12
 3
 4
 5
 6
 7
 8
 9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
 100
 101
 102
 103
 104
 105
 106
 107
 108
 
 | //external
//#include <afxwin.h>
#include <windows.h>
#include "Winuser.h"
#include "ext.h"//contains afxwin.h
#include "string.h"
//class for interecepting messages
//todo by inheriting CWnd or CDialog form MFC
//MAX EXTERNAL
typedef struct {
	t_object m_ob;
	UINT uiGlobal_MsgID_LumioDiscover;
	UINT uiGlobal_MsgID_LumioAttach;
	void *l_out;
	//CWnd *l_virtualWnd;
} t_lumio;
void lumio_bang(t_lumio *x);
void lumio_connect(t_lumio *x);
void lumio_disconnect(t_lumio *x);
char*  lumio_messageOut(t_lumio *x, t_symbol *s, short argc, t_atom *argv);
void lumio_free(t_lumio *x);
void *lumio_new(long num);
void *lumio_class;
int main()
{
	setup((t_messlist **)&lumio_class, (method)lumio_new, (method)lumio_free, (short)sizeof(t_lumio), 0L, A_DEFLONG, 0);//instancie la classe (pas l'objet)
	addmess((method)lumio_connect, "connect", 0);
	addmess((method)lumio_disconnect, "disconnect", 0);
	addbang((method)lumio_bang);
	return 0;
}
////////////////////////////////////////////////////////////////////////////////
//new LUMIO
void *lumio_new(long num)
{
	t_lumio *lumioObject;
	lumioObject = (t_lumio *)newobject(lumio_class);
	lumioObject->l_out = intout(lumioObject);
	//lumioObject->uiGlobal_MsgID_LumioDiscover = RegisterWindowMessage((LPCTSTR)"LumioCTAPIDiscover");
	//lumioObject->uiGlobal_MsgID_LumioAttach = RegisterWindowMessage((LPCTSTR)"LumioCTAPIAttach");
	//l_vWindow = new CVirtualDialog(...aremplir...);
	
	return lumioObject;
}
//~LUMIO
void lumio_free(t_lumio *x)
{
	//delete l_vWindow
}
////////////////////////////////////////////////////////////////////////////////////
// IN (callback) /****************************/
//connexion
void lumio_connect(t_lumio *x)
{
	//first time connection
	WPARAM m_hWnd = 0;//id du serveur en get
	//l_vWindow->
	::PostMessage( HWND_BROADCAST, /*The message is posted to all top-level windows in the system, including disabled or invisible unowned windows, overlapped windows, and pop-up windows. The message is not posted to child windows.*/
		//						x->uiGlobal_MsgID_LumioDiscover, 
		0, (WPARAM)m_hWnd, 0);
}
//deconnexion
void lumio_disconnect(t_lumio *x)
{
	//deconnection
	WPARAM m_hWnd = 0;//id du serveur en get
	//l_vWindow->PostMessage( HWND_BROADCAST, /*The message is posted to all top-level windows in the system, including disabled or invisible unowned windows, overlapped windows, and pop-up windows. The message is not posted to child windows.*/
		//						x->uiGlobal_MsgID_LumioDiscover, (WPARAM)m_hWnd, 0);
}
//bang pour tester
void lumio_bang(t_lumio *x)
{
	t_atom a;
	
	a.a_type = A_LONG;
	a.a_w.w_long = 0L;
	//lumio_atom(x,&a);
	post("bang in");
}
// End - IN (callback) /****************************/
// OUTLET
char* lumio_messageOut(t_lumio *x, t_symbol *s, short argc, t_atom *argv)
{
	return "hi";
} | 
Partager