SourceForge.net Logo
PythonQt
PythonQtSlot.h
Go to the documentation of this file.
00001 #ifndef _PYTHONQTSLOT_H
00002 #define _PYTHONQTSLOT_H
00003 
00004 /*
00005  *
00006  *  Copyright (C) 2010 MeVis Medical Solutions AG All Rights Reserved.
00007  *
00008  *  This library is free software; you can redistribute it and/or
00009  *  modify it under the terms of the GNU Lesser General Public
00010  *  License as published by the Free Software Foundation; either
00011  *  version 2.1 of the License, or (at your option) any later version.
00012  *
00013  *  This library is distributed in the hope that it will be useful,
00014  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00015  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00016  *  Lesser General Public License for more details.
00017  *
00018  *  Further, this software is distributed without any warranty that it is
00019  *  free of the rightful claim of any third person regarding infringement
00020  *  or the like.  Any license provided herein, whether implied or
00021  *  otherwise, applies only to this software file.  Patent licenses, if
00022  *  any, provided herein do not apply to combinations of this program with
00023  *  other software, or any other product whatsoever.
00024  *
00025  *  You should have received a copy of the GNU Lesser General Public
00026  *  License along with this library; if not, write to the Free Software
00027  *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00028  *
00029  *  Contact information: MeVis Medical Solutions AG, Universitaetsallee 29,
00030  *  28359 Bremen, Germany or:
00031  *
00032  *  http://www.mevis.de
00033  *
00034  */
00035 
00036 //----------------------------------------------------------------------------------
00043 //----------------------------------------------------------------------------------
00044 
00045 #include "PythonQtPythonInclude.h"
00046 
00047 #include "PythonQtSystem.h"
00048 #include "structmember.h"
00049 
00050 class PythonQtSlotInfo;
00051 
00052 extern PYTHONQT_EXPORT PyTypeObject PythonQtSlotFunction_Type;
00053 
00054 #define PythonQtSlotFunction_Check(op) ((op)->ob_type == &PythonQtSlotFunction_Type)
00055 
00056 PythonQtSlotInfo* PythonQtSlotFunction_GetSlotInfo(PyObject *);
00057 PyObject* PythonQtSlotFunction_GetSelf(PyObject *);
00058 
00059 /* Macros for direct access to these values. Type checks are *not*
00060    done, so use with care. */
00061 #define PythonQtSlotFunction_GET_SELF(func) \
00062   (((PythonQtSlotFunctionObject *)func) -> m_self)
00063 
00064 PyObject* PythonQtSlotFunction_Call(PyObject *, PyObject *, PyObject *);
00065 
00066 PyObject *PythonQtSlotFunction_CallImpl(PythonQtClassInfo* classInfo, QObject* objectToCall, PythonQtSlotInfo* info, PyObject *args, PyObject *kw, void* firstArg=NULL,  void** directReturnValuePointer=NULL);
00067 
00068 PyObject* PythonQtSlotFunction_New(PythonQtSlotInfo *, PyObject *,
00069            PyObject *);
00070 
00071 PyObject *PythonQtMemberFunction_Call(PythonQtSlotInfo* info, PyObject* m_self, PyObject *args, PyObject *kw);
00072 PyObject *PythonQtMemberFunction_parameterTypes(PythonQtSlotInfo* theInfo);
00073 PyObject *PythonQtMemberFunction_parameterNames(PythonQtSlotInfo* theInfo);
00074 PyObject *PythonQtMemberFunction_typeName(PythonQtSlotInfo* theInfo);
00075 
00077 typedef struct {
00078     PyObject_HEAD
00079     PythonQtSlotInfo *m_ml; /* Description of the C function to call */
00080     PyObject    *m_self; /* Passed as 'self' arg to the C func, can be NULL */
00081     PyObject    *m_module; /* The __module__ attribute, can be anything */
00082 } PythonQtSlotFunctionObject;
00083 
00084 
00085 #endif