|
| 1 | +#if WITH_EDITOR |
| 2 | +#include "UnrealEnginePythonPrivatePCH.h" |
| 3 | + |
| 4 | +#include "UEPySFilePathPicker.h" |
| 5 | + |
| 6 | +#define sw_file_path_picker StaticCastSharedRef<SFilePathPicker>(self->s_compound_widget.s_widget.s_widget) |
| 7 | + |
| 8 | + |
| 9 | +static PyMethodDef ue_PySFilePathPicker_methods[] = { |
| 10 | + { NULL } /* Sentinel */ |
| 11 | +}; |
| 12 | + |
| 13 | +PyTypeObject ue_PySFilePathPickerType = { |
| 14 | + PyVarObject_HEAD_INIT(NULL, 0) |
| 15 | + "unreal_engine.SFilePathPicker", /* tp_name */ |
| 16 | + sizeof(ue_PySFilePathPicker), /* tp_basicsize */ |
| 17 | + 0, /* tp_itemsize */ |
| 18 | + 0, /* tp_dealloc */ |
| 19 | + 0, /* tp_print */ |
| 20 | + 0, /* tp_getattr */ |
| 21 | + 0, /* tp_setattr */ |
| 22 | + 0, /* tp_reserved */ |
| 23 | + 0, /* tp_repr */ |
| 24 | + 0, /* tp_as_number */ |
| 25 | + 0, /* tp_as_sequence */ |
| 26 | + 0, /* tp_as_mapping */ |
| 27 | + 0, /* tp_hash */ |
| 28 | + 0, /* tp_call */ |
| 29 | + 0, /* tp_str */ |
| 30 | + 0, /* tp_getattro */ |
| 31 | + 0, /* tp_setattro */ |
| 32 | + 0, /* tp_as_buffer */ |
| 33 | + Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /* tp_flags */ |
| 34 | + "Unreal Engine FilePathPicker", /* tp_doc */ |
| 35 | + 0, /* tp_traverse */ |
| 36 | + 0, /* tp_clear */ |
| 37 | + 0, /* tp_richcompare */ |
| 38 | + 0, /* tp_weaklistoffset */ |
| 39 | + 0, /* tp_iter */ |
| 40 | + 0, /* tp_iternext */ |
| 41 | + ue_PySFilePathPicker_methods, /* tp_methods */ |
| 42 | +}; |
| 43 | + |
| 44 | +static int ue_py_sfile_path_picker_init(ue_PySFilePathPicker *self, PyObject *args, PyObject *kwargs) { |
| 45 | + ue_py_slate_setup_farguments(SFilePathPicker); |
| 46 | + |
| 47 | + ue_py_slate_farguments_optional_struct_ptr("browse_button_image", BrowseButtonImage, FSlateBrush); |
| 48 | + ue_py_slate_farguments_optional_struct_ptr("browse_button_style", BrowseButtonStyle, FButtonStyle); |
| 49 | + ue_py_slate_farguments_text("browse_button_tool_tip", BrowseButtonToolTip); |
| 50 | + ue_py_slate_farguments_string("browse_directory", BrowseDirectory); |
| 51 | + ue_py_slate_farguments_text("browse_title", BrowseTitle); |
| 52 | + ue_py_slate_farguments_string("file_path", FilePath); |
| 53 | + ue_py_slate_farguments_string("file_type_filter", FileTypeFilter); |
| 54 | + ue_py_slate_farguments_struct("font", Font, FSlateFontInfo); |
| 55 | + ue_py_slate_farguments_bool("is_read_only", IsReadOnly); |
| 56 | + ue_py_slate_farguments_event("on_path_picked", OnPathPicked, FOnPathPicked, OnStringChanged); |
| 57 | + |
| 58 | + ue_py_snew(SFilePathPicker, s_compound_widget.s_widget); |
| 59 | + return 0; |
| 60 | +} |
| 61 | + |
| 62 | +void ue_python_init_sfile_path_picker(PyObject *ue_module) { |
| 63 | + |
| 64 | + ue_PySFilePathPickerType.tp_init = (initproc)ue_py_sfile_path_picker_init; |
| 65 | + |
| 66 | + ue_PySFilePathPickerType.tp_base = &ue_PySCompoundWidgetType; |
| 67 | + |
| 68 | + if (PyType_Ready(&ue_PySFilePathPickerType) < 0) |
| 69 | + return; |
| 70 | + |
| 71 | + Py_INCREF(&ue_PySFilePathPickerType); |
| 72 | + PyModule_AddObject(ue_module, "SFilePathPicker", (PyObject *)&ue_PySFilePathPickerType); |
| 73 | +} |
| 74 | +#endif |
0 commit comments