Path: blob/devel/ElmerGUI/PythonQt/src/PythonQtSlot.h
3206 views
#ifndef _PYTHONQTSLOT_H1#define _PYTHONQTSLOT_H23/*4*5* Copyright (C) 2006 MeVis Research GmbH All Rights Reserved.6*7* This library is free software; you can redistribute it and/or8* modify it under the terms of the GNU Lesser General Public9* License as published by the Free Software Foundation; either10* version 2.1 of the License, or (at your option) any later version.11*12* This library is distributed in the hope that it will be useful,13* but WITHOUT ANY WARRANTY; without even the implied warranty of14* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU15* Lesser General Public License for more details.16*17* Further, this software is distributed without any warranty that it is18* free of the rightful claim of any third person regarding infringement19* or the like. Any license provided herein, whether implied or20* otherwise, applies only to this software file. Patent licenses, if21* any, provided herein do not apply to combinations of this program with22* other software, or any other product whatsoever.23*24* You should have received a copy of the GNU Lesser General Public25* License along with this library; if not, write to the Free Software26* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA27*28* Contact information: MeVis Research GmbH, Universitaetsallee 29,29* 28359 Bremen, Germany or:30*31* http://www.mevis.de32*33*/3435//----------------------------------------------------------------------------------36/*!37// \file PythonQtSlot.h38// \author Florian Link39// \author Last changed by $Author: florian $40// \date 2006-0541*/42//----------------------------------------------------------------------------------4344#include "Python.h"45#include "structmember.h"4647class PythonQtSlotInfo;4849extern PyTypeObject PythonQtSlotFunction_Type;5051#define PythonQtSlotFunction_Check(op) ((op)->ob_type == &PythonQtSlotFunction_Type)5253PythonQtSlotInfo* PythonQtSlotFunction_GetSlotInfo(PyObject *);54PyObject* PythonQtSlotFunction_GetSelf(PyObject *);5556/* Macros for direct access to these values. Type checks are *not*57done, so use with care. */58#define PythonQtSlotFunction_GET_SELF(func) \59(((PythonQtSlotFunctionObject *)func) -> m_self)6061PyObject* PythonQtSlotFunction_Call(PyObject *, PyObject *, PyObject *);6263PyObject *PythonQtSlotFunction_CallImpl(QObject* objectToCall, PythonQtSlotInfo* info, PyObject *args, PyObject *kw, bool isVariantCall=false, void* firstArg=NULL);646566PyObject* PythonQtSlotFunction_New(PythonQtSlotInfo *, PyObject *,67PyObject *);6869//! defines a python object that stores a Qt slot info70typedef struct {71PyObject_HEAD72PythonQtSlotInfo *m_ml; /* Description of the C function to call */73PyObject *m_self; /* Passed as 'self' arg to the C func, can be NULL */74PyObject *m_module; /* The __module__ attribute, can be anything */75} PythonQtSlotFunctionObject;767778#endif798081