Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2011-05-24 20:05:51 +0400
committerCampbell Barton <ideasman42@gmail.com>2011-05-24 20:05:51 +0400
commit15289c60480a31a4064e7132cb208b01cabfdd1b (patch)
tree74324877b02b8a8f8d1597a0911bbe3408a621cf /source/blender/python/generic/blf_py_api.c
parent357ce169589d70b610865a76788a1f1756ff231c (diff)
use PyDoc_STRVAR macro, so its possible to build without docstrings.
Diffstat (limited to 'source/blender/python/generic/blf_py_api.c')
-rw-r--r--source/blender/python/generic/blf_py_api.c83
1 files changed, 42 insertions, 41 deletions
diff --git a/source/blender/python/generic/blf_py_api.c b/source/blender/python/generic/blf_py_api.c
index 0653f967c14..3cf0b0f1f27 100644
--- a/source/blender/python/generic/blf_py_api.c
+++ b/source/blender/python/generic/blf_py_api.c
@@ -36,7 +36,7 @@
-static char py_blf_position_doc[] =
+PyDoc_STRVAR(py_blf_position_doc,
".. function:: position(fontid, x, y, z)\n"
"\n"
" Set the position for drawing text.\n"
@@ -48,7 +48,8 @@ static char py_blf_position_doc[] =
" :arg y: Y axis position to draw the text.\n"
" :type y: float\n"
" :arg z: Z axis position to draw the text.\n"
-" :type z: float\n";
+" :type z: float\n"
+);
static PyObject *py_blf_position(PyObject *UNUSED(self), PyObject *args)
{
@@ -64,7 +65,7 @@ static PyObject *py_blf_position(PyObject *UNUSED(self), PyObject *args)
}
-static char py_blf_size_doc[] =
+PyDoc_STRVAR(py_blf_size_doc,
".. function:: size(fontid, size, dpi)\n"
"\n"
" Set the size and dpi for drawing text.\n"
@@ -74,8 +75,8 @@ static char py_blf_size_doc[] =
" :arg size: Point size of the font.\n"
" :type size: int\n"
" :arg dpi: dots per inch value to use for drawing.\n"
-" :type dpi: int\n";
-
+" :type dpi: int\n"
+);
static PyObject *py_blf_size(PyObject *UNUSED(self), PyObject *args)
{
int fontid, size, dpi;
@@ -89,7 +90,7 @@ static PyObject *py_blf_size(PyObject *UNUSED(self), PyObject *args)
}
-static char py_blf_aspect_doc[] =
+PyDoc_STRVAR(py_blf_aspect_doc,
".. function:: aspect(fontid, aspect)\n"
"\n"
" Set the aspect for drawing text.\n"
@@ -97,8 +98,8 @@ static char py_blf_aspect_doc[] =
" :arg fontid: The id of the typeface as returned by :func:`blf.load`, for default font use 0.\n"
" :type fontid: int\n"
" :arg aspect: The aspect ratio for text drawing to use.\n"
-" :type aspect: float\n";
-
+" :type aspect: float\n"
+);
static PyObject *py_blf_aspect(PyObject *UNUSED(self), PyObject *args)
{
float aspect;
@@ -113,7 +114,7 @@ static PyObject *py_blf_aspect(PyObject *UNUSED(self), PyObject *args)
}
-static char py_blf_blur_doc[] =
+PyDoc_STRVAR(py_blf_blur_doc,
".. function:: blur(fontid, radius)\n"
"\n"
" Set the blur radius for drawing text.\n"
@@ -121,8 +122,8 @@ static char py_blf_blur_doc[] =
" :arg fontid: The id of the typeface as returned by :func:`blf.load`, for default font use 0.\n"
" :type fontid: int\n"
" :arg radius: The radius for blurring text (in pixels).\n"
-" :type radius: int\n";
-
+" :type radius: int\n"
+);
static PyObject *py_blf_blur(PyObject *UNUSED(self), PyObject *args)
{
int blur, fontid;
@@ -136,7 +137,7 @@ static PyObject *py_blf_blur(PyObject *UNUSED(self), PyObject *args)
}
-static char py_blf_draw_doc[] =
+PyDoc_STRVAR(py_blf_draw_doc,
".. function:: draw(fontid, text)\n"
"\n"
" Draw text in the current context.\n"
@@ -144,8 +145,8 @@ static char py_blf_draw_doc[] =
" :arg fontid: The id of the typeface as returned by :func:`blf.load`, for default font use 0.\n"
" :type fontid: int\n"
" :arg text: the text to draw.\n"
-" :type text: string\n";
-
+" :type text: string\n"
+);
static PyObject *py_blf_draw(PyObject *UNUSED(self), PyObject *args)
{
char *text;
@@ -160,7 +161,7 @@ static PyObject *py_blf_draw(PyObject *UNUSED(self), PyObject *args)
Py_RETURN_NONE;
}
-static char py_blf_dimensions_doc[] =
+PyDoc_STRVAR(py_blf_dimensions_doc,
".. function:: dimensions(fontid, text)\n"
"\n"
" Return the width and height of the text.\n"
@@ -170,8 +171,8 @@ static char py_blf_dimensions_doc[] =
" :arg text: the text to draw.\n"
" :type text: string\n"
" :return: the width and height of the text.\n"
-" :rtype: tuple of 2 floats\n";
-
+" :rtype: tuple of 2 floats\n"
+);
static PyObject *py_blf_dimensions(PyObject *UNUSED(self), PyObject *args)
{
char *text;
@@ -190,7 +191,7 @@ static PyObject *py_blf_dimensions(PyObject *UNUSED(self), PyObject *args)
return ret;
}
-static char py_blf_clipping_doc[] =
+PyDoc_STRVAR(py_blf_clipping_doc,
".. function:: clipping(fontid, xmin, ymin, xmax, ymax)\n"
"\n"
" Set the clipping, enable/disable using CLIPPING.\n"
@@ -204,8 +205,8 @@ static char py_blf_clipping_doc[] =
" :arg xmax: Clip the drawing area by these bounds.\n"
" :type xmax: float\n"
" :arg ymax: Clip the drawing area by these bounds.\n"
-" :type ymax: float\n";
-
+" :type ymax: float\n"
+);
static PyObject *py_blf_clipping(PyObject *UNUSED(self), PyObject *args)
{
float xmin, ymin, xmax, ymax;
@@ -219,7 +220,7 @@ static PyObject *py_blf_clipping(PyObject *UNUSED(self), PyObject *args)
Py_RETURN_NONE;
}
-static char py_blf_disable_doc[] =
+PyDoc_STRVAR(py_blf_disable_doc,
".. function:: disable(fontid, option)\n"
"\n"
" Disable option.\n"
@@ -227,8 +228,8 @@ static char py_blf_disable_doc[] =
" :arg fontid: The id of the typeface as returned by :func:`blf.load`, for default font use 0.\n"
" :type fontid: int\n"
" :arg option: One of ROTATION, CLIPPING, SHADOW or KERNING_DEFAULT.\n"
-" :type option: int\n";
-
+" :type option: int\n"
+);
static PyObject *py_blf_disable(PyObject *UNUSED(self), PyObject *args)
{
int option, fontid;
@@ -241,7 +242,7 @@ static PyObject *py_blf_disable(PyObject *UNUSED(self), PyObject *args)
Py_RETURN_NONE;
}
-static char py_blf_enable_doc[] =
+PyDoc_STRVAR(py_blf_enable_doc,
".. function:: enable(fontid, option)\n"
"\n"
" Enable option.\n"
@@ -249,8 +250,8 @@ static char py_blf_enable_doc[] =
" :arg fontid: The id of the typeface as returned by :func:`blf.load`, for default font use 0.\n"
" :type fontid: int\n"
" :arg option: One of ROTATION, CLIPPING, SHADOW or KERNING_DEFAULT.\n"
-" :type option: int\n";
-
+" :type option: int\n"
+);
static PyObject *py_blf_enable(PyObject *UNUSED(self), PyObject *args)
{
int option, fontid;
@@ -263,7 +264,7 @@ static PyObject *py_blf_enable(PyObject *UNUSED(self), PyObject *args)
Py_RETURN_NONE;
}
-static char py_blf_rotation_doc[] =
+PyDoc_STRVAR(py_blf_rotation_doc,
".. function:: rotation(fontid, angle)\n"
"\n"
" Set the text rotation angle, enable/disable using ROTATION.\n"
@@ -271,8 +272,8 @@ static char py_blf_rotation_doc[] =
" :arg fontid: The id of the typeface as returned by :func:`blf.load`, for default font use 0.\n"
" :type fontid: int\n"
" :arg angle: The angle for text drawing to use.\n"
-" :type angle: float\n";
-
+" :type angle: float\n"
+);
static PyObject *py_blf_rotation(PyObject *UNUSED(self), PyObject *args)
{
float angle;
@@ -286,7 +287,7 @@ static PyObject *py_blf_rotation(PyObject *UNUSED(self), PyObject *args)
Py_RETURN_NONE;
}
-static char py_blf_shadow_doc[] =
+PyDoc_STRVAR(py_blf_shadow_doc,
".. function:: shadow(fontid, level, r, g, b, a)\n"
"\n"
" Shadow options, enable/disable using SHADOW .\n"
@@ -302,8 +303,8 @@ static char py_blf_shadow_doc[] =
" :arg b: Shadow color (blue channel 0.0 - 1.0).\n"
" :type b: float\n"
" :arg a: Shadow color (alpha channel 0.0 - 1.0).\n"
-" :type a: float\n";
-
+" :type a: float\n"
+);
static PyObject *py_blf_shadow(PyObject *UNUSED(self), PyObject *args)
{
int level, fontid;
@@ -322,7 +323,7 @@ static PyObject *py_blf_shadow(PyObject *UNUSED(self), PyObject *args)
Py_RETURN_NONE;
}
-static char py_blf_shadow_offset_doc[] =
+PyDoc_STRVAR(py_blf_shadow_offset_doc,
".. function:: shadow_offset(fontid, x, y)\n"
"\n"
" Set the offset for shadow text.\n"
@@ -332,8 +333,8 @@ static char py_blf_shadow_offset_doc[] =
" :arg x: Vertical shadow offset value in pixels.\n"
" :type x: float\n"
" :arg y: Horizontal shadow offset value in pixels.\n"
-" :type y: float\n";
-
+" :type y: float\n"
+);
static PyObject *py_blf_shadow_offset(PyObject *UNUSED(self), PyObject *args)
{
int x, y, fontid;
@@ -346,7 +347,7 @@ static PyObject *py_blf_shadow_offset(PyObject *UNUSED(self), PyObject *args)
Py_RETURN_NONE;
}
-static char py_blf_load_doc[] =
+PyDoc_STRVAR(py_blf_load_doc,
".. function:: load(filename)\n"
"\n"
" Load a new font.\n"
@@ -354,8 +355,8 @@ static char py_blf_load_doc[] =
" :arg filename: the filename of the font.\n"
" :type filename: string\n"
" :return: the new font's fontid or -1 if there was an error.\n"
-" :rtype: integer\n";
-
+" :rtype: integer\n"
+);
static PyObject *py_blf_load(PyObject *UNUSED(self), PyObject *args)
{
char* filename;
@@ -384,9 +385,9 @@ static PyMethodDef BLF_methods[] = {
{NULL, NULL, 0, NULL}
};
-static char BLF_doc[] =
-"This module provides access to blenders text drawing functions.\n";
-
+PyDoc_STRVAR(BLF_doc,
+"This module provides access to blenders text drawing functions."
+);
static struct PyModuleDef BLF_module_def = {
PyModuleDef_HEAD_INIT,
"blf", /* m_name */