Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
ElmerCSC
GitHub Repository: ElmerCSC/elmerfem
Path: blob/devel/ElmerGUI/PythonQt/src/PythonQtSlot.h
3206 views
1
#ifndef _PYTHONQTSLOT_H
2
#define _PYTHONQTSLOT_H
3
4
/*
5
*
6
* Copyright (C) 2006 MeVis Research GmbH All Rights Reserved.
7
*
8
* This library is free software; you can redistribute it and/or
9
* modify it under the terms of the GNU Lesser General Public
10
* License as published by the Free Software Foundation; either
11
* version 2.1 of the License, or (at your option) any later version.
12
*
13
* This library is distributed in the hope that it will be useful,
14
* but WITHOUT ANY WARRANTY; without even the implied warranty of
15
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16
* Lesser General Public License for more details.
17
*
18
* Further, this software is distributed without any warranty that it is
19
* free of the rightful claim of any third person regarding infringement
20
* or the like. Any license provided herein, whether implied or
21
* otherwise, applies only to this software file. Patent licenses, if
22
* any, provided herein do not apply to combinations of this program with
23
* other software, or any other product whatsoever.
24
*
25
* You should have received a copy of the GNU Lesser General Public
26
* License along with this library; if not, write to the Free Software
27
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
28
*
29
* Contact information: MeVis Research GmbH, Universitaetsallee 29,
30
* 28359 Bremen, Germany or:
31
*
32
* http://www.mevis.de
33
*
34
*/
35
36
//----------------------------------------------------------------------------------
37
/*!
38
// \file PythonQtSlot.h
39
// \author Florian Link
40
// \author Last changed by $Author: florian $
41
// \date 2006-05
42
*/
43
//----------------------------------------------------------------------------------
44
45
#include "Python.h"
46
#include "structmember.h"
47
48
class PythonQtSlotInfo;
49
50
extern PyTypeObject PythonQtSlotFunction_Type;
51
52
#define PythonQtSlotFunction_Check(op) ((op)->ob_type == &PythonQtSlotFunction_Type)
53
54
PythonQtSlotInfo* PythonQtSlotFunction_GetSlotInfo(PyObject *);
55
PyObject* PythonQtSlotFunction_GetSelf(PyObject *);
56
57
/* Macros for direct access to these values. Type checks are *not*
58
done, so use with care. */
59
#define PythonQtSlotFunction_GET_SELF(func) \
60
(((PythonQtSlotFunctionObject *)func) -> m_self)
61
62
PyObject* PythonQtSlotFunction_Call(PyObject *, PyObject *, PyObject *);
63
64
PyObject *PythonQtSlotFunction_CallImpl(QObject* objectToCall, PythonQtSlotInfo* info, PyObject *args, PyObject *kw, bool isVariantCall=false, void* firstArg=NULL);
65
66
67
PyObject* PythonQtSlotFunction_New(PythonQtSlotInfo *, PyObject *,
68
PyObject *);
69
70
//! defines a python object that stores a Qt slot info
71
typedef struct {
72
PyObject_HEAD
73
PythonQtSlotInfo *m_ml; /* Description of the C function to call */
74
PyObject *m_self; /* Passed as 'self' arg to the C func, can be NULL */
75
PyObject *m_module; /* The __module__ attribute, can be anything */
76
} PythonQtSlotFunctionObject;
77
78
79
#endif
80
81