00001 // Filename: interfaceMakerC.h 00002 // Created by: drose (25Sep01) 00003 // 00004 //////////////////////////////////////////////////////////////////// 00005 // 00006 // PANDA 3D SOFTWARE 00007 // Copyright (c) 2001, Disney Enterprises, Inc. All rights reserved 00008 // 00009 // All use of this software is subject to the terms of the Panda 3d 00010 // Software license. You should have received a copy of this license 00011 // along with this source code; you will also find a current copy of 00012 // the license at http://www.panda3d.org/license.txt . 00013 // 00014 // To contact the maintainers of this program write to 00015 // panda3d@yahoogroups.com . 00016 // 00017 //////////////////////////////////////////////////////////////////// 00018 00019 #ifndef INTERFACEMAKERC_H 00020 #define INTERFACEMAKERC_H 00021 00022 #include "dtoolbase.h" 00023 00024 #include "interfaceMaker.h" 00025 #include "interrogate_interface.h" 00026 00027 class FunctionRemap; 00028 00029 //////////////////////////////////////////////////////////////////// 00030 // Class : InterfaceMakerC 00031 // Description : An InteraceMaker suitable for generating 00032 // a series of C-calling-convention functions for 00033 // Panda class objects. 00034 //////////////////////////////////////////////////////////////////// 00035 class InterfaceMakerC : public InterfaceMaker { 00036 public: 00037 InterfaceMakerC(InterrogateModuleDef *def); 00038 virtual ~InterfaceMakerC(); 00039 00040 virtual void write_prototypes(ostream &out); 00041 virtual void write_functions(ostream &out); 00042 00043 virtual bool synthesize_this_parameter(); 00044 00045 protected: 00046 virtual string get_wrapper_prefix(); 00047 virtual string get_unique_prefix(); 00048 00049 virtual void 00050 record_function_wrapper(InterrogateFunction &ifunc, 00051 FunctionWrapperIndex wrapper_index); 00052 00053 private: 00054 void write_prototype_for(ostream &out, Function *func); 00055 void write_function_for(ostream &out, Function *func); 00056 void write_function_instance(ostream &out, Function *func, 00057 FunctionRemap *remap); 00058 void write_function_header(ostream &out, Function *func, 00059 FunctionRemap *remap, bool newline); 00060 }; 00061 00062 #endif