1
/***************************************************************************
2
* Copyright (c) 2004 Werner Mayer <werner.wm.mayer@gmx.de> *
4
* This file is part of the FreeCAD CAx development system. *
6
* This library is free software; you can redistribute it and/or *
7
* modify it under the terms of the GNU Library General Public *
8
* License as published by the Free Software Foundation; either *
9
* version 2 of the License, or (at your option) any later version. *
11
* This library is distributed in the hope that it will be useful, *
12
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
13
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
14
* GNU Library General Public License for more details. *
16
* You should have received a copy of the GNU Library General Public *
17
* License along with this library; see the file COPYING.LIB. If not, *
18
* write to the Free Software Foundation, Inc., 59 Temple Place, *
19
* Suite 330, Boston, MA 02111-1307, USA *
21
***************************************************************************/
24
#ifndef GUI_PYTHONCONSOLE_PY_H
25
#define GUI_PYTHONCONSOLE_PY_H
27
#include <CXX/Extensions.hxx>
33
* Python class for redirection of stdout to FreeCAD's Python
34
* console window. This allows to show all Python messages in
35
* the same window where the commands are performed.
38
* @author Werner Mayer
40
class PythonStdout : public Py::PythonExtension<PythonStdout>
43
PythonConsole* pyConsole;
46
static void init_type(void); // announce properties and methods
48
PythonStdout(PythonConsole *pc);
52
Py::Object write(const Py::Tuple&);
53
Py::Object flush(const Py::Tuple&);
57
* Python class for redirection of stderr to FreeCAD's Python
58
* console window. This allows to show all Python messages in
59
* the same window where the commands are performed.
62
* @author Werner Mayer
64
class PythonStderr : public Py::PythonExtension<PythonStderr>
67
PythonConsole* pyConsole;
70
static void init_type(void); // announce properties and methods
72
PythonStderr(PythonConsole *pc);
76
Py::Object write(const Py::Tuple&);
77
Py::Object flush(const Py::Tuple&);
81
* Python class for redirection of stdin to an input dialog of Qt.
82
* @author Werner Mayer
84
class PythonStdin : public Py::PythonExtension<PythonStdin>
87
PythonConsole* pyConsole;
90
static void init_type(void); // announce properties and methods
92
PythonStdin(PythonConsole *pc);
96
Py::Object readline(const Py::Tuple&);
101
#endif // GUI_PYTHONCONSOLE_PY_H