IBrushPresetContext Class Reference

IBrushPresetContext Class Referenceabstract

#include <IBrushPresets.h>

Class Description

Interface to a brush preset context.

A context represents a specific brush-based feature, defining a set of parameters used by the features and a UI. Context objects are responsible for creating and deleting the parameter set objects held by a brush preset, and for providing general information about the parameters. Contexts are required to communicate with the manager in the following ways: 1) Contexts should register themselves with the manager as soon as they loaded into memory, using IBrushPresetMgr::RegisterContext(). If the context plug-in is loaded before the manager plug-in, then the context can use a notification handler to register with the manager after system startup. 2) When a context is active, meaning its UI is displayed and ready to begin painting, the context should call IBrushPresetMgr::BeginContext(), and EndContext() when the context is deactivated. 3) When the user changes any parameter in the context's UI, the context should call IBrushPresetMgr::OnContextUpdated().
Implemented by the plug-in.

+ Inheritance diagram for IBrushPresetContext:

Public Member Functions

virtual ~IBrushPresetContext ()
 Destructor. More...
 
virtual Class_ID ContextID ()=0
 Returns the unique ID for the context. These ID numbers should be random, as per standard class IDs. More...
 
virtual const MCHARGetContextName ()=0
 Returns a name for the context. This is for UI display and may be localized. More...
 
virtual IBrushPresetParamsCreateParams ()=0
 Creates and returns a parameter set object of appropriate type for this context. More...
 
virtual void DeleteParams (IBrushPresetParams *params)=0
 Deletes a parameter set object created by this context. More...
 
virtual int GetNumParams ()=0
 Returns the number of individual parameters in a parameter set of this context. More...
 
virtual int GetParamID (int paramIndex)=0
 Translates the index number of a parameter value into the corresponding parameter ID. More...
 
virtual int GetParamIndex (int paramID)=0
 Translates the ID of a parameter value into the corresponding parameter index number. More...
 
virtual const MCHARGetParamName (int paramID)=0
 Returns the name of a parameter value. More...
 
virtual ParamType2 GetParamType (int paramID)=0
 Returns the type of a parameter value. More...
 
virtual int GetNumDisplayParams ()
 Returns the number of parameters that should be displayed in the brush preset manager dialog. More...
 
virtual int GetDisplayParamID (int displayIndex)
 Translates the index number of a display parameter into the corresponding parameter ID. More...
 
virtual int GetDisplayParamIndex (int paramID)
 Translates the ID of a parameter value into the corresponding display parameter index number. More...
 
virtual const MCHARGetDisplayParamName (int paramID)
 Returns the name of a display parameter. More...
 
virtual BOOL IsDisplayParam (int paramID)
 Returns whether the given parameter should be displayed in the brush preset manager dialog. More...
 
virtual BOOL IsTransientParam (int paramID)
 Returns whether the given parameter is transient. More...
 
virtual Class_ID PluginClassID ()=0
 Returns the class ID of a plug-in implemented in the same module as this context. More...
 
virtual SClass_ID PluginSuperClassID ()=0
 Returns the superclass ID of a plug-in implemented in the same module as this context. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from MaxHeapOperators
static UtilExport voidoperator new (size_t size)
 Standard new operator used to allocate objects If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new (size_t size, const std::nothrow_t &e)
 Standard new operator used to allocate objects if there is insufficient memory, NULL will be returned. More...
 
static UtilExport voidoperator new (size_t size, const char *filename, int line)
 New operator used to allocate objects that takes the filename and line number where the new was called If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new (size_t size, int block_type, const char *filename, int line)
 New operator used to allocate objects that takes the type of memory, filename and line number where the new was called If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new (size_t size, const std::nothrow_t &e, const char *filename, int line)
 New operator used to allocate objects that takes the filename and line number where the new was called If there is insufficient memory, NULL will be returned. More...
 
static UtilExport voidoperator new (size_t size, unsigned long flags)
 New operator used to allocate objects that takes extra flags to specify special operations If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new (size_t size, const std::nothrow_t &e, unsigned long flags)
 New operator used to allocate objects that takes extra flags to specify special operations If there is insufficient memory, NULL will be returned. More...
 
static UtilExport voidoperator new[] (size_t size)
 New operator used to allocate arrays of objects If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new[] (size_t size, const std::nothrow_t &e)
 New operator used to allocate arrays of objects If there is insufficient memory, NULL will be returned. More...
 
static UtilExport voidoperator new[] (size_t size, const char *filename, int line)
 New operator used to allocate arrays of objects If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new[] (size_t size, int block_type, const char *filename, int line)
 New operator used to allocate arrays of objects. More...
 
static UtilExport voidoperator new[] (size_t size, const std::nothrow_t &e, const char *filename, int line)
 New operator used to allocate arrays of objects If there is insufficient memory, NULL will be returned. More...
 
static UtilExport voidoperator new[] (size_t size, unsigned long flags)
 New operator used to allocate arrays of objects If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new[] (size_t size, const std::nothrow_t &e, unsigned long flags)
 New operator used to allocate arrays of objects If there is insufficient memory, NULL will be returned. More...
 
static UtilExport void operator delete (void *ptr)
 Standard delete operator used to deallocate an object If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete (void *ptr, const std::nothrow_t &e)
 Standard delete operator used to deallocate an object If the pointer is invalid, nothing will happen. More...
 
static UtilExport void operator delete (void *ptr, const char *filename, int line)
 Delete operator used to deallocate an object that takes the filename and line number where the delete was called If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete (void *ptr, int block_type, const char *filename, int line)
 Delete operator used to deallocate an object that takes the type of memory, filename and line number where the delete was called If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete (void *ptr, const std::nothrow_t &e, const char *filename, int line)
 Delete operator used to deallocate an object that takes the filename and line number where the delete was called If the pointer is invalid, nothing will happen. More...
 
static UtilExport void operator delete (void *ptr, unsigned long flags)
 Delete operator used to deallocate an object that takes extra flags to specify special operations If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete (void *ptr, const std::nothrow_t &e, unsigned long flags)
 Delete operator used to deallocate an object that takes extra flags to specify special operations If the pointer is invalid, nothing will happen. More...
 
static UtilExport void operator delete[] (void *ptr)
 Standard delete operator used to deallocate an array of objects If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete[] (void *ptr, const std::nothrow_t &e)
 Standard delete operator used to deallocate an array of objects If the pointer is invalid, nothing will happen. More...
 
static UtilExport void operator delete[] (void *ptr, const char *filename, int line)
 Delete operator used to deallocate an array of objects that takes the filename and line number where the delete was called If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete[] (void *ptr, int block_type, const char *filename, int line)
 Delete operator used to deallocate an array of objects that takes the type of memory, filename and line number where the delete was called If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete[] (void *ptr, const std::nothrow_t &e, const char *filename, int line)
 Delete operator used to deallocate an array of objects that takes the filename and line number where the delete was called If the pointer is invalid, nothing will happen. More...
 
static UtilExport void operator delete[] (void *ptr, unsigned long flags)
 Delete operator used to deallocate an array of objects that takes extra flags to specify special operations If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete[] (void *ptr, const std::nothrow_t &e, unsigned long flags)
 Delete operator used to deallocate an array of objects that takes extra flags to specify special operations If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport voidoperator new (size_t size, void *placement_ptr)
 Placement new operator. More...
 
static UtilExport void operator delete (void *ptr, void *placement_ptr)
 Placement delete operator. More...
 
static UtilExport voidaligned_malloc (size_t size, size_t alignment)
 Allocates memory on a specified alignment boundary. More...
 
static UtilExport voidaligned_realloc (void *ptr, size_t size, size_t alignment)
 Reallocates memory on a specified alignment boundary. More...
 
static UtilExport void aligned_free (void *ptr)
 Frees a block of memory that was allocated with aligned_malloc/aligned_realloc. More...
 

Constructor & Destructor Documentation

virtual ~IBrushPresetContext ( )
inlinevirtual

Destructor.

168 {;}

Member Function Documentation

virtual Class_ID ContextID ( )
pure virtual

Returns the unique ID for the context. These ID numbers should be random, as per standard class IDs.

virtual const MCHAR* GetContextName ( )
pure virtual

Returns a name for the context. This is for UI display and may be localized.

virtual IBrushPresetParams* CreateParams ( )
pure virtual

Creates and returns a parameter set object of appropriate type for this context.

virtual void DeleteParams ( IBrushPresetParams params)
pure virtual

Deletes a parameter set object created by this context.

This is called by the system when the user deletes a preset or at shutdown; the object passed is always a parameter set created previously by the context.

virtual int GetNumParams ( )
pure virtual

Returns the number of individual parameters in a parameter set of this context.

virtual int GetParamID ( int  paramIndex)
pure virtual

Translates the index number of a parameter value into the corresponding parameter ID.

Parameters
[in]paramIndexThe index of the parameter value
Returns
The parameter ID for the value, or zero if the index is out of range
virtual int GetParamIndex ( int  paramID)
pure virtual

Translates the ID of a parameter value into the corresponding parameter index number.

Parameters
[in]paramIDThe ID of the parameter value
Returns
The index of the parameter value, or -1 if there is no parameter with the given ID
virtual const MCHAR* GetParamName ( int  paramID)
pure virtual

Returns the name of a parameter value.

Parameters
[in]paramIDThe ID of the parameter value
virtual ParamType2 GetParamType ( int  paramID)
pure virtual

Returns the type of a parameter value.

Parameters
[in]paramIDThe ID of the parameter value
virtual int GetNumDisplayParams ( )
inlinevirtual

Returns the number of parameters that should be displayed in the brush preset manager dialog.

200 {return GetNumParams();}
virtual int GetNumParams()=0
Returns the number of individual parameters in a parameter set of this context.
virtual int GetDisplayParamID ( int  displayIndex)
inlinevirtual

Translates the index number of a display parameter into the corresponding parameter ID.

Parameters
[in]displayIndexThe index of the display parameter
Returns
The parameter ID for the value, or zero if the index is out of range
204 {return GetParamID(displayIndex);}
virtual int GetParamID(int paramIndex)=0
Translates the index number of a parameter value into the corresponding parameter ID...
virtual int GetDisplayParamIndex ( int  paramID)
inlinevirtual

Translates the ID of a parameter value into the corresponding display parameter index number.

Parameters
[in]paramIDThe ID of the parameter value
Returns
The index of the parameter value, or -1 if there is no display parameter with the given ID
208 {return GetParamIndex(paramID);}
virtual int GetParamIndex(int paramID)=0
Translates the ID of a parameter value into the corresponding parameter index number.
virtual const MCHAR* GetDisplayParamName ( int  paramID)
inlinevirtual

Returns the name of a display parameter.

Parameters
[in]paramIDThe ID of the display parameter
211 {return GetParamName(paramID);}
virtual const MCHAR * GetParamName(int paramID)=0
Returns the name of a parameter value.
virtual BOOL IsDisplayParam ( int  paramID)
inlinevirtual

Returns whether the given parameter should be displayed in the brush preset manager dialog.

Parameters
[in]paramIDThe ID of the parameter
Returns
TRUE if the parameter should be displayed, FALSE otherwise
216 { UNUSED_PARAM(paramID); return TRUE;}
#define UNUSED_PARAM(x)
Definition: BuildWarnings.h:18
virtual BOOL IsTransientParam ( int  paramID)
inlinevirtual

Returns whether the given parameter is transient.

Transient parameters are not stored to disk. This can be useful, for example, with display-only parameters, whose value is a user-friendly string built from other non-display parameters.

Parameters
[in]paramIDThe ID of the parameter
Returns
TRUE if the parameter is transient, FALSE otherwise
222 { UNUSED_PARAM(paramID); return FALSE; }
#define UNUSED_PARAM(x)
Definition: BuildWarnings.h:18
virtual Class_ID PluginClassID ( )
pure virtual

Returns the class ID of a plug-in implemented in the same module as this context.

The class ID is used to support deferred plug-in loading. When the brush preset manager needs to ensure that a context implementation is loaded into memory, it will load the module using this ID. The manager calls this method when a context is first registered, and then stores the value in the brush preset file for later use.

virtual SClass_ID PluginSuperClassID ( )
pure virtual

Returns the superclass ID of a plug-in implemented in the same module as this context.

The superclass ID is used to support deferred plug-in loading. When the brush preset manager needs to ensure that a context implementation is loaded into memory, it will load the module using this ID. The manager calls this method when a context is first registered, and then stores the value in the brush preset file for later use.