diff --git a/doc/index.html b/doc/index.html new file mode 100644 index 0000000..e07525e --- /dev/null +++ b/doc/index.html @@ -0,0 +1,26 @@ + + + + Milsko GUI Toolkit Documentation + + +

Milsko GUI Toolkit Documentation

+
+

Mw/Button.h

+

+ Button widget. +

+
+ MWDECL MwClass MwButtonClass; +
+
+ Button class. +
+
+
+

Mw/Core.h

+

+ Core. +

+ + diff --git a/doc/note.gif b/doc/note.gif new file mode 100644 index 0000000..26d93d8 Binary files /dev/null and b/doc/note.gif differ diff --git a/doc/unsure.gif b/doc/unsure.gif new file mode 100644 index 0000000..2700666 Binary files /dev/null and b/doc/unsure.gif differ diff --git a/doc/warning.gif b/doc/warning.gif new file mode 100644 index 0000000..d020fb5 Binary files /dev/null and b/doc/warning.gif differ diff --git a/include/Mw/Button.h b/include/Mw/Button.h index c13ed9d..53a48f1 100644 --- a/include/Mw/Button.h +++ b/include/Mw/Button.h @@ -1,4 +1,8 @@ /* $Id$ */ +/*! + * %file Mw/Button.h + * %brief Button widget + */ #ifndef __MW_BUTTON_H__ #define __MW_BUTTON_H__ @@ -9,6 +13,9 @@ extern "C" { #endif +/*! + * %brief Button class + */ MWDECL MwClass MwButtonClass; #ifdef __cplusplus diff --git a/include/Mw/Core.h b/include/Mw/Core.h index b5e4095..1a1cfba 100644 --- a/include/Mw/Core.h +++ b/include/Mw/Core.h @@ -1,4 +1,8 @@ /* $Id$ */ +/*! + * %file Mw/Core.h + * %brief Core + */ #ifndef __MW_CORE_H__ #define __MW_CORE_H__ diff --git a/tools/doc.pl b/tools/doc.pl new file mode 100755 index 0000000..cadecc6 --- /dev/null +++ b/tools/doc.pl @@ -0,0 +1,116 @@ +#!/usr/bin/env perl +# $Id$ + +our $html = ""; +our $title = "Milsko GUI Toolkit Documentation"; +our @pathlist = ("include"); +our @notes = ("warning", "unsure", "note"); + +sub out { + $html = $html . "$_[0]\n"; +} + +sub scan_dir { + my ($first, $path) = @_; + $path =~ s/\/+$//g; + + if(opendir(my $dh, $path)){ + print(STDERR "Scanning $path\n"); + my @paths = sort(readdir($dh)); + foreach my $p (@paths){ + if($p eq '.' || $p eq '..'){ + next; + } + scan_dir($first, $path . "/" . $p); + } + closedir($dh); + }else{ + my $spaces = ""; + my $in = 0; + my $out = 0; + my $file = 0; + my $has_file = 0; + my %kv = (); + + print(STDERR "$path is a file\n"); + open(IN, "<", "$path"); + while(my $l = ){ + $l =~ s/[\r\n]+$//g; + if($out){ + my $para = "p"; + my $brief = $kv{brief} or ""; + + $brief =~ s/([^\.])$/\1./g; + + $out = 0; + if(!$has_file){ + print(STDERR "Warning: missing comment with %file, ignoring\n"); + next; + } + if(!$file && defined($kv{brief})){ + $para = "dd"; + + $l =~ s/[ \t]*(?:;|\{.+)[ \t]*$//g; + + out("
"); + out(" $l;"); + out("
"); + } + out("<$para>"); + out(" $brief"); + out(""); + + foreach my $note (@notes){ + if(defined($kv{$note})){ + out("
"); + out(" \"$note\""); + out("
"); + out("
"); + out(" $kv{$note}"); + out("
"); + } + } + if(!$file){ + out("
"); + } + }elsif($l =~ /^([ \t]*)\/\*\!/){ + $spaces = $1; + $in = 1; + $file = 0; + %kv = (); + }elsif($in && ($l =~ /^$spaces \*\//)){ + $in = 0; + $out = 1; + }elsif($in && ($l =~ /^$spaces \*[ \t]+%([^ ]+)(?:[ \t]+(.+))?$/)){ + $kv{$1} = $2; + if($1 eq "file"){ + if(!$has_file){ + out("
"); + out("

$2

"); + } + + $file = 1; + $has_file = 1; + } + } + } + close(IN); + } +} + +out(""); +out(" "); +out(" "); +out(" $title"); +out(" "); +out(" "); +out("

$title

"); + +foreach my $f (@pathlist){ + scan_dir($f, $f); +} + +out(" "); +out(""); + +print($html);