4 #include <wx/gsocket.h>
5 #include "../unix/gsockunx.h"
7 void _GSocket_GDK_Input(gpointer data
, gint source
, GdkInputCondition condition
)
9 GSocket
*socket
= (GSocket
*)data
;
13 _GSocket_Detected_Read(socket
);
16 _GSocket_Detected_Write(socket
);
23 void _GSocket_GUI_Init(GSocket
*socket
)
28 socket
->m_gui_dependent
= (char *)malloc(sizeof(gint
)*3);
29 m_id
= (gint
*)(socket
->m_gui_dependent
);
35 void _GSocket_GUI_Destroy(GSocket
*socket
)
40 m_id
= (gint
*)(socket
->m_gui_dependent
);
44 gdk_input_remove(m_id
[i
]);
46 free(socket
->m_gui_dependent
);
49 void _GSocket_Install_Fallback(GSocket
*socket
, GSocketEvent event
)
51 GdkInputCondition flag
;
55 m_id
= (gint
*)(socket
->m_gui_dependent
);
58 case GSOCK_CONNECTION
:
60 case GSOCK_INPUT
: c
= 0; flag
= GDK_INPUT_READ
; break;
61 case GSOCK_OUTPUT
: c
= 1;flag
= GDK_INPUT_WRITE
; break;
66 gdk_input_remove(m_id
[c
]);
68 m_id
[c
] = gdk_input_add(socket
->m_fd
, flag
,
69 _GSocket_GDK_Input
, (gpointer
)socket
);
72 void _GSocket_Uninstall_Fallback(GSocket
*socket
, GSocketEvent event
)
77 m_id
= (gint
*)(socket
->m_gui_dependent
);
80 case GSOCK_CONNECTION
:
82 case GSOCK_INPUT
: c
= 0; break;
83 case GSOCK_OUTPUT
: c
= 1; break;
88 gdk_input_remove(m_id
[c
]);
93 unsigned long GSocket_GetEventID(GSocket
*socket
)
98 void GSocket_DoEvent(unsigned long evt_id
)