[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [13994] trunk/blender/source/blender/ python/api2_2x: PyAPI - Window.TestBreak() - True if the user pressed escape.
Campbell Barton
ideasman42 at gmail.com
Thu Mar 6 23:45:19 CET 2008
Revision: 13994
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=13994
Author: campbellbarton
Date: 2008-03-06 23:45:11 +0100 (Thu, 06 Mar 2008)
Log Message:
-----------
PyAPI - Window.TestBreak() - True if the user pressed escape.
Modified Paths:
--------------
trunk/blender/source/blender/python/api2_2x/Window.c
trunk/blender/source/blender/python/api2_2x/doc/Window.py
Modified: trunk/blender/source/blender/python/api2_2x/Window.c
===================================================================
--- trunk/blender/source/blender/python/api2_2x/Window.c 2008-03-06 21:43:22 UTC (rev 13993)
+++ trunk/blender/source/blender/python/api2_2x/Window.c 2008-03-06 22:45:11 UTC (rev 13994)
@@ -106,6 +106,7 @@
static PyObject *M_Window_QRead( PyObject * self );
static PyObject *M_Window_QAdd( PyObject * self, PyObject * args );
static PyObject *M_Window_QHandle( PyObject * self, PyObject * args );
+static PyObject *M_Window_TestBreak( PyObject * self );
static PyObject *M_Window_GetMouseCoords( PyObject * self );
static PyObject *M_Window_SetMouseCoords( PyObject * self, PyObject * args );
static PyObject *M_Window_GetMouseButtons( PyObject * self );
@@ -250,6 +251,9 @@
(win) - int: the window id, see Blender.Window.GetScreenInfo().\n\n\
See Blender.Window.QAdd() for how to send events to a particular window.";
+static char M_Window_TestBreak_doc[] =
+ "() - Returns true if the user has pressed escape.";
+
static char M_Window_GetMouseCoords_doc[] =
"() - Get mouse pointer's current screen coordinates.";
@@ -373,6 +377,8 @@
M_Window_QAdd_doc},
{"QHandle", ( PyCFunction ) M_Window_QHandle, METH_VARARGS,
M_Window_QHandle_doc},
+ {"TestBreak", ( PyCFunction ) M_Window_TestBreak, METH_VARARGS,
+ M_Window_TestBreak_doc},
{"GetMouseCoords", ( PyCFunction ) M_Window_GetMouseCoords,
METH_NOARGS,
M_Window_GetMouseCoords_doc},
@@ -1262,6 +1268,15 @@
Py_RETURN_NONE;
}
+static PyObject *M_Window_TestBreak( PyObject * self )
+{
+ if (blender_test_break()) {
+ Py_RETURN_TRUE;
+ } else {
+ Py_RETURN_FALSE;
+ }
+}
+
static PyObject *M_Window_GetMouseCoords( PyObject * self )
{
short mval[2];
Modified: trunk/blender/source/blender/python/api2_2x/doc/Window.py
===================================================================
--- trunk/blender/source/blender/python/api2_2x/doc/Window.py 2008-03-06 21:43:22 UTC (rev 13993)
+++ trunk/blender/source/blender/python/api2_2x/doc/Window.py 2008-03-06 22:45:11 UTC (rev 13994)
@@ -434,6 +434,12 @@
@param winId: the window id, see L{GetScreenInfo}.
@note: see L{QAdd} for how to send events to a particular window.
"""
+def TestBreak ():
+ """
+ Return true if the user has pressed escape
+ @rtype: bool
+ @return: a boolean from a test if the user pressed escape
+ """
def GetMouseCoords ():
"""
More information about the Bf-blender-cvs
mailing list