]>
git.saurik.com Git - wxWidgets.git/blob - src/gtk/utilsgtk.cpp
1 /////////////////////////////////////////////////////////////////////////////
4 // Author: Robert Roebling
6 // Copyright: (c) 1998 Robert Roebling, Julian Smart and Markus Holzem
7 // Licence: wxWindows licence
8 /////////////////////////////////////////////////////////////////////////////
11 #include "wx/string.h"
16 #include "wx/process.h"
18 #include "wx/unix/execute.h"
23 #include <sys/types.h>
29 #include "gtk/gtkfeatures.h"
32 #ifdef HAVE_X11_XKBLIB_H
34 /* under HP-UX XKBlib.h defines structures with field named "explicit" -
35 * which is, of course, an error for a C++ compiler */
36 #define explicit __wx_explicit
39 #include "X11/XKBlib.h"
44 #endif // HAVE_X11_XKBLIB_H
46 // ----------------------------------------------------------------------------
48 // ----------------------------------------------------------------------------
55 /* Don't synthesize KeyUp events holding down a key and producing
56 KeyDown events with autorepeat. */
57 #ifdef HAVE_X11_XKBLIB_H
58 bool wxSetDetectableAutoRepeat( bool flag
)
61 XkbSetDetectableAutoRepeat( GDK_DISPLAY(), flag
, &result
);
62 return result
; /* TRUE if keyboard hardware supports this mode */
65 bool wxSetDetectableAutoRepeat( bool WXUNUSED(flag
) )
71 // ----------------------------------------------------------------------------
72 // display characterstics
73 // ----------------------------------------------------------------------------
75 void wxDisplaySize( int *width
, int *height
)
77 if (width
) *width
= gdk_screen_width();
78 if (height
) *height
= gdk_screen_height();
81 void wxGetMousePosition( int* x
, int* y
)
83 gdk_window_get_pointer( (GdkWindow
*) NULL
, x
, y
, (GdkModifierType
*) NULL
);
86 bool wxColourDisplay()
93 return gdk_window_get_visual( (GdkWindow
*) &gdk_root_parent
)->depth
;
96 int wxGetOsVersion(int *majorVsn
, int *minorVsn
)
98 if (majorVsn
) *majorVsn
= GTK_MAJOR_VERSION
;
99 if (minorVsn
) *minorVsn
= GTK_MINOR_VERSION
;
104 // ----------------------------------------------------------------------------
105 // subprocess routines
106 // ----------------------------------------------------------------------------
108 static void GTK_EndProcessDetector(gpointer data
, gint source
,
109 GdkInputCondition
WXUNUSED(condition
) )
111 wxEndProcessData
*proc_data
= (wxEndProcessData
*)data
;
113 wxHandleProcessTermination(proc_data
);
116 gdk_input_remove(proc_data
->tag
);
119 int wxAddProcessCallback(wxEndProcessData
*proc_data
, int fd
)
121 int tag
= gdk_input_add(fd
,
123 GTK_EndProcessDetector
,
124 (gpointer
)proc_data
);