Hot Door CORE 0.8.2
Adobe® Illustrator® Plug-in Library
Loading...
Searching...
No Matches
Classes | Macros | Typedefs
hdicoreCallback.h File Reference

Header file for callback-related utilities. More...

#include <assert.h>
#include "hdicoreTypes.h"
Include dependency graph for hdicoreCallback.h:

Classes

class  hdi::core::Callback
 Base class for templated __Callback class. More...
 
class  hdi::core::__Callback< hdiTargetType >
 Class to describe a target object and a method of it, to be called at a later time. More...
 
class  hdi::core::__Dummy
 Just a simple "dummy" class to allow for creation of "empty" callbacks. More...
 

Macros

#define HDI_CORE_CALLBACK_T(__HDI_C__)   hdi::core::__Callback<__HDI_C__>
 Inserts a properly templated type name for a Callback of a particular class.
 
#define HDI_CORE_CALLBACK(__HDI_C__, __HDI_O__, __HDI_M__)    hdi::core::__Callback<__HDI_C__>(__HDI_O__, &__HDI_C__::__HDI_M__)
 Creates a properly templated Callback object for firing a particular method of a particular object.
 
#define HDI_CORE_CALLBACK_NONE   HDI_CORE_CALLBACK(hdi::core::__Dummy, NULL, nothing)
 Creates an "empty" callback object for when no callback is desired.
 

Typedefs

typedef std::unique_ptr< Callback > hdi::core::CallbackUP
 
typedef std::shared_ptr< Callback > hdi::core::CallbackSP
 
typedef std::weak_ptr< Callback > hdi::core::CallbackWP
 

Detailed Description

Header file for callback-related utilities.

Macro Definition Documentation

◆ HDI_CORE_CALLBACK

#define HDI_CORE_CALLBACK (   __HDI_C__,
  __HDI_O__,
  __HDI_M__ 
)     hdi::core::__Callback<__HDI_C__>(__HDI_O__, &__HDI_C__::__HDI_M__)

Creates a properly templated Callback object for firing a particular method of a particular object.

Author
GW
Date
08/2013
Parameters
__HDI_C__Class name (scope-resolved) of which __HDI_O__ is an instantiation (e.g. myplugin::MyPanel)
__HDI_O__Object pointer that will act as the target for the callback
__HDI_M__Method name that will act as the target's action for the callback
// Here's an example:
hdi::core::Button* transformBtn = new hdi::core::Button(<args>);
transformBtn->setClickCallback( HDI_CORE_CALLBACK(myplugin::MyPanel, this, btnWasClicked) );
// When the above button is clicked by the user, myplugin::MyPanel::btnWasClicked() will be called with the
// myplugin::MyPanel object ("this") as the target
Button widget, which can be either the default button, cancel button, or normal button in a dialog,...
Definition: hdicoreButton.h:23
virtual void setClickCallback(const Callback &callback_)
Sets the click callback for the button.
#define HDI_CORE_CALLBACK(__HDI_C__, __HDI_O__, __HDI_M__)
Creates a properly templated Callback object for firing a particular method of a particular object.
Definition: hdicoreCallback.h:49

◆ HDI_CORE_CALLBACK_NONE

#define HDI_CORE_CALLBACK_NONE   HDI_CORE_CALLBACK(hdi::core::__Dummy, NULL, nothing)

Creates an "empty" callback object for when no callback is desired.

Author
GW
Date
08/2013

◆ HDI_CORE_CALLBACK_T

#define HDI_CORE_CALLBACK_T (   __HDI_C__)    hdi::core::__Callback<__HDI_C__>

Inserts a properly templated type name for a Callback of a particular class.

Author
GW
Date
10/2013
Parameters
__HDI_C__Class name (scope-resolved) within which a Callback instantiation will call a method
// Here's an example:
typedef HDI_CORE_CALLBACK_T(myplugin::MyPanel) MyPanelCB;
const MyPanelCB someCommonCB = HDI_CORE_CALLBACK(myplugin::MyPanel, this, commonMethod);
// Now the someCommonCB object can be assigned to a variety of e.g. widgets
#define HDI_CORE_CALLBACK_T(__HDI_C__)
Inserts a properly templated type name for a Callback of a particular class.
Definition: hdicoreCallback.h:30
Note
See the documentation for the HDI_CORE_CALLBACK macro for more info.