updates.
authorPekka Riikonen <priikone@silcnet.org>
Fri, 1 Feb 2002 16:42:41 +0000 (16:42 +0000)
committerPekka Riikonen <priikone@silcnet.org>
Fri, 1 Feb 2002 16:42:41 +0000 (16:42 +0000)
apps/silcer/src/silcerapp.hh
apps/silcer/src/silcerbasewin.hh
includes/silcincludes.h
lib/silcclient/README

index 64ea503626b6e484e34c870d7cf816fd4da79a58..8afc10a730b492359677b61e508d8ec14a49c0b6 100644 (file)
@@ -24,7 +24,6 @@
 #include "silcer_gladehelper.hh"
 
 extern "C" {
-#define CXX
 #include "silcincludes.h"
 #include "clientlibincludes.h"
 }
index fe60715fe7a7f96473d4bc17261b8d2e95a1fb3e..0b3270f33b89d312f025ab152475ab7a1b586e03 100644 (file)
@@ -23,7 +23,6 @@
 #include "silcer_gladehelper.hh"
 
 extern "C" {
-#define CXX
 #include "silcincludes.h"
 #include "clientlibincludes.h"
 }
index d553e9055ca6eb014fae8b15a90290a2d7ac8f84..b453686459d245f02483b6c7cb124ead604e222c 100644 (file)
@@ -223,8 +223,8 @@ typedef int32 int64;
 typedef uint32 * void *;
 #endif
 
+#ifndef __cplusplus
 #ifndef bool
-#ifndef CXX
 #define bool unsigned char
 #endif
 #endif
index 52a7c8122bd15dfffc0bcda7723015cba056d328..fef9e10ed1e23f2096b3d545e57f639c15370ed8 100644 (file)
@@ -1,7 +1,7 @@
 
                       SILC Client Library Manual
 
-                             Version 0.7
+                             Version 0.7.4
 
 1.0 Introduction
 
@@ -26,6 +26,23 @@ for sending channel and private messages, client and channel retrieval
 and other utility functions.
 
 
+1.0.1 Including Library Headers
+
+Your application must include the following includes in your sources to 
+get access all SILC Client Library routines:
+
+#include "silcincludes.h"
+#include "clientlibincludes.h"
+
+If you are compiling with C++ compiler then you need to include the 
+headers as follows:
+
+extern "C" {
+#include "silcincludes.h"
+#include "clientlibincludes.h"
+}
+
+
 1.1 Creating Client
 
 The client is context or entity based, so several client entitites can
@@ -113,6 +130,60 @@ this function.  For example before calling this function application
 should initialize the user interface.
 
 
+1.3.1 Running the Client in GUI application
+
+Many GUI applications has their own main loop or event loop, which they 
+would like to use or are forced to use by the underlaying system.  If you 
+are developing for example GUI application on Unix system, and you are 
+using GTK+ or QT as GUI library you would probably like to use their own 
+main loop.  SILC Client can be run under external main loop as well.  The 
+interface provides a function silc_client_run_one which will run the 
+client library once, and returns immediately.  During that running it can 
+process incoming data and send outgoing data, but it is guaranteed that it 
+will not block the calling process.
+
+It is suggested that you would call this function as many times in a 
+second as possible to provide smooth action for the client library.  You 
+can use an timeout task, or an idle task provided by your GUI library to 
+accomplish this.  After you have initialized the client library with 
+silc_client_init, you should register the timeout task or idle task that 
+will call the silc_client_run_one periodically.  In the Toolkit package 
+there is GTK-- GUI example in silcer/ directory.  That example calls the 
+silc_client_run_one every 50 milliseconds, and it should be sufficient for 
+smooth working.
+
+For Win32 the silc_client_run can be used instead of using the Windows's 
+own event loop.  However, if you would like to use the silc_client_run_one 
+also on Win32 systems it is possible.
+
+
+1.3.1.1 Running Client in GTK--
+
+Here is a short example how to run the SILC Client libary under the 
+Gnome/GTK--'s main loop:
+
+gint YourClass::silc_scheduler()
+{
+  // Run the SILC client once, and return immediately.  This function
+  // is called every 50 milliseconds by the Gnome main loop, to process
+  // SILC stuff.  This function will read data, and write data to network,
+  // etc.  Makes the client library tick! :)
+  silc_client_run_one(silc_client);
+  return 1;
+}
+
+then, during initialization of the SILC Client call:
+
+  // Setup SILC scheduler as timeout task. This will handle the SILC
+  // client library every 50 milliseconds.  It will actually make the
+  // SILC client work on background.
+  Gnome::Main::timeout.connect(slot(this, &YourClass::silc_scheduler), 50);
+
+This will call the function silc_scheduler every 50 millisecconds, which 
+on the otherhand will call silc_client_run_one, which will make the SILC 
+Client library work on the background of the GUI application.
+
+
 1.4 Creating Connection to Server
 
 Connection to remote SILC server is done by calling: