diff options
author | Thomas Wouters <thomas@python.org> | 2006-06-08 14:52:47 (GMT) |
---|---|---|
committer | Thomas Wouters <thomas@python.org> | 2006-06-08 14:52:47 (GMT) |
commit | 1ba5b3b425e970ec3e4a19165475aa68fa5ac893 (patch) | |
tree | 607d666a002704ccb6a8cc5d1739b729a64cc615 /Mac/Wastemods/WETabs.c | |
parent | 4d70c3d9dded0f0fa7a73c67217a71111d05df4d (diff) | |
download | cpython-1ba5b3b425e970ec3e4a19165475aa68fa5ac893.zip cpython-1ba5b3b425e970ec3e4a19165475aa68fa5ac893.tar.gz cpython-1ba5b3b425e970ec3e4a19165475aa68fa5ac893.tar.bz2 |
Merged revisions 46607-46608 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk
........
r46607 | neal.norwitz | 2006-06-03 06:49:00 +0200 (Sat, 03 Jun 2006) | 1 line
Remove Mac OS 9 support (http://mail.python.org/pipermail/python-dev/2006-June/065538.html)
........
r46608 | martin.v.loewis | 2006-06-03 09:37:13 +0200 (Sat, 03 Jun 2006) | 2 lines
Port to OpenBSD 3.9. Patch from Aldo Cortesi.
........
Diffstat (limited to 'Mac/Wastemods/WETabs.c')
-rw-r--r-- | Mac/Wastemods/WETabs.c | 116 |
1 files changed, 0 insertions, 116 deletions
diff --git a/Mac/Wastemods/WETabs.c b/Mac/Wastemods/WETabs.c deleted file mode 100644 index 1a0291e..0000000 --- a/Mac/Wastemods/WETabs.c +++ /dev/null @@ -1,116 +0,0 @@ -/* - * WETabs.c - * - * WASTE TABS PACKAGE - * Routines for installing/removing tab hooks; accessors - * - */ - - -#include "WETabs.h" -#include "WETabHooks.h" - -#if !defined(__ERRORS__) && defined(WITHOUT_FRAMEWORKS) -#include <Errors.h> -#endif - -/* static UPP's */ -static WEDrawTextUPP _weTabDrawTextProc = nil; -static WEPixelToCharUPP _weTabPixelToCharProc = nil; -static WECharToPixelUPP _weTabCharToPixelProc = nil; -static WELineBreakUPP _weTabLineBreakProc = nil; - -pascal OSErr WEInstallTabHooks(WEReference we) -{ - OSErr err; - - /* if first time, create routine descriptors */ - if (_weTabDrawTextProc == nil) - { - _weTabDrawTextProc = NewWEDrawTextProc(_WETabDrawText); - _weTabPixelToCharProc = NewWEPixelToCharProc(_WETabPixelToChar); - _weTabCharToPixelProc = NewWECharToPixelProc(_WETabCharToPixel); - _weTabLineBreakProc = NewWELineBreakProc(_WETabLineBreak); - } - - if ((err = WESetInfo( weDrawTextHook, &_weTabDrawTextProc, we )) != noErr) - { - goto cleanup; - } - if ((err = WESetInfo( wePixelToCharHook, &_weTabPixelToCharProc, we )) != noErr) - { - goto cleanup; - } - if ((err = WESetInfo( weCharToPixelHook, &_weTabCharToPixelProc, we )) != noErr) - { - goto cleanup; - } - if ((err = WESetInfo( weLineBreakHook, &_weTabLineBreakProc, we )) != noErr) - { - goto cleanup; - } - -cleanup: - return err; -} - -pascal OSErr WERemoveTabHooks(WEReference we) -{ - UniversalProcPtr nullHook = nil; - OSErr err; - - if ((err = WESetInfo( weDrawTextHook, &nullHook, we )) != noErr) - { - goto cleanup; - } - if ((err = WESetInfo( wePixelToCharHook, &nullHook, we )) != noErr) - { - goto cleanup; - } - if ((err = WESetInfo( weCharToPixelHook, &nullHook, we )) != noErr) - { - goto cleanup; - } - if ((err = WESetInfo( weLineBreakHook, &nullHook, we )) != noErr) - { - goto cleanup; - } - -cleanup: - return err; -} - -pascal Boolean WEIsTabHooks(WEReference we) -{ - WEPixelToCharUPP hook = nil; - - /* return true if our tab hooks are installed */ - - return ( _weTabPixelToCharProc != nil ) && - ( WEGetInfo( wePixelToCharHook, &hook, we ) == noErr) && - ( _weTabPixelToCharProc == hook ); -} - -pascal SInt16 WEGetTabSize(WEReference we) -{ - SInt32 result; - - if (WEGetUserInfo( kTabSizeTag, &result, we ) != noErr) - { - result = kDefaultTabSize; - } - return result; -} - -pascal OSErr WESetTabSize(SInt16 tabSize, WEReference we) -{ - // make sure tabSize is a reasonable size - if ((tabSize < kMinTabSize) || (tabSize > kMaxTabSize)) - { - return paramErr; - } - else - { - return WESetUserInfo( kTabSizeTag, tabSize, we ); - } -} |