Commit fa77e1a1 authored by Jack Jansen's avatar Jack Jansen

Lots more Carbon/Carbon.h includes, new UPP routine names, function...

Lots more Carbon/Carbon.h includes, new UPP routine names, function prototypes. Most toolbox modules now compile, link and import in MacOSX-MachO python.
parent 11296713
This diff is collapsed.
...@@ -82,8 +82,12 @@ AEMethod = OSErrMethodGenerator ...@@ -82,8 +82,12 @@ AEMethod = OSErrMethodGenerator
includestuff = includestuff + """ includestuff = includestuff + """
#ifdef WITHOUT_FRAMEWORKS
#include <AppleEvents.h> #include <AppleEvents.h>
#include <AEObjects.h> #include <AEObjects.h>
#else
#include <Carbon/Carbon.h>
#endif
#ifdef USE_TOOLBOX_OBJECT_GLUE #ifdef USE_TOOLBOX_OBJECT_GLUE
extern PyObject *_AEDesc_New(AEDesc *); extern PyObject *_AEDesc_New(AEDesc *);
...@@ -144,10 +148,10 @@ GenericEventHandler(const AppleEvent *request, AppleEvent *reply, unsigned long ...@@ -144,10 +148,10 @@ GenericEventHandler(const AppleEvent *request, AppleEvent *reply, unsigned long
""" """
initstuff = initstuff + """ initstuff = initstuff + """
upp_AEIdleProc = NewAEIdleProc(AEIdleProc); upp_AEIdleProc = NewAEIdleUPP(AEIdleProc);
upp_GenericEventHandler = NewAEEventHandlerProc(GenericEventHandler); upp_GenericEventHandler = NewAEEventHandlerUPP(GenericEventHandler);
PyMac_INIT_TOOLBOX_OBJECT_NEW(AEDesc_New); PyMac_INIT_TOOLBOX_OBJECT_NEW(AEDesc *, AEDesc_New);
PyMac_INIT_TOOLBOX_OBJECT_CONVERT(AEDesc_Convert); PyMac_INIT_TOOLBOX_OBJECT_CONVERT(AEDesc, AEDesc_Convert);
""" """
module = MacModule('AE', 'AE', includestuff, finalstuff, initstuff) module = MacModule('AE', 'AE', includestuff, finalstuff, initstuff)
......
This diff is collapsed.
...@@ -69,7 +69,12 @@ ThemeMetric = Type("ThemeMetric", "l") ...@@ -69,7 +69,12 @@ ThemeMetric = Type("ThemeMetric", "l")
RGBColor = OpaqueType("RGBColor", "QdRGB") RGBColor = OpaqueType("RGBColor", "QdRGB")
includestuff = includestuff + """ includestuff = includestuff + """
#include <%s>""" % MACHEADERFILE + """ #ifdef WITHOUT_FRAMEWORKS
#include <Appearance.h>
#else
#include <Carbon/Carbon.h>
#endif
""" """
## class MyObjectDefinition(GlobalObjectDefinition): ## class MyObjectDefinition(GlobalObjectDefinition):
......
This diff is collapsed.
...@@ -21,7 +21,12 @@ from macsupport import * ...@@ -21,7 +21,12 @@ from macsupport import *
# Create the type objects # Create the type objects
includestuff = includestuff + """ includestuff = includestuff + """
#include <%s>""" % MACHEADERFILE + """ #ifdef WITHOUT_FRAMEWORKS
#include <Components.h>
#else
#include <Carbon/Carbon.h>
#endif
#ifdef USE_TOOLBOX_OBJECT_GLUE #ifdef USE_TOOLBOX_OBJECT_GLUE
extern PyObject *_CmpObj_New(Component); extern PyObject *_CmpObj_New(Component);
extern int _CmpObj_Convert(PyObject *, Component *); extern int _CmpObj_Convert(PyObject *, Component *);
...@@ -38,8 +43,7 @@ extern int _CmpInstObj_Convert(PyObject *, ComponentInstance *); ...@@ -38,8 +43,7 @@ extern int _CmpInstObj_Convert(PyObject *, ComponentInstance *);
** Parse/generate ComponentDescriptor records ** Parse/generate ComponentDescriptor records
*/ */
static PyObject * static PyObject *
CmpDesc_New(itself) CmpDesc_New(ComponentDescription *itself)
ComponentDescription *itself;
{ {
return Py_BuildValue("O&O&O&ll", return Py_BuildValue("O&O&O&ll",
...@@ -50,9 +54,7 @@ CmpDesc_New(itself) ...@@ -50,9 +54,7 @@ CmpDesc_New(itself)
} }
static int static int
CmpDesc_Convert(v, p_itself) CmpDesc_Convert(PyObject *v, ComponentDescription *p_itself)
PyObject *v;
ComponentDescription *p_itself;
{ {
return PyArg_ParseTuple(v, "O&O&O&ll", return PyArg_ParseTuple(v, "O&O&O&ll",
PyMac_GetOSType, &p_itself->componentType, PyMac_GetOSType, &p_itself->componentType,
...@@ -64,10 +66,10 @@ CmpDesc_Convert(v, p_itself) ...@@ -64,10 +66,10 @@ CmpDesc_Convert(v, p_itself)
""" """
initstuff = initstuff + """ initstuff = initstuff + """
PyMac_INIT_TOOLBOX_OBJECT_NEW(CmpObj_New); PyMac_INIT_TOOLBOX_OBJECT_NEW(Component, CmpObj_New);
PyMac_INIT_TOOLBOX_OBJECT_CONVERT(CmpObj_Convert); PyMac_INIT_TOOLBOX_OBJECT_CONVERT(Component, CmpObj_Convert);
PyMac_INIT_TOOLBOX_OBJECT_NEW(CmpInstObj_New); PyMac_INIT_TOOLBOX_OBJECT_NEW(ComponentInstance, CmpInstObj_New);
PyMac_INIT_TOOLBOX_OBJECT_CONVERT(CmpInstObj_Convert); PyMac_INIT_TOOLBOX_OBJECT_CONVERT(ComponentInstance, CmpInstObj_Convert);
""" """
ComponentDescription = OpaqueType('ComponentDescription', 'CmpDesc') ComponentDescription = OpaqueType('ComponentDescription', 'CmpDesc')
......
This diff is collapsed.
...@@ -49,9 +49,11 @@ DragTrackingMessage = Type("DragTrackingMessage", "h") ...@@ -49,9 +49,11 @@ DragTrackingMessage = Type("DragTrackingMessage", "h")
DragReference = OpaqueByValueType("DragReference", "DragObj") DragReference = OpaqueByValueType("DragReference", "DragObj")
includestuff = includestuff + """ includestuff = includestuff + """
#include <%s>""" % MACHEADERFILE + """ #ifdef WITHOUT_FRAMEWORKS
#ifndef kControlCheckBoxUncheckedValue #include <Controls.h>
#include <ControlDefinitions.h> #include <ControlDefinitions.h>
#else
#include <Carbon/Carbon.h>
#endif #endif
#ifdef USE_TOOLBOX_OBJECT_GLUE #ifdef USE_TOOLBOX_OBJECT_GLUE
...@@ -77,8 +79,7 @@ staticforward PyObject *CtlObj_WhichControl(ControlHandle); ...@@ -77,8 +79,7 @@ staticforward PyObject *CtlObj_WhichControl(ControlHandle);
*/ */
#if 0 /* Not needed */ #if 0 /* Not needed */
static PyObject * static PyObject *
ControlFontStyle_New(itself) ControlFontStyle_New(ControlFontStyleRec *itself)
ControlFontStyleRec *itself;
{ {
return Py_BuildValue("hhhhhhO&O&", itself->flags, itself->font, return Py_BuildValue("hhhhhhO&O&", itself->flags, itself->font,
...@@ -88,9 +89,7 @@ ControlFontStyle_New(itself) ...@@ -88,9 +89,7 @@ ControlFontStyle_New(itself)
#endif #endif
static int static int
ControlFontStyle_Convert(v, itself) ControlFontStyle_Convert(PyObject *v, ControlFontStyleRec *itself)
PyObject *v;
ControlFontStyleRec *itself;
{ {
return PyArg_ParseTuple(v, "hhhhhhO&O&", &itself->flags, return PyArg_ParseTuple(v, "hhhhhhO&O&", &itself->flags,
&itself->font, &itself->size, &itself->style, &itself->mode, &itself->font, &itself->size, &itself->style, &itself->mode,
...@@ -102,17 +101,14 @@ ControlFontStyle_Convert(v, itself) ...@@ -102,17 +101,14 @@ ControlFontStyle_Convert(v, itself)
** Parse/generate ControlID records ** Parse/generate ControlID records
*/ */
static PyObject * static PyObject *
PyControlID_New(itself) PyControlID_New(ControlID *itself)
ControlID *itself;
{ {
return Py_BuildValue("O&l", PyMac_BuildOSType, itself->signature, itself->id); return Py_BuildValue("O&l", PyMac_BuildOSType, itself->signature, itself->id);
} }
static int static int
PyControlID_Convert(v, itself) PyControlID_Convert(PyObject *v, ControlID *itself)
PyObject *v;
ControlID *itself;
{ {
return PyArg_ParseTuple(v, "O&l", PyMac_GetOSType, &itself->signature, &itself->id); return PyArg_ParseTuple(v, "O&l", PyMac_GetOSType, &itself->signature, &itself->id);
} }
...@@ -133,8 +129,7 @@ staticforward int setcallback(PyObject *, OSType, PyObject *, UniversalProcPtr * ...@@ -133,8 +129,7 @@ staticforward int setcallback(PyObject *, OSType, PyObject *, UniversalProcPtr *
finalstuff = finalstuff + """ finalstuff = finalstuff + """
static PyObject * static PyObject *
CtlObj_NewUnmanaged(itself) CtlObj_NewUnmanaged(ControlHandle itself)
ControlHandle itself;
{ {
ControlObject *it; ControlObject *it;
if (itself == NULL) return PyMac_Error(resNotFound); if (itself == NULL) return PyMac_Error(resNotFound);
...@@ -166,8 +161,7 @@ CtlObj_WhichControl(ControlHandle c) ...@@ -166,8 +161,7 @@ CtlObj_WhichControl(ControlHandle c)
} }
static int static int
settrackfunc(obj) settrackfunc(PyObject *obj)
PyObject *obj;
{ {
if (tracker) { if (tracker) {
PyErr_SetString(Ctl_Error, "Tracker function in use"); PyErr_SetString(Ctl_Error, "Tracker function in use");
...@@ -178,7 +172,7 @@ settrackfunc(obj) ...@@ -178,7 +172,7 @@ settrackfunc(obj)
} }
static void static void
clrtrackfunc() clrtrackfunc(void)
{ {
Py_XDECREF(tracker); Py_XDECREF(tracker);
tracker = 0; tracker = 0;
...@@ -201,11 +195,7 @@ mytracker(ControlHandle ctl, short part) ...@@ -201,11 +195,7 @@ mytracker(ControlHandle ctl, short part)
} }
static int static int
setcallback(myself, which, callback, uppp) setcallback(PyObject *myself, OSType which, PyObject *callback, UniversalProcPtr *uppp)
PyObject *myself;
OSType which;
PyObject *callback;
UniversalProcPtr *uppp;
{ {
ControlObject *self = (ControlObject *)myself; ControlObject *self = (ControlObject *)myself;
char keybuf[9]; char keybuf[9];
...@@ -235,10 +225,7 @@ setcallback(myself, which, callback, uppp) ...@@ -235,10 +225,7 @@ setcallback(myself, which, callback, uppp)
} }
static PyObject * static PyObject *
callcallback(self, which, arglist) callcallback(ControlObject *self, OSType which, PyObject *arglist)
ControlObject *self;
OSType which;
PyObject *arglist;
{ {
char keybuf[9]; char keybuf[9];
PyObject *func, *rv; PyObject *func, *rv;
...@@ -319,13 +306,13 @@ mytrackingproc(ControlHandle control, Point startPt, ControlActionUPP actionProc ...@@ -319,13 +306,13 @@ mytrackingproc(ControlHandle control, Point startPt, ControlActionUPP actionProc
""" """
initstuff = initstuff + """ initstuff = initstuff + """
mytracker_upp = NewControlActionProc(mytracker); mytracker_upp = NewControlActionUPP(mytracker);
mydrawproc_upp = NewControlUserPaneDrawProc(mydrawproc); mydrawproc_upp = NewControlUserPaneDrawUPP(mydrawproc);
myidleproc_upp = NewControlUserPaneIdleProc(myidleproc); myidleproc_upp = NewControlUserPaneIdleUPP(myidleproc);
myhittestproc_upp = NewControlUserPaneHitTestProc(myhittestproc); myhittestproc_upp = NewControlUserPaneHitTestUPP(myhittestproc);
mytrackingproc_upp = NewControlUserPaneTrackingProc(mytrackingproc); mytrackingproc_upp = NewControlUserPaneTrackingUPP(mytrackingproc);
PyMac_INIT_TOOLBOX_OBJECT_NEW(CtlObj_New); PyMac_INIT_TOOLBOX_OBJECT_NEW(ControlHandle, CtlObj_New);
PyMac_INIT_TOOLBOX_OBJECT_CONVERT(CtlObj_Convert); PyMac_INIT_TOOLBOX_OBJECT_CONVERT(ControlHandle, CtlObj_Convert);
""" """
class MyObjectDefinition(ObjectIdentityMixin, GlobalObjectDefinition): class MyObjectDefinition(ObjectIdentityMixin, GlobalObjectDefinition):
......
This diff is collapsed.
...@@ -31,7 +31,12 @@ StringPtr = Str255 ...@@ -31,7 +31,12 @@ StringPtr = Str255
EventMask = Type("EventMask", "H") EventMask = Type("EventMask", "H")
includestuff = includestuff + """ includestuff = includestuff + """
#ifdef WITHOUT_FRAMEWORKS
#include <Dialogs.h> #include <Dialogs.h>
#else
#include <Carbon/Carbon.h>
#endif
#ifdef USE_TOOLBOX_OBJECT_GLUE #ifdef USE_TOOLBOX_OBJECT_GLUE
extern PyObject *_DlgObj_New(DialogRef); extern PyObject *_DlgObj_New(DialogRef);
extern PyObject *_DlgObj_WhichDialog(DialogRef); extern PyObject *_DlgObj_WhichDialog(DialogRef);
...@@ -150,8 +155,7 @@ finalstuff = finalstuff + """ ...@@ -150,8 +155,7 @@ finalstuff = finalstuff + """
/* Return the WindowPtr corresponding to a DialogObject */ /* Return the WindowPtr corresponding to a DialogObject */
#if 0 #if 0
WindowPtr WindowPtr
DlgObj_ConvertToWindow(self) DlgObj_ConvertToWindow(PyObject *self)
PyObject *self;
{ {
if ( DlgObj_Check(self) ) if ( DlgObj_Check(self) )
return GetDialogWindow(((DialogObject *)self)->ob_itself); return GetDialogWindow(((DialogObject *)self)->ob_itself);
...@@ -161,8 +165,7 @@ DlgObj_ConvertToWindow(self) ...@@ -161,8 +165,7 @@ DlgObj_ConvertToWindow(self)
/* Return the object corresponding to the dialog, or None */ /* Return the object corresponding to the dialog, or None */
PyObject * PyObject *
DlgObj_WhichDialog(d) DlgObj_WhichDialog(DialogPtr d)
DialogPtr d;
{ {
PyObject *it; PyObject *it;
...@@ -191,9 +194,9 @@ DlgObj_WhichDialog(d) ...@@ -191,9 +194,9 @@ DlgObj_WhichDialog(d)
""" """
initstuff = initstuff + """ initstuff = initstuff + """
PyMac_INIT_TOOLBOX_OBJECT_NEW(DlgObj_New); PyMac_INIT_TOOLBOX_OBJECT_NEW(DialogPtr, DlgObj_New);
PyMac_INIT_TOOLBOX_OBJECT_NEW(DlgObj_WhichDialog); PyMac_INIT_TOOLBOX_OBJECT_NEW(DialogPtr, DlgObj_WhichDialog);
PyMac_INIT_TOOLBOX_OBJECT_CONVERT(DlgObj_Convert); PyMac_INIT_TOOLBOX_OBJECT_CONVERT(DialogPtr, DlgObj_Convert);
""" """
...@@ -219,10 +222,7 @@ class MyObjectDefinition(GlobalObjectDefinition): ...@@ -219,10 +222,7 @@ class MyObjectDefinition(GlobalObjectDefinition):
def outputCompare(self): def outputCompare(self):
Output() Output()
Output("static int %s_compare(self, other)", self.prefix) Output("static int %s_compare(%s *self, %s *other)", self.prefix, self.objecttype, self.objecttype)
IndentLevel()
Output("%s *self, *other;", self.objecttype)
DedentLevel()
OutLbrace() OutLbrace()
Output("if ( self->ob_itself > other->ob_itself ) return 1;") Output("if ( self->ob_itself > other->ob_itself ) return 1;")
Output("if ( self->ob_itself < other->ob_itself ) return -1;") Output("if ( self->ob_itself < other->ob_itself ) return -1;")
...@@ -231,10 +231,7 @@ class MyObjectDefinition(GlobalObjectDefinition): ...@@ -231,10 +231,7 @@ class MyObjectDefinition(GlobalObjectDefinition):
def outputHash(self): def outputHash(self):
Output() Output()
Output("static int %s_hash(self)", self.prefix) Output("static int %s_hash(%s *self)", self.prefix, self.objecttype)
IndentLevel()
Output("%s *self;", self.objecttype)
DedentLevel()
OutLbrace() OutLbrace()
Output("return (int)self->ob_itself;") Output("return (int)self->ob_itself;")
OutRbrace() OutRbrace()
...@@ -293,7 +290,7 @@ setuseritembody = """ ...@@ -293,7 +290,7 @@ setuseritembody = """
Py_INCREF(Py_None); Py_INCREF(Py_None);
} else { } else {
Py_INCREF(new); Py_INCREF(new);
_res = Py_BuildValue("O&", ResObj_New, (Handle)NewUserItemProc(Dlg_UnivUserItemProc)); _res = Py_BuildValue("O&", ResObj_New, (Handle)NewUserItemUPP(Dlg_UnivUserItemProc));
} }
Dlg_UserItemProc_callback = new; Dlg_UserItemProc_callback = new;
......
This diff is collapsed.
...@@ -44,7 +44,11 @@ FlavorFlags = Type("FlavorFlags", "l") ...@@ -44,7 +44,11 @@ FlavorFlags = Type("FlavorFlags", "l")
DragTrackingMessage = Type("DragTrackingMessage", "h") DragTrackingMessage = Type("DragTrackingMessage", "h")
includestuff = includestuff + """ includestuff = includestuff + """
#include <%s>""" % MACHEADERFILE + """ #ifdef WITHOUT_FRAMEWORKS
#include <Drag.h>
#else
#include <Carbon/Carbon.h>
#endif
/* Callback glue routines */ /* Callback glue routines */
DragTrackingHandlerUPP dragglue_TrackingHandlerUPP; DragTrackingHandlerUPP dragglue_TrackingHandlerUPP;
...@@ -162,17 +166,17 @@ dragglue_Drawing(xxxx ...@@ -162,17 +166,17 @@ dragglue_Drawing(xxxx
""" """
initstuff = initstuff + """ initstuff = initstuff + """
PyMac_INIT_TOOLBOX_OBJECT_NEW(DragObj_New); PyMac_INIT_TOOLBOX_OBJECT_NEW(DragRef, DragObj_New);
PyMac_INIT_TOOLBOX_OBJECT_CONVERT(DragObj_Convert); PyMac_INIT_TOOLBOX_OBJECT_CONVERT(DragRef, DragObj_Convert);
""" """
variablestuff = """ variablestuff = """
dragglue_TrackingHandlerUPP = NewDragTrackingHandlerProc(dragglue_TrackingHandler); dragglue_TrackingHandlerUPP = NewDragTrackingHandlerUPP(dragglue_TrackingHandler);
dragglue_ReceiveHandlerUPP = NewDragReceiveHandlerProc(dragglue_ReceiveHandler); dragglue_ReceiveHandlerUPP = NewDragReceiveHandlerUPP(dragglue_ReceiveHandler);
dragglue_SendDataUPP = NewDragSendDataProc(dragglue_SendData); dragglue_SendDataUPP = NewDragSendDataUPP(dragglue_SendData);
#if 0 #if 0
dragglue_InputUPP = NewDragInputProc(dragglue_Input); dragglue_InputUPP = NewDragInputUPP(dragglue_Input);
dragglue_DrawingUPP = NewDragDrawingProc(dragglue_Drawing); dragglue_DrawingUPP = NewDragDrawingUPP(dragglue_Drawing);
#endif #endif
""" """
......
...@@ -8,13 +8,16 @@ ...@@ -8,13 +8,16 @@
#include "macglue.h" #include "macglue.h"
#include "pymactoolbox.h" #include "pymactoolbox.h"
#ifdef WITHOUT_FRAMEWORKS
#include <Events.h> #include <Events.h>
#else
#include <Carbon/Carbon.h>
#endif
static PyObject *Evt_Error; static PyObject *Evt_Error;
static PyObject *Evt_GetMouse(_self, _args) static PyObject *Evt_GetMouse(PyObject *_self, PyObject *_args)
PyObject *_self;
PyObject *_args;
{ {
PyObject *_res = NULL; PyObject *_res = NULL;
Point mouseLoc; Point mouseLoc;
...@@ -26,9 +29,7 @@ static PyObject *Evt_GetMouse(_self, _args) ...@@ -26,9 +29,7 @@ static PyObject *Evt_GetMouse(_self, _args)
return _res; return _res;
} }
static PyObject *Evt_Button(_self, _args) static PyObject *Evt_Button(PyObject *_self, PyObject *_args)
PyObject *_self;
PyObject *_args;
{ {
PyObject *_res = NULL; PyObject *_res = NULL;
Boolean _rv; Boolean _rv;
...@@ -40,9 +41,7 @@ static PyObject *Evt_Button(_self, _args) ...@@ -40,9 +41,7 @@ static PyObject *Evt_Button(_self, _args)
return _res; return _res;
} }
static PyObject *Evt_StillDown(_self, _args) static PyObject *Evt_StillDown(PyObject *_self, PyObject *_args)
PyObject *_self;
PyObject *_args;
{ {
PyObject *_res = NULL; PyObject *_res = NULL;
Boolean _rv; Boolean _rv;
...@@ -54,9 +53,7 @@ static PyObject *Evt_StillDown(_self, _args) ...@@ -54,9 +53,7 @@ static PyObject *Evt_StillDown(_self, _args)
return _res; return _res;
} }
static PyObject *Evt_WaitMouseUp(_self, _args) static PyObject *Evt_WaitMouseUp(PyObject *_self, PyObject *_args)
PyObject *_self;
PyObject *_args;
{ {
PyObject *_res = NULL; PyObject *_res = NULL;
Boolean _rv; Boolean _rv;
...@@ -68,9 +65,7 @@ static PyObject *Evt_WaitMouseUp(_self, _args) ...@@ -68,9 +65,7 @@ static PyObject *Evt_WaitMouseUp(_self, _args)
return _res; return _res;
} }
static PyObject *Evt_TickCount(_self, _args) static PyObject *Evt_TickCount(PyObject *_self, PyObject *_args)
PyObject *_self;
PyObject *_args;
{ {
PyObject *_res = NULL; PyObject *_res = NULL;
UInt32 _rv; UInt32 _rv;
...@@ -82,9 +77,7 @@ static PyObject *Evt_TickCount(_self, _args) ...@@ -82,9 +77,7 @@ static PyObject *Evt_TickCount(_self, _args)
return _res; return _res;
} }
static PyObject *Evt_GetCaretTime(_self, _args) static PyObject *Evt_GetCaretTime(PyObject *_self, PyObject *_args)
PyObject *_self;
PyObject *_args;
{ {
PyObject *_res = NULL; PyObject *_res = NULL;
UInt32 _rv; UInt32 _rv;
...@@ -96,9 +89,7 @@ static PyObject *Evt_GetCaretTime(_self, _args) ...@@ -96,9 +89,7 @@ static PyObject *Evt_GetCaretTime(_self, _args)
return _res; return _res;
} }
static PyObject *Evt_GetKeys(_self, _args) static PyObject *Evt_GetKeys(PyObject *_self, PyObject *_args)
PyObject *_self;
PyObject *_args;
{ {
PyObject *_res = NULL; PyObject *_res = NULL;
KeyMap theKeys__out__; KeyMap theKeys__out__;
...@@ -111,9 +102,7 @@ static PyObject *Evt_GetKeys(_self, _args) ...@@ -111,9 +102,7 @@ static PyObject *Evt_GetKeys(_self, _args)
return _res; return _res;
} }
static PyObject *Evt_GetDblTime(_self, _args) static PyObject *Evt_GetDblTime(PyObject *_self, PyObject *_args)
PyObject *_self;
PyObject *_args;
{ {
PyObject *_res = NULL; PyObject *_res = NULL;
UInt32 _rv; UInt32 _rv;
...@@ -125,9 +114,7 @@ static PyObject *Evt_GetDblTime(_self, _args) ...@@ -125,9 +114,7 @@ static PyObject *Evt_GetDblTime(_self, _args)
return _res; return _res;
} }
static PyObject *Evt_SetEventMask(_self, _args) static PyObject *Evt_SetEventMask(PyObject *_self, PyObject *_args)
PyObject *_self;
PyObject *_args;
{ {
PyObject *_res = NULL; PyObject *_res = NULL;
EventMask value; EventMask value;
...@@ -140,9 +127,7 @@ static PyObject *Evt_SetEventMask(_self, _args) ...@@ -140,9 +127,7 @@ static PyObject *Evt_SetEventMask(_self, _args)
return _res; return _res;
} }
static PyObject *Evt_GetNextEvent(_self, _args) static PyObject *Evt_GetNextEvent(PyObject *_self, PyObject *_args)
PyObject *_self;
PyObject *_args;
{ {
PyObject *_res = NULL; PyObject *_res = NULL;
Boolean _rv; Boolean _rv;
...@@ -159,9 +144,7 @@ static PyObject *Evt_GetNextEvent(_self, _args) ...@@ -159,9 +144,7 @@ static PyObject *Evt_GetNextEvent(_self, _args)
return _res; return _res;
} }
static PyObject *Evt_EventAvail(_self, _args) static PyObject *Evt_EventAvail(PyObject *_self, PyObject *_args)
PyObject *_self;
PyObject *_args;
{ {
PyObject *_res = NULL; PyObject *_res = NULL;
Boolean _rv; Boolean _rv;
...@@ -178,9 +161,7 @@ static PyObject *Evt_EventAvail(_self, _args) ...@@ -178,9 +161,7 @@ static PyObject *Evt_EventAvail(_self, _args)
return _res; return _res;
} }
static PyObject *Evt_PostEvent(_self, _args) static PyObject *Evt_PostEvent(PyObject *_self, PyObject *_args)
PyObject *_self;
PyObject *_args;
{ {
PyObject *_res = NULL; PyObject *_res = NULL;
OSErr _err; OSErr _err;
...@@ -200,9 +181,7 @@ static PyObject *Evt_PostEvent(_self, _args) ...@@ -200,9 +181,7 @@ static PyObject *Evt_PostEvent(_self, _args)
#if !TARGET_API_MAC_CARBON #if !TARGET_API_MAC_CARBON
static PyObject *Evt_OSEventAvail(_self, _args) static PyObject *Evt_OSEventAvail(PyObject *_self, PyObject *_args)
PyObject *_self;
PyObject *_args;
{ {
PyObject *_res = NULL; PyObject *_res = NULL;
Boolean _rv; Boolean _rv;
...@@ -222,9 +201,7 @@ static PyObject *Evt_OSEventAvail(_self, _args) ...@@ -222,9 +201,7 @@ static PyObject *Evt_OSEventAvail(_self, _args)
#if !TARGET_API_MAC_CARBON #if !TARGET_API_MAC_CARBON
static PyObject *Evt_GetOSEvent(_self, _args) static PyObject *Evt_GetOSEvent(PyObject *_self, PyObject *_args)
PyObject *_self;
PyObject *_args;
{ {
PyObject *_res = NULL; PyObject *_res = NULL;
Boolean _rv; Boolean _rv;
...@@ -242,9 +219,7 @@ static PyObject *Evt_GetOSEvent(_self, _args) ...@@ -242,9 +219,7 @@ static PyObject *Evt_GetOSEvent(_self, _args)
} }
#endif #endif
static PyObject *Evt_FlushEvents(_self, _args) static PyObject *Evt_FlushEvents(PyObject *_self, PyObject *_args)
PyObject *_self;
PyObject *_args;
{ {
PyObject *_res = NULL; PyObject *_res = NULL;
EventMask whichMask; EventMask whichMask;
...@@ -262,9 +237,7 @@ static PyObject *Evt_FlushEvents(_self, _args) ...@@ -262,9 +237,7 @@ static PyObject *Evt_FlushEvents(_self, _args)
#if !TARGET_API_MAC_CARBON #if !TARGET_API_MAC_CARBON
static PyObject *Evt_SystemClick(_self, _args) static PyObject *Evt_SystemClick(PyObject *_self, PyObject *_args)
PyObject *_self;
PyObject *_args;
{ {
PyObject *_res = NULL; PyObject *_res = NULL;
EventRecord theEvent; EventRecord theEvent;
...@@ -283,9 +256,7 @@ static PyObject *Evt_SystemClick(_self, _args) ...@@ -283,9 +256,7 @@ static PyObject *Evt_SystemClick(_self, _args)
#if !TARGET_API_MAC_CARBON #if !TARGET_API_MAC_CARBON
static PyObject *Evt_SystemTask(_self, _args) static PyObject *Evt_SystemTask(PyObject *_self, PyObject *_args)
PyObject *_self;
PyObject *_args;
{ {
PyObject *_res = NULL; PyObject *_res = NULL;
if (!PyArg_ParseTuple(_args, "")) if (!PyArg_ParseTuple(_args, ""))
...@@ -299,9 +270,7 @@ static PyObject *Evt_SystemTask(_self, _args) ...@@ -299,9 +270,7 @@ static PyObject *Evt_SystemTask(_self, _args)
#if !TARGET_API_MAC_CARBON #if !TARGET_API_MAC_CARBON
static PyObject *Evt_SystemEvent(_self, _args) static PyObject *Evt_SystemEvent(PyObject *_self, PyObject *_args)
PyObject *_self;
PyObject *_args;
{ {
PyObject *_res = NULL; PyObject *_res = NULL;
Boolean _rv; Boolean _rv;
...@@ -318,9 +287,7 @@ static PyObject *Evt_SystemEvent(_self, _args) ...@@ -318,9 +287,7 @@ static PyObject *Evt_SystemEvent(_self, _args)
#if TARGET_API_MAC_CARBON #if TARGET_API_MAC_CARBON
static PyObject *Evt_GetGlobalMouse(_self, _args) static PyObject *Evt_GetGlobalMouse(PyObject *_self, PyObject *_args)
PyObject *_self;
PyObject *_args;
{ {
PyObject *_res = NULL; PyObject *_res = NULL;
Point globalMouse; Point globalMouse;
...@@ -335,9 +302,7 @@ static PyObject *Evt_GetGlobalMouse(_self, _args) ...@@ -335,9 +302,7 @@ static PyObject *Evt_GetGlobalMouse(_self, _args)
#if TARGET_API_MAC_CARBON #if TARGET_API_MAC_CARBON
static PyObject *Evt_GetCurrentKeyModifiers(_self, _args) static PyObject *Evt_GetCurrentKeyModifiers(PyObject *_self, PyObject *_args)
PyObject *_self;
PyObject *_args;
{ {
PyObject *_res = NULL; PyObject *_res = NULL;
UInt32 _rv; UInt32 _rv;
...@@ -352,9 +317,7 @@ static PyObject *Evt_GetCurrentKeyModifiers(_self, _args) ...@@ -352,9 +317,7 @@ static PyObject *Evt_GetCurrentKeyModifiers(_self, _args)
#if TARGET_API_MAC_CARBON #if TARGET_API_MAC_CARBON
static PyObject *Evt_CheckEventQueueForUserCancel(_self, _args) static PyObject *Evt_CheckEventQueueForUserCancel(PyObject *_self, PyObject *_args)
PyObject *_self;
PyObject *_args;
{ {
PyObject *_res = NULL; PyObject *_res = NULL;
Boolean _rv; Boolean _rv;
...@@ -367,9 +330,7 @@ static PyObject *Evt_CheckEventQueueForUserCancel(_self, _args) ...@@ -367,9 +330,7 @@ static PyObject *Evt_CheckEventQueueForUserCancel(_self, _args)
} }
#endif #endif
static PyObject *Evt_WaitNextEvent(_self, _args) static PyObject *Evt_WaitNextEvent(PyObject *_self, PyObject *_args)
PyObject *_self;
PyObject *_args;
{ {
PyObject *_res = NULL; PyObject *_res = NULL;
...@@ -470,7 +431,7 @@ static PyMethodDef Evt_methods[] = { ...@@ -470,7 +431,7 @@ static PyMethodDef Evt_methods[] = {
void initEvt() void initEvt(void)
{ {
PyObject *m; PyObject *m;
PyObject *d; PyObject *d;
......
...@@ -35,7 +35,12 @@ EventMask = Type("EventMask", "H") ...@@ -35,7 +35,12 @@ EventMask = Type("EventMask", "H")
EventKind = Type("EventKind", "H") EventKind = Type("EventKind", "H")
includestuff = includestuff + """ includestuff = includestuff + """
#include <%s>""" % MACHEADERFILE + """ #ifdef WITHOUT_FRAMEWORKS
#include <Events.h>
#else
#include <Carbon/Carbon.h>
#endif
""" """
class MyObjectDefinition(GlobalObjectDefinition): class MyObjectDefinition(GlobalObjectDefinition):
......
...@@ -8,14 +8,18 @@ ...@@ -8,14 +8,18 @@
#include "macglue.h" #include "macglue.h"
#include "pymactoolbox.h" #include "pymactoolbox.h"
#ifdef WITHOUT_FRAMEWORKS
#include <Fonts.h> #include <Fonts.h>
#else
#include <Carbon/Carbon.h>
#endif
/* /*
** Parse/generate ComponentDescriptor records ** Parse/generate ComponentDescriptor records
*/ */
static PyObject * static PyObject *
FMRec_New(itself) FMRec_New(FMetricRec *itself)
FMetricRec *itself;
{ {
return Py_BuildValue("O&O&O&O&O&", return Py_BuildValue("O&O&O&O&O&",
...@@ -29,9 +33,7 @@ FMRec_New(itself) ...@@ -29,9 +33,7 @@ FMRec_New(itself)
#if 0 #if 0
/* Not needed... */ /* Not needed... */
static int static int
FMRec_Convert(v, p_itself) FMRec_Convert(PyObject *v, FMetricRec *p_itself)
PyObject *v;
FMetricRec *p_itself;
{ {
return PyArg_ParseTuple(v, "O&O&O&O&O&", return PyArg_ParseTuple(v, "O&O&O&O&O&",
PyMac_GetFixed, &itself->ascent, PyMac_GetFixed, &itself->ascent,
...@@ -47,9 +49,7 @@ static PyObject *Fm_Error; ...@@ -47,9 +49,7 @@ static PyObject *Fm_Error;
#if !TARGET_API_MAC_CARBON #if !TARGET_API_MAC_CARBON
static PyObject *Fm_InitFonts(_self, _args) static PyObject *Fm_InitFonts(PyObject *_self, PyObject *_args)
PyObject *_self;
PyObject *_args;
{ {
PyObject *_res = NULL; PyObject *_res = NULL;
if (!PyArg_ParseTuple(_args, "")) if (!PyArg_ParseTuple(_args, ""))
...@@ -61,9 +61,7 @@ static PyObject *Fm_InitFonts(_self, _args) ...@@ -61,9 +61,7 @@ static PyObject *Fm_InitFonts(_self, _args)
} }
#endif #endif
static PyObject *Fm_GetFontName(_self, _args) static PyObject *Fm_GetFontName(PyObject *_self, PyObject *_args)
PyObject *_self;
PyObject *_args;
{ {
PyObject *_res = NULL; PyObject *_res = NULL;
short familyID; short familyID;
...@@ -78,9 +76,7 @@ static PyObject *Fm_GetFontName(_self, _args) ...@@ -78,9 +76,7 @@ static PyObject *Fm_GetFontName(_self, _args)
return _res; return _res;
} }
static PyObject *Fm_GetFNum(_self, _args) static PyObject *Fm_GetFNum(PyObject *_self, PyObject *_args)
PyObject *_self;
PyObject *_args;
{ {
PyObject *_res = NULL; PyObject *_res = NULL;
Str255 name; Str255 name;
...@@ -95,9 +91,7 @@ static PyObject *Fm_GetFNum(_self, _args) ...@@ -95,9 +91,7 @@ static PyObject *Fm_GetFNum(_self, _args)
return _res; return _res;
} }
static PyObject *Fm_RealFont(_self, _args) static PyObject *Fm_RealFont(PyObject *_self, PyObject *_args)
PyObject *_self;
PyObject *_args;
{ {
PyObject *_res = NULL; PyObject *_res = NULL;
Boolean _rv; Boolean _rv;
...@@ -116,9 +110,7 @@ static PyObject *Fm_RealFont(_self, _args) ...@@ -116,9 +110,7 @@ static PyObject *Fm_RealFont(_self, _args)
#if !TARGET_API_MAC_CARBON #if !TARGET_API_MAC_CARBON
static PyObject *Fm_SetFontLock(_self, _args) static PyObject *Fm_SetFontLock(PyObject *_self, PyObject *_args)
PyObject *_self;
PyObject *_args;
{ {
PyObject *_res = NULL; PyObject *_res = NULL;
Boolean lockFlag; Boolean lockFlag;
...@@ -132,9 +124,7 @@ static PyObject *Fm_SetFontLock(_self, _args) ...@@ -132,9 +124,7 @@ static PyObject *Fm_SetFontLock(_self, _args)
} }
#endif #endif
static PyObject *Fm_SetFScaleDisable(_self, _args) static PyObject *Fm_SetFScaleDisable(PyObject *_self, PyObject *_args)
PyObject *_self;
PyObject *_args;
{ {
PyObject *_res = NULL; PyObject *_res = NULL;
Boolean fscaleDisable; Boolean fscaleDisable;
...@@ -147,9 +137,7 @@ static PyObject *Fm_SetFScaleDisable(_self, _args) ...@@ -147,9 +137,7 @@ static PyObject *Fm_SetFScaleDisable(_self, _args)
return _res; return _res;
} }
static PyObject *Fm_FontMetrics(_self, _args) static PyObject *Fm_FontMetrics(PyObject *_self, PyObject *_args)
PyObject *_self;
PyObject *_args;
{ {
PyObject *_res = NULL; PyObject *_res = NULL;
FMetricRec theMetrics; FMetricRec theMetrics;
...@@ -161,9 +149,7 @@ static PyObject *Fm_FontMetrics(_self, _args) ...@@ -161,9 +149,7 @@ static PyObject *Fm_FontMetrics(_self, _args)
return _res; return _res;
} }
static PyObject *Fm_SetFractEnable(_self, _args) static PyObject *Fm_SetFractEnable(PyObject *_self, PyObject *_args)
PyObject *_self;
PyObject *_args;
{ {
PyObject *_res = NULL; PyObject *_res = NULL;
Boolean fractEnable; Boolean fractEnable;
...@@ -176,9 +162,7 @@ static PyObject *Fm_SetFractEnable(_self, _args) ...@@ -176,9 +162,7 @@ static PyObject *Fm_SetFractEnable(_self, _args)
return _res; return _res;
} }
static PyObject *Fm_GetDefFontSize(_self, _args) static PyObject *Fm_GetDefFontSize(PyObject *_self, PyObject *_args)
PyObject *_self;
PyObject *_args;
{ {
PyObject *_res = NULL; PyObject *_res = NULL;
short _rv; short _rv;
...@@ -190,9 +174,7 @@ static PyObject *Fm_GetDefFontSize(_self, _args) ...@@ -190,9 +174,7 @@ static PyObject *Fm_GetDefFontSize(_self, _args)
return _res; return _res;
} }
static PyObject *Fm_IsOutline(_self, _args) static PyObject *Fm_IsOutline(PyObject *_self, PyObject *_args)
PyObject *_self;
PyObject *_args;
{ {
PyObject *_res = NULL; PyObject *_res = NULL;
Boolean _rv; Boolean _rv;
...@@ -209,9 +191,7 @@ static PyObject *Fm_IsOutline(_self, _args) ...@@ -209,9 +191,7 @@ static PyObject *Fm_IsOutline(_self, _args)
return _res; return _res;
} }
static PyObject *Fm_SetOutlinePreferred(_self, _args) static PyObject *Fm_SetOutlinePreferred(PyObject *_self, PyObject *_args)
PyObject *_self;
PyObject *_args;
{ {
PyObject *_res = NULL; PyObject *_res = NULL;
Boolean outlinePreferred; Boolean outlinePreferred;
...@@ -224,9 +204,7 @@ static PyObject *Fm_SetOutlinePreferred(_self, _args) ...@@ -224,9 +204,7 @@ static PyObject *Fm_SetOutlinePreferred(_self, _args)
return _res; return _res;
} }
static PyObject *Fm_GetOutlinePreferred(_self, _args) static PyObject *Fm_GetOutlinePreferred(PyObject *_self, PyObject *_args)
PyObject *_self;
PyObject *_args;
{ {
PyObject *_res = NULL; PyObject *_res = NULL;
Boolean _rv; Boolean _rv;
...@@ -238,9 +216,7 @@ static PyObject *Fm_GetOutlinePreferred(_self, _args) ...@@ -238,9 +216,7 @@ static PyObject *Fm_GetOutlinePreferred(_self, _args)
return _res; return _res;
} }
static PyObject *Fm_SetPreserveGlyph(_self, _args) static PyObject *Fm_SetPreserveGlyph(PyObject *_self, PyObject *_args)
PyObject *_self;
PyObject *_args;
{ {
PyObject *_res = NULL; PyObject *_res = NULL;
Boolean preserveGlyph; Boolean preserveGlyph;
...@@ -253,9 +229,7 @@ static PyObject *Fm_SetPreserveGlyph(_self, _args) ...@@ -253,9 +229,7 @@ static PyObject *Fm_SetPreserveGlyph(_self, _args)
return _res; return _res;
} }
static PyObject *Fm_GetPreserveGlyph(_self, _args) static PyObject *Fm_GetPreserveGlyph(PyObject *_self, PyObject *_args)
PyObject *_self;
PyObject *_args;
{ {
PyObject *_res = NULL; PyObject *_res = NULL;
Boolean _rv; Boolean _rv;
...@@ -269,9 +243,7 @@ static PyObject *Fm_GetPreserveGlyph(_self, _args) ...@@ -269,9 +243,7 @@ static PyObject *Fm_GetPreserveGlyph(_self, _args)
#if !TARGET_API_MAC_CARBON #if !TARGET_API_MAC_CARBON
static PyObject *Fm_FlushFonts(_self, _args) static PyObject *Fm_FlushFonts(PyObject *_self, PyObject *_args)
PyObject *_self;
PyObject *_args;
{ {
PyObject *_res = NULL; PyObject *_res = NULL;
OSErr _err; OSErr _err;
...@@ -285,9 +257,7 @@ static PyObject *Fm_FlushFonts(_self, _args) ...@@ -285,9 +257,7 @@ static PyObject *Fm_FlushFonts(_self, _args)
} }
#endif #endif
static PyObject *Fm_GetSysFont(_self, _args) static PyObject *Fm_GetSysFont(PyObject *_self, PyObject *_args)
PyObject *_self;
PyObject *_args;
{ {
PyObject *_res = NULL; PyObject *_res = NULL;
short _rv; short _rv;
...@@ -299,9 +269,7 @@ static PyObject *Fm_GetSysFont(_self, _args) ...@@ -299,9 +269,7 @@ static PyObject *Fm_GetSysFont(_self, _args)
return _res; return _res;
} }
static PyObject *Fm_GetAppFont(_self, _args) static PyObject *Fm_GetAppFont(PyObject *_self, PyObject *_args)
PyObject *_self;
PyObject *_args;
{ {
PyObject *_res = NULL; PyObject *_res = NULL;
short _rv; short _rv;
...@@ -313,9 +281,7 @@ static PyObject *Fm_GetAppFont(_self, _args) ...@@ -313,9 +281,7 @@ static PyObject *Fm_GetAppFont(_self, _args)
return _res; return _res;
} }
static PyObject *Fm_SetAntiAliasedTextEnabled(_self, _args) static PyObject *Fm_SetAntiAliasedTextEnabled(PyObject *_self, PyObject *_args)
PyObject *_self;
PyObject *_args;
{ {
PyObject *_res = NULL; PyObject *_res = NULL;
OSStatus _err; OSStatus _err;
...@@ -333,9 +299,7 @@ static PyObject *Fm_SetAntiAliasedTextEnabled(_self, _args) ...@@ -333,9 +299,7 @@ static PyObject *Fm_SetAntiAliasedTextEnabled(_self, _args)
return _res; return _res;
} }
static PyObject *Fm_IsAntiAliasedTextEnabled(_self, _args) static PyObject *Fm_IsAntiAliasedTextEnabled(PyObject *_self, PyObject *_args)
PyObject *_self;
PyObject *_args;
{ {
PyObject *_res = NULL; PyObject *_res = NULL;
Boolean _rv; Boolean _rv;
...@@ -403,7 +367,7 @@ static PyMethodDef Fm_methods[] = { ...@@ -403,7 +367,7 @@ static PyMethodDef Fm_methods[] = {
void initFm() void initFm(void)
{ {
PyObject *m; PyObject *m;
PyObject *d; PyObject *d;
......
...@@ -19,14 +19,18 @@ from macsupport import * ...@@ -19,14 +19,18 @@ from macsupport import *
# Create the type objects # Create the type objects
includestuff = includestuff + """ includestuff = includestuff + """
#include <%s>""" % MACHEADERFILE + """ #ifdef WITHOUT_FRAMEWORKS
#include <Fonts.h>
#else
#include <Carbon/Carbon.h>
#endif
/* /*
** Parse/generate ComponentDescriptor records ** Parse/generate ComponentDescriptor records
*/ */
static PyObject * static PyObject *
FMRec_New(itself) FMRec_New(FMetricRec *itself)
FMetricRec *itself;
{ {
return Py_BuildValue("O&O&O&O&O&", return Py_BuildValue("O&O&O&O&O&",
...@@ -40,9 +44,7 @@ FMRec_New(itself) ...@@ -40,9 +44,7 @@ FMRec_New(itself)
#if 0 #if 0
/* Not needed... */ /* Not needed... */
static int static int
FMRec_Convert(v, p_itself) FMRec_Convert(PyObject *v, FMetricRec *p_itself)
PyObject *v;
FMetricRec *p_itself;
{ {
return PyArg_ParseTuple(v, "O&O&O&O&O&", return PyArg_ParseTuple(v, "O&O&O&O&O&",
PyMac_GetFixed, &itself->ascent, PyMac_GetFixed, &itself->ascent,
......
...@@ -12,9 +12,7 @@ ...@@ -12,9 +12,7 @@
static PyObject *Help_Error; static PyObject *Help_Error;
static PyObject *Help_HMGetHelpMenuHandle(_self, _args) static PyObject *Help_HMGetHelpMenuHandle(PyObject *_self, PyObject *_args)
PyObject *_self;
PyObject *_args;
{ {
PyObject *_res = NULL; PyObject *_res = NULL;
OSErr _err; OSErr _err;
...@@ -28,9 +26,7 @@ static PyObject *Help_HMGetHelpMenuHandle(_self, _args) ...@@ -28,9 +26,7 @@ static PyObject *Help_HMGetHelpMenuHandle(_self, _args)
return _res; return _res;
} }
static PyObject *Help_HMRemoveBalloon(_self, _args) static PyObject *Help_HMRemoveBalloon(PyObject *_self, PyObject *_args)
PyObject *_self;
PyObject *_args;
{ {
PyObject *_res = NULL; PyObject *_res = NULL;
OSErr _err; OSErr _err;
...@@ -43,9 +39,7 @@ static PyObject *Help_HMRemoveBalloon(_self, _args) ...@@ -43,9 +39,7 @@ static PyObject *Help_HMRemoveBalloon(_self, _args)
return _res; return _res;
} }
static PyObject *Help_HMIsBalloon(_self, _args) static PyObject *Help_HMIsBalloon(PyObject *_self, PyObject *_args)
PyObject *_self;
PyObject *_args;
{ {
PyObject *_res = NULL; PyObject *_res = NULL;
Boolean _rv; Boolean _rv;
...@@ -57,9 +51,7 @@ static PyObject *Help_HMIsBalloon(_self, _args) ...@@ -57,9 +51,7 @@ static PyObject *Help_HMIsBalloon(_self, _args)
return _res; return _res;
} }
static PyObject *Help_HMGetBalloons(_self, _args) static PyObject *Help_HMGetBalloons(PyObject *_self, PyObject *_args)
PyObject *_self;
PyObject *_args;
{ {
PyObject *_res = NULL; PyObject *_res = NULL;
Boolean _rv; Boolean _rv;
...@@ -71,9 +63,7 @@ static PyObject *Help_HMGetBalloons(_self, _args) ...@@ -71,9 +63,7 @@ static PyObject *Help_HMGetBalloons(_self, _args)
return _res; return _res;
} }
static PyObject *Help_HMSetBalloons(_self, _args) static PyObject *Help_HMSetBalloons(PyObject *_self, PyObject *_args)
PyObject *_self;
PyObject *_args;
{ {
PyObject *_res = NULL; PyObject *_res = NULL;
OSErr _err; OSErr _err;
...@@ -88,9 +78,7 @@ static PyObject *Help_HMSetBalloons(_self, _args) ...@@ -88,9 +78,7 @@ static PyObject *Help_HMSetBalloons(_self, _args)
return _res; return _res;
} }
static PyObject *Help_HMSetFont(_self, _args) static PyObject *Help_HMSetFont(PyObject *_self, PyObject *_args)
PyObject *_self;
PyObject *_args;
{ {
PyObject *_res = NULL; PyObject *_res = NULL;
OSErr _err; OSErr _err;
...@@ -105,9 +93,7 @@ static PyObject *Help_HMSetFont(_self, _args) ...@@ -105,9 +93,7 @@ static PyObject *Help_HMSetFont(_self, _args)
return _res; return _res;
} }
static PyObject *Help_HMSetFontSize(_self, _args) static PyObject *Help_HMSetFontSize(PyObject *_self, PyObject *_args)
PyObject *_self;
PyObject *_args;
{ {
PyObject *_res = NULL; PyObject *_res = NULL;
OSErr _err; OSErr _err;
...@@ -122,9 +108,7 @@ static PyObject *Help_HMSetFontSize(_self, _args) ...@@ -122,9 +108,7 @@ static PyObject *Help_HMSetFontSize(_self, _args)
return _res; return _res;
} }
static PyObject *Help_HMGetFont(_self, _args) static PyObject *Help_HMGetFont(PyObject *_self, PyObject *_args)
PyObject *_self;
PyObject *_args;
{ {
PyObject *_res = NULL; PyObject *_res = NULL;
OSErr _err; OSErr _err;
...@@ -138,9 +122,7 @@ static PyObject *Help_HMGetFont(_self, _args) ...@@ -138,9 +122,7 @@ static PyObject *Help_HMGetFont(_self, _args)
return _res; return _res;
} }
static PyObject *Help_HMGetFontSize(_self, _args) static PyObject *Help_HMGetFontSize(PyObject *_self, PyObject *_args)
PyObject *_self;
PyObject *_args;
{ {
PyObject *_res = NULL; PyObject *_res = NULL;
OSErr _err; OSErr _err;
...@@ -154,9 +136,7 @@ static PyObject *Help_HMGetFontSize(_self, _args) ...@@ -154,9 +136,7 @@ static PyObject *Help_HMGetFontSize(_self, _args)
return _res; return _res;
} }
static PyObject *Help_HMSetDialogResID(_self, _args) static PyObject *Help_HMSetDialogResID(PyObject *_self, PyObject *_args)
PyObject *_self;
PyObject *_args;
{ {
PyObject *_res = NULL; PyObject *_res = NULL;
OSErr _err; OSErr _err;
...@@ -171,9 +151,7 @@ static PyObject *Help_HMSetDialogResID(_self, _args) ...@@ -171,9 +151,7 @@ static PyObject *Help_HMSetDialogResID(_self, _args)
return _res; return _res;
} }
static PyObject *Help_HMSetMenuResID(_self, _args) static PyObject *Help_HMSetMenuResID(PyObject *_self, PyObject *_args)
PyObject *_self;
PyObject *_args;
{ {
PyObject *_res = NULL; PyObject *_res = NULL;
OSErr _err; OSErr _err;
...@@ -191,9 +169,7 @@ static PyObject *Help_HMSetMenuResID(_self, _args) ...@@ -191,9 +169,7 @@ static PyObject *Help_HMSetMenuResID(_self, _args)
return _res; return _res;
} }
static PyObject *Help_HMScanTemplateItems(_self, _args) static PyObject *Help_HMScanTemplateItems(PyObject *_self, PyObject *_args)
PyObject *_self;
PyObject *_args;
{ {
PyObject *_res = NULL; PyObject *_res = NULL;
OSErr _err; OSErr _err;
...@@ -214,9 +190,7 @@ static PyObject *Help_HMScanTemplateItems(_self, _args) ...@@ -214,9 +190,7 @@ static PyObject *Help_HMScanTemplateItems(_self, _args)
return _res; return _res;
} }
static PyObject *Help_HMGetDialogResID(_self, _args) static PyObject *Help_HMGetDialogResID(PyObject *_self, PyObject *_args)
PyObject *_self;
PyObject *_args;
{ {
PyObject *_res = NULL; PyObject *_res = NULL;
OSErr _err; OSErr _err;
...@@ -230,9 +204,7 @@ static PyObject *Help_HMGetDialogResID(_self, _args) ...@@ -230,9 +204,7 @@ static PyObject *Help_HMGetDialogResID(_self, _args)
return _res; return _res;
} }
static PyObject *Help_HMGetMenuResID(_self, _args) static PyObject *Help_HMGetMenuResID(PyObject *_self, PyObject *_args)
PyObject *_self;
PyObject *_args;
{ {
PyObject *_res = NULL; PyObject *_res = NULL;
OSErr _err; OSErr _err;
...@@ -249,9 +221,7 @@ static PyObject *Help_HMGetMenuResID(_self, _args) ...@@ -249,9 +221,7 @@ static PyObject *Help_HMGetMenuResID(_self, _args)
return _res; return _res;
} }
static PyObject *Help_HMGetBalloonWindow(_self, _args) static PyObject *Help_HMGetBalloonWindow(PyObject *_self, PyObject *_args)
PyObject *_self;
PyObject *_args;
{ {
PyObject *_res = NULL; PyObject *_res = NULL;
OSErr _err; OSErr _err;
...@@ -302,7 +272,7 @@ static PyMethodDef Help_methods[] = { ...@@ -302,7 +272,7 @@ static PyMethodDef Help_methods[] = {
void initHelp() void initHelp(void)
{ {
PyObject *m; PyObject *m;
PyObject *d; PyObject *d;
......
This diff is collapsed.
...@@ -46,7 +46,12 @@ RGBColor = OpaqueType("RGBColor", "QdRGB") ...@@ -46,7 +46,12 @@ RGBColor = OpaqueType("RGBColor", "QdRGB")
#EventKind = Type("EventKind", "H") #EventKind = Type("EventKind", "H")
includestuff = includestuff + """ includestuff = includestuff + """
#include <%s>""" % MACHEADERFILE + """ #ifdef WITHOUT_FRAMEWORKS
#include <Icons.h>
#else
#include <Carbon/Carbon.h>
#endif
""" """
class MyObjectDefinition(GlobalObjectDefinition): class MyObjectDefinition(GlobalObjectDefinition):
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
...@@ -36,8 +36,13 @@ FMFontFamily = Type("FMFontFamily", "h") ...@@ -36,8 +36,13 @@ FMFontFamily = Type("FMFontFamily", "h")
FMFontStyle = Type("FMFontStyle", "h") FMFontStyle = Type("FMFontStyle", "h")
includestuff = includestuff + """ includestuff = includestuff + """
#ifdef WITHOUT_FRAMEWORKS
#include <Devices.h> /* Defines OpenDeskAcc in universal headers */ #include <Devices.h> /* Defines OpenDeskAcc in universal headers */
#include <%s>""" % MACHEADERFILE + """ #include <Menus.h>
#else
#include <Carbon/Carbon.h>
#endif
#ifdef USE_TOOLBOX_OBJECT_GLUE #ifdef USE_TOOLBOX_OBJECT_GLUE
...@@ -63,8 +68,8 @@ extern int _MenuObj_Convert(PyObject *, MenuHandle *); ...@@ -63,8 +68,8 @@ extern int _MenuObj_Convert(PyObject *, MenuHandle *);
""" """
initstuff = initstuff + """ initstuff = initstuff + """
PyMac_INIT_TOOLBOX_OBJECT_NEW(MenuObj_New); PyMac_INIT_TOOLBOX_OBJECT_NEW(MenuHandle, MenuObj_New);
PyMac_INIT_TOOLBOX_OBJECT_CONVERT(MenuObj_Convert); PyMac_INIT_TOOLBOX_OBJECT_CONVERT(MenuHandle, MenuObj_Convert);
""" """
class MyObjectDefinition(GlobalObjectDefinition): class MyObjectDefinition(GlobalObjectDefinition):
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
...@@ -49,7 +49,7 @@ class ResourcesScanner(Scanner): ...@@ -49,7 +49,7 @@ class ResourcesScanner(Scanner):
def makegreylist(self): def makegreylist(self):
return [ return [
('#if !TARGET_API_MAC_CARBON', [ ('#if TARGET_API_MAC_OS8', [
'RGetResource', 'RGetResource',
'OpenResFile', 'OpenResFile',
'CreateResFile', 'CreateResFile',
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment