Skip to content

Commit 86196fa

Browse files
author
Roberto De Ioris
committed
added SColorBlock
1 parent 4d45b72 commit 86196fa

File tree

4 files changed

+79
-0
lines changed

4 files changed

+79
-0
lines changed
Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
2+
#include "UnrealEnginePythonPrivatePCH.h"
3+
4+
#include "UEPySColorBlock.h"
5+
6+
#define sw_color_block StaticCastSharedRef<SColorBlock>(self->s_leaf_widget.s_widget.s_widget)
7+
8+
static PyMethodDef ue_PySColorBlock_methods[] = {
9+
{ NULL } /* Sentinel */
10+
};
11+
12+
PyTypeObject ue_PySColorBlockType = {
13+
PyVarObject_HEAD_INIT(NULL, 0)
14+
"unreal_engine.SColorBlock", /* tp_name */
15+
sizeof(ue_PySColorBlock), /* tp_basicsize */
16+
0, /* tp_itemsize */
17+
0, /* tp_dealloc */
18+
0, /* tp_print */
19+
0, /* tp_getattr */
20+
0, /* tp_setattr */
21+
0, /* tp_reserved */
22+
0, /* tp_repr */
23+
0, /* tp_as_number */
24+
0, /* tp_as_sequence */
25+
0, /* tp_as_mapping */
26+
0, /* tp_hash */
27+
0, /* tp_call */
28+
0, /* tp_str */
29+
0, /* tp_getattro */
30+
0, /* tp_setattro */
31+
0, /* tp_as_buffer */
32+
Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /* tp_flags */
33+
"Unreal Engine SColorBlock", /* tp_doc */
34+
0, /* tp_traverse */
35+
0, /* tp_clear */
36+
0, /* tp_richcompare */
37+
0, /* tp_weaklistoffset */
38+
0, /* tp_iter */
39+
0, /* tp_iternext */
40+
ue_PySColorBlock_methods, /* tp_methods */
41+
};
42+
43+
static int ue_py_scolor_block_init(ue_PySColorBlock *self, PyObject *args, PyObject *kwargs) {
44+
ue_py_snew_simple(SColorBlock, s_leaf_widget.s_widget);
45+
return 0;
46+
}
47+
48+
void ue_python_init_scolor_block(PyObject *ue_module) {
49+
50+
ue_PySColorBlockType.tp_init = (initproc)ue_py_scolor_block_init;
51+
52+
ue_PySColorBlockType.tp_base = &ue_PySLeafWidgetType;
53+
54+
if (PyType_Ready(&ue_PySColorBlockType) < 0)
55+
return;
56+
57+
Py_INCREF(&ue_PySColorBlockType);
58+
PyModule_AddObject(ue_module, "SColorBlock", (PyObject *)&ue_PySColorBlockType);
59+
}
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
#pragma once
2+
3+
#include "UnrealEnginePython.h"
4+
5+
6+
#include "UEPySLeafWidget.h"
7+
8+
#include "Runtime/Slate/Public/Widgets/Colors/SColorBlock.h"
9+
10+
extern PyTypeObject ue_PySColorBlockType;
11+
12+
typedef struct {
13+
ue_PySLeafWidget s_leaf_widget;
14+
/* Type-specific fields go here. */
15+
} ue_PySColorBlock;
16+
17+
void ue_python_init_scolor_block(PyObject *);

Source/UnrealEnginePython/Private/Slate/UEPySlate.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -566,6 +566,8 @@ void ue_python_init_slate(PyObject *module) {
566566
ue_python_init_srotator_input_box(module);
567567
ue_python_init_spython_combo_box(module);
568568
ue_python_init_sscroll_box(module);
569+
ue_python_init_scolor_block(module);
570+
569571

570572

571573
#if WITH_EDITOR

Source/UnrealEnginePython/Private/Slate/UEPySlate.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@
4949
#include "UEPySRotatorInputBox.h"
5050
#include "UEPySPythonComboBox.h"
5151
#include "UEPySScrollBox.h"
52+
#include "UEPySColorBlock.h"
5253

5354

5455

0 commit comments

Comments
 (0)