]>
git.saurik.com Git - wxWidgets.git/blob - src/gtk1/utilsgtk.cpp
9a18cfae57f9db3cedc08b01cc83421d0c96f17e
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: src/gtk1/utilsgtk.cpp
4 // Author: Robert Roebling
6 // Copyright: (c) 1998 Robert Roebling
7 // Licence: wxWindows licence
8 /////////////////////////////////////////////////////////////////////////////
10 // For compilers that support precompilation, includes "wx.h".
11 #include "wx/wxprec.h"
16 #include "wx/string.h"
21 #include "wx/apptrait.h"
22 #include "wx/gtk1/private/timer.h"
23 #include "wx/evtloop.h"
24 #include "wx/process.h"
29 #include <sys/types.h>
30 #include <sys/wait.h> // for WNOHANG
36 #include "gtk/gtkfeatures.h"
39 #ifdef HAVE_X11_XKBLIB_H
40 /* under HP-UX and Solaris 2.6, at least, XKBlib.h defines structures with
41 * field named "explicit" - which is, of course, an error for a C++
42 * compiler. To be on the safe side, just redefine it everywhere. */
43 #define explicit __wx_explicit
45 #include "X11/XKBlib.h"
48 #endif // HAVE_X11_XKBLIB_H
50 //-----------------------------------------------------------------------------
52 //-----------------------------------------------------------------------------
54 extern GtkWidget
*wxGetRootWindow();
56 //----------------------------------------------------------------------------
58 //----------------------------------------------------------------------------
65 /* Don't synthesize KeyUp events holding down a key and producing
66 KeyDown events with autorepeat. */
67 #ifdef HAVE_X11_XKBLIB_H
68 bool wxSetDetectableAutoRepeat( bool flag
)
71 XkbSetDetectableAutoRepeat( GDK_DISPLAY(), flag
, &result
);
72 return result
; /* true if keyboard hardware supports this mode */
75 bool wxSetDetectableAutoRepeat( bool WXUNUSED(flag
) )
81 // ----------------------------------------------------------------------------
82 // display characterstics
83 // ----------------------------------------------------------------------------
90 void wxDisplaySize( int *width
, int *height
)
92 if (width
) *width
= gdk_screen_width();
93 if (height
) *height
= gdk_screen_height();
96 void wxDisplaySizeMM( int *width
, int *height
)
98 if (width
) *width
= gdk_screen_width_mm();
99 if (height
) *height
= gdk_screen_height_mm();
102 void wxGetMousePosition( int* x
, int* y
)
104 gdk_window_get_pointer( NULL
, x
, y
, NULL
);
107 bool wxColourDisplay()
114 return gdk_window_get_visual( wxGetRootWindow()->window
)->depth
;
117 wxWindow
* wxFindWindowAtPoint(const wxPoint
& pt
)
119 return wxGenericFindWindowAtPoint(pt
);
123 // ----------------------------------------------------------------------------
124 // subprocess routines
125 // ----------------------------------------------------------------------------
129 wxTimerImpl
* wxGUIAppTraits::CreateTimerImpl(wxTimer
*timer
)
131 return new wxGTKTimerImpl(timer
);
134 #endif // wxUSE_TIMER
136 // ----------------------------------------------------------------------------
137 // wxPlatformInfo-related
138 // ----------------------------------------------------------------------------
140 wxPortId
wxGUIAppTraits::GetToolkitVersion(int *verMaj
, int *verMin
) const
143 *verMaj
= gtk_major_version
;
145 *verMin
= gtk_minor_version
;
150 wxEventLoopBase
* wxGUIAppTraits::CreateEventLoop()
152 return new wxEventLoop
;