summaryrefslogtreecommitdiffstats
path: root/Mac/Modules/app
diff options
context:
space:
mode:
authorJack Jansen <jack.jansen@cwi.nl>2000-12-10 23:43:49 (GMT)
committerJack Jansen <jack.jansen@cwi.nl>2000-12-10 23:43:49 (GMT)
commitf7d5aa61d34cb7816ead2757860e5a66f7da0dcb (patch)
treefaba3f23c2f0fdfa74a156d441f6fa8945c337f8 /Mac/Modules/app
parentc6c283840316dec54244b311657511e95e742eb0 (diff)
downloadcpython-f7d5aa61d34cb7816ead2757860e5a66f7da0dcb.zip
cpython-f7d5aa61d34cb7816ead2757860e5a66f7da0dcb.tar.gz
cpython-f7d5aa61d34cb7816ead2757860e5a66f7da0dcb.tar.bz2
Adapted to Universal Headers 3.3.2. More to follow.
Diffstat (limited to 'Mac/Modules/app')
-rw-r--r--Mac/Modules/app/Appmodule.c29
-rw-r--r--Mac/Modules/app/appscan.py6
-rw-r--r--Mac/Modules/app/appsupport.py1
3 files changed, 35 insertions, 1 deletions
diff --git a/Mac/Modules/app/Appmodule.c b/Mac/Modules/app/Appmodule.c
index fd12135..929c34f 100644
--- a/Mac/Modules/app/Appmodule.c
+++ b/Mac/Modules/app/Appmodule.c
@@ -1111,6 +1111,28 @@ static PyObject *App_GetThemeTextColor(_self, _args)
return _res;
}
+#if TARGET_API_MAC_CARBON
+
+static PyObject *App_GetThemeMetric(_self, _args)
+ PyObject *_self;
+ PyObject *_args;
+{
+ PyObject *_res = NULL;
+ OSStatus _err;
+ ThemeMetric inMetric;
+ SInt32 outMetric;
+ if (!PyArg_ParseTuple(_args, "l",
+ &inMetric))
+ return NULL;
+ _err = GetThemeMetric(inMetric,
+ &outMetric);
+ if (_err != noErr) return PyMac_Error(_err);
+ _res = Py_BuildValue("l",
+ outMetric);
+ return _res;
+}
+#endif
+
static PyMethodDef App_methods[] = {
{"RegisterAppearanceClient", (PyCFunction)App_RegisterAppearanceClient, 1,
"() -> None"},
@@ -1218,6 +1240,11 @@ static PyMethodDef App_methods[] = {
"(ThemeBrush inBrush, SInt16 inDepth, Boolean inColorDev) -> (RGBColor outColor)"},
{"GetThemeTextColor", (PyCFunction)App_GetThemeTextColor, 1,
"(ThemeTextColor inColor, SInt16 inDepth, Boolean inColorDev) -> (RGBColor outColor)"},
+
+#if TARGET_API_MAC_CARBON
+ {"GetThemeMetric", (PyCFunction)App_GetThemeMetric, 1,
+ "(ThemeMetric inMetric) -> (SInt32 outMetric)"},
+#endif
{NULL, NULL, 0}
};
@@ -1237,7 +1264,7 @@ void initApp()
App_Error = PyMac_GetOSErrException();
if (App_Error == NULL ||
PyDict_SetItemString(d, "Error", App_Error) != 0)
- Py_FatalError("can't initialize App.Error");
+ return;
}
/* ========================= End module App ========================= */
diff --git a/Mac/Modules/app/appscan.py b/Mac/Modules/app/appscan.py
index 82bdd1b..9cfc598 100644
--- a/Mac/Modules/app/appscan.py
+++ b/Mac/Modules/app/appscan.py
@@ -43,6 +43,12 @@ class MyScanner(Scanner):
"GetThemeFont", # Funny stringbuffer in/out parameter, I think...
]
+ def makegreylist(self):
+ return [
+ ('#if TARGET_API_MAC_CARBON', [
+ 'GetThemeMetric',
+ ])]
+
def makeblacklisttypes(self):
return [
"MenuTitleDrawingUPP",
diff --git a/Mac/Modules/app/appsupport.py b/Mac/Modules/app/appsupport.py
index 11b6d2f..bd314dd 100644
--- a/Mac/Modules/app/appsupport.py
+++ b/Mac/Modules/app/appsupport.py
@@ -65,6 +65,7 @@ ThemeGrowDirection = Type("ThemeGrowDirection", "H")
ThemeSoundKind = OSTypeType("ThemeSoundKind")
ThemeDragSoundKind = OSTypeType("ThemeDragSoundKind")
ThemeBackgroundKind = Type("ThemeBackgroundKind", "l")
+ThemeMetric = Type("ThemeMetric", "l")
RGBColor = OpaqueType("RGBColor", "QdRGB")
includestuff = includestuff + """