Blender  V2.59
GHOST_IWindow.h
Go to the documentation of this file.
00001 /*
00002  * $Id: GHOST_IWindow.h 35152 2011-02-25 11:28:33Z jesterking $
00003  * ***** BEGIN GPL LICENSE BLOCK *****
00004  *
00005  * This program is free software; you can redistribute it and/or
00006  * modify it under the terms of the GNU General Public License
00007  * as published by the Free Software Foundation; either version 2
00008  * of the License, or (at your option) any later version.
00009  *
00010  * This program is distributed in the hope that it will be useful,
00011  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00012  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00013  * GNU General Public License for more details.
00014  *
00015  * You should have received a copy of the GNU General Public License
00016  * along with this program; if not, write to the Free Software Foundation,
00017  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
00018  *
00019  * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
00020  * All rights reserved.
00021  *
00022  * The Original Code is: all of this file.
00023  *
00024  * Contributor(s): none yet.
00025  *
00026  * ***** END GPL LICENSE BLOCK *****
00027  */
00028 
00034 #ifndef _GHOST_IWINDOW_H_
00035 #define _GHOST_IWINDOW_H_
00036 
00037 #include "STR_String.h"
00038 #include "GHOST_Rect.h"
00039 #include "GHOST_Types.h"
00040 
00041 
00060 class GHOST_IWindow
00061 {
00062 public:
00066         virtual ~GHOST_IWindow()
00067         {
00068         }
00069 
00074         virtual bool getValid() const = 0;
00075 
00080         virtual void* getOSWindow() const = 0;
00081 
00086         virtual GHOST_TDrawingContextType getDrawingContextType() = 0;
00087 
00093         virtual GHOST_TSuccess setDrawingContextType(GHOST_TDrawingContextType type) = 0;
00094 
00099         virtual void setTitle(const STR_String& title) = 0;
00100 
00105         virtual void getTitle(STR_String& title) const = 0;
00106 
00112         virtual void getWindowBounds(GHOST_Rect& bounds) const = 0;
00113         
00119         virtual void getClientBounds(GHOST_Rect& bounds) const = 0;
00120 
00125         virtual GHOST_TSuccess setClientWidth(GHOST_TUns32 width) = 0;
00126 
00131         virtual GHOST_TSuccess setClientHeight(GHOST_TUns32 height) = 0;
00132 
00138         virtual GHOST_TSuccess setClientSize(GHOST_TUns32 width, GHOST_TUns32 height) = 0;
00139 
00147         virtual void screenToClient(GHOST_TInt32 inX, GHOST_TInt32 inY, GHOST_TInt32& outX, GHOST_TInt32& outY) const = 0;
00148 
00156         virtual void clientToScreen(GHOST_TInt32 inX, GHOST_TInt32 inY, GHOST_TInt32& outX, GHOST_TInt32& outY) const = 0;
00157 
00161         virtual void setAcceptDragOperation(bool canAccept) = 0;
00162         
00167         virtual bool canAcceptDragOperation() const = 0;
00168         
00173         virtual GHOST_TWindowState getState() const = 0;
00174 
00180         virtual GHOST_TSuccess setState(GHOST_TWindowState state) = 0;
00181 
00187         virtual GHOST_TSuccess setModifiedState(bool isUnsavedChanges) = 0;
00188         
00193         virtual bool getModifiedState() = 0;
00194         
00200         virtual GHOST_TSuccess setOrder(GHOST_TWindowOrder order) = 0;
00201 
00206         virtual GHOST_TSuccess swapBuffers() = 0;
00207 
00212         virtual GHOST_TSuccess activateDrawingContext() = 0;
00213 
00218         virtual GHOST_TSuccess invalidate() = 0;
00219         
00224         virtual GHOST_TUserDataPtr getUserData() const = 0;
00225         
00230         virtual void setUserData(const GHOST_TUserDataPtr userData) = 0;
00231         
00236         virtual const GHOST_TabletData* GetTabletData() = 0;
00237         
00238         /***************************************************************************************
00239          ** Progress bar functionality
00240          ***************************************************************************************/
00241         
00246         virtual GHOST_TSuccess setProgressBar(float progress) = 0;
00247         
00251         virtual GHOST_TSuccess endProgressBar() = 0;
00252         
00253         /***************************************************************************************
00254          ** Cursor management functionality
00255          ***************************************************************************************/
00256 
00261         virtual GHOST_TStandardCursor getCursorShape() const = 0;
00262 
00268         virtual GHOST_TSuccess setCursorShape(GHOST_TStandardCursor cursorShape) = 0;
00269 
00278         virtual GHOST_TSuccess setCustomCursorShape(GHOST_TUns8 bitmap[16][2], 
00279                                                                                                 GHOST_TUns8 mask[16][2], 
00280                                                                                                 int hotX, 
00281                                                                                                 int hotY) = 0;
00282                                                                                                 
00283         virtual GHOST_TSuccess setCustomCursorShape(GHOST_TUns8 *bitmap, 
00284                                                                                                 GHOST_TUns8 *mask, 
00285                                                                                                 int sizex, int sizey, 
00286                                                                                                 int hotX, int hotY, 
00287                                                                                                 int fg_color, int bg_color) = 0;
00288 
00293         virtual bool getCursorVisibility() const = 0;
00294 
00300         virtual GHOST_TSuccess setCursorVisibility(bool visible) = 0;
00301 
00307         virtual GHOST_TSuccess setCursorGrab(GHOST_TGrabCursorMode mode, GHOST_Rect *bounds) { return GHOST_kSuccess; };
00308 
00309 #ifdef WITH_CXX_GUARDEDALLOC
00310 public:
00311         void *operator new(size_t num_bytes) { return MEM_mallocN(num_bytes, "GHOST:GHOST_IWindow"); }
00312         void operator delete( void *mem ) { MEM_freeN(mem); }
00313 #endif
00314 };
00315 
00316 #endif // _GHOST_IWINDOW_H_
00317