00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #ifndef __RE_OSXWindow__
00020 #define __RE_OSXWindow__
00021
00022 #include "RE_API.h"
00023 #include "RE_Types.h"
00024 #include "RE_Window.h"
00025 #include <UT/UT_String.h>
00026 #include <UT/UT_MBSDUtil.h>
00027
00028 #include <ApplicationServices/ApplicationServices.h>
00029
00030 class RE_API RE_OSXWindow : public RE_Window
00031 {
00032 public:
00033 RE_OSXWindow(RE_Server *server,
00034 RE_WindowType type,
00035 RE_VisualType visType = RE_NORMAL_VIS,
00036 RE_WindowVisibility doOffScreen = RE_WINDOW_VISIBLE,
00037 bool alwaysOnTop = false);
00038
00039 virtual ~RE_OSXWindow();
00040
00041 virtual void setName(const char *name);
00042 virtual void setIconName(const char *name);
00043
00044 virtual void reparentWindow( RE_Window *newParent );
00045
00046 virtual void setParentOfTransient(RE_IDType transient);
00047 virtual RE_IDType getParentOfTransient();
00048
00049 virtual RE_IDType openWindow( int isMain, int show=1 );
00050 virtual void showWindow();
00051 virtual void closeWindow();
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
00057
00058
00059
00060 virtual void moveWindow( short x, short y, int force = 1 );
00061 virtual void sizeWindow( short w, short h, int force = 1 );
00062 virtual void resizeWindow( short w, short h );
00063 virtual void moveAndSizeWindow(short x, short y, short w, short h,
00064 int force = 1 );
00065
00066
00067 void updatePositionAndSize();
00068
00069
00070
00071
00072 virtual void maximizeWindow();
00073 virtual void restoreWindow();
00074
00075
00076
00077
00078
00079 virtual void fullscreenWindow(bool full);
00080
00081 virtual short getX() const;
00082 virtual short getY() const;
00083 virtual short getW() const;
00084 virtual short getH() const;
00085
00086 virtual void lowerWindow();
00087 virtual void raiseWindow();
00088
00089 virtual void findLocation(short *x, short *y, short *w, short *h,
00090 char topMostParent);
00091
00092
00093
00094 virtual void setWindowAlwaysOnTop(bool newstate);
00095 virtual void setWindowAlwaysOnTopAndHideWhenInactive(bool newstate);
00096
00097 virtual RE_IDType getBufferID() const;
00098
00099 virtual OGLDrawable getGraphicsDrawable();
00100 virtual OGLDrawable getAlternateDrawable();
00101
00102 private:
00103 CGRect childFrameInScreenSpace();
00104 void updateWindowBorders();
00105
00106 CFStringRef myName;
00107 UT_ObjCRef myFullScreenSavedWindow;
00108 CGRect myContentFrame;
00109 CGSize myMinSize;
00110 CGSize myMaxSize;
00111 };
00112
00113 #endif