interfaceMakerC.h 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. // Filename: interfaceMakerC.h
  2. // Created by: drose (25Sep01)
  3. //
  4. ////////////////////////////////////////////////////////////////////
  5. //
  6. // PANDA 3D SOFTWARE
  7. // Copyright (c) 2001 - 2004, Disney Enterprises, Inc. All rights reserved
  8. //
  9. // All use of this software is subject to the terms of the Panda 3d
  10. // Software license. You should have received a copy of this license
  11. // along with this source code; you will also find a current copy of
  12. // the license at http://etc.cmu.edu/panda3d/docs/license/ .
  13. //
  14. // To contact the maintainers of this program write to
  15. // [email protected] .
  16. //
  17. ////////////////////////////////////////////////////////////////////
  18. #ifndef INTERFACEMAKERC_H
  19. #define INTERFACEMAKERC_H
  20. #include "dtoolbase.h"
  21. #include "interfaceMaker.h"
  22. #include "interrogate_interface.h"
  23. class FunctionRemap;
  24. ////////////////////////////////////////////////////////////////////
  25. // Class : InterfaceMakerC
  26. // Description : An InteraceMaker suitable for generating
  27. // a series of C-calling-convention functions for
  28. // Panda class objects.
  29. ////////////////////////////////////////////////////////////////////
  30. class InterfaceMakerC : public InterfaceMaker {
  31. public:
  32. InterfaceMakerC(InterrogateModuleDef *def);
  33. virtual ~InterfaceMakerC();
  34. virtual void write_prototypes(ostream &out);
  35. virtual void write_functions(ostream &out);
  36. virtual bool synthesize_this_parameter();
  37. protected:
  38. virtual string get_wrapper_prefix();
  39. virtual string get_unique_prefix();
  40. virtual void
  41. record_function_wrapper(InterrogateFunction &ifunc,
  42. FunctionWrapperIndex wrapper_index);
  43. private:
  44. void write_prototype_for(ostream &out, Function *func);
  45. void write_function_for(ostream &out, Function *func);
  46. void write_function_instance(ostream &out, Function *func,
  47. FunctionRemap *remap);
  48. void write_function_header(ostream &out, Function *func,
  49. FunctionRemap *remap, bool newline);
  50. };
  51. #endif