summaryrefslogtreecommitdiffstats
path: root/Mac/Modules/cm
diff options
context:
space:
mode:
authorJack Jansen <jack.jansen@cwi.nl>1998-04-21 15:23:55 (GMT)
committerJack Jansen <jack.jansen@cwi.nl>1998-04-21 15:23:55 (GMT)
commit1c4e61462720b441467ab41c62d0c37143af45e7 (patch)
tree58e412cb39b322be47818a4c54341be163cf818b /Mac/Modules/cm
parent02facaf90a39b0f2d3dafbca2ef17c8e8c678b10 (diff)
downloadcpython-1c4e61462720b441467ab41c62d0c37143af45e7.zip
cpython-1c4e61462720b441467ab41c62d0c37143af45e7.tar.gz
cpython-1c4e61462720b441467ab41c62d0c37143af45e7.tar.bz2
Re-generated from new (3.1) universal headers
Diffstat (limited to 'Mac/Modules/cm')
-rw-r--r--Mac/Modules/cm/Cmmodule.c67
1 files changed, 67 insertions, 0 deletions
diff --git a/Mac/Modules/cm/Cmmodule.c b/Mac/Modules/cm/Cmmodule.c
index fe35685..4eb0be3 100644
--- a/Mac/Modules/cm/Cmmodule.c
+++ b/Mac/Modules/cm/Cmmodule.c
@@ -469,6 +469,67 @@ static PyObject *CmpObj_OpenComponentResFile(_self, _args)
return _res;
}
+static PyObject *CmpObj_GetComponentResource(_self, _args)
+ ComponentObject *_self;
+ PyObject *_args;
+{
+ PyObject *_res = NULL;
+ OSErr _err;
+ OSType resType;
+ short resID;
+ Handle theResource;
+ if (!PyArg_ParseTuple(_args, "O&h",
+ PyMac_GetOSType, &resType,
+ &resID))
+ return NULL;
+ _err = GetComponentResource(_self->ob_itself,
+ resType,
+ resID,
+ &theResource);
+ if (_err != noErr) return PyMac_Error(_err);
+ _res = Py_BuildValue("O&",
+ ResObj_New, theResource);
+ return _res;
+}
+
+static PyObject *CmpObj_GetComponentIndString(_self, _args)
+ ComponentObject *_self;
+ PyObject *_args;
+{
+ PyObject *_res = NULL;
+ OSErr _err;
+ Str255 theString;
+ short strListID;
+ short index;
+ if (!PyArg_ParseTuple(_args, "O&hh",
+ PyMac_GetStr255, theString,
+ &strListID,
+ &index))
+ return NULL;
+ _err = GetComponentIndString(_self->ob_itself,
+ theString,
+ strListID,
+ index);
+ if (_err != noErr) return PyMac_Error(_err);
+ Py_INCREF(Py_None);
+ _res = Py_None;
+ return _res;
+}
+
+static PyObject *CmpObj_ResolveComponentAlias(_self, _args)
+ ComponentObject *_self;
+ PyObject *_args;
+{
+ PyObject *_res = NULL;
+ Component _rv;
+ if (!PyArg_ParseTuple(_args, ""))
+ return NULL;
+ _rv = ResolveComponentAlias(_self->ob_itself);
+ _res = Py_BuildValue("O&",
+ CmpObj_New, _rv);
+ return _res;
+}
+
static PyObject *CmpObj_CountComponentInstances(_self, _args)
ComponentObject *_self;
PyObject *_args;
@@ -563,6 +624,12 @@ static PyMethodDef CmpObj_methods[] = {
"(long theRefcon) -> None"},
{"OpenComponentResFile", (PyCFunction)CmpObj_OpenComponentResFile, 1,
"() -> (short _rv)"},
+ {"GetComponentResource", (PyCFunction)CmpObj_GetComponentResource, 1,
+ "(OSType resType, short resID) -> (Handle theResource)"},
+ {"GetComponentIndString", (PyCFunction)CmpObj_GetComponentIndString, 1,
+ "(Str255 theString, short strListID, short index) -> None"},
+ {"ResolveComponentAlias", (PyCFunction)CmpObj_ResolveComponentAlias, 1,
+ "() -> (Component _rv)"},
{"CountComponentInstances", (PyCFunction)CmpObj_CountComponentInstances, 1,
"() -> (long _rv)"},
{"SetDefaultComponent", (PyCFunction)CmpObj_SetDefaultComponent, 1,