summaryrefslogtreecommitdiffstats
path: root/Mac/Modules/win
diff options
context:
space:
mode:
authorJack Jansen <jack.jansen@cwi.nl>1998-04-24 10:28:20 (GMT)
committerJack Jansen <jack.jansen@cwi.nl>1998-04-24 10:28:20 (GMT)
commite180d99280a7b7615d445a52efd63314f330e74b (patch)
tree806d4c6302ec0e534ecbf50b830339571d34bc52 /Mac/Modules/win
parent6a508aef7d024921b00a1c8fe635f19b0fa6a98f (diff)
downloadcpython-e180d99280a7b7615d445a52efd63314f330e74b.zip
cpython-e180d99280a7b7615d445a52efd63314f330e74b.tar.gz
cpython-e180d99280a7b7615d445a52efd63314f330e74b.tar.bz2
Grmpf, a lot more routines have gotten a "Mac" prefix for their
declaration, probably so the universal headers are useable on windows/unix too. Have to think of a more definite workaround later, for now we manually declare the old names in the *edit.py files.
Diffstat (limited to 'Mac/Modules/win')
-rw-r--r--Mac/Modules/win/Winmodule.c75
-rw-r--r--Mac/Modules/win/winedit.py28
2 files changed, 103 insertions, 0 deletions
diff --git a/Mac/Modules/win/Winmodule.c b/Mac/Modules/win/Winmodule.c
index f57928e..58da8fd 100644
--- a/Mac/Modules/win/Winmodule.c
+++ b/Mac/Modules/win/Winmodule.c
@@ -967,6 +967,54 @@ static PyObject *WinObj_SetWindowUserState(_self, _args)
return _res;
}
+static PyObject *WinObj_CloseWindow(_self, _args)
+ WindowObject *_self;
+ PyObject *_args;
+{
+ PyObject *_res = NULL;
+ if (!PyArg_ParseTuple(_args, ""))
+ return NULL;
+ CloseWindow(_self->ob_itself);
+ Py_INCREF(Py_None);
+ _res = Py_None;
+ return _res;
+}
+
+static PyObject *WinObj_MoveWindow(_self, _args)
+ WindowObject *_self;
+ PyObject *_args;
+{
+ PyObject *_res = NULL;
+ short hGlobal;
+ short vGlobal;
+ Boolean front;
+ if (!PyArg_ParseTuple(_args, "hhb",
+ &hGlobal,
+ &vGlobal,
+ &front))
+ return NULL;
+ MoveWindow(_self->ob_itself,
+ hGlobal,
+ vGlobal,
+ front);
+ Py_INCREF(Py_None);
+ _res = Py_None;
+ return _res;
+}
+
+static PyObject *WinObj_ShowWindow(_self, _args)
+ WindowObject *_self;
+ PyObject *_args;
+{
+ PyObject *_res = NULL;
+ if (!PyArg_ParseTuple(_args, ""))
+ return NULL;
+ ShowWindow(_self->ob_itself);
+ Py_INCREF(Py_None);
+ _res = Py_None;
+ return _res;
+}
+
static PyMethodDef WinObj_methods[] = {
{"MacCloseWindow", (PyCFunction)WinObj_MacCloseWindow, 1,
"() -> None"},
@@ -1080,6 +1128,12 @@ static PyMethodDef WinObj_methods[] = {
"(Rect r) -> None"},
{"SetWindowUserState", (PyCFunction)WinObj_SetWindowUserState, 1,
"(Rect r) -> None"},
+ {"CloseWindow", (PyCFunction)WinObj_CloseWindow, 1,
+ "() -> None"},
+ {"MoveWindow", (PyCFunction)WinObj_MoveWindow, 1,
+ "(short hGlobal, short vGlobal, Boolean front) -> None"},
+ {"ShowWindow", (PyCFunction)WinObj_ShowWindow, 1,
+ "() -> None"},
{NULL, NULL, 0}
};
@@ -1448,6 +1502,25 @@ static PyObject *Win_WhichWindow(_self, _args)
}
+static PyObject *Win_FindWindow(_self, _args)
+ PyObject *_self;
+ PyObject *_args;
+{
+ PyObject *_res = NULL;
+ short _rv;
+ Point thePoint;
+ WindowPtr theWindow;
+ if (!PyArg_ParseTuple(_args, "O&",
+ PyMac_GetPoint, &thePoint))
+ return NULL;
+ _rv = FindWindow(thePoint,
+ &theWindow);
+ _res = Py_BuildValue("hO&",
+ _rv,
+ WinObj_WhichWindow, theWindow);
+ return _res;
+}
+
static PyMethodDef Win_methods[] = {
{"GetNewCWindow", (PyCFunction)Win_GetNewCWindow, 1,
"(short windowID, WindowPtr behind) -> (WindowPtr _rv)"},
@@ -1487,6 +1560,8 @@ static PyMethodDef Win_methods[] = {
"() -> (RgnHandle _rv)"},
{"WhichWindow", (PyCFunction)Win_WhichWindow, 1,
"Resolve an integer WindowPtr address to a Window object"},
+ {"FindWindow", (PyCFunction)Win_FindWindow, 1,
+ "(Point thePoint) -> (short _rv, WindowPtr theWindow)"},
{NULL, NULL, 0}
};
diff --git a/Mac/Modules/win/winedit.py b/Mac/Modules/win/winedit.py
index a5812f1..b7c2a97 100644
--- a/Mac/Modules/win/winedit.py
+++ b/Mac/Modules/win/winedit.py
@@ -96,3 +96,31 @@ f = Method(void, 'SetWindowUserState',
)
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',
+ (WindowPtr, 'theWindow', InMode),
+)
+methods.append(f)
+
+f = Function(short, 'FindWindow',
+ (Point, 'thePoint', InMode),
+ (ExistingWindowPtr, 'theWindow', OutMode),
+)
+functions.append(f)
+
+f = Method(void, 'MoveWindow',
+ (WindowPtr, 'theWindow', InMode),
+ (short, 'hGlobal', InMode),
+ (short, 'vGlobal', InMode),
+ (Boolean, 'front', InMode),
+)
+methods.append(f)
+
+f = Method(void, 'ShowWindow',
+ (WindowPtr, 'theWindow', InMode),
+)
+methods.append(f)
+
+
+