Blender V5.0
gpu_py_select.cc
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2023 Blender Authors
2 *
3 * SPDX-License-Identifier: GPL-2.0-or-later */
4
16
17#include <Python.h>
18
20
21#include "GPU_select.hh"
22
23#include "gpu_py.hh"
24#include "gpu_py_select.hh" /* Own include. */
25
26/* -------------------------------------------------------------------- */
29
31 /* Wrap. */
32 pygpu_select_load_id_doc,
33 ".. function:: load_id(id)\n"
34 "\n"
35 " Set the selection ID.\n"
36 "\n"
37 " :arg id: Number (32-bit uint).\n"
38 " :type select: int\n");
39static PyObject *pygpu_select_load_id(PyObject * /*self*/, PyObject *value)
40{
42
43 uint id;
44 if ((id = PyC_Long_AsU32(value)) == uint(-1)) {
45 return nullptr;
46 }
48 Py_RETURN_NONE;
49}
50
52
53/* -------------------------------------------------------------------- */
56
57static PyMethodDef pygpu_select__tp_methods[] = {
58 /* Manage Stack */
59 {"load_id", (PyCFunction)pygpu_select_load_id, METH_O, pygpu_select_load_id_doc},
60 {nullptr, nullptr, 0, nullptr},
61};
62
64 /* Wrap. */
65 pygpu_select__tp_doc,
66 "This module provides access to selection.");
67static PyModuleDef pygpu_select_module_def = {
68 /*m_base*/ PyModuleDef_HEAD_INIT,
69 /*m_name*/ "gpu.select",
70 /*m_doc*/ pygpu_select__tp_doc,
71 /*m_size*/ 0,
72 /*m_methods*/ pygpu_select__tp_methods,
73 /*m_slots*/ nullptr,
74 /*m_traverse*/ nullptr,
75 /*m_clear*/ nullptr,
76 /*m_free*/ nullptr,
77};
78
80{
81 PyObject *submodule;
82
83 submodule = PyModule_Create(&pygpu_select_module_def);
84
85 return submodule;
86}
87
unsigned int uint
bool GPU_select_load_id(unsigned int id)
#define BPYGPU_IS_INIT_OR_ERROR_OBJ
Definition gpu_py.hh:20
static PyModuleDef pygpu_select_module_def
PyDoc_STRVAR(pygpu_select_load_id_doc, ".. function:: load_id(id)\n" "\n" " Set the selection ID.\n" "\n" " :arg id: Number (32-bit uint).\n" " :type select: int\n")
static PyMethodDef pygpu_select__tp_methods[]
static PyObject * pygpu_select_load_id(PyObject *, PyObject *value)
PyObject * bpygpu_select_init()
uint32_t PyC_Long_AsU32(PyObject *value)