]> git.lyx.org Git - lyx.git/blobdiff - src/Server.h
forgot that
[lyx.git] / src / Server.h
index eed1ce01293cbe7de3842658611766a9e6339a16..0c595c861f5c687776603b3c82a02a4fe5605c3f 100644 (file)
@@ -4,7 +4,7 @@
  * This file is part of LyX, the document processor.
  * Licence details can be found in the file COPYING.
  *
- * \author Lars Gullik Bjønnes
+ * \author Lars Gullik Bjønnes
  * \author Jean-Marc Lasgouttes
  *
  * Full author contact details are available in file CREDITS.
@@ -38,12 +38,7 @@ public:
        typedef void (*ClientCallbackfct)(Server *, std::string const &);
 
        /// Construct with pipe-basename and callback to receive messages
-       LyXComm(std::string const & pip, Server * cli, ClientCallbackfct ccb = 0)
-               : pipename(pip), client(cli), clientcb(ccb)
-       {
-               ready = false;
-               openConnection();
-       }
+       LyXComm(std::string const & pip, Server * cli, ClientCallbackfct ccb = 0);
 
        ///
        ~LyXComm() { closeConnection(); }
@@ -77,26 +72,25 @@ private:
        void endPipe(int &, std::string const &, bool);
 
        /// This is -1 if not open
-       int infd;
+       int infd_;
 
        /// This is -1 if not open
-       int outfd;
+       int outfd_;
 
        /// Are we up and running?
-       bool ready;
+       bool ready_;
 
        /// Base of pipename including path
-       std::string pipename;
+       std::string pipename_;
 
        /// The client
-       Server * client;
+       Server * client_;
 
        /// The client callback function
-       ClientCallbackfct clientcb;
+       ClientCallbackfct clientcb_;
 };
 
 
-
 ///
 class Server {
 public:
@@ -111,32 +105,28 @@ public:
        // lyxserver is using a buffer that is being edited with a bufferview.
        // With a common buffer list this is not a problem, maybe. (Alejandro)
        ///
-       Server(LyXFunc * f, std::string const & pip)
-               : numclients(0), func(f), pipes(pip, (this), callback) {}
+       Server(LyXFunc * f, std::string const & pip);
        ///
        ~Server();
        ///
        void notifyClient(std::string const &);
 
        /// whilst crashing etc.
-       void emergencyCleanup() { pipes.emergencyCleanup(); }
+       void emergencyCleanup() { pipes_.emergencyCleanup(); }
+       ///
+       void callback(std::string const & msg);
 
 private:
-       ///
-       static void callback(Server *, std::string const & msg);
        /// Names and number of current clients
-       enum {
-               ///
-               MAX_CLIENTS = 10
-       };
+       enum { MAX_CLIENTS = 10 };
        ///
-       std::string clients[MAX_CLIENTS];
+       std::string clients_[MAX_CLIENTS];
        ///
-       int numclients;
+       int numclients_;
        ///
-       LyXFunc * func;
+       LyXFunc * func_;
        ///
-       LyXComm pipes;
+       LyXComm pipes_;
 };
 
 /// Implementation is in LyX.cpp