1+
2+ #if WITH_EDITOR
3+
4+
5+ #include " UnrealEnginePythonPrivatePCH.h"
6+ #include " Runtime/Projects/Public/Interfaces/IPluginManager.h"
7+
8+ static PyObject *py_ue_iplugin_get_name (ue_PyIPlugin *self, PyObject * args) {
9+ return PyUnicode_FromString (TCHAR_TO_UTF8 (*(self->plugin ->GetName ())));
10+ }
11+
12+
13+ static PyMethodDef ue_PyIPlugin_methods[] = {
14+ { " get_name" , (PyCFunction)py_ue_iplugin_get_name, METH_VARARGS , " " },
15+ { NULL } /* Sentinel */
16+ };
17+
18+ static PyObject *py_ue_iplugin_get_category (ue_PyIPlugin *self, void *closure) {
19+ return PyUnicode_FromString (TCHAR_TO_UTF8 (*(self->plugin ->GetDescriptor ().Category )));
20+ }
21+
22+ static PyGetSetDef ue_PyIPlugin_getseters[] = {
23+ { (char *)" category" , (getter)py_ue_iplugin_get_category, NULL , (char *)" " , NULL },
24+ { NULL } /* Sentinel */
25+ };
26+
27+ static PyObject *ue_PyIPlugin_str (ue_PyIPlugin *self)
28+ {
29+ return PyUnicode_FromFormat (" <unreal_engine.EdGraphPin {'name': '%s'}>" ,
30+ TCHAR_TO_UTF8 (*self->plugin ->GetName ()));
31+ }
32+
33+ static PyTypeObject ue_PyIPluginType = {
34+ PyVarObject_HEAD_INIT (NULL , 0 )
35+ " unreal_engine.IPlugin" , /* tp_name */
36+ sizeof (ue_PyIPlugin), /* tp_basicsize */
37+ 0 , /* tp_itemsize */
38+ 0 , /* tp_dealloc */
39+ 0 , /* tp_print */
40+ 0 , /* tp_getattr */
41+ 0 , /* tp_setattr */
42+ 0 , /* tp_reserved */
43+ 0 , /* tp_repr */
44+ 0 , /* tp_as_number */
45+ 0 , /* tp_as_sequence */
46+ 0 , /* tp_as_mapping */
47+ 0 , /* tp_hash */
48+ 0 , /* tp_call */
49+ (reprfunc)ue_PyIPlugin_str, /* tp_str */
50+ 0 , /* tp_getattro */
51+ 0 , /* tp_setattro */
52+ 0 , /* tp_as_buffer */
53+ Py_TPFLAGS_DEFAULT, /* tp_flags */
54+ " Unreal Engine Editor IPlugin" , /* tp_doc */
55+ 0 , /* tp_traverse */
56+ 0 , /* tp_clear */
57+ 0 , /* tp_richcompare */
58+ 0 , /* tp_weaklistoffset */
59+ 0 , /* tp_iter */
60+ 0 , /* tp_iternext */
61+ ue_PyIPlugin_methods, /* tp_methods */
62+ 0 ,
63+ ue_PyIPlugin_getseters,
64+ };
65+
66+
67+ void ue_python_init_iplugin (PyObject *ue_module) {
68+ ue_PyIPluginType.tp_new = PyType_GenericNew;
69+
70+ if (PyType_Ready (&ue_PyIPluginType) < 0 )
71+ return ;
72+
73+ Py_INCREF (&ue_PyIPluginType);
74+ PyModule_AddObject (ue_module, " IPlugin" , (PyObject *)&ue_PyIPluginType);
75+ }
76+
77+ PyObject *py_ue_new_iplugin (IPlugin *plugin) {
78+ ue_PyIPlugin *ret = (ue_PyIPlugin *)PyObject_New (ue_PyIPlugin, &ue_PyIPluginType);
79+ ret->plugin = plugin;
80+ return (PyObject *)ret;
81+ }
82+ #endif
0 commit comments