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