[pywin32-checkins] pywin32/com/win32com/src PythonCOM.cpp,1.20,1.21 Register.cpp,1.8,1.9
OLD project page for the Python extensions for Windows
Brought to you by:
mhammond
|
From: <mha...@us...> - 2003-10-08 04:28:46
|
Update of /cvsroot/pywin32/pywin32/com/win32com/src
In directory sc8-pr-cvs1:/tmp/cvs-serv13856
Modified Files:
PythonCOM.cpp Register.cpp
Log Message:
Add IDataFormat and support for FORMATETC and STGMEDIUM
Index: PythonCOM.cpp
===================================================================
RCS file: /cvsroot/pywin32/pywin32/com/win32com/src/PythonCOM.cpp,v
retrieving revision 1.20
retrieving revision 1.21
diff -C2 -d -r1.20 -r1.21
*** PythonCOM.cpp 7 Jul 2003 14:10:53 -0000 1.20
--- PythonCOM.cpp 8 Oct 2003 04:28:42 -0000 1.21
***************
*** 42,45 ****
--- 42,47 ----
extern PyObject *pythoncom_GetRecordFromGuids(PyObject *self, PyObject *args);
+ extern PyObject *Py_NewSTGMEDIUM(PyObject *self, PyObject *args);
+
// Typelib related functions
***************
*** 1335,1338 ****
--- 1337,1420 ----
}
+ // @pymeth <o PyIDataObject>|OleGetClipboard|Retrieves a data object that you can use to access the contents of the clipboard.
+ static PyObject *pythoncom_OleGetClipboard(PyObject *, PyObject *args)
+ {
+ if (!PyArg_ParseTuple(args, ":OleGetClipboard"))
+ return NULL;
+ IDataObject *pd = NULL;
+ HRESULT hr;
+ Py_BEGIN_ALLOW_THREADS
+ hr = ::OleGetClipboard(&pd);
+ Py_END_ALLOW_THREADS
+ if (FAILED(hr)) {
+ PyCom_BuildPyException(hr);
+ return NULL;
+ }
+ return PyCom_PyObjectFromIUnknown(pd, IID_IDataObject, FALSE);
+ }
+
+ // @pymeth |OleSetClipboard|Places a pointer to a specific data object onto the clipboard. This makes the data object accessible to the OleGetClipboard function.
+ static PyObject *pythoncom_OleSetClipboard(PyObject *, PyObject *args)
+ {
+ PyObject *obd;
+ if (!PyArg_ParseTuple(args, "O:OleSetClipboard", &obd))
+ return NULL;
+ IDataObject *pd;
+ if (!PyCom_InterfaceFromPyObject(obd, IID_IDataObject, (void**)&pd, FALSE))
+ return NULL;
+ HRESULT hr;
+ Py_BEGIN_ALLOW_THREADS
+ hr = ::OleSetClipboard(pd);
+ Py_END_ALLOW_THREADS
+ pd->Release();
+ if (FAILED(hr)) {
+ PyCom_BuildPyException(hr);
+ return NULL;
+ }
+ Py_INCREF(Py_None);
+ return Py_None;
+ }
+
+ // @pymeth true/false|OleIsCurrentClipboard|Determines whether the data object pointer previously placed on the clipboard by the OleSetClipboard function is still on the clipboard.
+ static PyObject *pythoncom_OleIsCurrentClipboard(PyObject *, PyObject *args)
+ {
+ PyObject *obd;
+ if (!PyArg_ParseTuple(args, "O:OleIsCurrentClipboard", &obd))
+ return NULL;
+ IDataObject *pd;
+ if (!PyCom_InterfaceFromPyObject(obd, IID_IDataObject, (void**)&pd, FALSE))
+ return NULL;
+ HRESULT hr;
+ Py_BEGIN_ALLOW_THREADS
+ hr = ::OleIsCurrentClipboard(pd);
+ Py_END_ALLOW_THREADS
+ pd->Release();
+ if (FAILED(hr)) {
+ PyCom_BuildPyException(hr);
+ return NULL;
+ }
+ PyObject *ret = hr==S_OK ? Py_True: Py_False;
+ Py_INCREF(ret);
+ return ret;
+ }
+
+ // @pymeth |OleFlushClipboard|Carries out the clipboard shutdown sequence. It also releases the IDataObject pointer that was placed on the clipboard by the <om pythoncom.OleSetClipboard> function.
+ static PyObject *pythoncom_OleFlushClipboard(PyObject *, PyObject *args)
+ {
+ if (!PyArg_ParseTuple(args, ":OleFlushClipboard"))
+ return NULL;
+
+ HRESULT hr;
+ Py_BEGIN_ALLOW_THREADS
+ hr = ::OleFlushClipboard();
+ Py_END_ALLOW_THREADS
+ if (FAILED(hr)) {
+ PyCom_BuildPyException(hr);
+ return NULL;
+ }
+ Py_INCREF(Py_None);
+ return Py_None;
+ }
+
***************
*** 1395,1398 ****
--- 1477,1484 ----
{ "new", pythoncom_new, 1 },
{ "New", pythoncom_new, 1 }, // @pymeth New|Create a new instance of an OLE automation server.
+ { "OleGetClipboard", pythoncom_OleGetClipboard, 1}, // @pymeth OleGetClipboard|Retrieves a data object that you can use to access the contents of the clipboard.
+ { "OleFlushClipboard", pythoncom_OleFlushClipboard, 1}, // @pymeth OleFlushClipboard|Carries out the clipboard shutdown sequence. It also releases the IDataObject pointer that was placed on the clipboard by the <om pythoncom.OleSetClipboard> function.
+ { "OleIsCurrentClipboard",pythoncom_OleIsCurrentClipboard, 1}, // @pymeth OleIsCurrentClipboard|Determines whether the data object pointer previously placed on the clipboard by the OleSetClipboard function is still on the clipboard.
+ { "OleSetClipboard", pythoncom_OleSetClipboard, 1}, // @pymeth OleSetClipboard|Places a pointer to a specific data object onto the clipboard. This makes the data object accessible to the OleGetClipboard function.
{ "OleLoadFromStream", pythoncom_OleLoadFromStream, 1}, // @pymeth OleLoadFromStream|Load an object from an IStream.
{ "OleSaveToStream", pythoncom_OleSaveToStream, 1}, // @pymeth OleSaveToStream|Save an object to an IStream.
***************
*** 1420,1423 ****
--- 1506,1510 ----
{ "StgIsStorageFile", pythoncom_StgIsStorageFile, 1 }, // @pymeth StgIsStorageFile|Indicates whether a particular disk file contains a storage object.
#endif // MS_WINCE
+ { "STGMEDIUM", Py_NewSTGMEDIUM, 1}, // @pymeth STGMEDIUM|Creates a new <o PySTGMEDIUM> object suitable for the <o PyIDataObject> interface.
{ "StgOpenStorage", pythoncom_StgOpenStorage, 1 }, // @pymeth StgOpenStorage|Opens an existing root storage object in the file system.
{ "TYPEATTR", Py_NewTYPEATTR, 1}, // @pymeth TYPEATTR|Returns a new <o TYPEATTR> object.
***************
*** 1556,1559 ****
--- 1643,1658 ----
ADD_CONSTANT(COINIT_SPEED_OVER_MEMORY);
#endif
+ // CLIPBOARD
+ ADD_CONSTANT(DATADIR_GET);
+ ADD_CONSTANT(DATADIR_SET);
+ ADD_CONSTANT(TYMED_HGLOBAL);
+ ADD_CONSTANT(TYMED_FILE);
+ ADD_CONSTANT(TYMED_ISTREAM);
+ ADD_CONSTANT(TYMED_ISTORAGE);
+ ADD_CONSTANT(TYMED_GDI);
+ ADD_CONSTANT(TYMED_MFPICT);
+ ADD_CONSTANT(TYMED_ENHMF);
+ ADD_CONSTANT(TYMED_NULL);
+
// DISPATCH
ADD_CONSTANT(DISPATCH_PROPERTYGET);
Index: Register.cpp
===================================================================
RCS file: /cvsroot/pywin32/pywin32/com/win32com/src/Register.cpp,v
retrieving revision 1.8
retrieving revision 1.9
diff -C2 -d -r1.8 -r1.9
*** Register.cpp 7 Jul 2003 14:10:53 -0000 1.8
--- Register.cpp 8 Oct 2003 04:28:42 -0000 1.9
***************
*** 46,49 ****
--- 46,51 ----
#include "PyIPropertySetStorage.h"
#include "PyIEnumSTATPROPSTG.h"
+ #include "PyIEnumFORMATETC.h"
+ #include "PyIDataObject.h"
//PyObject *CLSIDMapping; // Maps CLSIDs onto PyClassObjects
***************
*** 222,225 ****
--- 224,228 ----
PYCOM_INTERFACE_CLIENT_ONLY( CreateTypeInfo),
PYCOM_INTERFACE_CLIENT_ONLY( CreateTypeLib),
+ PYCOM_INTERFACE_FULL ( DataObject ),
#ifndef NO_PYCOM_IENUMCATEGORYINFO
PYCOM_INTERFACE_CLIENT_ONLY( EnumCATEGORYINFO),
***************
*** 227,230 ****
--- 230,234 ----
PYCOM_INTERFACE_FULL ( EnumConnectionPoints),
PYCOM_INTERFACE_FULL ( EnumConnections),
+ PYCOM_INTERFACE_FULL ( EnumFORMATETC),
#ifndef NO_PYCOM_IENUMGUID
PYCOM_INTERFACE_CLIENT_ONLY( EnumGUID),
|