// Keep linker from discarding wxStockGDIMac
wxFORCE_LINK_MODULE(gdiobj)
-#if wxUSE_THREADS
-extern size_t g_numberOfThreads;
-#endif
-
// statics for implementation
static bool s_inYield = false;
static bool s_inReceiveEvent = false ;
// platform specific static variables
-const short kMacMinHeap = (29 * 1024) ;
-const short kwxMacMenuBarResource = 1 ;
-const short kwxMacAppleMenuId = 1 ;
+static const short kwxMacAppleMenuId = 1 ;
wxWindow* wxApp::s_captureWindow = NULL ;
long wxApp::s_lastModifiers = 0 ;
static const wxCoord MARGIN = 2;
static const int TEXTFOCUSBORDER = 0 ;
#endif
-static const int POPUPHEIGHT = 23;
// ----------------------------------------------------------------------------
wxCommandEvent event( wxEVT_COMMAND_BUTTON_CLICKED, def->GetId() );
event.SetEventObject(def);
def->Command(event);
- }
+ }
}
return;
long m_themeCursor;
};
-#define M_CURSORDATA ((wxCursorRefData *)m_refData)
-#define M_CURSORHANDLERDATA ((wxCursorRefData *)bitmap->m_refData)
+#define M_CURSORDATA wx_static_cast(wxCursorRefData*, m_refData)
const short kwxCursorBullseye = 0;
const short kwxCursorBlank = 1;
const short kEmulatedMode = -1 ;
const short kUnsupportedMode = -2 ;
-extern TECObjectRef s_TECNativeCToUnicode ;
-
-
wxMacPortSetter::wxMacPortSetter( const wxDC* dc ) :
m_ph( (GrafPtr) dc->m_macPort )
{
SetThemeDrawingState( m_themeDrawingState , true ) ;
}
-//-----------------------------------------------------------------------------
-// Local functions
-//-----------------------------------------------------------------------------
-static inline double dmin(double a, double b) { return a < b ? a : b; }
-static inline double dmax(double a, double b) { return a > b ? a : b; }
-static inline double DegToRad(double deg) { return (deg * M_PI) / 180.0; }
-
//-----------------------------------------------------------------------------
// wxDC
//-----------------------------------------------------------------------------
// constants
//-----------------------------------------------------------------------------
-#define RAD2DEG 57.2957795131
-
//-----------------------------------------------------------------------------
// wxPaintDC
//-----------------------------------------------------------------------------
WindowRef windowref = (WindowRef) rootwindow->MacGetWindowRef() ;
int x , y ;
x = y = 0 ;
- wxSize size = window->GetSize() ;
window->MacWindowToRootWindow( &x , &y ) ;
m_macPort = UMAGetWindowPort( windowref ) ;
m_ok = true ;
/////////////////////////////////////////////////////////////////////////////
-// Name: msw/dir.cpp
+// Name: mac/dirmac.cpp
// Purpose: wxDir implementation for Mac
// Author: Stefan Csomor
// Modified by:
#pragma hdrstop
#endif
+#include "wx/dir.h"
+
#ifndef WX_PRECOMP
#include "wx/intl.h"
#include "wx/log.h"
#endif // PCH
-#include "wx/dir.h"
#include "wx/filefn.h" // for wxDirExists()
-
-#ifndef __DARWIN__
- #include <windows.h>
-#endif
-
#include "wx/filename.h"
#include "wx/mac/private.h"
-#include "MoreFilesX.h"
-
-// ----------------------------------------------------------------------------
-// constants
-// ----------------------------------------------------------------------------
-
-#ifndef MAX_PATH
- #define MAX_PATH 260 // from VC++ headers
-#endif
-
-// ----------------------------------------------------------------------------
-// macros
-// ----------------------------------------------------------------------------
-
-#define M_DIR ((wxDirData *)m_data)
-
// ----------------------------------------------------------------------------
// private classes
// ----------------------------------------------------------------------------
bool wxDir::Open(const wxString& dirname)
{
- delete M_DIR;
+ delete m_data;
m_data = new wxDirData(dirname);
return true;
wxString name;
if ( m_data )
{
- name = M_DIR->GetName();
+ name = m_data->GetName();
if ( !name.empty() && (name.Last() == _T('/')) )
{
// chop off the last (back)slash
wxDir::~wxDir()
{
- if (M_DIR != NULL) {
- delete M_DIR;
- m_data = NULL;
- }
+ delete m_data;
+ m_data = NULL;
}
// ----------------------------------------------------------------------------
{
wxCHECK_MSG( IsOpened(), false, _T("must wxDir::Open() first") );
- M_DIR->Rewind();
+ m_data->Rewind();
- M_DIR->SetFileSpec(filespec);
- M_DIR->SetFlags(flags);
+ m_data->SetFileSpec(filespec);
+ m_data->SetFlags(flags);
return GetNext(filename);
}
wxCHECK_MSG( filename, false, _T("bad pointer in wxDir::GetNext()") );
- return M_DIR->Read(filename);
+ return m_data->Read(filename);
}
#ifndef WX_PRECOMP
#include "wx/app.h"
- #include "wx/window.h"
#include "wx/toplevel.h"
#include "wx/gdicmn.h"
#endif // WX_PRECOMP
wxWindow *m_currentTargetWindow;
wxDropTarget *m_currentTarget;
wxDropSource *m_currentSource;
-}
-MacTrackingGlobals;
+} MacTrackingGlobals;
MacTrackingGlobals gTrackingGlobals;
if ( !supported )
{
UInt16 items;
- OSErr result;
ItemReference theItem;
FlavorType theType;
UInt16 flavors = 0;
for ( UInt16 flavor = 1; flavor <= flavors; ++flavor )
{
- result = GetFlavorType( (DragReference)m_currentDrag, theItem, flavor, &theType );
+ GetFlavorType( (DragReference)m_currentDrag, theItem, flavor, &theType );
if ( m_dataObject->IsSupportedFormat( wxDataFormat( theType ) ) )
{
supported = true;
if ((m_data == NULL) || (m_data->GetFormatCount() == 0))
return (wxDragResult)wxDragNone;
- OSStatus result;
DragReference theDrag;
RgnHandle dragRegion;
- if ((result = NewDrag( &theDrag )) != noErr)
+ if (NewDrag( &theDrag ) != noErr)
return wxDragNone;
// add data to drag
// only when drag was successfully completed
gTrackingGlobals.m_currentSource = this;
- result = TrackDrag( theDrag, ev, dragRegion );
+ TrackDrag( theDrag, ev, dragRegion );
DisposeRgn( dragRegion );
DisposeDrag( theDrag );
gTrackingGlobals.m_currentSource = NULL;
#include "PLStringFuncs.h"
#endif
-#include "MoreFilesX.h"
-
IMPLEMENT_CLASS(wxFileDialog, wxFileDialogBase)
-extern bool gUseNavServices;
-
// the data we need to pass to our standard file hook routine
// includes a pointer to the dialog, a pointer to the standard
// file reply record (so we can inspect the current selection)
NavDialogRef dialog;
NavObjectFilterUPP navFilterUPP = NULL;
- CFArrayRef cfArray = NULL; // for popupExtension
OpenUserDataRec myData;
myData.defaultLocation = m_dir;
// clean up filter related data, etc.
if (navFilterUPP)
::DisposeNavObjectFilterUPP(navFilterUPP);
- if (cfArray)
- ::CFRelease(cfArray);
if (err != noErr)
return wxID_CANCEL;
static const wxChar *TRACE_MDI = _T("mdi");
-static const int IDM_WINDOWTILE = 4001;
static const int IDM_WINDOWTILEHOR = 4001;
static const int IDM_WINDOWCASCADE = 4002;
static const int IDM_WINDOWICONS = 4003;
static const int IDM_WINDOWNEXT = 4004;
static const int IDM_WINDOWTILEVERT = 4005;
-static const int IDM_WINDOWPREV = 4006;
-
-// This range gives a maximum of 500 MDI children. Should be enough :-)
-static const int wxFIRST_MDI_CHILD = 4100;
-static const int wxLAST_MDI_CHILD = 4600;
-
-// Status border dimensions
-static const int wxTHICK_LINE_BORDER = 3;
// ----------------------------------------------------------------------------
// Parent frame
#include "wx/log.h"
#include "wx/app.h"
#include "wx/utils.h"
- #include "wx/window.h"
#include "wx/frame.h"
#include "wx/menuitem.h"
#endif
// the (popup) menu title has this special id
static const int idMenuTitle = -3;
-const short kwxMacMenuBarResource = 1 ;
-const short kwxMacAppleMenuId = 1 ;
+static const short kwxMacAppleMenuId = 1 ;
// Find an item given the Macintosh Menu Reference
if ( isSubMenu )
::DeleteMenu(MacGetMenuId());
- wxMenuItem* previousItem = NULL ;
wxMenuItemList::compatibility_iterator node;
wxMenuItem *item;
- int pos ;
- for (pos = 0, node = GetMenuItems().GetFirst(); node; node = node->GetNext(), pos++)
+ for (node = GetMenuItems().GetFirst(); node; node = node->GetNext())
{
item = (wxMenuItem *)node->GetData();
wxMenu* subMenu = item->GetSubMenu() ;
{
// no need to undo hidings
}
-
- previousItem = item ;
}
}
{
wxMenuItemList::compatibility_iterator node;
wxMenuItem *item;
- int pos ;
wxMenu* menu = menuIter->GetData() , *subMenu = NULL ;
if ( m_titles[i] == wxT("?") || m_titles[i] == wxT("&?") || m_titles[i] == wxApp::s_macHelpMenuTitleName )
{
- for (pos = 0 , node = menu->GetMenuItems().GetFirst(); node; node = node->GetNext(), pos++)
+ for (node = menu->GetMenuItems().GetFirst(); node; node = node->GetNext())
{
item = (wxMenuItem *)node->GetData();
subMenu = item->GetSubMenu() ;
#endif
};
-
-extern bool wxClipboardIsOpen;
-
-
wxMetafileRefData::wxMetafileRefData()
{
m_metafile = NULL;
// ----------------------------------------------------------------------------
#define wxCFDATA_RELEASEBUFFER 1
-#define wxCFDATA_RETAINBUFFER 0
class wxCFData
{
//
void wxRadioBox::SetFocus()
{
- int i;
wxRadioButton *current;
- i = 0;
current = m_radioButtonCycle;
while (!current->GetValue())
{
- i++;
current = current->NextInCycle();
}
wxRadioButton *wxRadioButton::AddInCycle(wxRadioButton *cycle)
{
- wxRadioButton *next, *current;
+ wxRadioButton *current;
if (cycle == NULL)
{
else
{
current = cycle;
- while ((next = current->m_cycle) != cycle)
+ while (current->m_cycle != cycle)
current = current->m_cycle;
m_cycle = cycle;
END_EVENT_TABLE()
// The dimensions of the different styles of sliders (from Aqua document)
-#define wxSLIDER_DIMENSIONACROSS 15
#define wxSLIDER_DIMENSIONACROSS_WITHTICKMARKS 24
#define wxSLIDER_DIMENSIONACROSS_ARROW 18
void wxSlider::DoSetSize(int x, int y, int w, int h, int sizeFlags)
{
- int xborder, yborder;
+ int yborder = 0;
int minValWidth, maxValWidth, textheight;
int sliderBreadth;
int width = w;
- xborder = yborder = 0;
-
if (GetWindowStyle() & wxSL_LABELS)
{
wxString text;
#include "wx/mac/uma.h"
-
-// if this is set to 1 then under OSX 10.2 the 'classic' MLTE implementation will be used
-// if set to 0 then the unicode textctrl will be used
-#ifndef wxMAC_AWAYS_USE_MLTE
-#define wxMAC_AWAYS_USE_MLTE 1
-#endif
-
#ifndef __WXMAC_OSX__
enum
{
#include "wx/mac/uma.h"
// Button
-static const int kMacOSXHorizontalBorder = 2 ;
-static const int kMacOSXVerticalBorder = 4 ;
-
// ----------------------------------------------------------------------------
// macros
// ----------------------------------------------------------------------------
m_x = position.x;
m_y = position.y;
- int x, y;
- x = y = 0;
int mac_x = position.x;
int mac_y = position.y;
return result ;
}
+#if wxMAC_USE_NATIVE_TOOLBAR
static const EventTypeSpec kToolbarEvents[] =
{
{ kEventClassToolbar, kEventToolbarGetDefaultIdentifiers },
}
return result ;
}
+#endif // wxMAC_USE_NATIVE_TOOLBAR
// also for the toolbar we have the dual implementation:
// only when MacInstallNativeToolbar is called is the native toolbar set as the window toolbar
bool lastIsRadio = false;
bool curIsRadio = false;
- bool setChoiceInGroup = false;
#if wxMAC_USE_NATIVE_TOOLBAR
CFIndex currentPosition = 0;
{
if ( tool->IsToggled() )
DoToggleTool( tool, true );
-
- setChoiceInGroup = false;
}
else
{
if ( tool->Toggle( true ) )
{
DoToggleTool( tool, true );
- setChoiceInGroup = true;
}
}
else if ( tool->IsToggled() )
// Carbon Events
// ---------------------------------------------------------------------------
-extern long wxMacTranslateKey(unsigned char key, unsigned char code) ;
-
static const EventTypeSpec eventList[] =
{
// TODO: remove control related event like key and mouse (except for WindowLeave events)
wxPoint m_position ;
wxSize m_size ;
bool m_wasResizable ;
-}
-FullScreenData ;
+} FullScreenData ;
void wxTopLevelWindowMac::Init()
{
EventRef currentEvent = (EventRef) wxTheApp->MacGetCurrentEvent() ;
UInt32 currentEventClass = 0 ;
- UInt32 currentEventKind = 0 ;
if ( currentEvent != NULL )
{
currentEventClass = ::GetEventClass( currentEvent ) ;
- currentEventKind = ::GetEventKind( currentEvent ) ;
+ ::GetEventKind( currentEvent ) ;
}
if ( currentEventClass != kEventClassMenu )
{
// when tracking a menu, strange redraw errors occur if we flush now, so leave..
EventRef theEvent;
- OSStatus status = noErr ;
- status = ReceiveNextEvent( 0 , NULL , kEventDurationNoWait , false , &theEvent ) ;
+ ReceiveNextEvent( 0 , NULL , kEventDurationNoWait , false , &theEvent ) ;
}
}
}
static bool sUMAHasInittedAppearance = false;
-extern int gAGABackgroundColor ;
-
bool UMAHasAppearance() { return sUMAHasAppearance ; }
long UMAGetAppearanceVersion() { return sUMAAppearanceVersion ; }
long UMAGetSystemVersion() { return sUMASystemVersion ; }