Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit a4f0309

Browse files
committed
Added WEGetTabSize and WESetTabSize, at Just's request
1 parent f7cfb9a commit a4f0309

2 files changed

Lines changed: 42 additions & 0 deletions

File tree

Mac/Modules/waste/wastemodule.c

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1694,6 +1694,38 @@ static PyObject *wasteObj_WEIsTabHooks(_self, _args)
16941694
return _res;
16951695
}
16961696

1697+
static PyObject *wasteObj_WEGetTabSize(_self, _args)
1698+
wasteObject *_self;
1699+
PyObject *_args;
1700+
{
1701+
PyObject *_res = NULL;
1702+
SInt16 _rv;
1703+
if (!PyArg_ParseTuple(_args, ""))
1704+
return NULL;
1705+
_rv = WEGetTabSize(_self->ob_itself);
1706+
_res = Py_BuildValue("h",
1707+
_rv);
1708+
return _res;
1709+
}
1710+
1711+
static PyObject *wasteObj_WESetTabSize(_self, _args)
1712+
wasteObject *_self;
1713+
PyObject *_args;
1714+
{
1715+
PyObject *_res = NULL;
1716+
OSErr _err;
1717+
SInt16 tabWidth;
1718+
if (!PyArg_ParseTuple(_args, "h",
1719+
&tabWidth))
1720+
return NULL;
1721+
_err = WESetTabSize(tabWidth,
1722+
_self->ob_itself);
1723+
if (_err != noErr) return PyMac_Error(_err);
1724+
Py_INCREF(Py_None);
1725+
_res = Py_None;
1726+
return _res;
1727+
}
1728+
16971729
static PyMethodDef wasteObj_methods[] = {
16981730
{"WEGetText", (PyCFunction)wasteObj_WEGetText, 1,
16991731
"() -> (Handle _rv)"},
@@ -1839,6 +1871,10 @@ static PyMethodDef wasteObj_methods[] = {
18391871
"() -> None"},
18401872
{"WEIsTabHooks", (PyCFunction)wasteObj_WEIsTabHooks, 1,
18411873
"() -> (Boolean _rv)"},
1874+
{"WEGetTabSize", (PyCFunction)wasteObj_WEGetTabSize, 1,
1875+
"() -> (SInt16 _rv)"},
1876+
{"WESetTabSize", (PyCFunction)wasteObj_WESetTabSize, 1,
1877+
"(SInt16 tabWidth) -> None"},
18421878
{NULL, NULL, 0}
18431879
};
18441880

Mac/Modules/waste/wastesupport.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -400,12 +400,18 @@ def outputCheckNewArg(self):
400400
stdhand = ManualGenerator("STDObjectHandlers", stdhandlers_body)
401401
inshand = ManualGenerator("WEInstallObjectHandler", inshandler_body)
402402

403+
404+
# Tab hook handlers. Could be parsed from WETabs.h, but this is just as simple.
403405
f = Method(OSErr, 'WEInstallTabHooks', (WEReference, 'we', InMode))
404406
methods.append(f)
405407
f = Method(OSErr, 'WERemoveTabHooks', (WEReference, 'we', InMode))
406408
methods.append(f)
407409
f = Method(Boolean, 'WEIsTabHooks', (WEReference, 'we', InMode))
408410
methods.append(f)
411+
f = Method(SInt16, 'WEGetTabSize', (WEReference, 'we', InMode))
412+
methods.append(f)
413+
f = Method(OSErr, 'WESetTabSize', (SInt16, 'tabWidth', InMode), (WEReference, 'we', InMode))
414+
methods.append(f)
409415

410416
# add the populated lists to the generator groups
411417
# (in a different wordl the scan program would generate this)

0 commit comments

Comments
 (0)