]> granicus.if.org Git - python/commitdiff
Ported to Universal Headers 3.4.2. Qd and Qt remain to be done.
authorJack Jansen <jack.jansen@cwi.nl>
Wed, 3 Dec 2003 23:20:13 +0000 (23:20 +0000)
committerJack Jansen <jack.jansen@cwi.nl>
Wed, 3 Dec 2003 23:20:13 +0000 (23:20 +0000)
Completely untested.

18 files changed:
Mac/Modules/cg/_CGmodule.c
Mac/Modules/cg/cgsupport.py
Mac/Modules/ctl/_Ctlmodule.c
Mac/Modules/ctl/ctlscan.py
Mac/Modules/drag/dragscan.py
Mac/Modules/file/filescan.py
Mac/Modules/icn/_Icnmodule.c
Mac/Modules/icn/icnscan.py
Mac/Modules/icn/icnsupport.py
Mac/Modules/launch/_Launchmodule.c
Mac/Modules/launch/launchscan.py
Mac/Modules/launch/launchsupport.py
Mac/Modules/mlte/_Mltemodule.c
Mac/Modules/mlte/mltescan.py
Mac/Modules/osa/osascan.py
Mac/Modules/osa/osasupport.py
Mac/Modules/win/_Winmodule.c
Mac/Modules/win/winscan.py

index 088976643ef0b8afbd614b1de53407fb63d4fdc2..378bfa4764ec7226866acf781257f9699ba44b31 100755 (executable)
@@ -699,20 +699,20 @@ static PyObject *CGContextRefObj_CGContextSetGrayStrokeColor(CGContextRefObject
 static PyObject *CGContextRefObj_CGContextSetRGBFillColor(CGContextRefObject *_self, PyObject *_args)
 {
        PyObject *_res = NULL;
-       float r;
-       float g;
-       float b;
+       float red;
+       float green;
+       float blue;
        float alpha;
        if (!PyArg_ParseTuple(_args, "ffff",
-                             &r,
-                             &g,
-                             &b,
+                             &red,
+                             &green,
+                             &blue,
                              &alpha))
                return NULL;
        CGContextSetRGBFillColor(_self->ob_itself,
-                                r,
-                                g,
-                                b,
+                                red,
+                                green,
+                                blue,
                                 alpha);
        Py_INCREF(Py_None);
        _res = Py_None;
@@ -722,20 +722,20 @@ static PyObject *CGContextRefObj_CGContextSetRGBFillColor(CGContextRefObject *_s
 static PyObject *CGContextRefObj_CGContextSetRGBStrokeColor(CGContextRefObject *_self, PyObject *_args)
 {
        PyObject *_res = NULL;
-       float r;
-       float g;
-       float b;
+       float red;
+       float green;
+       float blue;
        float alpha;
        if (!PyArg_ParseTuple(_args, "ffff",
-                             &r,
-                             &g,
-                             &b,
+                             &red,
+                             &green,
+                             &blue,
                              &alpha))
                return NULL;
        CGContextSetRGBStrokeColor(_self->ob_itself,
-                                  r,
-                                  g,
-                                  b,
+                                  red,
+                                  green,
+                                  blue,
                                   alpha);
        Py_INCREF(Py_None);
        _res = Py_None;
@@ -745,23 +745,23 @@ static PyObject *CGContextRefObj_CGContextSetRGBStrokeColor(CGContextRefObject *
 static PyObject *CGContextRefObj_CGContextSetCMYKFillColor(CGContextRefObject *_self, PyObject *_args)
 {
        PyObject *_res = NULL;
-       float c;
-       float m;
-       float y;
-       float k;
+       float cyan;
+       float magenta;
+       float yellow;
+       float black;
        float alpha;
        if (!PyArg_ParseTuple(_args, "fffff",
-                             &c,
-                             &m,
-                             &y,
-                             &k,
+                             &cyan,
+                             &magenta,
+                             &yellow,
+                             &black,
                              &alpha))
                return NULL;
        CGContextSetCMYKFillColor(_self->ob_itself,
-                                 c,
-                                 m,
-                                 y,
-                                 k,
+                                 cyan,
+                                 magenta,
+                                 yellow,
+                                 black,
                                  alpha);
        Py_INCREF(Py_None);
        _res = Py_None;
@@ -771,29 +771,55 @@ static PyObject *CGContextRefObj_CGContextSetCMYKFillColor(CGContextRefObject *_
 static PyObject *CGContextRefObj_CGContextSetCMYKStrokeColor(CGContextRefObject *_self, PyObject *_args)
 {
        PyObject *_res = NULL;
-       float c;
-       float m;
-       float y;
-       float k;
+       float cyan;
+       float magenta;
+       float yellow;
+       float black;
        float alpha;
        if (!PyArg_ParseTuple(_args, "fffff",
-                             &c,
-                             &m,
-                             &y,
-                             &k,
+                             &cyan,
+                             &magenta,
+                             &yellow,
+                             &black,
                              &alpha))
                return NULL;
        CGContextSetCMYKStrokeColor(_self->ob_itself,
-                                   c,
-                                   m,
-                                   y,
-                                   k,
+                                   cyan,
+                                   magenta,
+                                   yellow,
+                                   black,
                                    alpha);
        Py_INCREF(Py_None);
        _res = Py_None;
        return _res;
 }
 
+static PyObject *CGContextRefObj_CGContextGetInterpolationQuality(CGContextRefObject *_self, PyObject *_args)
+{
+       PyObject *_res = NULL;
+       int _rv;
+       if (!PyArg_ParseTuple(_args, ""))
+               return NULL;
+       _rv = CGContextGetInterpolationQuality(_self->ob_itself);
+       _res = Py_BuildValue("i",
+                            _rv);
+       return _res;
+}
+
+static PyObject *CGContextRefObj_CGContextSetInterpolationQuality(CGContextRefObject *_self, PyObject *_args)
+{
+       PyObject *_res = NULL;
+       int quality;
+       if (!PyArg_ParseTuple(_args, "i",
+                             &quality))
+               return NULL;
+       CGContextSetInterpolationQuality(_self->ob_itself,
+                                        quality);
+       Py_INCREF(Py_None);
+       _res = Py_None;
+       return _res;
+}
+
 static PyObject *CGContextRefObj_CGContextSetCharacterSpacing(CGContextRefObject *_self, PyObject *_args)
 {
        PyObject *_res = NULL;
@@ -1107,13 +1133,17 @@ static PyMethodDef CGContextRefObj_methods[] = {
        {"CGContextSetGrayStrokeColor", (PyCFunction)CGContextRefObj_CGContextSetGrayStrokeColor, 1,
         PyDoc_STR("(float gray, float alpha) -> None")},
        {"CGContextSetRGBFillColor", (PyCFunction)CGContextRefObj_CGContextSetRGBFillColor, 1,
-        PyDoc_STR("(float r, float g, float b, float alpha) -> None")},
+        PyDoc_STR("(float red, float green, float blue, float alpha) -> None")},
        {"CGContextSetRGBStrokeColor", (PyCFunction)CGContextRefObj_CGContextSetRGBStrokeColor, 1,
-        PyDoc_STR("(float r, float g, float b, float alpha) -> None")},
+        PyDoc_STR("(float red, float green, float blue, float alpha) -> None")},
        {"CGContextSetCMYKFillColor", (PyCFunction)CGContextRefObj_CGContextSetCMYKFillColor, 1,
-        PyDoc_STR("(float c, float m, float y, float k, float alpha) -> None")},
+        PyDoc_STR("(float cyan, float magenta, float yellow, float black, float alpha) -> None")},
        {"CGContextSetCMYKStrokeColor", (PyCFunction)CGContextRefObj_CGContextSetCMYKStrokeColor, 1,
-        PyDoc_STR("(float c, float m, float y, float k, float alpha) -> None")},
+        PyDoc_STR("(float cyan, float magenta, float yellow, float black, float alpha) -> None")},
+       {"CGContextGetInterpolationQuality", (PyCFunction)CGContextRefObj_CGContextGetInterpolationQuality, 1,
+        PyDoc_STR("() -> (int _rv)")},
+       {"CGContextSetInterpolationQuality", (PyCFunction)CGContextRefObj_CGContextSetInterpolationQuality, 1,
+        PyDoc_STR("(int quality) -> None")},
        {"CGContextSetCharacterSpacing", (PyCFunction)CGContextRefObj_CGContextSetCharacterSpacing, 1,
         PyDoc_STR("(float spacing) -> None")},
        {"CGContextSetTextPosition", (PyCFunction)CGContextRefObj_CGContextSetTextPosition, 1,
index 1b667c018377aa01cbfa5b013a0e818246eaf73b..7dc2d54cdf17f4b2ccff73eb7617882f564b5a8a 100755 (executable)
@@ -114,6 +114,7 @@ CGLineCap = int
 CGLineJoin = int
 CGTextDrawingMode = int
 CGPathDrawingMode = int
+CGInterpolationQuality = int
 
 # The real objects
 CGContextRef = OpaqueByValueType("CGContextRef", "CGContextRefObj")
index 9f299a18e3e069ecc2491d00da000809e71ec498..a7073a665ed67de0ce540707033e59f197125bea 100644 (file)
@@ -1385,15 +1385,15 @@ static PyObject *CtlObj_SetControlDragTrackingEnabled(ControlObject *_self, PyOb
 {
        PyObject *_res = NULL;
        OSStatus _err;
-       Boolean tracks;
+       Boolean inTracks;
 #ifndef SetControlDragTrackingEnabled
        PyMac_PRECHECK(SetControlDragTrackingEnabled);
 #endif
        if (!PyArg_ParseTuple(_args, "b",
-                             &tracks))
+                             &inTracks))
                return NULL;
        _err = SetControlDragTrackingEnabled(_self->ob_itself,
-                                            tracks);
+                                            inTracks);
        if (_err != noErr) return PyMac_Error(_err);
        Py_INCREF(Py_None);
        _res = Py_None;
@@ -1404,17 +1404,17 @@ static PyObject *CtlObj_IsControlDragTrackingEnabled(ControlObject *_self, PyObj
 {
        PyObject *_res = NULL;
        OSStatus _err;
-       Boolean tracks;
+       Boolean outTracks;
 #ifndef IsControlDragTrackingEnabled
        PyMac_PRECHECK(IsControlDragTrackingEnabled);
 #endif
        if (!PyArg_ParseTuple(_args, ""))
                return NULL;
        _err = IsControlDragTrackingEnabled(_self->ob_itself,
-                                           &tracks);
+                                           &outTracks);
        if (_err != noErr) return PyMac_Error(_err);
        _res = Py_BuildValue("b",
-                            tracks);
+                            outTracks);
        return _res;
 }
 
@@ -3608,9 +3608,9 @@ static PyMethodDef CtlObj_methods[] = {
        {"HandleControlDragReceive", (PyCFunction)CtlObj_HandleControlDragReceive, 1,
         PyDoc_STR("(DragReference inDrag) -> None")},
        {"SetControlDragTrackingEnabled", (PyCFunction)CtlObj_SetControlDragTrackingEnabled, 1,
-        PyDoc_STR("(Boolean tracks) -> None")},
+        PyDoc_STR("(Boolean inTracks) -> None")},
        {"IsControlDragTrackingEnabled", (PyCFunction)CtlObj_IsControlDragTrackingEnabled, 1,
-        PyDoc_STR("() -> (Boolean tracks)")},
+        PyDoc_STR("() -> (Boolean outTracks)")},
        {"GetControlBounds", (PyCFunction)CtlObj_GetControlBounds, 1,
         PyDoc_STR("() -> (Rect bounds)")},
        {"IsControlHilited", (PyCFunction)CtlObj_IsControlHilited, 1,
@@ -3990,17 +3990,17 @@ static PyObject *Ctl_DrawControls(PyObject *_self, PyObject *_args)
 static PyObject *Ctl_UpdateControls(PyObject *_self, PyObject *_args)
 {
        PyObject *_res = NULL;
-       WindowPtr theWindow;
-       RgnHandle updateRegion;
+       WindowPtr inWindow;
+       RgnHandle inUpdateRegion;
 #ifndef UpdateControls
        PyMac_PRECHECK(UpdateControls);
 #endif
        if (!PyArg_ParseTuple(_args, "O&O&",
-                             WinObj_Convert, &theWindow,
-                             ResObj_Convert, &updateRegion))
+                             WinObj_Convert, &inWindow,
+                             ResObj_Convert, &inUpdateRegion))
                return NULL;
-       UpdateControls(theWindow,
-                      updateRegion);
+       UpdateControls(inWindow,
+                      inUpdateRegion);
        Py_INCREF(Py_None);
        _res = Py_None;
        return _res;
@@ -4231,17 +4231,17 @@ static PyObject *Ctl_SetAutomaticControlDragTrackingEnabledForWindow(PyObject *_
 {
        PyObject *_res = NULL;
        OSStatus _err;
-       WindowPtr theWindow;
-       Boolean tracks;
+       WindowPtr inWindow;
+       Boolean inTracks;
 #ifndef SetAutomaticControlDragTrackingEnabledForWindow
        PyMac_PRECHECK(SetAutomaticControlDragTrackingEnabledForWindow);
 #endif
        if (!PyArg_ParseTuple(_args, "O&b",
-                             WinObj_Convert, &theWindow,
-                             &tracks))
+                             WinObj_Convert, &inWindow,
+                             &inTracks))
                return NULL;
-       _err = SetAutomaticControlDragTrackingEnabledForWindow(theWindow,
-                                                              tracks);
+       _err = SetAutomaticControlDragTrackingEnabledForWindow(inWindow,
+                                                              inTracks);
        if (_err != noErr) return PyMac_Error(_err);
        Py_INCREF(Py_None);
        _res = Py_None;
@@ -4252,19 +4252,19 @@ static PyObject *Ctl_IsAutomaticControlDragTrackingEnabledForWindow(PyObject *_s
 {
        PyObject *_res = NULL;
        OSStatus _err;
-       WindowPtr theWindow;
-       Boolean tracks;
+       WindowPtr inWindow;
+       Boolean outTracks;
 #ifndef IsAutomaticControlDragTrackingEnabledForWindow
        PyMac_PRECHECK(IsAutomaticControlDragTrackingEnabledForWindow);
 #endif
        if (!PyArg_ParseTuple(_args, "O&",
-                             WinObj_Convert, &theWindow))
+                             WinObj_Convert, &inWindow))
                return NULL;
-       _err = IsAutomaticControlDragTrackingEnabledForWindow(theWindow,
-                                                             &tracks);
+       _err = IsAutomaticControlDragTrackingEnabledForWindow(inWindow,
+                                                             &outTracks);
        if (_err != noErr) return PyMac_Error(_err);
        _res = Py_BuildValue("b",
-                            tracks);
+                            outTracks);
        return _res;
 }
 
@@ -4362,33 +4362,33 @@ static PyObject *Ctl_CreateDisclosureTriangleControl(PyObject *_self, PyObject *
 {
        PyObject *_res = NULL;
        OSStatus _err;
-       WindowPtr window;
-       Rect boundsRect;
-       UInt16 orientation;
-       CFStringRef title;
-       SInt32 initialValue;
-       Boolean drawTitle;
-       Boolean autoToggles;
+       WindowPtr inWindow;
+       Rect inBoundsRect;
+       UInt16 inOrientation;
+       CFStringRef inTitle;
+       SInt32 inInitialValue;
+       Boolean inDrawTitle;
+       Boolean inAutoToggles;
        ControlHandle outControl;
 #ifndef CreateDisclosureTriangleControl
        PyMac_PRECHECK(CreateDisclosureTriangleControl);
 #endif
        if (!PyArg_ParseTuple(_args, "O&O&HO&lbb",
-                             WinObj_Convert, &window,
-                             PyMac_GetRect, &boundsRect,
-                             &orientation,
-                             CFStringRefObj_Convert, &title,
-                             &initialValue,
-                             &drawTitle,
-                             &autoToggles))
+                             WinObj_Convert, &inWindow,
+                             PyMac_GetRect, &inBoundsRect,
+                             &inOrientation,
+                             CFStringRefObj_Convert, &inTitle,
+                             &inInitialValue,
+                             &inDrawTitle,
+                             &inAutoToggles))
                return NULL;
-       _err = CreateDisclosureTriangleControl(window,
-                                              &boundsRect,
-                                              orientation,
-                                              title,
-                                              initialValue,
-                                              drawTitle,
-                                              autoToggles,
+       _err = CreateDisclosureTriangleControl(inWindow,
+                                              &inBoundsRect,
+                                              inOrientation,
+                                              inTitle,
+                                              inInitialValue,
+                                              inDrawTitle,
+                                              inAutoToggles,
                                               &outControl);
        if (_err != noErr) return PyMac_Error(_err);
        _res = Py_BuildValue("O&",
@@ -4882,24 +4882,24 @@ static PyObject *Ctl_CreateIconControl(PyObject *_self, PyObject *_args)
 {
        PyObject *_res = NULL;
        OSStatus _err;
-       WindowPtr window;
-       Rect boundsRect;
-       ControlButtonContentInfo icon;
-       Boolean dontTrack;
+       WindowPtr inWindow;
+       Rect inBoundsRect;
+       ControlButtonContentInfo inIconContent;
+       Boolean inDontTrack;
        ControlHandle outControl;
 #ifndef CreateIconControl
        PyMac_PRECHECK(CreateIconControl);
 #endif
        if (!PyArg_ParseTuple(_args, "O&O&O&b",
-                             WinObj_Convert, &window,
-                             PyMac_GetRect, &boundsRect,
-                             ControlButtonContentInfo_Convert, &icon,
-                             &dontTrack))
+                             WinObj_Convert, &inWindow,
+                             PyMac_GetRect, &inBoundsRect,
+                             ControlButtonContentInfo_Convert, &inIconContent,
+                             &inDontTrack))
                return NULL;
-       _err = CreateIconControl(window,
-                                &boundsRect,
-                                &icon,
-                                dontTrack,
+       _err = CreateIconControl(inWindow,
+                                &inBoundsRect,
+                                &inIconContent,
+                                inDontTrack,
                                 &outControl);
        if (_err != noErr) return PyMac_Error(_err);
        _res = Py_BuildValue("O&",
@@ -5422,7 +5422,7 @@ static PyMethodDef Ctl_methods[] = {
        {"DrawControls", (PyCFunction)Ctl_DrawControls, 1,
         PyDoc_STR("(WindowPtr theWindow) -> None")},
        {"UpdateControls", (PyCFunction)Ctl_UpdateControls, 1,
-        PyDoc_STR("(WindowPtr theWindow, RgnHandle updateRegion) -> None")},
+        PyDoc_STR("(WindowPtr inWindow, RgnHandle inUpdateRegion) -> None")},
        {"FindControl", (PyCFunction)Ctl_FindControl, 1,
         PyDoc_STR("(Point testPoint, WindowPtr theWindow) -> (ControlPartCode _rv, ControlHandle theControl)")},
        {"IdleControls", (PyCFunction)Ctl_IdleControls, 1,
@@ -5446,15 +5446,15 @@ static PyMethodDef Ctl_methods[] = {
        {"ClearKeyboardFocus", (PyCFunction)Ctl_ClearKeyboardFocus, 1,
         PyDoc_STR("(WindowPtr inWindow) -> None")},
        {"SetAutomaticControlDragTrackingEnabledForWindow", (PyCFunction)Ctl_SetAutomaticControlDragTrackingEnabledForWindow, 1,
-        PyDoc_STR("(WindowPtr theWindow, Boolean tracks) -> None")},
+        PyDoc_STR("(WindowPtr inWindow, Boolean inTracks) -> None")},
        {"IsAutomaticControlDragTrackingEnabledForWindow", (PyCFunction)Ctl_IsAutomaticControlDragTrackingEnabledForWindow, 1,
-        PyDoc_STR("(WindowPtr theWindow) -> (Boolean tracks)")},
+        PyDoc_STR("(WindowPtr inWindow) -> (Boolean outTracks)")},
        {"CreateBevelButtonControl", (PyCFunction)Ctl_CreateBevelButtonControl, 1,
         PyDoc_STR("(WindowPtr window, Rect boundsRect, CFStringRef title, UInt16 thickness, UInt16 behavior, ControlButtonContentInfo info, SInt16 menuID, UInt16 menuBehavior, UInt16 menuPlacement) -> (ControlHandle outControl)")},
        {"CreateSliderControl", (PyCFunction)Ctl_CreateSliderControl, 1,
         PyDoc_STR("(WindowPtr window, Rect boundsRect, SInt32 value, SInt32 minimum, SInt32 maximum, UInt16 orientation, UInt16 numTickMarks, Boolean liveTracking, PyObject* liveTrackingProc) -> (ControlHandle outControl)")},
        {"CreateDisclosureTriangleControl", (PyCFunction)Ctl_CreateDisclosureTriangleControl, 1,
-        PyDoc_STR("(WindowPtr window, Rect boundsRect, UInt16 orientation, CFStringRef title, SInt32 initialValue, Boolean drawTitle, Boolean autoToggles) -> (ControlHandle outControl)")},
+        PyDoc_STR("(WindowPtr inWindow, Rect inBoundsRect, UInt16 inOrientation, CFStringRef inTitle, SInt32 inInitialValue, Boolean inDrawTitle, Boolean inAutoToggles) -> (ControlHandle outControl)")},
        {"CreateProgressBarControl", (PyCFunction)Ctl_CreateProgressBarControl, 1,
         PyDoc_STR("(WindowPtr window, Rect boundsRect, SInt32 value, SInt32 minimum, SInt32 maximum, Boolean indeterminate) -> (ControlHandle outControl)")},
        {"CreateRelevanceBarControl", (PyCFunction)Ctl_CreateRelevanceBarControl, 1,
@@ -5488,7 +5488,7 @@ static PyMethodDef Ctl_methods[] = {
        {"CreatePictureControl", (PyCFunction)Ctl_CreatePictureControl, 1,
         PyDoc_STR("(WindowPtr window, Rect boundsRect, ControlButtonContentInfo content, Boolean dontTrack) -> (ControlHandle outControl)")},
        {"CreateIconControl", (PyCFunction)Ctl_CreateIconControl, 1,
-        PyDoc_STR("(WindowPtr window, Rect boundsRect, ControlButtonContentInfo icon, Boolean dontTrack) -> (ControlHandle outControl)")},
+        PyDoc_STR("(WindowPtr inWindow, Rect inBoundsRect, ControlButtonContentInfo inIconContent, Boolean inDontTrack) -> (ControlHandle outControl)")},
        {"CreateWindowHeaderControl", (PyCFunction)Ctl_CreateWindowHeaderControl, 1,
         PyDoc_STR("(WindowPtr window, Rect boundsRect, Boolean isListHeader) -> (ControlHandle outControl)")},
        {"CreatePushButtonControl", (PyCFunction)Ctl_CreatePushButtonControl, 1,
index ac1d3f4d93af7b9fa57fa458b904f6682d46d717..818541e52bb42384f1445228f30f39a1ffc1858b 100644 (file)
@@ -125,6 +125,7 @@ class MyScanner(Scanner):
 ##                     'DataBrowserTableViewColumnDesc',
 ##                     'DataBrowserListViewColumnDesc',
                        'CFDataRef',
+                       'DataBrowserListViewHeaderDesc', # difficult struct
                        ]
 
        def makerepairinstructions(self):
index 158cfffeb078efa6ad3c7066d791f475b22d03de..282728e288affbb68ece51e31f45194d283d2d0d 100644 (file)
@@ -47,12 +47,14 @@ class MyScanner(Scanner):
                self.defsfile.write("def FOUR_CHAR_CODE(x): return x\n")
                self.defsfile.write("from Carbon.TextEdit import *\n")
                self.defsfile.write("from Carbon.QuickDraw import *\n")
+               self.defsfile.write("fkDragActionAll = -1\n")
                self.defsfile.write("\n")
                # Defines unparseable in Drag.h
                self.defsfile.write(MISSING_DEFINES)
 
        def makeblacklistnames(self):
                return [
+                       "kDragActionAll",
                        ]
 
        def makeblacklisttypes(self):
index 8d663a3b14fcbab7d7ec038b8c6f30e2e03d1f3d..f8b5ba2f66a15fa21aa77602c827be1743ac6d77 100644 (file)
@@ -136,7 +136,9 @@ class MyScanner(Scanner_OSX):
                        "IOCompletionUPP", # Proc pointer
                        "AliasFilterProcPtr",
                        "AliasFilterUPP",
+                       "FNSubscriptionUPP",
                        
+                       "FNSubscriptionRef", # Lazy, for now.
                        ]
 
        def makerepairinstructions(self):
index bbd59ab18912b4d5de1ccec69bcb10501b13f6ef..2b43ed44402202cf0363f70bc22d19cd86634b96 100644 (file)
@@ -906,6 +906,32 @@ static PyObject *Icn_RegisterIconRefFromResource(PyObject *_self, PyObject *_arg
        return _res;
 }
 
+static PyObject *Icn_RegisterIconRefFromFSRef(PyObject *_self, PyObject *_args)
+{
+       PyObject *_res = NULL;
+       OSStatus _err;
+       OSType creator;
+       OSType iconType;
+       FSRef iconFile;
+       IconRef theIconRef;
+#ifndef RegisterIconRefFromFSRef
+       PyMac_PRECHECK(RegisterIconRefFromFSRef);
+#endif
+       if (!PyArg_ParseTuple(_args, "O&O&O&",
+                             PyMac_GetOSType, &creator,
+                             PyMac_GetOSType, &iconType,
+                             PyMac_GetFSRef, &iconFile))
+               return NULL;
+       _err = RegisterIconRefFromFSRef(creator,
+                                       iconType,
+                                       &iconFile,
+                                       &theIconRef);
+       if (_err != noErr) return PyMac_Error(_err);
+       _res = Py_BuildValue("O&",
+                            ResObj_New, theIconRef);
+       return _res;
+}
+
 static PyObject *Icn_UnregisterIconRef(PyObject *_self, PyObject *_args)
 {
        PyObject *_res = NULL;
@@ -1381,6 +1407,26 @@ static PyObject *Icn_ReadIconFile(PyObject *_self, PyObject *_args)
        return _res;
 }
 
+static PyObject *Icn_ReadIconFromFSRef(PyObject *_self, PyObject *_args)
+{
+       PyObject *_res = NULL;
+       OSStatus _err;
+       FSRef ref;
+       IconFamilyHandle iconFamily;
+#ifndef ReadIconFromFSRef
+       PyMac_PRECHECK(ReadIconFromFSRef);
+#endif
+       if (!PyArg_ParseTuple(_args, "O&",
+                             PyMac_GetFSRef, &ref))
+               return NULL;
+       _err = ReadIconFromFSRef(&ref,
+                                &iconFamily);
+       if (_err != noErr) return PyMac_Error(_err);
+       _res = Py_BuildValue("O&",
+                            ResObj_New, iconFamily);
+       return _res;
+}
+
 static PyObject *Icn_WriteIconFile(PyObject *_self, PyObject *_args)
 {
        PyObject *_res = NULL;
@@ -1479,6 +1525,8 @@ static PyMethodDef Icn_methods[] = {
         PyDoc_STR("(OSType creator, OSType iconType, IconFamilyHandle iconFamily) -> (IconRef theIconRef)")},
        {"RegisterIconRefFromResource", (PyCFunction)Icn_RegisterIconRefFromResource, 1,
         PyDoc_STR("(OSType creator, OSType iconType, FSSpec resourceFile, SInt16 resourceID) -> (IconRef theIconRef)")},
+       {"RegisterIconRefFromFSRef", (PyCFunction)Icn_RegisterIconRefFromFSRef, 1,
+        PyDoc_STR("(OSType creator, OSType iconType, FSRef iconFile) -> (IconRef theIconRef)")},
        {"UnregisterIconRef", (PyCFunction)Icn_UnregisterIconRef, 1,
         PyDoc_STR("(OSType creator, OSType iconType) -> None")},
        {"UpdateIconRef", (PyCFunction)Icn_UpdateIconRef, 1,
@@ -1521,6 +1569,8 @@ static PyMethodDef Icn_methods[] = {
         PyDoc_STR("(OSType creator, OSType iconType, FSSpec iconFile) -> (IconRef theIconRef)")},
        {"ReadIconFile", (PyCFunction)Icn_ReadIconFile, 1,
         PyDoc_STR("(FSSpec iconFile) -> (IconFamilyHandle iconFamily)")},
+       {"ReadIconFromFSRef", (PyCFunction)Icn_ReadIconFromFSRef, 1,
+        PyDoc_STR("(FSRef ref) -> (IconFamilyHandle iconFamily)")},
        {"WriteIconFile", (PyCFunction)Icn_WriteIconFile, 1,
         PyDoc_STR("(IconFamilyHandle iconFamily, FSSpec iconFile) -> None")},
        {NULL, NULL, 0}
index 138cc628990920ca2a65bdd6e8b1aa8a29dc6d1c..c6a39f36486addfc25326ac4e730e4b3d8ca1bbb 100644 (file)
@@ -48,6 +48,8 @@ class MyScanner(Scanner):
                        "err",
                        # OS8 only
                        'IconServicesTerminate',
+                       # Lazy, right now.
+                       "GetIconRefFromFileInfo"
                        ]
 
        def makeblacklisttypes(self):
@@ -55,6 +57,7 @@ class MyScanner(Scanner):
                        "IconActionUPP",
                        "IconGetterUPP",
                        "CFragInitBlockPtr",
+                       "CGRect_ptr",
                        ]
 
        def makerepairinstructions(self):
@@ -63,6 +66,7 @@ class MyScanner(Scanner):
 
        def writeinitialdefs(self):
                self.defsfile.write("def FOUR_CHAR_CODE(x): return x\n")
+               self.defsfile.write("from Carbon.Files import *\n")
                        
 if __name__ == "__main__":
        main()
index 9b4a68fbe2d8b62304e549ec89504f4829c1f88a..ef1dbf3a8276a2c2d3f4a156612390202396c07b 100644 (file)
@@ -32,6 +32,7 @@ IconTransformType = Type("IconTransformType", "h")
 IconSelectorValue = Type("IconSelectorValue", "l")
 IconServicesUsageFlags = Type("IconServicesUsageFlags", "l")
 RGBColor = OpaqueType("RGBColor", "QdRGB")
+CGContextRef = OpaqueByValueType("CGContextRef", "CGContextRefObj")
 
 #WindowPeek = OpaqueByValueType("WindowPeek", OBJECTPREFIX)
 
index cb3007f36b746dcf210b05e05da49dd8b75184cf..9180350bd554fc12df66cfbafdff6b71dd5cb67f 100644 (file)
@@ -97,6 +97,96 @@ static PyObject *Launch_LSCopyItemInfoForURL(PyObject *_self, PyObject *_args)
        return _res;
 }
 
+static PyObject *Launch_LSGetExtensionInfo(PyObject *_self, PyObject *_args)
+{
+       PyObject *_res = NULL;
+       OSStatus _err;
+       UniChar *inNameLen__in__;
+       UniCharCount inNameLen__len__;
+       int inNameLen__in_len__;
+       UniCharCount outExtStartIndex;
+       if (!PyArg_ParseTuple(_args, "u#",
+                             &inNameLen__in__, &inNameLen__in_len__))
+               return NULL;
+       inNameLen__len__ = inNameLen__in_len__;
+       _err = LSGetExtensionInfo(inNameLen__len__, inNameLen__in__,
+                                 &outExtStartIndex);
+       if (_err != noErr) return PyMac_Error(_err);
+       _res = Py_BuildValue("l",
+                            outExtStartIndex);
+       return _res;
+}
+
+static PyObject *Launch_LSCopyDisplayNameForRef(PyObject *_self, PyObject *_args)
+{
+       PyObject *_res = NULL;
+       OSStatus _err;
+       FSRef inRef;
+       CFStringRef outDisplayName;
+       if (!PyArg_ParseTuple(_args, "O&",
+                             PyMac_GetFSRef, &inRef))
+               return NULL;
+       _err = LSCopyDisplayNameForRef(&inRef,
+                                      &outDisplayName);
+       if (_err != noErr) return PyMac_Error(_err);
+       _res = Py_BuildValue("O&",
+                            CFStringRefObj_New, outDisplayName);
+       return _res;
+}
+
+static PyObject *Launch_LSCopyDisplayNameForURL(PyObject *_self, PyObject *_args)
+{
+       PyObject *_res = NULL;
+       OSStatus _err;
+       CFURLRef inURL;
+       CFStringRef outDisplayName;
+       if (!PyArg_ParseTuple(_args, "O&",
+                             CFURLRefObj_Convert, &inURL))
+               return NULL;
+       _err = LSCopyDisplayNameForURL(inURL,
+                                      &outDisplayName);
+       if (_err != noErr) return PyMac_Error(_err);
+       _res = Py_BuildValue("O&",
+                            CFStringRefObj_New, outDisplayName);
+       return _res;
+}
+
+static PyObject *Launch_LSSetExtensionHiddenForRef(PyObject *_self, PyObject *_args)
+{
+       PyObject *_res = NULL;
+       OSStatus _err;
+       FSRef inRef;
+       Boolean inHide;
+       if (!PyArg_ParseTuple(_args, "O&b",
+                             PyMac_GetFSRef, &inRef,
+                             &inHide))
+               return NULL;
+       _err = LSSetExtensionHiddenForRef(&inRef,
+                                         inHide);
+       if (_err != noErr) return PyMac_Error(_err);
+       Py_INCREF(Py_None);
+       _res = Py_None;
+       return _res;
+}
+
+static PyObject *Launch_LSSetExtensionHiddenForURL(PyObject *_self, PyObject *_args)
+{
+       PyObject *_res = NULL;
+       OSStatus _err;
+       CFURLRef inURL;
+       Boolean inHide;
+       if (!PyArg_ParseTuple(_args, "O&b",
+                             CFURLRefObj_Convert, &inURL,
+                             &inHide))
+               return NULL;
+       _err = LSSetExtensionHiddenForURL(inURL,
+                                         inHide);
+       if (_err != noErr) return PyMac_Error(_err);
+       Py_INCREF(Py_None);
+       _res = Py_None;
+       return _res;
+}
+
 static PyObject *Launch_LSCopyKindStringForRef(PyObject *_self, PyObject *_args)
 {
        PyObject *_res = NULL;
@@ -323,6 +413,16 @@ static PyMethodDef Launch_methods[] = {
         PyDoc_STR("(FSRef inItemRef, LSRequestedInfo inWhichInfo) -> (LSItemInfoRecord outItemInfo)")},
        {"LSCopyItemInfoForURL", (PyCFunction)Launch_LSCopyItemInfoForURL, 1,
         PyDoc_STR("(CFURLRef inURL, LSRequestedInfo inWhichInfo) -> (LSItemInfoRecord outItemInfo)")},
+       {"LSGetExtensionInfo", (PyCFunction)Launch_LSGetExtensionInfo, 1,
+        PyDoc_STR("(Buffer inNameLen) -> (UniCharCount outExtStartIndex)")},
+       {"LSCopyDisplayNameForRef", (PyCFunction)Launch_LSCopyDisplayNameForRef, 1,
+        PyDoc_STR("(FSRef inRef) -> (CFStringRef outDisplayName)")},
+       {"LSCopyDisplayNameForURL", (PyCFunction)Launch_LSCopyDisplayNameForURL, 1,
+        PyDoc_STR("(CFURLRef inURL) -> (CFStringRef outDisplayName)")},
+       {"LSSetExtensionHiddenForRef", (PyCFunction)Launch_LSSetExtensionHiddenForRef, 1,
+        PyDoc_STR("(FSRef inRef, Boolean inHide) -> None")},
+       {"LSSetExtensionHiddenForURL", (PyCFunction)Launch_LSSetExtensionHiddenForURL, 1,
+        PyDoc_STR("(CFURLRef inURL, Boolean inHide) -> None")},
        {"LSCopyKindStringForRef", (PyCFunction)Launch_LSCopyKindStringForRef, 1,
         PyDoc_STR("(FSRef inFSRef) -> (CFStringRef outKindString)")},
        {"LSCopyKindStringForURL", (PyCFunction)Launch_LSCopyKindStringForURL, 1,
index 8d0f3e913fd447ef2af5bd5c082ebd0015db07e0..01f68f56c01faef3c9f486d89a543c6d7ff0b039 100644 (file)
@@ -39,8 +39,10 @@ class MyScanner(Scanner):
 
        def writeinitialdefs(self):
                self.defsfile.write("def FOUR_CHAR_CODE(x): return x\n")
+               self.defsfile.write("from Carbon.Files import *\n")
                self.defsfile.write("kLSRequestAllInfo = -1\n")
                self.defsfile.write("kLSRolesAll = -1\n")
+               self.defsfile.write("kLSInvalidExtensionIndex = -1\n")
 
        def makeblacklistnames(self):
                return [
@@ -48,6 +50,7 @@ class MyScanner(Scanner):
                        "LSTerm",
                        "kLSRequestAllInfo",
                        "kLSRolesAll",
+                       "kLSInvalidExtensionIndex",
                        ]
 
        def makeblacklisttypes(self):
@@ -67,6 +70,12 @@ class MyScanner(Scanner):
                 [('OptCFStringRef', 'inBundleID', 'InMode')]),
                        ([('CFStringRef', 'inName', 'InMode')],
                 [('OptCFStringRef', 'inName', 'InMode')]),
+
+                       # Unicode filenames passed as length, buffer. LSGetExtensionInfo
+                       ([('UniCharCount', '*', 'InMode'),
+                         ('UniChar_ptr', '*', 'InMode')],
+                        [('UnicodeReverseInBuffer', '*', 'InMode')]
+                       ),
                        ]
                        
 if __name__ == "__main__":
index 066d3c669e566e0d5a2ceb49fb23bd2af83dafa9..7816a46410b7f66a22715c1b1d007fa0adfc8dfb 100644 (file)
@@ -24,22 +24,9 @@ LSAcceptanceFlags = Type("LSAcceptanceFlags", "l")
 LSInitializeFlags = Type("LSInitializeFlags", "l")
 LSRequestedInfo = Type("LSRequestedInfo", "l")
 LSRolesMask = Type("LSRolesMask", "l")
+UniCharCount = Type("UniCharCount", "l")
 OptCFStringRef = OpaqueByValueType("CFStringRef", "OptCFStringRefObj")
 LSItemInfoRecord = OpaqueType("LSItemInfoRecord", "LSItemInfoRecord")
-#MenuRef = OpaqueByValueType("MenuRef", "MenuObj")
-#MenuItemIndex = Type("MenuItemIndex", "H")
-
-#WindowPeek = OpaqueByValueType("WindowPeek", OBJECTPREFIX)
-
-#RgnHandle = FakeType("(RgnHandle)0")
-# XXXX Should be next, but this will break a lot of code...
-# RgnHandle = OpaqueByValueType("RgnHandle", "OptResObj")
-
-#KeyMap = ArrayOutputBufferType("KeyMap")
-##MacOSEventKind = Type("MacOSEventKind", "h") # Old-style
-##MacOSEventMask = Type("MacOSEventMask", "h") # Old-style
-#EventMask = Type("EventMask", "H")
-#EventKind = Type("EventKind", "H")
 
 includestuff = includestuff + """
 #include <ApplicationServices/ApplicationServices.h>
index 2c972e9f80baae9203d28db525796a7d6010662f..0b37fe1e1d4e42ad34f5907a7728918d13a1584d 100644 (file)
@@ -361,7 +361,7 @@ static PyObject *TXNObj_TXNGrowWindow(TXNObjectObject *_self, PyObject *_args)
 static PyObject *TXNObj_TXNZoomWindow(TXNObjectObject *_self, PyObject *_args)
 {
        PyObject *_res = NULL;
-       short iPart;
+       SInt16 iPart;
 #ifndef TXNZoomWindow
        PyMac_PRECHECK(TXNZoomWindow);
 #endif
@@ -697,37 +697,6 @@ static PyObject *TXNObj_TXNSetDataFromFile(TXNObjectObject *_self, PyObject *_ar
        return _res;
 }
 
-static PyObject *TXNObj_TXNSetData(TXNObjectObject *_self, PyObject *_args)
-{
-       PyObject *_res = NULL;
-       OSStatus _err;
-       TXNDataType iDataType;
-       void * *iDataPtr__in__;
-       ByteCount iDataPtr__len__;
-       int iDataPtr__in_len__;
-       TXNOffset iStartOffset;
-       TXNOffset iEndOffset;
-#ifndef TXNSetData
-       PyMac_PRECHECK(TXNSetData);
-#endif
-       if (!PyArg_ParseTuple(_args, "O&s#ll",
-                             PyMac_GetOSType, &iDataType,
-                             &iDataPtr__in__, &iDataPtr__in_len__,
-                             &iStartOffset,
-                             &iEndOffset))
-               return NULL;
-       iDataPtr__len__ = iDataPtr__in_len__;
-       _err = TXNSetData(_self->ob_itself,
-                         iDataType,
-                         iDataPtr__in__, iDataPtr__len__,
-                         iStartOffset,
-                         iEndOffset);
-       if (_err != noErr) return PyMac_Error(_err);
-       Py_INCREF(Py_None);
-       _res = Py_None;
-       return _res;
-}
-
 static PyObject *TXNObj_TXNGetChangeCount(TXNObjectObject *_self, PyObject *_args)
 {
        PyObject *_res = NULL;
@@ -1150,6 +1119,20 @@ static PyObject *TXNObj_TXNIsObjectAttachedToSpecificWindow(TXNObjectObject *_se
        return _res;
 }
 
+static PyObject *TXNObj_TXNRecalcTextLayout(TXNObjectObject *_self, PyObject *_args)
+{
+       PyObject *_res = NULL;
+#ifndef TXNRecalcTextLayout
+       PyMac_PRECHECK(TXNRecalcTextLayout);
+#endif
+       if (!PyArg_ParseTuple(_args, ""))
+               return NULL;
+       TXNRecalcTextLayout(_self->ob_itself);
+       Py_INCREF(Py_None);
+       _res = Py_None;
+       return _res;
+}
+
 static PyMethodDef TXNObj_methods[] = {
        {"TXNDeleteObject", (PyCFunction)TXNObj_TXNDeleteObject, 1,
         PyDoc_STR("() -> None")},
@@ -1180,7 +1163,7 @@ static PyMethodDef TXNObj_methods[] = {
        {"TXNGrowWindow", (PyCFunction)TXNObj_TXNGrowWindow, 1,
         PyDoc_STR("(EventRecord iEvent) -> None")},
        {"TXNZoomWindow", (PyCFunction)TXNObj_TXNZoomWindow, 1,
-        PyDoc_STR("(short iPart) -> None")},
+        PyDoc_STR("(SInt16 iPart) -> None")},
        {"TXNCanUndo", (PyCFunction)TXNObj_TXNCanUndo, 1,
         PyDoc_STR("() -> (Boolean _rv, TXNActionKey oTXNActionKey)")},
        {"TXNUndo", (PyCFunction)TXNObj_TXNUndo, 1,
@@ -1215,8 +1198,6 @@ static PyMethodDef TXNObj_methods[] = {
         PyDoc_STR("(TXNOffset iStartOffset, TXNOffset iEndOffset, TXNDataType iEncoding) -> (Handle oDataHandle)")},
        {"TXNSetDataFromFile", (PyCFunction)TXNObj_TXNSetDataFromFile, 1,
         PyDoc_STR("(SInt16 iFileRefNum, OSType iFileType, ByteCount iFileLength, TXNOffset iStartOffset, TXNOffset iEndOffset) -> None")},
-       {"TXNSetData", (PyCFunction)TXNObj_TXNSetData, 1,
-        PyDoc_STR("(TXNDataType iDataType, Buffer iDataPtr, TXNOffset iStartOffset, TXNOffset iEndOffset) -> None")},
        {"TXNGetChangeCount", (PyCFunction)TXNObj_TXNGetChangeCount, 1,
         PyDoc_STR("() -> (ItemCount _rv)")},
        {"TXNSave", (PyCFunction)TXNObj_TXNSave, 1,
@@ -1257,6 +1238,8 @@ static PyMethodDef TXNObj_methods[] = {
         PyDoc_STR("(UInt32 iLineNumber) -> (Fixed oLineWidth, Fixed oLineHeight)")},
        {"TXNIsObjectAttachedToSpecificWindow", (PyCFunction)TXNObj_TXNIsObjectAttachedToSpecificWindow, 1,
         PyDoc_STR("(WindowPtr iWindow) -> (Boolean oAttached)")},
+       {"TXNRecalcTextLayout", (PyCFunction)TXNObj_TXNRecalcTextLayout, 1,
+        PyDoc_STR("() -> None")},
        {NULL, NULL, 0}
 };
 
@@ -1493,7 +1476,7 @@ static PyObject *Mlte_TXNNewObject(PyObject *_self, PyObject *_args)
        OSStatus _err;
        FSSpec * iFileSpec;
        WindowPtr iWindow;
-       Rect iFrame;
+       Rect iFrame;
        TXNFrameOptions iFrameOptions;
        TXNFrameType iFrameType;
        TXNFileType iFileType;
@@ -1506,7 +1489,7 @@ static PyObject *Mlte_TXNNewObject(PyObject *_self, PyObject *_args)
        if (!PyArg_ParseTuple(_args, "O&O&O&llO&l",
                              OptFSSpecPtr_Convert, &iFileSpec,
                              WinObj_Convert, &iWindow,
-                             OptRectPtr_Convert, &iFrame,
+                             PyMac_GetRect, &iFrame,
                              &iFrameOptions,
                              &iFrameType,
                              PyMac_GetOSType, &iFileType,
@@ -1514,7 +1497,7 @@ static PyObject *Mlte_TXNNewObject(PyObject *_self, PyObject *_args)
                return NULL;
        _err = TXNNewObject(iFileSpec,
                            iWindow,
-                           iFrame,
+                           &iFrame,
                            iFrameOptions,
                            iFrameType,
                            iFileType,
@@ -1656,7 +1639,7 @@ static PyObject *Mlte_TXNInitTextension(PyObject *_self, PyObject *_args)
 
 static PyMethodDef Mlte_methods[] = {
        {"TXNNewObject", (PyCFunction)Mlte_TXNNewObject, 1,
-        PyDoc_STR("(FSSpec * iFileSpec, WindowPtr iWindow, Rect iFrame, TXNFrameOptions iFrameOptions, TXNFrameType iFrameType, TXNFileType iFileType, TXNPermanentTextEncodingType iPermanentEncoding) -> (TXNObject oTXNObject, TXNFrameID oTXNFrameID)")},
+        PyDoc_STR("(FSSpec * iFileSpec, WindowPtr iWindow, Rect iFrame, TXNFrameOptions iFrameOptions, TXNFrameType iFrameType, TXNFileType iFileType, TXNPermanentTextEncodingType iPermanentEncoding) -> (TXNObject oTXNObject, TXNFrameID oTXNFrameID)")},
        {"TXNTerminateTextension", (PyCFunction)Mlte_TXNTerminateTextension, 1,
         PyDoc_STR("() -> None")},
        {"TXNIsScrapPastable", (PyCFunction)Mlte_TXNIsScrapPastable, 1,
index 011d7bbeefeb43c2e818755f3eef7ad5b98d6af4..134bffa30e7ed960252726fb763d2a210433890b 100644 (file)
@@ -52,6 +52,7 @@ kTXNEndOffset = 0x7FFFFFFF
 MovieFileType = FOUR_CHAR_CODE('moov')
 kTXNUseEncodingWordRulesMask = 0x80000000
 kTXNFontSizeAttributeSize = 4
+normal = 0
 """)
 
        def makeblacklistnames(self):
@@ -94,10 +95,18 @@ kTXNFontSizeAttributeSize = 4
                        "TXNBackground", #TBD
                        "TXNFindUPP", 
                        "ATSUStyle", #TBD
+                       "TXNBackground_ptr", #TBD
+                       "TXNControlData_ptr", #TBD
+                       "TXNControlTag_ptr", #TBD
+                       "TXNLongRect", #TBD
+                       "TXNLongRect_ptr", #TBD
+                       "TXNTypeAttributes_ptr", #TBD
+
                        "TXNActionKeyMapperProcPtr",
                        "TXNActionKeyMapperUPP",
                        "TXNTextBoxOptionsData",
                        "TXNCountOptions",
+                       "void_ptr",
                        ]
 
        def makerepairinstructions(self):
index ed58fc8b9e107e395ff43f66821d0931603cc5f4..75e1a0808aa3275e21f75e2ca9f952c5a97e2417 100644 (file)
@@ -47,6 +47,7 @@ class MyScanner(Scanner):
 
        def makeblacklisttypes(self):
                return [
+                       "OSALocalOrGlobal",
                        "OSACreateAppleEventUPP",
                        "OSAActiveUPP",
                        "AEEventHandlerUPP",
index fe687b4435a42138c72bb5c04095da7de734eeaf..7e702236064c8be1eb7dcb97f85d68b08b062ef3 100644 (file)
@@ -40,6 +40,7 @@ initstuff = initstuff + """
 
 ComponentInstance = OpaqueByValueType('ComponentInstance', OBJECTPREFIX)
 OSAError = OSErrType("OSAError", "l")
+# OSALocalOrGlobal = Type("OSALocalOrGlobal", "l")
 OSAID = Type("OSAID", "l")
 OSADebugCallFrameRef = Type("OSADebugCallFrameRef", "l")
 OSADebugSessionRef = Type("OSADebugSessionRef", "l")
index e971e31ab20969690b3252e1e33b1e9806b8e2cf..2a131827c3fabacfb4e553250bb0210f8675274a 100644 (file)
@@ -1041,15 +1041,15 @@ static PyObject *WinObj_SetWindowProxyAlias(WindowObject *_self, PyObject *_args
 {
        PyObject *_res = NULL;
        OSStatus _err;
-       AliasHandle alias;
+       AliasHandle inAlias;
 #ifndef SetWindowProxyAlias
        PyMac_PRECHECK(SetWindowProxyAlias);
 #endif
        if (!PyArg_ParseTuple(_args, "O&",
-                             ResObj_Convert, &alias))
+                             ResObj_Convert, &inAlias))
                return NULL;
        _err = SetWindowProxyAlias(_self->ob_itself,
-                                  alias);
+                                  inAlias);
        if (_err != noErr) return PyMac_Error(_err);
        Py_INCREF(Py_None);
        _res = Py_None;
@@ -1332,21 +1332,21 @@ static PyObject *WinObj_TransitionWindow(WindowObject *_self, PyObject *_args)
 {
        PyObject *_res = NULL;
        OSStatus _err;
-       WindowTransitionEffect effect;
-       WindowTransitionAction action;
-       Rect rect;
+       WindowTransitionEffect inEffect;
+       WindowTransitionAction inAction;
+       Rect inRect;
 #ifndef TransitionWindow
        PyMac_PRECHECK(TransitionWindow);
 #endif
        if (!PyArg_ParseTuple(_args, "llO&",
-                             &effect,
-                             &action,
-                             PyMac_GetRect, &rect))
+                             &inEffect,
+                             &inAction,
+                             PyMac_GetRect, &inRect))
                return NULL;
        _err = TransitionWindow(_self->ob_itself,
-                               effect,
-                               action,
-                               &rect);
+                               inEffect,
+                               inAction,
+                               &inRect);
        if (_err != noErr) return PyMac_Error(_err);
        Py_INCREF(Py_None);
        _res = Py_None;
@@ -1357,24 +1357,24 @@ static PyObject *WinObj_TransitionWindowAndParent(WindowObject *_self, PyObject
 {
        PyObject *_res = NULL;
        OSStatus _err;
-       WindowPtr parentWindow;
-       WindowTransitionEffect effect;
-       WindowTransitionAction action;
-       Rect rect;
+       WindowPtr inParentWindow;
+       WindowTransitionEffect inEffect;
+       WindowTransitionAction inAction;
+       Rect inRect;
 #ifndef TransitionWindowAndParent
        PyMac_PRECHECK(TransitionWindowAndParent);
 #endif
        if (!PyArg_ParseTuple(_args, "O&llO&",
-                             WinObj_Convert, &parentWindow,
-                             &effect,
-                             &action,
-                             PyMac_GetRect, &rect))
+                             WinObj_Convert, &inParentWindow,
+                             &inEffect,
+                             &inAction,
+                             PyMac_GetRect, &inRect))
                return NULL;
        _err = TransitionWindowAndParent(_self->ob_itself,
-                                        parentWindow,
-                                        effect,
-                                        action,
-                                        &rect);
+                                        inParentWindow,
+                                        inEffect,
+                                        inAction,
+                                        &inRect);
        if (_err != noErr) return PyMac_Error(_err);
        Py_INCREF(Py_None);
        _res = Py_None;
@@ -1562,23 +1562,23 @@ static PyObject *WinObj_ResizeWindow(WindowObject *_self, PyObject *_args)
 {
        PyObject *_res = NULL;
        Boolean _rv;
-       Point startPoint;
-       Rect sizeConstraints;
-       Rect newContentRect;
+       Point inStartPoint;
+       Rect inSizeConstraints;
+       Rect outNewContentRect;
 #ifndef ResizeWindow
        PyMac_PRECHECK(ResizeWindow);
 #endif
        if (!PyArg_ParseTuple(_args, "O&O&",
-                             PyMac_GetPoint, &startPoint,
-                             PyMac_GetRect, &sizeConstraints))
+                             PyMac_GetPoint, &inStartPoint,
+                             PyMac_GetRect, &inSizeConstraints))
                return NULL;
        _rv = ResizeWindow(_self->ob_itself,
-                          startPoint,
-                          &sizeConstraints,
-                          &newContentRect);
+                          inStartPoint,
+                          &inSizeConstraints,
+                          &outNewContentRect);
        _res = Py_BuildValue("bO&",
                             _rv,
-                            PyMac_BuildRect, &newContentRect);
+                            PyMac_BuildRect, &outNewContentRect);
        return _res;
 }
 
@@ -1652,20 +1652,20 @@ static PyObject *WinObj_IsWindowInStandardState(WindowObject *_self, PyObject *_
 {
        PyObject *_res = NULL;
        Boolean _rv;
-       Point idealSize;
-       Rect idealStandardState;
+       Point inIdealSize;
+       Rect outIdealStandardState;
 #ifndef IsWindowInStandardState
        PyMac_PRECHECK(IsWindowInStandardState);
 #endif
-       if (!PyArg_ParseTuple(_args, ""))
+       if (!PyArg_ParseTuple(_args, "O&",
+                             PyMac_GetPoint, &inIdealSize))
                return NULL;
        _rv = IsWindowInStandardState(_self->ob_itself,
-                                     &idealSize,
-                                     &idealStandardState);
-       _res = Py_BuildValue("bO&O&",
+                                     &inIdealSize,
+                                     &outIdealStandardState);
+       _res = Py_BuildValue("bO&",
                             _rv,
-                            PyMac_BuildPoint, idealSize,
-                            PyMac_BuildRect, &idealStandardState);
+                            PyMac_BuildRect, &outIdealStandardState);
        return _res;
 }
 
@@ -1673,16 +1673,16 @@ static PyObject *WinObj_ZoomWindowIdeal(WindowObject *_self, PyObject *_args)
 {
        PyObject *_res = NULL;
        OSStatus _err;
-       WindowPartCode partCode;
+       WindowPartCode inPartCode;
        Point ioIdealSize;
 #ifndef ZoomWindowIdeal
        PyMac_PRECHECK(ZoomWindowIdeal);
 #endif
        if (!PyArg_ParseTuple(_args, "h",
-                             &partCode))
+                             &inPartCode))
                return NULL;
        _err = ZoomWindowIdeal(_self->ob_itself,
-                              partCode,
+                              inPartCode,
                               &ioIdealSize);
        if (_err != noErr) return PyMac_Error(_err);
        _res = Py_BuildValue("O&",
@@ -1694,17 +1694,17 @@ static PyObject *WinObj_GetWindowIdealUserState(WindowObject *_self, PyObject *_
 {
        PyObject *_res = NULL;
        OSStatus _err;
-       Rect userState;
+       Rect outUserState;
 #ifndef GetWindowIdealUserState
        PyMac_PRECHECK(GetWindowIdealUserState);
 #endif
        if (!PyArg_ParseTuple(_args, ""))
                return NULL;
        _err = GetWindowIdealUserState(_self->ob_itself,
-                                      &userState);
+                                      &outUserState);
        if (_err != noErr) return PyMac_Error(_err);
        _res = Py_BuildValue("O&",
-                            PyMac_BuildRect, &userState);
+                            PyMac_BuildRect, &outUserState);
        return _res;
 }
 
@@ -1712,15 +1712,15 @@ static PyObject *WinObj_SetWindowIdealUserState(WindowObject *_self, PyObject *_
 {
        PyObject *_res = NULL;
        OSStatus _err;
-       Rect userState;
+       Rect inUserState;
 #ifndef SetWindowIdealUserState
        PyMac_PRECHECK(SetWindowIdealUserState);
 #endif
        if (!PyArg_ParseTuple(_args, "O&",
-                             PyMac_GetRect, &userState))
+                             PyMac_GetRect, &inUserState))
                return NULL;
        _err = SetWindowIdealUserState(_self->ob_itself,
-                                      &userState);
+                                      &inUserState);
        if (_err != noErr) return PyMac_Error(_err);
        Py_INCREF(Py_None);
        _res = Py_None;
@@ -1997,6 +1997,21 @@ static PyObject *WinObj_GetWindowPort(WindowObject *_self, PyObject *_args)
        return _res;
 }
 
+static PyObject *WinObj_GetWindowStructurePort(WindowObject *_self, PyObject *_args)
+{
+       PyObject *_res = NULL;
+       CGrafPtr _rv;
+#ifndef GetWindowStructurePort
+       PyMac_PRECHECK(GetWindowStructurePort);
+#endif
+       if (!PyArg_ParseTuple(_args, ""))
+               return NULL;
+       _rv = GetWindowStructurePort(_self->ob_itself);
+       _res = Py_BuildValue("O&",
+                            GrafObj_New, _rv);
+       return _res;
+}
+
 static PyObject *WinObj_GetWindowKind(WindowObject *_self, PyObject *_args)
 {
        PyObject *_res = NULL;
@@ -2412,7 +2427,7 @@ static PyMethodDef WinObj_methods[] = {
        {"GetWindowProxyFSSpec", (PyCFunction)WinObj_GetWindowProxyFSSpec, 1,
         PyDoc_STR("() -> (FSSpec outFile)")},
        {"SetWindowProxyAlias", (PyCFunction)WinObj_SetWindowProxyAlias, 1,
-        PyDoc_STR("(AliasHandle alias) -> None")},
+        PyDoc_STR("(AliasHandle inAlias) -> None")},
        {"GetWindowProxyAlias", (PyCFunction)WinObj_GetWindowProxyAlias, 1,
         PyDoc_STR("() -> (AliasHandle alias)")},
        {"SetWindowProxyCreatorAndType", (PyCFunction)WinObj_SetWindowProxyCreatorAndType, 1,
@@ -2442,9 +2457,9 @@ static PyMethodDef WinObj_methods[] = {
        {"HiliteWindowFrameForDrag", (PyCFunction)WinObj_HiliteWindowFrameForDrag, 1,
         PyDoc_STR("(Boolean hilited) -> None")},
        {"TransitionWindow", (PyCFunction)WinObj_TransitionWindow, 1,
-        PyDoc_STR("(WindowTransitionEffect effect, WindowTransitionAction action, Rect rect) -> None")},
+        PyDoc_STR("(WindowTransitionEffect inEffect, WindowTransitionAction inAction, Rect inRect) -> None")},
        {"TransitionWindowAndParent", (PyCFunction)WinObj_TransitionWindowAndParent, 1,
-        PyDoc_STR("(WindowPtr parentWindow, WindowTransitionEffect effect, WindowTransitionAction action, Rect rect) -> None")},
+        PyDoc_STR("(WindowPtr inParentWindow, WindowTransitionEffect inEffect, WindowTransitionAction inAction, Rect inRect) -> None")},
        {"MacMoveWindow", (PyCFunction)WinObj_MacMoveWindow, 1,
         PyDoc_STR("(short hGlobal, short vGlobal, Boolean front) -> None")},
        {"SizeWindow", (PyCFunction)WinObj_SizeWindow, 1,
@@ -2464,7 +2479,7 @@ static PyMethodDef WinObj_methods[] = {
        {"GetWindowBounds", (PyCFunction)WinObj_GetWindowBounds, 1,
         PyDoc_STR("(WindowRegionCode regionCode) -> (Rect globalBounds)")},
        {"ResizeWindow", (PyCFunction)WinObj_ResizeWindow, 1,
-        PyDoc_STR("(Point startPoint, Rect sizeConstraints) -> (Boolean _rv, Rect newContentRect)")},
+        PyDoc_STR("(Point inStartPoint, Rect inSizeConstraints) -> (Boolean _rv, Rect outNewContentRect)")},
        {"SetWindowBounds", (PyCFunction)WinObj_SetWindowBounds, 1,
         PyDoc_STR("(WindowRegionCode regionCode, Rect globalBounds) -> None")},
        {"RepositionWindow", (PyCFunction)WinObj_RepositionWindow, 1,
@@ -2472,13 +2487,13 @@ static PyMethodDef WinObj_methods[] = {
        {"MoveWindowStructure", (PyCFunction)WinObj_MoveWindowStructure, 1,
         PyDoc_STR("(short hGlobal, short vGlobal) -> None")},
        {"IsWindowInStandardState", (PyCFunction)WinObj_IsWindowInStandardState, 1,
-        PyDoc_STR("() -> (Boolean _rv, Point idealSize, Rect idealStandardState)")},
+        PyDoc_STR("(Point inIdealSize) -> (Boolean _rv, Rect outIdealStandardState)")},
        {"ZoomWindowIdeal", (PyCFunction)WinObj_ZoomWindowIdeal, 1,
-        PyDoc_STR("(WindowPartCode partCode) -> (Point ioIdealSize)")},
+        PyDoc_STR("(WindowPartCode inPartCode) -> (Point ioIdealSize)")},
        {"GetWindowIdealUserState", (PyCFunction)WinObj_GetWindowIdealUserState, 1,
-        PyDoc_STR("() -> (Rect userState)")},
+        PyDoc_STR("() -> (Rect outUserState)")},
        {"SetWindowIdealUserState", (PyCFunction)WinObj_SetWindowIdealUserState, 1,
-        PyDoc_STR("(Rect userState) -> None")},
+        PyDoc_STR("(Rect inUserState) -> None")},
        {"GetWindowGreatestAreaDevice", (PyCFunction)WinObj_GetWindowGreatestAreaDevice, 1,
         PyDoc_STR("(WindowRegionCode inRegion) -> (GDHandle outGreatestDevice, Rect outGreatestDeviceRect)")},
        {"ConstrainWindowToScreen", (PyCFunction)WinObj_ConstrainWindowToScreen, 1,
@@ -2507,6 +2522,8 @@ static PyMethodDef WinObj_methods[] = {
         PyDoc_STR("(Point thePt) -> (Boolean _rv)")},
        {"GetWindowPort", (PyCFunction)WinObj_GetWindowPort, 1,
         PyDoc_STR("() -> (CGrafPtr _rv)")},
+       {"GetWindowStructurePort", (PyCFunction)WinObj_GetWindowStructurePort, 1,
+        PyDoc_STR("() -> (CGrafPtr _rv)")},
        {"GetWindowKind", (PyCFunction)WinObj_GetWindowKind, 1,
         PyDoc_STR("() -> (short _rv)")},
        {"IsWindowHilited", (PyCFunction)WinObj_IsWindowHilited, 1,
@@ -2998,7 +3015,7 @@ static PyObject *Win_GetAvailableWindowPositioningBounds(PyObject *_self, PyObje
        PyObject *_res = NULL;
        OSStatus _err;
        GDHandle inDevice;
-       Rect availableRect;
+       Rect outAvailableRect;
 #ifndef GetAvailableWindowPositioningBounds
        PyMac_PRECHECK(GetAvailableWindowPositioningBounds);
 #endif
@@ -3006,10 +3023,10 @@ static PyObject *Win_GetAvailableWindowPositioningBounds(PyObject *_self, PyObje
                              ResObj_Convert, &inDevice))
                return NULL;
        _err = GetAvailableWindowPositioningBounds(inDevice,
-                                                  &availableRect);
+                                                  &outAvailableRect);
        if (_err != noErr) return PyMac_Error(_err);
        _res = Py_BuildValue("O&",
-                            PyMac_BuildRect, &availableRect);
+                            PyMac_BuildRect, &outAvailableRect);
        return _res;
 }
 
@@ -3166,7 +3183,7 @@ static PyMethodDef Win_methods[] = {
        {"CollapseAllWindows", (PyCFunction)Win_CollapseAllWindows, 1,
         PyDoc_STR("(Boolean collapse) -> None")},
        {"GetAvailableWindowPositioningBounds", (PyCFunction)Win_GetAvailableWindowPositioningBounds, 1,
-        PyDoc_STR("(GDHandle inDevice) -> (Rect availableRect)")},
+        PyDoc_STR("(GDHandle inDevice) -> (Rect outAvailableRect)")},
        {"DisableScreenUpdates", (PyCFunction)Win_DisableScreenUpdates, 1,
         PyDoc_STR("() -> None")},
        {"EnableScreenUpdates", (PyCFunction)Win_EnableScreenUpdates, 1,
index 1aefbd3a2a0447dfb63ef3293f0e65e46b3589e0..6b08c00195a1363e0d9d9bc1b7345395fd53bb3f 100644 (file)
@@ -35,6 +35,7 @@ class MyScanner(Scanner):
                self.defsfile.write("def FOUR_CHAR_CODE(x): return x\n")
                self.defsfile.write("false = 0\n")
                self.defsfile.write("true = 1\n")
+               self.defsfile.write("kWindowNoConstrainAttribute = 0x80000000\n")
 
        def makeblacklistnames(self):
                return [
@@ -49,6 +50,7 @@ class MyScanner(Scanner):
                        # Constants with funny definitions
                        'kMouseUpOutOfSlop',
                        'kAllWindowClasses',
+                       'kWindowNoConstrainAttribute',
                        # OS8 only:
                        'GetAuxWin',
                        'GetWindowDataHandle',