]>
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();
95 wxToolkitInfo
& wxGUIAppTraits::GetToolkitInfo()
97 static wxToolkitInfo info
;
98 info
.shortName
= _T("mgluniv");
99 info
.name
= _T("wxMGL");
100 info
.versionMajor
= MGL_RELEASE_MAJOR
;
101 info
.versionMinor
= MGL_RELEASE_MINOR
;
103 #if defined(__UNIX__)
104 info
.os
= wxMGL_UNIX
;
105 #elif defined(__OS2__)
107 #elif defined(__WIN32__)
108 info
.os
= wxMGL_WIN32
;
109 #elif defined(__DOS__)
112 #error Platform not supported by wxMGL!
120 wxToolkitInfo
& wxConsoleAppTraits::GetToolkitInfo()
122 static wxToolkitInfo info
;
123 info
.shortName
= _T("mglbase");
124 info
.versionMajor
= MGL_RELEASE_MAJOR
;
125 info
.versionMinor
= MGL_RELEASE_MINOR
;
126 info
.name
= _T("wxBase");
128 #if defined(__UNIX__)
129 info
.os
= wxMGL_UNIX
;
130 #elif defined(__OS2__)
132 #elif defined(__WIN32__)
133 info
.os
= wxMGL_WIN32
;
134 #elif defined(__DOS__)
137 #error Platform not supported by wxMGL!
143 void wxGetMousePosition(int* x
, int* y
)
148 wxPoint
wxGetMousePosition()
151 wxGetMousePosition(&pt
.x
, &pt
.y
);
159 int wxAddProcessCallback(wxEndProcessData
*proc_data
, int fd
)
161 wxFAIL_MSG(wxT("wxAddProcessCallback not implemented in wxMGL!"));
163 #if 0 // FIXME_MGL -do we need it at all?
164 int tag
= gdk_input_add(fd
,
166 GTK_EndProcessDetector
,
167 (gpointer
)proc_data
);