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
aa15966a
Commit
aa15966a
authored
Dec 19, 2000
by
Jack Jansen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Emulate a few more non-carbon calls in carbon and the other way around.
parent
9529dddb
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
163 additions
and
93 deletions
+163
-93
Mac/Modules/win/Winmodule.c
Mac/Modules/win/Winmodule.c
+125
-0
Mac/Modules/win/winedit.py
Mac/Modules/win/winedit.py
+31
-93
Mac/Modules/win/winsupport.py
Mac/Modules/win/winsupport.py
+7
-0
No files found.
Mac/Modules/win/Winmodule.c
View file @
aa15966a
...
...
@@ -11,10 +11,17 @@
#include <Windows.h>
#if !ACCESSOR_CALLS_ARE_FUNCTIONS
/* Carbon calls that we emulate in classic mode */
#define GetWindowSpareFlag(win) (((CWindowPeek)(win))->spareFlag)
#define GetWindowFromPort(port) ((WindowRef)(port))
#define GetWindowPortBounds(win, rectp) (*(rectp) = ((CWindowPeek)(win))->port.portRect)
#endif
#if ACCESSOR_CALLS_ARE_FUNCTIONS
/* Classic calls that we emulate in carbon mode */
#define GetWindowUpdateRgn(win, rgn) GetWindowRegion((win), kWindowUpdateRgn, (rgn))
#define GetWindowStructureRgn(win, rgn) GetWindowRegion((win), kWindowStructureRgn, (rgn))
#define GetWindowContentRgn(win, rgn) GetWindowRegion((win), kWindowContentRgn, (rgn))
#endif
/* Function to dispose a window, with a "normal" calling sequence */
static
void
...
...
@@ -1851,6 +1858,110 @@ static PyObject *WinObj_GetWindowPortBounds(_self, _args)
return
_res
;
}
static
PyObject
*
WinObj_IsWindowVisible
(
_self
,
_args
)
WindowObject
*
_self
;
PyObject
*
_args
;
{
PyObject
*
_res
=
NULL
;
Boolean
_rv
;
if
(
!
PyArg_ParseTuple
(
_args
,
""
))
return
NULL
;
_rv
=
IsWindowVisible
(
_self
->
ob_itself
);
_res
=
Py_BuildValue
(
"b"
,
_rv
);
return
_res
;
}
static
PyObject
*
WinObj_GetWindowZoomFlag
(
_self
,
_args
)
WindowObject
*
_self
;
PyObject
*
_args
;
{
PyObject
*
_res
=
NULL
;
Boolean
_rv
;
if
(
!
PyArg_ParseTuple
(
_args
,
""
))
return
NULL
;
_rv
=
GetWindowZoomFlag
(
_self
->
ob_itself
);
_res
=
Py_BuildValue
(
"b"
,
_rv
);
return
_res
;
}
static
PyObject
*
WinObj_GetWindowStructureRgn
(
_self
,
_args
)
WindowObject
*
_self
;
PyObject
*
_args
;
{
PyObject
*
_res
=
NULL
;
RgnHandle
r
;
if
(
!
PyArg_ParseTuple
(
_args
,
"O&"
,
ResObj_Convert
,
&
r
))
return
NULL
;
GetWindowStructureRgn
(
_self
->
ob_itself
,
r
);
Py_INCREF
(
Py_None
);
_res
=
Py_None
;
return
_res
;
}
static
PyObject
*
WinObj_GetWindowContentRgn
(
_self
,
_args
)
WindowObject
*
_self
;
PyObject
*
_args
;
{
PyObject
*
_res
=
NULL
;
RgnHandle
r
;
if
(
!
PyArg_ParseTuple
(
_args
,
"O&"
,
ResObj_Convert
,
&
r
))
return
NULL
;
GetWindowContentRgn
(
_self
->
ob_itself
,
r
);
Py_INCREF
(
Py_None
);
_res
=
Py_None
;
return
_res
;
}
static
PyObject
*
WinObj_GetWindowUpdateRgn
(
_self
,
_args
)
WindowObject
*
_self
;
PyObject
*
_args
;
{
PyObject
*
_res
=
NULL
;
RgnHandle
r
;
if
(
!
PyArg_ParseTuple
(
_args
,
"O&"
,
ResObj_Convert
,
&
r
))
return
NULL
;
GetWindowUpdateRgn
(
_self
->
ob_itself
,
r
);
Py_INCREF
(
Py_None
);
_res
=
Py_None
;
return
_res
;
}
static
PyObject
*
WinObj_GetWindowTitleWidth
(
_self
,
_args
)
WindowObject
*
_self
;
PyObject
*
_args
;
{
PyObject
*
_res
=
NULL
;
short
_rv
;
if
(
!
PyArg_ParseTuple
(
_args
,
""
))
return
NULL
;
_rv
=
GetWindowTitleWidth
(
_self
->
ob_itself
);
_res
=
Py_BuildValue
(
"h"
,
_rv
);
return
_res
;
}
static
PyObject
*
WinObj_GetNextWindow
(
_self
,
_args
)
WindowObject
*
_self
;
PyObject
*
_args
;
{
PyObject
*
_res
=
NULL
;
WindowPtr
_rv
;
if
(
!
PyArg_ParseTuple
(
_args
,
""
))
return
NULL
;
_rv
=
GetNextWindow
(
_self
->
ob_itself
);
_res
=
Py_BuildValue
(
"O&"
,
WinObj_WhichWindow
,
_rv
);
return
_res
;
}
#if !TARGET_API_MAC_CARBON
static
PyObject
*
WinObj_CloseWindow
(
_self
,
_args
)
...
...
@@ -2142,6 +2253,20 @@ static PyMethodDef WinObj_methods[] = {
"() -> None"
},
{
"GetWindowPortBounds"
,
(
PyCFunction
)
WinObj_GetWindowPortBounds
,
1
,
"() -> (Rect bounds)"
},
{
"IsWindowVisible"
,
(
PyCFunction
)
WinObj_IsWindowVisible
,
1
,
"() -> (Boolean _rv)"
},
{
"GetWindowZoomFlag"
,
(
PyCFunction
)
WinObj_GetWindowZoomFlag
,
1
,
"() -> (Boolean _rv)"
},
{
"GetWindowStructureRgn"
,
(
PyCFunction
)
WinObj_GetWindowStructureRgn
,
1
,
"(RgnHandle r) -> None"
},
{
"GetWindowContentRgn"
,
(
PyCFunction
)
WinObj_GetWindowContentRgn
,
1
,
"(RgnHandle r) -> None"
},
{
"GetWindowUpdateRgn"
,
(
PyCFunction
)
WinObj_GetWindowUpdateRgn
,
1
,
"(RgnHandle r) -> None"
},
{
"GetWindowTitleWidth"
,
(
PyCFunction
)
WinObj_GetWindowTitleWidth
,
1
,
"() -> (short _rv)"
},
{
"GetNextWindow"
,
(
PyCFunction
)
WinObj_GetNextWindow
,
1
,
"() -> (WindowPtr _rv)"
},
#if !TARGET_API_MAC_CARBON
{
"CloseWindow"
,
(
PyCFunction
)
WinObj_CloseWindow
,
1
,
...
...
Mac/Modules/win/winedit.py
View file @
aa15966a
# These are inline-routines/defines, so we do them "by hand"
#
if
0
:
f
=
Method
(
CGrafPtr
,
'GetWindowPort'
,
(
WindowRef
,
'theWindow'
,
InMode
),
)
methods
.
append
(
f
)
f
=
Method
(
void
,
'SetPortWindowPort'
,
(
WindowRef
,
'theWindow'
,
InMode
),
)
methods
.
append
(
f
)
f
=
Method
(
short
,
'GetWindowKind'
,
(
WindowRef
,
'theWindow'
,
InMode
),
)
methods
.
append
(
f
)
f
=
Method
(
void
,
'SetWindowKind'
,
(
WindowRef
,
'theWindow'
,
InMode
),
(
short
,
'wKind'
,
InMode
),
)
methods
.
append
(
f
)
f
=
Method
(
Boolean
,
'IsWindowVisible'
,
(
WindowRef
,
'theWindow'
,
InMode
),
)
methods
.
append
(
f
)
f
=
Method
(
Boolean
,
'IsWindowHilited'
,
(
WindowRef
,
'theWindow'
,
InMode
),
)
methods
.
append
(
f
)
f
=
Method
(
Boolean
,
'GetWindowGoAwayFlag'
,
(
WindowRef
,
'theWindow'
,
InMode
),
)
methods
.
append
(
f
)
f
=
Method
(
Boolean
,
'GetWindowZoomFlag'
,
(
WindowRef
,
'theWindow'
,
InMode
),
condition
=
'#if !TARGET_API_MAC_CARBON'
)
methods
.
append
(
f
)
f
=
Method
(
void
,
'GetWindowStructureRgn'
,
(
WindowRef
,
'theWindow'
,
InMode
),
(
RgnHandle
,
'r'
,
InMode
),
condition
=
'#if !TARGET_API_MAC_CARBON'
)
methods
.
append
(
f
)
f
=
Method
(
void
,
'GetWindowContentRgn'
,
(
WindowRef
,
'theWindow'
,
InMode
),
(
RgnHandle
,
'r'
,
InMode
),
condition
=
'#if !TARGET_API_MAC_CARBON'
)
methods
.
append
(
f
)
f
=
Method
(
void
,
'GetWindowUpdateRgn'
,
(
WindowRef
,
'theWindow'
,
InMode
),
(
RgnHandle
,
'r'
,
InMode
),
condition
=
'#if !TARGET_API_MAC_CARBON'
)
methods
.
append
(
f
)
f
=
Method
(
short
,
'GetWindowTitleWidth'
,
(
WindowRef
,
'theWindow'
,
InMode
),
condition
=
'#if !TARGET_API_MAC_CARBON'
)
methods
.
append
(
f
)
f
=
Method
(
Boolean
,
'IsWindowVisible'
,
(
WindowRef
,
'theWindow'
,
InMode
),
)
methods
.
append
(
f
)
f
=
Method
(
ExistingWindowPtr
,
'GetNextWindow
'
,
(
WindowRef
,
'theWindow'
,
InMode
),
)
methods
.
append
(
f
)
f
=
Method
(
Boolean
,
'GetWindowZoomFlag
'
,
(
WindowRef
,
'theWindow'
,
InMode
),
)
methods
.
append
(
f
)
f
=
Method
(
void
,
'GetWindowStandardState
'
,
(
WindowRef
,
'theWindow'
,
InMode
),
(
Rect
,
'r'
,
Out
Mode
),
)
methods
.
append
(
f
)
f
=
Method
(
void
,
'GetWindowStructureRgn
'
,
(
WindowRef
,
'theWindow'
,
InMode
),
(
RgnHandle
,
'r'
,
In
Mode
),
)
methods
.
append
(
f
)
f
=
Method
(
void
,
'GetWindowUserState
'
,
(
WindowRef
,
'theWindow'
,
InMode
),
(
Rect
,
'r'
,
Out
Mode
),
)
methods
.
append
(
f
)
f
=
Method
(
void
,
'GetWindowContentRgn
'
,
(
WindowRef
,
'theWindow'
,
InMode
),
(
RgnHandle
,
'r'
,
In
Mode
),
)
methods
.
append
(
f
)
f
=
Method
(
void
,
'GetWindowUpdateRgn'
,
(
WindowRef
,
'theWindow'
,
InMode
),
(
RgnHandle
,
'r'
,
InMode
),
)
methods
.
append
(
f
)
f
=
Method
(
void
,
'SetWindowStandardState'
,
(
WindowRef
,
'theWindow'
,
InMode
),
(
Rect
,
'r'
,
InMode
),
)
methods
.
append
(
f
)
f
=
Method
(
short
,
'GetWindowTitleWidth'
,
(
WindowRef
,
'theWindow'
,
InMode
),
)
methods
.
append
(
f
)
f
=
Method
(
void
,
'SetWindowUserState'
,
(
WindowRef
,
'theWindow'
,
InMode
),
(
Rect
,
'r'
,
InMode
),
)
methods
.
append
(
f
)
f
=
Method
(
ExistingWindowPtr
,
'GetNextWindow'
,
(
WindowRef
,
'theWindow'
,
InMode
),
)
methods
.
append
(
f
)
# These have Mac prefixed to their name in the 3.1 universal headers,
# so we add the old/real names by hand.
...
...
Mac/Modules/win/winsupport.py
View file @
aa15966a
...
...
@@ -57,10 +57,17 @@ includestuff = includestuff + """
#include <%s>"""
%
MACHEADERFILE
+
"""
#if !ACCESSOR_CALLS_ARE_FUNCTIONS
/* Carbon calls that we emulate in classic mode */
#define GetWindowSpareFlag(win) (((CWindowPeek)(win))->spareFlag)
#define GetWindowFromPort(port) ((WindowRef)(port))
#define GetWindowPortBounds(win, rectp) (*(rectp) = ((CWindowPeek)(win))->port.portRect)
#endif
#if ACCESSOR_CALLS_ARE_FUNCTIONS
/* Classic calls that we emulate in carbon mode */
#define GetWindowUpdateRgn(win, rgn) GetWindowRegion((win), kWindowUpdateRgn, (rgn))
#define GetWindowStructureRgn(win, rgn) GetWindowRegion((win), kWindowStructureRgn, (rgn))
#define GetWindowContentRgn(win, rgn) GetWindowRegion((win), kWindowContentRgn, (rgn))
#endif
/* Function to dispose a window, with a "normal" calling sequence */
static void
...
...
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