First bits and pieces of appearance support: an init routine, a global flag PyMac_AppearanceCompliant (exported thru MacOS). If USE_APPEARANCE
is off the code is disabled (but the variables are still there, set to 0).
diff --git a/Mac/Python/macglue.c b/Mac/Python/macglue.c
index fa27c79..4b4c021 100644
--- a/Mac/Python/macglue.c
+++ b/Mac/Python/macglue.c
@@ -155,6 +155,11 @@
*/
static PyObject *python_event_handler;
+/*
+** Set to true if we're appearance-compliant
+*/
+int PyMac_AppearanceCompliant;
+
#ifdef USE_GUSI
/*
** GUSI (1.6.0 and earlier, at the least) do not set the MacOS idea of
diff --git a/Mac/Python/macmain.c b/Mac/Python/macmain.c
index 0fdcb51..db39e18 100644
--- a/Mac/Python/macmain.c
+++ b/Mac/Python/macmain.c
@@ -37,6 +37,10 @@
#include <Windows.h>
#include <Fonts.h>
#include <Balloons.h>
+#ifdef USE_APPEARANCE
+#include <Gestalt.h>
+#include <Appearance.h>
+#endif /* USE_APPEARANCE */
#ifdef __MWERKS__
#include <SIOUX.h>
#define USE_SIOUX
@@ -64,6 +68,21 @@
static void Py_Main Py_PROTO((int, char **)); /* Forward */
void PyMac_Exit Py_PROTO((int)); /* Forward */
+static void init_appearance()
+{
+#ifdef USE_APPEARANCE
+ OSErr err;
+ SInt32 response;
+
+ err = Gestalt(gestaltAppearanceAttr,&response);
+ if ( err ) goto no_appearance;
+ if ( !(response&(1<<gestaltAppearanceExists)) ) goto no_appearance;
+ /* XXXX Should we check the version? Compat-mode? */
+ PyMac_AppearanceCompliant = 1;
+no_appearance:
+ return;
+#endif /* USE_APPEARANCE */
+}
/* Initialize the Mac toolbox world */
static void
@@ -80,6 +99,7 @@
InitDialogs((long)0);
InitMenus();
InitCursor();
+ init_appearance();
#endif
}