Coco-Actaro 作成記録
CoCo-Actaroは,アウトラインプロセッサ Acta のファイルを取り扱えるMac OS X上のアプリケーションです。Acta は Mac OS 用アウトラインプロセッサとしては大変有名です。かつては市販されていましたが,現在ではサボートなしという条件で無償で利用できるようになっています。しかし,Classicアプリケーションですのであまり安定していません。公開サイトではActaの文書ファイルフォーマットが公開されていますので,それを元にしてCocoaアプリケーションを作ってみることにしました。
Acta文書ファイルのフォーマットについて
この部分は,公開されている内容をまとめた覚え書きです。
Acta の文書ファイル(以下,Acta ファイルと呼ぶ)は,タイプか"OTLN",クリエータか"ACTA"のファイルである。
Acta ファイルは,データフォークしかない。データフォークの中に,トピックが順番に並んでいる。ファイルの最後にはワード(16ビット)の0が書き込まれている。
それぞれのトピックには,レベルがある。一番左に位置するのがレベル1,その娘トピックがレベル2という具合である。トピックの属性は,そのトピックの型と書式を識別できるデータが書き込まれている。データの前に,ロングワード(32ビット)でその長さが書き込まれている。データそのものは,テキスト(ただし Pascal 文字列ではない)または QuickDraw のピクチャーであり,パディングはされていない。
以上の話はディスク上のファイルについてであるが,クリップボード内のデータも同様の書式である。ただし,スクラップタイプは"ACTA"とされている。また,Acta はテキストタイプのスクラップデータを扱うこともある。
トピックの属性の定義を以下に示す:
struct TOPIC_ATTRIBUTES {
word bType;/* TEXTtype か PICTtypeか */
word bAttributes; /* 現在は0,ただし,optionWordビットを設定する場合を除く */
word bFont;/* タイプスタイル */
word bStyle;
word bSize;
byte bColor; /* カラーインデックス */
byte bExtra; /* 予約済み; 0 */
byte firstLine; /* 初めの一行だけの表示? */
byte expanded; /* YまたはN */
word hidden; /* このトピックが折り畳みによって隠れているか否か。数字は隠れている段数の深さを示す */
}
BType は 1 がテキストタイプ, 2 が QuickDraw ピクチャータイプを示す。
Other values are reserved for future use. BAttributes is currently unused and should be left 0, except that the bAttributes for the first topic is used to determine the options. BFont, bStyle, and bSize determine the typestyle of a topic, and have their usual QuickDraw interpretation. BColor is an index into a table of color values; 0 is black. BExtra is reserved and should be 0. FirstLine should be set to TRUE (-1) if the topic is shrunken, FALSE (0) otherwise. Expanded is TRUE if the daughters are visible, FALSE if they are hidden. If a topic is visible, hidden is 0, otherwise it is the number of collapsed ancestors. If bAttributes of the first topic is 0, the default options of alphabetic sort A-Z, no ancestress constraint, and outline current topic are used. You can choose different options by setting the following bits (all other bits should be left reset). These bits are ignored if set on topics other than the first. 0x0100 numeric sort 0x0001 Z-A sort 0x0002 single ancestress 0x0004 “smart quotes” 0x0020 don’t label pictures 0x0040 don’t outline current topic 0x0080 don’t put bullets in Clipboard In future releases, additional information (such as TextEdit ‘styl’ records) may be added. It will follow the zero word. This data can be ignored, as the above format will be used for backward compatibility.参考文献/サイト
- A-Sharp(Acta classicの公開)
Copyright(C) 2002by Kentaro Uono; All rights reserved.