+
さらに
+
+
qemu で TLB base で動かす
+
interpreter base の Emualtor ではなく、compile base にする
+
nitros-9 のソースコードのコメントを増やす
+
まぁ、あんまりやりすぎないように
+
+
diff -r d8feb607c44e -r 7fd82a802a66 poster/os9/os9.ind
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/poster/os9/os9.ind Fri Apr 19 18:23:10 2019 +0900
@@ -0,0 +1,251 @@
+-title: OS9
+
+-author: 河野真治
+
+--OS-9 の特徴
+
+Microware 社によりMotorola のMC6809用に作られた 8bit OS。
+
+ Module と言う単位をメモリ上にどこに配置しても良い
+ Time sharing を採用した並列実行(concurrent) (平行(parallel)ではない)
+ Unix like なshell とpipe
+ Unified file system ( Device descriptor, Device driver)
+ Floppy disk 128k 階層型ファイルシステム
+ Basic09 というPascal likeな言語を持つ。
+
+
+--MC6809
+
+
+
+
+--Level 1/2
+
+level 1 ROM上のOS9 p1 kernel で動作する。
+level 1 MMUで2Mbyteのメモリを使える
+
+-- Module
+
+ 87CD から始まり、CRC24 で検証されたコードとデータの固まり
+ Relocatable
+ entry point とモードフラグ
+
+ROMに常駐できる
+
+8bitなのでメモリ空間は64k(16bit addressing)
+
+8080/6809 は 8bit CPUというよりは、8bit busな16bit CPU
+
+--何をするか
+
+Emulator 上で OS-9 を動かそう。
+
+ できれば Level 2
+
+
+--なんで?
+
+昔、自作のに乗っけれなかった。せっかく5万円も出して買ったのに。
+
+残念ながらハードはもうないけど、Emulator なら?
+
+20年前に「年取ったらやろう」と思っていたが、そろそろやるべき。
+
+
+--level 2
+
+ アドレス変換に対応し、512kメモリを使用できる。
+ ユーザ空間とシステム空間を別にできる
+
+8k単位で16task*64k分を512kから自由に割り振れる
+
+TLB base ではなく、変換機構をメモリで実装する方式
+
+--kernel構成
+
+OS9p1
+ system callと割り込み処理
+ Module 発見と管理
+
+OS9p2
+ メモリ管理
+ Task管理
+ Signal
+
+--kernel構成2
+
+IOMan
+ SCF/RBFと device driver とdescriptor の登録
+
+SCF
+ sequencial file io manager
+
+RBF
+ randome block file io manager
+ file system管理
+
+--Runtime module
+
+init
+ boot用初期データ
+
+sysgo
+ clockとShellの起動
+
+Clock
+ timer 割り込み
+ 日付計算
+
+--Runtime module 2
+
+Shell
+
+Device descriptor
+ D0
+ Term
+
+Device driver
+ PTY
+ PDisk
+
+--nitros9
+
+OS9 をdisassemble したものらしい
+
+Tandy Coco 上で動いていたらしい
+
+ライセンス的にはだめかも
+
+大目に見られてる?
+
+--Emulator
+
+sbc09というアセンブラEmulator上に実装して動作させた
+
+Java版を作った人がいるらしい
+
+Unix上のOS9 emulator があるが動作せず
+
+osnineという途中まで作られたものがあった
+
+level 2 まで動かす?
+
+--利点と欠点
+
+初期の8bit用のUnix like OS
+
+8bitのOSでMMUを持つものとしては唯一 (M/PMもあったが)
+
+comapct で信頼できるmodule構成
+
+CRCの意味は不明
+
+メモリ領域はmodule構成ではない
+
+--利点と欠点 2
+
+PICのせいもあり、比較的低速
+
+real-time scheduling を持ってない
+
+プロセス間通信は貧弱 (signal のみ)
+
+68K用などは現在も生きてる製品
+
+--level 2
+
+sbc09 を mmu 対応にして level 2 まで動かした。
+
+nitros9 という「まだメンテされている(〜2014)」ソースに対応した。
+
+Coco (tandy color computer)
+
+ 0xfe00-0xffff は MMU による影響を受けない
+ ROM切り替えで、2MBのfull ramとして使える
+
+--vrbf
+
+仮想RBF (random block filer manager )
+
+ Unix 上のファイルを Emulator 側からos9のファイルシステムとして見せる
+
+os9はopen されたファイルを path descriptor というioman が管理するデータ構造で実装する。それに対応する
+構造体を vrbf 内で用意する。256個と決まっているので固定配列で良い。そこに FILE *を置けばよい。
+
+os9はディレクトリを普通のファイルとして開いてしまうので、os9のディレクトリ構造を作って返す。
+
+ fmemopen というメモリ上のバッファを FILE* として開く機能を使う
+
+--vrbf 続き
+
+dir -e はファイルの属性を持つ特別なsector (file descriptor)を getstat のundocumented commandを
+使ってアクセスするので、それを返す必要がある。
+
+os9は current directory をLSN( 24bit logical sector number)で持つが、面倒なので、current directory 名を256個のFIFOっで管理。
+同じ名前は再利用。
+
+path descriptor でcurrent directoryを管理してくれれば良いのだが、そうでなくて、LSN。しかも、path descriptor と別。なので、
+別に管理する必要がある。
+
+--level2 での割り込み
+
+時分割処理に必要な clock module は割り込みを行う。
+
+割り込み時には、どのmmuにいるかわからない。なので、
+
+ os9にentry割り込みルーチンを登録する
+ os9 が割り込み後mmuを設定してentry割り込みルーチンを呼び出す
+ engry割り込みルーチンで、serviceタスクを SSvcIRQに登録して jmp [D.XIRQ]
+ すると iret してくれる
+ os9 側が暇な時に、serviceタスクをsystem mode で呼び出す
+ service は処理の後、task 切り替えをする用に jmp [>D.Clock] する
+
+
+
+--level2 のoverhead
+
+vrbf はサービスするprocessとは別なシステムメモリ空間にいるので、データは copy sysetm callを使う必要がある。
+
+vrbf のC側からはos9のsystem callを呼べないので、mmu を一時的に作って、それを使ってアクセス。mmuの情報はprocess descriptor 上にある。
+
+call するプロセスのレジスタはsystem spaceにコピーされていて、そこに値を書き込むと返される。
+
+hook がたくさんあり、indirect jump ばっかりが増える。
+
+Coco ではIOは全部のプロセスに見えてしまってる。特に保護されてない。
+
+--module 間のlink
+
+os9 のlinkは、system に登録されるだけ。同じメモリ空間に登録されるとは限らない。
+
+同じ空間に登録されれば、module にアクセスできる。
+
+module に付属している固定メモリはある
+
+malloc されたものは自由に取り扱えるが、どこにあるかはprocess毎に異なる
+
+--OS-9 上のソフト
+
+ BASIC09
+ FORTH
+ BASIC
+ GAME09
+
+--Micro C
+
+mohta氏と手塚氏の作った 6809 用の整数Cコンパイラ。構造体がある。
+
+ かなり動いているんですが...
+
+--さらに
+
+qemu で TLB base で動かす
+
+interpreter base の Emualtor ではなく、compile base にする
+
+nitros-9 のソースコードのコメントを増やす
+
+ まぁ、あんまりやりすぎないように
+
+
+
diff -r d8feb607c44e -r 7fd82a802a66 poster/os9/os9s.css
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/poster/os9/os9s.css Fri Apr 19 18:23:10 2019 +0900
@@ -0,0 +1,96 @@
+
+@import url(ui/s6/projection.css); /* required to make the slide show run at all */
+
+body { font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; }
+
+a:link, a:visited { color: black; }
+
+.slide h1 { font-size: 30pt; }
+
+.slide h1 { text-align: center; }
+
+.slide h1.fullscreen { position: absolute;
+ top: 40%;
+ width: 100%; }
+
+/* lets you create slides with no heading (because heading is hidden but gets included in toc) */
+.slide h1.hidden { display: none; }
+
+
+.slide h2 { font-size: 28pt; }
+
+h3 { font-size: 25pt; }
+
+/* todo: add special formating for .cover slide
+ lets you use h1(cover). for title/cover slide (a la S5 slide0) but more generic (not bound to 1st slide)
+*/
+
+.cover h1 { /* tbd */ }
+.cover h2 { /* tbd */ }
+
+/* todo: add special formating for h1, h2 in footer */
+
+#footer h1 { /* tbd */ }
+#footer h2 { /* tbd */ }
+
+
+p, li, dt, dd, td, th { font-size: 18pt; }
+
+ul { list-style-type: square; }
+
+/**********************************/
+/* general text-alignment classes */
+
+.left { text-align: left; }
+.center { text-align: center; }
+.right { text-align: right; }
+
+/**********************************/
+/* general font-size classes */
+
+.small { font-size: 97%; }
+
+.x-small,
+.smaller { font-size: 88%; }
+
+.xx-small,
+.smallest,
+.tiny { font-size: 82%; }
+
+
+
+pre { font-size: 16pt; }
+
+.code {
+ background-color: azure;
+ padding: 5px;
+ }
+
+.footnote a:first-of-type { text-decoration: none; }
+
+
+p.small { font-size: 97%; }
+
+p.x-small,
+p.smaller,
+p.footnote { font-size: 88%; }
+
+p.xx-small,
+p.smallest,
+p.tiny { font-size: 82%; }
+
+
+.help p,
+.help td { font-size: 88%; }
+
+
+.step { color: silver; }
+/* or hide next steps e.g. .step { visibility: hidden; } */
+.stepcurrent { color: black; }
+
+
+
+table#ajax { width: 100%; }
+
+table#ajax td { text-align: center; }
+
diff -r d8feb607c44e -r 7fd82a802a66 poster/os9/os9s.html
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/poster/os9/os9s.html Fri Apr 19 18:23:10 2019 +0900
@@ -0,0 +1,427 @@
+
+
+
+
+
+
OS9/GAME09/FORTH/TL1
+
+
+
+
OS9/GAME09/FORTH/TL1
+
+Menu
+
+
+Menu
+
+
+
+
+ 河野真治
+
+
+
+Microware 社によりMotorola のMC6809用に作られた 8bit OS。1980年初頭。
+
+
+
+ Module と言う単位をメモリ上にどこに配置しても良い
+ Time sharing を採用した並列実行(concurrent) (平行(parallel)ではない)
+ Unix like なshell とpipe
+ Basic09 というPascal likeな言語を持つ。
+
+
+
+
+
+
+
+
+
+
+
+
+level 1 ROM上のOS9 p1 kernel で動作する。
+
+level 2 MMUで2Mbyteのメモリを使える
+
+ アドレス変換に対応し、512kメモリを使用できる。
+
+
+
+
+
+
+
+Emulator 上で OS-9 を動かそう。
+
+
+
+ できれば Level 2
+
+
+なんで?
+
+昔、自作のに乗っけれなかった。せっかく5万円も出して買ったのに。
+
+残念ながらハードはもうないけど、Emulator なら?
+
+20年前に「年取ったらやろう」と思っていたが、そろそろやるべき。
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+OS9p1
+
+ system callと割り込み処理
+ Module 発見と管理
+
+
+OS9p2
+
+ メモリ管理
+ Task管理
+ Signal
+
+
+
+
+
+
+
+IOMan
+
+ SCF/RBFと device driver とdescriptor の登録
+
+
+SCF
+
+ sequencial file io manager
+
+
+RBF
+
+ randome block file io manager
+ file system管理
+
+
+
+
+
+
+
+init
+
+ boot用初期データ
+
+
+sysgo
+
+ clockとShellの起動
+
+
+Clock
+
+ timer 割り込み
+ 日付計算
+
+
+
+
+
+
+
+Shell
+
+Device descriptor
+
+ D0
+ Term
+
+
+Device driver
+
+ PTY
+ PDisk
+
+
+
+
+
+
+
+OS9 をdisassemble したものらしい
+
+Tandy Coco 上で動いていたらしい
+
+ライセンス的にはだめかも
+
+大目に見られてる?
+
+
+
+
+sbc09というアセンブラEmulator上に実装して動作させた
+
+sbc09 を mmu 対応にして level 2 まで動かした。
+
+仮想RBF (random block filer manager )
+
+
+
+ Unix 上のファイルを Emulator 側からos9のファイルシステムとして見せる
+
+
+
+
+
+
+
+
+
+ BASIC09
+ FORTH
+ BASIC
+ GAME09
+ TL/1
+
+
+
+
+
+
+
+PostScript の元になった言語
+
+関数単位
+
+
+
+ assembler を自分でかける
+ : ACCEPT-TEST
+ CR ." PLEASE TYPE UP TO 80 CHARACTERS:" CR
+ ABUF 80 ACCEPT
+ CR ." RECEIVED: " [CHAR] " EMIT
+ ABUF SWAP TYPE [CHAR] " EMIT CR
+
+
+
+
+
+
+
+VTLの日本での実装
+
+記号的なBASIC
+
+コンパイラとかが書かれた
+
+
+
+ 100 "ADDRESS=" A=?
+ 110 "TO =" D=? @ !=900
+ 120 @=(A>D) #=-1
+ 900 / ??=A .=20 E=A !=1000
+ 910 $=$D .=5 B=0,5 ;=E+B>=A .=3 #=930
+ 920 ?$=E:B) " "
+
+
+割とダメ。行番号なしの rvtl というのがある。
+
+
+
+
+mohta氏と手塚氏の作った 6809 用の整数Cコンパイラ。構造体がある。
+
+
+
+ 04D7: * getchar()
+ 04D7: * { return getc(stdin);
+ 04D7: getchar
+ 04D7: 3440 PSHS U
+ 04D9: 33E4 LEAU ,S
+ 04DB: EC20 LDD 0,Y
+ 04DD: 3406 PSHS D
+ 04DF: 17FFB7 LBSR getc
+ 04E2: 3262 LEAS 2,S
+ 04E4: * }
+ 04E4: 35C0 PULS U,PC
+
+
+これを CbC にしたものがある。
+
+
+
+
+大西氏のコンパイラ言語、データ型はByteとByte Arrayのみ。手続きと関数がある。
+
+
+
+ PROC WAIT
+ FUNC TIME
+ %--- MAIN ---
+ VAR MMI,MMJ,MMK
+ BEGIN
+ WRITE(1:ASCII($A))
+ MMI:=1 MMJ:=2 MMK:=3
+ WAIT(4,5)
+ WRITE(1:MMI,CRLF)
+ END
+ %-- PROCEDURE WAIT --
+ WAIT(WWA,WWB)
+ VAR WWJ,WWK
+ BEGIN
+ WWJ:=4
+ WWK:=TIME(6,7)
+ WRITE(1:MMI,WWJ,WWA,WWB,WWK,CRLF)
+ END
+
+
+型がないのは現代的な気がする
+
+
+
+
+
+
+ 020B: 9F 16 STX <$16
+ 020D: 30 C9 01 C2 LEAX +$01C2,U
+ 0211: 86 01 LDA #$01
+ 0213: A7 00 STA +$00,X Mainの大域変数
+ 0215: 86 02 LDA #$02 =局所変数
+ 0217: A7 01 STA +$01,X
+ 0219: 86 03 LDA #$03
+ 021B: A7 02 STA +$02,X
+ 021D: 86 04 LDA #$04
+ 021F: A7 03 STA +$03,X
+ 0221: 86 05 LDA #$05
+ 0223: A7 04 STA +$04,X
+ 0225: 86 03 LDA #$03
+ 0227: 17 00 0F LBSR $0239
+ 022A: 86 01 LDA #$01
+ 022C: 97 01 STA <$01
+ 022E: A6 00 LDA +$00,X
+ 0230: 17 FE 3A LBSR $006D
+ 0233: 17 FE C6 LBSR $00FC
+ 0236: 16 FE D6 LBRA $010F
+ 0239: AF E3 STX ,--S
+ 023B: 30 86 LEAX A,X 呼出側の局所変数の確保
+ 023D: 86 04 LDA #$04
+ 023F: A7 02 STA +$02,X
+ 0241: 86 06 LDA #$06
+ 0243: A7 04 STA +$04,X 局所変数
+ 0245: 86 07 LDA #$07
+ 0247: A7 05 STA +$05,X
+ 0249: 86 04 LDA #$04
+ 024B: 17 00 24 LBSR $0272
+ 024E: A7 03 STA +$03,X
+ 0250: 86 01 LDA #$01
+ 0252: 97 01 STA <$01
+ 0254: A6 20 LDA +$00,Y 大域変数
+ 0256: 17 FE 14 LBSR $006D
+ 0259: A6 02 LDA +$02,X 呼び出した方の引数
+ 025B: 17 FE 0F LBSR $006D
+ 025E: A6 00 LDA +$00,X
+ 0260: 17 FE 0A LBSR $006D
+ 0263: A6 01 LDA +$01,X
+ 0265: 17 FE 05 LBSR $006D
+ 0268: A6 03 LDA +$03,X
+ 026A: 17 FE 00 LBSR $006D
+ 026D: 17 FE 8C LBSR $00FC
+ 0270: 35 90 PULS PC,X
+
+
+
+
+
+
+
+module は Code Gear 。Data Gear を導入する。
+
+OS 自体を module 構成にする
+
+module を memory に mapping する
+
+module 間の通信
+
+module の生態系 (version 管理 )
+
+
+
+ 動く module の version の組合せ
+
+
+TL/1 言語はシンプルに
+
+型はメタレベルで付ける
+
+大きなデータは write などの通信で行う
+
+
+
+
+qemu で TLB base で動かす
+
+interpreter base の Emualtor ではなく、compile base にする
+
+nitros-9 のソースコードのコメントを増やす
+
+ まぁ、あんまりやりすぎないように
+
+
+
+
+
河野真治 / Tue Apr 16 16:57:59 2019
+
diff -r d8feb607c44e -r 7fd82a802a66 poster/os9/os9s.ind
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/poster/os9/os9s.ind Fri Apr 19 18:23:10 2019 +0900
@@ -0,0 +1,278 @@
+-title: OS9/GAME09/FORTH/TL1
+
+-author: 河野真治
+
+--OS-9 の特徴
+
+Microware 社によりMotorola のMC6809用に作られた 8bit OS。1980年初頭。
+
+ Module と言う単位をメモリ上にどこに配置しても良い
+ Time sharing を採用した並列実行(concurrent) (平行(parallel)ではない)
+ Unix like なshell とpipe
+ Basic09 というPascal likeな言語を持つ。
+
+--MC6809
+
+
+
+
+--Level 1/2
+
+level 1 ROM上のOS9 p1 kernel で動作する。
+
+level 2 MMUで2Mbyteのメモリを使える
+ アドレス変換に対応し、512kメモリを使用できる。
+
+--何をするか
+
+Emulator 上で OS-9 を動かそう。
+
+ できれば Level 2
+
+なんで?
+
+昔、自作のに乗っけれなかった。せっかく5万円も出して買ったのに。
+
+残念ながらハードはもうないけど、Emulator なら?
+
+20年前に「年取ったらやろう」と思っていたが、そろそろやるべき。
+
+--OS9 with MMU
+
+
+
+--kernel構成
+
+
+
+--kernel構成
+
+OS9p1
+ system callと割り込み処理
+ Module 発見と管理
+
+OS9p2
+ メモリ管理
+ Task管理
+ Signal
+
+--kernel構成2
+
+IOMan
+ SCF/RBFと device driver とdescriptor の登録
+
+SCF
+ sequencial file io manager
+
+RBF
+ randome block file io manager
+ file system管理
+
+--Runtime module
+
+init
+ boot用初期データ
+
+sysgo
+ clockとShellの起動
+
+Clock
+ timer 割り込み
+ 日付計算
+
+--Runtime module 2
+
+Shell
+
+Device descriptor
+ D0
+ Term
+
+Device driver
+ PTY
+ PDisk
+
+--nitros9
+
+OS9 をdisassemble したものらしい
+
+Tandy Coco 上で動いていたらしい
+
+ライセンス的にはだめかも
+
+大目に見られてる?
+
+--Emulator
+
+sbc09というアセンブラEmulator上に実装して動作させた
+
+sbc09 を mmu 対応にして level 2 まで動かした。
+
+仮想RBF (random block filer manager )
+
+ Unix 上のファイルを Emulator 側からos9のファイルシステムとして見せる
+
+--OS-9 上のソフト
+
+ BASIC09
+ FORTH
+ BASIC
+ GAME09
+ TL/1
+
+--FORTH
+
+PostScript の元になった言語
+
+関数単位
+
+ assembler を自分でかける
+
+ : ACCEPT-TEST
+ CR ." PLEASE TYPE UP TO 80 CHARACTERS:" CR
+ ABUF 80 ACCEPT
+ CR ." RECEIVED: " [CHAR] " EMIT
+ ABUF SWAP TYPE [CHAR] " EMIT CR
+
+
+--GAME09
+
+VTLの日本での実装
+
+記号的なBASIC
+
+コンパイラとかが書かれた
+
+ 100 "ADDRESS=" A=?
+ 110 "TO =" D=? @ !=900
+ 120 @=(A>D) #=-1
+ 900 / ??=A .=20 E=A !=1000
+ 910 $=$D .=5 B=0,5 ;=E+B>=A .=3 #=930
+ 920 ?$=E:B) " "
+
+割とダメ。行番号なしの rvtl というのがある。
+
+--Micro C
+
+mohta氏と手塚氏の作った 6809 用の整数Cコンパイラ。構造体がある。
+
+ 04D7: * getchar()
+ 04D7: * { return getc(stdin);
+ 04D7: getchar
+ 04D7: 3440 PSHS U
+ 04D9: 33E4 LEAU ,S
+ 04DB: EC20 LDD 0,Y
+ 04DD: 3406 PSHS D
+ 04DF: 17FFB7 LBSR getc
+ 04E2: 3262 LEAS 2,S
+ 04E4: * }
+ 04E4: 35C0 PULS U,PC
+
+これを CbC にしたものがある。
+
+--TL/1
+
+大西氏のコンパイラ言語、データ型はByteとByte Arrayのみ。手続きと関数がある。
+
+ PROC WAIT
+ FUNC TIME
+ %--- MAIN ---
+ VAR MMI,MMJ,MMK
+ BEGIN
+ WRITE(1:ASCII($A))
+ MMI:=1 MMJ:=2 MMK:=3
+ WAIT(4,5)
+ WRITE(1:MMI,CRLF)
+ END
+ %-- PROCEDURE WAIT --
+ WAIT(WWA,WWB)
+ VAR WWJ,WWK
+ BEGIN
+ WWJ:=4
+ WWK:=TIME(6,7)
+ WRITE(1:MMI,WWJ,WWA,WWB,WWK,CRLF)
+ END
+
+型がないのは現代的な気がする
+
+--TL/1のオブジェクト
+
+ 020B: 9F 16 STX <$16
+ 020D: 30 C9 01 C2 LEAX +$01C2,U
+ 0211: 86 01 LDA #$01
+ 0213: A7 00 STA +$00,X Mainの大域変数
+ 0215: 86 02 LDA #$02 =局所変数
+ 0217: A7 01 STA +$01,X
+ 0219: 86 03 LDA #$03
+ 021B: A7 02 STA +$02,X
+ 021D: 86 04 LDA #$04
+ 021F: A7 03 STA +$03,X
+ 0221: 86 05 LDA #$05
+ 0223: A7 04 STA +$04,X
+ 0225: 86 03 LDA #$03
+ 0227: 17 00 0F LBSR $0239
+ 022A: 86 01 LDA #$01
+ 022C: 97 01 STA <$01
+ 022E: A6 00 LDA +$00,X
+ 0230: 17 FE 3A LBSR $006D
+ 0233: 17 FE C6 LBSR $00FC
+ 0236: 16 FE D6 LBRA $010F
+ 0239: AF E3 STX ,--S
+ 023B: 30 86 LEAX A,X 呼出側の局所変数の確保
+ 023D: 86 04 LDA #$04
+ 023F: A7 02 STA +$02,X
+ 0241: 86 06 LDA #$06
+ 0243: A7 04 STA +$04,X 局所変数
+ 0245: 86 07 LDA #$07
+ 0247: A7 05 STA +$05,X
+ 0249: 86 04 LDA #$04
+ 024B: 17 00 24 LBSR $0272
+ 024E: A7 03 STA +$03,X
+ 0250: 86 01 LDA #$01
+ 0252: 97 01 STA <$01
+ 0254: A6 20 LDA +$00,Y 大域変数
+ 0256: 17 FE 14 LBSR $006D
+ 0259: A6 02 LDA +$02,X 呼び出した方の引数
+ 025B: 17 FE 0F LBSR $006D
+ 025E: A6 00 LDA +$00,X
+ 0260: 17 FE 0A LBSR $006D
+ 0263: A6 01 LDA +$01,X
+ 0265: 17 FE 05 LBSR $006D
+ 0268: A6 03 LDA +$03,X
+ 026A: 17 FE 00 LBSR $006D
+ 026D: 17 FE 8C LBSR $00FC
+ 0270: 35 90 PULS PC,X
+
+--Gears OS の参考になる?
+
+module は Code Gear 。Data Gear を導入する。
+
+OS 自体を module 構成にする
+
+module を memory に mapping する
+
+module 間の通信
+
+module の生態系 (version 管理 )
+
+ 動く module の version の組合せ
+
+TL/1 言語はシンプルに
+
+型はメタレベルで付ける
+
+大きなデータは write などの通信で行う
+
+
+--さらに
+
+qemu で TLB base で動かす
+
+interpreter base の Emualtor ではなく、compile base にする
+
+nitros-9 のソースコードのコメントを増やす
+
+ まぁ、あんまりやりすぎないように
+
+
+
diff -r d8feb607c44e -r 7fd82a802a66 poster/os9/ui/bg-shade.png
Binary file poster/os9/ui/bg-shade.png has changed
diff -r d8feb607c44e -r 7fd82a802a66 poster/os9/ui/blume.jpg
Binary file poster/os9/ui/blume.jpg has changed
diff -r d8feb607c44e -r 7fd82a802a66 poster/os9/ui/blumerechts.jpg
Binary file poster/os9/ui/blumerechts.jpg has changed
diff -r d8feb607c44e -r 7fd82a802a66 poster/os9/ui/core/framing.css
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/poster/os9/ui/core/framing.css Fri Apr 19 18:23:10 2019 +0900
@@ -0,0 +1,22 @@
+/* The following styles size, place, and layer the slide components.
+ Edit these if you want to change the overall slide layout.
+ The commented lines can be uncommented (and modified, if necessary)
+ to help you with the rearrangement process. */
+
+/* target = 1024x768 */
+
+div#header, div#footer, .slide {width: 100%; top: 0; left: 0;}
+div#header {top: 0; height: 2em; z-index: 1;}
+div#footer {top: auto; bottom: 0; height: 2.5em; z-index: 5;}
+.slide {top: 0; width: 92%; padding: 2.5em 4% 4% 1em; z-index: 2; list-style: none;}
+div#controls {left: 50%; bottom: 0; width: 50%; z-index: 100;}
+div#controls form {text-align: right; width: 100%; margin: 0;}
+#currentSlide {position: absolute; width: 10%; left: 45%; bottom: 1em; z-index: 10;}
+html>body #currentSlide {position: fixed;}
+
+/*
+div#header {background: #FCC;}
+div#footer {background: #CCF;}
+div#controls {background: #BBD;}
+div#currentSlide {background: #FFC;}
+*/
diff -r d8feb607c44e -r 7fd82a802a66 poster/os9/ui/core/math.css
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/poster/os9/ui/core/math.css Fri Apr 19 18:23:10 2019 +0900
@@ -0,0 +1,79 @@
+merror {display:inline;font-size:1em;}
+math[display=block] {overflow:auto;}
+math { white-space: nowrap }
+.maruku-eq-number {float:right}
+.blockquotesource {margin-left:1em;}
+table.plaintable {
+ border-collapse:collapse;
+ margin-left:30px;
+ border:0;
+}
+.plaintable td {border:1px solid #000; padding: 3px;}
+.plaintable th {padding: 3px;}
+.plaintable caption {
+ font-weight: bold;
+ font-size:1.1em;
+ text-align:center;
+ margin-left:30px;
+}
+.noborder td, .noborder th {border:0}
+body {counter-reset: theorem lemma proposition corollary definition example remark note}
+.un_theorem *, .num_theorem *,
+.un_lemma *, .num_lemma *,
+.un_prop *, .num_prop *,
+.un_cor *, .num_cor * {font-style: italic}
+span.theorem_label {font-style:normal; font-weight:bold;}
+.proof span.theorem_label {font-style:italic;}
+.num_theorem .theorem_label:after {
+ content: " " counter(theorem); counter-increment: theorem;}
+.num_lemma .theorem_label:after {
+ content: " " counter(lemma); counter-increment: lemma;}
+.num_prop .theorem_label:after {
+ content: " " counter(proposition); counter-increment: proposition;}
+.num_cor .theorem_label:after {
+ content: " " counter(corollary); counter-increment: corollary;}
+.num_defn .theorem_label:after {
+ content: " " counter(definition); counter-increment: definition;}
+.num_example .theorem_label:after {
+ content: " " counter(example); counter-increment: example;}
+.num_remark .theorem_label:after {
+ content: " " counter(remark); counter-increment: remark;}
+.num_note .theorem_label:after {
+ content: " " counter(note); counter-increment: note;}
+
+/* Hack for Mozilla bug 449396 */
+[mathvariant="bold"] * {
+ font-style: normal;
+ font-variant: normal;
+ font-weight: bold;
+}
+[mathvariant="italic"] * {
+ font-style: italic;
+ font-variant: normal;
+ font-weight: normal;
+}
+[mathvariant="bold-italic"] * {
+ font-style: italic;
+ font-variant: normal;
+ font-weight: bold;
+}
+[mathvariant="sans-serif"] * {
+ font-style: normal;
+ font-variant: normal;
+ font-weight: normal;
+}
+[mathvariant="bold-sans-serif"] * {
+ font-style: normal;
+ font-variant: normal;
+ font-weight: bold;
+}
+[mathvariant="sans-serif-italic"] * {
+ font-style: italic;
+ font-variant: normal;
+ font-weight: normal;
+}
+[mathvariant="sans-serif-bold-italic"] * {
+ font-style: italic;
+ font-variant: normal;
+ font-weight: bold;
+}
\ No newline at end of file
diff -r d8feb607c44e -r 7fd82a802a66 poster/os9/ui/core/opera.css
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/poster/os9/ui/core/opera.css Fri Apr 19 18:23:10 2019 +0900
@@ -0,0 +1,7 @@
+/* DO NOT CHANGE THESE unless you really want to break Opera Show */
+.slide {
+ visibility: visible !important;
+ position: static !important;
+ page-break-before: always;
+}
+#slide0 {page-break-before: avoid;}
diff -r d8feb607c44e -r 7fd82a802a66 poster/os9/ui/core/outline.css
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/poster/os9/ui/core/outline.css Fri Apr 19 18:23:10 2019 +0900
@@ -0,0 +1,15 @@
+/* don't change this unless you want the layout stuff to show up in the outline view! */
+
+.layout div, #footer *, #controlForm * {display: none;}
+#footer, #controls, #controlForm, #navLinks, #toggle {
+ display: block; visibility: visible; margin: 0; padding: 0;}
+#toggle {float: right; padding: 0.5em;}
+html>body #toggle {position: fixed; top: 0; right: 0;}
+
+/* making the outline look pretty-ish */
+
+#slide0 h1, #slide0 h2, #slide0 h3, #slide0 h4 {border: none; margin: 0;}
+#slide0 h1 {padding-top: 1.5em;}
+.slide h1 {margin: 1.5em 0 0; padding-top: 0.25em;
+ border-top: 1px solid #888; border-bottom: 1px solid #AAA;}
+#toggle {border: 1px solid; border-width: 0 0 1px 1px; background: #FFF;}
diff -r d8feb607c44e -r 7fd82a802a66 poster/os9/ui/core/print.css
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/poster/os9/ui/core/print.css Fri Apr 19 18:23:10 2019 +0900
@@ -0,0 +1,1 @@
+/* The following rule is necessary to have all slides appear in print! DO NOT REMOVE IT! */
.slide, ul {page-break-inside: avoid; visibility: visible !important;}
h1 {page-break-after: avoid;}
body {font-size: 12pt; background: white;}
* {color: black;}
#slide0 h1 {font-size: 200%; border: none; margin: 0.5em 0 0.25em;}
#slide0 h3 {margin: 0; padding: 0;}
#slide0 h4 {margin: 0 0 0.5em; padding: 0;}
#slide0 {margin-bottom: 3em;}
h1 {border-top: 2pt solid gray; border-bottom: 1px dotted silver;}
.extra {background: transparent !important;}
div.extra, pre.extra, .example {font-size: 10pt; color: #333;}
ul.extra a {font-weight: bold;}
p.example {display: none;}
#header {display: none;}
#footer h1 {margin: 0; border-bottom: 1px solid; color: gray; font-style: italic;}
#footer h2, #controls {display: none;}
/* The following rule keeps the layout stuff out of print. Remove at your own risk! */
.layout, .layout * {display: none !important;}
\ No newline at end of file
diff -r d8feb607c44e -r 7fd82a802a66 poster/os9/ui/core/s5-core.css
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/poster/os9/ui/core/s5-core.css Fri Apr 19 18:23:10 2019 +0900
@@ -0,0 +1,9 @@
+/* Do not edit or override these styles! The system will likely break if you do. */
+
+div#header, div#footer, div#controls, .slide {position: absolute;}
+html>body div#header, html>body div#footer,
+ html>body div#controls, html>body .slide {position: fixed;}
+.handout, .notes {display: none;}
+.layout {display: block;}
+.slide, .hideme, .incremental {visibility: hidden;}
+#slide0 {visibility: visible;}
diff -r d8feb607c44e -r 7fd82a802a66 poster/os9/ui/core/slides.js
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/poster/os9/ui/core/slides.js Fri Apr 19 18:23:10 2019 +0900
@@ -0,0 +1,856 @@
+// S5 v1.2a2 slides.js -- released into the Public Domain
+// Many modifications by Jacques Distler to allow operation as real XHTML.
+//
+// Please see http://www.meyerweb.com/eric/tools/s5/credits.html for information
+// about all the wonderful and talented contributors to this code!
+
+var undef;
+var slideCSS = '';
+var snum = 0;
+var smax = 1;
+var incpos = 0;
+var number = undef;
+var s5mode = true;
+var defaultView = 'slideshow';
+var controlVis = 'visible';
+
+var s5NotesWindow;
+var s5NotesWindowLoaded = false;
+var previousSlide = 0;
+var presentationStart = new Date();
+var slideStart = new Date();
+
+var countdown = {
+ timer: 0,
+ state: 'pause',
+ start: new Date(),
+ end: 0,
+ remaining: 0
+};
+
+
+var isIE = navigator.appName == 'Microsoft Internet Explorer' && navigator.userAgent.indexOf('Opera') < 1 ? 1 : 0;
+var isOp = navigator.userAgent.indexOf('Opera') > -1 ? 1 : 0;
+var isSa = navigator.userAgent.indexOf('Safari') > -1 ? 1 : 0;
+var isGe = navigator.userAgent.indexOf('Gecko') > -1 && navigator.userAgent.indexOf('Safari') < 1 ? 1 : 0;
+
+function hasClass(object, className) {
+ if (!object.className ||!object.getAttribute('class')) return false;
+ return (object.getAttribute('class').search('(^|\\s)' + className + '(\\s|$)') != -1);
+}
+
+function hasValue(object, value) {
+ if (!object) return false;
+ return (object.search('(^|\\s)' + value + '(\\s|$)') != -1);
+}
+
+function removeClass(object,className) {
+ if (!object || !hasClass(object,className)) return;
+ object.className = object.className.replace(new RegExp('(^|\\s)'+className+'(\\s|$)'), RegExp.$1+RegExp.$2);
+}
+
+function addClass(object,className) {
+ if (!object || hasClass(object, className)) return;
+ if (object.className) {
+ object.className += ' '+className;
+ } else {
+ object.className = className;
+ }
+}
+
+function GetElementsWithClassName(elementName,className) {
+ var allElements = document.getElementsByTagName(elementName);
+ var elemColl = new Array();
+ for (var i = 0; i< allElements.length; i++) {
+ if (hasClass(allElements[i], className)) {
+ elemColl[elemColl.length] = allElements[i];
+ }
+ }
+ return elemColl;
+}
+
+function isParentOrSelf(element, id) {
+ if (element == null || element.nodeName=='body') return false;
+ else if (element.id == id) return true;
+ else return isParentOrSelf(element.parentNode, id);
+}
+
+function nodeValue(node) {
+ var result = "";
+ if (node.nodeType == 1) {
+ var children = node.childNodes;
+ for (var i = 0; i < children.length; ++i) {
+ result += nodeValue(children[i]);
+ }
+ }
+ else if (node.nodeType == 3) {
+ result = node.nodeValue;
+ }
+ return(result);
+}
+
+function slideLabel() {
+ var slideColl = GetElementsWithClassName('*','slide');
+ var list = document.getElementById('jumplist');
+ smax = slideColl.length;
+ for (var n = 0; n < smax; n++) {
+ var obj = slideColl[n];
+
+ var did = 'slide' + n.toString();
+ obj.setAttribute('id',did);
+
+// if (isOp) continue; // Opera fix (hallvord)
+
+ var otext = '';
+ var menu = obj.firstChild;
+ if (!menu) continue; // to cope with empty slides
+ while (menu && menu.nodeType == 3) {
+ menu = menu.nextSibling;
+ }
+ if (!menu) continue; // to cope with slides with only text nodes
+
+ var menunodes = menu.childNodes;
+ for (var o = 0; o < menunodes.length; o++) {
+ otext += nodeValue(menunodes[o]);
+ }
+ if (isSa) {
+ var option = createElement('option');
+ option.setAttribute('value', n);
+ option.appendChild(document.createTextNode(n + ' : ' + otext) );
+ list.appendChild(option);
+ } else {
+ list.options[list.length] = new Option(n + ' : ' + otext, n);
+ }
+ }
+}
+
+function currentSlide() {
+ var cs;
+ if (document.getElementById) {
+ cs = document.getElementById('currentSlide');
+ } else {
+ cs = document.currentSlide;
+ }
+ var plink = createElement('a');
+ plink.id = 'plink';
+ plink.setAttribute('href', '');
+ var csHere = createElement('span');
+ var csSep = createElement('span');
+ var csTotal = createElement('span');
+ csHere.id = 'csHere';
+ csSep.id = 'csSep';
+ csTotal.id = 'csTotal';
+ csHere.appendChild(document.createTextNode(this.snum));
+ csSep.appendChild(document.createTextNode('/'));
+ csTotal.appendChild(document.createTextNode(this.smax-1));
+ plink.appendChild(csHere);
+ plink.appendChild(csSep);
+ plink.appendChild(csTotal);
+ cs.removeChild(cs.firstChild);
+ cs.appendChild(plink);
+ if (snum == 0) {
+ cs.style.visibility = 'hidden';
+ } else {
+ cs.style.visibility = 'visible';
+ }
+}
+
+function go(step) {
+ if (document.getElementById('slideProj').disabled || step == 0) return;
+ var jl = document.getElementById('jumplist');
+ var cid = 'slide' + snum;
+ var ce = document.getElementById(cid);
+ if (incrementals[snum].length > 0) {
+ for (var i = 0; i < incrementals[snum].length; i++) {
+ removeClass(incrementals[snum][i], 'current');
+ removeClass(incrementals[snum][i], 'incremental');
+ }
+ }
+ if (step != 'j') {
+ snum += step;
+ lmax = smax - 1;
+ if (snum > lmax) snum = lmax;
+ if (snum < 0) snum = 0;
+ } else
+ snum = parseInt(jl.value);
+ var nid = 'slide' + snum;
+ var ne = document.getElementById(nid);
+ if (!ne) {
+ ne = document.getElementById('slide0');
+ snum = 0;
+ }
+ if (step < 0) {incpos = incrementals[snum].length} else {incpos = 0;}
+ if (incrementals[snum].length > 0 && incpos == 0) {
+ for (var i = 0; i < incrementals[snum].length; i++) {
+ if (hasClass(incrementals[snum][i], 'current'))
+ incpos = i + 1;
+ else
+ addClass(incrementals[snum][i], 'incremental');
+ }
+ }
+ if (incrementals[snum].length > 0 && incpos > 0)
+ addClass(incrementals[snum][incpos - 1], 'current');
+ if (isOp) { //hallvord
+ location.hash = nid;
+ } else {
+ ce.style.visibility = 'hidden';
+ ne.style.visibility = 'visible';
+ } // /hallvord
+ jl.selectedIndex = snum;
+ currentSlide();
+ loadNote();
+ permaLink();
+ number = undef;
+}
+
+function goTo(target) {
+ if (target >= smax || target == snum) return;
+ go(target - snum);
+}
+
+function subgo(step) {
+ if (step > 0) {
+ removeClass(incrementals[snum][incpos - 1],'current');
+ removeClass(incrementals[snum][incpos], 'incremental');
+ addClass(incrementals[snum][incpos],'current');
+ incpos++;
+ } else {
+ incpos--;
+ removeClass(incrementals[snum][incpos],'current');
+ addClass(incrementals[snum][incpos], 'incremental');
+ addClass(incrementals[snum][incpos - 1],'current');
+ }
+ loadNote();
+}
+
+function toggle() {
+ var slideColl = GetElementsWithClassName('*','slide');
+ var slides = document.getElementById('slideProj');
+ var outline = document.getElementById('outlineStyle');
+ if (!slides.disabled) {
+ slides.disabled = true;
+ outline.disabled = false;
+ s5mode = false;
+ fontSize('1em');
+ for (var n = 0; n < smax; n++) {
+ var slide = slideColl[n];
+ slide.style.visibility = 'visible';
+ }
+ } else {
+ slides.disabled = false;
+ outline.disabled = true;
+ s5mode = true;
+ fontScale();
+ for (var n = 0; n < smax; n++) {
+ var slide = slideColl[n];
+ slide.style.visibility = 'hidden';
+ }
+ slideColl[snum].style.visibility = 'visible';
+ }
+}
+
+function showHide(action) {
+ var obj = GetElementsWithClassName('*','hideme')[0];
+ switch (action) {
+ case 's': obj.style.visibility = 'visible'; break;
+ case 'h': obj.style.visibility = 'hidden'; break;
+ case 'k':
+ if (obj.style.visibility != 'visible') {
+ obj.style.visibility = 'visible';
+ } else {
+ obj.style.visibility = 'hidden';
+ }
+ break;
+ }
+}
+
+// 'keys' code adapted from MozPoint (http://mozpoint.mozdev.org/)
+function keys(key) {
+ if (!key) {
+ key = event;
+ key.which = key.keyCode;
+ }
+ if (key.which == 84) {
+ toggle();
+ return;
+ }
+ if (s5mode) {
+ switch (key.which) {
+ case 10: // return
+ case 13: // enter
+ if (window.event && isParentOrSelf(window.event.srcElement, 'controls')) return;
+ if (key.target && isParentOrSelf(key.target, 'controls')) return;
+ if(number != undef) {
+ goTo(number);
+ break;
+ }
+ case 32: // spacebar
+ case 34: // page down
+ case 39: // rightkey
+ case 40: // downkey
+ if(number != undef) {
+ go(number);
+ } else if (!incrementals[snum] || incpos >= incrementals[snum].length) {
+ go(1);
+ } else {
+ subgo(1);
+ }
+ break;
+ case 33: // page up
+ case 37: // leftkey
+ case 38: // upkey
+ if(number != undef) {
+ go(-1 * number);
+ } else if (!incrementals[snum] || incpos <= 0) {
+ go(-1);
+ } else {
+ subgo(-1);
+ }
+ break;
+ case 36: // home
+ goTo(0);
+ break;
+ case 35: // end
+ goTo(smax-1);
+ break;
+ case 67: // c
+ showHide('k');
+ break;
+ case 78: // n
+ createNotesWindow();
+ break;
+ }
+ if (key.which < 48 || key.which > 57) {
+ number = undef;
+ } else {
+ if (window.event && isParentOrSelf(window.event.srcElement, 'controls')) return;
+ if (key.target && isParentOrSelf(key.target, 'controls')) return;
+ number = (((number != undef) ? number : 0) * 10) + (key.which - 48);
+ }
+ }
+ return false;
+}
+
+function clicker(e) {
+ number = undef;
+ var target;
+ if (window.event) {
+ target = window.event.srcElement;
+ e = window.event;
+ } else target = e.target;
+ if (target.href != null || hasValue(target.rel, 'external') || isParentOrSelf(target, 'controls') || isParentOrSelf(target,'embed') || isParentOrSelf(target,'object')) return true;
+ if (!e.which || e.which == 1) {
+ if (!incrementals[snum] || incpos >= incrementals[snum].length) {
+ go(1);
+ } else {
+ subgo(1);
+ }
+ }
+}
+
+function findSlide(hash) {
+ var target = null;
+ var slides = GetElementsWithClassName('*','slide');
+ for (var i = 0; i < slides.length; i++) {
+ var targetSlide = slides[i];
+ if ( (targetSlide.name && targetSlide.name == hash)
+ || (targetSlide.id && targetSlide.id == hash) ) {
+ target = targetSlide;
+ break;
+ }
+ }
+ while(target != null && target.nodeName != 'body') {
+ if (hasClass(target, 'slide')) {
+ return parseInt(target.id.slice(5));
+ }
+ target = target.parentNode;
+ }
+ return null;
+}
+
+function slideJump() {
+ if (window.location.hash == null) return;
+ var sregex = /^#slide(\d+)$/;
+ var matches = sregex.exec(window.location.hash);
+ var dest = null;
+ if (matches != null) {
+ dest = parseInt(matches[1]);
+ } else {
+ dest = findSlide(window.location.hash.slice(1));
+ }
+ if (dest != null)
+ go(dest - snum);
+}
+
+function fixLinks() {
+ var thisUri = window.location.href;
+ thisUri = thisUri.slice(0, thisUri.length - window.location.hash.length);
+ var aelements = document.getElementsByTagName('a');
+ for (var i = 0; i < aelements.length; i++) {
+ var a = aelements[i].href;
+ var slideID = a.match('\#slide[0-9]{1,2}');
+ if ((slideID) && (slideID[0].slice(0,1) == '#')) {
+ var dest = findSlide(slideID[0].slice(1));
+ if (dest != null) {
+ if (aelements[i].addEventListener) {
+ aelements[i].addEventListener("click", new Function("e",
+ "if (document.getElementById('slideProj').disabled) return;" +
+ "go("+dest+" - snum); " +
+ "if (e.preventDefault) e.preventDefault();"), true);
+ } else if (aelements[i].attachEvent) {
+ aelements[i].attachEvent("onclick", new Function("",
+ "if (document.getElementById('slideProj').disabled) return;" +
+ "go("+dest+" - snum); " +
+ "event.returnValue = false;"));
+ }
+ }
+ }
+ }
+}
+
+function externalLinks() {
+ if (!document.getElementsByTagName) return;
+ var anchors = document.getElementsByTagName('a');
+ for (var i=0; i
There are no notes for this slide.';
+ if (document.getElementById('note' + snum)) {
+ notes = document.getElementById('note' + snum).innerHTML;
+ }
+ if (document.getElementById('note' + (snum + 1))) {
+ nextNotes = document.getElementById('note' + (snum + 1)).innerHTML;
+ }
+
+ var jl = document.getElementById('jumplist');
+ var slideTitle = jl.options[jl.selectedIndex].text.replace(/^\d+\s+:\s+/, '') + ((jl.selectedIndex) ? ' (' + jl.selectedIndex + '/' + (smax - 1) + ')' : '');
+ if (incrementals[snum].length > 0) {
+// alert('howdy');
+ slideTitle += ' [' + incpos + '/' + incrementals[snum].length + ']';
+ }
+ if (jl.selectedIndex < smax - 1) {
+ var nextTitle = jl.options[jl.selectedIndex + 1].text.replace(/^\d+\s+:\s+/, '') + ((jl.selectedIndex + 1) ? ' (' + (jl.selectedIndex + 1) + '/' + (smax - 1) + ')' : '');
+ } else {
+ var nextTitle = '[end of slide show]';
+ }
+
+ if (s5NotesWindow && !s5NotesWindow.closed && s5NotesWindow.document) {
+ s5NotesWindow.document.getElementById('slide').innerHTML = slideTitle;
+ s5NotesWindow.document.getElementById('notes').innerHTML = notes;
+ s5NotesWindow.document.getElementById('next').innerHTML = nextTitle;
+ s5NotesWindow.document.getElementById('nextnotes').innerHTML = nextNotes;
+ }
+ resetElapsedSlide();
+}
+
+function minimizeTimer(id) {
+ var obj = s5NotesWindow.document.getElementById(id);
+ if (hasClass(obj,'collapsed')) {
+ removeClass(obj,'collapsed');
+ } else {
+ addClass(obj,'collapsed');
+ }
+}
+
+function resetElapsedTime() {
+ presentationStart = new Date();
+ slideStart = new Date();
+ updateElaspedTime();
+}
+
+function resetElapsedSlide() {
+ if (snum != previousSlide) {
+ slideStart = new Date();
+ previousSlide = snum;
+ updateElaspedTime();
+ }
+}
+
+function updateElaspedTime() {
+ if (!s5NotesWindowLoaded || !s5NotesWindow || s5NotesWindow.closed) return;
+ var now = new Date();
+ var ep = s5NotesWindow.document.getElementById('elapsed-presentation');
+ var es = s5NotesWindow.document.getElementById('elapsed-slide');
+ ep.removeChild(ep.firstChild);
+ ep.appendChild(document.createTextNode(formatTime(now.valueOf() - presentationStart.valueOf())));
+ es.removeChild(es.firstChild);
+ es.appendChild(document.createTextNode(formatTime(now.valueOf() - slideStart.valueOf())));
+}
+
+function resetRemainingTime() {
+ if (!s5NotesWindowLoaded || !s5NotesWindow || s5NotesWindow.closed) return;
+ var startField = s5NotesWindow.document.getElementById('startFrom');
+ startFrom = readTime(startField.value);
+ countdown.remaining = startFrom * 60000; // convert to msecs
+ countdown.start = new Date().valueOf();
+ countdown.end = countdown.start + countdown.remaining;
+ var tl = s5NotesWindow.document.getElementById('timeLeft');
+ var timeLeft = formatTime(countdown.remaining);
+ tl.removeChild(tl.firstChild);
+ tl.appendChild(document.createTextNode(timeLeft));
+}
+
+function updateRemainingTime() {
+ if (!s5NotesWindowLoaded || !s5NotesWindow || s5NotesWindow.closed) return;
+ var tl = s5NotesWindow.document.getElementById('timeLeft');
+ var now = new Date();
+ if (countdown.state == 'run') {
+ countdown.remaining = countdown.end - now;
+ }
+ tl.style.color = '';
+ tl.style.backgroundColor = '';
+ if (countdown.remaining >= 0) {
+ var timeLeft = formatTime(countdown.remaining);
+ removeClass(tl,'overtime');
+ if (countdown.remaining < 300000) {
+ tl.style.color = 'rgb(' + (255-Math.round(countdown.remaining/2000)) + ',0,0)';
+ tl.style.backgroundColor = 'rgb(255,255,' + (Math.round(countdown.remaining/2000)) + ')';
+ }
+ } else {
+ var timeLeft = '-' + formatTime(-countdown.remaining);
+ addClass(tl,'overtime');
+ }
+ tl.removeChild(tl.firstChild);
+ tl.appendChild(document.createTextNode(timeLeft));
+}
+
+function toggleRemainingTime() {
+ if (countdown.state == 'pause') countdown.state = 'run'; else countdown.state = 'pause';
+ if (countdown.state == 'pause') {
+ window.clearInterval(countdown.timer);
+ }
+ if (countdown.state == 'run') {
+ countdown.start = new Date().valueOf();
+ countdown.end = countdown.start + countdown.remaining;
+ countdown.timer = window.setInterval('updateRemainingTime()', 1000);
+ }
+}
+
+function alterRemainingTime(amt) {
+ var change = amt * 60000; // convert to msecs
+ countdown.end += change;
+ countdown.remaining += change;
+ updateRemainingTime();
+}
+
+function formatTime(msecs) {
+ var time = new Date(msecs);
+
+ var hrs = time.getUTCHours() + ((time.getUTCDate() -1) * 24); // I doubt anyone will spend more than 24 hours on a presentation or single slide but just in case...
+ hrs = (hrs < 10) ? '0'+hrs : hrs;
+ if (hrs == 'NaN' || isNaN(hrs)) hrs = '--';
+
+ var min = time.getUTCMinutes();
+ min = (min < 10) ? '0'+min : min;
+ if (min == 'NaN' || isNaN(min)) min = '--';
+
+ var sec = time.getUTCSeconds();
+ sec = (sec < 10) ? '0'+sec : sec;
+ if (sec == 'NaN' || isNaN(sec)) sec = '--';
+
+ return hrs + ':' + min + ':' + sec;
+}
+
+function readTime(val) {
+ var sregex = /:/;
+ var matches = sregex.exec(val);
+ if (matches == null) {
+ return val;
+ } else {
+ var times = val.split(':');
+ var hours = parseInt(times[0]);
+ var mins = parseInt(times[1]);
+ var total = (hours * 60) + mins;
+ return total;
+ }
+}
+
+function createElement(element) {
+ if (typeof document.createElementNS != 'undefined') {
+ return document.createElementNS('http://www.w3.org/1999/xhtml', element);
+ } else {
+ return document.createElement(element);
+ }
+}
+
+function windowChange() {
+ fontScale();
+}
+
+function fixRunIn() {
+// work around lack of gecko support for display:run-in
+ var re = /^num_|\s+num_|^un_|\s+un_|proof/;
+ $$('div > h6').each(function(element) {
+ if(re.test($(element.parentNode).className)) {
+ var new_span = new Element('span').update(element.textContent);
+ new_span.addClassName('theorem_label');
+ var next_el = element.next().firstChild;
+ next_el.parentNode.insertBefore(new_span, next_el);
+ var period = new Element('span').update('. ');
+ next_el.parentNode.insertBefore(period, next_el);
+ element.remove();
+ }
+ });
+// add tombstone to proof, since gecko doesn't support :last-child properly
+
+ $$('div.proof').each(function(element) {
+ var l = element.childElements().length -1;
+ var span = new Element('span').update('\u00a0\u00a0\u25ae');
+ element.childElements()[l].insert(span);
+ })
+}
+
+function startup() {
+ defaultCheck();
+ createControls(); // hallvord
+ slideLabel();
+ incrementals = createIncrementals();
+ noteLabel(); // [SI:060104] must follow slideLabel()
+ loadNote();
+ fixLinks();
+ externalLinks();
+ fontScale();
+ fixRunIn();
+ if (!isOp) notOperaFix();
+ slideJump();
+ if (defaultView == 'outline') {
+ toggle();
+ }
+ document.onkeyup = keys;
+ document.onkeypress = trap;
+ document.onclick = clicker;
+}
+
+window.onload = startup;
+window.onresize = function(){setTimeout('windowChange()',5);}
diff -r d8feb607c44e -r 7fd82a802a66 poster/os9/ui/framing.css
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/poster/os9/ui/framing.css Fri Apr 19 18:23:10 2019 +0900
@@ -0,0 +1,25 @@
+/* The following styles size and place the slide components.
+ Edit them if you want to change the overall slide layout.
+ The commented lines can be uncommented (and modified, if necessary)
+ to help you with the rearrangement process. */
+
+div#header, div#footer, div.slide {width: 100%; top: 0; left: 0;}
+div#header {top: 0; height: 1em;}
+div#footer {top: auto; bottom: 0; height: 2.5em;}
+div.slide {top: 0; width: 92%; padding: 3.5em 4% 4%;}
+/*div#controls {left: 50%; top: 0; width: 50%; height: 100%;}
+#footer>*/
+div#controls {bottom: 0; top: auto; height: auto;}
+
+div#controls form {position: absolute; bottom: 0; right: 0; width: 100%;
+ margin: 0;}
+div#currentSlide {position: absolute; left: -500px; bottom: 1em; width: 130px; z-index: 10;}
+/*html>body
+#currentSlide {position: fixed;}*/
+
+/*
+div#header {background: #FCC;}
+div#footer {background: #CCF;}
+div#controls {background: #BBD;}
+div#currentSlide {background: #FFC;}
+*/
diff -r d8feb607c44e -r 7fd82a802a66 poster/os9/ui/google/prettify.js
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/poster/os9/ui/google/prettify.js Fri Apr 19 18:23:10 2019 +0900
@@ -0,0 +1,1391 @@
+// Copyright (C) 2006 Google Inc.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+
+/**
+ * @fileoverview
+ * some functions for browser-side pretty printing of code contained in html.
+ *
+ *
+ * For a fairly comprehensive set of languages see the
+ * README
+ * file that came with this source. At a minimum, the lexer should work on a
+ * number of languages including C and friends, Java, Python, Bash, SQL, HTML,
+ * XML, CSS, Javascript, and Makefiles. It works passably on Ruby, PHP and Awk
+ * and a subset of Perl, but, because of commenting conventions, doesn't work on
+ * Smalltalk, Lisp-like, or CAML-like languages without an explicit lang class.
+ *
+ * Usage:
+ * - include this source file in an html page via
+ * {@code }
+ *
- define style rules. See the example page for examples.
+ *
- mark the {@code
} and {@code } tags in your source with
+ * {@code class=prettyprint.}
+ * You can also use the (html deprecated) {@code } tag, but the pretty
+ * printer needs to do more substantial DOM manipulations to support that, so
+ * some css styles may not be preserved.
+ *
+ * That's it. I wanted to keep the API as simple as possible, so there's no
+ * need to specify which language the code is in, but if you wish, you can add
+ * another class to the {@code } or {@code } element to specify the
+ * language, as in {@code }. Any class that
+ * starts with "lang-" followed by a file extension, specifies the file type.
+ * See the "lang-*.js" files in this directory for code that implements
+ * per-language file handlers.
+ *
+ * Change log:
+ * cbeust, 2006/08/22
+ *
+ * Java annotations (start with "@") are now captured as literals ("lit")
+ *
+ * @requires console
+ */
+
+// JSLint declarations
+/*global console, document, navigator, setTimeout, window */
+
+/**
+ * Split {@code prettyPrint} into multiple timeouts so as not to interfere with
+ * UI events.
+ * If set to {@code false}, {@code prettyPrint()} is synchronous.
+ */
+window['PR_SHOULD_USE_CONTINUATION'] = true;
+
+/** the number of characters between tab columns */
+window['PR_TAB_WIDTH'] = 8;
+
+/** Contains functions for creating and registering new language handlers.
+ * @type {Object}
+ */
+window['PR']
+
+/** Pretty print a chunk of code.
+ *
+ * @param {string} sourceCodeHtml code as html
+ * @return {string} code as html, but prettier
+ */
+ = window['prettyPrintOne']
+/** Find all the {@code } and {@code } tags in the DOM with
+ * {@code class=prettyprint} and prettify them.
+ * @param {Function?} opt_whenDone if specified, called when the last entry
+ * has been finished.
+ */
+ = window['prettyPrint'] = void 0;
+
+
+(function () {
+ // Keyword lists for various languages.
+ var FLOW_CONTROL_KEYWORDS =
+ "break continue do else for if return while ";
+ var C_KEYWORDS = FLOW_CONTROL_KEYWORDS + "auto case char const default " +
+ "double enum extern float goto int long register short signed sizeof " +
+ "static struct switch typedef union unsigned void volatile ";
+ var COMMON_KEYWORDS = C_KEYWORDS + "catch class delete false import " +
+ "new operator private protected public this throw true try typeof ";
+ var CPP_KEYWORDS = COMMON_KEYWORDS + "alignof align_union asm axiom bool " +
+ "concept concept_map const_cast constexpr decltype " +
+ "dynamic_cast explicit export friend inline late_check " +
+ "mutable namespace nullptr reinterpret_cast static_assert static_cast " +
+ "template typeid typename using virtual wchar_t where ";
+ var JAVA_KEYWORDS = COMMON_KEYWORDS +
+ "abstract boolean byte extends final finally implements import " +
+ "instanceof null native package strictfp super synchronized throws " +
+ "transient ";
+ var CSHARP_KEYWORDS = JAVA_KEYWORDS +
+ "as base by checked decimal delegate descending dynamic event " +
+ "fixed foreach from group implicit in interface internal into is lock " +
+ "object out override orderby params partial readonly ref sbyte sealed " +
+ "stackalloc string select uint ulong unchecked unsafe ushort var ";
+ var COFFEE_KEYWORDS = "all and by catch class else extends false finally " +
+ "for if in is isnt loop new no not null of off on or return super then " +
+ "true try unless until when while yes ";
+ var JSCRIPT_KEYWORDS = COMMON_KEYWORDS +
+ "debugger eval export function get null set undefined var with " +
+ "Infinity NaN ";
+ var PERL_KEYWORDS = "caller delete die do dump elsif eval exit foreach for " +
+ "goto if import last local my next no our print package redo require " +
+ "sub undef unless until use wantarray while BEGIN END ";
+ var PYTHON_KEYWORDS = FLOW_CONTROL_KEYWORDS + "and as assert class def del " +
+ "elif except exec finally from global import in is lambda " +
+ "nonlocal not or pass print raise try with yield " +
+ "False True None ";
+ var RUBY_KEYWORDS = FLOW_CONTROL_KEYWORDS + "alias and begin case class def" +
+ " defined elsif end ensure false in module next nil not or redo rescue " +
+ "retry self super then true undef unless until when yield BEGIN END ";
+ var SH_KEYWORDS = FLOW_CONTROL_KEYWORDS + "case done elif esac eval fi " +
+ "function in local set then until ";
+ var ALL_KEYWORDS = (
+ CPP_KEYWORDS + CSHARP_KEYWORDS + JSCRIPT_KEYWORDS + PERL_KEYWORDS +
+ PYTHON_KEYWORDS + RUBY_KEYWORDS + SH_KEYWORDS);
+
+ // token style names. correspond to css classes
+ /** token style for a string literal */
+ var PR_STRING = 'str';
+ /** token style for a keyword */
+ var PR_KEYWORD = 'kwd';
+ /** token style for a comment */
+ var PR_COMMENT = 'com';
+ /** token style for a type */
+ var PR_TYPE = 'typ';
+ /** token style for a literal value. e.g. 1, null, true. */
+ var PR_LITERAL = 'lit';
+ /** token style for a punctuation string. */
+ var PR_PUNCTUATION = 'pun';
+ /** token style for a punctuation string. */
+ var PR_PLAIN = 'pln';
+
+ /** token style for an sgml tag. */
+ var PR_TAG = 'tag';
+ /** token style for a markup declaration such as a DOCTYPE. */
+ var PR_DECLARATION = 'dec';
+ /** token style for embedded source. */
+ var PR_SOURCE = 'src';
+ /** token style for an sgml attribute name. */
+ var PR_ATTRIB_NAME = 'atn';
+ /** token style for an sgml attribute value. */
+ var PR_ATTRIB_VALUE = 'atv';
+
+ /**
+ * A class that indicates a section of markup that is not code, e.g. to allow
+ * embedding of line numbers within code listings.
+ */
+ var PR_NOCODE = 'nocode';
+
+ /** A set of tokens that can precede a regular expression literal in
+ * javascript.
+ * http://www.mozilla.org/js/language/js20/rationale/syntax.html has the full
+ * list, but I've removed ones that might be problematic when seen in
+ * languages that don't support regular expression literals.
+ *
+ * Specifically, I've removed any keywords that can't precede a regexp
+ * literal in a syntactically legal javascript program, and I've removed the
+ * "in" keyword since it's not a keyword in many languages, and might be used
+ * as a count of inches.
+ *
+ *
The link a above does not accurately describe EcmaScript rules since
+ * it fails to distinguish between (a=++/b/i) and (a++/b/i) but it works
+ * very well in practice.
+ *
+ * @private
+ */
+ var REGEXP_PRECEDER_PATTERN = function () {
+ var preceders = [
+ "!", "!=", "!==", "#", "%", "%=", "&", "&&", "&&=",
+ "&=", "(", "*", "*=", /* "+", */ "+=", ",", /* "-", */ "-=",
+ "->", /*".", "..", "...", handled below */ "/", "/=", ":", "::", ";",
+ "<", "<<", "<<=", "<=", "=", "==", "===", ">",
+ ">=", ">>", ">>=", ">>>", ">>>=", "?", "@", "[",
+ "^", "^=", "^^", "^^=", "{", "|", "|=", "||",
+ "||=", "~" /* handles =~ and !~ */,
+ "break", "case", "continue", "delete",
+ "do", "else", "finally", "instanceof",
+ "return", "throw", "try", "typeof"
+ ];
+ var pattern = '(?:^^|[+-]';
+ for (var i = 0; i < preceders.length; ++i) {
+ pattern += '|' + preceders[i].replace(/([^=<>:&a-z])/g, '\\$1');
+ }
+ pattern += ')\\s*'; // matches at end, and matches empty string
+ return pattern;
+ // CAVEAT: this does not properly handle the case where a regular
+ // expression immediately follows another since a regular expression may
+ // have flags for case-sensitivity and the like. Having regexp tokens
+ // adjacent is not valid in any language I'm aware of, so I'm punting.
+ // TODO: maybe style special characters inside a regexp as punctuation.
+ }();
+
+
+ /**
+ * Given a group of {@link RegExp}s, returns a {@code RegExp} that globally
+ * matches the union of the sets of strings matched by the input RegExp.
+ * Since it matches globally, if the input strings have a start-of-input
+ * anchor (/^.../), it is ignored for the purposes of unioning.
+ * @param {Array.} regexs non multiline, non-global regexs.
+ * @return {RegExp} a global regex.
+ */
+ function combinePrefixPatterns(regexs) {
+ var capturedGroupIndex = 0;
+
+ var needToFoldCase = false;
+ var ignoreCase = false;
+ for (var i = 0, n = regexs.length; i < n; ++i) {
+ var regex = regexs[i];
+ if (regex.ignoreCase) {
+ ignoreCase = true;
+ } else if (/[a-z]/i.test(regex.source.replace(
+ /\\u[0-9a-f]{4}|\\x[0-9a-f]{2}|\\[^ux]/gi, ''))) {
+ needToFoldCase = true;
+ ignoreCase = false;
+ break;
+ }
+ }
+
+ function decodeEscape(charsetPart) {
+ if (charsetPart.charAt(0) !== '\\') { return charsetPart.charCodeAt(0); }
+ switch (charsetPart.charAt(1)) {
+ case 'b': return 8;
+ case 't': return 9;
+ case 'n': return 0xa;
+ case 'v': return 0xb;
+ case 'f': return 0xc;
+ case 'r': return 0xd;
+ case 'u': case 'x':
+ return parseInt(charsetPart.substring(2), 16)
+ || charsetPart.charCodeAt(1);
+ case '0': case '1': case '2': case '3': case '4':
+ case '5': case '6': case '7':
+ return parseInt(charsetPart.substring(1), 8);
+ default: return charsetPart.charCodeAt(1);
+ }
+ }
+
+ function encodeEscape(charCode) {
+ if (charCode < 0x20) {
+ return (charCode < 0x10 ? '\\x0' : '\\x') + charCode.toString(16);
+ }
+ var ch = String.fromCharCode(charCode);
+ if (ch === '\\' || ch === '-' || ch === '[' || ch === ']') {
+ ch = '\\' + ch;
+ }
+ return ch;
+ }
+
+ function caseFoldCharset(charSet) {
+ var charsetParts = charSet.substring(1, charSet.length - 1).match(
+ new RegExp(
+ '\\\\u[0-9A-Fa-f]{4}'
+ + '|\\\\x[0-9A-Fa-f]{2}'
+ + '|\\\\[0-3][0-7]{0,2}'
+ + '|\\\\[0-7]{1,2}'
+ + '|\\\\[\\s\\S]'
+ + '|-'
+ + '|[^-\\\\]',
+ 'g'));
+ var groups = [];
+ var ranges = [];
+ var inverse = charsetParts[0] === '^';
+ for (var i = inverse ? 1 : 0, n = charsetParts.length; i < n; ++i) {
+ var p = charsetParts[i];
+ switch (p) {
+ case '\\B': case '\\b':
+ case '\\D': case '\\d':
+ case '\\S': case '\\s':
+ case '\\W': case '\\w':
+ groups.push(p);
+ continue;
+ }
+ var start = decodeEscape(p);
+ var end;
+ if (i + 2 < n && '-' === charsetParts[i + 1]) {
+ end = decodeEscape(charsetParts[i + 2]);
+ i += 2;
+ } else {
+ end = start;
+ }
+ ranges.push([start, end]);
+ // If the range might intersect letters, then expand it.
+ if (!(end < 65 || start > 122)) {
+ if (!(end < 65 || start > 90)) {
+ ranges.push([Math.max(65, start) | 32, Math.min(end, 90) | 32]);
+ }
+ if (!(end < 97 || start > 122)) {
+ ranges.push([Math.max(97, start) & ~32, Math.min(end, 122) & ~32]);
+ }
+ }
+ }
+
+ // [[1, 10], [3, 4], [8, 12], [14, 14], [16, 16], [17, 17]]
+ // -> [[1, 12], [14, 14], [16, 17]]
+ ranges.sort(function (a, b) { return (a[0] - b[0]) || (b[1] - a[1]); });
+ var consolidatedRanges = [];
+ var lastRange = [NaN, NaN];
+ for (var i = 0; i < ranges.length; ++i) {
+ var range = ranges[i];
+ if (range[0] <= lastRange[1] + 1) {
+ lastRange[1] = Math.max(lastRange[1], range[1]);
+ } else {
+ consolidatedRanges.push(lastRange = range);
+ }
+ }
+
+ var out = ['['];
+ if (inverse) { out.push('^'); }
+ out.push.apply(out, groups);
+ for (var i = 0; i < consolidatedRanges.length; ++i) {
+ var range = consolidatedRanges[i];
+ out.push(encodeEscape(range[0]));
+ if (range[1] > range[0]) {
+ if (range[1] + 1 > range[0]) { out.push('-'); }
+ out.push(encodeEscape(range[1]));
+ }
+ }
+ out.push(']');
+ return out.join('');
+ }
+
+ function allowAnywhereFoldCaseAndRenumberGroups(regex) {
+ // Split into character sets, escape sequences, punctuation strings
+ // like ('(', '(?:', ')', '^'), and runs of characters that do not
+ // include any of the above.
+ var parts = regex.source.match(
+ new RegExp(
+ '(?:'
+ + '\\[(?:[^\\x5C\\x5D]|\\\\[\\s\\S])*\\]' // a character set
+ + '|\\\\u[A-Fa-f0-9]{4}' // a unicode escape
+ + '|\\\\x[A-Fa-f0-9]{2}' // a hex escape
+ + '|\\\\[0-9]+' // a back-reference or octal escape
+ + '|\\\\[^ux0-9]' // other escape sequence
+ + '|\\(\\?[:!=]' // start of a non-capturing group
+ + '|[\\(\\)\\^]' // start/emd of a group, or line start
+ + '|[^\\x5B\\x5C\\(\\)\\^]+' // run of other characters
+ + ')',
+ 'g'));
+ var n = parts.length;
+
+ // Maps captured group numbers to the number they will occupy in
+ // the output or to -1 if that has not been determined, or to
+ // undefined if they need not be capturing in the output.
+ var capturedGroups = [];
+
+ // Walk over and identify back references to build the capturedGroups
+ // mapping.
+ for (var i = 0, groupIndex = 0; i < n; ++i) {
+ var p = parts[i];
+ if (p === '(') {
+ // groups are 1-indexed, so max group index is count of '('
+ ++groupIndex;
+ } else if ('\\' === p.charAt(0)) {
+ var decimalValue = +p.substring(1);
+ if (decimalValue && decimalValue <= groupIndex) {
+ capturedGroups[decimalValue] = -1;
+ }
+ }
+ }
+
+ // Renumber groups and reduce capturing groups to non-capturing groups
+ // where possible.
+ for (var i = 1; i < capturedGroups.length; ++i) {
+ if (-1 === capturedGroups[i]) {
+ capturedGroups[i] = ++capturedGroupIndex;
+ }
+ }
+ for (var i = 0, groupIndex = 0; i < n; ++i) {
+ var p = parts[i];
+ if (p === '(') {
+ ++groupIndex;
+ if (capturedGroups[groupIndex] === undefined) {
+ parts[i] = '(?:';
+ }
+ } else if ('\\' === p.charAt(0)) {
+ var decimalValue = +p.substring(1);
+ if (decimalValue && decimalValue <= groupIndex) {
+ parts[i] = '\\' + capturedGroups[groupIndex];
+ }
+ }
+ }
+
+ // Remove any prefix anchors so that the output will match anywhere.
+ // ^^ really does mean an anchored match though.
+ for (var i = 0, groupIndex = 0; i < n; ++i) {
+ if ('^' === parts[i] && '^' !== parts[i + 1]) { parts[i] = ''; }
+ }
+
+ // Expand letters to groups to handle mixing of case-sensitive and
+ // case-insensitive patterns if necessary.
+ if (regex.ignoreCase && needToFoldCase) {
+ for (var i = 0; i < n; ++i) {
+ var p = parts[i];
+ var ch0 = p.charAt(0);
+ if (p.length >= 2 && ch0 === '[') {
+ parts[i] = caseFoldCharset(p);
+ } else if (ch0 !== '\\') {
+ // TODO: handle letters in numeric escapes.
+ parts[i] = p.replace(
+ /[a-zA-Z]/g,
+ function (ch) {
+ var cc = ch.charCodeAt(0);
+ return '[' + String.fromCharCode(cc & ~32, cc | 32) + ']';
+ });
+ }
+ }
+ }
+
+ return parts.join('');
+ }
+
+ var rewritten = [];
+ for (var i = 0, n = regexs.length; i < n; ++i) {
+ var regex = regexs[i];
+ if (regex.global || regex.multiline) { throw new Error('' + regex); }
+ rewritten.push(
+ '(?:' + allowAnywhereFoldCaseAndRenumberGroups(regex) + ')');
+ }
+
+ return new RegExp(rewritten.join('|'), ignoreCase ? 'gi' : 'g');
+ }
+
+
+ /**
+ * Split markup into a string of source code and an array mapping ranges in
+ * that string to the text nodes in which they appear.
+ *
+ *
+ * The HTML DOM structure:
+ *
+ * (Element "p"
+ * (Element "b"
+ * (Text "print ")) ; #1
+ * (Text "'Hello '") ; #2
+ * (Element "br") ; #3
+ * (Text " + 'World';")) ; #4
+ *
+ *
+ * corresponds to the HTML
+ * {@code
print 'Hello '
+ 'World';
}.
+ *
+ *
+ * It will produce the output:
+ *
+ * {
+ * source: "print 'Hello '\n + 'World';",
+ * // 1 2
+ * // 012345678901234 5678901234567
+ * spans: [0, #1, 6, #2, 14, #3, 15, #4]
+ * }
+ *
+ *
+ * where #1 is a reference to the {@code "print "} text node above, and so
+ * on for the other text nodes.
+ *
+ *
+ *
+ * The {@code} spans array is an array of pairs. Even elements are the start
+ * indices of substrings, and odd elements are the text nodes (or BR elements)
+ * that contain the text for those substrings.
+ * Substrings continue until the next index or the end of the source.
+ *
+ *
+ * @param {Node} node an HTML DOM subtree containing source-code.
+ * @return {Object} source code and the text nodes in which they occur.
+ */
+ function extractSourceSpans(node) {
+ var nocode = /(?:^|\s)nocode(?:\s|$)/;
+
+ var chunks = [];
+ var length = 0;
+ var spans = [];
+ var k = 0;
+
+ var whitespace;
+ if (node.currentStyle) {
+ whitespace = node.currentStyle.whiteSpace;
+ } else if (window.getComputedStyle) {
+ whitespace = document.defaultView.getComputedStyle(node, null)
+ .getPropertyValue('white-space');
+ }
+ var isPreformatted = whitespace && 'pre' === whitespace.substring(0, 3);
+
+ function walk(node) {
+ switch (node.nodeType) {
+ case 1: // Element
+ if (nocode.test(node.className)) { return; }
+ for (var child = node.firstChild; child; child = child.nextSibling) {
+ walk(child);
+ }
+ var nodeName = node.nodeName;
+ if ('BR' === nodeName || 'LI' === nodeName) {
+ chunks[k] = '\n';
+ spans[k << 1] = length++;
+ spans[(k++ << 1) | 1] = node;
+ }
+ break;
+ case 3: case 4: // Text
+ var text = node.nodeValue;
+ if (text.length) {
+ if (!isPreformatted) {
+ text = text.replace(/[ \t\r\n]+/g, ' ');
+ } else {
+ text = text.replace(/\r\n?/g, '\n'); // Normalize newlines.
+ }
+ // TODO: handle tabs here?
+ chunks[k] = text;
+ spans[k << 1] = length;
+ length += text.length;
+ spans[(k++ << 1) | 1] = node;
+ }
+ break;
+ }
+ }
+
+ walk(node);
+
+ return {
+ source: chunks.join('').replace(/\n$/, ''),
+ spans: spans
+ };
+ }
+
+
+ /**
+ * Apply the given language handler to sourceCode and add the resulting
+ * decorations to out.
+ * @param {number} basePos the index of sourceCode within the chunk of source
+ * whose decorations are already present on out.
+ */
+ function appendDecorations(basePos, sourceCode, langHandler, out) {
+ if (!sourceCode) { return; }
+ var job = {
+ source: sourceCode,
+ basePos: basePos
+ };
+ langHandler(job);
+ out.push.apply(out, job.decorations);
+ }
+
+ /** Given triples of [style, pattern, context] returns a lexing function,
+ * The lexing function interprets the patterns to find token boundaries and
+ * returns a decoration list of the form
+ * [index_0, style_0, index_1, style_1, ..., index_n, style_n]
+ * where index_n is an index into the sourceCode, and style_n is a style
+ * constant like PR_PLAIN. index_n-1 <= index_n, and style_n-1 applies to
+ * all characters in sourceCode[index_n-1:index_n].
+ *
+ * The stylePatterns is a list whose elements have the form
+ * [style : string, pattern : RegExp, DEPRECATED, shortcut : string].
+ *
+ * Style is a style constant like PR_PLAIN, or can be a string of the
+ * form 'lang-FOO', where FOO is a language extension describing the
+ * language of the portion of the token in $1 after pattern executes.
+ * E.g., if style is 'lang-lisp', and group 1 contains the text
+ * '(hello (world))', then that portion of the token will be passed to the
+ * registered lisp handler for formatting.
+ * The text before and after group 1 will be restyled using this decorator
+ * so decorators should take care that this doesn't result in infinite
+ * recursion. For example, the HTML lexer rule for SCRIPT elements looks
+ * something like ['lang-js', /<[s]cript>(.+?)<\/script>/]. This may match
+ * '
+
+
+
+
+
+
+
+
+-
+
Presentation
+00:00:00
+
+-
+
Current Slide
+00:00:00
+
+
+
+
+
+
+
+
+-
+00:00:00
++
+
+
+
+
+...
+
+
+...
+
+
+
+