]>
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 // ----------------------------------------------------------------------------
41 // ----------------------------------------------------------------------------
48 // ----------------------------------------------------------------------------
49 // display characterstics
50 // ----------------------------------------------------------------------------
52 void wxDisplaySize( int *width
, int *height
)
54 if (width
) *width
= gdk_screen_width();
55 if (height
) *height
= gdk_screen_height();
58 void wxGetMousePosition( int* x
, int* y
)
60 gdk_window_get_pointer( (GdkWindow
*) NULL
, x
, y
, (GdkModifierType
*) NULL
);
63 bool wxColourDisplay()
70 return gdk_window_get_visual( (GdkWindow
*) &gdk_root_parent
)->depth
;
73 int wxGetOsVersion(int *majorVsn
, int *minorVsn
)
75 if (majorVsn
) *majorVsn
= GTK_MAJOR_VERSION
;
76 if (minorVsn
) *minorVsn
= GTK_MINOR_VERSION
;
81 // ----------------------------------------------------------------------------
82 // subprocess routines
83 // ----------------------------------------------------------------------------
85 static void GTK_EndProcessDetector(gpointer data
, gint source
,
86 GdkInputCondition
WXUNUSED(condition
) )
88 wxEndProcessData
*proc_data
= (wxEndProcessData
*)data
;
90 wxHandleProcessTermination(proc_data
);
93 gdk_input_remove(proc_data
->tag
);
96 int wxAddProcessCallback(wxEndProcessData
*proc_data
, int fd
)
98 int tag
= gdk_input_add(fd
,
100 GTK_EndProcessDetector
,
101 (gpointer
)proc_data
);