VTK
dox/Common/Core/vtkOldStyleCallbackCommand.h
Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Visualization Toolkit
00004   Module:    vtkOldStyleCallbackCommand.h
00005 
00006   Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
00007   All rights reserved.
00008   See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
00009 
00010      This software is distributed WITHOUT ANY WARRANTY; without even
00011      the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
00012      PURPOSE.  See the above copyright notice for more information.
00013 
00014 =========================================================================*/
00033 #ifndef __vtkOldStyleCallbackCommand_h
00034 #define __vtkOldStyleCallbackCommand_h
00035 
00036 #include "vtkCommonCoreModule.h" // For export macro
00037 #include "vtkCommand.h"
00038 
00039 // the old style void fund(void *) callbacks
00040 class VTKCOMMONCORE_EXPORT vtkOldStyleCallbackCommand : public vtkCommand
00041 {
00042 public:
00043   vtkTypeMacro(vtkOldStyleCallbackCommand,vtkCommand);
00044 
00045   static vtkOldStyleCallbackCommand *New()
00046     {return new vtkOldStyleCallbackCommand;};
00047 
00049   void Execute(vtkObject *invoker, unsigned long eid, void *calldata);
00050 
00052 
00053   void SetClientData(void *cd)
00054     {this->ClientData = cd;};
00055   void SetCallback(void (*f)(void *clientdata))
00056     {this->Callback = f;};
00057   void SetClientDataDeleteCallback(void (*f)(void *))
00058     {this->ClientDataDeleteCallback = f;};
00060 
00061   void *ClientData;
00062   void (*Callback)(void *);
00063   void (*ClientDataDeleteCallback)(void *);
00064 
00065 protected:
00066   vtkOldStyleCallbackCommand();
00067   ~vtkOldStyleCallbackCommand();
00068 };
00069 
00070 
00071 #endif /* __vtkOldStyleCallbackCommand_h */
00072 
00073 // VTK-HeaderTest-Exclude: vtkOldStyleCallbackCommand.h