From 31d01d3b7910e286a9063478bc2088e5e0300c58 Mon Sep 17 00:00:00 2001 From: NishiOwO Date: Tue, 30 Sep 2025 11:11:30 +0000 Subject: [PATCH] work on document git-svn-id: http://svn2.nishi.boats/svn/milsko/trunk@75 b9cfdab3-6d41-4d17-bbe4-086880011989 --- doc/index.html | 26 ++++++++++ doc/note.gif | Bin 0 -> 179 bytes doc/unsure.gif | Bin 0 -> 121 bytes doc/warning.gif | Bin 0 -> 179 bytes include/Mw/Button.h | 7 +++ include/Mw/Core.h | 4 ++ tools/doc.pl | 116 ++++++++++++++++++++++++++++++++++++++++++++ 7 files changed, 153 insertions(+) create mode 100644 doc/index.html create mode 100644 doc/note.gif create mode 100644 doc/unsure.gif create mode 100644 doc/warning.gif create mode 100755 tools/doc.pl 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 0000000000000000000000000000000000000000..26d93d8a2dd851987901ecf086fff938c5c418c6 GIT binary patch literal 179 zcmZ?wbhEHbRA5kG_{hNU|Nnmm28KU>fCPi$PZmZHtpg%J@(fHZE&VG`^D-`+t#-@% zD(|B5IkpqsCk2{KTUBnB$+^~P_0d(T-lp3hRR&Bx8)qJS^qR7m;E9yt%8El%0wxw{ z%#~XoF)v`cY2emttKW0$EIz!(t-mmd8|I^Y9ZT zaxZd3!WK=I+@$;SP^wy0cJ6Wiy4^NK6aSd(Shz5Q<;Ns1$L!NH=wXnW?$SY1a7(IulU<06PvVPQw5I literal 0 HcmV?d00001 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);