]>
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"
24 #include <sys/types.h>
31 #include <fcntl.h> // for O_WRONLY and friends
36 #include <gtk/gtkfeatures.h>
38 #include "X11/XKBlib.h"
40 // ----------------------------------------------------------------------------
42 // ----------------------------------------------------------------------------
49 // Synthesize KeyUp events holding down a key and producing
50 // KeyDown events with autorepeat.
51 bool wxSetDetectableAutoRepeat( bool flag
)
54 XkbSetDetectableAutoRepeat( GDK_DISPLAY(), flag
, &result
);
55 return result
; // true if keyboard hardware supports this mode
58 // ----------------------------------------------------------------------------
59 // display characterstics
60 // ----------------------------------------------------------------------------
62 void wxDisplaySize( int *width
, int *height
)
64 if (width
) *width
= gdk_screen_width();
65 if (height
) *height
= gdk_screen_height();
68 void wxGetMousePosition( int* x
, int* y
)
70 gdk_window_get_pointer( (GdkWindow
*) NULL
, x
, y
, (GdkModifierType
*) NULL
);
73 bool wxColourDisplay()
80 return gdk_window_get_visual( (GdkWindow
*) &gdk_root_parent
)->depth
;
83 int wxGetOsVersion(int *majorVsn
, int *minorVsn
)
85 if (majorVsn
) *majorVsn
= GTK_MAJOR_VERSION
;
86 if (minorVsn
) *minorVsn
= GTK_MINOR_VERSION
;
91 // ----------------------------------------------------------------------------
92 // subprocess routines
93 // ----------------------------------------------------------------------------
95 static void GTK_EndProcessDetector(gpointer data
, gint source
,
96 GdkInputCondition
WXUNUSED(condition
) )
98 wxEndProcessData
*proc_data
= (wxEndProcessData
*)data
;
100 wxHandleProcessTermination(proc_data
);
103 gdk_input_remove(proc_data
->tag
);
106 int wxAddProcessCallback(wxEndProcessData
*proc_data
, int fd
)
108 int tag
= gdk_input_add(fd
,
110 GTK_EndProcessDetector
,
111 (gpointer
)proc_data
);