]>
Commit | Line | Data |
---|---|---|
32b8ec41 VZ |
1 | ///////////////////////////////////////////////////////////////////////////// |
2 | // Name: utils.cpp | |
3 | // Purpose: | |
4 | // Author: Vaclav Slavik | |
5 | // Id: $Id$ | |
8f7b34a8 | 6 | // Copyright: (c) 2001 SciTech Software, Inc. (www.scitechsoft.com) |
32b8ec41 VZ |
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" | |
32b8ec41 VZ |
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 | ||
a4bbc9f7 VS |
28 | #include "wx/mgl/private.h" |
29 | ||
32b8ec41 VZ |
30 | //---------------------------------------------------------------------------- |
31 | // misc. | |
32 | //---------------------------------------------------------------------------- | |
33 | ||
34 | void wxBell() | |
35 | { | |
36 | // FIXME_MGL | |
37 | } | |
38 | ||
39 | // ---------------------------------------------------------------------------- | |
40 | // display characterstics | |
41 | // ---------------------------------------------------------------------------- | |
42 | ||
a4bbc9f7 | 43 | void wxDisplaySize(int *width, int *height) |
32b8ec41 VZ |
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 | ||
7bdc1879 | 50 | void wxDisplaySizeMM(int *width, int *height) |
32b8ec41 | 51 | { |
7bdc1879 VS |
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? | |
a4bbc9f7 VS |
56 | } |
57 | ||
7bdc1879 | 58 | void wxClientDisplayRect(int *x, int *y, int *width, int *height) |
a4bbc9f7 | 59 | { |
7bdc1879 VS |
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); | |
32b8ec41 VZ |
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 | |
a4bbc9f7 | 86 | // FIXME_MGL : fix wxGetOsVersion, too |
32b8ec41 VZ |
87 | if (majorVsn) *majorVsn = GTK_MAJOR_VERSION; |
88 | if (minorVsn) *minorVsn = GTK_MINOR_VERSION; | |
89 | ||
90 | return wxGTK; | |
91 | #endif | |
92 | } | |
93 | ||
94 | ||
7bdc1879 VS |
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 | ||
32b8ec41 VZ |
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 |