Blender  V3.3
gpu_py_select.c
Go to the documentation of this file.
1 /* SPDX-License-Identifier: GPL-2.0-or-later */
2 
15 #include <Python.h>
16 
17 #include "BLI_utildefines.h"
18 
19 #include "../generic/py_capi_utils.h"
20 
21 #include "GPU_select.h"
22 
23 #include "gpu_py_select.h" /* Own include. */
24 
25 /* -------------------------------------------------------------------- */
29 PyDoc_STRVAR(pygpu_select_load_id_doc,
30  ".. function:: load_id(id)\n"
31  "\n"
32  " Set the selection ID.\n"
33  "\n"
34  " :param id: Number (32-bit uint).\n"
35  " :type select: int\n");
36 static PyObject *pygpu_select_load_id(PyObject *UNUSED(self), PyObject *value)
37 {
38  uint id;
39  if ((id = PyC_Long_AsU32(value)) == (uint)-1) {
40  return NULL;
41  }
43  Py_RETURN_NONE;
44 }
45 
48 /* -------------------------------------------------------------------- */
52 static struct PyMethodDef pygpu_select__tp_methods[] = {
53  /* Manage Stack */
54  {"load_id", (PyCFunction)pygpu_select_load_id, METH_O, pygpu_select_load_id_doc},
55  {NULL, NULL, 0, NULL},
56 };
57 
58 PyDoc_STRVAR(pygpu_select__tp_doc, "This module provides access to selection.");
59 static PyModuleDef pygpu_select_module_def = {
60  PyModuleDef_HEAD_INIT,
61  .m_name = "gpu.select",
62  .m_doc = pygpu_select__tp_doc,
63  .m_methods = pygpu_select__tp_methods,
64 };
65 
66 PyObject *bpygpu_select_init(void)
67 {
68  PyObject *submodule;
69 
70  submodule = PyModule_Create(&pygpu_select_module_def);
71 
72  return submodule;
73 }
74 
unsigned int uint
Definition: BLI_sys_types.h:67
#define UNUSED(x)
bool GPU_select_load_id(unsigned int id)
Definition: gpu_select.c:117
static PyObject * pygpu_select_load_id(PyObject *UNUSED(self), PyObject *value)
Definition: gpu_py_select.c:36
static PyModuleDef pygpu_select_module_def
Definition: gpu_py_select.c:59
static struct PyMethodDef pygpu_select__tp_methods[]
Definition: gpu_py_select.c:52
PyObject * bpygpu_select_init(void)
Definition: gpu_py_select.c:66
PyDoc_STRVAR(pygpu_select_load_id_doc, ".. function:: load_id(id)\n" "\n" " Set the selection ID.\n" "\n" " :param id: Number (32-bit uint).\n" " :type select: int\n")
uint32_t PyC_Long_AsU32(PyObject *value)