1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: GUI thread manager for GTK
4 // Author: Original from Wolfram Gloger/Guilhem Lavaux
8 // Copyright: (c) Wolfram Gloger (1996, 1997); Guilhem Lavaux (1998)
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
17 #include <sys/types.h>
25 /////////////////////////////////////////////////////////////////////////////
27 /////////////////////////////////////////////////////////////////////////////
29 static int p_thrd_pipe[2] = { -1, -1 };
31 static gint p_thrd_inid;
33 #define THREAD_SEND_EXIT_MSG(ptr) write(p_thrd_pipe[1], &ptr, sizeof(ptr));
36 ThreadExitProc(gpointer WXUNUSED(client), gint fid,
37 GdkInputCondition WXUNUSED(cond))
41 if (fid != p_thrd_pipe[0])
43 if (read(fid, &ptr, sizeof(ptr)) == sizeof(ptr)) {
44 //fprintf(stderr, "calling OnExit %p\n", ptr);
47 //fprintf(stderr, "this should never happen\n");
51 // Global initialization
52 static void wxThreadGuiInit()
55 p_thrd_inid = gdk_input_add(p_thrd_pipe[0], GDK_INPUT_READ,
60 static void wxThreadGuiExit()
62 gdk_input_remove(p_thrd_inid);
63 close(p_thrd_pipe[0]);
64 close(p_thrd_pipe[1]);