Blender  V2.93
GHOST_ISystem.h
Go to the documentation of this file.
1 /*
2  * This program is free software; you can redistribute it and/or
3  * modify it under the terms of the GNU General Public License
4  * as published by the Free Software Foundation; either version 2
5  * of the License, or (at your option) any later version.
6  *
7  * This program is distributed in the hope that it will be useful,
8  * but WITHOUT ANY WARRANTY; without even the implied warranty of
9  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10  * GNU General Public License for more details.
11  *
12  * You should have received a copy of the GNU General Public License
13  * along with this program; if not, write to the Free Software Foundation,
14  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
15  *
16  * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
17  * All rights reserved.
18  */
19 
27 #pragma once
28 
29 #include <stdlib.h>
30 
31 #include "GHOST_IContext.h"
32 #include "GHOST_ITimerTask.h"
33 #include "GHOST_IWindow.h"
34 #include "GHOST_Types.h"
35 
37 
133  public:
138  static GHOST_TSuccess createSystem();
139 
144  static GHOST_TSuccess disposeSystem();
145 
150  static GHOST_ISystem *getSystem();
151 
152  protected:
158  {
159  }
160 
165  virtual ~GHOST_ISystem()
166  {
167  }
168 
169  public:
170  /***************************************************************************************
171  * Time(r) functionality
172  ***************************************************************************************/
173 
180  virtual GHOST_TUns64 getMilliSeconds() const = 0;
181 
193  GHOST_TUns64 interval,
194  GHOST_TimerProcPtr timerProc,
195  GHOST_TUserDataPtr userData = NULL) = 0;
196 
202  virtual GHOST_TSuccess removeTimer(GHOST_ITimerTask *timerTask) = 0;
203 
204  /***************************************************************************************
205  * Display/window management functionality
206  ***************************************************************************************/
207 
212  virtual GHOST_TUns8 getNumDisplays() const = 0;
213 
219 
225 
244  virtual GHOST_IWindow *createWindow(const char *title,
251  GHOST_GLSettings glSettings,
252  const bool exclusive = false,
253  const bool is_dialog = false,
254  const GHOST_IWindow *parentWindow = NULL) = 0;
255 
262 
269 
276 
282  virtual bool validWindow(GHOST_IWindow *window) = 0;
283 
292  GHOST_IWindow **window,
293  const bool stereoVisual,
294  const bool alphaBackground = 0) = 0;
295 
304  GHOST_IWindow **window) = 0;
305 
310  virtual GHOST_TSuccess endFullScreen(void) = 0;
311 
316  virtual bool getFullScreen(void) = 0;
317 
321  virtual bool useNativePixel(void) = 0;
322 
326  virtual void useWindowFocus(const bool use_focus) = 0;
327 
328  /***************************************************************************************
329  * Event management functionality
330  ***************************************************************************************/
331 
337  virtual bool processEvents(bool waitForEvent) = 0;
338 
342  virtual void dispatchEvents() = 0;
343 
350 
357 
358  /***************************************************************************************
359  * Cursor management functionality
360  ***************************************************************************************/
361 
369 
378 
379  /***************************************************************************************
380  * Access to mouse button and keyboard states.
381  ***************************************************************************************/
382 
390 
397  virtual GHOST_TSuccess getButtonState(GHOST_TButtonMask mask, bool &isDown) const = 0;
398 
403  virtual void setTabletAPI(GHOST_TTabletAPI api) = 0;
404 
405 #ifdef WITH_INPUT_NDOF
410  virtual void setNDOFDeadZone(float deadzone) = 0;
411 #endif
412 
423  virtual int toggleConsole(int action) = 0;
424 
425  /***************************************************************************************
426  * Access to clipboard.
427  ***************************************************************************************/
428 
434  virtual GHOST_TUns8 *getClipboard(bool selection) const = 0;
435 
439  virtual void putClipboard(GHOST_TInt8 *buffer, bool selection) const = 0;
440 
441  /***************************************************************************************
442  * System Message Box.
443  ***************************************************************************************/
444 
455  virtual GHOST_TSuccess showMessageBox(const char * /*title*/,
456  const char * /*message*/,
457  const char * /*help_label*/,
458  const char * /*continue_label*/,
459  const char * /*link*/,
460  GHOST_DialogOptions /*dialog_options*/) const = 0;
461 
462  /***************************************************************************************
463  * Debugging
464  ***************************************************************************************/
465 
469  virtual void initDebug(bool is_debug_enabled) = 0;
470 
474  virtual bool isDebugEnabled() = 0;
475 
476  protected:
481  virtual GHOST_TSuccess init() = 0;
482 
487  virtual GHOST_TSuccess exit() = 0;
488 
491 
492 #ifdef WITH_CXX_GUARDEDALLOC
493  MEM_CXX_CLASS_ALLOC_FUNCS("GHOST:GHOST_ISystem")
494 #endif
495 };
GHOST_TWindowState
Definition: GHOST_Types.h:144
void * GHOST_TUserDataPtr
Definition: GHOST_Types.h:89
unsigned int GHOST_TUns32
Definition: GHOST_Types.h:64
unsigned long long GHOST_TUns64
Definition: GHOST_Types.h:86
void(* GHOST_TimerProcPtr)(struct GHOST_TimerTaskHandle__ *task, GHOST_TUns64 time)
Definition: GHOST_Types.h:608
int GHOST_TInt32
Definition: GHOST_Types.h:63
GHOST_TDrawingContextType
Definition: GHOST_Types.h:156
GHOST_TButtonMask
Definition: GHOST_Types.h:164
char GHOST_TInt8
Definition: GHOST_Types.h:59
GHOST_TSuccess
Definition: GHOST_Types.h:91
GHOST_TModifierKeyMask
Definition: GHOST_Types.h:133
unsigned char GHOST_TUns8
Definition: GHOST_Types.h:60
GHOST_TTabletAPI
Definition: GHOST_Types.h:106
GHOST_DialogOptions
Definition: GHOST_Types.h:76
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum const void *lists _GL_VOID_RET _GL_VOID const GLdouble *equation _GL_VOID_RET _GL_VOID GLdouble GLdouble blue _GL_VOID_RET _GL_VOID GLfloat GLfloat blue _GL_VOID_RET _GL_VOID GLint GLint blue _GL_VOID_RET _GL_VOID GLshort GLshort blue _GL_VOID_RET _GL_VOID GLubyte GLubyte blue _GL_VOID_RET _GL_VOID GLuint GLuint blue _GL_VOID_RET _GL_VOID GLushort GLushort blue _GL_VOID_RET _GL_VOID GLbyte GLbyte GLbyte alpha _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble alpha _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat alpha _GL_VOID_RET _GL_VOID GLint GLint GLint alpha _GL_VOID_RET _GL_VOID GLshort GLshort GLshort alpha _GL_VOID_RET _GL_VOID GLubyte GLubyte GLubyte alpha _GL_VOID_RET _GL_VOID GLuint GLuint GLuint alpha _GL_VOID_RET _GL_VOID GLushort GLushort GLushort alpha _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLint GLsizei width
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum type
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei height
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum const void *lists _GL_VOID_RET _GL_VOID const GLdouble *equation _GL_VOID_RET _GL_VOID GLdouble GLdouble blue _GL_VOID_RET _GL_VOID GLfloat GLfloat blue _GL_VOID_RET _GL_VOID GLint GLint blue _GL_VOID_RET _GL_VOID GLshort GLshort blue _GL_VOID_RET _GL_VOID GLubyte GLubyte blue _GL_VOID_RET _GL_VOID GLuint GLuint blue _GL_VOID_RET _GL_VOID GLushort GLushort blue _GL_VOID_RET _GL_VOID GLbyte GLbyte GLbyte alpha _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble alpha _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat alpha _GL_VOID_RET _GL_VOID GLint GLint GLint alpha _GL_VOID_RET _GL_VOID GLshort GLshort GLshort alpha _GL_VOID_RET _GL_VOID GLubyte GLubyte GLubyte alpha _GL_VOID_RET _GL_VOID GLuint GLuint GLuint alpha _GL_VOID_RET _GL_VOID GLushort GLushort GLushort alpha _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLint y
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum const void *lists _GL_VOID_RET _GL_VOID const GLdouble *equation _GL_VOID_RET _GL_VOID GLdouble GLdouble blue _GL_VOID_RET _GL_VOID GLfloat GLfloat blue _GL_VOID_RET _GL_VOID GLint GLint blue _GL_VOID_RET _GL_VOID GLshort GLshort blue _GL_VOID_RET _GL_VOID GLubyte GLubyte blue _GL_VOID_RET _GL_VOID GLuint GLuint blue _GL_VOID_RET _GL_VOID GLushort GLushort blue _GL_VOID_RET _GL_VOID GLbyte GLbyte GLbyte alpha _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble alpha _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat alpha _GL_VOID_RET _GL_VOID GLint GLint GLint alpha _GL_VOID_RET _GL_VOID GLshort GLshort GLshort alpha _GL_VOID_RET _GL_VOID GLubyte GLubyte GLubyte alpha _GL_VOID_RET _GL_VOID GLuint GLuint GLuint alpha _GL_VOID_RET _GL_VOID GLushort GLushort GLushort alpha _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLint GLsizei GLsizei GLenum type _GL_VOID_RET _GL_VOID GLsizei GLenum GLenum const void *pixels _GL_VOID_RET _GL_VOID const void *pointer _GL_VOID_RET _GL_VOID GLdouble v _GL_VOID_RET _GL_VOID GLfloat v _GL_VOID_RET _GL_VOID GLint GLint i2 _GL_VOID_RET _GL_VOID GLint j _GL_VOID_RET _GL_VOID GLfloat param _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble top
virtual GHOST_TUns8 * getClipboard(bool selection) const =0
virtual void getMainDisplayDimensions(GHOST_TUns32 &width, GHOST_TUns32 &height) const =0
static GHOST_ISystem * getSystem()
virtual GHOST_TSuccess showMessageBox(const char *, const char *, const char *, const char *, const char *, GHOST_DialogOptions) const =0
virtual GHOST_TUns8 getNumDisplays() const =0
virtual GHOST_TUns64 getMilliSeconds() const =0
virtual void setTabletAPI(GHOST_TTabletAPI api)=0
virtual GHOST_TSuccess beginFullScreen(const GHOST_DisplaySetting &setting, GHOST_IWindow **window, const bool stereoVisual, const bool alphaBackground=0)=0
virtual void getAllDisplayDimensions(GHOST_TUns32 &width, GHOST_TUns32 &height) const =0
virtual ~GHOST_ISystem()
virtual bool validWindow(GHOST_IWindow *window)=0
virtual GHOST_TSuccess getCursorPosition(GHOST_TInt32 &x, GHOST_TInt32 &y) const =0
virtual GHOST_IWindow * createWindow(const char *title, GHOST_TInt32 left, GHOST_TInt32 top, GHOST_TUns32 width, GHOST_TUns32 height, GHOST_TWindowState state, GHOST_TDrawingContextType type, GHOST_GLSettings glSettings, const bool exclusive=false, const bool is_dialog=false, const GHOST_IWindow *parentWindow=NULL)=0
virtual GHOST_TSuccess addEventConsumer(GHOST_IEventConsumer *consumer)=0
virtual GHOST_TSuccess exit()=0
virtual GHOST_TSuccess getButtonState(GHOST_TButtonMask mask, bool &isDown) const =0
virtual GHOST_IContext * createOffscreenContext(GHOST_GLSettings glSettings)=0
virtual bool isDebugEnabled()=0
virtual void useWindowFocus(const bool use_focus)=0
virtual GHOST_TSuccess disposeContext(GHOST_IContext *context)=0
virtual GHOST_TSuccess removeTimer(GHOST_ITimerTask *timerTask)=0
static GHOST_TSuccess disposeSystem()
virtual bool getFullScreen(void)=0
virtual GHOST_TSuccess setCursorPosition(GHOST_TInt32 x, GHOST_TInt32 y)=0
static GHOST_TSuccess createSystem()
virtual void dispatchEvents()=0
virtual GHOST_ITimerTask * installTimer(GHOST_TUns64 delay, GHOST_TUns64 interval, GHOST_TimerProcPtr timerProc, GHOST_TUserDataPtr userData=NULL)=0
virtual int toggleConsole(int action)=0
virtual void putClipboard(GHOST_TInt8 *buffer, bool selection) const =0
virtual GHOST_TSuccess endFullScreen(void)=0
static GHOST_ISystem * m_system
virtual GHOST_TSuccess updateFullScreen(const GHOST_DisplaySetting &setting, GHOST_IWindow **window)=0
virtual GHOST_TSuccess getModifierKeyState(GHOST_TModifierKeyMask mask, bool &isDown) const =0
virtual bool useNativePixel(void)=0
virtual GHOST_TSuccess disposeWindow(GHOST_IWindow *window)=0
virtual void initDebug(bool is_debug_enabled)=0
virtual GHOST_TSuccess removeEventConsumer(GHOST_IEventConsumer *consumer)=0
virtual bool processEvents(bool waitForEvent)=0
virtual GHOST_TSuccess init()=0
__kernel void ccl_constant KernelData ccl_global void ccl_global char ccl_global int ccl_global char ccl_global unsigned int ccl_global float * buffer
static ulong state[N]
static int left
struct SELECTID_Context context
Definition: select_engine.c:47
ccl_device_inline float4 mask(const int4 &mask, const float4 &a)