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