From d391a3451080638e6b1f2f24f92078d18c5ab9d8 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Fri, 1 Oct 1999 13:53:26 +0000 Subject: [PATCH] renamed gsockmot.cpp to *.c git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@3778 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- include/wx/motif/private.h | 6 ++++++ src/motif/app.cpp | 9 +++++++++ src/motif/{gsockmot.cpp => gsockmot.c} | 25 ++++++++++++------------- 3 files changed, 27 insertions(+), 13 deletions(-) rename src/motif/{gsockmot.cpp => gsockmot.c} (80%) diff --git a/include/wx/motif/private.h b/include/wx/motif/private.h index 4660979bae..23737aecba 100644 --- a/include/wx/motif/private.h +++ b/include/wx/motif/private.h @@ -110,5 +110,11 @@ private: // argument is of type "wxWindow *" #define GetWidget(w) ((Widget)(w)->GetHandle()) +// ---------------------------------------------------------------------------- +// accessors for C modules +// ---------------------------------------------------------------------------- + +extern "C" XtAppContext wxGetAppContext(); + #endif // _WX_PRIVATE_H_ diff --git a/src/motif/app.cpp b/src/motif/app.cpp index 72ab9cb7b2..fd96ab7e44 100644 --- a/src/motif/app.cpp +++ b/src/motif/app.cpp @@ -763,3 +763,12 @@ wxApp::GetStdIcon(int which) const return wxIcon(error_xpm); } } + +// ---------------------------------------------------------------------------- +// accessors for C modules +// ---------------------------------------------------------------------------- + +extern "C" XtAppContext wxGetAppContext() +{ + return (XtAppContext)wxTheApp->GetAppContext(); +} diff --git a/src/motif/gsockmot.cpp b/src/motif/gsockmot.c similarity index 80% rename from src/motif/gsockmot.cpp rename to src/motif/gsockmot.c index d7ed9ebf90..797c3cff7b 100644 --- a/src/motif/gsockmot.cpp +++ b/src/motif/gsockmot.c @@ -1,9 +1,9 @@ -// ------------------------------------------------------------------------- -// Project: GSocket (Generic Socket) for WX -// Name: gsockmot.cpp -// Purpose: GSocket: Motif part -// CVSID: $Id$ -// ------------------------------------------------------------------------- +/* ------------------------------------------------------------------------- + * Project: GSocket (Generic Socket) for WX + * Name: gsockmot.c + * Purpose: GSocket: Motif part + * CVSID: $Id$ + * ------------------------------------------------------------------------- */ #include "wx/setup.h" @@ -12,10 +12,9 @@ #include #include #include "wx/gsocket.h" -#include "wx/app.h" #include "wx/unix/gsockunx.h" -#define wxAPP_CONTEXT ((XtAppContext)wxTheApp->GetAppContext()) +extern XtAppContext wxGetAppContext(); static void _GSocket_Motif_Input(XtPointer data, int *fid, XtInputId *id) @@ -61,7 +60,7 @@ void _GSocket_Install_Callback(GSocket *socket, GSocketEvent event) switch (event) { 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_CONNECTION: c = ((socket->m_server) ? 0 : 1); break; default: return; @@ -72,14 +71,14 @@ void _GSocket_Install_Callback(GSocket *socket, GSocketEvent event) if (c == 0) { - m_id[0] = XtAppAddInput(wxAPP_CONTEXT, socket->m_fd, + m_id[0] = XtAppAddInput(wxGetAppContext(), socket->m_fd, (XtPointer *)XtInputReadMask, (XtInputCallbackProc) _GSocket_Motif_Input, (XtPointer) socket); } else { - m_id[1] = XtAppAddInput(wxAPP_CONTEXT, socket->m_fd, + m_id[1] = XtAppAddInput(wxGetAppContext(), socket->m_fd, (XtPointer *)XtInputWriteMask, (XtInputCallbackProc) _GSocket_Motif_Output, (XtPointer) socket); @@ -94,7 +93,7 @@ void _GSocket_Uninstall_Callback(GSocket *socket, GSocketEvent event) switch (event) { 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_CONNECTION: c = ((socket->m_server) ? 0 : 1); break; default: return; @@ -118,4 +117,4 @@ void _GSocket_Disable_Events(GSocket *socket) _GSocket_Uninstall_Callback(socket, GSOCK_OUTPUT); } -#endif // wxUSE_SOCKETS +#endif /* wxUSE_SOCKETS */ -- 2.45.2