Blender V2.61 - r43446
|
00001 /* 00002 * ***** BEGIN GPL LICENSE BLOCK ***** 00003 * 00004 * This program is free software; you can redistribute it and/or 00005 * modify it under the terms of the GNU General Public License 00006 * as published by the Free Software Foundation; either version 2 00007 * of the License, or (at your option) any later version. 00008 * 00009 * This program is distributed in the hope that it will be useful, 00010 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00011 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00012 * GNU General Public License for more details. 00013 * 00014 * You should have received a copy of the GNU General Public License 00015 * along with this program; if not, write to the Free Software Foundation, 00016 * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 00017 * 00018 * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV. 00019 * All rights reserved. 00020 * 00021 * The Original Code is: all of this file. 00022 * 00023 * Contributor(s): none yet. 00024 * 00025 * ***** END GPL LICENSE BLOCK ***** 00026 */ 00027 00033 #ifndef _GHOST_IWINDOW_H_ 00034 #define _GHOST_IWINDOW_H_ 00035 00036 #include "STR_String.h" 00037 #include "GHOST_Rect.h" 00038 #include "GHOST_Types.h" 00039 00040 00059 class GHOST_IWindow 00060 { 00061 public: 00065 virtual ~GHOST_IWindow() 00066 { 00067 } 00068 00073 virtual bool getValid() const = 0; 00074 00079 virtual void* getOSWindow() const = 0; 00080 00085 virtual GHOST_TDrawingContextType getDrawingContextType() = 0; 00086 00092 virtual GHOST_TSuccess setDrawingContextType(GHOST_TDrawingContextType type) = 0; 00093 00098 virtual void setTitle(const STR_String& title) = 0; 00099 00104 virtual void getTitle(STR_String& title) const = 0; 00105 00111 virtual void getWindowBounds(GHOST_Rect& bounds) const = 0; 00112 00118 virtual void getClientBounds(GHOST_Rect& bounds) const = 0; 00119 00124 virtual GHOST_TSuccess setClientWidth(GHOST_TUns32 width) = 0; 00125 00130 virtual GHOST_TSuccess setClientHeight(GHOST_TUns32 height) = 0; 00131 00137 virtual GHOST_TSuccess setClientSize(GHOST_TUns32 width, GHOST_TUns32 height) = 0; 00138 00146 virtual void screenToClient(GHOST_TInt32 inX, GHOST_TInt32 inY, GHOST_TInt32& outX, GHOST_TInt32& outY) const = 0; 00147 00155 virtual void clientToScreen(GHOST_TInt32 inX, GHOST_TInt32 inY, GHOST_TInt32& outX, GHOST_TInt32& outY) const = 0; 00156 00160 virtual void setAcceptDragOperation(bool canAccept) = 0; 00161 00166 virtual bool canAcceptDragOperation() const = 0; 00167 00172 virtual GHOST_TWindowState getState() const = 0; 00173 00179 virtual GHOST_TSuccess setState(GHOST_TWindowState state) = 0; 00180 00186 virtual GHOST_TSuccess setModifiedState(bool isUnsavedChanges) = 0; 00187 00192 virtual bool getModifiedState() = 0; 00193 00199 virtual GHOST_TSuccess setOrder(GHOST_TWindowOrder order) = 0; 00200 00205 virtual GHOST_TSuccess swapBuffers() = 0; 00206 00211 virtual GHOST_TSuccess activateDrawingContext() = 0; 00212 00217 virtual GHOST_TSuccess invalidate() = 0; 00218 00223 virtual GHOST_TUserDataPtr getUserData() const = 0; 00224 00229 virtual void setUserData(const GHOST_TUserDataPtr userData) = 0; 00230 00235 virtual const GHOST_TabletData* GetTabletData() = 0; 00236 00237 /*************************************************************************************** 00238 ** Progress bar functionality 00239 ***************************************************************************************/ 00240 00245 virtual GHOST_TSuccess setProgressBar(float progress) = 0; 00246 00250 virtual GHOST_TSuccess endProgressBar() = 0; 00251 00252 /*************************************************************************************** 00253 ** Cursor management functionality 00254 ***************************************************************************************/ 00255 00260 virtual GHOST_TStandardCursor getCursorShape() const = 0; 00261 00267 virtual GHOST_TSuccess setCursorShape(GHOST_TStandardCursor cursorShape) = 0; 00268 00277 virtual GHOST_TSuccess setCustomCursorShape(GHOST_TUns8 bitmap[16][2], 00278 GHOST_TUns8 mask[16][2], 00279 int hotX, 00280 int hotY) = 0; 00281 00282 virtual GHOST_TSuccess setCustomCursorShape(GHOST_TUns8 *bitmap, 00283 GHOST_TUns8 *mask, 00284 int sizex, int sizey, 00285 int hotX, int hotY, 00286 int fg_color, int bg_color) = 0; 00287 00292 virtual bool getCursorVisibility() const = 0; 00293 00299 virtual GHOST_TSuccess setCursorVisibility(bool visible) = 0; 00300 00306 virtual GHOST_TSuccess setCursorGrab(GHOST_TGrabCursorMode mode, GHOST_Rect *bounds) { return GHOST_kSuccess; } 00307 00308 #ifdef WITH_CXX_GUARDEDALLOC 00309 public: 00310 void *operator new(size_t num_bytes) { return MEM_mallocN(num_bytes, "GHOST:GHOST_IWindow"); } 00311 void operator delete( void *mem ) { MEM_freeN(mem); } 00312 #endif 00313 }; 00314 00315 #endif // _GHOST_IWINDOW_H_ 00316