]>
git.saurik.com Git - wxWidgets.git/blob - src/gtk/utilsgtk.cpp
c8837d8f2e7524477c0f69533fd023d6a361576b
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
43 #include "X11/XKBlib.h"
47 // ----------------------------------------------------------------------------
49 // ----------------------------------------------------------------------------
56 // Synthesize KeyUp events holding down a key and producing
57 // KeyDown events with autorepeat.
58 bool wxSetDetectableAutoRepeat( bool flag
)
61 XkbSetDetectableAutoRepeat( GDK_DISPLAY(), flag
, &result
);
62 return result
; // true if keyboard hardware supports this mode
65 // ----------------------------------------------------------------------------
66 // display characterstics
67 // ----------------------------------------------------------------------------
69 void wxDisplaySize( int *width
, int *height
)
71 if (width
) *width
= gdk_screen_width();
72 if (height
) *height
= gdk_screen_height();
75 void wxGetMousePosition( int* x
, int* y
)
77 gdk_window_get_pointer( (GdkWindow
*) NULL
, x
, y
, (GdkModifierType
*) NULL
);
80 bool wxColourDisplay()
87 return gdk_window_get_visual( (GdkWindow
*) &gdk_root_parent
)->depth
;
90 int wxGetOsVersion(int *majorVsn
, int *minorVsn
)
92 if (majorVsn
) *majorVsn
= GTK_MAJOR_VERSION
;
93 if (minorVsn
) *minorVsn
= GTK_MINOR_VERSION
;
98 // ----------------------------------------------------------------------------
99 // subprocess routines
100 // ----------------------------------------------------------------------------
102 static void GTK_EndProcessDetector(gpointer data
, gint source
,
103 GdkInputCondition
WXUNUSED(condition
) )
105 wxEndProcessData
*proc_data
= (wxEndProcessData
*)data
;
107 wxHandleProcessTermination(proc_data
);
110 gdk_input_remove(proc_data
->tag
);
113 int wxAddProcessCallback(wxEndProcessData
*proc_data
, int fd
)
115 int tag
= gdk_input_add(fd
,
117 GTK_EndProcessDetector
,
118 (gpointer
)proc_data
);