Include order is wxprec.h=>defs.h=>platform.h=>setup.h so remove explicit setup.h inclusion not touched by chckconf.h.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@37169 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Włodzimierz Skiba
2006-01-26 19:53:08 +00:00
parent 23ff76d5ad
commit 0ba6a83624
13 changed files with 157 additions and 166 deletions

View File

@@ -1,5 +1,5 @@
/* /////////////////////////////////////////////////////////////////////////// /* ///////////////////////////////////////////////////////////////////////////
// Name: win_gtk.c // Name: src/gtk/win_gtk.c
// Purpose: Native GTK+ widget for wxWidgets, based on GtkLayout and // Purpose: Native GTK+ widget for wxWidgets, based on GtkLayout and
// GtkFixed. It makes use of the gravity window property and // GtkFixed. It makes use of the gravity window property and
// therefore does not work with GTK 1.0. // therefore does not work with GTK 1.0.
@@ -13,7 +13,7 @@
#define XCheckIfEvent XCHECKIFEVENT #define XCheckIfEvent XCHECKIFEVENT
#endif #endif
#include "wx/setup.h" #include "wx/defs.h"
#include "wx/gtk/win_gtk.h" #include "wx/gtk/win_gtk.h"
#include "gtk/gtksignal.h" #include "gtk/gtksignal.h"
#include "gtk/gtkprivate.h" #include "gtk/gtkprivate.h"
@@ -886,4 +886,3 @@ gtk_pizza_scroll (GtkPizza *pizza, gint dx, gint dy)
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif /* __cplusplus */ #endif /* __cplusplus */

View File

@@ -1,5 +1,5 @@
/* /////////////////////////////////////////////////////////////////////////// /* ///////////////////////////////////////////////////////////////////////////
// Name: win_gtk.c // Name: src/gtk1/win_gtk.c
// Purpose: Native GTK+ widget for wxWidgets, based on GtkLayout and // Purpose: Native GTK+ widget for wxWidgets, based on GtkLayout and
// GtkFixed. It makes use of the gravity window property and // GtkFixed. It makes use of the gravity window property and
// therefore does not work with GTK 1.0. // therefore does not work with GTK 1.0.
@@ -13,7 +13,7 @@
#define XCheckIfEvent XCHECKIFEVENT #define XCheckIfEvent XCHECKIFEVENT
#endif #endif
#include "wx/setup.h" #include "wx/defs.h"
#include "wx/gtk1/win_gtk.h" #include "wx/gtk1/win_gtk.h"
#include "gtk/gtksignal.h" #include "gtk/gtksignal.h"
#include "gtk/gtkprivate.h" #include "gtk/gtkprivate.h"
@@ -1202,4 +1202,3 @@ gtk_pizza_main_filter (GdkXEvent *gdk_xevent,
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif /* __cplusplus */ #endif /* __cplusplus */

View File

@@ -1,6 +1,6 @@
/* ------------------------------------------------------------------------- /* -------------------------------------------------------------------------
* Project: GSocket (Generic Socket) for WX * Project: GSocket (Generic Socket) for WX
* Name: gsocket.cpp * Name: src/mac/carbon/gsocket.cpp
* Copyright: (c) Guilhem Lavaux * Copyright: (c) Guilhem Lavaux
* Licence: wxWindows Licence * Licence: wxWindows Licence
* Authors: Guilhem Lavaux, * Authors: Guilhem Lavaux,
@@ -16,7 +16,6 @@
*/ */
#ifndef __GSOCKET_STANDALONE__ #ifndef __GSOCKET_STANDALONE__
#include "wx/setup.h"
#include "wx/platform.h" #include "wx/platform.h"
#endif #endif

View File

@@ -1,5 +1,5 @@
///////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////
// Name: accel.cpp // Name: src/mac/classic/accel.cpp
// Purpose: wxAcceleratorTable // Purpose: wxAcceleratorTable
// Author: Stefan Csomor // Author: Stefan Csomor
// Modified by: // Modified by:
@@ -9,7 +9,8 @@
// Licence: wxWindows licence // Licence: wxWindows licence
///////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////
#include "wx/setup.h" #include "wx/wxprec.h"
#include "wx/accel.h" #include "wx/accel.h"
#include "wx/string.h" #include "wx/string.h"
@@ -98,5 +99,3 @@ int wxAcceleratorTable::GetCommand( wxKeyEvent &event )
return -1; return -1;
} }

View File

@@ -9,7 +9,8 @@
// Licence: wxWindows licence // Licence: wxWindows licence
///////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////
#include "wx/setup.h" #include "wx/wxprec.h"
#include "wx/utils.h" #include "wx/utils.h"
#include "wx/brush.h" #include "wx/brush.h"

View File

@@ -1,5 +1,5 @@
///////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////
// Name: glcanvas.cpp // Name: src/mac/classic/glcanvas.cpp
// Purpose: wxGLCanvas, for using OpenGL with wxWidgets under Macintosh // Purpose: wxGLCanvas, for using OpenGL with wxWidgets under Macintosh
// Author: Stefan Csomor // Author: Stefan Csomor
// Modified by: // Modified by:
@@ -15,8 +15,6 @@
#pragma hdrstop #pragma hdrstop
#endif #endif
#include "wx/setup.h"
#if wxUSE_GLCANVAS #if wxUSE_GLCANVAS
#ifndef WX_PRECOMP #ifndef WX_PRECOMP
@@ -44,12 +42,12 @@ wxGLContext::wxGLContext(
) )
{ {
m_window = win; m_window = win;
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); m_glContext = aglCreateContext(fmt, other ? other->m_glContext : NULL);
wxCHECK_RET( m_glContext, wxT("Couldn't create OpenGl context") ); wxCHECK_RET( m_glContext, wxT("Couldn't create OpenGl context") );
GLboolean b; GLboolean b;
b = aglSetDrawable(m_glContext, m_drawable); b = aglSetDrawable(m_glContext, m_drawable);
wxCHECK_RET( b, wxT("Couldn't bind OpenGl context") ); wxCHECK_RET( b, wxT("Couldn't bind OpenGl context") );
@@ -147,14 +145,14 @@ wxGLCanvas::~wxGLCanvas()
static AGLPixelFormat ChoosePixelFormat(const int *attribList) static AGLPixelFormat ChoosePixelFormat(const int *attribList)
{ {
GLint data[512]; GLint data[512];
GLint defaultAttribs[] = { AGL_RGBA, GLint defaultAttribs[] = { AGL_RGBA,
AGL_DOUBLEBUFFER, AGL_DOUBLEBUFFER,
AGL_MINIMUM_POLICY, 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_RED_SIZE, 1,
AGL_GREEN_SIZE, 1, AGL_GREEN_SIZE, 1,
AGL_BLUE_SIZE, 1, AGL_BLUE_SIZE, 1,
AGL_ALPHA_SIZE, 0, AGL_ALPHA_SIZE, 0,
AGL_NONE }; AGL_NONE };
GLint *attribs; GLint *attribs;
if (!attribList) if (!attribList)
@@ -164,7 +162,7 @@ static AGLPixelFormat ChoosePixelFormat(const int *attribList)
else else
{ {
int arg=0, p=0; int arg=0, p=0;
data[p++] = AGL_MINIMUM_POLICY; // make _SIZE tags behave more like GLX data[p++] = AGL_MINIMUM_POLICY; // make _SIZE tags behave more like GLX
while( (attribList[arg]!=0) && (p<512) ) while( (attribList[arg]!=0) && (p<512) )
{ {
@@ -187,9 +185,9 @@ static AGLPixelFormat ChoosePixelFormat(const int *attribList)
data[p++]=AGL_BLUE_SIZE; data[p++]=attribList[arg++]; break; data[p++]=AGL_BLUE_SIZE; data[p++]=attribList[arg++]; break;
case WX_GL_MIN_ALPHA: case WX_GL_MIN_ALPHA:
data[p++]=AGL_ALPHA_SIZE; data[p++]=attribList[arg++]; break; data[p++]=AGL_ALPHA_SIZE; data[p++]=attribList[arg++]; break;
case WX_GL_DEPTH_SIZE: case WX_GL_DEPTH_SIZE:
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; data[p++]=AGL_STENCIL_SIZE; data[p++]=attribList[arg++]; break;
case WX_GL_MIN_ACCUM_RED: case WX_GL_MIN_ACCUM_RED:
data[p++]=AGL_ACCUM_RED_SIZE; data[p++]=attribList[arg++]; break; data[p++]=AGL_ACCUM_RED_SIZE; data[p++]=attribList[arg++]; break;
@@ -202,12 +200,12 @@ static AGLPixelFormat ChoosePixelFormat(const int *attribList)
default: default:
break; break;
} }
} }
data[p] = 0; data[p] = 0;
attribs = data; attribs = data;
} }
return aglChoosePixelFormat(NULL, 0, attribs); return aglChoosePixelFormat(NULL, 0, attribs);
} }
@@ -216,14 +214,14 @@ bool wxGLCanvas::Create(wxWindow *parent, const wxGLContext *shared, wxWindowID
int *attribList, const wxPalette& palette) int *attribList, const wxPalette& palette)
{ {
wxWindow::Create( parent, id, pos, size, style, name ); wxWindow::Create( parent, id, pos, size, style, name );
AGLPixelFormat fmt = ChoosePixelFormat(attribList); AGLPixelFormat fmt = ChoosePixelFormat(attribList);
wxCHECK_MSG( fmt, false, wxT("Couldn't create OpenGl pixel format") ); wxCHECK_MSG( fmt, false, wxT("Couldn't create OpenGl pixel format") );
m_glContext = new wxGLContext(fmt, this, palette, shared); m_glContext = new wxGLContext(fmt, this, palette, shared);
m_macCanvasIsShown = true ; m_macCanvasIsShown = true ;
aglDestroyPixelFormat(fmt); aglDestroyPixelFormat(fmt);
return true; return true;
} }
@@ -245,30 +243,30 @@ void wxGLCanvas::SetViewport()
// adjust glViewport to just this window // adjust glViewport to just this window
int x = 0 ; int x = 0 ;
int y = 0 ; int y = 0 ;
wxWindow* iter = this ; wxWindow* iter = this ;
while( iter->GetParent() ) while( iter->GetParent() )
{ {
iter = iter->GetParent() ; iter = iter->GetParent() ;
} }
if ( iter && iter->IsTopLevel() ) if ( iter && iter->IsTopLevel() )
{ {
MacClientToRootWindow( &x , &y ) ; MacClientToRootWindow( &x , &y ) ;
int width, height; int width, height;
GetClientSize(& width, & height); GetClientSize(& width, & height);
Rect bounds ; Rect bounds ;
GetWindowPortBounds( MAC_WXHWND(MacGetRootWindow()) , &bounds ) ; GetWindowPortBounds( MAC_WXHWND(MacGetRootWindow()) , &bounds ) ;
GLint parms[4] ; GLint parms[4] ;
parms[0] = x ; parms[0] = x ;
parms[1] = bounds.bottom - bounds.top - ( y + height ) ; parms[1] = bounds.bottom - bounds.top - ( y + height ) ;
parms[2] = width ; parms[2] = width ;
parms[3] = height ; parms[3] = height ;
if ( !m_macCanvasIsShown ) if ( !m_macCanvasIsShown )
parms[0] += 20000 ; parms[0] += 20000 ;
aglSetInteger( m_glContext->m_glContext , AGL_BUFFER_RECT , parms ) ; aglSetInteger( m_glContext->m_glContext , AGL_BUFFER_RECT , parms ) ;
} }
} }
void wxGLCanvas::OnSize(wxSizeEvent& event) void wxGLCanvas::OnSize(wxSizeEvent& event)
@@ -312,11 +310,11 @@ void wxGLCanvas::SetColour(const wxChar *colour)
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 ) )
return FALSE ; return false ;
if ( !show ) if ( !show )
{ {
if ( m_macCanvasIsShown ) if ( m_macCanvasIsShown )
@@ -333,10 +331,10 @@ bool wxGLCanvas::Show(bool show)
SetViewport() ; SetViewport() ;
} }
} }
return TRUE ; return true ;
} }
void wxGLCanvas::MacSuperShown( bool show ) void wxGLCanvas::MacSuperShown( bool show )
{ {
if ( !show ) if ( !show )
{ {
@@ -354,7 +352,7 @@ void wxGLCanvas::MacSuperShown( bool show )
SetViewport() ; SetViewport() ;
} }
} }
wxWindow::MacSuperShown( show ) ; wxWindow::MacSuperShown( show ) ;
} }

View File

@@ -1,6 +1,6 @@
/* ------------------------------------------------------------------------- /* -------------------------------------------------------------------------
* Project: GSocket (Generic Socket) for WX * Project: GSocket (Generic Socket) for WX
* Name: gsocket.c * Name: src/mac/classic/gsocket.c
* Authors: Guilhem Lavaux, * Authors: Guilhem Lavaux,
* Guillermo Rodriguez Garcia <guille@iies.es> (maintainer) * Guillermo Rodriguez Garcia <guille@iies.es> (maintainer)
* Stefan CSomor * Stefan CSomor
@@ -14,7 +14,6 @@
*/ */
#ifndef __GSOCKET_STANDALONE__ #ifndef __GSOCKET_STANDALONE__
#include "wx/setup.h"
#include "wx/platform.h" #include "wx/platform.h"
#endif #endif
@@ -92,29 +91,29 @@ OTNotifyUPP gOTNotifierUPP = NULL ;
OSStatus DoNegotiateIPReuseAddrOption(EndpointRef ep, Boolean enableReuseIPMode); OSStatus DoNegotiateIPReuseAddrOption(EndpointRef ep, Boolean enableReuseIPMode);
/* Input: ep - endpointref on which to negotiate the option /* 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 OSStatus is an error if < 0, otherwise, the status field is
returned and is > 0. returned and is > 0.
IMPORTANT NOTE: The endpoint is assumed to be in synchronous more, otherwise IMPORTANT NOTE: The endpoint is assumed to be in synchronous more, otherwise
this code will not function as desired 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 UInt8 buf[kOTFourByteOptionSize]; // define buffer for fourByte Option size
TOption* opt; // option ptr to make items easier to access TOption* opt; // option ptr to make items easier to access
TOptMgmt req; TOptMgmt req;
TOptMgmt ret; TOptMgmt ret;
OSStatus err; OSStatus err;
if (!OTIsSynchronous(ep)) if (!OTIsSynchronous(ep))
{ {
return (-1); return (-1);
} }
opt = (TOption*)buf; // set option ptr to buffer opt = (TOption*)buf; // set option ptr to buffer
req.opt.buf = buf; req.opt.buf = buf;
req.opt.len = sizeof(buf); req.opt.len = sizeof(buf);
@@ -225,7 +224,7 @@ int GSocket_Verify_Inited()
#else #else
if ( gInetSvcRef ) if ( gInetSvcRef )
return TRUE ; return TRUE ;
InitOpenTransport() ; InitOpenTransport() ;
gOTInited = 1 ; gOTInited = 1 ;
gInetSvcRef = OTOpenInternetServices(kDefaultInternetServicesPath, NULL, &err); gInetSvcRef = OTOpenInternetServices(kDefaultInternetServicesPath, NULL, &err);
@@ -259,7 +258,7 @@ void GSocket_Cleanup()
GSocket *GSocket_new() GSocket *GSocket_new()
{ {
int i; int i;
GSocket *socket; GSocket *socket;
@@ -427,7 +426,7 @@ GAddress *GSocket_GetLocal(GSocket *socket)
/* 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
*/ */
{ {
@@ -474,11 +473,11 @@ GAddress *GSocket_GetPeer(GSocket *socket)
* Sets up this socket as a server. The local address must have been * Sets up this socket as a server. The local address must have been
* set with GSocket_SetLocal() before GSocket_SetServer() is called. * set with GSocket_SetLocal() before GSocket_SetServer() is called.
* Returns GSOCK_NOERROR on success, one of the following otherwise: * Returns GSOCK_NOERROR on success, one of the following otherwise:
* *
* Error codes: * Error codes:
* GSOCK_INVSOCK - the socket is in use. * GSOCK_INVSOCK - the socket is in use.
* GSOCK_INVADDR - the local address has not been set. * 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)
{ {
@@ -546,7 +545,7 @@ GSocketError GSocket_SetServer(GSocket *sck)
* GSOCK_TIMEDOUT - timeout, no incoming connections. * GSOCK_TIMEDOUT - timeout, no incoming connections.
* GSOCK_WOULDBLOCK - the call would block and the socket is nonblocking. * GSOCK_WOULDBLOCK - the call would block and the socket is nonblocking.
* GSOCK_MEMERR - couldn't allocate memory. * 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)
{ {
@@ -663,7 +662,7 @@ GSocketError GSocket_SetNonOriented(GSocket *sck)
sck->m_oriented = FALSE; sck->m_oriented = FALSE;
/* Create the socket */ /* Create the socket */
// TODO // TODO
#if 0 #if 0
sck->m_endpoint = socket(sck->m_local->m_realfamily, SOCK_DGRAM, 0); sck->m_endpoint = socket(sck->m_local->m_realfamily, SOCK_DGRAM, 0);
@@ -723,7 +722,7 @@ GSocketError GSocket_SetNonOriented(GSocket *sck)
* GSOCK_TIMEDOUT - timeout, the connection failed. * GSOCK_TIMEDOUT - timeout, the connection failed.
* GSOCK_WOULDBLOCK - connection in progress (nonblocking sockets only) * GSOCK_WOULDBLOCK - connection in progress (nonblocking sockets only)
* GSOCK_MEMERR - couldn't allocate memory. * 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)
{ {
@@ -756,10 +755,10 @@ GSocketError GSocket_Connect(GSocket *sck, GSocketStream stream)
/* Create the socket */ /* Create the socket */
#if TARGET_CARBON #if TARGET_CARBON
sck->m_endpoint = sck->m_endpoint =
OTOpenEndpointInContext( OTCreateConfiguration( kTCPName) , 0 , &info , &err , NULL ) ; OTOpenEndpointInContext( OTCreateConfiguration( kTCPName) , 0 , &info , &err , NULL ) ;
#else #else
sck->m_endpoint = sck->m_endpoint =
OTOpenEndpoint( OTCreateConfiguration( kTCPName) , 0 , &info , &err ) ; OTOpenEndpoint( OTCreateConfiguration( kTCPName) , 0 , &info , &err ) ;
#endif #endif
if ( sck->m_endpoint == kOTInvalidEndpointRef || err != kOTNoError ) if ( sck->m_endpoint == kOTInvalidEndpointRef || err != kOTNoError )
@@ -791,7 +790,7 @@ GSocketError GSocket_Connect(GSocket *sck, GSocketStream stream)
* is in blocking mode, we select() for the specified timeout * is in blocking mode, we select() for the specified timeout
* checking for writability to see if the connection request * checking for writability to see if the connection request
* completes. * completes.
*/ */
if ((err == kOTNoDataErr ) && (!sck->m_non_blocking)) if ((err == kOTNoDataErr ) && (!sck->m_non_blocking))
{ {
@@ -868,7 +867,7 @@ int GSocket_Read(GSocket *socket, char *buffer, int size)
ret = _GSocket_Recv_Stream(socket, buffer, size); ret = _GSocket_Recv_Stream(socket, buffer, size);
else else
ret = _GSocket_Recv_Dgram(socket, buffer, size); ret = _GSocket_Recv_Dgram(socket, buffer, size);
if (ret == -1) if (ret == -1)
{ {
if (errno == EWOULDBLOCK) if (errno == EWOULDBLOCK)
@@ -876,12 +875,12 @@ int GSocket_Read(GSocket *socket, char *buffer, int size)
else else
socket->m_error = GSOCK_IOERR; socket->m_error = GSOCK_IOERR;
} }
return ret; return ret;
} }
int GSocket_Write(GSocket *socket, const char *buffer, int size) int GSocket_Write(GSocket *socket, const char *buffer, int size)
{ {
int ret; int ret;
assert(socket != NULL); assert(socket != NULL);
@@ -901,7 +900,7 @@ int GSocket_Write(GSocket *socket, const char *buffer, int size)
ret = _GSocket_Send_Stream(socket, buffer, size); ret = _GSocket_Send_Stream(socket, buffer, size);
else else
ret = _GSocket_Send_Dgram(socket, buffer, size); ret = _GSocket_Send_Dgram(socket, buffer, size);
if (ret == -1) if (ret == -1)
{ {
if (errno == EWOULDBLOCK) if (errno == EWOULDBLOCK)
@@ -917,7 +916,7 @@ int GSocket_Write(GSocket *socket, const char *buffer, int size)
socket->m_detected &= ~GSOCK_OUTPUT_FLAG; socket->m_detected &= ~GSOCK_OUTPUT_FLAG;
return -1; return -1;
} }
return ret; return ret;
} }
@@ -934,7 +933,7 @@ GSocketEventFlags GSocket_Select(GSocket *socket, GSocketEventFlags flags)
wxMacProcessNotifierEvents() ; wxMacProcessNotifierEvents() ;
/* /*
state = OTGetEndpointState(socket->m_endpoint); state = OTGetEndpointState(socket->m_endpoint);
if ( ( flags & GSOCK_INPUT_FLAG ) && ! ( socket->m_detected & GSOCK_INPUT_FLAG ) ) if ( ( flags & GSOCK_INPUT_FLAG ) && ! ( socket->m_detected & GSOCK_INPUT_FLAG ) )
{ {
size_t sz = 0 ; size_t sz = 0 ;
@@ -1002,7 +1001,7 @@ GSocketError GSocket_GetError(GSocket *socket)
* operation, there is still data available, the callback function will * operation, there is still data available, the callback function will
* be called again. * be called again.
* GSOCK_OUTPUT: * 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 * 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, * first established, and then only if a call failed with GSOCK_WOULDBLOCK,
* when the output buffer empties again. This means that the app should * when the output buffer empties again. This means that the app should
@@ -1290,7 +1289,7 @@ GSocketError _GAddress_Init_INET(GAddress *address)
{ {
address->m_family = GSOCK_INET; address->m_family = GSOCK_INET;
address->m_host = kOTAnyInetAddress ; address->m_host = kOTAnyInetAddress ;
return GSOCK_NOERROR; return GSOCK_NOERROR;
} }
@@ -1311,7 +1310,7 @@ GSocketError GAddress_INET_SetHostName(GAddress *address, const char *hostname)
address->m_host = INADDR_NONE ; address->m_host = INADDR_NONE ;
address->m_error = GSOCK_NOHOST; address->m_error = GSOCK_NOHOST;
return GSOCK_NOHOST; return GSOCK_NOHOST;
} }
address->m_host = hinfo.addrs[0] ; address->m_host = hinfo.addrs[0] ;
return GSOCK_NOERROR; return GSOCK_NOERROR;
} }
@@ -1333,17 +1332,17 @@ GSocketError GAddress_INET_SetHostAddress(GAddress *address,
return GSOCK_NOERROR; return GSOCK_NOERROR;
} }
struct service_entry struct service_entry
{ {
char * name ; char * name ;
unsigned short port ; unsigned short port ;
char * protocol ; char * protocol ;
} ; } ;
typedef struct service_entry service_entry ; typedef struct service_entry service_entry ;
service_entry gServices[] = 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,
@@ -1386,17 +1385,17 @@ GSocketError GAddress_INET_SetPort(GAddress *address, unsigned short port)
assert(address != NULL); assert(address != NULL);
CHECK_ADDRESS(address, INET, GSOCK_INVADDR); CHECK_ADDRESS(address, INET, GSOCK_INVADDR);
address->m_port = port ; address->m_port = port ;
return GSOCK_NOERROR; return GSOCK_NOERROR;
} }
GSocketError GAddress_INET_GetHostName(GAddress *address, char *hostname, size_t sbuf) GSocketError GAddress_INET_GetHostName(GAddress *address, char *hostname, size_t sbuf)
{ {
InetDomainName name ; InetDomainName name ;
if ( GSocket_Verify_Inited() == FALSE ) if ( GSocket_Verify_Inited() == FALSE )
return GSOCK_IOERR ; return GSOCK_IOERR ;
assert(address != NULL); assert(address != NULL);
CHECK_ADDRESS(address, INET, GSOCK_INVADDR); CHECK_ADDRESS(address, INET, GSOCK_INVADDR);
OTInetAddressToName( gInetSvcRef , address->m_host , name ) ; OTInetAddressToName( gInetSvcRef , address->m_host , name ) ;
@@ -1406,16 +1405,16 @@ GSocketError GAddress_INET_GetHostName(GAddress *address, char *hostname, size_t
unsigned long GAddress_INET_GetHostAddress(GAddress *address) unsigned long GAddress_INET_GetHostAddress(GAddress *address)
{ {
assert(address != NULL); assert(address != NULL);
CHECK_ADDRESS(address, INET, 0); CHECK_ADDRESS(address, INET, 0);
return address->m_host; return address->m_host;
} }
unsigned short GAddress_INET_GetPort(GAddress *address) unsigned short GAddress_INET_GetPort(GAddress *address)
{ {
assert(address != NULL); assert(address != NULL);
CHECK_ADDRESS(address, INET, 0); CHECK_ADDRESS(address, INET, 0);
return address->m_port; return address->m_port;
} }
@@ -1424,12 +1423,12 @@ void _GSocket_Enable_Events(GSocket *socket)
{ {
if ( socket->m_takesEvents ) if ( socket->m_takesEvents )
return ; return ;
{ {
OTResult state ; OTResult state ;
socket->m_takesEvents = TRUE ; socket->m_takesEvents = TRUE ;
state = OTGetEndpointState(socket->m_endpoint); state = OTGetEndpointState(socket->m_endpoint);
{ {
OTByteCount sz = 0 ; OTByteCount sz = 0 ;
OTCountDataBytes( socket->m_endpoint , &sz ) ; OTCountDataBytes( socket->m_endpoint , &sz ) ;
@@ -1467,20 +1466,20 @@ GSocketError _GSocket_Input_Timeout(GSocket *socket)
Microseconds(&start); Microseconds(&start);
now = start ; now = start ;
socket->m_takesEvents = FALSE ; socket->m_takesEvents = FALSE ;
while( (now.hi * 4294967296.0 + now.lo) - (start.hi * 4294967296.0 + start.lo) < socket->m_timeout * 1000.0 ) while( (now.hi * 4294967296.0 + now.lo) - (start.hi * 4294967296.0 + start.lo) < socket->m_timeout * 1000.0 )
{ {
OTResult state ; OTResult state ;
OTByteCount sz = 0 ; OTByteCount sz = 0 ;
state = OTGetEndpointState(socket->m_endpoint); state = OTGetEndpointState(socket->m_endpoint);
OTCountDataBytes( socket->m_endpoint , &sz ) ; OTCountDataBytes( socket->m_endpoint , &sz ) ;
if ( state == T_INCON || sz > 0 ) if ( state == T_INCON || sz > 0 )
{ {
socket->m_takesEvents = formerTakesEvents ; socket->m_takesEvents = formerTakesEvents ;
return GSOCK_NOERROR; return GSOCK_NOERROR;
} }
Microseconds(&now); Microseconds(&now);
} }
socket->m_takesEvents = formerTakesEvents ; socket->m_takesEvents = formerTakesEvents ;
socket->m_error = GSOCK_TIMEDOUT; socket->m_error = GSOCK_TIMEDOUT;
@@ -1502,18 +1501,18 @@ GSocketError _GSocket_Output_Timeout(GSocket *socket)
Microseconds(&start); Microseconds(&start);
now = start ; now = start ;
socket->m_takesEvents = FALSE ; socket->m_takesEvents = FALSE ;
while( (now.hi * 4294967296.0 + now.lo) - (start.hi * 4294967296.0 + start.lo) < socket->m_timeout * 1000.0 ) while( (now.hi * 4294967296.0 + now.lo) - (start.hi * 4294967296.0 + start.lo) < socket->m_timeout * 1000.0 )
{ {
OTResult state ; OTResult state ;
state = OTGetEndpointState(socket->m_endpoint); state = OTGetEndpointState(socket->m_endpoint);
if ( state == T_DATAXFER || state == T_INREL ) if ( state == T_DATAXFER || state == T_INREL )
{ {
socket->m_takesEvents = formerTakesEvents ; socket->m_takesEvents = formerTakesEvents ;
return GSOCK_NOERROR; return GSOCK_NOERROR;
} }
Microseconds(&now); Microseconds(&now);
} }
socket->m_takesEvents = formerTakesEvents ; socket->m_takesEvents = formerTakesEvents ;
socket->m_error = GSOCK_TIMEDOUT; socket->m_error = GSOCK_TIMEDOUT;
@@ -1527,7 +1526,7 @@ GSocketError _GSocket_Output_Timeout(GSocket *socket)
* operation, there is still data available, the callback function will * operation, there is still data available, the callback function will
* be called again. * be called again.
* GSOCK_OUTPUT: * 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 * 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, * first established, and then only if a call failed with GSOCK_WOULDBLOCK,
* when the output buffer empties again. This means that the app should * when the output buffer empties again. This means that the app should

View File

@@ -1,5 +1,5 @@
///////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////
// Name: joystick.cpp // Name: src/mac/classic/joystick.cpp
// Purpose: wxJoystick class // Purpose: wxJoystick class
// Author: Stefan Csomor // Author: Stefan Csomor
// Modified by: // Modified by:
@@ -9,12 +9,12 @@
// Licence: wxWindows licence // Licence: wxWindows licence
///////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////
#include "wx/setup.h" #include "wx/wxprec.h"
#include "wx/joystick.h"
#if wxUSE_JOYSTICK #if wxUSE_JOYSTICK
#include "wx/joystick.h"
IMPLEMENT_DYNAMIC_CLASS(wxJoystick, wxObject) IMPLEMENT_DYNAMIC_CLASS(wxJoystick, wxObject)
// Attributes // Attributes
@@ -85,7 +85,7 @@ void wxJoystick::SetMovementThreshold(int threshold)
bool wxJoystick::IsOk() const bool wxJoystick::IsOk() const
{ {
// TODO // TODO
return FALSE; return false;
} }
int wxJoystick::GetNumberJoysticks() int wxJoystick::GetNumberJoysticks()
@@ -109,7 +109,7 @@ int wxJoystick::GetProductId() const
wxString wxJoystick::GetProductName() const wxString wxJoystick::GetProductName() const
{ {
// TODO // TODO
return wxString(wxT("")); return wxEmptyString;
} }
int wxJoystick::GetXMin() const int wxJoystick::GetXMin() const
@@ -223,43 +223,43 @@ int wxJoystick::GetVMax() const
bool wxJoystick::HasRudder() const bool wxJoystick::HasRudder() const
{ {
// TODO // TODO
return FALSE; return false;
} }
bool wxJoystick::HasZ() const bool wxJoystick::HasZ() const
{ {
// TODO // TODO
return FALSE; return false;
} }
bool wxJoystick::HasU() const bool wxJoystick::HasU() const
{ {
// TODO // TODO
return FALSE; return false;
} }
bool wxJoystick::HasV() const bool wxJoystick::HasV() const
{ {
// TODO // TODO
return FALSE; return false;
} }
bool wxJoystick::HasPOV() const bool wxJoystick::HasPOV() const
{ {
// TODO // TODO
return FALSE; return false;
} }
bool wxJoystick::HasPOV4Dir() const bool wxJoystick::HasPOV4Dir() const
{ {
// TODO // TODO
return FALSE; return false;
} }
bool wxJoystick::HasPOVCTS() const bool wxJoystick::HasPOVCTS() const
{ {
// TODO // TODO
return FALSE; return false;
} }
// Operations // Operations
@@ -268,15 +268,14 @@ bool wxJoystick::HasPOVCTS() const
bool wxJoystick::SetCapture(wxWindow* win, int pollingFreq) bool wxJoystick::SetCapture(wxWindow* win, int pollingFreq)
{ {
// TODO // TODO
return FALSE; return false;
} }
bool wxJoystick::ReleaseCapture() bool wxJoystick::ReleaseCapture()
{ {
// TODO // TODO
return FALSE; return false;
} }
#endif #endif
// wxUSE_JOYSTICK // wxUSE_JOYSTICK

View File

@@ -1,5 +1,5 @@
///////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////
// Name: metafile.cpp // Name: src/mac/classic/metafile.cpp
// Purpose: wxMetaFile, wxMetaFileDC etc. These classes are optional. // Purpose: wxMetaFile, wxMetaFileDC etc. These classes are optional.
// Author: Stefan Csomor // Author: Stefan Csomor
// Modified by: // Modified by:
@@ -16,10 +16,6 @@
#pragma hdrstop #pragma hdrstop
#endif #endif
#ifndef WX_PRECOMP
#include "wx/setup.h"
#endif
#if wxUSE_METAFILE #if wxUSE_METAFILE
#ifndef WX_PRECOMP #ifndef WX_PRECOMP
@@ -68,7 +64,7 @@ wxMetaFile::wxMetaFile(const wxString& file)
M_METAFILEDATA->m_metafile = 0; M_METAFILEDATA->m_metafile = 0;
wxASSERT_MSG( file.IsEmpty() , wxT("no file based metafile support yet") ) ; wxASSERT_MSG( file.IsEmpty() , wxT("no file based metafile support yet") ) ;
/* /*
if (!file.IsNull() && (file.Cmp("") == 0)) if (!file.empty())
M_METAFILEDATA->m_metafile = (WXHANDLE) GetMetaFile(file); M_METAFILEDATA->m_metafile = (WXHANDLE) GetMetaFile(file);
*/ */
} }
@@ -82,8 +78,8 @@ bool wxMetaFile::SetClipboard(int width, int height)
#if wxUSE_DRAG_AND_DROP #if wxUSE_DRAG_AND_DROP
//TODO finishi this port , we need the data obj first //TODO finishi this port , we need the data obj first
if (!m_refData) if (!m_refData)
return FALSE; return false;
bool alreadyOpen=wxTheClipboard->IsOpened() ; bool alreadyOpen=wxTheClipboard->IsOpened() ;
if (!alreadyOpen) if (!alreadyOpen)
{ {
@@ -93,11 +89,11 @@ bool wxMetaFile::SetClipboard(int width, int height)
wxDataObject *data = wxDataObject *data =
new wxMetafileDataObject( *this) ; new wxMetafileDataObject( *this) ;
bool success = wxTheClipboard->SetData(data); bool success = wxTheClipboard->SetData(data);
if (!alreadyOpen) if (!alreadyOpen)
wxTheClipboard->Close(); wxTheClipboard->Close();
return (bool) success; return (bool) success;
#endif #endif
return TRUE ; return true ;
} }
void wxMetafile::SetHMETAFILE(WXHMETAFILE mf) void wxMetafile::SetHMETAFILE(WXHMETAFILE mf)
@@ -113,17 +109,17 @@ void wxMetafile::SetHMETAFILE(WXHMETAFILE mf)
bool wxMetaFile::Play(wxDC *dc) bool wxMetaFile::Play(wxDC *dc)
{ {
if (!m_refData) if (!m_refData)
return FALSE; return false;
if (!dc->Ok() ) if (!dc->Ok() )
return FALSE; return false;
{ {
wxMacPortSetter helper( dc ) ; wxMacPortSetter helper( dc ) ;
PicHandle pict = (PicHandle) GetHMETAFILE() ; PicHandle pict = (PicHandle) GetHMETAFILE() ;
DrawPicture( pict , &(**pict).picFrame ) ; DrawPicture( pict , &(**pict).picFrame ) ;
} }
return TRUE; return true;
} }
wxSize wxMetaFile::GetSize() const wxSize wxMetaFile::GetSize() const
@@ -149,23 +145,23 @@ wxSize wxMetaFile::GetSize() const
// give origin/extent arguments to wxMakeMetaFilePlaceable. // give origin/extent arguments to wxMakeMetaFilePlaceable.
wxMetaFileDC::wxMetaFileDC(const wxString& filename , wxMetaFileDC::wxMetaFileDC(const wxString& filename ,
int width , int height , int width , int height ,
const wxString& WXUNUSED(description) ) 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) ; m_metaFile = new wxMetaFile(filename) ;
Rect r={0,0,height,width} ; Rect r={0,0,height,width} ;
RectRgn( (RgnHandle) m_macBoundaryClipRgn , &r ) ; RectRgn( (RgnHandle) m_macBoundaryClipRgn , &r ) ;
CopyRgn( (RgnHandle) m_macBoundaryClipRgn , (RgnHandle) m_macCurrentClipRgn ) ; CopyRgn( (RgnHandle) m_macBoundaryClipRgn , (RgnHandle) m_macCurrentClipRgn ) ;
m_metaFile->SetHMETAFILE( OpenPicture( &r ) ) ; m_metaFile->SetHMETAFILE( OpenPicture( &r ) ) ;
::GetPort( (GrafPtr*) &m_macPort ) ; ::GetPort( (GrafPtr*) &m_macPort ) ;
m_ok = TRUE ; m_ok = true ;
SetMapMode(wxMM_TEXT); SetMapMode(wxMM_TEXT);
} }
wxMetaFileDC::~wxMetaFileDC() wxMetaFileDC::~wxMetaFileDC()

View File

@@ -9,7 +9,8 @@
// Licence: wxWindows licence // Licence: wxWindows licence
///////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////
#include "wx/setup.h" #include "wx/wxprec.h"
#include "wx/utils.h" #include "wx/utils.h"
#include "wx/pen.h" #include "wx/pen.h"

View File

@@ -1,5 +1,5 @@
///////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////
// Name: utils.cpp // Name: src/mac/classic/utils.cpp
// Purpose: Various utilities // Purpose: Various utilities
// Author: Stefan Csomor // Author: Stefan Csomor
// Modified by: // Modified by:
@@ -9,7 +9,8 @@
// Licence: wxWindows licence // Licence: wxWindows licence
///////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////
#include "wx/setup.h" #include "wx/wxprec.h"
#include "wx/utils.h" #include "wx/utils.h"
#include "wx/app.h" #include "wx/app.h"
#include "wx/apptrait.h" #include "wx/apptrait.h"
@@ -1399,4 +1400,3 @@ extern bool WXDLLEXPORT wxIsDebuggerRunning()
#endif // defined(__WXMAC__) && !defined(__DARWIN__) && (__MWERKS__ >= 0x2400) #endif // defined(__WXMAC__) && !defined(__DARWIN__) && (__MWERKS__ >= 0x2400)
#endif // wxUSE_GUI #endif // wxUSE_GUI

View File

@@ -9,7 +9,8 @@
// Licence: wxWindows licence // Licence: wxWindows licence
///////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////
#include "wx/setup.h" #include "wx/wxprec.h"
#include "wx/menu.h" #include "wx/menu.h"
#include "wx/window.h" #include "wx/window.h"
#include "wx/dc.h" #include "wx/dc.h"

View File

@@ -1,12 +1,12 @@
/* ------------------------------------------------------------------------- /* -------------------------------------------------------------------------
* Project: GSocket (Generic Socket) for WX * Project: GSocket (Generic Socket) for WX
* Name: gsockosx.c * Name: src/mac/corefoundation/gsockosx.c
* Purpose: GSocket: Mac OS X mach-o part * Purpose: GSocket: Mac OS X mach-o part
* CVSID: $Id$ * CVSID: $Id$
* Mac code by Brian Victor, February 2002. Email comments to bhv1@psu.edu * Mac code by Brian Victor, February 2002. Email comments to bhv1@psu.edu
* ------------------------------------------------------------------------- */ * ------------------------------------------------------------------------- */
#include "wx/setup.h" #include "wx/wxprec.h"
#if wxUSE_SOCKETS #if wxUSE_SOCKETS
@@ -75,7 +75,7 @@ struct MacGSocketData* _GSocket_Get_Mac_Socket(GSocket *socket)
cont.info = socket; cont.info = socket;
CFSocketRef cf = CFSocketCreateWithNative(NULL, socket->m_fd, 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); CFRunLoopSourceRef source = CFSocketCreateRunLoopSource(NULL, cf, 0);
assert(source); assert(source);
socket->m_gui_dependent = (char*)data; socket->m_gui_dependent = (char*)data;