00001 /*========================================================================= 00002 00003 Program: Visualization Toolkit 00004 Module: $RCSfile: vtkOldStyleCallbackCommand.h,v $ 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 static vtkOldStyleCallbackCommand *New() 00043 {return new vtkOldStyleCallbackCommand;}; 00044 00046 void Execute(vtkObject *invoker, unsigned long eid, void *calldata); 00047 00049 00050 void SetClientData(void *cd) 00051 {this->ClientData = cd;}; 00052 void SetCallback(void (*f)(void *clientdata)) 00053 {this->Callback = f;}; 00054 void SetClientDataDeleteCallback(void (*f)(void *)) 00055 {this->ClientDataDeleteCallback = f;}; 00057 00058 void *ClientData; 00059 void (*Callback)(void *); 00060 void (*ClientDataDeleteCallback)(void *); 00061 00062 protected: 00063 vtkOldStyleCallbackCommand(); 00064 ~vtkOldStyleCallbackCommand(); 00065 }; 00066 00067 00068 #endif /* __vtkOldStyleCallbackCommand_h */ 00069