// ************************************************************************* //
//                        BinnerScriptingPluginInfo.C
// ************************************************************************* //
#include <BinnerPluginInfo.h>
#include <PyBinner.h>

#if defined(__APPLE__)
#define GetScriptingInfo Binner_GetScriptingInfo
#endif

// ****************************************************************************
//  Function:  GetScriptingInfo
//
//  Purpose:
//    Return a new ScriptingPluginInfo for the Binner plot.
//
//  Programmer: cristina -- generated by xml2info
//  Creation:   Thu Mar 30 12:05:26 PDT 2006
//
// ****************************************************************************
extern "C" ScriptingOperatorPluginInfo* GetScriptingInfo()
{
    return new BinnerScriptingPluginInfo;
}

// ****************************************************************************
// Method: BinnerScriptingPluginInfo::InitializePlugin
//
// Purpose: 
//   Calls the initialization function for the plugin.
//
// Arguments:
//   subj    : A pointer to the plugin's state object.
//   data    : A pointer to data to be used by the observer function.
//
//  Programmer: cristina -- generated by xml2info
//  Creation:   Thu Mar 30 12:05:26 PDT 2006
//
// Modifications:
//   
// ****************************************************************************

void
BinnerScriptingPluginInfo::InitializePlugin(AttributeSubject *subj,
    void *data)
{
    PyBinner_StartUp((Binner *)subj, data);
}

// ****************************************************************************
// Method: BinnerScriptingPluginInfo::GetMethodTable
//
// Purpose: 
//   Returns a pointer to the plugin's Python method table. These methods are
//   added to the top-level visit module's methods.
//
// Arguments:
//   nMethods : Returns the number of methods in the method table.
//
// Returns:    A pointer to the method table.
//
//  Programmer: cristina -- generated by xml2info
//  Creation:   Thu Mar 30 12:05:26 PDT 2006
//
// Modifications:
//   
// ****************************************************************************

void *
BinnerScriptingPluginInfo::GetMethodTable(int *nMethods)
{
    return PyBinner_GetMethodTable(nMethods);
}

// ****************************************************************************
// Method: BinnerScriptingPluginInfo::TypesMatch
//
// Purpose: 
//   Returns whether or not the input PyObject is Binner plot attributes.
//
// Arguments:
//   pyobject : A PyObject cast to void*.
//
//  Programmer: cristina -- generated by xml2info
//  Creation:   Thu Mar 30 12:05:26 PDT 2006
//
// Modifications:
//   
// ****************************************************************************

bool
BinnerScriptingPluginInfo::TypesMatch(void *pyobject)
{
    return PyBinner_Check((PyObject *)pyobject);
}

// ****************************************************************************
// Method: BinnerScriptingPluginInfo::GetLogString
//
// Purpose: 
//   Gets a string representation of the current attributes.
//
// Arguments:
//   val : Whether or not to log state information.
//
//  Programmer: cristina -- generated by xml2info
//  Creation:   Thu Mar 30 12:05:26 PDT 2006
//
// Modifications:
//   
// ****************************************************************************

char *
BinnerScriptingPluginInfo::GetLogString()
{
    std::string s(PyBinner_GetLogString());
    char *v = new char[s.size() + 1];
    strcpy(v, s.c_str());
    return v;
}

// ****************************************************************************
// Method: BinnerScriptingPluginInfo::SetDefaults
//
// Purpose: 
//   Used to set the default values for a plugin's state object.
//
// Arguments:
//   atts : The new state.
//
//  Programmer: cristina -- generated by xml2info
//  Creation:   Thu Mar 30 12:05:26 PDT 2006
//
// Modifications:
//   
// ****************************************************************************

void
BinnerScriptingPluginInfo::SetDefaults(const AttributeSubject *atts)
{
    PyBinner_SetDefaults((const Binner *)atts);
}
