]> git.saurik.com Git - wxWidgets.git/commitdiff
remove unused stuff
authorPaul Cornett <paulcor@bullseye.com>
Mon, 9 Oct 2006 05:14:39 +0000 (05:14 +0000)
committerPaul Cornett <paulcor@bullseye.com>
Mon, 9 Oct 2006 05:14:39 +0000 (05:14 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@41781 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

20 files changed:
src/mac/carbon/app.cpp
src/mac/carbon/combobox.cpp
src/mac/carbon/cursor.cpp
src/mac/carbon/dc.cpp
src/mac/carbon/dcclient.cpp
src/mac/carbon/dirmac.cpp
src/mac/carbon/dnd.cpp
src/mac/carbon/filedlg.cpp
src/mac/carbon/mdi.cpp
src/mac/carbon/menu.cpp
src/mac/carbon/metafile.cpp
src/mac/carbon/mimetmac.cpp
src/mac/carbon/radiobox.cpp
src/mac/carbon/radiobut.cpp
src/mac/carbon/slider.cpp
src/mac/carbon/textctrl.cpp
src/mac/carbon/tglbtn.cpp
src/mac/carbon/toolbar.cpp
src/mac/carbon/toplevel.cpp
src/mac/carbon/uma.cpp

index abbe50cc3544ac68ee5b56e615761e0b3446f98f..e4a20d93757fff44a164f9c0231f713da7051ab4 100644 (file)
 // 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 ;
@@ -90,9 +86,7 @@ END_EVENT_TABLE()
 
 
 // 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 ;
index 0f0fbdc08a360d22abb0e65c8d334fc0b2c4d17a..f2c79697b6218e8d40c8026f63c4d1f4c0eee571 100644 (file)
@@ -59,7 +59,6 @@ static const int    TEXTFOCUSBORDER = 3 ;
 static const wxCoord MARGIN = 2;
 static const int    TEXTFOCUSBORDER = 0 ;
 #endif
-static const int    POPUPHEIGHT = 23;
 
 
 // ----------------------------------------------------------------------------
@@ -119,7 +118,7 @@ protected:
                         wxCommandEvent event( wxEVT_COMMAND_BUTTON_CLICKED, def->GetId() );
                         event.SetEventObject(def);
                         def->Command(event);
-                   }
+                    }
                 }
 
                 return;
index 9176de3dc88b18f8f3eeeaa48634eaba8c862c2f..df2b686b22a6a61ffdbda4358c809c20f82b3ba8 100644 (file)
@@ -46,8 +46,7 @@ protected:
     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;
index 4b75c0fdbfae9865a62c3aeb96d544a45ffc84a1..9bc9f204b513a444a17dd5d028ce86cd1e04b7fc 100644 (file)
@@ -55,9 +55,6 @@ const double RAD2DEG  = 180.0 / M_PI;
 const short kEmulatedMode = -1 ;
 const short kUnsupportedMode = -2 ;
 
-extern TECObjectRef s_TECNativeCToUnicode ;
-
-
 wxMacPortSetter::wxMacPortSetter( const wxDC* dc ) :
     m_ph( (GrafPtr) dc->m_macPort )
 {
@@ -154,13 +151,6 @@ wxMacWindowStateSaver::~wxMacWindowStateSaver()
     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
 //-----------------------------------------------------------------------------
index 0e0b775e920e6581fb1ee20d4c66dac84013765e..fc005335a256d9e98211aacf5d253c3dc1bd52a7 100644 (file)
@@ -29,8 +29,6 @@
 // constants
 //-----------------------------------------------------------------------------
 
-#define RAD2DEG 57.2957795131
-
 //-----------------------------------------------------------------------------
 // wxPaintDC
 //-----------------------------------------------------------------------------
@@ -124,7 +122,6 @@ wxWindowDC::wxWindowDC(wxWindow *window)
     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 ;
index 8669577a49a317bdf3fd9dce9ef4aceae14bf140..3dd53627a6b45a935c9c99cd8c1cf2030f843fa5 100644 (file)
@@ -1,5 +1,5 @@
 /////////////////////////////////////////////////////////////////////////////
-// 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
 // ----------------------------------------------------------------------------
@@ -226,7 +206,7 @@ wxDir::wxDir(const wxString& dirname)
 
 bool wxDir::Open(const wxString& dirname)
 {
-    delete M_DIR;
+    delete m_data;
     m_data = new wxDirData(dirname);
 
     return true;
@@ -242,7 +222,7 @@ wxString wxDir::GetName() const
     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
@@ -255,10 +235,8 @@ wxString wxDir::GetName() const
 
 wxDir::~wxDir()
 {
-    if (M_DIR != NULL) {
-        delete M_DIR;
-        m_data = NULL;
-    }
+    delete m_data;
+    m_data = NULL;
 }
 
 // ----------------------------------------------------------------------------
@@ -271,10 +249,10 @@ bool wxDir::GetFirst(wxString *filename,
 {
     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);
 }
@@ -285,5 +263,5 @@ bool wxDir::GetNext(wxString *filename) const
 
     wxCHECK_MSG( filename, false, _T("bad pointer in wxDir::GetNext()") );
 
-    return M_DIR->Read(filename);
+    return m_data->Read(filename);
 }
index 834533d04a4ca38ea013901710d079215d113364..0a42702a8fcca677274f8296b00d2be47e9c3d64 100644 (file)
@@ -17,7 +17,6 @@
 
 #ifndef WX_PRECOMP
     #include "wx/app.h"
-    #include "wx/window.h"
     #include "wx/toplevel.h"
     #include "wx/gdicmn.h"
 #endif // WX_PRECOMP
@@ -38,8 +37,7 @@ typedef struct
     wxWindow *m_currentTargetWindow;
     wxDropTarget *m_currentTarget;
     wxDropSource *m_currentSource;
-}
-MacTrackingGlobals;
+} MacTrackingGlobals;
 
 MacTrackingGlobals gTrackingGlobals;
 
@@ -113,7 +111,6 @@ bool wxDropTarget::CurrentDragHasSupportedFormat()
     if ( !supported )
     {
         UInt16 items;
-        OSErr result;
         ItemReference theItem;
         FlavorType theType;
         UInt16 flavors = 0;
@@ -127,7 +124,7 @@ bool wxDropTarget::CurrentDragHasSupportedFormat()
 
             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;
@@ -338,11 +335,10 @@ wxDragResult wxDropSource::DoDragDrop(int flags)
     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
@@ -454,7 +450,7 @@ wxDragResult wxDropSource::DoDragDrop(int flags)
     // 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;
index 5fffa73c60a067938c8e5df9e9a09c1e75322b9d..9e73bcf2d3510e495b91e066ea01624126342504 100644 (file)
     #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)
@@ -319,7 +315,6 @@ int wxFileDialog::ShowModal()
 
     NavDialogRef dialog;
     NavObjectFilterUPP navFilterUPP = NULL;
-    CFArrayRef cfArray = NULL; // for popupExtension
     OpenUserDataRec myData;
     myData.defaultLocation = m_dir;
 
@@ -386,8 +381,6 @@ int wxFileDialog::ShowModal()
     // clean up filter related data, etc.
     if (navFilterUPP)
         ::DisposeNavObjectFilterUPP(navFilterUPP);
-    if (cfArray)
-        ::CFRelease(cfArray);
 
     if (err != noErr)
         return wxID_CANCEL;
index 871d223cb6727883337e250492ece78477554345..108e0371d82527c6ec219553e3a050299a07951e 100644 (file)
@@ -42,20 +42,11 @@ END_EVENT_TABLE()
 
 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
index 391e97b560e7730b0cb0b5ff478bf2c4e1abfe88..75b60c03bf83afe3592cb642db60c11129926ba5 100644 (file)
@@ -24,7 +24,6 @@
     #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
@@ -41,8 +40,7 @@ IMPLEMENT_DYNAMIC_CLASS(wxMenuBar, wxEvtHandler)
 // 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
@@ -488,12 +486,10 @@ void wxMenu::MacAfterDisplay( bool isSubMenu )
     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() ;
@@ -505,8 +501,6 @@ void wxMenu::MacAfterDisplay( bool isSubMenu )
         {
             // no need to undo hidings
         }
-
-        previousItem = item ;
     }
 }
 
@@ -663,12 +657,11 @@ void wxMenuBar::MacInstallMenuBar()
     {
         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() ;
index 0b15a9e246c4faf42c636b78083180e280e57429..8bb2a118427c8e3d514107a05790f586bfaff476 100644 (file)
@@ -48,10 +48,6 @@ private:
 #endif
 };
 
-
-extern bool wxClipboardIsOpen;
-
-
 wxMetafileRefData::wxMetafileRefData()
 {
     m_metafile = NULL;
index 4ee87964e6955090e3852b880905bdceff64f3e9..aef955dd2d4ee3f1ca0057d33c779a1c2c3a2418 100644 (file)
@@ -1311,7 +1311,6 @@ private:
 // ----------------------------------------------------------------------------
 
 #define wxCFDATA_RELEASEBUFFER  1
-#define wxCFDATA_RETAINBUFFER   0
 
 class wxCFData
 {
index 649aa592a2868c77b9ac7559675cb8015dba0fb7..da6e2588685f4c460fa39c2ef1d001b05555c308 100644 (file)
@@ -321,14 +321,11 @@ void wxRadioBox::Command( wxCommandEvent& event )
 //
 void wxRadioBox::SetFocus()
 {
-    int i;
     wxRadioButton *current;
 
-    i = 0;
     current = m_radioButtonCycle;
     while (!current->GetValue())
     {
-        i++;
         current = current->NextInCycle();
     }
 
index 6ecc2657bc0a9f4b9e7c682adf49354bc06e3b03..5a83609f27cf2c7daafcf33f3ec8647993e1cb2a 100644 (file)
@@ -143,7 +143,7 @@ wxInt32 wxRadioButton::MacControlHit( WXEVENTHANDLERREF WXUNUSED(handler), WXEVE
 
 wxRadioButton *wxRadioButton::AddInCycle(wxRadioButton *cycle)
 {
-    wxRadioButton *next, *current;
+    wxRadioButton *current;
 
     if (cycle == NULL)
     {
@@ -152,7 +152,7 @@ wxRadioButton *wxRadioButton::AddInCycle(wxRadioButton *cycle)
     else
     {
         current = cycle;
-        while ((next = current->m_cycle) != cycle)
+        while (current->m_cycle != cycle)
             current = current->m_cycle;
 
         m_cycle = cycle;
index a46467044f45906f6074149b8201e82ae98ed062..5d3514db5100594b1a0e5da5d304093a7cfbee62 100644 (file)
@@ -22,7 +22,6 @@ BEGIN_EVENT_TABLE(wxSlider, wxControl)
 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
 
@@ -416,13 +415,11 @@ wxSize wxSlider::DoGetBestSize() const
 
 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;
index 30e828c6318982dfa247d7d13454812bc5cbcdc6..ebd4a0dbb3539b7ed2d97bcca4afd509c7147db4 100644 (file)
 
 #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
 {
index 69394fbaa6ed967279c69bbb887952108187cb95..3e974ca9a479dedeebb7707adda5af44f4bcf6fe 100644 (file)
@@ -26,9 +26,6 @@
 #include "wx/mac/uma.h"
 // Button
 
-static const int kMacOSXHorizontalBorder = 2 ;
-static const int kMacOSXVerticalBorder = 4 ;
-
 // ----------------------------------------------------------------------------
 // macros
 // ----------------------------------------------------------------------------
index 94228ad0bfcfb9905e56c3e5f3f9d3dbb7f2d89b..d1f29edb1a191514dc08dbebe5036a2ba30db419 100644 (file)
@@ -392,8 +392,6 @@ void wxToolBarTool::SetPosition( const wxPoint& position )
     m_x = position.x;
     m_y = position.y;
 
-    int x, y;
-    x = y = 0;
     int mac_x = position.x;
     int mac_y = position.y;
 
@@ -714,6 +712,7 @@ CantCreateEvent :
     return result ;
 }
 
+#if wxMAC_USE_NATIVE_TOOLBAR
 static const EventTypeSpec kToolbarEvents[] =
 {
     { kEventClassToolbar, kEventToolbarGetDefaultIdentifiers },
@@ -777,6 +776,7 @@ static OSStatus ToolbarDelegateHandler( EventHandlerCallRef inCallRef, EventRef
     }
     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
@@ -1070,7 +1070,6 @@ bool wxToolBar::Realize()
 
     bool lastIsRadio = false;
     bool curIsRadio = false;
-    bool setChoiceInGroup = false;
 
 #if wxMAC_USE_NATIVE_TOOLBAR
     CFIndex currentPosition = 0;
@@ -1165,8 +1164,6 @@ bool wxToolBar::Realize()
         {
             if ( tool->IsToggled() )
                 DoToggleTool( tool, true );
-
-            setChoiceInGroup = false;
         }
         else
         {
@@ -1175,7 +1172,6 @@ bool wxToolBar::Realize()
                 if ( tool->Toggle( true ) )
                 {
                     DoToggleTool( tool, true );
-                    setChoiceInGroup = true;
                 }
             }
             else if ( tool->IsToggled() )
index d0251e111e04ed62988e3defdebbb4613c12b69a..8d279e9599678a1f460b261158a37846c6a3457e 100644 (file)
@@ -81,8 +81,6 @@ END_EVENT_TABLE()
 // 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)
@@ -884,8 +882,7 @@ typedef struct
     wxPoint m_position ;
     wxSize m_size ;
     bool m_wasResizable ;
-}
-FullScreenData ;
+} FullScreenData ;
 
 void wxTopLevelWindowMac::Init()
 {
@@ -1530,19 +1527,17 @@ void wxTopLevelWindowMac::MacPerformUpdates()
 
         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 ) ;
         }
     }
 }
index e975a2adf730a20e515f3f3100cefb698c562743..7da19bddc940e9b0552a6afd0452ec885ea37b94 100644 (file)
@@ -48,8 +48,6 @@ static bool sUMAHasAquaLayout = false ;
 
 static bool sUMAHasInittedAppearance = false;
 
-extern int gAGABackgroundColor ;
-
 bool UMAHasAppearance() { return sUMAHasAppearance ; }
 long UMAGetAppearanceVersion() { return sUMAAppearanceVersion ; }
 long UMAGetSystemVersion() { return sUMASystemVersion ; }