Back to index

scribus-ng  1.3.4.dfsg+svn20071115
Functions
scripter2_base.cpp File Reference
#include "cmdvar.h"
#include "scribusstructs.h"

Go to the source code of this file.

Functions

void export_QString ()
void export_QObject ()
void export_QWidget ()
void export_QFrame ()
void export_QScrollView ()
void export_QMainWindow ()
void export_QApplication ()
void export_ScribusStructs ()
void export_PageItem ()
void export_ScribusMainWindow ()
void export_ScribusQApp ()
void export_ScribusWin ()
void export_ScribusDoc ()
void export_ScribusView ()
void export_styles ()
int add_five (int x)
 A simple test function to wrap with Boost::Python.
 BOOST_PYTHON_MODULE (scribus2)
 Define the scribus2 module.
void scripter2_init ()
 Initialize the module, including calling initscribus2()

Function Documentation

int add_five ( int  x)

A simple test function to wrap with Boost::Python.

Definition at line 35 of file scripter2_base.cpp.

{
       return x+5;
}

Here is the caller graph for this function:

BOOST_PYTHON_MODULE ( scribus2  )

Define the scribus2 module.

Definition at line 43 of file scripter2_base.cpp.

{
       qDebug("Exporting scribus2");

       // Export our basic testing function
       def("add_five", add_five);

       // Export type converters
       export_QString();

       // And Qt classes
       export_QObject();
       export_QApplication();
       export_QWidget();
       export_QFrame();
       export_QScrollView();
       export_QMainWindow();

       // Export Scribus types
       export_ScribusStructs();
       export_ScribusQApp();
       export_ScribusDoc();
       export_ScribusView();
       export_ScribusWin();
       export_ScribusMainWindow();
       export_PageItem();

       // Export access functions and dirty hacks
       export_styles();

       qDebug("Done");
}

Here is the call graph for this function:

void export_PageItem ( )

Definition at line 51 of file scripter2_scribus_pageitem.cpp.

{
       using namespace boost::python;

       def("getItemNames", getItemNames);
       def("getItem", getItem, return_internal_reference<>());

       {
              scope p = class_<PageItem,boost::noncopyable>(
                            "PageItem",
                            "A Scribus canvas object",
                            no_init)
                     .def("clearContents", &PageItem::clearContents)
                     .def("AdjustPictScale", &PageItem::AdjustPictScale)
                     //TODO Needs: ObjAttrVector, Problem: pointer return
                     //.def("getObjectAttributes", &PageItem::getObjectAttributes,
                     //TODO Needs: ObjectAttribute
                     .def("getObjectAttribute", &PageItem::getObjectAttribute)
                     .def("setObjectAttributes", &PageItem::setObjectAttributes)
                     .def("SetFrameShape", &PageItem::SetFrameShape)
                     .def("SetRectFrame", &PageItem::SetRectFrame)
                     .def("SetOvalFrame", &PageItem::SetOvalFrame)
                     .def("SetFrameRound", &PageItem::SetFrameRound)
                     .def("SetPolyClip", &PageItem::SetPolyClip)
                     .def("getBoundingRect", &PageItem::getBoundingRect)
                     .def("pointWithinItem", &PageItem::pointWithinItem)
                     //.def("SetZeichAttr", &PageItem::SetZeichAttr) // WTF?
                     .def("SetFarbe", &PageItem::SetFarbe)
                     .def_readwrite("AspectRatio", &PageItem::AspectRatio)
                     .def_readwrite("AutoName", &PageItem::AutoName)  
                     .def_readwrite("BottomLine", &PageItem::BottomLine)
                     .def_readwrite("ChangedMasterItem", &PageItem::ChangedMasterItem)
                     .def_readwrite("ClipEdited", &PageItem::ClipEdited)
                     .def_readwrite("Dirty", &PageItem::Dirty)
                     .def_readwrite("fillRule", &PageItem::fillRule)
                     .def_readwrite("Frame", &PageItem::Frame)
                     .def_readwrite("FrameOnly", &PageItem::FrameOnly)
                     .def_readwrite("HasSel", &PageItem::HasSel)
                     .def_readwrite("isAutoText", &PageItem::isAutoText)
                     .def_readwrite("isBookmark", &PageItem::isBookmark)
                     .def_readwrite("isEmbedded", &PageItem::isEmbedded)
                     .def_readwrite("isRaster", &PageItem::isRaster)
                     .def_readwrite("isSingleSel", &PageItem::isSingleSel)
                     .def_readwrite("isTableItem", &PageItem::isTableItem)
                     .def_readwrite("LeftLine", &PageItem::LeftLine)
                     .def_readwrite("PicArt", &PageItem::PicArt)
                     .def_readwrite("PicAvail", &PageItem::PicAvail)
                     .def_readwrite("PoShow", &PageItem::PoShow)
                     .def_readwrite("Redrawn", &PageItem::Redrawn)
                     .def_readwrite("RightLine", &PageItem::RightLine)
                     .def_readwrite("ScaleType", &PageItem::ScaleType)
                     .def_readwrite("Sizing", &PageItem::Sizing)
                     .def_readwrite("Tinput", &PageItem::Tinput)
                     .def_readwrite("toPixmap", &PageItem::toPixmap)
                     .def_readwrite("TopLine", &PageItem::TopLine)
                     .def_readwrite("UseEmbedded", &PageItem::UseEmbedded)
                     .def_readwrite("BaseOffs", &PageItem::BaseOffs)
                     .def_readwrite("BBoxH", &PageItem::BBoxH)
                     .def_readwrite("BBoxX", &PageItem::BBoxX)
                     .def_readwrite("BoundingH", &PageItem::BoundingH)
                     .def_readwrite("BoundingW", &PageItem::BoundingW)
                     .def_readwrite("BoundingX", &PageItem::BoundingX)
                     .def_readwrite("BoundingY", &PageItem::BoundingY)
                     .def_readwrite("ColGap", &PageItem::ColGap)
                     .def_readwrite("CurX", &PageItem::CurX)
                     .def_readwrite("CurY", &PageItem::CurY)
                     .def_readwrite("DashOffset", &PageItem::DashOffset)
                     .def_readwrite("gHeight", &PageItem::gHeight)
                     .def_readwrite("GrEndX", &PageItem::GrEndX)
                     .def_readwrite("GrEndY", &PageItem::GrEndY)
                     .def_readwrite("GrStartX", &PageItem::GrStartX)
                     .def_readwrite("GrStartY", &PageItem::GrStartY)
                     .def_readwrite("gWidth", &PageItem::gWidth)
                     .def_readwrite("gXpos", &PageItem::gXpos)
                     .def_readwrite("gYpos", &PageItem::gYpos)
                     .def_readwrite("LineSp", &PageItem::LineSp)
                     .def_readwrite("OldB", &PageItem::OldB)
                     .def_readwrite("OldB2", &PageItem::OldB2)
                     .def_readwrite("OldH", &PageItem::OldH)
                     .def_readwrite("OldH2", &PageItem::OldH2)
                     .def_readwrite("OldPwidth", &PageItem::OldPwidth)
                     .def_readwrite("Pwidth", &PageItem::Pwidth)
                     .def_readwrite("ContourLine", &PageItem::ContourLine)
                     .def_readwrite("imageClip", &PageItem::imageClip)
                     .def_readwrite("PoLine", &PageItem::PoLine)
                     .def_readwrite("BottomLinkID", &PageItem::BottomLinkID)
                     .def_readwrite("Cols", &PageItem::Cols)
                     .def_readwrite("CPos", &PageItem::CPos)
                     .def_readwrite("ExtraV", &PageItem::ExtraV)
                     .def_readwrite("FrameType", &PageItem::FrameType)
                     .def_readwrite("GrType", &PageItem::GrType)
                     .def_readwrite("IRender", &PageItem::IRender)
                     .def_readwrite("LayerNr", &PageItem::LayerNr)
                     .def_readwrite("LeftLinkID", &PageItem::LeftLinkID)
                     .def_readwrite("LineSpMode", &PageItem::LineSpMode)
                     .def_readwrite("NextIt", &PageItem::NextIt)
                     .def_readwrite("NextPg", &PageItem::NextPg)
                     .def_readwrite("oldOwnPage", &PageItem::oldOwnPage)
                     .def_readwrite("OrigH", &PageItem::OrigH)
                     .def_readwrite("OrigW", &PageItem::OrigW)
                     .def_readwrite("OwnPage", &PageItem::OwnPage)
                     .def_readwrite("RightLinkID", &PageItem::RightLinkID)
                     .def_readwrite("ShTxtFill", &PageItem::ShTxtFill)
                     .def_readwrite("ShTxtStroke", &PageItem::ShTxtStroke)
                     .def_readwrite("textAlignment", &PageItem::textAlignment)
                     .def_readwrite("TopLinkID", &PageItem::TopLinkID)
                     .def_readwrite("TxtBase", &PageItem::TxtBase)
                     .def_readwrite("TxtOutline", &PageItem::TxtOutline)
                     .def_readwrite("TxtScale", &PageItem::TxtScale)
                     .def_readwrite("TxtScaleV", &PageItem::TxtScaleV)
                     .def_readwrite("TxtShadowX", &PageItem::TxtShadowX)
                     .def_readwrite("TxtShadowY", &PageItem::TxtShadowY)
                     .def_readwrite("TxtStrikePos", &PageItem::TxtStrikePos)
                     .def_readwrite("TxtStrikeWidth", &PageItem::TxtStrikeWidth)
                     .def_readwrite("TxTStyle", &PageItem::TxTStyle)
                     .def_readwrite("TxtUnderPos", &PageItem::TxtUnderPos)
                     .def_readwrite("TxtUnderWidth", &PageItem::TxtUnderWidth)
                     .def_readwrite("*BackBox", &PageItem::BackBox)
                     .def_readwrite("BottomLink", &PageItem::BottomLink)
                     .def_readwrite("LeftLink", &PageItem::LeftLink)
                     .def_readwrite("*NextBox", &PageItem::NextBox)
                     .def_readwrite("RightLink", &PageItem::RightLink)
                     .def_readwrite("TopLink", &PageItem::TopLink)
                     .def_readwrite("PLineEnd", &PageItem::PLineEnd)
                     .def_readwrite("PLineJoin", &PageItem::PLineJoin)
                     .def_readwrite("PLineArt", &PageItem::PLineArt)
                     .def_readwrite("Clip", &PageItem::Clip)
                     .def_readwrite("itemText", &PageItem::itemText)
                     .def_readwrite("EmProfile", &PageItem::EmProfile)
                     .def_readwrite("IProfile", &PageItem::IProfile)
                     .def_readwrite("Language", &PageItem::Language)
                     .def_readwrite("NamedLStyle", &PageItem::NamedLStyle)
                     .def_readwrite("OnMasterPage", &PageItem::OnMasterPage)
                     .def_readwrite("Pfile", &PageItem::Pfile)
                     .def_readwrite("Pfile2", &PageItem::Pfile2)
                     .def_readwrite("Pfile3", &PageItem::Pfile3)
                     .def_readwrite("TxtFill", &PageItem::TxtFill)
                     .def_readwrite("TxtStroke", &PageItem::TxtStroke)
                     .def_readwrite("DashValues", &PageItem::DashValues)
                     .def_readwrite("effectsInUse", &PageItem::effectsInUse)
                     .def_readwrite("TabValues", &PageItem::TabValues)
                     .def_readwrite("Segments", &PageItem::Segments)
                     .def_readwrite("Groups", &PageItem::Groups)
                     .def_readwrite("pixm", &PageItem::pixm)
                     .def_readwrite("ItemNr", &PageItem::ItemNr)
                     .def_readwrite("MaxChars", &PageItem::MaxChars)
                     .def_readwrite("fill_gradient", &PageItem::fill_gradient)
                     .add_property("xPos", &PageItem::xPos, &PageItem::setXPos)
                     .add_property("yPos", &PageItem::yPos, &PageItem::setYPos)
                     .def("moveBy", &PageItem::moveBy)
                     .add_property("width", &PageItem::width, &PageItem::setWidth)
                     .add_property("height", &PageItem::height, &PageItem::setHeight)
                     .def("resizeBy", &PageItem::resizeBy)
                     // TODO: Weird error
                     //.def("rotation", &PageItem::rotation)
                     .def("setRotation", &PageItem::setRotation)
                     .def("rotateBy", &PageItem::rotateBy)
                     .add_property("selected", &PageItem::isSelected, &PageItem::setSelected)
                     .add_property("imageXscale", &PageItem::imageXScale, &PageItem::setImageXScale)
                     .add_property("imageYscale", &PageItem::imageYScale, &PageItem::setImageYScale)
                     .add_property("imageXOffset", &PageItem::imageXOffset, &PageItem::setImageXOffset)
                     .add_property("imageYOffset", &PageItem::imageYOffset, &PageItem::setImageYOffset)
                     .def("moveImageXYOffsetBy", &PageItem::moveImageXYOffsetBy)
                     .add_property("reversed", &PageItem::reversed, &PageItem::setReversed)
                     // TODO: Weird error
                     //.def("cornerRadius", &PageItem::cornerRadius)
                     .def("setCornerRadius", &PageItem::setCornerRadius)
                     .add_property("textToFrameDistLeft", &PageItem::textToFrameDistLeft, &PageItem::setTextToFrameDistLeft)
                     .add_property("textToFrameDistRight", &PageItem::textToFrameDistRight, &PageItem::setTextToFrameDistRight)
                     .add_property("textToFrameDistTop", &PageItem::textToFrameDistTop, &PageItem::setTextToFrameDistTop)
                     .add_property("textToFrameDistBottom", &PageItem::textToFrameDistBottom, &PageItem::setTextToFrameDistBottom)
                     .def("setTextToFrameDist", &PageItem::setTextToFrameDist)
                     .add_property("itemName", &PageItem::itemName, &PageItem::setItemName)
                     .add_property("fillColor", &PageItem::fillColor, &PageItem::setFillColor)
                     .add_property("fillShade", &PageItem::fillShade, &PageItem::setFillShade)
                     .add_property("fillTransparency", &PageItem::fillTransparency, &PageItem::setFillTransparency)
                     .add_property("lineColor", &PageItem::lineColor, &PageItem::setLineColor)
                     .add_property("lineShade", &PageItem::lineShade, &PageItem::setLineShade)
                     .add_property("lineTransparency", &PageItem::lineTransparency, &PageItem::setLineTransparency)
                     .add_property("setLineQColor", &PageItem::setLineQColor, &PageItem::setFillQColor)
                     .def("lineStyle", &PageItem::lineStyle)
                     // TODO: weird error
                     //.def("setLineStyle", &PageItem::setLineStyle)
                     // TODO: weird error
                     //.def("lineWidth", &PageItem::lineWidth)
                     .def("setLineWidth", &PageItem::setLineWidth)
                     .add_property("lineEnd", &PageItem::lineEnd, &PageItem::setLineEnd)
                     .add_property("lineJoin", &PageItem::lineJoin, &PageItem::setLineJoin)
                     .add_property("customLineStyle", &PageItem::customLineStyle, &PageItem::setCustomLineStyle)
                     .add_property("startArrowIndex", &PageItem::startArrowIndex, &PageItem::setStartArrowIndex)
                     .add_property("endArrowIndex", &PageItem::endArrowIndex, &PageItem::setEndArrowIndex)
                     .add_property("imageFlippedH", &PageItem::imageFlippedH, &PageItem::setImageFlippedH)
                     .def("flipImageH", &PageItem::flipImageH)
                     .add_property("imageFlippedV", &PageItem::imageFlippedV, &PageItem::setImageFlippedV)
                     .def("flipImageV", &PageItem::flipImageV)
                     .def("setImageScalingMode", &PageItem::setImageScalingMode)
                     .def("toggleLock", &PageItem::toggleLock)
                     .add_property("locked", &PageItem::locked, &PageItem::setLocked)
                     .def("toggleSizeLock", &PageItem::toggleSizeLock)
                     .add_property("sizeLocked", &PageItem::sizeLocked, &PageItem::setSizeLocked)
                     .add_property("font", &PageItem::font,  &PageItem::setFont)
                     .add_property("fontSize", &PageItem::fontSize, &PageItem::setFontSize)
                     .add_property("fontHeight", &PageItem::fontHeight, &PageItem::setFontHeight)
                     .add_property("fontWidth", &PageItem::fontWidth, &PageItem::setFontWidth)
                     .add_property("fontFillColor", &PageItem::fontFillColor, &PageItem::setFontFillColor)
                     .add_property("fontFillShade", &PageItem::fontFillShade, &PageItem::setFontFillShade)
                     .add_property("fontStrokeColor", &PageItem::fontStrokeColor, &PageItem::setFontStrokeColor)
                     .add_property("fontStrokeShade", &PageItem::fontStrokeShade, &PageItem::setFontStrokeShade)
                     .add_property("fontEffects", &PageItem::fontEffects, &PageItem::setFontEffects)
                     .add_property("kerning", &PageItem::kerning, &PageItem::setKerning)
                     // TODO: weird error
                     //.def("lineSpacing", &PageItem::lineSpacing)
                     .def("setLineSpacing", &PageItem::setLineSpacing)
                     .add_property("language", &PageItem::language, &PageItem::setLanguage)
                     .add_property("textFlowMode", &PageItem::textFlowMode, &PageItem::setTextFlowMode)
                     .def("itemType", &PageItem::itemType)
                     .def("convertTo", &PageItem::convertTo)
                     .def("setLayer", &PageItem::setLayer)
                     .add_property("printable", &PageItem::printable, &PageItem::setPrintable)
                     .def("loadImage", &PageItem::loadImage)
                     .add_property("isAnnotation", &PageItem::isAnnotation, &PageItem::setIsAnnotation)
                     .def("annotation", &PageItem::annotation, return_internal_reference<>());

              enum_<PageItem::ItemType>("ItemType")
                     .value("ImageFrame", PageItem::ImageFrame)
                     .value("ImageFrame", PageItem::ImageFrame)
                     .value("TextFrame", PageItem::TextFrame)
                     .value("Line", PageItem::Line)
                     .value("Polygon", PageItem::Polygon)
                     .value("PolyLine", PageItem::PolyLine)
                     .value("PathText", PageItem::PathText)
                     .export_values();

              enum_<PageItem::ItemFrameType>("ItemFrameType")
                     .value("Unspecified", PageItem::Unspecified)
                     .value("Rectangle", PageItem::Rectangle)
                     .value("Ellipse", PageItem::Ellipse)
                     .value("Round", PageItem::Round)
                     .value("Other", PageItem::Other)
                     .export_values();

              class_<PageItem::TabRecord>("TabRecord")
                     .def_readwrite("tabPosition", &PageItem::TabRecord::tabPosition)
                     .def_readwrite("tabType", &PageItem::TabRecord::tabType)
                     .add_property("tabFillChar", make_getter(&PageItem::TabRecord::tabFillChar, return_value_policy<return_by_value>()),
                                                                       make_setter(&PageItem::TabRecord::tabFillChar, return_value_policy<return_by_value>()));

       } // end scope p
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 23 of file scripter2_qtclass_qapplication.cpp.

{
       using namespace boost::python;

       class_<QApplication,boost::noncopyable>(
                     "QApplication",
                     "The base Qt application class",
                     no_init)
              //.def("exec", &QApplication::exec); // BAD PLAN to expose this
              //.def("processEvents", &QApplication::processEvents);
              .def("processEvents", &QApplication_processEvents)
              .def("processEventsT", &QApplication_processEventsT);

       scope().attr("qApp") = boost::ref(qApp);
}

Here is the call graph for this function:

Here is the caller graph for this function:

void export_QFrame ( )

Definition at line 11 of file scripter2_qtclass_qframe.cpp.

{
       using namespace boost::python;

       class_<QFrame,bases<QWidget>,boost::noncopyable>(
                     "QFrame",
                     "A generic Qt frame widget");
}

Here is the caller graph for this function:

Definition at line 11 of file scripter2_qtclass_qmainwindow.cpp.

{
       using namespace boost::python;

       class_<QMainWindow,bases<QWidget>,boost::noncopyable>(
                     "QMainWindow",
                     "A Qt main window widget");
}

Here is the caller graph for this function:

void export_QObject ( )

Definition at line 13 of file scripter2_qtclass_qobject.cpp.

{
       using namespace boost::python;

       class_<QObject, boost::noncopyable>(
                     "QObject",
                     "A generic Qt object");
}

Here is the caller graph for this function:

Definition at line 11 of file scripter2_qtclass_qscrollview.cpp.

{
       using namespace boost::python;

       class_<QScrollView,bases<QFrame>,boost::noncopyable>(
                     "QScrollView",
                     "A generic Qt scroll view widget");
}

Here is the caller graph for this function:

void export_QString ( )

Definition at line 118 of file scripter2_qttype_qstring.cpp.

{
       boost::python::to_python_converter<QString, QString_to_python_unicode>();
       QString_from_python_str_or_unicode();
}

Here is the caller graph for this function:

void export_QWidget ( )

Definition at line 13 of file scripter2_qtclass_qwidget.cpp.

{
       using namespace boost::python;

       class_<QWidget,bases<QObject>,boost::noncopyable>(
                     "QWidget",
                     "A generic Qt widget")
              .def("show", &QWidget::show)
              .def("hide", &QWidget::hide);
}

Here is the caller graph for this function:

Definition at line 24 of file scripter2_scribus_scribusdoc.cpp.

{
       using namespace boost::python;

       scope d = class_<ScribusDoc, bases<QObject>, boost::noncopyable>("ScribusDoc",
                                   "A Scribus document",
                                   no_init)
              .add_property("isModified", &ScribusDoc::isModified, &ScribusDoc::setModified);
       /*
              .add_property("items", &getDocItems)
              .add_property("masterPageItems", &getMasterItems);
              */
}

Here is the caller graph for this function:

Definition at line 14 of file scripter2_scribus_scribusmainwin.cpp.

{
       using namespace boost::python;

       class_<ScribusMainWindow, bases<QWidget>, boost::noncopyable>(
                     "ScribusMainWindow",
                     "The app's main window, which also provides much of its core functionality",
                     no_init)
              .add_property("doc", make_getter(&ScribusMainWindow::doc, return_internal_reference<>()))
              .add_property("view", make_getter(&ScribusMainWindow::view, return_internal_reference<>()))
              .add_property("ActWin", make_getter(&ScribusMainWindow::ActWin, return_internal_reference<>()));

       scope().attr("ScMW") = boost::ref(ScMW);
}

Here is the caller graph for this function:

Definition at line 15 of file scripter2_scribus_scribusqapp.cpp.

{
       using namespace boost::python;

       class_<ScribusQApp, bases<QApplication>, boost::noncopyable>("ScribusQApp",
                     "The core application",
                     no_init)
              .add_property("usingGUI", &ScribusQApp::usingGUI)
              .add_property("isMacGUI", &ScribusQApp::isMacGUI)
              .add_property("reverseDialogButtons", &ScribusQApp::reverseDialogButtons);

       scope().attr("ScQApp") = boost::ref(ScQApp);
}

Here is the caller graph for this function:

Definition at line 62 of file scripter2_scribusstructs.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 11 of file scripter2_scribus_scribusview.cpp.

{
       using namespace boost::python;

       scope w = class_<ScribusView, bases<QScrollView>, boost::noncopyable>("ScribusView",
                                   "The document display canvas",
                                   no_init);
}

Here is the caller graph for this function:

Definition at line 11 of file scripter2_scribus_scribuswin.cpp.

{
       using namespace boost::python;

       class_<ScribusWin, bases<QMainWindow>, boost::noncopyable>("ScribusWin",
                     "A Scribus document window",
                     no_init);
}

Here is the caller graph for this function:

void export_styles ( )

Definition at line 100 of file scripter2_styles.cpp.

{
       def("getStyleRef", getStyleRef, return_internal_reference<>());
       def("getStyleVal", getStyleVal);
       def("getStyleRefi", getStyleRefi, return_internal_reference<>());
       def("getStyleVali", getStyleVali);
       def("addStyle", addStyle);
       def("getStylesVal", getStylesVal);
       def("getStylesRef", getStylesRef);
       def("getStyleNames", getStyleNames);
}

Here is the call graph for this function:

Here is the caller graph for this function:

void scripter2_init ( )

Initialize the module, including calling initscribus2()

This method should be a no-op if we've been built without support for Boost::Python

Definition at line 82 of file scripter2_base.cpp.

{
       initscribus2();
}