PyErr_SetString(PyExc_TypeError,"setEditableText expects a string");
PYTHON_RETURN_ERROR;
}
self->fThis->SetEditableText(text);
PYTHON_RETURN_NONE;
}
PYTHON_START_METHODS_TABLE(ptBook)
PYTHON_METHOD(ptBook,show,"Params: startOpened\nShows the book closed, or open if the the startOpened flag is true"),
PYTHON_BASIC_METHOD(ptBook,hide,"Hides the book"),
PYTHON_METHOD(ptBook,open,"Params: startingPage\nOpens the book to the specified page"),
PYTHON_BASIC_METHOD(ptBook,close,"Closes the book"),
PYTHON_BASIC_METHOD(ptBook,closeAndHide,"Closes the book and hides it once it finishes animating"),
PYTHON_BASIC_METHOD(ptBook,nextPage,"Flips the book to the next page"),
PYTHON_BASIC_METHOD(ptBook,previousPage,"Flips the book to the previous page"),
PYTHON_METHOD(ptBook,goToPage,"Params: page\nFlips the book to the specified page"),
PYTHON_METHOD(ptBook,setSize,"Params: width,height\nSets the size of the book (width and height are floats from 0 to 1)"),
PYTHON_METHOD_NOARGS(ptBook,getCurrentPage,"Returns the currently shown page"),
PYTHON_METHOD(ptBook,allowPageTurning,"Params: allow\nTurns on and off the ability to flip the pages in a book"),
PYTHON_METHOD(ptBook,setPageMargin,"Params: margin\nSets the text margin for the book"),
PYTHON_METHOD(ptBook,setGUI,"Params: guiName\nSets the gui to be used by the book, if the requested gui is not loaded, it will use the default\nDo not call while the book is open!"),
PYTHON_METHOD(ptBook,getMovie,"Params: index\nGrabs a ptAnimation object representing the movie indexed by index. The index is the index of the movie in the source code"),
PYTHON_METHOD(ptBook,setEditable,"Params: editable\nTurn book editing on or off. If the book GUI does not support editing, nothing will happen"),
PYTHON_METHOD(ptBook,getEditableText,"Returns the editable text currently contained in the book."),
PYTHON_METHOD(ptBook,setEditableText,"Params: text\nSets the book's editable text."),
PYTHON_END_METHODS_TABLE;
// Type structure definition
PLASMA_DEFAULT_TYPE(ptBook,"Params: esHTMLSource,coverImage=None,callbackKey=None,guiName=''\nCreates a new book");
// required functions for PyObject interoperability
// AddPlasmaClasses - the python module definitions
//
voidpyJournalBook::AddPlasmaClasses(PyObject*m)
{
PYTHON_CLASS_IMPORT_START(m);
PYTHON_CLASS_IMPORT(m,ptBook);
PYTHON_CLASS_IMPORT_END(m);
}
PYTHON_GLOBAL_METHOD_DEFINITION(PtLoadBookGUI,args,"Params: guiName\nLoads the gui specified, a gui must be loaded before it can be used. If the gui is already loaded, doesn't do anything")
{
char*guiName;
if(!PyArg_ParseTuple(args,"s",&guiName))
{
PyErr_SetString(PyExc_TypeError,"PtLoadBookGUI expects a string");
PYTHON_RETURN_ERROR;
}
pyJournalBook::LoadGUI(guiName);
PYTHON_RETURN_NONE;
}
PYTHON_GLOBAL_METHOD_DEFINITION(PtUnloadBookGUI,args,"Params: guiName\nUnloads the gui specified. If the gui isn't loaded, doesn't do anything")
{
char*guiName;
if(!PyArg_ParseTuple(args,"s",&guiName))
{
PyErr_SetString(PyExc_TypeError,"PtUnloadBookGUI expects a string");
PYTHON_RETURN_ERROR;
}
pyJournalBook::UnloadGUI(guiName);
PYTHON_RETURN_NONE;
}
PYTHON_BASIC_GLOBAL_METHOD_DEFINITION(PtUnloadAllBookGUIs,pyJournalBook::UnloadAllGUIs,"Unloads all loaded guis except for the default one")