[Back to Free Stuff] - [Back to Mike's Home]


Please Note

NOTE: MOKit is now a Source Forge project and is hosted at mokit.sourceforge.net. The most recent releases, starting with release 2.7, are available for download there. This page is now obsolete. Only older versions of MOKit are available here (versions 2.6 and prior).

Old Home Page

Just let me download.

MOKit is just a collection of objects I have found useful. All versions of MOKit are not public domain, but they are free. For me, this project is mostly an exercise in reuse. Part of it is trying to take objects that I have had use for more than once and make them as generally useful as possible. Another part is trying to package the whole thing up so it is easy to use.

There are two major versions of MOKit. MOKit_1 is the original pre-OpenStep MOKit. MOKit_2 is the version that has been evolving since OpenStep came along. Below are descriptions of the various release of MOKit starting with the latest version and working back.

MOKit 2.6

The biggest change in this version is the new backing implementation for MORegularExpression. Henry Spencer, the author of the original regular expression code used by previous versions of MOKit has rewritten his package to support Unicode directly. He has also greatly expanded the supported syntax for regular expressions to support, among other things, most of the extensions from Perl5. I have upgraded MORegularExpression to use this new package (which I obtained from the tcl 8.3.2 distribution.) I believe all the syntax additions that had been added to the old implementation by Vivian Girel are now present in the new base-line implementation.

The only other significant change from 2.5 is that MOKit is now a (new) Project Builder project. Another minor change is that all MOKit source code is now stored in UTF-8 format. In this release, the only place that this is noticeable as being different from ASCII is in the file header comments where the copyright symbol is used. The project is set up such that all source files have UTF-8 set as their explicit file encodings, so handling should be completely automatic under Project Builder. Opening the source files in TextEdit or other editors may cause the copyright symbols to become corrupted if you do not explicitly open the files as UTF-8 encoding.

Sadly, this is the first version of MOKit that does not support Windows. MOKit 2.6 is for Mac OS X only.

As usual, the latest TextExtras (1.6) requires the latest MOKit (2.6).

MOKit 2.5

The only changes in this version are a couple bug fixes and a big speed boost for standardizing line endings. TextExtras 1.5 requires this version of MOKit.

MOKit 2.4

There are two main changes in 2.4.

- MOController is dead. Long live NSWindowController. MOController has been removed from the framework. If you depend on MOController, you may want to avoid upgrading until you get a chance to convert your code to use NSWindowController. The conversion is simple. I converted all the controllers in TextExtras to NSWindowController in a half hour. There are a couple main areas where you may have to watch out during the conversion. The way that you associate a controller with its nib is different. An NSWindowController is not automatically made its window's delegate. NSWindowController automatically takes ownership of (and responsibility for releasing) all top level objects in its nib so you shouldn't release them in your subclass' dealloc. You might want to look at the differences between TextExtras 1.3 and TextExtras 1.4 to see what sorts of things have to change in order to switch from MOController to NSWindowController.

- MORegularExpression changes: The compiled regular expression for each MORegularExpression is now cached. This increases memory usage a bit, but it makes doing many matches against the same regular expression loads faster. Also, Vivian Girel has contributed some extensions to the Henry Spencer regular expression package that MOKit uses which add some extended features from perl 5's regular expression matching syntax. See the regexp_stuff.h header in the framework for details on the new features.

MOKit 2.4 is built to run on Rhapsody/YellowBox For Windows Developer Release 2.

MOKit 2.3

MOKit 2.3 is pretty similar to 2.2. However, starting with version 2.3, MOKit is a Rhapsody/YellowBox framework. This doesn't mean much in terms of changes, but it does alter the binary distributions.

MOKit 2.3 is built to run on Rhapsody/YellowBox For Windows Developer Release 1.

There have been a couple tweaks here and there, but nothing really new.

MOKit 2.2

MOKit 2.2 has a few new classes, and removes one class.

I realized MOClassVariable is merely an NSDictionary with different API. Back in the old days of 3.x, having a MOClassVariable class made more sense since there was no NSDictionary and I never did like the old Hashtable APIs. I ported the class to OPENSTEP without really thinking. Well, I have thought about it now and the class is totally unneccessary. MOController now uses an NSDictionary directly. You should too, if you used to use MOClassVariable.

MOCompletionManager and MOCompletionStrategy provide a basic framework for implementing many different kinds of escape completion. These classes are useful for types of completion where there will be one or multiple possible completions and all the possible completions can be discovered quickly. The architecture kind of requires that all matches be discovered at once, so this is not really applicable where there might be multiple matches but it is either not possible or too expensive to figure them all out at once. One concrete strategy, MOFileCompletionStrategy, is provided which does regular file/path completion.

These classes are the result of some work I did on a Shell. I wanted to be able to have multiple types of completion that could all work at the same time. In addition to file completion, an advanced Shell usually wants to offer otyher types of completion such as wildcard completion, history completion, command completion, etc... Using this architecture it is possible to do this in a fairly clean way and to add new types of completion easily as they are implemented.

Finally, I have added some semi-useful category methods on various Foundation classes.

MOKit 2.1

MOKit 2.1 addresses a couple minor problems with MOKit 2.0. PLEASE NOTE: This version of MOKit will only build on OPENSTEP for Mach or Windows version 4.1! The compiled versions may or may not work on 4.0.

There is a workaround in MOController for an OPENSTEP for Mach bug affecting the way MOController finds nib files. The workaround is not that great. Basically, if you have MOController nib files that won't load on Mach, you can write a special default for each such nib file to help MOController find it. See the code for details.

The MORegularExpression class has a couple new methods also, and there is an additional subproject which contains a test tool for MORegularExpression based on the test suite provided in the regex code on which MORegularExpression is based.

MOKit 2.0

MOKit 2.0 is based on OPENSTEP. It will compile and run on both Windows and Mach. It does not include as many objects as 1.0, but they're better. They are also totally unsupported.

This version is packaged as a framework project. It builds into a shared library. There are few issues with this on Mach (see the ReadMe in the project).

Only a few classes are present. MOClassVariable implements a class variable that you can define once in a superclass, but which can take on different values for any subclasses. This class usually comes into its own when you are designing other reusable classes. Especially those that are meant to be subclassed. For instance, MOController uses this class internally.

MOController is a simple nib file controller object. It basically keeps track of loading a nib file and managing a window that comes out of it. It really must be subclassed to be useful, but it is good for either document situations or single instance situations. As simplistic as it is, I find this class one of the most useful. This functionality can be needed over and over again in different contexts even in a single application.

MORegularExpression encapsulates regular expression matching. The class is really a thin wrapper on top of Henry Spencer's implementation of the regex library routines. Instances represent immutable regular expressions that can be matched with strings and report on subexpression matches. This is a refinement from the MOKit 1.0 regular expression support. The expression itself is an object. Then the UI aspects are implemented separately in MORegexFormatter.

MORegexFormatter is an NSFormatter subclass which does validation and formatting based on regular expression matching. NSFormatters are cool. They can be used by any NSCell, or anybody else for that matter, to restrict and canonicalize text entry. This kind of formatter uses a set of regular expressions to validate input. The proposed value must match one of the expressions. There is a format string which can be used to reformat the value using the subexpression matches from the expression.

MOKit 2.0 also includes an InterfaceBuilder palette with a MORegexFormatter object on it. You can drop these onto NSTextFieldCells and NSFormCells in IB and a custom inspector lets you configure the regular expressions used for validating and the format string used for formatting.

MOKit 1.0

MOKit 1.0 is based on the NEXTSTEP 3.x API. It has quite a few objects. Many of the objects in this version have since been incorporated into MiscKit where they are (more) actively supported. I urge you to use MiscKit if possible instead of MOKit 1.0 since MOKit 1.0 is not being supported by anyone (least of all me). I am not going to describe what's in this version.


Releases are organized from the most recent to the oldest.

Recent releases are Disk Copy disk image files. After downloading, double-click the resulting file to mount it in Finder.

Source Code Binary Distribution
Mac OS X
MOKit 2.6 (for Mac OS X 1.0) smallFile Download smallFile Download

All files from releases below this point are tarred and gzipped.

Source Code Binary Distribution
Mac OS X Server Windows
MOKit 2.5 (for Mac OS X Server 1.1) smallFile Download smallFile Download smallFile Download
MOKit 2.4 (for Rhapsody DR2) smallFile Download smallFile Download smallFile Download
MOKit 2.3 (for Rhapsody DR1) smallFile Download smallFile Download smallFile Download

Source Code Binary Distribution
OPENSTEP Mach Windows
MOKit 2.2 (for OPENSTEP 4.2) smallFile Download smallFile Download smallFile Download
MOKit 2.1 (for OPENSTEP 4.1) smallFile Download smallFile Download smallFile Download
MOKit 2.0 (for OPENSTEP 4.0) smallFile Download smallFile Download smallFile Download

Source Code Binary Distribution
NeXTStep Windows
MOKit 1.0 (for NeXTStep 3.x) smallFile Download Not availableNot available

[Back to Free Stuff] - [Back to Mike's Home]

Mail Send mail to Mike Ferris