home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / ocl150a.zip / OCL / Samples / Balloons / Source / server.hpp < prev    next >
C/C++ Source or Header  |  1996-08-12  |  2KB  |  117 lines

  1. // Server.hpp (SERVER.EXE)
  2. // common header
  3.  
  4.  
  5. #define INCL_WIN
  6. #define INCL_DOS
  7.  
  8. #include <ocl.hpp>
  9. #include <OApp.hpp>
  10. #include <OPipeSvr.hpp>
  11. #include <ONSem.hpp>
  12. #include <OSlider.hpp>
  13. #include <OMsgs.hpp>
  14. #include <OBook.hpp>
  15. #include <OPMException.hpp>
  16.  
  17.  
  18. #include "..\Source\Balloons.hpp"
  19. #include "..\Source\Server.h"
  20.  
  21.  
  22.  
  23. // first page in book
  24.  
  25. typedef class CtrlPanel *pCtrlPanel;
  26.  
  27. class CtrlPanel 
  28.    : public OBookPage
  29. {
  30.  public:
  31.  
  32.    CtrlPanel()
  33.      : OBookPage("Control Panel", "Control Panel",
  34.                  ID_CONTROL, CONTROL_TXT1, FALSE, BKA_MAJOR)
  35.      {}
  36.  
  37.    ~CtrlPanel() {}
  38.    virtual PSZ isOfType() const { return("CtrlPanel");  } 
  39.  
  40.    BOOL OCommand(ULONG msg, MPARAM mp1, MPARAM mp2);
  41. };
  42.  
  43.  
  44. // second and third page in Book
  45.  
  46. typedef class NumSpeedControl *pNumSpeedControl;
  47.  
  48. class NumSpeedControl
  49.    : public OBookPage
  50. {
  51.  private:
  52.    BOOL     isSpeedCtrl;
  53.    OSlider  *slider;
  54.  
  55.  public:
  56.  
  57.    NumSpeedControl(BOOL speeder, PSZ Text)  // is it the speed page
  58.     : OBookPage(Text, Text, ID_NUM, NUM_TXT1, FALSE, BKA_MAJOR),
  59.       isSpeedCtrl(speeder)
  60.      {}
  61.  
  62.    ~NumSpeedControl() 
  63.      {
  64.       if (slider) delete slider;
  65.      }
  66.  
  67.    virtual PSZ isOfType() const { return("NumSpeedControl");  } 
  68.  
  69.    BOOL OCommand(ULONG msg, MPARAM mp1, MPARAM mp2);
  70. };
  71.  
  72.  
  73.  
  74. // pipe server
  75.  
  76. typedef class BPipeServer *pBPipeServer;
  77.  
  78. class BPipeServer : public OPipeSvr
  79. {
  80.  public:
  81.   BPipeServer();
  82.   virtual ~BPipeServer();
  83.  
  84.   virtual PSZ isOfType() const { return("BPipeServer");  } 
  85.  
  86.   void OPipeCommand(PVOID pvData);
  87. };
  88.  
  89.  
  90. typedef class BalloonServer *pBalloonServer;
  91.  
  92. class BalloonServer
  93.    : public OApp, 
  94.      public OBook,
  95.      public BPipeServer
  96. {
  97.  private:
  98.   ONSem           *svrSem;
  99.   CtrlPanel       firstPage;
  100.   NumSpeedControl secondPage;
  101.   NumSpeedControl thirdPage;
  102.  
  103.  public:
  104.   PIPEMSG         pipeMessage;
  105.  
  106.  
  107.   BalloonServer();
  108.   virtual ~BalloonServer();
  109.   virtual PSZ isOfType() const { return("BalloonServer");  } 
  110.  
  111.   void init();
  112.   BOOL OCommand(ULONG msg, MPARAM mp1, MPARAM mp2);
  113. };
  114.  
  115.  
  116. // end of source
  117.