]> git.saurik.com Git - wxWidgets.git/blame - src/cocoa/utils.mm
Check for invalid items in generic wxDataViewCtrl::GetSelections().
[wxWidgets.git] / src / cocoa / utils.mm
CommitLineData
a24aff65 1/////////////////////////////////////////////////////////////////////////////
80fdcdb9 2// Name: src/cocoa/utils.mm
a24aff65 3// Purpose: Various utilities
c2ca375c 4// Author: David Elliott
a24aff65 5// Created: 2003/??/??
5489a9a1 6// RCS-ID: $Id$
c2ca375c 7// Copyright: (c) wxWidgets dev team
5489a9a1 8// Licence: wxWindows licence
a24aff65
DE
9/////////////////////////////////////////////////////////////////////////////
10
8498a285
WS
11#include "wx/wxprec.h"
12
a24aff65 13#include "wx/utils.h"
670f9935
WS
14
15#ifndef WX_PRECOMP
16 #include "wx/app.h"
17#endif // WX_PRECOMP
18
a631300c 19#include "wx/apptrait.h"
1f360a2d 20#include "wx/display.h"
3a472195 21#include "wx/evtloop.h"
c2ca375c 22#include "wx/cocoa/private/timer.h"
a24aff65
DE
23
24#include <ctype.h>
25
26#include <stdio.h>
27#include <stdlib.h>
28#include <string.h>
29#include <stdarg.h>
30
4263bab0
DE
31#include "wx/cocoa/string.h"
32
33#import <Foundation/NSURL.h>
34#import <AppKit/NSWorkspace.h>
35
a24aff65
DE
36void wxDisplaySize(int *width, int *height)
37{
38 // TODO
ba7c420a
DE
39 if(width)
40 *width = 1024;
41 if(height)
42 *height = 768;
a24aff65
DE
43}
44
45void wxDisplaySizeMM(int*,int*)
46{
47 // TODO
48}
49
50void wxClientDisplayRect(int *x,int *y,int *width,int *height)
51{
52 // TODO
53 if(x)
54 *x = 0;
55 if(y)
56 *y = 0;
57 if(width)
58 *width=1024;
59 if(height)
60 *height=768;
61}
62
9d639ffa 63wxPortId wxGUIAppTraits::GetToolkitVersion(int *verMaj, int *verMin) const
15809513 64{
9d639ffa
VZ
65 // We suppose that toolkit version is the same as OS version under Mac
66 wxGetOsVersion(verMaj, verMin);
67
68 return wxPORT_COCOA;
15809513
DE
69}
70
c2ca375c
VZ
71wxTimerImpl* wxGUIAppTraits::CreateTimerImpl(wxTimer* timer)
72{
73 return new wxCocoaTimerImpl(timer);
74}
75
2ddff00c 76wxEventLoopBase* wxGUIAppTraits::CreateEventLoop()
3a472195 77{
2ddff00c 78 return new wxGUIEventLoop;
3a472195
DE
79}
80
5489a9a1
WS
81wxWindow* wxFindWindowAtPoint(const wxPoint& pt)
82{
83 return wxGenericFindWindowAtPoint(pt);
84}
85
86// Return true if we have a colour display
a24aff65
DE
87bool wxColourDisplay()
88{
89 // TODO
5489a9a1 90 return true;
a24aff65
DE
91}
92
93void wxGetMousePosition( int* x, int* y )
94{
95 // TODO
96};
97
98// Returns depth of screen
99int wxDisplayDepth()
100{
101 // TODO
102 return 0;
103}
104
105// Emit a beeeeeep
106void wxBell()
107{
108 // TODO
109}
110
4263bab0 111// Private helper method for wxLaunchDefaultBrowser
50a2e26f 112bool wxDoLaunchDefaultBrowser(const wxString& url, int flags)
4263bab0
DE
113{
114 // NOTE: We ignore the flags
115 return [[NSWorkspace sharedWorkspace] openURL: [NSURL URLWithString:wxNSStringWithWxString(url)]] != NO;
116}
117
a24aff65 118#if 0
77ffb593 119// DFE: These aren't even implemented by wxGTK, and no wxWidgets code calls
a24aff65
DE
120// them. If someone needs them, then they'll get a link error
121
122// Consume all events until no more left
123void wxFlushEvents()
124{
125}
126
127// Check whether this window wants to process messages, e.g. Stop button
128// in long calculations.
129bool wxCheckForInterrupt(wxWindow *wnd)
130{
131 // TODO
5489a9a1 132 return false;
a24aff65
DE
133}
134
135#endif
136