git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@37169
c3d73ce0-8a6f-49c7-b76d-
6d57e0e08775
13 files changed:
/* ///////////////////////////////////////////////////////////////////////////
/* ///////////////////////////////////////////////////////////////////////////
+// Name: src/gtk/win_gtk.c
// Purpose: Native GTK+ widget for wxWidgets, based on GtkLayout and
// GtkFixed. It makes use of the gravity window property and
// therefore does not work with GTK 1.0.
// Purpose: Native GTK+ widget for wxWidgets, based on GtkLayout and
// GtkFixed. It makes use of the gravity window property and
// therefore does not work with GTK 1.0.
#define XCheckIfEvent XCHECKIFEVENT
#endif
#define XCheckIfEvent XCHECKIFEVENT
#endif
#include "wx/gtk/win_gtk.h"
#include "gtk/gtksignal.h"
#include "gtk/gtkprivate.h"
#include "wx/gtk/win_gtk.h"
#include "gtk/gtksignal.h"
#include "gtk/gtkprivate.h"
#ifdef __cplusplus
}
#endif /* __cplusplus */
#ifdef __cplusplus
}
#endif /* __cplusplus */
/* ///////////////////////////////////////////////////////////////////////////
/* ///////////////////////////////////////////////////////////////////////////
+// Name: src/gtk1/win_gtk.c
// Purpose: Native GTK+ widget for wxWidgets, based on GtkLayout and
// GtkFixed. It makes use of the gravity window property and
// therefore does not work with GTK 1.0.
// Purpose: Native GTK+ widget for wxWidgets, based on GtkLayout and
// GtkFixed. It makes use of the gravity window property and
// therefore does not work with GTK 1.0.
#define XCheckIfEvent XCHECKIFEVENT
#endif
#define XCheckIfEvent XCHECKIFEVENT
#endif
#include "wx/gtk1/win_gtk.h"
#include "gtk/gtksignal.h"
#include "gtk/gtkprivate.h"
#include "wx/gtk1/win_gtk.h"
#include "gtk/gtksignal.h"
#include "gtk/gtkprivate.h"
#ifdef __cplusplus
}
#endif /* __cplusplus */
#ifdef __cplusplus
}
#endif /* __cplusplus */
/* -------------------------------------------------------------------------
* Project: GSocket (Generic Socket) for WX
/* -------------------------------------------------------------------------
* Project: GSocket (Generic Socket) for WX
+ * Name: src/mac/carbon/gsocket.cpp
* Copyright: (c) Guilhem Lavaux
* Licence: wxWindows Licence
* Authors: Guilhem Lavaux,
* Copyright: (c) Guilhem Lavaux
* Licence: wxWindows Licence
* Authors: Guilhem Lavaux,
*/
#ifndef __GSOCKET_STANDALONE__
*/
#ifndef __GSOCKET_STANDALONE__
#include "wx/platform.h"
#endif
#include "wx/platform.h"
#endif
/////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////
+// Name: src/mac/classic/accel.cpp
// Purpose: wxAcceleratorTable
// Author: Stefan Csomor
// Modified by:
// Purpose: wxAcceleratorTable
// Author: Stefan Csomor
// Modified by:
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
+#include "wx/wxprec.h"
+
#include "wx/accel.h"
#include "wx/string.h"
#include "wx/accel.h"
#include "wx/string.h"
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
+#include "wx/wxprec.h"
+
#include "wx/utils.h"
#include "wx/brush.h"
#include "wx/utils.h"
#include "wx/brush.h"
/////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////
+// Name: src/mac/classic/glcanvas.cpp
// Purpose: wxGLCanvas, for using OpenGL with wxWidgets under Macintosh
// Author: Stefan Csomor
// Modified by:
// Purpose: wxGLCanvas, for using OpenGL with wxWidgets under Macintosh
// Author: Stefan Csomor
// Modified by:
#if wxUSE_GLCANVAS
#ifndef WX_PRECOMP
#if wxUSE_GLCANVAS
#ifndef WX_PRECOMP
m_drawable = (AGLDrawable) UMAGetWindowPort(MAC_WXHWND(win->MacGetRootWindow()));
m_drawable = (AGLDrawable) UMAGetWindowPort(MAC_WXHWND(win->MacGetRootWindow()));
m_glContext = aglCreateContext(fmt, other ? other->m_glContext : NULL);
wxCHECK_RET( m_glContext, wxT("Couldn't create OpenGl context") );
m_glContext = aglCreateContext(fmt, other ? other->m_glContext : NULL);
wxCHECK_RET( m_glContext, wxT("Couldn't create OpenGl context") );
GLboolean b;
b = aglSetDrawable(m_glContext, m_drawable);
wxCHECK_RET( b, wxT("Couldn't bind OpenGl context") );
GLboolean b;
b = aglSetDrawable(m_glContext, m_drawable);
wxCHECK_RET( b, wxT("Couldn't bind OpenGl context") );
static AGLPixelFormat ChoosePixelFormat(const int *attribList)
{
GLint data[512];
static AGLPixelFormat ChoosePixelFormat(const int *attribList)
{
GLint data[512];
- GLint defaultAttribs[] = { AGL_RGBA,
- AGL_DOUBLEBUFFER,
- AGL_MINIMUM_POLICY,
+ GLint defaultAttribs[] = { AGL_RGBA,
+ AGL_DOUBLEBUFFER,
+ AGL_MINIMUM_POLICY,
AGL_DEPTH_SIZE, 1, // use largest available depth buffer
AGL_DEPTH_SIZE, 1, // use largest available depth buffer
- AGL_RED_SIZE, 1,
- AGL_GREEN_SIZE, 1,
- AGL_BLUE_SIZE, 1,
- AGL_ALPHA_SIZE, 0,
+ AGL_RED_SIZE, 1,
+ AGL_GREEN_SIZE, 1,
+ AGL_BLUE_SIZE, 1,
+ AGL_ALPHA_SIZE, 0,
AGL_NONE };
GLint *attribs;
if (!attribList)
AGL_NONE };
GLint *attribs;
if (!attribList)
data[p++] = AGL_MINIMUM_POLICY; // make _SIZE tags behave more like GLX
while( (attribList[arg]!=0) && (p<512) )
{
data[p++] = AGL_MINIMUM_POLICY; // make _SIZE tags behave more like GLX
while( (attribList[arg]!=0) && (p<512) )
{
data[p++]=AGL_BLUE_SIZE; data[p++]=attribList[arg++]; break;
case WX_GL_MIN_ALPHA:
data[p++]=AGL_ALPHA_SIZE; data[p++]=attribList[arg++]; break;
data[p++]=AGL_BLUE_SIZE; data[p++]=attribList[arg++]; break;
case WX_GL_MIN_ALPHA:
data[p++]=AGL_ALPHA_SIZE; data[p++]=attribList[arg++]; break;
data[p++]=AGL_DEPTH_SIZE; data[p++]=attribList[arg++]; break;
data[p++]=AGL_DEPTH_SIZE; data[p++]=attribList[arg++]; break;
- case WX_GL_STENCIL_SIZE:
+ case WX_GL_STENCIL_SIZE:
data[p++]=AGL_STENCIL_SIZE; data[p++]=attribList[arg++]; break;
case WX_GL_MIN_ACCUM_RED:
data[p++]=AGL_ACCUM_RED_SIZE; data[p++]=attribList[arg++]; break;
data[p++]=AGL_STENCIL_SIZE; data[p++]=attribList[arg++]; break;
case WX_GL_MIN_ACCUM_RED:
data[p++]=AGL_ACCUM_RED_SIZE; data[p++]=attribList[arg++]; break;
return aglChoosePixelFormat(NULL, 0, attribs);
}
return aglChoosePixelFormat(NULL, 0, attribs);
}
int *attribList, const wxPalette& palette)
{
wxWindow::Create( parent, id, pos, size, style, name );
int *attribList, const wxPalette& palette)
{
wxWindow::Create( parent, id, pos, size, style, name );
AGLPixelFormat fmt = ChoosePixelFormat(attribList);
wxCHECK_MSG( fmt, false, wxT("Couldn't create OpenGl pixel format") );
AGLPixelFormat fmt = ChoosePixelFormat(attribList);
wxCHECK_MSG( fmt, false, wxT("Couldn't create OpenGl pixel format") );
m_glContext = new wxGLContext(fmt, this, palette, shared);
m_macCanvasIsShown = true ;
aglDestroyPixelFormat(fmt);
m_glContext = new wxGLContext(fmt, this, palette, shared);
m_macCanvasIsShown = true ;
aglDestroyPixelFormat(fmt);
// adjust glViewport to just this window
int x = 0 ;
int y = 0 ;
// adjust glViewport to just this window
int x = 0 ;
int y = 0 ;
wxWindow* iter = this ;
while( iter->GetParent() )
{
wxWindow* iter = this ;
while( iter->GetParent() )
{
- iter = iter->GetParent() ;
+ iter = iter->GetParent() ;
if ( iter && iter->IsTopLevel() )
{
if ( iter && iter->IsTopLevel() )
{
- MacClientToRootWindow( &x , &y ) ;
- int width, height;
- GetClientSize(& width, & height);
- Rect bounds ;
- GetWindowPortBounds( MAC_WXHWND(MacGetRootWindow()) , &bounds ) ;
- GLint parms[4] ;
- parms[0] = x ;
- parms[1] = bounds.bottom - bounds.top - ( y + height ) ;
- parms[2] = width ;
- parms[3] = height ;
-
- if ( !m_macCanvasIsShown )
- parms[0] += 20000 ;
- aglSetInteger( m_glContext->m_glContext , AGL_BUFFER_RECT , parms ) ;
- }
+ MacClientToRootWindow( &x , &y ) ;
+ int width, height;
+ GetClientSize(& width, & height);
+ Rect bounds ;
+ GetWindowPortBounds( MAC_WXHWND(MacGetRootWindow()) , &bounds ) ;
+ GLint parms[4] ;
+ parms[0] = x ;
+ parms[1] = bounds.bottom - bounds.top - ( y + height ) ;
+ parms[2] = width ;
+ parms[3] = height ;
+
+ if ( !m_macCanvasIsShown )
+ parms[0] += 20000 ;
+ aglSetInteger( m_glContext->m_glContext , AGL_BUFFER_RECT , parms ) ;
+ }
}
void wxGLCanvas::OnSize(wxSizeEvent& event)
}
void wxGLCanvas::OnSize(wxSizeEvent& event)
m_glContext->SetColour(colour);
}
m_glContext->SetColour(colour);
}
-bool wxGLCanvas::Show(bool show)
+bool wxGLCanvas::Show(bool show)
{
if ( !wxWindow::Show( show ) )
{
if ( !wxWindow::Show( show ) )
if ( !show )
{
if ( m_macCanvasIsShown )
if ( !show )
{
if ( m_macCanvasIsShown )
-void wxGLCanvas::MacSuperShown( bool show )
+void wxGLCanvas::MacSuperShown( bool show )
wxWindow::MacSuperShown( show ) ;
}
wxWindow::MacSuperShown( show ) ;
}
/* -------------------------------------------------------------------------
* Project: GSocket (Generic Socket) for WX
/* -------------------------------------------------------------------------
* Project: GSocket (Generic Socket) for WX
+ * Name: src/mac/classic/gsocket.c
* Authors: Guilhem Lavaux,
* Guillermo Rodriguez Garcia <guille@iies.es> (maintainer)
* Stefan CSomor
* Authors: Guilhem Lavaux,
* Guillermo Rodriguez Garcia <guille@iies.es> (maintainer)
* Stefan CSomor
*/
#ifndef __GSOCKET_STANDALONE__
*/
#ifndef __GSOCKET_STANDALONE__
#include "wx/platform.h"
#endif
#include "wx/platform.h"
#endif
OSStatus DoNegotiateIPReuseAddrOption(EndpointRef ep, Boolean enableReuseIPMode);
/* Input: ep - endpointref on which to negotiate the option
OSStatus DoNegotiateIPReuseAddrOption(EndpointRef ep, Boolean enableReuseIPMode);
/* Input: ep - endpointref on which to negotiate the option
- enableReuseIPMode - desired option setting - true/false
+ enableReuseIPMode - desired option setting - true/false
Return: kOTNoError indicates that the option was successfully negotiated
Return: kOTNoError indicates that the option was successfully negotiated
- OSStatus is an error if < 0, otherwise, the status field is
- returned and is > 0.
-
- IMPORTANT NOTE: The endpoint is assumed to be in synchronous more, otherwise
- this code will not function as desired
+ OSStatus is an error if < 0, otherwise, the status field is
+ returned and is > 0.
+
+ IMPORTANT NOTE: The endpoint is assumed to be in synchronous more, otherwise
+ this code will not function as desired
*/
OSStatus DoNegotiateIPReuseAddrOption(EndpointRef ep, Boolean enableReuseIPMode)
{
*/
OSStatus DoNegotiateIPReuseAddrOption(EndpointRef ep, Boolean enableReuseIPMode)
{
- UInt8 buf[kOTFourByteOptionSize]; // define buffer for fourByte Option size
- TOption* opt; // option ptr to make items easier to access
- TOptMgmt req;
- TOptMgmt ret;
- OSStatus err;
-
- if (!OTIsSynchronous(ep))
- {
- return (-1);
- }
+ UInt8 buf[kOTFourByteOptionSize]; // define buffer for fourByte Option size
+ TOption* opt; // option ptr to make items easier to access
+ TOptMgmt req;
+ TOptMgmt ret;
+ OSStatus err;
+
+ if (!OTIsSynchronous(ep))
+ {
+ return (-1);
+ }
opt = (TOption*)buf; // set option ptr to buffer
req.opt.buf = buf;
req.opt.len = sizeof(buf);
opt = (TOption*)buf; // set option ptr to buffer
req.opt.buf = buf;
req.opt.len = sizeof(buf);
#else
if ( gInetSvcRef )
return TRUE ;
#else
if ( gInetSvcRef )
return TRUE ;
InitOpenTransport() ;
gOTInited = 1 ;
gInetSvcRef = OTOpenInternetServices(kDefaultInternetServicesPath, NULL, &err);
InitOpenTransport() ;
gOTInited = 1 ;
gInetSvcRef = OTOpenInternetServices(kDefaultInternetServicesPath, NULL, &err);
/* we do not support multihoming with this code at the moment
/* we do not support multihoming with this code at the moment
- OTGetProtAddress will have to be used then - but we don't have a handy
+ OTGetProtAddress will have to be used then - but we don't have a handy
method to use right now
*/
{
method to use right now
*/
{
* Sets up this socket as a server. The local address must have been
* set with GSocket_SetLocal() before GSocket_SetServer() is called.
* Returns GSOCK_NOERROR on success, one of the following otherwise:
* Sets up this socket as a server. The local address must have been
* set with GSocket_SetLocal() before GSocket_SetServer() is called.
* Returns GSOCK_NOERROR on success, one of the following otherwise:
* Error codes:
* GSOCK_INVSOCK - the socket is in use.
* GSOCK_INVADDR - the local address has not been set.
* Error codes:
* GSOCK_INVSOCK - the socket is in use.
* GSOCK_INVADDR - the local address has not been set.
- * GSOCK_IOERR - low-level error.
+ * GSOCK_IOERR - low-level error.
*/
GSocketError GSocket_SetServer(GSocket *sck)
{
*/
GSocketError GSocket_SetServer(GSocket *sck)
{
* GSOCK_TIMEDOUT - timeout, no incoming connections.
* GSOCK_WOULDBLOCK - the call would block and the socket is nonblocking.
* GSOCK_MEMERR - couldn't allocate memory.
* GSOCK_TIMEDOUT - timeout, no incoming connections.
* GSOCK_WOULDBLOCK - the call would block and the socket is nonblocking.
* GSOCK_MEMERR - couldn't allocate memory.
- * GSOCK_IOERR - low-level error.
+ * GSOCK_IOERR - low-level error.
*/
GSocket *GSocket_WaitConnection(GSocket *socket)
{
*/
GSocket *GSocket_WaitConnection(GSocket *socket)
{
sck->m_oriented = FALSE;
/* Create the socket */
sck->m_oriented = FALSE;
/* Create the socket */
// TODO
#if 0
sck->m_endpoint = socket(sck->m_local->m_realfamily, SOCK_DGRAM, 0);
// TODO
#if 0
sck->m_endpoint = socket(sck->m_local->m_realfamily, SOCK_DGRAM, 0);
* GSOCK_TIMEDOUT - timeout, the connection failed.
* GSOCK_WOULDBLOCK - connection in progress (nonblocking sockets only)
* GSOCK_MEMERR - couldn't allocate memory.
* GSOCK_TIMEDOUT - timeout, the connection failed.
* GSOCK_WOULDBLOCK - connection in progress (nonblocking sockets only)
* GSOCK_MEMERR - couldn't allocate memory.
- * GSOCK_IOERR - low-level error.
+ * GSOCK_IOERR - low-level error.
*/
GSocketError GSocket_Connect(GSocket *sck, GSocketStream stream)
{
*/
GSocketError GSocket_Connect(GSocket *sck, GSocketStream stream)
{
/* Create the socket */
#if TARGET_CARBON
/* Create the socket */
#if TARGET_CARBON
OTOpenEndpointInContext( OTCreateConfiguration( kTCPName) , 0 , &info , &err , NULL ) ;
#else
OTOpenEndpointInContext( OTCreateConfiguration( kTCPName) , 0 , &info , &err , NULL ) ;
#else
OTOpenEndpoint( OTCreateConfiguration( kTCPName) , 0 , &info , &err ) ;
#endif
if ( sck->m_endpoint == kOTInvalidEndpointRef || err != kOTNoError )
OTOpenEndpoint( OTCreateConfiguration( kTCPName) , 0 , &info , &err ) ;
#endif
if ( sck->m_endpoint == kOTInvalidEndpointRef || err != kOTNoError )
* is in blocking mode, we select() for the specified timeout
* checking for writability to see if the connection request
* completes.
* is in blocking mode, we select() for the specified timeout
* checking for writability to see if the connection request
* completes.
if ((err == kOTNoDataErr ) && (!sck->m_non_blocking))
{
if ((err == kOTNoDataErr ) && (!sck->m_non_blocking))
{
ret = _GSocket_Recv_Stream(socket, buffer, size);
else
ret = _GSocket_Recv_Dgram(socket, buffer, size);
ret = _GSocket_Recv_Stream(socket, buffer, size);
else
ret = _GSocket_Recv_Dgram(socket, buffer, size);
if (ret == -1)
{
if (errno == EWOULDBLOCK)
if (ret == -1)
{
if (errno == EWOULDBLOCK)
else
socket->m_error = GSOCK_IOERR;
}
else
socket->m_error = GSOCK_IOERR;
}
return ret;
}
int GSocket_Write(GSocket *socket, const char *buffer, int size)
return ret;
}
int GSocket_Write(GSocket *socket, const char *buffer, int size)
int ret;
assert(socket != NULL);
int ret;
assert(socket != NULL);
ret = _GSocket_Send_Stream(socket, buffer, size);
else
ret = _GSocket_Send_Dgram(socket, buffer, size);
ret = _GSocket_Send_Stream(socket, buffer, size);
else
ret = _GSocket_Send_Dgram(socket, buffer, size);
if (ret == -1)
{
if (errno == EWOULDBLOCK)
if (ret == -1)
{
if (errno == EWOULDBLOCK)
socket->m_detected &= ~GSOCK_OUTPUT_FLAG;
return -1;
}
socket->m_detected &= ~GSOCK_OUTPUT_FLAG;
return -1;
}
wxMacProcessNotifierEvents() ;
/*
state = OTGetEndpointState(socket->m_endpoint);
wxMacProcessNotifierEvents() ;
/*
state = OTGetEndpointState(socket->m_endpoint);
if ( ( flags & GSOCK_INPUT_FLAG ) && ! ( socket->m_detected & GSOCK_INPUT_FLAG ) )
{
size_t sz = 0 ;
if ( ( flags & GSOCK_INPUT_FLAG ) && ! ( socket->m_detected & GSOCK_INPUT_FLAG ) )
{
size_t sz = 0 ;
* operation, there is still data available, the callback function will
* be called again.
* GSOCK_OUTPUT:
* operation, there is still data available, the callback function will
* be called again.
* GSOCK_OUTPUT:
- * The socket is available for writing. That is, the next write call
+ * The socket is available for writing. That is, the next write call
* won't block. This event is generated only once, when the connection is
* first established, and then only if a call failed with GSOCK_WOULDBLOCK,
* when the output buffer empties again. This means that the app should
* won't block. This event is generated only once, when the connection is
* first established, and then only if a call failed with GSOCK_WOULDBLOCK,
* when the output buffer empties again. This means that the app should
{
address->m_family = GSOCK_INET;
address->m_host = kOTAnyInetAddress ;
{
address->m_family = GSOCK_INET;
address->m_host = kOTAnyInetAddress ;
address->m_host = INADDR_NONE ;
address->m_error = GSOCK_NOHOST;
return GSOCK_NOHOST;
address->m_host = INADDR_NONE ;
address->m_error = GSOCK_NOHOST;
return GSOCK_NOHOST;
address->m_host = hinfo.addrs[0] ;
return GSOCK_NOERROR;
}
address->m_host = hinfo.addrs[0] ;
return GSOCK_NOERROR;
}
{
char * name ;
unsigned short port ;
{
char * name ;
unsigned short port ;
} ;
typedef struct service_entry service_entry ;
service_entry gServices[] =
{
} ;
typedef struct service_entry service_entry ;
service_entry gServices[] =
{
- { "http" , 80 , "tcp" }
+ { "http" , 80 , "tcp" }
} ;
GSocketError GAddress_INET_SetPortName(GAddress *address, const char *port,
} ;
GSocketError GAddress_INET_SetPortName(GAddress *address, const char *port,
assert(address != NULL);
CHECK_ADDRESS(address, INET, GSOCK_INVADDR);
address->m_port = port ;
assert(address != NULL);
CHECK_ADDRESS(address, INET, GSOCK_INVADDR);
address->m_port = port ;
return GSOCK_NOERROR;
}
GSocketError GAddress_INET_GetHostName(GAddress *address, char *hostname, size_t sbuf)
{
InetDomainName name ;
return GSOCK_NOERROR;
}
GSocketError GAddress_INET_GetHostName(GAddress *address, char *hostname, size_t sbuf)
{
InetDomainName name ;
- if ( GSocket_Verify_Inited() == FALSE )
+ if ( GSocket_Verify_Inited() == FALSE )
-
- assert(address != NULL);
+
+ assert(address != NULL);
CHECK_ADDRESS(address, INET, GSOCK_INVADDR);
OTInetAddressToName( gInetSvcRef , address->m_host , name ) ;
CHECK_ADDRESS(address, INET, GSOCK_INVADDR);
OTInetAddressToName( gInetSvcRef , address->m_host , name ) ;
unsigned long GAddress_INET_GetHostAddress(GAddress *address)
{
unsigned long GAddress_INET_GetHostAddress(GAddress *address)
{
- assert(address != NULL);
- CHECK_ADDRESS(address, INET, 0);
+ assert(address != NULL);
+ CHECK_ADDRESS(address, INET, 0);
return address->m_host;
}
unsigned short GAddress_INET_GetPort(GAddress *address)
{
return address->m_host;
}
unsigned short GAddress_INET_GetPort(GAddress *address)
{
- assert(address != NULL);
- CHECK_ADDRESS(address, INET, 0);
+ assert(address != NULL);
+ CHECK_ADDRESS(address, INET, 0);
return address->m_port;
}
return address->m_port;
}
{
if ( socket->m_takesEvents )
return ;
{
if ( socket->m_takesEvents )
return ;
{
OTResult state ;
socket->m_takesEvents = TRUE ;
state = OTGetEndpointState(socket->m_endpoint);
{
OTResult state ;
socket->m_takesEvents = TRUE ;
state = OTGetEndpointState(socket->m_endpoint);
{
OTByteCount sz = 0 ;
OTCountDataBytes( socket->m_endpoint , &sz ) ;
{
OTByteCount sz = 0 ;
OTCountDataBytes( socket->m_endpoint , &sz ) ;
Microseconds(&start);
now = start ;
socket->m_takesEvents = FALSE ;
Microseconds(&start);
now = start ;
socket->m_takesEvents = FALSE ;
while( (now.hi * 4294967296.0 + now.lo) - (start.hi * 4294967296.0 + start.lo) < socket->m_timeout * 1000.0 )
{
OTResult state ;
OTByteCount sz = 0 ;
state = OTGetEndpointState(socket->m_endpoint);
while( (now.hi * 4294967296.0 + now.lo) - (start.hi * 4294967296.0 + start.lo) < socket->m_timeout * 1000.0 )
{
OTResult state ;
OTByteCount sz = 0 ;
state = OTGetEndpointState(socket->m_endpoint);
OTCountDataBytes( socket->m_endpoint , &sz ) ;
if ( state == T_INCON || sz > 0 )
{
socket->m_takesEvents = formerTakesEvents ;
return GSOCK_NOERROR;
}
OTCountDataBytes( socket->m_endpoint , &sz ) ;
if ( state == T_INCON || sz > 0 )
{
socket->m_takesEvents = formerTakesEvents ;
return GSOCK_NOERROR;
}
}
socket->m_takesEvents = formerTakesEvents ;
socket->m_error = GSOCK_TIMEDOUT;
}
socket->m_takesEvents = formerTakesEvents ;
socket->m_error = GSOCK_TIMEDOUT;
Microseconds(&start);
now = start ;
socket->m_takesEvents = FALSE ;
Microseconds(&start);
now = start ;
socket->m_takesEvents = FALSE ;
while( (now.hi * 4294967296.0 + now.lo) - (start.hi * 4294967296.0 + start.lo) < socket->m_timeout * 1000.0 )
{
OTResult state ;
state = OTGetEndpointState(socket->m_endpoint);
while( (now.hi * 4294967296.0 + now.lo) - (start.hi * 4294967296.0 + start.lo) < socket->m_timeout * 1000.0 )
{
OTResult state ;
state = OTGetEndpointState(socket->m_endpoint);
if ( state == T_DATAXFER || state == T_INREL )
{
socket->m_takesEvents = formerTakesEvents ;
return GSOCK_NOERROR;
}
if ( state == T_DATAXFER || state == T_INREL )
{
socket->m_takesEvents = formerTakesEvents ;
return GSOCK_NOERROR;
}
}
socket->m_takesEvents = formerTakesEvents ;
socket->m_error = GSOCK_TIMEDOUT;
}
socket->m_takesEvents = formerTakesEvents ;
socket->m_error = GSOCK_TIMEDOUT;
* operation, there is still data available, the callback function will
* be called again.
* GSOCK_OUTPUT:
* operation, there is still data available, the callback function will
* be called again.
* GSOCK_OUTPUT:
- * The socket is available for writing. That is, the next write call
+ * The socket is available for writing. That is, the next write call
* won't block. This event is generated only once, when the connection is
* first established, and then only if a call failed with GSOCK_WOULDBLOCK,
* when the output buffer empties again. This means that the app should
* won't block. This event is generated only once, when the connection is
* first established, and then only if a call failed with GSOCK_WOULDBLOCK,
* when the output buffer empties again. This means that the app should
/////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////
+// Name: src/mac/classic/joystick.cpp
// Purpose: wxJoystick class
// Author: Stefan Csomor
// Modified by:
// Purpose: wxJoystick class
// Author: Stefan Csomor
// Modified by:
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
-#include "wx/setup.h"
-
-#include "wx/joystick.h"
+#include "wx/joystick.h"
+
IMPLEMENT_DYNAMIC_CLASS(wxJoystick, wxObject)
// Attributes
IMPLEMENT_DYNAMIC_CLASS(wxJoystick, wxObject)
// Attributes
bool wxJoystick::IsOk() const
{
// TODO
bool wxJoystick::IsOk() const
{
// TODO
}
int wxJoystick::GetNumberJoysticks()
}
int wxJoystick::GetNumberJoysticks()
wxString wxJoystick::GetProductName() const
{
// TODO
wxString wxJoystick::GetProductName() const
{
// TODO
- return wxString(wxT(""));
}
int wxJoystick::GetXMin() const
}
int wxJoystick::GetXMin() const
bool wxJoystick::HasRudder() const
{
// TODO
bool wxJoystick::HasRudder() const
{
// TODO
}
bool wxJoystick::HasZ() const
{
// TODO
}
bool wxJoystick::HasZ() const
{
// TODO
}
bool wxJoystick::HasU() const
{
// TODO
}
bool wxJoystick::HasU() const
{
// TODO
}
bool wxJoystick::HasV() const
{
// TODO
}
bool wxJoystick::HasV() const
{
// TODO
}
bool wxJoystick::HasPOV() const
{
// TODO
}
bool wxJoystick::HasPOV() const
{
// TODO
}
bool wxJoystick::HasPOV4Dir() const
{
// TODO
}
bool wxJoystick::HasPOV4Dir() const
{
// TODO
}
bool wxJoystick::HasPOVCTS() const
{
// TODO
}
bool wxJoystick::HasPOVCTS() const
{
// TODO
bool wxJoystick::SetCapture(wxWindow* win, int pollingFreq)
{
// TODO
bool wxJoystick::SetCapture(wxWindow* win, int pollingFreq)
{
// TODO
}
bool wxJoystick::ReleaseCapture()
{
// TODO
}
bool wxJoystick::ReleaseCapture()
{
// TODO
}
#endif
// wxUSE_JOYSTICK
}
#endif
// wxUSE_JOYSTICK
/////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////
+// Name: src/mac/classic/metafile.cpp
// Purpose: wxMetaFile, wxMetaFileDC etc. These classes are optional.
// Author: Stefan Csomor
// Modified by:
// Purpose: wxMetaFile, wxMetaFileDC etc. These classes are optional.
// Author: Stefan Csomor
// Modified by:
-#ifndef WX_PRECOMP
-#include "wx/setup.h"
-#endif
-
#if wxUSE_METAFILE
#ifndef WX_PRECOMP
#if wxUSE_METAFILE
#ifndef WX_PRECOMP
M_METAFILEDATA->m_metafile = 0;
wxASSERT_MSG( file.IsEmpty() , wxT("no file based metafile support yet") ) ;
/*
M_METAFILEDATA->m_metafile = 0;
wxASSERT_MSG( file.IsEmpty() , wxT("no file based metafile support yet") ) ;
/*
- if (!file.IsNull() && (file.Cmp("") == 0))
M_METAFILEDATA->m_metafile = (WXHANDLE) GetMetaFile(file);
*/
}
M_METAFILEDATA->m_metafile = (WXHANDLE) GetMetaFile(file);
*/
}
#if wxUSE_DRAG_AND_DROP
//TODO finishi this port , we need the data obj first
if (!m_refData)
#if wxUSE_DRAG_AND_DROP
//TODO finishi this port , we need the data obj first
if (!m_refData)
bool alreadyOpen=wxTheClipboard->IsOpened() ;
if (!alreadyOpen)
{
bool alreadyOpen=wxTheClipboard->IsOpened() ;
if (!alreadyOpen)
{
wxDataObject *data =
new wxMetafileDataObject( *this) ;
bool success = wxTheClipboard->SetData(data);
wxDataObject *data =
new wxMetafileDataObject( *this) ;
bool success = wxTheClipboard->SetData(data);
wxTheClipboard->Close();
return (bool) success;
#endif
wxTheClipboard->Close();
return (bool) success;
#endif
}
void wxMetafile::SetHMETAFILE(WXHMETAFILE mf)
}
void wxMetafile::SetHMETAFILE(WXHMETAFILE mf)
bool wxMetaFile::Play(wxDC *dc)
{
if (!m_refData)
bool wxMetaFile::Play(wxDC *dc)
{
if (!m_refData)
{
wxMacPortSetter helper( dc ) ;
PicHandle pict = (PicHandle) GetHMETAFILE() ;
DrawPicture( pict , &(**pict).picFrame ) ;
}
{
wxMacPortSetter helper( dc ) ;
PicHandle pict = (PicHandle) GetHMETAFILE() ;
DrawPicture( pict , &(**pict).picFrame ) ;
}
}
wxSize wxMetaFile::GetSize() const
}
wxSize wxMetaFile::GetSize() const
// give origin/extent arguments to wxMakeMetaFilePlaceable.
wxMetaFileDC::wxMetaFileDC(const wxString& filename ,
// give origin/extent arguments to wxMakeMetaFilePlaceable.
wxMetaFileDC::wxMetaFileDC(const wxString& filename ,
- int width , int height ,
- const wxString& WXUNUSED(description) )
+ int width , int height ,
+ const wxString& WXUNUSED(description) )
{
wxASSERT_MSG( width == 0 || height == 0 , _T("no arbitration of metafilesize supported") ) ;
{
wxASSERT_MSG( width == 0 || height == 0 , _T("no arbitration of metafilesize supported") ) ;
- wxASSERT_MSG( filename.IsEmpty() , _T("no file based metafile support yet")) ;
-
+ wxASSERT_MSG( filename.empty() , _T("no file based metafile support yet")) ;
+
m_metaFile = new wxMetaFile(filename) ;
Rect r={0,0,height,width} ;
m_metaFile = new wxMetaFile(filename) ;
Rect r={0,0,height,width} ;
RectRgn( (RgnHandle) m_macBoundaryClipRgn , &r ) ;
CopyRgn( (RgnHandle) m_macBoundaryClipRgn , (RgnHandle) m_macCurrentClipRgn ) ;
m_metaFile->SetHMETAFILE( OpenPicture( &r ) ) ;
RectRgn( (RgnHandle) m_macBoundaryClipRgn , &r ) ;
CopyRgn( (RgnHandle) m_macBoundaryClipRgn , (RgnHandle) m_macCurrentClipRgn ) ;
m_metaFile->SetHMETAFILE( OpenPicture( &r ) ) ;
- ::GetPort( (GrafPtr*) &m_macPort ) ;
- m_ok = TRUE ;
-
- SetMapMode(wxMM_TEXT);
+ ::GetPort( (GrafPtr*) &m_macPort ) ;
+ m_ok = true ;
+
+ SetMapMode(wxMM_TEXT);
}
wxMetaFileDC::~wxMetaFileDC()
}
wxMetaFileDC::~wxMetaFileDC()
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
+#include "wx/wxprec.h"
+
#include "wx/utils.h"
#include "wx/pen.h"
#include "wx/utils.h"
#include "wx/pen.h"
/////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////
+// Name: src/mac/classic/utils.cpp
// Purpose: Various utilities
// Author: Stefan Csomor
// Modified by:
// Purpose: Various utilities
// Author: Stefan Csomor
// Modified by:
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
+#include "wx/wxprec.h"
+
#include "wx/utils.h"
#include "wx/app.h"
#include "wx/apptrait.h"
#include "wx/utils.h"
#include "wx/app.h"
#include "wx/apptrait.h"
#endif // defined(__WXMAC__) && !defined(__DARWIN__) && (__MWERKS__ >= 0x2400)
#endif // wxUSE_GUI
#endif // defined(__WXMAC__) && !defined(__DARWIN__) && (__MWERKS__ >= 0x2400)
#endif // wxUSE_GUI
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
+#include "wx/wxprec.h"
+
#include "wx/menu.h"
#include "wx/window.h"
#include "wx/dc.h"
#include "wx/menu.h"
#include "wx/window.h"
#include "wx/dc.h"
/* -------------------------------------------------------------------------
* Project: GSocket (Generic Socket) for WX
/* -------------------------------------------------------------------------
* Project: GSocket (Generic Socket) for WX
+ * Name: src/mac/corefoundation/gsockosx.c
* Purpose: GSocket: Mac OS X mach-o part
* CVSID: $Id$
* Mac code by Brian Victor, February 2002. Email comments to bhv1@psu.edu
* ------------------------------------------------------------------------- */
* Purpose: GSocket: Mac OS X mach-o part
* CVSID: $Id$
* Mac code by Brian Victor, February 2002. Email comments to bhv1@psu.edu
* ------------------------------------------------------------------------- */
cont.info = socket;
CFSocketRef cf = CFSocketCreateWithNative(NULL, socket->m_fd,
cont.info = socket;
CFSocketRef cf = CFSocketCreateWithNative(NULL, socket->m_fd,
- ALL_CALLBACK_TYPES, Mac_Socket_Callback, &cont);
+ ALL_CALLBACK_TYPES, Mac_Socket_Callback, &cont);
CFRunLoopSourceRef source = CFSocketCreateRunLoopSource(NULL, cf, 0);
assert(source);
socket->m_gui_dependent = (char*)data;
CFRunLoopSourceRef source = CFSocketCreateRunLoopSource(NULL, cf, 0);
assert(source);
socket->m_gui_dependent = (char*)data;