Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
b5394066
Commit
b5394066
authored
Jan 05, 1996
by
Jack Jansen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added support for cursors, and a way to get at the qd global 'arrow'
parent
7d1eba97
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
57 additions
and
2 deletions
+57
-2
Mac/Modules/qd/Qdmodule.c
Mac/Modules/qd/Qdmodule.c
+37
-0
Mac/Modules/qd/qdgen.py
Mac/Modules/qd/qdgen.py
+5
-0
Mac/Modules/qd/qdscan.py
Mac/Modules/qd/qdscan.py
+1
-1
Mac/Modules/qd/qdsupport.py
Mac/Modules/qd/qdsupport.py
+14
-1
No files found.
Mac/Modules/qd/Qdmodule.c
View file @
b5394066
...
...
@@ -40,6 +40,9 @@ extern int GrafObj_Convert(PyObject *, GrafPtr *);
extern
PyObject
*
BMObj_New
(
BitMapPtr
);
extern
int
BMObj_Convert
(
PyObject
*
,
BitMapPtr
*
);
extern
PyObject
*
PMObj_New
(
PixMapHandle
);
extern
int
PMObj_Convert
(
PyObject
*
,
PixMapHandle
*
);
extern
PyObject
*
WinObj_WhichWindow
(
WindowPtr
);
#include <QuickDraw.h>
...
...
@@ -425,6 +428,28 @@ static PyObject *Qd_InitCursor(_self, _args)
return
_res
;
}
static
PyObject
*
Qd_SetCursor
(
_self
,
_args
)
PyObject
*
_self
;
PyObject
*
_args
;
{
PyObject
*
_res
=
NULL
;
Cursor
*
crsr__in__
;
int
crsr__in_len__
;
if
(
!
PyArg_ParseTuple
(
_args
,
"s#"
,
(
char
**
)
&
crsr__in__
,
&
crsr__in_len__
))
return
NULL
;
if
(
crsr__in_len__
!=
sizeof
(
Cursor
))
{
PyErr_SetString
(
PyExc_TypeError
,
"buffer length should be sizeof(Cursor)"
);
goto
crsr__error__
;
}
SetCursor
(
crsr__in__
);
Py_INCREF
(
Py_None
);
_res
=
Py_None
;
crsr__error__:
;
return
_res
;
}
static
PyObject
*
Qd_HideCursor
(
_self
,
_args
)
PyObject
*
_self
;
PyObject
*
_args
;
...
...
@@ -3131,6 +3156,8 @@ static PyMethodDef Qd_methods[] = {
"(Rect r) -> None"
},
{
"InitCursor"
,
(
PyCFunction
)
Qd_InitCursor
,
1
,
"() -> None"
},
{
"SetCursor"
,
(
PyCFunction
)
Qd_SetCursor
,
1
,
"(Cursor crsr) -> None"
},
{
"HideCursor"
,
(
PyCFunction
)
Qd_HideCursor
,
1
,
"() -> None"
},
{
"ShowCursor"
,
(
PyCFunction
)
Qd_ShowCursor
,
1
,
...
...
@@ -3453,6 +3480,16 @@ void initQd()
if
(
Qd_Error
==
NULL
||
PyDict_SetItemString
(
d
,
"Error"
,
Qd_Error
)
!=
0
)
Py_FatalError
(
"can't initialize Qd.Error"
);
{
PyObject
*
o
;
o
=
PyString_FromStringAndSize
((
char
*
)
&
qd
.
arrow
,
sizeof
(
qd
.
arrow
));
if
(
o
==
NULL
||
PyDict_SetItemString
(
d
,
"arrow"
,
o
)
!=
0
)
Py_FatalError
(
"can't initialize Qd.arrow"
);
}
}
/* ========================= End module Qd ========================== */
...
...
Mac/Modules/qd/qdgen.py
View file @
b5394066
...
...
@@ -57,6 +57,11 @@ f = Function(void, 'InitCursor',
)
functions
.
append
(
f
)
f
=
Function
(
void
,
'SetCursor'
,
(
Cursor_ptr
,
'crsr'
,
InMode
),
)
functions
.
append
(
f
)
f
=
Function
(
void
,
'HideCursor'
,
)
functions
.
append
(
f
)
...
...
Mac/Modules/qd/qdscan.py
View file @
b5394066
...
...
@@ -87,7 +87,7 @@ class MyScanner(Scanner):
'ConstPatternParam'
,
'Pattern_ptr'
,
'Pattern'
,
'Cursor_ptr'
,
##
'Cursor_ptr',
'DeviceLoopDrawingProcPtr'
,
'DeviceLoopFlags'
,
'FontInfo'
,
...
...
Mac/Modules/qd/qdsupport.py
View file @
b5394066
...
...
@@ -45,6 +45,8 @@ GrafPtr = OpaqueByValueType("GrafPtr", "GrafObj")
BitMap_ptr
=
OpaqueByValueType
(
"BitMapPtr"
,
"BMObj"
)
RGBColor
=
OpaqueType
(
'RGBColor'
,
'QdRGB'
)
RGBColor_ptr
=
RGBColor
Cursor
=
StructInputBufferType
(
'Cursor'
)
Cursor_ptr
=
Cursor
includestuff
=
includestuff
+
"""
#include <%s>"""
%
MACHEADERFILE
+
"""
...
...
@@ -77,6 +79,17 @@ QdRGB_Convert(v, p_itself)
}
"""
variablestuff
=
"""
{
PyObject *o;
o = PyString_FromStringAndSize((char *)&qd.arrow, sizeof(qd.arrow));
if (o == NULL || PyDict_SetItemString(d, "arrow", o) != 0)
Py_FatalError("can't initialize Qd.arrow");
}
"""
## not yet...
##
##class Region_ObjectDefinition(GlobalObjectDefinition):
...
...
@@ -147,7 +160,7 @@ class MyBMObjectDefinition(GlobalObjectDefinition):
"""
)
# Create the generator groups and link them
module
=
MacModule
(
MODNAME
,
MODPREFIX
,
includestuff
,
finalstuff
,
initstuff
)
module
=
MacModule
(
MODNAME
,
MODPREFIX
,
includestuff
,
finalstuff
,
initstuff
,
variablestuff
)
##r_object = Region_ObjectDefinition('Region', 'QdRgn', 'RgnHandle')
##po_object = Polygon_ObjectDefinition('Polygon', 'QdPgn', 'PolyHandle')
##module.addobject(r_object)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment