00001 #ifndef __RE_NTServer__
00002 #define __RE_NTServer__
00003
00004 #include "RE_API.h"
00005 #include "RE_Types.h"
00006 #include "RE_Server.h"
00007 #include <UT/UT_RefArray.h>
00008 #include <UT/UT_Rect.h>
00009
00010 class RE_API RE_NTServer : public RE_Server
00011 {
00012 public:
00013 RE_NTServer();
00014 virtual ~RE_NTServer();
00015
00016 virtual char initServer(char *data = 0);
00017 virtual void flush() const;
00018
00019 int getColorBits() const{ return scrcolorbits; }
00020 virtual short getWidth() const { return scrwidth; }
00021 virtual short getHeight() const { return scrheight; }
00022 virtual short getWidthMM() const { return scrwidthmm; }
00023 virtual short getHeightMM() const { return scrheightmm; }
00024
00025 virtual int getDragTolX() const { return scrdragtol[0]; }
00026 virtual int getDragTolY() const { return scrdragtol[1]; }
00027
00028 virtual UT_DimRect getWorkArea();
00029
00030 virtual bool GLMakeCurrent( OGLDrawable draw,
00031 RE_OGLContext context );
00032 virtual int GLMakeCopyCurrent( OGLDrawable draw,
00033 RE_OGLContext sourceContext,
00034 RE_OGLContext targetContext );
00035 virtual void GLSwapBuffers(RE_Window *currentWindow);
00036 virtual OGLDrawable GLGetCurrentDrawable();
00037 virtual void GLWaitGL();
00038
00039 static HINSTANCE getHInst() { return hInst; }
00040 static void setHInst( HINSTANCE newhInst ) { hInst = newhInst; }
00041
00042 void redirectEvents(const OGLWindow from, const OGLWindow to);
00043 void stopRedirectingEvents(const OGLWindow from, const OGLWindow to);
00044 int redirectEventWindow( MSG &message );
00045 RE_IDType getRedirectToWindow() { return myRedirectTo; }
00046 void findLocation(OGLWindow wid,
00047 short *x, short *y, short *w, short *h,
00048 short *_leftBorder = NULL,
00049 short *_rightBorder = NULL,
00050 short *_bottomBorder = NULL,
00051 short *_topBorder = NULL, char topMostParent = 0);
00052
00053 virtual bool windowUnderCursor(RE_IDType, int x, int y);
00054
00055 virtual bool getColorUnderCursor(float color[3]);
00056
00057 protected:
00058 private:
00059 UT_RefArray<OGLWindow> myRedirectFroms;
00060 OGLWindow myRedirectTo;
00061 int scrcolorbits;
00062 int scrwidth;
00063 int scrheight;
00064 int scrwidthmm;
00065 int scrheightmm;
00066 int scrdragtol[2];
00067 short xTo;
00068 short yTo;
00069 short widthTo;
00070 short heightTo;
00071 short lbTo;
00072 short rbTo;
00073 short bbTo;
00074 short tbTo;
00075 int toHasFocus;
00076
00077 static HINSTANCE hInst;
00078 };
00079
00080 #endif