summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorbothorel2000-01-19 19:07:12 +0000
committerbothorel2000-01-19 19:07:12 +0000
commit09f4adbc91893a5ec938eeb0b5a317f38e6c4b7b (patch)
treed440940725d33fd974716ba23db0509772e8bca3 /src
parent76b3033e9dc3cf307d2ec71f65d94bc3a0c69195 (diff)
downloadivy-c-09f4adbc91893a5ec938eeb0b5a317f38e6c4b7b.zip
ivy-c-09f4adbc91893a5ec938eeb0b5a317f38e6c4b7b.tar.gz
ivy-c-09f4adbc91893a5ec938eeb0b5a317f38e6c4b7b.tar.bz2
ivy-c-09f4adbc91893a5ec938eeb0b5a317f38e6c4b7b.tar.xz
*** empty log message ***
Diffstat (limited to 'src')
-rw-r--r--src/ivygtkloop.h55
-rw-r--r--src/ivyprobe.c40
2 files changed, 89 insertions, 6 deletions
diff --git a/src/ivygtkloop.h b/src/ivygtkloop.h
new file mode 100644
index 0000000..fd92349
--- /dev/null
+++ b/src/ivygtkloop.h
@@ -0,0 +1,55 @@
+/*
+ * Ivy, C interface
+ *
+ * Copyright (C) 1997-1999
+ * Centre d'Études de la Navigation Aérienne
+ *
+ * Main loop based on GTK Toolkit
+ *
+ * Authors: François-Régis Colin <colin@tls.cena.fr>
+ *
+ * $Id$
+ *
+ * Please refer to file version.h for the
+ * copyright notice regarding this software
+ */
+
+#ifndef IVYGTKLOOP_H
+#define IVYGTKLOOP_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+/* general Handle */
+
+#define ANYPORT 0
+
+#ifdef WIN32
+#include <windows.h>
+#define HANDLE SOCKET
+#else
+#define HANDLE int
+#endif
+
+#include "ivychannel.h"
+
+extern void IvyGtkChannelInit(void);
+
+extern Channel IvyGtkChannelSetUp(
+ HANDLE fd,
+ void *data,
+ ChannelHandleDelete handle_delete,
+ ChannelHandleRead handle_read
+);
+
+extern void IvyGtkChannelClose( Channel channel );
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
+
diff --git a/src/ivyprobe.c b/src/ivyprobe.c
index d9a2ab1..b7317f5 100644
--- a/src/ivyprobe.c
+++ b/src/ivyprobe.c
@@ -13,6 +13,14 @@
* Please refer to file version.h for the
* copyright notice regarding this software
*/
+#define IVYMAINLOOP
+
+#ifdef XTMAINLOOP
+#undef IVYMAINLOOP
+#endif
+#ifdef GTKMAINLOOP
+#undef IVYMAINLOOP
+#endif
#include <stdio.h>
#include <stdlib.h>
@@ -25,7 +33,11 @@
#endif
#ifdef XTMAINLOOP
#include "ivyxtloop.h"
-#else
+#endif
+#ifdef GTKMAINLOOP
+#include "ivygtkloop.h"
+#endif
+#ifdef IVYMAINLOOP
#include "ivyloop.h"
#endif
#include "ivysocket.h"
@@ -61,7 +73,11 @@ void HandleStdin (Channel channel, HANDLE fd, void *data)
if (!line) {
#ifdef XTMAINLOOP
IvyXtChannelClose (channel);
-#else
+#endif
+#ifdef GTKMAINLOOP
+ IvyGtkChannelClose(channel);
+#endif
+#ifdef IVYMAINLOOP
IvyChannelClose (channel);
IvyStop();
#endif
@@ -160,7 +176,11 @@ void ApplicationCallback (IvyClientPtr app, void *user_data, IvyApplicationEvent
if (app_count == wait_count)
#ifdef XTMAINLOOP
IvyXtChannelSetUp (0, NULL, NULL, HandleStdin);
-#else
+#endif
+#ifdef GTKMAINLLOP
+ IvyGtkChannelSetUp( 0, NULL, NULL, HandleStdin);
+#endif
+#ifdef IVYMAINLOOP
IvyChannelSetUp (0, NULL, NULL, HandleStdin);
#endif
break;
@@ -220,14 +240,18 @@ int main(int argc, char *argv[])
if (wait_count == 0)
#ifdef XTMAINLOOP
IvyXtChannelSetUp (0, NULL, NULL, HandleStdin);
-#else
+#endif
+#ifdef GTKMAINLOOP
+ IvyGtkChannelSetUp (0, NULL, NULL, HandleStdin);
+#endif
+#ifdef IVYMAINLOOP
IvyChannelSetUp (0, NULL, NULL, HandleStdin);
#endif
IvyStart (bus);
if (timer_test) {
-#ifndef XTMAINLOOP
+#ifdef IVYMAINLOOP
TimerRepeatAfter (TIMER_LOOP, 1000, TimerCall, (void*)1);
TimerRepeatAfter (5, 5000, TimerCall, (void*)5);
#endif
@@ -235,7 +259,11 @@ int main(int argc, char *argv[])
#ifdef XTMAINLOOP
XtAppMainLoop (cntx);
-#else
+#endif
+#ifdef GTKMAINLOOP
+ gtk_main();
+#endif
+#ifdef IVYMAINLOOP
IvyMainLoop (0);
#endif
return 0;