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
d2a837f1
Commit
d2a837f1
authored
Mar 19, 1995
by
Guido van Rossum
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
moved OpenDeskAcc here
parent
98e084b9
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
30 additions
and
0 deletions
+30
-0
Mac/Modules/menu/Menumodule.c
Mac/Modules/menu/Menumodule.c
+19
-0
Mac/Modules/menu/menuedit.py
Mac/Modules/menu/menuedit.py
+4
-0
Mac/Modules/menu/menusupport.py
Mac/Modules/menu/menusupport.py
+7
-0
No files found.
Mac/Modules/menu/Menumodule.c
View file @
d2a837f1
...
@@ -32,6 +32,8 @@ extern int CtlObj_Convert(PyObject *, ControlHandle *);
...
@@ -32,6 +32,8 @@ extern int CtlObj_Convert(PyObject *, ControlHandle *);
extern
PyObject
*
WinObj_WhichWindow
(
WindowPtr
);
extern
PyObject
*
WinObj_WhichWindow
(
WindowPtr
);
#include <Devices.h>
/* Defines OpenDeskAcc in universal headers */
#include <Desk.h>
/* Defines OpenDeskAcc in old headers */
#include <Menus.h>
#include <Menus.h>
#define resNotFound -192
/* Can't include <Errors.h> because of Python's "errors.h" */
#define resNotFound -192
/* Can't include <Errors.h> because of Python's "errors.h" */
...
@@ -843,6 +845,21 @@ static PyObject *Menu_DelMCEntries(_self, _args)
...
@@ -843,6 +845,21 @@ static PyObject *Menu_DelMCEntries(_self, _args)
return
_res
;
return
_res
;
}
}
static
PyObject
*
Menu_OpenDeskAcc
(
_self
,
_args
)
PyObject
*
_self
;
PyObject
*
_args
;
{
PyObject
*
_res
=
NULL
;
Str255
name
;
if
(
!
PyArg_ParseTuple
(
_args
,
"O&"
,
PyMac_GetStr255
,
name
))
return
NULL
;
OpenDeskAcc
(
name
);
Py_INCREF
(
Py_None
);
_res
=
Py_None
;
return
_res
;
}
static
PyMethodDef
Menu_methods
[]
=
{
static
PyMethodDef
Menu_methods
[]
=
{
{
"InitMenus"
,
(
PyCFunction
)
Menu_InitMenus
,
1
,
{
"InitMenus"
,
(
PyCFunction
)
Menu_InitMenus
,
1
,
"() -> None"
},
"() -> None"
},
...
@@ -882,6 +899,8 @@ static PyMethodDef Menu_methods[] = {
...
@@ -882,6 +899,8 @@ static PyMethodDef Menu_methods[] = {
"() -> (long _rv)"
},
"() -> (long _rv)"
},
{
"DelMCEntries"
,
(
PyCFunction
)
Menu_DelMCEntries
,
1
,
{
"DelMCEntries"
,
(
PyCFunction
)
Menu_DelMCEntries
,
1
,
"(short menuID, short menuItem) -> None"
},
"(short menuID, short menuItem) -> None"
},
{
"OpenDeskAcc"
,
(
PyCFunction
)
Menu_OpenDeskAcc
,
1
,
"(Str255 name) -> None"
},
{
NULL
,
NULL
,
0
}
{
NULL
,
NULL
,
0
}
};
};
...
...
Mac/Modules/menu/menuedit.py
0 → 100644
View file @
d2a837f1
f
=
Function
(
void
,
'OpenDeskAcc'
,
(
Str255
,
'name'
,
InMode
),
)
functions
.
append
(
f
)
Mac/Modules/menu/menusupport.py
View file @
d2a837f1
...
@@ -5,6 +5,9 @@
...
@@ -5,6 +5,9 @@
import
string
import
string
import
addpack
addpack
.
addpack
(
'D:python:Tools:bgen:bgen'
)
# Declarations that change for each manager
# Declarations that change for each manager
MACHEADERFILE
=
'Menus.h'
# The Apple header file
MACHEADERFILE
=
'Menus.h'
# The Apple header file
MODNAME
=
'Menu'
# The name of the module
MODNAME
=
'Menu'
# The name of the module
...
@@ -15,6 +18,7 @@ MODPREFIX = MODNAME # The prefix for module-wide routines
...
@@ -15,6 +18,7 @@ MODPREFIX = MODNAME # The prefix for module-wide routines
OBJECTTYPE
=
OBJECTNAME
+
'Handle'
# The C type used to represent them
OBJECTTYPE
=
OBJECTNAME
+
'Handle'
# The C type used to represent them
OBJECTPREFIX
=
MODPREFIX
+
'Obj'
# The prefix for object methods
OBJECTPREFIX
=
MODPREFIX
+
'Obj'
# The prefix for object methods
INPUTFILE
=
string
.
lower
(
MODPREFIX
)
+
'gen.py'
# The file generated by the scanner
INPUTFILE
=
string
.
lower
(
MODPREFIX
)
+
'gen.py'
# The file generated by the scanner
EXTRAFILE
=
string
.
lower
(
MODPREFIX
)
+
'edit.py'
# A similar file but hand-made
OUTPUTFILE
=
MODNAME
+
"module.c"
# The file generated by this program
OUTPUTFILE
=
MODNAME
+
"module.c"
# The file generated by this program
from
macsupport
import
*
from
macsupport
import
*
...
@@ -24,6 +28,8 @@ from macsupport import *
...
@@ -24,6 +28,8 @@ from macsupport import *
MenuHandle
=
OpaqueByValueType
(
OBJECTTYPE
,
OBJECTPREFIX
)
MenuHandle
=
OpaqueByValueType
(
OBJECTTYPE
,
OBJECTPREFIX
)
includestuff
=
includestuff
+
"""
includestuff
=
includestuff
+
"""
#include <Devices.h> /* Defines OpenDeskAcc in universal headers */
#include <Desk.h> /* Defines OpenDeskAcc in old headers */
#include <%s>"""
%
MACHEADERFILE
+
"""
#include <%s>"""
%
MACHEADERFILE
+
"""
#define resNotFound -192 /* Can't include <Errors.h> because of Python's "errors.h" */
#define resNotFound -192 /* Can't include <Errors.h> because of Python's "errors.h" */
...
@@ -45,6 +51,7 @@ Method = OSErrMethodGenerator
...
@@ -45,6 +51,7 @@ Method = OSErrMethodGenerator
functions
=
[]
functions
=
[]
methods
=
[]
methods
=
[]
execfile
(
INPUTFILE
)
execfile
(
INPUTFILE
)
execfile
(
EXTRAFILE
)
# add the populated lists to the generator groups
# add the populated lists to the generator groups
for
f
in
functions
:
module
.
add
(
f
)
for
f
in
functions
:
module
.
add
(
f
)
...
...
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