]>
git.saurik.com Git - wxWidgets.git/blob - src/gtk1/utilsgtk.cpp
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: src/gtk1/utilsgtk.cpp
4 // Author: Robert Roebling
5 // Copyright: (c) 1998 Robert Roebling
6 // Licence: wxWindows licence
7 /////////////////////////////////////////////////////////////////////////////
9 // For compilers that support precompilation, includes "wx.h".
10 #include "wx/wxprec.h"
15 #include "wx/string.h"
20 #include "wx/apptrait.h"
21 #include "wx/gtk1/private/timer.h"
22 #include "wx/evtloop.h"
23 #include "wx/process.h"
28 #include <sys/types.h>
29 #include <sys/wait.h> // for WNOHANG
35 #include "gtk/gtkfeatures.h"
38 #ifdef HAVE_X11_XKBLIB_H
39 /* under HP-UX and Solaris 2.6, at least, XKBlib.h defines structures with
40 * field named "explicit" - which is, of course, an error for a C++
41 * compiler. To be on the safe side, just redefine it everywhere. */
42 #define explicit __wx_explicit
44 #include "X11/XKBlib.h"
47 #endif // HAVE_X11_XKBLIB_H
49 //-----------------------------------------------------------------------------
51 //-----------------------------------------------------------------------------
53 extern GtkWidget
*wxGetRootWindow();
55 //----------------------------------------------------------------------------
57 //----------------------------------------------------------------------------
64 /* Don't synthesize KeyUp events holding down a key and producing
65 KeyDown events with autorepeat. */
66 #ifdef HAVE_X11_XKBLIB_H
67 bool wxSetDetectableAutoRepeat( bool flag
)
70 XkbSetDetectableAutoRepeat( GDK_DISPLAY(), flag
, &result
);
71 return result
; /* true if keyboard hardware supports this mode */
74 bool wxSetDetectableAutoRepeat( bool WXUNUSED(flag
) )
80 // ----------------------------------------------------------------------------
81 // display characterstics
82 // ----------------------------------------------------------------------------
89 void wxDisplaySize( int *width
, int *height
)
91 if (width
) *width
= gdk_screen_width();
92 if (height
) *height
= gdk_screen_height();
95 void wxDisplaySizeMM( int *width
, int *height
)
97 if (width
) *width
= gdk_screen_width_mm();
98 if (height
) *height
= gdk_screen_height_mm();
101 void wxGetMousePosition( int* x
, int* y
)
103 gdk_window_get_pointer( NULL
, x
, y
, NULL
);
106 bool wxColourDisplay()
113 return gdk_window_get_visual( wxGetRootWindow()->window
)->depth
;
116 wxWindow
* wxFindWindowAtPoint(const wxPoint
& pt
)
118 return wxGenericFindWindowAtPoint(pt
);
122 // ----------------------------------------------------------------------------
123 // subprocess routines
124 // ----------------------------------------------------------------------------
128 wxTimerImpl
* wxGUIAppTraits::CreateTimerImpl(wxTimer
*timer
)
130 return new wxGTKTimerImpl(timer
);
133 #endif // wxUSE_TIMER
135 // ----------------------------------------------------------------------------
136 // wxPlatformInfo-related
137 // ----------------------------------------------------------------------------
139 wxPortId
wxGUIAppTraits::GetToolkitVersion(int *verMaj
, int *verMin
) const
142 *verMaj
= gtk_major_version
;
144 *verMin
= gtk_minor_version
;
149 wxEventLoopBase
* wxGUIAppTraits::CreateEventLoop()
151 return new wxEventLoop
;