renamed gsockmot.cpp to *.c

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@3778 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
1999-10-01 13:53:26 +00:00
parent e1393d82b3
commit d391a34510
3 changed files with 27 additions and 13 deletions

View File

@@ -110,5 +110,11 @@ private:
// argument is of type "wxWindow *" // argument is of type "wxWindow *"
#define GetWidget(w) ((Widget)(w)->GetHandle()) #define GetWidget(w) ((Widget)(w)->GetHandle())
// ----------------------------------------------------------------------------
// accessors for C modules
// ----------------------------------------------------------------------------
extern "C" XtAppContext wxGetAppContext();
#endif #endif
// _WX_PRIVATE_H_ // _WX_PRIVATE_H_

View File

@@ -763,3 +763,12 @@ wxApp::GetStdIcon(int which) const
return wxIcon(error_xpm); return wxIcon(error_xpm);
} }
} }
// ----------------------------------------------------------------------------
// accessors for C modules
// ----------------------------------------------------------------------------
extern "C" XtAppContext wxGetAppContext()
{
return (XtAppContext)wxTheApp->GetAppContext();
}

View File

@@ -1,9 +1,9 @@
// ------------------------------------------------------------------------- /* -------------------------------------------------------------------------
// Project: GSocket (Generic Socket) for WX * Project: GSocket (Generic Socket) for WX
// Name: gsockmot.cpp * Name: gsockmot.c
// Purpose: GSocket: Motif part * Purpose: GSocket: Motif part
// CVSID: $Id$ * CVSID: $Id$
// ------------------------------------------------------------------------- * ------------------------------------------------------------------------- */
#include "wx/setup.h" #include "wx/setup.h"
@@ -12,10 +12,9 @@
#include <stdlib.h> #include <stdlib.h>
#include <X11/Intrinsic.h> #include <X11/Intrinsic.h>
#include "wx/gsocket.h" #include "wx/gsocket.h"
#include "wx/app.h"
#include "wx/unix/gsockunx.h" #include "wx/unix/gsockunx.h"
#define wxAPP_CONTEXT ((XtAppContext)wxTheApp->GetAppContext()) extern XtAppContext wxGetAppContext();
static void _GSocket_Motif_Input(XtPointer data, int *fid, static void _GSocket_Motif_Input(XtPointer data, int *fid,
XtInputId *id) XtInputId *id)
@@ -61,7 +60,7 @@ void _GSocket_Install_Callback(GSocket *socket, GSocketEvent event)
switch (event) switch (event)
{ {
case GSOCK_LOST: /* fall-through */ case GSOCK_LOST: /* fall-through */
case GSOCK_INPUT: c = 0; break; case GSOCK_INPUT: c = 0; break;
case GSOCK_OUTPUT: c = 1; break; case GSOCK_OUTPUT: c = 1; break;
case GSOCK_CONNECTION: c = ((socket->m_server) ? 0 : 1); break; case GSOCK_CONNECTION: c = ((socket->m_server) ? 0 : 1); break;
default: return; default: return;
@@ -72,14 +71,14 @@ void _GSocket_Install_Callback(GSocket *socket, GSocketEvent event)
if (c == 0) if (c == 0)
{ {
m_id[0] = XtAppAddInput(wxAPP_CONTEXT, socket->m_fd, m_id[0] = XtAppAddInput(wxGetAppContext(), socket->m_fd,
(XtPointer *)XtInputReadMask, (XtPointer *)XtInputReadMask,
(XtInputCallbackProc) _GSocket_Motif_Input, (XtInputCallbackProc) _GSocket_Motif_Input,
(XtPointer) socket); (XtPointer) socket);
} }
else else
{ {
m_id[1] = XtAppAddInput(wxAPP_CONTEXT, socket->m_fd, m_id[1] = XtAppAddInput(wxGetAppContext(), socket->m_fd,
(XtPointer *)XtInputWriteMask, (XtPointer *)XtInputWriteMask,
(XtInputCallbackProc) _GSocket_Motif_Output, (XtInputCallbackProc) _GSocket_Motif_Output,
(XtPointer) socket); (XtPointer) socket);
@@ -94,7 +93,7 @@ void _GSocket_Uninstall_Callback(GSocket *socket, GSocketEvent event)
switch (event) switch (event)
{ {
case GSOCK_LOST: /* fall-through */ case GSOCK_LOST: /* fall-through */
case GSOCK_INPUT: c = 0; break; case GSOCK_INPUT: c = 0; break;
case GSOCK_OUTPUT: c = 1; break; case GSOCK_OUTPUT: c = 1; break;
case GSOCK_CONNECTION: c = ((socket->m_server) ? 0 : 1); break; case GSOCK_CONNECTION: c = ((socket->m_server) ? 0 : 1); break;
default: return; default: return;
@@ -118,4 +117,4 @@ void _GSocket_Disable_Events(GSocket *socket)
_GSocket_Uninstall_Callback(socket, GSOCK_OUTPUT); _GSocket_Uninstall_Callback(socket, GSOCK_OUTPUT);
} }
#endif // wxUSE_SOCKETS #endif /* wxUSE_SOCKETS */