From: David Elliott Date: Mon, 7 May 2007 20:58:04 +0000 (+0000) Subject: Move src/cocoa/utils.cpp to src/cocoa/utils.mm. X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/c24937e4cc6bed655a2c163a91e4c623dfc5f15f?ds=inline Move src/cocoa/utils.cpp to src/cocoa/utils.mm. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@45869 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/Makefile.in b/Makefile.in index 16e8ed3a61..da2e1dd89d 100644 --- a/Makefile.in +++ b/Makefile.in @@ -14348,8 +14348,8 @@ monodll_sound_sdl.o: $(srcdir)/src/unix/sound_sdl.cpp $(MONODLL_ODEP) @COND_TOOLKIT_MOTIF_USE_GUI_1_WXUNIV_0@monodll_utils.o: $(srcdir)/src/motif/utils.cpp $(MONODLL_ODEP) @COND_TOOLKIT_MOTIF_USE_GUI_1_WXUNIV_0@ $(CXXC) -c -o $@ $(MONODLL_CXXFLAGS) $(srcdir)/src/motif/utils.cpp -@COND_TOOLKIT_COCOA_USE_GUI_1_WXUNIV_0@monodll_utils.o: $(srcdir)/src/cocoa/utils.cpp $(MONODLL_ODEP) -@COND_TOOLKIT_COCOA_USE_GUI_1_WXUNIV_0@ $(CXXC) -c -o $@ $(MONODLL_CXXFLAGS) $(srcdir)/src/cocoa/utils.cpp +@COND_TOOLKIT_COCOA_USE_GUI_1_WXUNIV_0@monodll_utils.o: $(srcdir)/src/cocoa/utils.mm $(MONODLL_ODEP) +@COND_TOOLKIT_COCOA_USE_GUI_1_WXUNIV_0@ $(CXXC) -c -o $@ $(MONODLL_CXXFLAGS) $(srcdir)/src/cocoa/utils.mm @COND_PLATFORM_WIN32_1@monodll_utilsexc.o: $(srcdir)/src/msw/utilsexc.cpp $(MONODLL_ODEP) @COND_PLATFORM_WIN32_1@ $(CXXC) -c -o $@ $(MONODLL_CXXFLAGS) $(srcdir)/src/msw/utilsexc.cpp @@ -18548,8 +18548,8 @@ monolib_sound_sdl.o: $(srcdir)/src/unix/sound_sdl.cpp $(MONOLIB_ODEP) @COND_TOOLKIT_MOTIF_USE_GUI_1_WXUNIV_0@monolib_utils.o: $(srcdir)/src/motif/utils.cpp $(MONOLIB_ODEP) @COND_TOOLKIT_MOTIF_USE_GUI_1_WXUNIV_0@ $(CXXC) -c -o $@ $(MONOLIB_CXXFLAGS) $(srcdir)/src/motif/utils.cpp -@COND_TOOLKIT_COCOA_USE_GUI_1_WXUNIV_0@monolib_utils.o: $(srcdir)/src/cocoa/utils.cpp $(MONOLIB_ODEP) -@COND_TOOLKIT_COCOA_USE_GUI_1_WXUNIV_0@ $(CXXC) -c -o $@ $(MONOLIB_CXXFLAGS) $(srcdir)/src/cocoa/utils.cpp +@COND_TOOLKIT_COCOA_USE_GUI_1_WXUNIV_0@monolib_utils.o: $(srcdir)/src/cocoa/utils.mm $(MONOLIB_ODEP) +@COND_TOOLKIT_COCOA_USE_GUI_1_WXUNIV_0@ $(CXXC) -c -o $@ $(MONOLIB_CXXFLAGS) $(srcdir)/src/cocoa/utils.mm @COND_PLATFORM_WIN32_1@monolib_utilsexc.o: $(srcdir)/src/msw/utilsexc.cpp $(MONOLIB_ODEP) @COND_PLATFORM_WIN32_1@ $(CXXC) -c -o $@ $(MONOLIB_CXXFLAGS) $(srcdir)/src/msw/utilsexc.cpp @@ -23276,8 +23276,8 @@ coredll_win32.o: $(srcdir)/src/univ/themes/win32.cpp $(COREDLL_ODEP) @COND_TOOLKIT_MOTIF_USE_GUI_1_WXUNIV_0@coredll_utils.o: $(srcdir)/src/motif/utils.cpp $(COREDLL_ODEP) @COND_TOOLKIT_MOTIF_USE_GUI_1_WXUNIV_0@ $(CXXC) -c -o $@ $(COREDLL_CXXFLAGS) $(srcdir)/src/motif/utils.cpp -@COND_TOOLKIT_COCOA_USE_GUI_1_WXUNIV_0@coredll_utils.o: $(srcdir)/src/cocoa/utils.cpp $(COREDLL_ODEP) -@COND_TOOLKIT_COCOA_USE_GUI_1_WXUNIV_0@ $(CXXC) -c -o $@ $(COREDLL_CXXFLAGS) $(srcdir)/src/cocoa/utils.cpp +@COND_TOOLKIT_COCOA_USE_GUI_1_WXUNIV_0@coredll_utils.o: $(srcdir)/src/cocoa/utils.mm $(COREDLL_ODEP) +@COND_TOOLKIT_COCOA_USE_GUI_1_WXUNIV_0@ $(CXXC) -c -o $@ $(COREDLL_CXXFLAGS) $(srcdir)/src/cocoa/utils.mm @COND_TOOLKIT_MAC_USE_GUI_1_WXUNIV_0@coredll_caret.o: $(srcdir)/src/generic/caret.cpp $(COREDLL_ODEP) @COND_TOOLKIT_MAC_USE_GUI_1_WXUNIV_0@ $(CXXC) -c -o $@ $(COREDLL_CXXFLAGS) $(srcdir)/src/generic/caret.cpp @@ -26243,8 +26243,8 @@ corelib_win32.o: $(srcdir)/src/univ/themes/win32.cpp $(CORELIB_ODEP) @COND_TOOLKIT_MOTIF_USE_GUI_1_WXUNIV_0@corelib_utils.o: $(srcdir)/src/motif/utils.cpp $(CORELIB_ODEP) @COND_TOOLKIT_MOTIF_USE_GUI_1_WXUNIV_0@ $(CXXC) -c -o $@ $(CORELIB_CXXFLAGS) $(srcdir)/src/motif/utils.cpp -@COND_TOOLKIT_COCOA_USE_GUI_1_WXUNIV_0@corelib_utils.o: $(srcdir)/src/cocoa/utils.cpp $(CORELIB_ODEP) -@COND_TOOLKIT_COCOA_USE_GUI_1_WXUNIV_0@ $(CXXC) -c -o $@ $(CORELIB_CXXFLAGS) $(srcdir)/src/cocoa/utils.cpp +@COND_TOOLKIT_COCOA_USE_GUI_1_WXUNIV_0@corelib_utils.o: $(srcdir)/src/cocoa/utils.mm $(CORELIB_ODEP) +@COND_TOOLKIT_COCOA_USE_GUI_1_WXUNIV_0@ $(CXXC) -c -o $@ $(CORELIB_CXXFLAGS) $(srcdir)/src/cocoa/utils.mm @COND_TOOLKIT_MAC_USE_GUI_1_WXUNIV_0@corelib_caret.o: $(srcdir)/src/generic/caret.cpp $(CORELIB_ODEP) @COND_TOOLKIT_MAC_USE_GUI_1_WXUNIV_0@ $(CXXC) -c -o $@ $(CORELIB_CXXFLAGS) $(srcdir)/src/generic/caret.cpp diff --git a/build/bakefiles/files.bkl b/build/bakefiles/files.bkl index 2e9633e2d1..a0a07da582 100644 --- a/build/bakefiles/files.bkl +++ b/build/bakefiles/files.bkl @@ -2448,7 +2448,7 @@ IMPORTANT: please read docs/tech/tn0016.txt before modifying this file! src/cocoa/toolbar.mm src/cocoa/tooltip.mm src/cocoa/toplevel.mm - src/cocoa/utils.cpp + src/cocoa/utils.mm src/cocoa/utilsexc.mm src/cocoa/window.mm diff --git a/src/cocoa/utils.cpp b/src/cocoa/utils.cpp deleted file mode 100644 index a2ae48aa1a..0000000000 --- a/src/cocoa/utils.cpp +++ /dev/null @@ -1,118 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: src/cocoa/utils.cpp -// Purpose: Various utilities -// Author: David Elliott -// Created: 2003/??/?? -// RCS-ID: $Id$ -// Copyright: (c) wxWidgets dev team -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#include "wx/wxprec.h" - -#include "wx/utils.h" - -#ifndef WX_PRECOMP - #include "wx/app.h" -#endif // WX_PRECOMP - -#include "wx/apptrait.h" -#include "wx/display.h" -#include "wx/cocoa/private/timer.h" - -#include - -#include -#include -#include -#include - -void wxDisplaySize(int *width, int *height) -{ - // TODO - if(width) - *width = 1024; - if(height) - *height = 768; -} - -void wxDisplaySizeMM(int*,int*) -{ - // TODO -} - -void wxClientDisplayRect(int *x,int *y,int *width,int *height) -{ - // TODO - if(x) - *x = 0; - if(y) - *y = 0; - if(width) - *width=1024; - if(height) - *height=768; -} - -wxPortId wxGUIAppTraits::GetToolkitVersion(int *verMaj, int *verMin) const -{ - // We suppose that toolkit version is the same as OS version under Mac - wxGetOsVersion(verMaj, verMin); - - return wxPORT_COCOA; -} - -wxTimerImpl* wxGUIAppTraits::CreateTimerImpl(wxTimer* timer) -{ - return new wxCocoaTimerImpl(timer); -} - -wxWindow* wxFindWindowAtPoint(const wxPoint& pt) -{ - return wxGenericFindWindowAtPoint(pt); -} - -// Return true if we have a colour display -bool wxColourDisplay() -{ - // TODO - return true; -} - -void wxGetMousePosition( int* x, int* y ) -{ - // TODO -}; - -// Returns depth of screen -int wxDisplayDepth() -{ - // TODO - return 0; -} - -// Emit a beeeeeep -void wxBell() -{ - // TODO -} - -#if 0 -// DFE: These aren't even implemented by wxGTK, and no wxWidgets code calls -// them. If someone needs them, then they'll get a link error - -// Consume all events until no more left -void wxFlushEvents() -{ -} - -// Check whether this window wants to process messages, e.g. Stop button -// in long calculations. -bool wxCheckForInterrupt(wxWindow *wnd) -{ - // TODO - return false; -} - -#endif - diff --git a/src/cocoa/utils.mm b/src/cocoa/utils.mm new file mode 100644 index 0000000000..a2ae48aa1a --- /dev/null +++ b/src/cocoa/utils.mm @@ -0,0 +1,118 @@ +///////////////////////////////////////////////////////////////////////////// +// Name: src/cocoa/utils.cpp +// Purpose: Various utilities +// Author: David Elliott +// Created: 2003/??/?? +// RCS-ID: $Id$ +// Copyright: (c) wxWidgets dev team +// Licence: wxWindows licence +///////////////////////////////////////////////////////////////////////////// + +#include "wx/wxprec.h" + +#include "wx/utils.h" + +#ifndef WX_PRECOMP + #include "wx/app.h" +#endif // WX_PRECOMP + +#include "wx/apptrait.h" +#include "wx/display.h" +#include "wx/cocoa/private/timer.h" + +#include + +#include +#include +#include +#include + +void wxDisplaySize(int *width, int *height) +{ + // TODO + if(width) + *width = 1024; + if(height) + *height = 768; +} + +void wxDisplaySizeMM(int*,int*) +{ + // TODO +} + +void wxClientDisplayRect(int *x,int *y,int *width,int *height) +{ + // TODO + if(x) + *x = 0; + if(y) + *y = 0; + if(width) + *width=1024; + if(height) + *height=768; +} + +wxPortId wxGUIAppTraits::GetToolkitVersion(int *verMaj, int *verMin) const +{ + // We suppose that toolkit version is the same as OS version under Mac + wxGetOsVersion(verMaj, verMin); + + return wxPORT_COCOA; +} + +wxTimerImpl* wxGUIAppTraits::CreateTimerImpl(wxTimer* timer) +{ + return new wxCocoaTimerImpl(timer); +} + +wxWindow* wxFindWindowAtPoint(const wxPoint& pt) +{ + return wxGenericFindWindowAtPoint(pt); +} + +// Return true if we have a colour display +bool wxColourDisplay() +{ + // TODO + return true; +} + +void wxGetMousePosition( int* x, int* y ) +{ + // TODO +}; + +// Returns depth of screen +int wxDisplayDepth() +{ + // TODO + return 0; +} + +// Emit a beeeeeep +void wxBell() +{ + // TODO +} + +#if 0 +// DFE: These aren't even implemented by wxGTK, and no wxWidgets code calls +// them. If someone needs them, then they'll get a link error + +// Consume all events until no more left +void wxFlushEvents() +{ +} + +// Check whether this window wants to process messages, e.g. Stop button +// in long calculations. +bool wxCheckForInterrupt(wxWindow *wnd) +{ + // TODO + return false; +} + +#endif +