/* ----------------------------------------------------------------------------
 * This file was automatically generated by SWIG (http://www.swig.org).
 * Version 1.3.19
 * 
 * This file is not intended to be easily readable and contains a number of 
 * coding conventions designed to improve portability and efficiency. Do not make
 * changes to this file unless you know what you are doing--modify the SWIG 
 * interface file instead. 
 * ----------------------------------------------------------------------------- */


#ifdef __cplusplus
template<class T> class SwigValueWrapper {
    T *tt;
public:
    inline SwigValueWrapper() : tt(0) { }
    inline ~SwigValueWrapper() { if (tt) delete tt; } 
    inline SwigValueWrapper& operator=(const T& t) { tt = new T(t); return *this; }
    inline operator T&() const { return *tt; }
    inline T *operator&() { return tt; }
};                                                    
#endif



#include <stdlib.h>
#include <string.h>
#include <stdio.h>
#ifdef WIN32
#  define DllExport   __declspec( dllexport )
#else
#  define DllExport  
#endif 


#include "example.h"


#ifdef __cplusplus
extern "C" {
#endif

DllExport void delete_Shape(int jarg1) {
    Shape *arg1 = (Shape *) 0 ;
    
    arg1 = *(Shape **)&jarg1; 
    delete arg1;
    
}


DllExport void Shape_x(int jarg1, double jarg2) {
    Shape *arg1 = (Shape *) 0 ;
    double arg2 ;
    
    arg1 = *(Shape **)&jarg1; 
    arg2 = (double)jarg2; 
    if (arg1) (arg1)->x = arg2;
    
}


DllExport double Shape_x(int jarg1) {
    double jresult = 0 ;
    Shape *arg1 = (Shape *) 0 ;
    double result;
    
    arg1 = *(Shape **)&jarg1; 
    result = (double) ((arg1)->x);
    
    jresult = result; 
    return jresult;
}


DllExport void Shape_y(int jarg1, double jarg2) {
    Shape *arg1 = (Shape *) 0 ;
    double arg2 ;
    
    arg1 = *(Shape **)&jarg1; 
    arg2 = (double)jarg2; 
    if (arg1) (arg1)->y = arg2;
    
}


DllExport double Shape_y(int jarg1) {
    double jresult = 0 ;
    Shape *arg1 = (Shape *) 0 ;
    double result;
    
    arg1 = *(Shape **)&jarg1; 
    result = (double) ((arg1)->y);
    
    jresult = result; 
    return jresult;
}


DllExport void Shape_move(int jarg1, double jarg2, double jarg3) {
    Shape *arg1 = (Shape *) 0 ;
    double arg2 ;
    double arg3 ;
    
    arg1 = *(Shape **)&jarg1; 
    arg2 = (double)jarg2; 
    arg3 = (double)jarg3; 
    (arg1)->move(arg2,arg3);
    
}


DllExport double Shape_area(int jarg1) {
    double jresult = 0 ;
    Shape *arg1 = (Shape *) 0 ;
    double result;
    
    arg1 = *(Shape **)&jarg1; 
    result = (double)(arg1)->area();
    
    jresult = result; 
    return jresult;
}


DllExport double Shape_perimeter(int jarg1) {
    double jresult = 0 ;
    Shape *arg1 = (Shape *) 0 ;
    double result;
    
    arg1 = *(Shape **)&jarg1; 
    result = (double)(arg1)->perimeter();
    
    jresult = result; 
    return jresult;
}


DllExport void Shape_nshapes(int jarg1) {
    int arg1 ;
    
    arg1 = (int)jarg1; 
    Shape::nshapes = arg1;
    
}


DllExport int Shape_nshapes() {
    int jresult = 0 ;
    int result;
    
    result = (int)Shape::nshapes;
    
    jresult = result; 
    return jresult;
}


DllExport int new_Circle(double jarg1) {
    int jresult = 0 ;
    double arg1 ;
    Circle *result;
    
    arg1 = (double)jarg1; 
    result = (Circle *)new Circle(arg1);
    
    *(Circle **)&jresult = result; 
    return jresult;
}


DllExport double Circle_area(int jarg1) {
    double jresult = 0 ;
    Circle *arg1 = (Circle *) 0 ;
    double result;
    
    arg1 = *(Circle **)&jarg1; 
    result = (double)(arg1)->area();
    
    jresult = result; 
    return jresult;
}


DllExport double Circle_perimeter(int jarg1) {
    double jresult = 0 ;
    Circle *arg1 = (Circle *) 0 ;
    double result;
    
    arg1 = *(Circle **)&jarg1; 
    result = (double)(arg1)->perimeter();
    
    jresult = result; 
    return jresult;
}


DllExport void delete_Circle(int jarg1) {
    Circle *arg1 = (Circle *) 0 ;
    
    arg1 = *(Circle **)&jarg1; 
    delete arg1;
    
}


DllExport int new_Square(double jarg1) {
    int jresult = 0 ;
    double arg1 ;
    Square *result;
    
    arg1 = (double)jarg1; 
    result = (Square *)new Square(arg1);
    
    *(Square **)&jresult = result; 
    return jresult;
}


DllExport double Square_area(int jarg1) {
    double jresult = 0 ;
    Square *arg1 = (Square *) 0 ;
    double result;
    
    arg1 = *(Square **)&jarg1; 
    result = (double)(arg1)->area();
    
    jresult = result; 
    return jresult;
}


DllExport double Square_perimeter(int jarg1) {
    double jresult = 0 ;
    Square *arg1 = (Square *) 0 ;
    double result;
    
    arg1 = *(Square **)&jarg1; 
    result = (double)(arg1)->perimeter();
    
    jresult = result; 
    return jresult;
}


DllExport void delete_Square(int jarg1) {
    Square *arg1 = (Square *) 0 ;
    
    arg1 = *(Square **)&jarg1; 
    delete arg1;
    
}


DllExport long CircleToShape(long objectRef) {
    long baseptr = 0;
    *(Shape **)&baseptr = *(Circle **)&objectRef;
    return baseptr;
}

DllExport long SquareToShape(long objectRef) {
    long baseptr = 0;
    *(Shape **)&baseptr = *(Square **)&objectRef;
    return baseptr;
}

#ifdef __cplusplus
}
#endif

