00001 #ifndef __RE_NTWindow_h__
00002 #define __RE_NTWindow_h__
00003
00004 #include "RE_API.h"
00005 #include <UT/UT_SysClone.h>
00006 #include <UT/UT_String.h>
00007 #include "RE_Types.h"
00008 #include "RE_Window.h"
00009 #include "RE_NTServer.h"
00010
00011 #define RE_NTWINDOWNAMELEN 256
00012 #define WM_DOWINDOWCREATE WM_USER+WM_USER+1
00013 #define WM_DOWINDOWDESTROY WM_USER+WM_USER+2
00014 #define WM_DOACTIVATEWINDOW WM_USER+WM_USER+3
00015
00016 class RE_DIBSection;
00017
00018 class RE_API RE_NTWindowCreate
00019 {
00020 public:
00021 DWORD myExStyle;
00022 LPCTSTR myClassName;
00023 LPCTSTR myWindowName;
00024 DWORD myStyle;
00025 int myX;
00026 int myY;
00027 int myWidth;
00028 int myHeight;
00029 HWND myWndParent;
00030 HMENU myMenu;
00031 HINSTANCE myInstance;
00032 LPVOID myParam;
00033 HWND myReturnID;
00034 };
00035
00036 class RE_API RE_NTWindow : public RE_Window
00037 {
00038 public:
00039 RE_NTWindow(RE_Server *newserver,
00040 RE_WindowType type,
00041 RE_VisualType visType = RE_NORMAL_VIS,
00042 RE_WindowVisibility doOffScreen = RE_WINDOW_VISIBLE,
00043 bool alwaysOnTop = false);
00044
00045 virtual ~RE_NTWindow();
00046
00047 virtual OGLDrawable getGraphicsDrawable() { return myGraphicsDrawable; }
00048 virtual void setGraphicsDrawable(OGLDrawable d) { myGraphicsDrawable = d; }
00049
00050 virtual OGLDrawable getAlternateDrawable() { return myAlternateDrawable; }
00051 virtual void setAlternateDrawable(OGLDrawable d) { myAlternateDrawable=d; }
00052
00053 virtual void initMaxSize( short w, short h );
00054 virtual void initMinSize( short w, short h );
00055 virtual void initClass( char *name, char *rclass );
00056 virtual void setName(const char *name);
00057 virtual void setIconName(const char *name);
00058
00059 virtual void reparentWindow( RE_Window *newParent );
00060
00061 virtual void moveWindow( short x, short y, int force = 1 );
00062 virtual void sizeWindow( short w, short h, int force = 1 );
00063 virtual void resizeWindow( short w, short h );
00064 virtual void moveAndSizeWindow(short x, short y, short w, short h,
00065 int force = 1);
00066
00067
00068
00069 virtual void maximizeWindow();
00070 virtual void restoreWindow();
00071
00072 virtual short getX() const { return size.left; }
00073 virtual short getY() const { return size.top; }
00074 virtual short getW() const { return size.right - size.left; }
00075 virtual short getH() const { return size.bottom - size.top; }
00076
00077 virtual void lowerWindow();
00078 virtual void raiseWindow();
00079
00080
00081
00082
00083 virtual void fullscreenWindow(bool full);
00084
00085 virtual void findLocation(short *x, short *y, short *w, short *h,
00086 char topMostParent = 0);
00087
00088 virtual RE_IDType openWindow( int isMain = 0, int show=1 );
00089 virtual void showWindow();
00090 virtual void closeWindow();
00091
00092 virtual void setWindowAlwaysOnTop(bool newstate);
00093
00094 virtual int overlayState(int state);
00095
00096 int isOverlayOn() const
00097 { return myOverlayOn; }
00098 int isChild() const
00099 { return myWindowType == RE_WINDOW_CHILD; }
00100 RE_Window *getParentWnd()
00101 { return parentWindow; }
00102
00103 static void setWindowCreationThread(DWORD id)
00104 { theWindowCreationThread = id; }
00105
00106 enum RE_NTBorderType
00107 {
00108 BORDERS_NONE,
00109 BORDERS_ALL
00110 };
00111 void setWindowBorderType(RE_NTBorderType bordertype);
00112
00113 virtual void setParentOfTransient(RE_IDType transient);
00114 virtual RE_IDType getParentOfTransient();
00115
00116 void setCursor(void *cursor) { myCursor = cursor; }
00117
00118
00119 void resetWindowSize();
00120 void adjustVerticalSize(int top, int bot);
00121 protected:
00122
00123
00124 void setBordersByWindowType();
00125
00126 BOOL RegisterWindowClass();
00127
00128 RE_DIBSection *myOffscreenBitmap;
00129 UT_String myName;
00130 UT_String myIconName;
00131 OGLDrawable myGraphicsDrawable;
00132 OGLDrawable myAlternateDrawable;
00133 UT_Bool myOverlayOn;
00134 RECT size;
00135 POINT minsize, maxsize;
00136 POINT oldsize, oldpos;
00137 void *myCursor;
00138 unsigned long myExStyle;
00139 unsigned long myStyle;
00140
00141 static int theSystemBorderLeftSize;
00142 static int theSystemBorderRightSize;
00143 static int theSystemBorderTopSize;
00144 static int theSystemBorderBottomSize;
00145
00146 static DWORD theWindowCreationThread;
00147 static BOOL bClassRegistered;
00148 static char szClassName[];
00149 static char szOverlayClassName[];
00150
00151 static LRESULT CALLBACK WindowProc( HWND hwnd, UINT uMsg,
00152 WPARAM wParam, LPARAM lParam );
00153 };
00154
00155 #endif