Torque3D Documentation / _generateds / platformCursorController.h

platformCursorController.h

Engine/source/windowManager/platformCursorController.h

More...

Classes:

Detailed Description

  1
  2//-----------------------------------------------------------------------------
  3// Copyright (c) 2012 GarageGames, LLC
  4//
  5// Permission is hereby granted, free of charge, to any person obtaining a copy
  6// of this software and associated documentation files (the "Software"), to
  7// deal in the Software without restriction, including without limitation the
  8// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
  9// sell copies of the Software, and to permit persons to whom the Software is
 10// furnished to do so, subject to the following conditions:
 11//
 12// The above copyright notice and this permission notice shall be included in
 13// all copies or substantial portions of the Software.
 14//
 15// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 16// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 17// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 18// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 19// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
 20// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
 21// IN THE SOFTWARE.
 22//-----------------------------------------------------------------------------
 23
 24#ifndef _PLATFORMCURSORCONTROLLER_H_
 25#define _PLATFORMCURSORCONTROLLER_H_
 26
 27#ifndef _TVECTOR_H_
 28#include "core/util/tVector.h"
 29#endif
 30
 31class PlatformWindow;
 32
 33class PlatformCursorController
 34{
 35protected:
 36
 37   struct Cursor_Shape
 38   {
 39      enum Type
 40      {
 41         TYPE_RESOURCE,
 42         TYPE_FILE,
 43      };
 44
 45      Type   mCursorType;
 46      S32    mCursorID;   // Points to a platform specific cursor ID
 47      String mCursorFile; // Points to a custom cursor file
 48   };
 49
 50   Vector<Cursor_Shape> mCursors;
 51
 52   /// The PlatformWindow that owns this Cursor Controller
 53   PlatformWindow *mOwner;
 54
 55public:
 56
 57   PlatformCursorController( PlatformWindow *owner ) :
 58      mOwner( owner )
 59   {
 60      VECTOR_SET_ASSOCIATION( mCursors );
 61   };
 62
 63   virtual ~PlatformCursorController()
 64   {
 65      mOwner = NULL;
 66   };
 67
 68   enum 
 69   {
 70      curArrow = 0,
 71      curWait,
 72      curPlus,
 73      curResizeVert,
 74      curResizeHorz,
 75      curResizeAll,
 76      curIBeam,
 77      curResizeNESW,
 78      curResizeNWSE,
 79      curHand,
 80      curWaitArrow,
 81      curNoNo,
 82      numPlatformCursors
 83   };
 84
 85public:
 86
 87   virtual void setCursorPosition(S32 x, S32 y) = 0;
 88   virtual void getCursorPosition( Point2I &point ) = 0;
 89   virtual void setCursorVisible( bool visible ) = 0;
 90   virtual bool isCursorVisible() = 0;
 91
 92   virtual void setCursorShape( const Cursor_Shape &shape, bool reload );
 93   virtual void setCursorShape( U32 cursorID ) = 0;
 94   virtual void setCursorShape( const UTF8 *filename, bool reload ) = 0;
 95
 96   virtual void pushCursor( S32 cursorID );
 97   virtual void pushCursor( const UTF8 *fileName );
 98   virtual void popCursor();
 99   virtual void refreshCursor();
100
101   virtual U32 getDoubleClickTime() = 0;
102   virtual S32 getDoubleClickWidth() = 0;
103   virtual S32 getDoubleClickHeight() = 0;
104};
105
106#endif
107