From 09f4adbc91893a5ec938eeb0b5a317f38e6c4b7b Mon Sep 17 00:00:00 2001 From: bothorel Date: Wed, 19 Jan 2000 19:07:12 +0000 Subject: *** empty log message *** --- src/ivygtkloop.h | 55 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ src/ivyprobe.c | 40 ++++++++++++++++++++++++++++++++++------ 2 files changed, 89 insertions(+), 6 deletions(-) create mode 100644 src/ivygtkloop.h (limited to 'src') 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 + * + * $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 +#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 #include @@ -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; -- cgit v1.1