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 "vtkCommand.h" 00037 00038 // the old style void fund(void *) callbacks 00039 class VTK_COMMON_EXPORT vtkOldStyleCallbackCommand : public vtkCommand 00040 { 00041 public: 00042 vtkTypeMacro(vtkOldStyleCallbackCommand,vtkCommand); 00043 00044 static vtkOldStyleCallbackCommand *New() 00045 {return new vtkOldStyleCallbackCommand;}; 00046 00048 void Execute(vtkObject *invoker, unsigned long eid, void *calldata); 00049 00051 00052 void SetClientData(void *cd) 00053 {this->ClientData = cd;}; 00054 void SetCallback(void (*f)(void *clientdata)) 00055 {this->Callback = f;}; 00056 void SetClientDataDeleteCallback(void (*f)(void *)) 00057 {this->ClientDataDeleteCallback = f;}; 00059 00060 void *ClientData; 00061 void (*Callback)(void *); 00062 void (*ClientDataDeleteCallback)(void *); 00063 00064 protected: 00065 vtkOldStyleCallbackCommand(); 00066 ~vtkOldStyleCallbackCommand(); 00067 }; 00068 00069 00070 #endif /* __vtkOldStyleCallbackCommand_h */ 00071