]>
git.saurik.com Git - wxWidgets.git/blob - src/gtk1/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"
24 #include <sys/types.h>
31 #include <fcntl.h> // for O_WRONLY and friends
36 #include <gtk/gtkfeatures.h>
39 #ifdef HAVE_X11_XKBLIB_H
41 /* under HP-UX XKBlib.h defines structures with field named "explicit" -
42 * which is, of course, an error for a C++ compiler */
43 #define explicit __wx_explicit
46 #include "X11/XKBlib.h"
51 #endif // HAVE_X11_XKBLIB_H
53 // ----------------------------------------------------------------------------
55 // ----------------------------------------------------------------------------
62 /* Don't synthesize KeyUp events holding down a key and producing
63 KeyDown events with autorepeat. */
64 #ifdef HAVE_X11_XKBLIB_H
65 bool wxSetDetectableAutoRepeat( bool flag
)
68 XkbSetDetectableAutoRepeat( GDK_DISPLAY(), flag
, &result
);
69 return result
; /* TRUE if keyboard hardware supports this mode */
72 bool wxSetDetectableAutoRepeat( bool WXUNUSED(flag
) )
78 // ----------------------------------------------------------------------------
79 // display characterstics
80 // ----------------------------------------------------------------------------
82 void wxDisplaySize( int *width
, int *height
)
84 if (width
) *width
= gdk_screen_width();
85 if (height
) *height
= gdk_screen_height();
88 void wxGetMousePosition( int* x
, int* y
)
90 gdk_window_get_pointer( (GdkWindow
*) NULL
, x
, y
, (GdkModifierType
*) NULL
);
93 bool wxColourDisplay()
100 return gdk_window_get_visual( (GdkWindow
*) &gdk_root_parent
)->depth
;
103 int wxGetOsVersion(int *majorVsn
, int *minorVsn
)
105 if (majorVsn
) *majorVsn
= GTK_MAJOR_VERSION
;
106 if (minorVsn
) *minorVsn
= GTK_MINOR_VERSION
;
111 // ----------------------------------------------------------------------------
112 // subprocess routines
113 // ----------------------------------------------------------------------------
115 static void GTK_EndProcessDetector(gpointer data
, gint source
,
116 GdkInputCondition
WXUNUSED(condition
) )
118 wxEndProcessData
*proc_data
= (wxEndProcessData
*)data
;
120 wxHandleProcessTermination(proc_data
);
123 gdk_input_remove(proc_data
->tag
);
126 int wxAddProcessCallback(wxEndProcessData
*proc_data
, int fd
)
128 int tag
= gdk_input_add(fd
,
130 GTK_EndProcessDetector
,
131 (gpointer
)proc_data
);