File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -80,4 +80,6 @@ PyObject *PyMac_BuildPoint(Point); /* Convert Point to PyObject */
8080int PyMac_GetEventRecord (PyObject * , EventRecord * ); /* argument parser for EventRecord */
8181PyObject * PyMac_BuildEventRecord (EventRecord * ); /* Convert EventRecord to PyObject */
8282
83+ int PyMac_GetFixed (PyObject * , Fixed * ); /* argument parser for Fixed */
84+ PyObject * PyMac_BuildFixed (Fixed ); /* Convert Fixed to PyObject */
8385void PyMac_InitApplet (void ); /* Initialize and run an Applet */
Original file line number Diff line number Diff line change @@ -734,3 +734,26 @@ PyMac_BuildEventRecord(EventRecord *e)
734734 e -> where .v ,
735735 e -> modifiers );
736736}
737+
738+ /* Convert Python object to Fixed */
739+ int
740+ PyMac_GetFixed (PyObject * v , Fixed * f )
741+ {
742+ double d ;
743+
744+ if ( !PyArg_Parse (v , "d" , & d ))
745+ return 0 ;
746+ * f = (Fixed )(d * 0x10000 );
747+ }
748+
749+ /* Convert a Point to a Python object */
750+ PyObject *
751+ PyMac_BuildFixed (Fixed f )
752+ {
753+ double d ;
754+
755+ d = f ;
756+ d = d / 0x10000 ;
757+ return Py_BuildValue ("d" , d );
758+ }
759+
You can’t perform that action at this time.
0 commit comments