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>
24 /////////////////////////////////////////////////////////////////////////////
26 /////////////////////////////////////////////////////////////////////////////
28 static int p_thrd_pipe[2] = { -1, -1 };
30 static gint p_thrd_inid;
32 #define THREAD_SEND_EXIT_MSG(ptr) write(p_thrd_pipe[1], &ptr, sizeof(ptr));
35 ThreadExitProc(gpointer WXUNUSED(client), gint fid,
36 GdkInputCondition WXUNUSED(cond))
40 if (fid != p_thrd_pipe[0])
42 if (read(fid, &ptr, sizeof(ptr)) == sizeof(ptr)) {
43 //fprintf(stderr, "calling OnExit %p\n", ptr);
46 //fprintf(stderr, "this should never happen\n");
50 // Global initialization
51 static void wxThreadGuiInit()
54 p_thrd_inid = gdk_input_add(p_thrd_pipe[0], GDK_INPUT_READ,
59 static void wxThreadGuiExit()
61 gdk_input_remove(p_thrd_inid);
62 close(p_thrd_pipe[0]);
63 close(p_thrd_pipe[1]);
66 #ifdef NO_DEFINE_GDK_1_1
68 void wxMutexGuiEnter()
73 void wxMutexGuiLeave()
80 void wxMutexGuiEnter()
85 void wxMutexGuiLeave()
87 wxMainMutex->Unlock();