]>
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>
40 // under HP-UX XKBlib.h defines structures with field named "explicit" -
41 // which is, of course, an error for a C++ compiler
42 #define explicit __wx_explicit
44 #include "X11/XKBlib.h"
49 // ----------------------------------------------------------------------------
51 // ----------------------------------------------------------------------------
58 // Synthesize KeyUp events holding down a key and producing
59 // KeyDown events with autorepeat.
60 bool wxSetDetectableAutoRepeat( bool flag
)
63 XkbSetDetectableAutoRepeat( GDK_DISPLAY(), flag
, &result
);
64 return result
; // true if keyboard hardware supports this mode
67 // ----------------------------------------------------------------------------
68 // display characterstics
69 // ----------------------------------------------------------------------------
71 void wxDisplaySize( int *width
, int *height
)
73 if (width
) *width
= gdk_screen_width();
74 if (height
) *height
= gdk_screen_height();
77 void wxGetMousePosition( int* x
, int* y
)
79 gdk_window_get_pointer( (GdkWindow
*) NULL
, x
, y
, (GdkModifierType
*) NULL
);
82 bool wxColourDisplay()
89 return gdk_window_get_visual( (GdkWindow
*) &gdk_root_parent
)->depth
;
92 int wxGetOsVersion(int *majorVsn
, int *minorVsn
)
94 if (majorVsn
) *majorVsn
= GTK_MAJOR_VERSION
;
95 if (minorVsn
) *minorVsn
= GTK_MINOR_VERSION
;
100 // ----------------------------------------------------------------------------
101 // subprocess routines
102 // ----------------------------------------------------------------------------
104 static void GTK_EndProcessDetector(gpointer data
, gint source
,
105 GdkInputCondition
WXUNUSED(condition
) )
107 wxEndProcessData
*proc_data
= (wxEndProcessData
*)data
;
109 wxHandleProcessTermination(proc_data
);
112 gdk_input_remove(proc_data
->tag
);
115 int wxAddProcessCallback(wxEndProcessData
*proc_data
, int fd
)
117 int tag
= gdk_input_add(fd
,
119 GTK_EndProcessDetector
,
120 (gpointer
)proc_data
);