The Commandant Project

Fast programming on Mac OS X.

Actual version: 0.1. Date : 15th june 2001.

What is it?
How to use it?
What's the fee?

What is it?

It is a project to allow implified programming of Cocoa applications on Mac OS X without any knowledge of Objective C or the Cocoa framework. Indeed, Cocoa is a very complete set of librairies, but it is dense. Apple's documentation is still incomplete, and doesn't always give short paths.

On the other hand, many engineers, researchers, etc., would like to make short programs with texts and/or graphics and a simplified user interface. they want to test assumptions, to make computations on a precise subject, etc. They don't intend to make commercial software with a very polished interface. They aim a fast result.

Here comes the Commandant Project. It creates for you a full featured Cocoa application, including one or many text or graphics windows. You just have to program the smart part, that which uses the text input to compute something, for instance.

You don't have to know Objective C or Cocoa to use the project. But you should know the C language, or one of its derivatives (C++ -- later on Java). The project declares a number of C functions, allowing you to change the text input/output, to draw or print in graphical windows. For instance, there is a function that prints a string on the text window, another one that opens a graphical window, another for drawing lines, shapes, etc. That's up to you to do something interesting with that!

The program you can create with this project are usually in the form "text input"/"text or graphical output". That means that the user will type some commands that you defined (hence the name of the project!). They are transmitted, as a char string argument, to a special function you have to implement. This function can interpret the commands and print or draw some results.

This is a very common behavior in the universitary domain or on older computers/OS'es (examples are: TeX, Maple, MatLab, SciLab, etc.).

How to use it?

You need a computer with Mac OS X 10.0.0 or later, PLUS the developer tools (given by Apple on a separate CD in the box of Mac OS X).

First download the Commandant project . After unstuffing, you will get a disk image with a folder named "Commandant". You should copy it somewhere (in your home directory, say).

Open that copied folder and double-click the file "Commandant.pbproj". This launches Project Builder, Mac OS X's programming environment. On the left side of the project window, you can see the list of files included.

Take a look on the files "CommandantText.h" and"CommandantGraphics.h". They contain all the declarations of the functions you can use from your C/C++/Objective-C files.

Let us make a first try. In Project Builder menus, choose "Build and Run". The program will be build and run ;-). A text window appears; try to type "uuors" for instance. Then the grapics window appears and display a small picture. The connection between this picture and the typed text is explained in another page. That's just a test program anyway.

To change this dummy small program, move or duplicate the file "testprogram.c" (you may rename it directly within Project Builder, using the appropriate command in the Project menu). Your program must implement at least one C function, named CMDuserAction (look its header in CommandantText.h). The first parameter it receives is a code number indicating which action has occured in th program: starting, opening new document, carriage-return, etc. You can safely ignore some codes (return 0), or react as you wish. Then take a look on the header files CommandantText.h and CommandantGraphics.h to see the description of the functions you can call.

What's the fee?

Nothing. The commandant Project is free, under the GNU public license.

History

18 june 2001. version 0.1. Restricted diffusion.


 

To the web site of the project. T. Lachand-Robert.