blob: e6f1100c8ea1f5d335ab1936e6a25762053f5962 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
|
/*
For general Scribus (>=1.3.2) copyright and licensing information please refer
to the COPYING file provided with the program. Following this notice may exist
a copyright and/or license notice that predates the release of Scribus 1.3.2
for which a new license (GPL+exception) is in place.
*/
#include "cmdvar.h"
#include "scribusstructs.h"
using namespace boost::python;
// Declare the export functions from the implementation
extern void export_QString();
extern void export_QObject();
extern void export_QWidget();
extern void export_QFrame();
extern void export_QScrollView();
extern void export_QMainWindow();
extern void export_QApplication();
extern void export_ScribusStructs();
extern void export_PageItem();
extern void export_ScribusMainWindow();
extern void export_ScribusQApp();
extern void export_ScribusWin();
extern void export_ScribusDoc();
extern void export_ScribusView();
extern void export_styles();
/**
* @brief A simple test function to wrap with Boost::Python
*/
int add_five(int x)
{
return x+5;
}
/**
* @brief Define the scribus2 module
*/
BOOST_PYTHON_MODULE(scribus2)
{
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");
}
/**
* @brief Initialize the module, including calling initscribus2()
*
* This method should be a no-op if we've been built without support
* for Boost::Python
*/
void scripter2_init()
{
initscribus2();
}
|