Update of /cvsroot/pywin32/pywin32/com/win32com/src/include
In directory sc8-pr-cvs1:/tmp/cvs-serv10436/include
Modified Files:
PyIEnumFORMATETC.h PyIEnumVARIANT.h PythonCOM.h
Log Message:
Tighten up iterator semantics. Only interfaces that explicitly declare
they are an enumerator get the iterator slots and flags. Our 2 interfaces
that support iteration make this declaration.
Index: PyIEnumFORMATETC.h
===================================================================
RCS file: /cvsroot/pywin32/pywin32/com/win32com/src/include/PyIEnumFORMATETC.h,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** PyIEnumFORMATETC.h 23 Oct 2003 02:44:12 -0000 1.2
--- PyIEnumFORMATETC.h 23 Oct 2003 23:42:02 -0000 1.3
***************
*** 10,14 ****
MAKE_PYCOM_CTOR(PyIEnumFORMATETC);
static IEnumFORMATETC *GetI(PyObject *self);
! static PyComTypeObject type;
virtual PyObject *iternext();
--- 10,14 ----
MAKE_PYCOM_CTOR(PyIEnumFORMATETC);
static IEnumFORMATETC *GetI(PyObject *self);
! static PyComEnumTypeObject type;
virtual PyObject *iternext();
Index: PyIEnumVARIANT.h
===================================================================
RCS file: /cvsroot/pywin32/pywin32/com/win32com/src/include/PyIEnumVARIANT.h,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** PyIEnumVARIANT.h 23 Oct 2003 02:43:04 -0000 1.3
--- PyIEnumVARIANT.h 23 Oct 2003 23:42:02 -0000 1.4
***************
*** 10,14 ****
MAKE_PYCOM_CTOR(PyIEnumVARIANT);
static IEnumVARIANT *GetI(PyObject *self);
! static PyComTypeObject type;
virtual PyObject *iternext();
--- 10,14 ----
MAKE_PYCOM_CTOR(PyIEnumVARIANT);
static IEnumVARIANT *GetI(PyObject *self);
! static PyComEnumTypeObject type;
virtual PyObject *iternext();
Index: PythonCOM.h
===================================================================
RCS file: /cvsroot/pywin32/pywin32/com/win32com/src/include/PythonCOM.h,v
retrieving revision 1.11
retrieving revision 1.12
diff -C2 -d -r1.11 -r1.12
*** PythonCOM.h 23 Oct 2003 07:34:37 -0000 1.11
--- PythonCOM.h 23 Oct 2003 23:42:02 -0000 1.12
***************
*** 154,157 ****
--- 154,163 ----
};
+ // A type used for PyIEnum interfaces
+ class PYCOM_EXPORT PyComEnumTypeObject : public PyComTypeObject {
+ public:
+ PyComEnumTypeObject( const char *name, PyComTypeObject *pBaseType, int typeSize, struct PyMethodDef* methodList, PyIUnknown* (* thector)(IUnknown *) );
+ };
+
// Very very base class - not COM specific - Should exist in the
// Python core somewhere, IMO.
***************
*** 165,169 ****
virtual PyObject *repr();
virtual int compare(PyObject *other) {return (int)this-int(other);}
! virtual PyObject *iter();
virtual PyObject *iternext();
--- 171,175 ----
virtual PyObject *repr();
virtual int compare(PyObject *other) {return (int)this-int(other);}
! virtual PyObject *iter() {Py_INCREF(this);return this;}
virtual PyObject *iternext();
***************
*** 181,185 ****
static int setattr(PyObject *op, char *name, PyObject *v);
static int cmp(PyObject *ob1, PyObject *ob2);
! static PyObject *iter(PyObject *self) {return PyObject_SelfIter(self);}
static PyObject *iternext(PyObject *self);
};
--- 187,191 ----
static int setattr(PyObject *op, char *name, PyObject *v);
static int cmp(PyObject *ob1, PyObject *ob2);
! static PyObject *iter(PyObject *self);
static PyObject *iternext(PyObject *self);
};
|