[pywin32-checkins] pywin32/com/win32comext/shell/src PyIShellFolder.cpp,1.11,1.12
OLD project page for the Python extensions for Windows
Brought to you by:
mhammond
From: Roger U. <ru...@us...> - 2005-10-26 01:05:27
|
Update of /cvsroot/pywin32/pywin32/com/win32comext/shell/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9412/com/win32comext/shell/src Modified Files: PyIShellFolder.cpp Log Message: Autoduck fixes, argument handling fix Index: PyIShellFolder.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32comext/shell/src/PyIShellFolder.cpp,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** PyIShellFolder.cpp 18 Oct 2005 00:36:05 -0000 1.11 --- PyIShellFolder.cpp 26 Oct 2005 01:05:18 -0000 1.12 *************** *** 225,229 **** } ! // @pymethod |PyIShellFolder|CreateViewObject|Description of CreateViewObject. PyObject *PyIShellFolder::CreateViewObject(PyObject *self, PyObject *args) { --- 225,229 ---- } ! // @pymethod <o PyIShellView>|PyIShellFolder|CreateViewObject|Creates a view object for a shell folder. PyObject *PyIShellFolder::CreateViewObject(PyObject *self, PyObject *args) { *************** *** 231,236 **** if ( pISF == NULL ) return NULL; ! // @pyparm HWND|hwndOwner||Description for hwndOwner ! // @pyparm <o PyIID>|riid||Description for riid PyObject *obriid; HWND hwndOwner; --- 231,236 ---- if ( pISF == NULL ) return NULL; ! // @pyparm HWND|hwndOwner||Parent window for a custom folder view, or 0 ! // @pyparm <o PyIID>|riid||IID of the desired interface, usually IID_IShellView PyObject *obriid; HWND hwndOwner; *************** *** 254,258 **** } ! // @pymethod |PyIShellFolder|GetAttributesOf|Description of GetAttributesOf. PyObject *PyIShellFolder::GetAttributesOf(PyObject *self, PyObject *args) { --- 254,259 ---- } ! // @pymethod int|PyIShellFolder|GetAttributesOf|Queries attributes of items within the shell folder ! // @rdesc The requested attributes are only returned if they are common to all of the specified items PyObject *PyIShellFolder::GetAttributesOf(PyObject *self, PyObject *args) { *************** *** 260,265 **** if ( pISF == NULL ) return NULL; ! // @pyparm <o PyIDL>|pidl||Description for pidl ! // @pyparm int|rgfInOut||Description for rgfInOut PyObject *obpidl; UINT cidl; --- 261,266 ---- if ( pISF == NULL ) return NULL; ! // @pyparm (<o PyIDL>,...)|pidl||A sequence of single-level pidls identifying items directly contained by the folder ! // @pyparm int|rgfInOut||Combination of shellcon.SFGAO_* constants PyObject *obpidl; UINT cidl; *************** *** 283,287 **** } ! // @pymethod int, <o PyIUnknown>|PyIShellFolder|GetUIObjectOf|Description of GetUIObjectOf. PyObject *PyIShellFolder::GetUIObjectOf(PyObject *self, PyObject *args) { --- 284,288 ---- } ! // @pymethod int, <o PyIUnknown>|PyIShellFolder|GetUIObjectOf|Creates an interface to one or more items in a shell folder PyObject *PyIShellFolder::GetUIObjectOf(PyObject *self, PyObject *args) { *************** *** 289,297 **** if ( pISF == NULL ) return NULL; ! // @pyparm HWND|hwndOwner||Description for hwndOwner ! // @pyparm <o PyIDL>|pidl||Description for pidl ! // @pyparm <o PyIID>|riid||Description for riid ! // @pyparm int|rgfInOut||Description for rgfInOut ! // @pyparm <o PyIID>|iidout|None|The IID to wrap the result in. If not specified, riid is used. PyObject *obpidl; PyObject *obriid; --- 290,297 ---- if ( pISF == NULL ) return NULL; ! // @pyparm HWND|hwndOwner||Specifies a window in which to display any required dialogs or errors, can be 0 ! // @pyparm (<o PyIDL>,...)|pidl||A sequence of single-level pidls identifying items in the folder ! // @pyparm <o PyIID>|riid||The interface to create, one of IID_IContextMenu, IID_IContextMenu2, IID_IDataObject, IID_IDropTarget, IID_IExtractIcon, IID_IQueryInfo ! // @pyparm int|rgfReserved|0|Reserved, use 0 if passed in PyObject *obpidl; PyObject *obriid; *************** *** 306,310 **** return NULL; BOOL bPythonIsHappy = TRUE; - if (bPythonIsHappy && !PyObject_AsPIDLArray(obpidl, &cidl, &pidl)) bPythonIsHappy = FALSE; if (!PyWinObject_AsIID(obriid, &riid)) bPythonIsHappy = FALSE; if (obiidout==NULL) --- 306,309 ---- *************** *** 312,315 **** --- 311,315 ---- else if (!PyWinObject_AsIID(obiidout, &iidout)) bPythonIsHappy = FALSE; + if (bPythonIsHappy && !PyObject_AsPIDLArray(obpidl, &cidl, &pidl)) bPythonIsHappy = FALSE; if (!bPythonIsHappy) return NULL; HRESULT hr; *************** *** 330,334 **** } ! // @pymethod |PyIShellFolder|GetDisplayNameOf|Description of GetDisplayNameOf. PyObject *PyIShellFolder::GetDisplayNameOf(PyObject *self, PyObject *args) { --- 330,334 ---- } ! // @pymethod str|PyIShellFolder|GetDisplayNameOf|Returns the display name of an item within this shell folder PyObject *PyIShellFolder::GetDisplayNameOf(PyObject *self, PyObject *args) { *************** *** 336,341 **** if ( pISF == NULL ) return NULL; ! // @pyparm <o PyIDL>|pidl||Description for pidl ! // @pyparm int|uFlags||Description for uFlags PyObject *obpidl; ITEMIDLIST *pidl; --- 336,341 ---- if ( pISF == NULL ) return NULL; ! // @pyparm <o PyIDL>|pidl||PIDL that identifies the item relative to the parent folder ! // @pyparm int|uFlags||Combination of shellcon.SHGDN_* flags PyObject *obpidl; ITEMIDLIST *pidl; *************** *** 343,349 **** if ( !PyArg_ParseTuple(args, "Ol:GetDisplayNameOf", &obpidl, &uFlags) ) return NULL; ! BOOL bPythonIsHappy = TRUE; ! if (bPythonIsHappy && !PyObject_AsPIDL(obpidl, &pidl)) bPythonIsHappy = FALSE; ! if (!bPythonIsHappy) return NULL; HRESULT hr; STRRET out; --- 343,348 ---- if ( !PyArg_ParseTuple(args, "Ol:GetDisplayNameOf", &obpidl, &uFlags) ) return NULL; ! if (!PyObject_AsPIDL(obpidl, &pidl)) ! return NULL; HRESULT hr; STRRET out; *************** *** 359,363 **** } ! // @pymethod |PyIShellFolder|SetNameOf|Description of SetNameOf. PyObject *PyIShellFolder::SetNameOf(PyObject *self, PyObject *args) { --- 358,363 ---- } ! // @pymethod <o PyIDL>|PyIShellFolder|SetNameOf|Sets the display name of an item and changes its PIDL ! // @rdesc Returns the new PIDL for item PyObject *PyIShellFolder::SetNameOf(PyObject *self, PyObject *args) { *************** *** 365,395 **** if ( pISF == NULL ) return NULL; ! // @pyparm HWND|hwndOwner||Description for hwndOwner ! // @pyparm <o PyIDL>|pidl||Description for pidl ! // @pyparm <o unicode>|lpszName||Description for lpszName ! PyObject *obpidl; ! PyObject *oblpszName; HWND hwndOwner; ! ITEMIDLIST *pidl; ITEMIDLIST *pidlRet; ! LPOLESTR lpszName; ! long flags; if ( !PyArg_ParseTuple(args, "lOOl:SetNameOf", &hwndOwner, &obpidl, &oblpszName, &flags) ) return NULL; ! BOOL bPythonIsHappy = TRUE; ! if (bPythonIsHappy && !PyObject_AsPIDL(obpidl, &pidl)) bPythonIsHappy = FALSE; ! if (bPythonIsHappy && !PyWinObject_AsBstr(oblpszName, &lpszName)) bPythonIsHappy = FALSE; ! if (!bPythonIsHappy) return NULL; ! HRESULT hr; ! PY_INTERFACE_PRECALL; ! hr = pISF->SetNameOf( hwndOwner, pidl, lpszName, (SHGDNF)flags, &pidlRet ); PyObject_FreePIDL(pidl); SysFreeString(lpszName); - - PY_INTERFACE_POSTCALL; - - if ( FAILED(hr) ) - return PyCom_BuildPyException(hr, pISF, IID_IShellFolder ); - PyObject *ret = PyObject_FromPIDL(pidlRet, TRUE); return ret; } --- 365,396 ---- if ( pISF == NULL ) return NULL; ! // @pyparm HWND|hwndOwner||Window in which to display any message boxes or dialogs, can be 0 ! // @pyparm <o PyIDL>|pidl||PIDL that identifies the item relative to the parent folder ! // @pyparm <o unicode>|lpszName||New name for the item ! // @pyparm int|Flags||Combination of shellcon.SHGDM_* values ! PyObject *obpidl=NULL, *ret=NULL; ! PyObject *oblpszName=NULL; HWND hwndOwner; ! ITEMIDLIST *pidl=NULL; ITEMIDLIST *pidlRet; ! LPOLESTR lpszName=NULL; ! DWORD flags; ! if ( !PyArg_ParseTuple(args, "lOOl:SetNameOf", &hwndOwner, &obpidl, &oblpszName, &flags) ) return NULL; ! if (PyObject_AsPIDL(obpidl, &pidl)&& ! PyWinObject_AsBstr(oblpszName, &lpszName)){ ! HRESULT hr; ! PY_INTERFACE_PRECALL; ! hr = pISF->SetNameOf( hwndOwner, pidl, lpszName, (SHGDNF)flags, &pidlRet ); ! PY_INTERFACE_POSTCALL; ! if ( FAILED(hr) ) ! PyCom_BuildPyException(hr, pISF, IID_IShellFolder ); ! else ! ret = PyObject_FromPIDL(pidlRet, TRUE); ! } ! PyObject_FreePIDL(pidl); SysFreeString(lpszName); return ret; } *************** *** 398,411 **** static struct PyMethodDef PyIShellFolder_methods[] = { ! { "ParseDisplayName", PyIShellFolder::ParseDisplayName, 1 }, // @pymeth ParseDisplayName|Description of ParseDisplayName ! { "EnumObjects", PyIShellFolder::EnumObjects, 1 }, // @pymeth EnumObjects|Description of EnumObjects ! { "BindToObject", PyIShellFolder::BindToObject, 1 }, // @pymeth BindToObject|Description of BindToObject ! { "BindToStorage", PyIShellFolder::BindToStorage, 1 }, // @pymeth BindToStorage|Description of BindToStorage ! { "CompareIDs", PyIShellFolder::CompareIDs, 1 }, // @pymeth CompareIDs|Description of CompareIDs ! { "CreateViewObject", PyIShellFolder::CreateViewObject, 1 }, // @pymeth CreateViewObject|Description of CreateViewObject ! { "GetAttributesOf", PyIShellFolder::GetAttributesOf, 1 }, // @pymeth GetAttributesOf|Description of GetAttributesOf ! { "GetUIObjectOf", PyIShellFolder::GetUIObjectOf, 1 }, // @pymeth GetUIObjectOf|Description of GetUIObjectOf ! { "GetDisplayNameOf", PyIShellFolder::GetDisplayNameOf, 1 }, // @pymeth GetDisplayNameOf|Description of GetDisplayNameOf ! { "SetNameOf", PyIShellFolder::SetNameOf, 1 }, // @pymeth SetNameOf|Description of SetNameOf { NULL } }; --- 399,412 ---- static struct PyMethodDef PyIShellFolder_methods[] = { ! { "ParseDisplayName", PyIShellFolder::ParseDisplayName, 1 }, // @pymeth ParseDisplayName|Returns the PIDL of an item in a shell folder ! { "EnumObjects", PyIShellFolder::EnumObjects, 1 }, // @pymeth EnumObjects|Creates an enumerator to list the contents of the shell folder ! { "BindToObject", PyIShellFolder::BindToObject, 1 }, // @pymeth BindToObject|Returns an IShellFolder interface for a subfolder ! { "BindToStorage", PyIShellFolder::BindToStorage, 1 }, // @pymeth BindToStorage|Returns an interface to a storage object in a shell folder ! { "CompareIDs", PyIShellFolder::CompareIDs, 1 }, // @pymeth CompareIDs|Determines the sorting order of 2 items in shell folder ! { "CreateViewObject", PyIShellFolder::CreateViewObject, 1 }, // @pymeth CreateViewObject|Creates a view object for a shell folder. ! { "GetAttributesOf", PyIShellFolder::GetAttributesOf, 1 }, // @pymeth GetAttributesOf|Queries attributes of items within the shell folder ! { "GetUIObjectOf", PyIShellFolder::GetUIObjectOf, 1 }, // @pymeth GetUIObjectOf|Creates an interface to one or more items in a shell folder ! { "GetDisplayNameOf", PyIShellFolder::GetDisplayNameOf, 1 }, // @pymeth GetDisplayNameOf|Returns the display name of an item within this shell folder ! { "SetNameOf", PyIShellFolder::SetNameOf, 1 }, // @pymeth SetNameOf|Sets the display name of an item and changes its PIDL { NULL } }; |