Blender V4.3
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
17#include <Python.h>
18
19#include "BLI_utildefines.h"
20
22
23#include "GPU_select.hh"
24
25#include "gpu_py.hh"
26#include "gpu_py_select.hh" /* Own include. */
27
28/* -------------------------------------------------------------------- */
33 /* Wrap. */
34 pygpu_select_load_id_doc,
35 ".. function:: load_id(id)\n"
36 "\n"
37 " Set the selection ID.\n"
38 "\n"
39 " :arg id: Number (32-bit uint).\n"
40 " :type select: int\n");
41static PyObject *pygpu_select_load_id(PyObject * /*self*/, PyObject *value)
42{
44
45 uint id;
46 if ((id = PyC_Long_AsU32(value)) == uint(-1)) {
47 return nullptr;
48 }
50 Py_RETURN_NONE;
51}
52
55/* -------------------------------------------------------------------- */
59static PyMethodDef pygpu_select__tp_methods[] = {
60 /* Manage Stack */
61 {"load_id", (PyCFunction)pygpu_select_load_id, METH_O, pygpu_select_load_id_doc},
62 {nullptr, nullptr, 0, nullptr},
63};
64
66 /* Wrap. */
67 pygpu_select__tp_doc,
68 "This module provides access to selection.");
69static PyModuleDef pygpu_select_module_def = {
70 /*m_base*/ PyModuleDef_HEAD_INIT,
71 /*m_name*/ "gpu.select",
72 /*m_doc*/ pygpu_select__tp_doc,
73 /*m_size*/ 0,
74 /*m_methods*/ pygpu_select__tp_methods,
75 /*m_slots*/ nullptr,
76 /*m_traverse*/ nullptr,
77 /*m_clear*/ nullptr,
78 /*m_free*/ nullptr,
79};
80
82{
83 PyObject *submodule;
84
85 submodule = PyModule_Create(&pygpu_select_module_def);
86
87 return submodule;
88}
89
unsigned int uint
bool GPU_select_load_id(unsigned int id)
#define BPYGPU_IS_INIT_OR_ERROR_OBJ
Definition gpu_py.hh:18
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)