Commit: e27c89c7c7c4db37afca8e54f07905973b7a09e3 Author: Jon Denning Date: Mon Feb 6 22:40:10 2023 -0500 Branches: master https://developer.blender.org/rBe27c89c7c7c4db37afca8e54f07905973b7a09e3
Docs: added missing documentation for `WindowManager` methods Added missing documentation for `draw_cursor_add` and `draw_cursor_remove` methods for `WindowManager`. Differential Revision: https://developer.blender.org/D14860 =================================================================== M source/blender/python/intern/bpy_rna_types_capi.c =================================================================== diff --git a/source/blender/python/intern/bpy_rna_types_capi.c b/source/blender/python/intern/bpy_rna_types_capi.c index 2b830eb9ffe..99bcc17654a 100644 --- a/source/blender/python/intern/bpy_rna_types_capi.c +++ b/source/blender/python/intern/bpy_rna_types_capi.c @@ -139,15 +139,48 @@ static int pyrna_WindowManager_clipboard_set(PyObject *UNUSED(self), /** \name Window Manager Type * \{ */ +PyDoc_STRVAR( + pyrna_draw_cursor_add_doc, + ".. method:: draw_cursor_add(callback, args, space_type, region_type)\n" + "\n" + " Add a new draw cursor handler to this space type.\n" + " It will be called every time the cursor for the specified region in the space " + "type will be drawn.\n" + " Note: All arguments are positional only for now.\n" + "\n" + " :param callback:\n" + " A function that will be called when the cursor is drawn.\n" + " It gets the specified arguments as input with the mouse position (tuple) as last " + "argument.\n" + " :type callback: function\n" + " :param args: Arguments that will be passed to the callback.\n" + " :type args: tuple\n" + " :param space_type: The space type the callback draws in; for example ``VIEW_3D``. " + "(:class:`bpy.types.Space.type`)\n" + " :type space_type: str\n" + " :param region_type: The region type the callback draws in; usually ``WINDOW``. " + "(:class:`bpy.types.Region.type`)\n" + " :type region_type: str\n" + " :return: Handler that can be removed later on.\n" + " :rtype: object\n"); + +PyDoc_STRVAR(pyrna_draw_cursor_remove_doc, + ".. method:: draw_cursor_remove(handler)\n" + "\n" + " Remove a draw cursor handler that was added previously.\n" + "\n" + " :param handler: The draw cursor handler that should be removed.\n" + " :type handler: object\n"); + static struct PyMethodDef pyrna_windowmanager_methods[] = { {"draw_cursor_add", (PyCFunction)pyrna_callback_classmethod_add, METH_VARARGS | METH_CLASS, - ""}, + pyrna_draw_cursor_add_doc}, {"draw_cursor_remove", (PyCFunction)pyrna_callback_classmethod_remove, METH_VARARGS | METH_CLASS, - ""}, + pyrna_draw_cursor_remove_doc}, {NULL, NULL, 0, NULL}, }; _______________________________________________ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org List details, subscription details or unsubscribe: https://lists.blender.org/mailman/listinfo/bf-blender-cvs