63
63
* Creates a new window and opens it.
64
64
* To check if the window was created properly, use the getValid() method.
65
* @param systemCocoa The associated system class to forward events to
66
* @param title The text shown in the title bar of the window.
67
* @param left The coordinate of the left edge of the window.
68
* @param top The coordinate of the top edge of the window.
69
* @param width The width the window.
70
* @param height The height the window.
71
* @param state The state the window is initially opened with.
72
* @param type The type of drawing context installed in this window.
73
* @param stereoVisual Stereo visual for quad buffered stereo.
74
* @param numOfAASamples Number of samples used for AA (zero if no AA)
65
* \param systemCocoa The associated system class to forward events to
66
* \param title The text shown in the title bar of the window.
67
* \param left The coordinate of the left edge of the window.
68
* \param top The coordinate of the top edge of the window.
69
* \param width The width the window.
70
* \param height The height the window.
71
* \param state The state the window is initially opened with.
72
* \param type The type of drawing context installed in this window.
73
* \param stereoVisual Stereo visual for quad buffered stereo.
74
* \param numOfAASamples Number of samples used for AA (zero if no AA)
77
GHOST_SystemCocoa *systemCocoa,
78
const STR_String& title,
83
GHOST_TWindowState state,
84
GHOST_TDrawingContextType type = GHOST_kDrawingContextTypeNone,
85
const bool stereoVisual = false,
86
const GHOST_TUns16 numOfAASamples = 0
77
GHOST_SystemCocoa *systemCocoa,
78
const STR_String& title,
83
GHOST_TWindowState state,
84
GHOST_TDrawingContextType type = GHOST_kDrawingContextTypeNone,
85
const bool stereoVisual = false,
86
const GHOST_TUns16 numOfAASamples = 0
96
96
* Returns indication as to whether the window is valid.
97
* @return The validity of the window.
97
* \return The validity of the window.
99
virtual bool getValid() const;
99
virtual bool getValid() const;
102
102
* Returns the associated NSWindow object
103
* @return The associated NSWindow object
103
* \return The associated NSWindow object
105
virtual void* getOSWindow() const;
105
virtual void *getOSWindow() const;
108
108
* Sets the title displayed in the title bar.
109
* @param title The title to display in the title bar.
109
* \param title The title to display in the title bar.
111
111
virtual void setTitle(const STR_String& title);
114
114
* Returns the title displayed in the title bar.
115
* @param title The title displayed in the title bar.
115
* \param title The title displayed in the title bar.
117
117
virtual void getTitle(STR_String& title) const;
120
120
* Returns the window rectangle dimensions.
121
121
* The dimensions are given in screen coordinates that are relative to the upper-left corner of the screen.
122
* @param bounds The bounding rectangle of the window.
122
* \param bounds The bounding rectangle of the window.
124
virtual void getWindowBounds(GHOST_Rect& bounds) const;
124
virtual void getWindowBounds(GHOST_Rect& bounds) const;
127
127
* Returns the client rectangle dimensions.
128
128
* The left and top members of the rectangle are always zero.
129
* @param bounds The bounding rectangle of the cleient area of the window.
129
* \param bounds The bounding rectangle of the cleient area of the window.
131
virtual void getClientBounds(GHOST_Rect& bounds) const;
131
virtual void getClientBounds(GHOST_Rect& bounds) const;
134
134
* Resizes client rectangle width.
135
* @param width The new width of the client area of the window.
135
* \param width The new width of the client area of the window.
137
virtual GHOST_TSuccess setClientWidth(GHOST_TUns32 width);
137
virtual GHOST_TSuccess setClientWidth(GHOST_TUns32 width);
140
140
* Resizes client rectangle height.
141
* @param height The new height of the client area of the window.
141
* \param height The new height of the client area of the window.
143
virtual GHOST_TSuccess setClientHeight(GHOST_TUns32 height);
143
virtual GHOST_TSuccess setClientHeight(GHOST_TUns32 height);
146
146
* Resizes client rectangle.
147
* @param width The new width of the client area of the window.
148
* @param height The new height of the client area of the window.
147
* \param width The new width of the client area of the window.
148
* \param height The new height of the client area of the window.
150
virtual GHOST_TSuccess setClientSize(GHOST_TUns32 width, GHOST_TUns32 height);
150
virtual GHOST_TSuccess setClientSize(GHOST_TUns32 width, GHOST_TUns32 height);
153
153
* Returns the state of the window (normal, minimized, maximized).
154
* @return The state of the window.
154
* \return The state of the window.
156
156
virtual GHOST_TWindowState getState() const;
159
159
* Sets the window "modified" status, indicating unsaved changes
160
* @param isUnsavedChanges Unsaved changes or not
161
* @return Indication of success.
160
* \param isUnsavedChanges Unsaved changes or not
161
* \return Indication of success.
163
163
virtual GHOST_TSuccess setModifiedState(bool isUnsavedChanges);
166
166
* Converts a point in screen coordinates to client rectangle coordinates
167
* @param inX The x-coordinate on the screen.
168
* @param inY The y-coordinate on the screen.
169
* @param outX The x-coordinate in the client rectangle.
170
* @param outY The y-coordinate in the client rectangle.
167
* \param inX The x-coordinate on the screen.
168
* \param inY The y-coordinate on the screen.
169
* \param outX The x-coordinate in the client rectangle.
170
* \param outY The y-coordinate in the client rectangle.
172
virtual void screenToClient(GHOST_TInt32 inX, GHOST_TInt32 inY, GHOST_TInt32& outX, GHOST_TInt32& outY) const;
172
virtual void screenToClient(GHOST_TInt32 inX, GHOST_TInt32 inY, GHOST_TInt32& outX, GHOST_TInt32& outY) const;
175
175
* Converts a point in screen coordinates to client rectangle coordinates
176
* @param inX The x-coordinate in the client rectangle.
177
* @param inY The y-coordinate in the client rectangle.
178
* @param outX The x-coordinate on the screen.
179
* @param outY The y-coordinate on the screen.
176
* \param inX The x-coordinate in the client rectangle.
177
* \param inY The y-coordinate in the client rectangle.
178
* \param outX The x-coordinate on the screen.
179
* \param outY The y-coordinate on the screen.
181
virtual void clientToScreen(GHOST_TInt32 inX, GHOST_TInt32 inY, GHOST_TInt32& outX, GHOST_TInt32& outY) const;
181
virtual void clientToScreen(GHOST_TInt32 inX, GHOST_TInt32 inY, GHOST_TInt32& outX, GHOST_TInt32& outY) const;
184
184
* Converts a point in screen coordinates to client rectangle coordinates
185
185
* but without the y coordinate conversion needed for ghost compatibility.
186
* @param inX The x-coordinate in the client rectangle.
187
* @param inY The y-coordinate in the client rectangle.
188
* @param outX The x-coordinate on the screen.
189
* @param outY The y-coordinate on the screen.
186
* \param inX The x-coordinate in the client rectangle.
187
* \param inY The y-coordinate in the client rectangle.
188
* \param outX The x-coordinate on the screen.
189
* \param outY The y-coordinate on the screen.
191
191
void clientToScreenIntern(GHOST_TInt32 inX, GHOST_TInt32 inY, GHOST_TInt32& outX, GHOST_TInt32& outY) const;
194
194
* Converts a point in screen coordinates to client rectangle coordinates,
195
195
* but without the y coordinate conversion needed for ghost compatibility.
196
* @param inX The x-coordinate in the client rectangle.
197
* @param inY The y-coordinate in the client rectangle.
198
* @param outX The x-coordinate on the screen.
199
* @param outY The y-coordinate on the screen.
196
* \param inX The x-coordinate in the client rectangle.
197
* \param inY The y-coordinate in the client rectangle.
198
* \param outX The x-coordinate on the screen.
199
* \param outY The y-coordinate on the screen.
201
201
void screenToClientIntern(GHOST_TInt32 inX, GHOST_TInt32 inY, GHOST_TInt32& outX, GHOST_TInt32& outY) const;
204
204
* Gets the screen the window is displayed in
205
* @return The NSScreen object
205
* \return The NSScreen object
207
NSScreen* getScreen();
207
NSScreen *getScreen();
210
210
* Sets the state of the window (normal, minimized, maximized).
211
* @param state The state of the window.
212
* @return Indication of success.
211
* \param state The state of the window.
212
* \return Indication of success.
214
214
virtual GHOST_TSuccess setState(GHOST_TWindowState state);
217
217
* Sets the order of the window (bottom, top).
218
* @param order The order of the window.
219
* @return Indication of success.
218
* \param order The order of the window.
219
* \return Indication of success.
221
221
virtual GHOST_TSuccess setOrder(GHOST_TWindowOrder order);
224
224
* Swaps front and back buffers of a window.
225
* @return A boolean success indicator.
225
* \return A boolean success indicator.
227
227
virtual GHOST_TSuccess swapBuffers();
230
230
* Updates the drawing context of this window. Needed
231
231
* whenever the window is changed.
232
* @return Indication of success.
232
* \return Indication of success.
234
234
GHOST_TSuccess updateDrawingContext();
237
237
* Activates the drawing context of this window.
238
* @return A boolean success indicator.
238
* \return A boolean success indicator.
240
240
virtual GHOST_TSuccess activateDrawingContext();
242
242
virtual void loadCursor(bool visible, GHOST_TStandardCursor cursor) const;
245
const GHOST_TabletData* GetTabletData()
246
{ return &m_tablet; }
245
const GHOST_TabletData *GetTabletData()
248
250
GHOST_TabletData& GetCocoaTabletData()
252
256
* Sets the progress bar value displayed in the window/application icon
253
* @param progress The progress % (0.0 to 1.0)
257
* \param progress The progress % (0.0 to 1.0)
255
259
virtual GHOST_TSuccess setProgressBar(float progress);