]>
git.saurik.com Git - wxWidgets.git/blob - src/mgl/utils.cpp
7bd3338d3b648c4d169142f5509a18f981cbc669
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: src/mgl/utils.cpp
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"
20 #include "wx/string.h"
25 #include "wx/apptrait.h"
26 #include "wx/process.h"
31 #include <sys/types.h>
36 #include "wx/unix/execute.h"
39 #include "wx/mgl/private.h"
41 //----------------------------------------------------------------------------
43 //----------------------------------------------------------------------------
50 // ----------------------------------------------------------------------------
51 // display characterstics
52 // ----------------------------------------------------------------------------
54 void wxDisplaySize(int *width
, int *height
)
56 wxASSERT_MSG( g_displayDC
, wxT("You must call wxApp::SetDisplayMode before using this function") );
57 if (width
) *width
= g_displayDC
->sizex()+1;
58 if (height
) *height
= g_displayDC
->sizey()+1;
61 void wxDisplaySizeMM(int *width
, int *height
)
63 wxASSERT_MSG( g_displayDC
, wxT("You must call wxApp::SetDisplayMode before using this function") );
66 MGL_getDotsPerInch(&xDPI
, &yDPI
);
69 *width
= (int)((g_displayDC
->sizex()+1) * 25.4 / xDPI
);
71 *height
= (int)((g_displayDC
->sizey()+1) * 25.4 / yDPI
);
74 void wxClientDisplayRect(int *x
, int *y
, int *width
, int *height
)
78 wxDisplaySize(width
, height
);
79 // FIXME_MGL - windowed version needs different handling
82 bool wxColourDisplay()
84 wxASSERT_MSG( g_displayDC
, wxT("You must call wxApp::SetDisplayMode before using this function") );
86 return (wxDisplayDepth() > 1);
91 wxASSERT_MSG( g_displayDC
, wxT("You must call wxApp::SetDisplayMode before using this function") );
93 return g_displayDC
->getBitsPerPixel();
98 wxToolkitInfo
& wxGUIAppTraits::GetToolkitInfo()
100 static wxToolkitInfo info
;
101 info
.shortName
= _T("mgluniv");
102 info
.name
= _T("wxMGL");
103 info
.versionMajor
= MGL_RELEASE_MAJOR
;
104 info
.versionMinor
= MGL_RELEASE_MINOR
;
106 #if defined(__UNIX__)
107 info
.os
= wxMGL_UNIX
;
108 #elif defined(__OS2__)
110 #elif defined(__WIN32__)
111 info
.os
= wxMGL_WIN32
;
112 #elif defined(__DOS__)
115 #error Platform not supported by wxMGL!
123 wxToolkitInfo
& wxConsoleAppTraits::GetToolkitInfo()
125 static wxToolkitInfo info
;
126 info
.shortName
= _T("mglbase");
127 info
.versionMajor
= MGL_RELEASE_MAJOR
;
128 info
.versionMinor
= MGL_RELEASE_MINOR
;
129 info
.name
= _T("wxBase");
131 #if defined(__UNIX__)
132 info
.os
= wxMGL_UNIX
;
133 #elif defined(__OS2__)
135 #elif defined(__WIN32__)
136 info
.os
= wxMGL_WIN32
;
137 #elif defined(__DOS__)
140 #error Platform not supported by wxMGL!
146 void wxGetMousePosition(int* x
, int* y
)
151 wxPoint
wxGetMousePosition()
154 wxGetMousePosition(&pt
.x
, &pt
.y
);
162 int wxAddProcessCallback(wxEndProcessData
*proc_data
, int fd
)
164 wxFAIL_MSG(wxT("wxAddProcessCallback not implemented in wxMGL!"));
166 #if 0 // FIXME_MGL -do we need it at all?
167 int tag
= gdk_input_add(fd
,
169 GTK_EndProcessDetector
,
170 (gpointer
)proc_data
);