]>
git.saurik.com Git - wxWidgets.git/blob - src/mgl/utils.cpp
1 /////////////////////////////////////////////////////////////////////////////
4 // Author: Vaclav Slavik
6 // Copyright: (c) 2001 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"
22 #include "wx/process.h"
27 #include <sys/types.h>
32 #include "wx/unix/execute.h"
35 #include "wx/mgl/private.h"
37 //----------------------------------------------------------------------------
39 //----------------------------------------------------------------------------
46 // ----------------------------------------------------------------------------
47 // display characterstics
48 // ----------------------------------------------------------------------------
50 void wxDisplaySize(int *width
, int *height
)
52 wxASSERT_MSG( g_displayDC
, wxT("You must call wxApp::SetDisplayMode before using this function") );
53 if (width
) *width
= g_displayDC
->sizex()+1;
54 if (height
) *height
= g_displayDC
->sizey()+1;
57 void wxDisplaySizeMM(int *width
, int *height
)
59 wxASSERT_MSG( g_displayDC
, wxT("You must call wxApp::SetDisplayMode before using this function") );
61 *width
= (g_displayDC
->sizex()+1) * 25/72;
63 *height
= (g_displayDC
->sizey()+1) * 25/72;
64 // FIXME_MGL -- what about returning *real* monitor dimensions?
67 void wxClientDisplayRect(int *x
, int *y
, int *width
, int *height
)
71 wxDisplaySize(width
, height
);
72 // FIXME_MGL - windowed version needs different handling
75 bool wxColourDisplay()
77 wxASSERT_MSG( g_displayDC
, wxT("You must call wxApp::SetDisplayMode before using this function") );
79 return (wxDisplayDepth() > 1);
84 wxASSERT_MSG( g_displayDC
, wxT("You must call wxApp::SetDisplayMode before using this function") );
86 return g_displayDC
->getBitsPerPixel();
89 int wxGetOsVersion(int *majorVsn
, int *minorVsn
)
92 *majorVsn
= MGL_RELEASE_MAJOR
;
94 *minorVsn
= MGL_RELEASE_MINOR
;
98 #elif defined(__OS2__)
100 #elif defined(__WIN32__)
102 #elif defined(__DOS__)
105 #error Platform not supported by wxMGL!
110 void wxGetMousePosition(int* x
, int* y
)
115 wxPoint
wxGetMousePosition()
118 wxGetMousePosition(&pt
.x
, &pt
.y
);
126 int wxAddProcessCallback(wxEndProcessData
*proc_data
, int fd
)
128 wxFAIL_MSG(wxT("wxAddProcessCallback not implemented in wxMGL!"));
130 #if 0 // FIXME_MGL -do we need it at all?
131 int tag
= gdk_input_add(fd
,
133 GTK_EndProcessDetector
,
134 (gpointer
)proc_data
);