HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
IMG_TileInetBuf.h
Go to the documentation of this file.
1 /*
2  * PROPRIETARY INFORMATION. This software is proprietary to
3  * Side Effects Software Inc., and is not to be reproduced,
4  * transmitted, or disclosed in any way without written permission.
5  *
6  * NAME: IMG library internet socket interface (C++)
7  *
8  * COMMENTS: This provides a shared memory interface for read/write
9  * of tiles generated by Mantra. Mantra will write to
10  * the buffer and flag it as readable. Until the buffer
11  * has been read, the buffer is flagged as "non-writable".
12  */
13 
14 #ifndef __IMG_TileInetBuf_h__
15 #define __IMG_TileInetBuf_h__
16 
17 #include "IMG_API.h"
18 #include <UT/UT_SysClone.h>
19 #include <UT/UT_NetSocket.h>
20 #include "IMG_TileBuffer.h"
21 
22 class UT_String;
23 
25 public:
26  IMG_TileInetBuf( char *host = NULL, UT_NetSocket *theServer = NULL,
27  int port = 0 );
28 
29  ~IMG_TileInetBuf();
30 
31  virtual int getTileWidth() const { return myTW; }
32  virtual int getTileHeight() const { return myTH; }
33 
34  virtual void setQuitFlag(int val=1);
35  virtual int getQuitFlag() const;
36 
37  virtual void setMouseXY(int x, int y)
38  { myMX = x; myMY = y; };
39  virtual void getMouseXY(int &x, int &y) const
40  { x = myMX; y = myMY; };
41 
42  virtual int canWriteTile() const;
43  virtual int canReadTile() const;
44 
45  virtual void writeTile(int xl, int xr, int yb, int yt,
46  const void *data);
47  virtual void readTile(IMG_Raster &rp, int *coords=0);
48  virtual void getKeyString( char *str );
49 
50  int getPort()
51  {
52  return myInetSocket ? myInetSocket->getPort() : 0;
53  }
54  void getStartupCommand( UT_String &cmd );
55  void sendStartupCommand( int pid, int x, int y,
56  int w, int h );
57 
58  int promptRetry();
59 
60  static int getServerPort();
61 
62 protected:
63  virtual void setTileSize(int w, int h)
64  {
65  myTW = w; myTH = h;
66  }
67 
68 private:
69  int myTW, myTH, myQuitFlag;
70  int myMX, myMY;
71  int myTotalData, myDataSoFar;
72  UT_NetSocket *myInetSocket;
73 };
74 
75 #endif
virtual void getKeyString(char *str)=0
virtual int getTileHeight() const
virtual int canReadTile() const =0
GLint y
Definition: glcorearb.h:102
virtual void getMouseXY(int &x, int &y) const
virtual void setTileSize(int w, int h)
#define IMG_API
Definition: IMG_API.h:10
virtual void writeTile(int xl, int xr, int yb, int yt, const void *data)=0
GLboolean * data
Definition: glcorearb.h:130
virtual int getQuitFlag() const =0
virtual void setMouseXY(int x, int y)
GLfloat GLfloat GLfloat GLfloat h
Definition: glcorearb.h:2001
virtual int canWriteTile() const =0
virtual void readTile(IMG_Raster &rp, int *coords=0)=0
GLint GLenum GLint x
Definition: glcorearb.h:408
GLuint GLfloat * val
Definition: glcorearb.h:1607
virtual void setQuitFlag(int val=1)=0
GLubyte GLubyte GLubyte GLubyte w
Definition: glcorearb.h:856
virtual int getTileWidth() const