]> git.saurik.com Git - wxWidgets.git/blob - src/mgl/utils.cpp
MinGW compilation fix.
[wxWidgets.git] / src / mgl / utils.cpp
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: utils.cpp
3 // Purpose:
4 // Author: Vaclav Slavik
5 // Id: $Id$
6 // Copyright: (c) 2001 SciTech Software, Inc. (www.scitechsoft.com)
7 // Licence: wxWindows licence
8 /////////////////////////////////////////////////////////////////////////////
9
10 #include "wx/utils.h"
11 #include "wx/string.h"
12
13 #include "wx/intl.h"
14 #include "wx/log.h"
15 #include "wx/process.h"
16
17 #include <stdarg.h>
18 #include <string.h>
19 #include <sys/stat.h>
20 #include <sys/types.h>
21 #include <unistd.h>
22 #include <mgraph.hpp>
23
24 #ifdef __UNIX__
25 #include "wx/unix/execute.h"
26 #endif
27
28 #include "wx/mgl/private.h"
29
30 //----------------------------------------------------------------------------
31 // misc.
32 //----------------------------------------------------------------------------
33
34 void wxBell()
35 {
36 // FIXME_MGL
37 }
38
39 // ----------------------------------------------------------------------------
40 // display characterstics
41 // ----------------------------------------------------------------------------
42
43 void wxDisplaySize(int *width, int *height)
44 {
45 wxASSERT_MSG( g_displayDC, wxT("MGL display DC not created yet.") );
46 if (width) *width = g_displayDC->sizex();
47 if (height) *height = g_displayDC->sizey();
48 }
49
50 void wxDisplaySizeMM(int *width, int *height)
51 {
52 wxASSERT_MSG( g_displayDC, wxT("MGL display DC not created yet.") );
53 if (width) *width = g_displayDC->sizex() * 25/72;
54 if (height) *height = g_displayDC->sizey() * 25/72;
55 // FIXME_MGL -- what about returning *real* monitor dimensions?
56 }
57
58 void wxClientDisplayRect(int *x, int *y, int *width, int *height)
59 {
60 // This is supposed to return desktop dimensions minus any window
61 // manager panels, menus, taskbars, etc. If there is a way to do that
62 // for this platform please fix this function, otherwise it defaults
63 // to the entire desktop.
64 if (x) *x = 0;
65 if (y) *y = 0;
66 wxDisplaySize(width, height);
67 }
68
69 bool wxColourDisplay()
70 {
71 wxASSERT_MSG( g_displayDC, wxT("MGL display DC not created yet.") );
72
73 return (wxDisplayDepth() > 1);
74 }
75
76 int wxDisplayDepth()
77 {
78 wxASSERT_MSG( g_displayDC, wxT("MGL display DC not created yet.") );
79
80 return g_displayDC->getBitsPerPixel();
81 }
82
83 int wxGetOsVersion(int *majorVsn, int *minorVsn)
84 {
85 #if 0 // FIXME_MGL
86 // FIXME_MGL : fix wxGetOsVersion, too
87 if (majorVsn) *majorVsn = GTK_MAJOR_VERSION;
88 if (minorVsn) *minorVsn = GTK_MINOR_VERSION;
89
90 return wxGTK;
91 #endif
92 }
93
94
95 void wxGetMousePosition(int* x, int* y)
96 {
97 MS_getPos(x, y);
98 }
99
100 wxPoint wxGetMousePosition()
101 {
102 wxPoint pt;
103 wxGetMousePosition(&pt.x, &pt.y);
104 return pt;
105 }
106
107
108
109 #ifdef __UNIX__
110
111 int wxAddProcessCallback(wxEndProcessData *proc_data, int fd)
112 {
113 #if 0 // FIXME_MGL -do we need it at all?
114 int tag = gdk_input_add(fd,
115 GDK_INPUT_READ,
116 GTK_EndProcessDetector,
117 (gpointer)proc_data);
118
119 return tag;
120 #endif
121 }
122
123 #endif