[SVN] r8201

Allan Odgaard throw-away-1 at macromates.com
Sun Sep 23 05:07:27 UTC 2007


Initial work for a rewrite of the Dialog plug-in.

This is presently a standalone app and a client that talks to it (since that makes development easier).

Not everything has been ported over from the existing Dialog plug-in and the current TMDCommand class is likely to change its signature. It needs to help in making reading/writing to the file descriptors from the client more natural and parsing the arguments given (probably it does make sense to make a replacement for getop_long, which I don’t really think is that useful with this «noun» «verb» command structure).

A short overview of the architecture:

The client creates named pipes (mkfifo) for stdin, out, and error. Then it passes these on to the server (together with an array of the arguments and the current working directory (for resolving potential relative paths)).

The client will poll the various file descriptors and make sure data arrives at the proper pipe.

When the server has closed the output pipes, the client will return. This means the server can “stall” the client simply by not closing the pipe (so we no longer need to use a semaphore for this).

The server receives info from the client and looks up the TMDCommand subclass to handle this info. That subclass is basically free to do whatever it want with it, and as mentioned above, it can decide to stall the client simply by not closing the pipes.

Changed:
A   trunk/Tools/Dialog 2/
A   trunk/Tools/Dialog 2/Comm.xcodeproj/
A   trunk/Tools/Dialog 2/Comm.xcodeproj/project.pbxproj
A   trunk/Tools/Dialog 2/Comm_Prefix.pch
A   trunk/Tools/Dialog 2/English.lproj/
A   trunk/Tools/Dialog 2/English.lproj/InfoPlist.strings
A   trunk/Tools/Dialog 2/English.lproj/MainMenu.nib/
A   trunk/Tools/Dialog 2/English.lproj/MainMenu.nib/designable.nib
A   trunk/Tools/Dialog 2/English.lproj/MainMenu.nib/keyedobjects.nib
A   trunk/Tools/Dialog 2/Info.plist
A   trunk/Tools/Dialog 2/src/
A   trunk/Tools/Dialog 2/src/Client/
A   trunk/Tools/Dialog 2/src/Client/client.mm
A   trunk/Tools/Dialog 2/src/Commands/
A   trunk/Tools/Dialog 2/src/Commands/alert.mm
A   trunk/Tools/Dialog 2/src/Commands/menu.mm
A   trunk/Tools/Dialog 2/src/Commands/quit.mm
A   trunk/Tools/Dialog 2/src/Commands/window.mm
A   trunk/Tools/Dialog 2/src/Dialog.h
A   trunk/Tools/Dialog 2/src/Server/
A   trunk/Tools/Dialog 2/src/TMDCommand.h
A   trunk/Tools/Dialog 2/src/TMDCommand.mm
A   trunk/Tools/Dialog 2/src/TestApp/
A   trunk/Tools/Dialog 2/src/TestApp/AppDelegate.h
A   trunk/Tools/Dialog 2/src/TestApp/AppDelegate.mm
A   trunk/Tools/Dialog 2/src/TestApp/main.m



More information about the textmate-dev mailing list