InDesign SDK  20.5
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
ICursorUtils Class Referenceabstract

#include <ICursorUtils.h>

Inheritance diagram for ICursorUtils:
IPMUnknown

Public Types

enum  { kDefaultIID = IID_ICURSORUTILS }
 
enum  CursorOptions {
  kDefaultCursor = 0, kShowWidthHeight, kShowXPosition, kShowYPosition,
  kShowXYPosition, kShowLineLength, kShowScale, kShowRotation,
  kShowLiveCornerRadius, kShowWidth, kShowHeight, kShowZoomFactor
}
 

Public Member Functions

virtual void InitCursor (const CursorOptions option)=0
 
virtual void UpdateCursor (CursorSpec &adjustedCursorSpec) const =0
 
virtual void ReleaseCursor ()=0
 
virtual IGraphicsPortQueryGraphicsPortForBitmap (uchar *bitmapBuffer, uint32 bitmapWidth, uint32 bitmapHeight, bool16 hasAlpha, bool16 hiRes) const =0
 
virtual IGraphicsPortQueryGraphicsPortForBitmap (uchar *bitmapBuffer, uint32 bitmapWidth, uint32 bitmapHeight, bool16 hasAlpha, bool16 hiRes, float scaleFactor) const =0
 
- Public Member Functions inherited from IPMUnknown
virtual IPMUnknownQueryInterface (PMIID interfaceID) const =0
 
virtual void AddRef () const =0
 
virtual void Release () const =0
 

Detailed Description

ICursorUtils is a utility class used to create custom bitmap based cursors. Please use the ICursorUtils directly via the UtilsBoss if possible, see Utils.h: i.e. Utils<ICursorUtils>()->DrawStringIntoOffscreen( ... ) ;

Member Function Documentation

virtual void ICursorUtils::InitCursor (const CursorOptions option)
pure virtual

Initialize a new custom cursor that shows the current width/height of a sprite.

Parameters
option[IN]: Type of information you want updated and displayed dynamically within the cursor.
virtual IGraphicsPort* ICursorUtils::QueryGraphicsPortForBitmap (uchar * bitmapBuffer,
uint32 bitmapWidth,
uint32 bitmapHeight,
bool16 hasAlpha,
bool16 hiRes 
) const
pure virtual

Utility routine which creates a graphics port around a bitmap, so we can draw to it with AGM

Parameters
bitmapBuffer[IN]: pointer to the bitmap buffer to be used. Buffers length is width * height * 4;
bitmapWidth[IN]: width, in pixels, of the bitmap.
bitmapHeight[IN]: height, in pixels, of the bitmap.
hasAlpha[IN]: on input,the cursor to super-impose. On output, the new custom cursor.
hiRes[IN]: whether the bitmap is at regular 72dpi or high/retina resolution (144dpi), in which case the returned IGraphicsPort will be scaled accordingly.
Returns
pointer to an IGraphicsPort interface can be used to draw into the bitmapped buffer.
virtual IGraphicsPort* ICursorUtils::QueryGraphicsPortForBitmap (uchar * bitmapBuffer,
uint32 bitmapWidth,
uint32 bitmapHeight,
bool16 hasAlpha,
bool16 hiRes,
float scaleFactor 
) const
pure virtual
Utility routine which creates a graphics port around a bitmap, so we can draw to it with AGM

Parameters
bitmapBuffer[IN]: pointer to the bitmap buffer to be used. Buffers length is width * height * 4;
bitmapWidth[IN]: width, in pixels, of the bitmap.
bitmapHeight[IN]: height, in pixels, of the bitmap.
hasAlpha[IN]: on input,the cursor to super-impose. On output, the new custom cursor.
hiRes[IN]: whether the bitmap is at regular 72dpi or high/retina resolution (144dpi), in which case the returned IGraphicsPort will be scaled by passed scaleFactor.
Returns
pointer to an IGraphicsPort interface can be used to draw into the bitmapped buffer.
virtual void ICursorUtils::ReleaseCursor ()
pure virtual

Release any interfaces held due to calls to InitCursor and/or one of the Update methods.

virtual void ICursorUtils::UpdateCursor (CursorSpecadjustedCursorSpec) const
pure virtual

Create a new custom cursor showing the information specified by InitCursor of a sprite with the provided cursor superimposed on top-left of the new cursor.

Parameters
adjustedCursorSpec[IN/OUT]: on input,the cursor to super-impose. On output, the new custom cursor.