[Python-checkins] python/dist/src/Mac/Modules/scrap _Scrapmodule.c,1.4,1.5 scrapscan.py,1.8,1.9
jackjansen@users.sourceforge.net
jackjansen@users.sourceforge.net
2002年12月12日 02:31:55 -0800
- Previous message: [Python-checkins] python/dist/src/Mac/Modules/res _Resmodule.c,1.16,1.17 resscan.py,1.18,1.19
- Next message: [Python-checkins] python/dist/src/Mac/Modules/snd _Sndmodule.c,1.12,1.13 sndscan.py,1.18,1.19 sndsupport.py,1.20,1.21
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
Update of /cvsroot/python/python/dist/src/Mac/Modules/scrap
In directory sc8-pr-cvs1:/tmp/cvs-serv21368/Modules/scrap
Modified Files:
_Scrapmodule.c scrapscan.py
Log Message:
Getting rid of pre-Carbon (MacOS8) support. All code depending on
TARGET_API_MAC_OS8 (or !TARGET_API_MAC_CARBON) is gone. Also some
TARGET_API_MAC_OSX conditional code is gone, because it is no longer
used on OSX-only Python (only in MacPython-OS9).
Index: _Scrapmodule.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Mac/Modules/scrap/_Scrapmodule.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** _Scrapmodule.c 18 Nov 2002 15:26:42 -0000 1.4
--- _Scrapmodule.c 12 Dec 2002 10:31:52 -0000 1.5
***************
*** 30,52 ****
#endif
- #if TARGET_API_MAC_OS8
-
- /*
- ** Generate ScrapInfo records
- */
- static PyObject *
- SCRRec_New(itself)
- ScrapStuff *itself;
- {
-
- return Py_BuildValue("lO&hhO&", itself->scrapSize,
- ResObj_New, itself->scrapHandle, itself->scrapCount, itself->scrapState,
- PyMac_BuildStr255, itself->scrapName);
- }
- #endif
-
static PyObject *Scrap_Error;
- #if !TARGET_API_MAC_OS8
/* ----------------------- Object type Scrap ------------------------ */
--- 30,35 ----
***************
*** 281,285 ****
/* --------------------- End object type Scrap ---------------------- */
- #endif /* !TARGET_API_MAC_OS8 */
static PyObject *Scrap_LoadScrap(PyObject *_self, PyObject *_args)
--- 264,267 ----
***************
*** 309,385 ****
}
- #if TARGET_API_MAC_OS8
-
- static PyObject *Scrap_InfoScrap(PyObject *_self, PyObject *_args)
- {
- PyObject *_res = NULL;
- ScrapStuffPtr _rv;
- if (!PyArg_ParseTuple(_args, ""))
- return NULL;
- _rv = InfoScrap();
- _res = Py_BuildValue("O&",
- SCRRec_New, _rv);
- return _res;
- }
-
- static PyObject *Scrap_GetScrap(PyObject *_self, PyObject *_args)
- {
- PyObject *_res = NULL;
- long _rv;
- Handle destination;
- ScrapFlavorType flavorType;
- SInt32 offset;
- if (!PyArg_ParseTuple(_args, "O&O&",
- ResObj_Convert, &destination,
- PyMac_GetOSType, &flavorType))
- return NULL;
- _rv = GetScrap(destination,
- flavorType,
- &offset);
- _res = Py_BuildValue("ll",
- _rv,
- offset);
- return _res;
- }
-
- static PyObject *Scrap_ZeroScrap(PyObject *_self, PyObject *_args)
- {
- PyObject *_res = NULL;
- OSStatus _err;
- if (!PyArg_ParseTuple(_args, ""))
- return NULL;
- _err = ZeroScrap();
- if (_err != noErr) return PyMac_Error(_err);
- Py_INCREF(Py_None);
- _res = Py_None;
- return _res;
- }
-
- static PyObject *Scrap_PutScrap(PyObject *_self, PyObject *_args)
- {
- PyObject *_res = NULL;
- OSStatus _err;
- SInt32 sourceBufferByteCount;
- ScrapFlavorType flavorType;
- char *sourceBuffer__in__;
- int sourceBuffer__len__;
- int sourceBuffer__in_len__;
- if (!PyArg_ParseTuple(_args, "lO&s#",
- &sourceBufferByteCount,
- PyMac_GetOSType, &flavorType,
- &sourceBuffer__in__, &sourceBuffer__in_len__))
- return NULL;
- _err = PutScrap(sourceBufferByteCount,
- flavorType,
- sourceBuffer__in__);
- if (_err != noErr) return PyMac_Error(_err);
- Py_INCREF(Py_None);
- _res = Py_None;
- sourceBuffer__error__: ;
- return _res;
- }
- #endif /* TARGET_API_MAC_OS8 */
-
- #if !TARGET_API_MAC_OS8
static PyObject *Scrap_GetCurrentScrap(PyObject *_self, PyObject *_args)
{
--- 291,294 ----
***************
*** 421,425 ****
return _res;
}
- #endif
static PyMethodDef Scrap_methods[] = {
--- 330,333 ----
***************
*** 428,444 ****
{"UnloadScrap", (PyCFunction)Scrap_UnloadScrap, 1,
"() -> None"},
-
- #if TARGET_API_MAC_OS8
- {"InfoScrap", (PyCFunction)Scrap_InfoScrap, 1,
- "() -> (ScrapStuffPtr _rv)"},
- {"GetScrap", (PyCFunction)Scrap_GetScrap, 1,
- "(Handle destination, ScrapFlavorType flavorType) -> (long _rv, SInt32 offset)"},
- {"ZeroScrap", (PyCFunction)Scrap_ZeroScrap, 1,
- "() -> None"},
- {"PutScrap", (PyCFunction)Scrap_PutScrap, 1,
- "(SInt32 sourceBufferByteCount, ScrapFlavorType flavorType, Buffer sourceBuffer) -> None"},
- #endif
-
- #if !TARGET_API_MAC_OS8
{"GetCurrentScrap", (PyCFunction)Scrap_GetCurrentScrap, 1,
"() -> (ScrapRef scrap)"},
--- 336,339 ----
***************
*** 447,451 ****
{"CallInScrapPromises", (PyCFunction)Scrap_CallInScrapPromises, 1,
"() -> None"},
- #endif
{NULL, NULL, 0}
};
--- 342,345 ----
***************
*** 468,477 ****
PyDict_SetItemString(d, "Error", Scrap_Error) != 0)
return;
- #if !TARGET_API_MAC_OS8
Scrap_Type.ob_type = &PyType_Type;
Py_INCREF(&Scrap_Type);
if (PyDict_SetItemString(d, "ScrapType", (PyObject *)&Scrap_Type) != 0)
Py_FatalError("can't initialize ScrapType");
- #endif
}
--- 362,369 ----
Index: scrapscan.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Mac/Modules/scrap/scrapscan.py,v
retrieving revision 1.8
retrieving revision 1.9
diff -C2 -d -r1.8 -r1.9
*** scrapscan.py 15 Aug 2002 22:05:58 -0000 1.8
--- scrapscan.py 12 Dec 2002 10:31:53 -0000 1.9
***************
*** 41,58 ****
return [
"GetScrapFlavorInfoList",
]
-
- def makegreylist(self):
- return [
- ('#if !TARGET_API_MAC_CARBON', [
- 'InfoScrap',
- 'GetScrap',
- 'ZeroScrap',
- 'PutScrap',
- ]),
- ('#if TARGET_API_MAC_CARBON', [
- 'CallInScrapPromises',
- 'ClearCurrentScrap',
- ])]
def makeblacklisttypes(self):
--- 41,49 ----
return [
"GetScrapFlavorInfoList",
+ 'InfoScrap',
+ 'GetScrap',
+ 'ZeroScrap',
+ 'PutScrap',
]
def makeblacklisttypes(self):
- Previous message: [Python-checkins] python/dist/src/Mac/Modules/res _Resmodule.c,1.16,1.17 resscan.py,1.18,1.19
- Next message: [Python-checkins] python/dist/src/Mac/Modules/snd _Sndmodule.c,1.12,1.13 sndscan.py,1.18,1.19 sndsupport.py,1.20,1.21
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]