]>
git.saurik.com Git - wxWidgets.git/blob - src/mgl/utils.cpp
1 /////////////////////////////////////////////////////////////////////////////
4 // Author: Vaclav Slavik
6 // Copyright: (c) 2001-2002 SciTech Software, Inc. (www.scitechsoft.com)
7 // Licence: wxWindows licence
8 /////////////////////////////////////////////////////////////////////////////
10 // For compilers that support precompilation, includes "wx.h".
11 #include "wx/wxprec.h"
18 #include "wx/string.h"
21 #include "wx/apptrait.h"
23 #include "wx/process.h"
28 #include <sys/types.h>
33 #include "wx/unix/execute.h"
36 #include "wx/mgl/private.h"
38 //----------------------------------------------------------------------------
40 //----------------------------------------------------------------------------
47 // ----------------------------------------------------------------------------
48 // display characterstics
49 // ----------------------------------------------------------------------------
51 void wxDisplaySize(int *width
, int *height
)
53 wxASSERT_MSG( g_displayDC
, wxT("You must call wxApp::SetDisplayMode before using this function") );
54 if (width
) *width
= g_displayDC
->sizex()+1;
55 if (height
) *height
= g_displayDC
->sizey()+1;
58 void wxDisplaySizeMM(int *width
, int *height
)
60 wxASSERT_MSG( g_displayDC
, wxT("You must call wxApp::SetDisplayMode before using this function") );
63 MGL_getDotsPerInch(&xDPI
, &yDPI
);
66 *width
= (int)((g_displayDC
->sizex()+1) * 25.4 / xDPI
);
68 *height
= (int)((g_displayDC
->sizey()+1) * 25.4 / yDPI
);
71 void wxClientDisplayRect(int *x
, int *y
, int *width
, int *height
)
75 wxDisplaySize(width
, height
);
76 // FIXME_MGL - windowed version needs different handling
79 bool wxColourDisplay()
81 wxASSERT_MSG( g_displayDC
, wxT("You must call wxApp::SetDisplayMode before using this function") );
83 return (wxDisplayDepth() > 1);
88 wxASSERT_MSG( g_displayDC
, wxT("You must call wxApp::SetDisplayMode before using this function") );
90 return g_displayDC
->getBitsPerPixel();
93 wxString
wxGetOsDescription()
99 #elif defined(__OS2__)
101 #elif defined(__WIN32__)
103 #elif defined(__DOS__)
116 wxToolkitInfo
& wxGUIAppTraits::GetToolkitInfo()
118 static wxToolkitInfo info
;
119 info
.shortName
= _T("mgluniv");
120 info
.name
= _T("wxMGL");
121 info
.versionMajor
= MGL_RELEASE_MAJOR
;
122 info
.versionMinor
= MGL_RELEASE_MINOR
;
124 #if defined(__UNIX__)
125 info
.os
= wxMGL_UNIX
;
126 #elif defined(__OS2__)
128 #elif defined(__WIN32__)
129 info
.os
= wxMGL_WIN32
;
130 #elif defined(__DOS__)
133 #error Platform not supported by wxMGL!
141 wxToolkitInfo
& wxConsoleAppTraits::GetToolkitInfo()
143 static wxToolkitInfo info
;
144 info
.shortName
= _T("mglbase");
145 info
.versionMajor
= MGL_RELEASE_MAJOR
;
146 info
.versionMinor
= MGL_RELEASE_MINOR
;
147 info
.name
= _T("wxBase");
149 #if defined(__UNIX__)
150 info
.os
= wxMGL_UNIX
;
151 #elif defined(__OS2__)
153 #elif defined(__WIN32__)
154 info
.os
= wxMGL_WIN32
;
155 #elif defined(__DOS__)
158 #error Platform not supported by wxMGL!
164 void wxGetMousePosition(int* x
, int* y
)
169 wxPoint
wxGetMousePosition()
172 wxGetMousePosition(&pt
.x
, &pt
.y
);
180 int wxAddProcessCallback(wxEndProcessData
*proc_data
, int fd
)
182 wxFAIL_MSG(wxT("wxAddProcessCallback not implemented in wxMGL!"));
184 #if 0 // FIXME_MGL -do we need it at all?
185 int tag
= gdk_input_add(fd
,
187 GTK_EndProcessDetector
,
188 (gpointer
)proc_data
);