[Python-checkins] CVS: python/dist/src/Mac/Modules/res _Resmodule.c,1.6,1.6.2.1 resscan.py,1.13,1.13.12.1 ressupport.py,1.17,1.17.10.1

Jack Jansen jackjansen@users.sourceforge.net
2001年12月19日 07:10:19 -0800


Update of /cvsroot/python/python/dist/src/Mac/Modules/res
In directory usw-pr-cvs1:/tmp/cvs-serv12554/Modules/res
Modified Files:
 Tag: r22rc1-branch
	_Resmodule.c resscan.py ressupport.py 
Log Message:
Merged Mac subtree into the 22c1 branch.
Index: _Resmodule.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Mac/Modules/res/_Resmodule.c,v
retrieving revision 1.6
retrieving revision 1.6.2.1
diff -C2 -d -r1.6 -r1.6.2.1
*** _Resmodule.c	2001年12月08日 18:02:53	1.6
--- _Resmodule.c	2001年12月19日 15:10:17	1.6.2.1
***************
*** 6,11 ****
--- 6,15 ----
 
 
+ #ifdef _WIN32
+ #include "pywintoolbox.h"
+ #else
 #include "macglue.h"
 #include "pymactoolbox.h"
+ #endif
 
 /* Macro to test whether a weak-loaded CFM function exists */
***************
*** 1358,1361 ****
--- 1362,1410 ----
 #endif
 
+ static PyObject *Res_FSOpenResFile(PyObject *_self, PyObject *_args)
+ {
+ 	PyObject *_res = NULL;
+ 	short _rv;
+ 	FSRef ref;
+ 	SignedByte permission;
+ 	if (!PyArg_ParseTuple(_args, "O&b",
+ 	 PyMac_GetFSRef, &ref,
+ 	 &permission))
+ 		return NULL;
+ 	_rv = FSOpenResFile(&ref,
+ 	 permission);
+ 	{
+ 		OSErr _err = ResError();
+ 		if (_err != noErr) return PyMac_Error(_err);
+ 	}
+ 	_res = Py_BuildValue("h",
+ 	 _rv);
+ 	return _res;
+ }
+ 
+ static PyObject *Res_FSResourceFileAlreadyOpen(PyObject *_self, PyObject *_args)
+ {
+ 	PyObject *_res = NULL;
+ 	Boolean _rv;
+ 	FSRef resourceFileRef;
+ 	Boolean inChain;
+ 	SInt16 refNum;
+ 	if (!PyArg_ParseTuple(_args, "O&",
+ 	 PyMac_GetFSRef, &resourceFileRef))
+ 		return NULL;
+ 	_rv = FSResourceFileAlreadyOpen(&resourceFileRef,
+ 	 &inChain,
+ 	 &refNum);
+ 	{
+ 		OSErr _err = ResError();
+ 		if (_err != noErr) return PyMac_Error(_err);
+ 	}
+ 	_res = Py_BuildValue("bbh",
+ 	 _rv,
+ 	 inChain,
+ 	 refNum);
+ 	return _res;
+ }
+ 
 static PyObject *Res_Resource(PyObject *_self, PyObject *_args)
 {
***************
*** 1519,1522 ****
--- 1568,1575 ----
 	 "(SInt16 curRefNum) -> (OSErr _rv, SInt16 nextRefNum)"},
 #endif
+ 	{"FSOpenResFile", (PyCFunction)Res_FSOpenResFile, 1,
+ 	 "(FSRef ref, SignedByte permission) -> (short _rv)"},
+ 	{"FSResourceFileAlreadyOpen", (PyCFunction)Res_FSResourceFileAlreadyOpen, 1,
+ 	 "(FSRef resourceFileRef) -> (Boolean _rv, Boolean inChain, SInt16 refNum)"},
 	{"Resource", (PyCFunction)Res_Resource, 1,
 	 "Convert a string to a resource object.\n\nThe created resource object is actually just a handle,\napply AddResource() to write it to a resource file.\nSee also the Handle() docstring.\n"},
Index: resscan.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Mac/Modules/res/resscan.py,v
retrieving revision 1.13
retrieving revision 1.13.12.1
diff -C2 -d -r1.13 -r1.13.12.1
*** resscan.py	2001年08月03日 13:31:36	1.13
--- resscan.py	2001年12月19日 15:10:17	1.13.12.1
***************
*** 47,50 ****
--- 47,55 ----
 			]
 			
+ 	def makeblacklisttypes(self):
+ 		return [
+ 			"UniCharCount", #TBD
+ 			]
+ 			
 	def makegreylist(self):
 		return [
Index: ressupport.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Mac/Modules/res/ressupport.py,v
retrieving revision 1.17
retrieving revision 1.17.10.1
diff -C2 -d -r1.17 -r1.17.10.1
*** ressupport.py	2001年09月05日 10:31:47	1.17
--- ressupport.py	2001年12月19日 15:10:17	1.17.10.1
***************
*** 6,9 ****
--- 6,10 ----
 from macsupport import *
 
+ FSRef_ptr = OpaqueType("FSRef", "PyMac_BuildFSRef", "PyMac_GetFSRef")
 
 class ResMixIn:

AltStyle によって変換されたページ (->オリジナル) /