summaryrefslogtreecommitdiffstats
path: root/Mac/Modules/win
diff options
context:
space:
mode:
authorJack Jansen <jack.jansen@cwi.nl>1998-10-22 15:08:00 (GMT)
committerJack Jansen <jack.jansen@cwi.nl>1998-10-22 15:08:00 (GMT)
commitcdcbd1f02bfbf80bb8d0a93ce91a640404f0304b (patch)
treeee25d3f6209e42182986cc553174a8114ae44bfa /Mac/Modules/win
parent3dd1c39c809d77a90112a94b0aec373f86d1b751 (diff)
downloadcpython-cdcbd1f02bfbf80bb8d0a93ce91a640404f0304b.zip
cpython-cdcbd1f02bfbf80bb8d0a93ce91a640404f0304b.tar.gz
cpython-cdcbd1f02bfbf80bb8d0a93ce91a640404f0304b.tar.bz2
Added {Get,Set}WindowUserData methods.
Diffstat (limited to 'Mac/Modules/win')
-rw-r--r--Mac/Modules/win/Winmodule.c37
-rw-r--r--Mac/Modules/win/winedit.py10
-rw-r--r--Mac/Modules/win/winsupport.py3
3 files changed, 44 insertions, 6 deletions
diff --git a/Mac/Modules/win/Winmodule.c b/Mac/Modules/win/Winmodule.c
index 58da8fd..dd23ab0 100644
--- a/Mac/Modules/win/Winmodule.c
+++ b/Mac/Modules/win/Winmodule.c
@@ -46,9 +46,6 @@ extern PyObject *WinObj_WhichWindow(WindowPtr);
#define resNotFound -192 /* Can't include <Errors.h> because of Python's "errors.h" */
-#ifdef HAVE_UNIVERSAL_HEADERS
-#define WindowPeek WindowPtr
-#endif
static PyObject *Win_Error;
@@ -967,6 +964,36 @@ static PyObject *WinObj_SetWindowUserState(_self, _args)
return _res;
}
+static PyObject *WinObj_GetWindowDataHandle(_self, _args)
+ WindowObject *_self;
+ PyObject *_args;
+{
+ PyObject *_res = NULL;
+ Handle _rv;
+ if (!PyArg_ParseTuple(_args, ""))
+ return NULL;
+ _rv = GetWindowDataHandle(_self->ob_itself);
+ _res = Py_BuildValue("O&",
+ ResObj_New, _rv);
+ return _res;
+}
+
+static PyObject *WinObj_SetWindowDataHandle(_self, _args)
+ WindowObject *_self;
+ PyObject *_args;
+{
+ PyObject *_res = NULL;
+ Handle data;
+ if (!PyArg_ParseTuple(_args, "O&",
+ ResObj_Convert, &data))
+ return NULL;
+ SetWindowDataHandle(_self->ob_itself,
+ data);
+ Py_INCREF(Py_None);
+ _res = Py_None;
+ return _res;
+}
+
static PyObject *WinObj_CloseWindow(_self, _args)
WindowObject *_self;
PyObject *_args;
@@ -1128,6 +1155,10 @@ static PyMethodDef WinObj_methods[] = {
"(Rect r) -> None"},
{"SetWindowUserState", (PyCFunction)WinObj_SetWindowUserState, 1,
"(Rect r) -> None"},
+ {"GetWindowDataHandle", (PyCFunction)WinObj_GetWindowDataHandle, 1,
+ "() -> (Handle _rv)"},
+ {"SetWindowDataHandle", (PyCFunction)WinObj_SetWindowDataHandle, 1,
+ "(Handle data) -> None"},
{"CloseWindow", (PyCFunction)WinObj_CloseWindow, 1,
"() -> None"},
{"MoveWindow", (PyCFunction)WinObj_MoveWindow, 1,
diff --git a/Mac/Modules/win/winedit.py b/Mac/Modules/win/winedit.py
index b7c2a97..6a81b9b 100644
--- a/Mac/Modules/win/winedit.py
+++ b/Mac/Modules/win/winedit.py
@@ -96,6 +96,16 @@ f = Method(void, 'SetWindowUserState',
)
methods.append(f)
+f = Method(Handle, 'GetWindowDataHandle',
+ (WindowRef, 'theWindow', InMode),
+)
+methods.append(f)
+f = Method(void, 'SetWindowDataHandle',
+ (WindowRef, 'theWindow', InMode),
+ (Handle, 'data', 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.
f = Method(void, 'CloseWindow',
diff --git a/Mac/Modules/win/winsupport.py b/Mac/Modules/win/winsupport.py
index c7e1f7a..6150819 100644
--- a/Mac/Modules/win/winsupport.py
+++ b/Mac/Modules/win/winsupport.py
@@ -42,9 +42,6 @@ includestuff = includestuff + """
#define resNotFound -192 /* Can't include <Errors.h> because of Python's "errors.h" */
-#ifdef HAVE_UNIVERSAL_HEADERS
-#define WindowPeek WindowPtr
-#endif
"""
finalstuff = finalstuff + """