valadoc r2 - in trunk: . .bzr .bzr/branch .bzr/branch-lock .bzr/branch/lock .bzr/checkout .bzr/checkout/lock .bzr/repository .bzr/repository/knits .bzr/repository/knits/3b .bzr/repository/knits/3f .bzr/repository/knits/44 .bzr/repository/knits/46 .bzr/repository/knits/61 .bzr/repository/knits/6e .bzr/repository/knits/7e .bzr/repository/knits/85 .bzr/repository/knits/88 .bzr/repository/knits/89 .bzr/repository/knits/a9 .bzr/repository/knits/b1 .bzr/repository/knits/b3 .bzr/repository/knits/b5 .bzr/repository/knits/b6 .bzr/repository/knits/de .bzr/repository/knits/ed .bzr/repository/knits/ff .bzr/repository/lock .bzr/repository/revision-store basic html testcases testcases/comments testcases/definitions
- From: flobrosch svn gnome org
- To: svn-commits-list gnome org
- Subject: valadoc r2 - in trunk: . .bzr .bzr/branch .bzr/branch-lock .bzr/branch/lock .bzr/checkout .bzr/checkout/lock .bzr/repository .bzr/repository/knits .bzr/repository/knits/3b .bzr/repository/knits/3f .bzr/repository/knits/44 .bzr/repository/knits/46 .bzr/repository/knits/61 .bzr/repository/knits/6e .bzr/repository/knits/7e .bzr/repository/knits/85 .bzr/repository/knits/88 .bzr/repository/knits/89 .bzr/repository/knits/a9 .bzr/repository/knits/b1 .bzr/repository/knits/b3 .bzr/repository/knits/b5 .bzr/repository/knits/b6 .bzr/repository/knits/de .bzr/repository/knits/ed .bzr/repository/knits/ff .bzr/repository/lock .bzr/repository/revision-store basic html testcases testcases/comments testcases/definitions
- Date: Sat, 26 Apr 2008 15:47:36 +0100 (BST)
Author: flobrosch
Date: Sat Apr 26 14:47:35 2008
New Revision: 2
URL: http://svn.gnome.org/viewvc/valadoc?rev=2&view=rev
Log:
Added:
trunk/.bzr/
trunk/.bzr/README
trunk/.bzr/branch/
trunk/.bzr/branch-format
trunk/.bzr/branch-lock/
trunk/.bzr/branch/branch-name
trunk/.bzr/branch/format
trunk/.bzr/branch/lock/
trunk/.bzr/branch/revision-history
trunk/.bzr/checkout/
trunk/.bzr/checkout/conflicts
trunk/.bzr/checkout/dirstate (contents, props changed)
trunk/.bzr/checkout/format
trunk/.bzr/checkout/lock/
trunk/.bzr/repository/
trunk/.bzr/repository/format
trunk/.bzr/repository/inventory.kndx
trunk/.bzr/repository/inventory.knit (contents, props changed)
trunk/.bzr/repository/knits/
trunk/.bzr/repository/knits/3b/
trunk/.bzr/repository/knits/3b/b_doclet.vala-20080218204957-pl3fx0hj0l1su78a-10.kndx
trunk/.bzr/repository/knits/3b/b_doclet.vala-20080218204957-pl3fx0hj0l1su78a-10.knit (contents, props changed)
trunk/.bzr/repository/knits/3f/
trunk/.bzr/repository/knits/3f/makefile-20080218204957-pl3fx0hj0l1su78a-5.kndx
trunk/.bzr/repository/knits/3f/makefile-20080218204957-pl3fx0hj0l1su78a-5.knit (contents, props changed)
trunk/.bzr/repository/knits/44/
trunk/.bzr/repository/knits/44/b_taglet.vala-20080218204957-pl3fx0hj0l1su78a-13.kndx
trunk/.bzr/repository/knits/44/b_taglet.vala-20080218204957-pl3fx0hj0l1su78a-13.knit (contents, props changed)
trunk/.bzr/repository/knits/46/
trunk/.bzr/repository/knits/46/b_drawer.vala-20080218204957-pl3fx0hj0l1su78a-11.kndx
trunk/.bzr/repository/knits/46/b_drawer.vala-20080218204957-pl3fx0hj0l1su78a-11.knit (contents, props changed)
trunk/.bzr/repository/knits/46/settings.vala-20080218204957-pl3fx0hj0l1su78a-7.kndx
trunk/.bzr/repository/knits/46/settings.vala-20080218204957-pl3fx0hj0l1su78a-7.knit (contents, props changed)
trunk/.bzr/repository/knits/61/
trunk/.bzr/repository/knits/61/parser.vala-20080218204957-pl3fx0hj0l1su78a-6.kndx
trunk/.bzr/repository/knits/61/parser.vala-20080218204957-pl3fx0hj0l1su78a-6.knit (contents, props changed)
trunk/.bzr/repository/knits/6e/
trunk/.bzr/repository/knits/6e/errorreporter.vala-20080218204957-pl3fx0hj0l1su78a-3.kndx
trunk/.bzr/repository/knits/6e/errorreporter.vala-20080218204957-pl3fx0hj0l1su78a-3.knit (contents, props changed)
trunk/.bzr/repository/knits/7e/
trunk/.bzr/repository/knits/7e/doclet.vala-20080218204957-pl3fx0hj0l1su78a-14.kndx
trunk/.bzr/repository/knits/7e/doclet.vala-20080218204957-pl3fx0hj0l1su78a-14.knit (contents, props changed)
trunk/.bzr/repository/knits/85/
trunk/.bzr/repository/knits/85/helper.vala-20080218204957-pl3fx0hj0l1su78a-16.kndx
trunk/.bzr/repository/knits/85/helper.vala-20080218204957-pl3fx0hj0l1su78a-16.knit (contents, props changed)
trunk/.bzr/repository/knits/88/
trunk/.bzr/repository/knits/88/taglet.vala-20080218204957-pl3fx0hj0l1su78a-18.kndx
trunk/.bzr/repository/knits/88/taglet.vala-20080218204957-pl3fx0hj0l1su78a-18.knit (contents, props changed)
trunk/.bzr/repository/knits/89/
trunk/.bzr/repository/knits/89/drawer.vala-20080218204957-pl3fx0hj0l1su78a-15.kndx
trunk/.bzr/repository/knits/89/drawer.vala-20080218204957-pl3fx0hj0l1su78a-15.knit (contents, props changed)
trunk/.bzr/repository/knits/a9/
trunk/.bzr/repository/knits/a9/b_langlet.vala-20080218204957-pl3fx0hj0l1su78a-12.kndx
trunk/.bzr/repository/knits/a9/b_langlet.vala-20080218204957-pl3fx0hj0l1su78a-12.knit (contents, props changed)
trunk/.bzr/repository/knits/b1/
trunk/.bzr/repository/knits/b1/valadoc.vala-20080218204957-pl3fx0hj0l1su78a-9.kndx
trunk/.bzr/repository/knits/b1/valadoc.vala-20080218204957-pl3fx0hj0l1su78a-9.knit (contents, props changed)
trunk/.bzr/repository/knits/b3/
trunk/.bzr/repository/knits/b3/drawer.vala-20080424040412-d6uhuycghl9gg0s7-1.kndx
trunk/.bzr/repository/knits/b3/drawer.vala-20080424040412-d6uhuycghl9gg0s7-1.knit (contents, props changed)
trunk/.bzr/repository/knits/b5/
trunk/.bzr/repository/knits/b5/html-20080218204957-pl3fx0hj0l1su78a-4.kndx
trunk/.bzr/repository/knits/b5/html-20080218204957-pl3fx0hj0l1su78a-4.knit (contents, props changed)
trunk/.bzr/repository/knits/b6/
trunk/.bzr/repository/knits/b6/doctree.vala-20080218204957-pl3fx0hj0l1su78a-2.kndx
trunk/.bzr/repository/knits/b6/doctree.vala-20080218204957-pl3fx0hj0l1su78a-2.knit (contents, props changed)
trunk/.bzr/repository/knits/de/
trunk/.bzr/repository/knits/de/valadoc-20080218204957-pl3fx0hj0l1su78a-8.kndx
trunk/.bzr/repository/knits/de/valadoc-20080218204957-pl3fx0hj0l1su78a-8.knit (contents, props changed)
trunk/.bzr/repository/knits/ed/
trunk/.bzr/repository/knits/ed/langlet.vala-20080218204957-pl3fx0hj0l1su78a-17.kndx
trunk/.bzr/repository/knits/ed/langlet.vala-20080218204957-pl3fx0hj0l1su78a-17.knit (contents, props changed)
trunk/.bzr/repository/knits/ff/
trunk/.bzr/repository/knits/ff/basic-20080218204957-pl3fx0hj0l1su78a-1.kndx
trunk/.bzr/repository/knits/ff/basic-20080218204957-pl3fx0hj0l1su78a-1.knit (contents, props changed)
trunk/.bzr/repository/lock/
trunk/.bzr/repository/revision-store/
trunk/.bzr/repository/revisions.kndx
trunk/.bzr/repository/revisions.knit (contents, props changed)
trunk/.bzr/repository/signatures.kndx
trunk/.bzr/repository/signatures.knit
trunk/MAINTAINERS
trunk/Makefile
trunk/basic/
trunk/basic/b_doclet.vala
trunk/basic/b_langlet.vala
trunk/basic/b_taglet.vala
trunk/doctree.vala
trunk/drawer.vala
trunk/errorreporter.vala
trunk/html/
trunk/html/doclet.vala
trunk/html/helper.vala
trunk/html/langlet.vala
trunk/html/taglet.vala
trunk/parser.vala
trunk/settings.vala
trunk/testcases/
trunk/testcases/comments/
trunk/testcases/definitions/
trunk/testcases/definitions/class.vala
trunk/testcases/definitions/enum.vala
trunk/testcases/definitions/errordomain.vala
trunk/testcases/definitions/interface.vala
trunk/testcases/definitions/structs.vala
trunk/testcases/test.vala
trunk/valadoc.vala
Added: trunk/.bzr/README
==============================================================================
--- (empty file)
+++ trunk/.bzr/README Sat Apr 26 14:47:35 2008
@@ -0,0 +1,2 @@
+This is a Bazaar-NG control directory.
+Do not change any files in this directory.
Added: trunk/.bzr/branch-format
==============================================================================
--- (empty file)
+++ trunk/.bzr/branch-format Sat Apr 26 14:47:35 2008
@@ -0,0 +1 @@
+Bazaar-NG meta directory, format 1
Added: trunk/.bzr/branch/branch-name
==============================================================================
Added: trunk/.bzr/branch/format
==============================================================================
--- (empty file)
+++ trunk/.bzr/branch/format Sat Apr 26 14:47:35 2008
@@ -0,0 +1 @@
+Bazaar-NG branch format 5
Added: trunk/.bzr/branch/revision-history
==============================================================================
--- (empty file)
+++ trunk/.bzr/branch/revision-history Sat Apr 26 14:47:35 2008
@@ -0,0 +1,22 @@
+mog mogus-20080219025336-1o8epuaixnvvbixu
+mog mogus-20080221231048-n2zzx3dgyhi1vf3a
+mog mogus-20080221232121-5n6d944d0m9hbttk
+mog mogus-20080223211435-9o0ds9fd7dt067zo
+mog mogus-20080226123107-gn4v9xrago59d78v
+mog mogus-20080226132751-oyf3l3n8mip5fkyl
+mog mogus-20080229011515-u63qsr7s69a8bppq
+mog mogus-20080303223549-yp040ocss4q1eivz
+mog mogus-20080304210421-sv90vgj62yzzw46m
+mog mogus-20080304221841-2lmtqa16w5bdrcm4
+mog mogus-20080304222554-b6zm4m9npkdi6l8e
+mog mogus-20080310002227-a16zz4yomvwsevjr
+mog mogus-20080313211424-i4ig63m3e8qqept9
+mog mogus-20080315221916-nsp28lrg966wxym3
+mog mogus-20080318032746-pnsfn44es29cfnlv
+mog mogus-20080318051946-0eph9zlly6rmga0w
+mog mogus-20080319003455-04im9z5daqkirfbf
+mog mogus-20080410234555-agzrp8fo5pvhzvws
+mog mogus-20080424034147-pfzigxi9z2xqu06r
+mog mogus-20080424040440-hk05q8t0rwycx5db
+mog mogus-20080424043045-os0x74v18yukiply
+mog mogus-20080424234249-moy3d3xfai13ve1h
\ No newline at end of file
Added: trunk/.bzr/checkout/conflicts
==============================================================================
--- (empty file)
+++ trunk/.bzr/checkout/conflicts Sat Apr 26 14:47:35 2008
@@ -0,0 +1 @@
+BZR conflict list format 1
Added: trunk/.bzr/checkout/dirstate
==============================================================================
Binary file. No diff available.
Added: trunk/.bzr/checkout/format
==============================================================================
--- (empty file)
+++ trunk/.bzr/checkout/format Sat Apr 26 14:47:35 2008
@@ -0,0 +1 @@
+Bazaar Working Tree Format 4 (bzr 0.15)
Added: trunk/.bzr/repository/format
==============================================================================
--- (empty file)
+++ trunk/.bzr/repository/format Sat Apr 26 14:47:35 2008
@@ -0,0 +1 @@
+Bazaar-NG Knit Repository Format 1
\ No newline at end of file
Added: trunk/.bzr/repository/inventory.kndx
==============================================================================
--- (empty file)
+++ trunk/.bzr/repository/inventory.kndx Sat Apr 26 14:47:35 2008
@@ -0,0 +1,35 @@
+# bzr knit index 8
+
+mog mogus-20080218211816-2nlpnze0t26036ln fulltext 0 995 :
+mog mogus-20080218214948-waaiakvi9osd561d fulltext 995 995 :
+mog mogus-20080219025110-48xzygetv0zuen9i fulltext 1990 1000 :
+mog mogus-20080219025336-1o8epuaixnvvbixu fulltext 2990 1001 :
+mog mogus-20080221231041-enezxqkos46ln8f9 line-delta 3991 481 3 :
+mog mogus-20080221231048-n2zzx3dgyhi1vf3a line-delta 4472 481 3 :
+mog mogus-20080221232121-5n6d944d0m9hbttk line-delta 4953 335 5 :
+mog mogus-20080223211435-9o0ds9fd7dt067zo line-delta 5288 435 6 :
+mog mogus-20080226123107-gn4v9xrago59d78v fulltext 5723 1060 7 :
+mog mogus-20080226132421-7z009n1zgkcg7f4h line-delta 6783 324 8 :
+mog mogus-20080226132455-4dan632yhr1ridjz line-delta 7107 324 8 :
+mog mogus-20080226132729-ha1rf94hduqi2l7f line-delta 7431 323 8 :
+mog mogus-20080226132751-oyf3l3n8mip5fkyl line-delta 7754 324 8 :
+mog mogus-20080229011515-u63qsr7s69a8bppq line-delta 8078 652 12 :
+mog mogus-20080303223519-udgzruh11hzcyxkg line-delta 8730 425 13 :
+mog mogus-20080303223549-yp040ocss4q1eivz line-delta 9155 423 13 :
+mog mogus-20080304210421-sv90vgj62yzzw46m fulltext 9578 1030 15 :
+mog mogus-20080304221841-2lmtqa16w5bdrcm4 line-delta 10608 320 16 :
+mog mogus-20080304222554-b6zm4m9npkdi6l8e line-delta 10928 270 17 :
+mog mogus-20080310002146-eyl11a5ey2qqs9ll line-delta 11198 375 18 :
+mog mogus-20080310002227-a16zz4yomvwsevjr line-delta 11573 376 18 :
+mog mogus-20080313211424-i4ig63m3e8qqept9 line-delta 11949 424 20 :
+mog mogus-20080315221900-c4rmpw8qfjlg9087 fulltext 12373 1063 21 :
+mog mogus-20080315221916-nsp28lrg966wxym3 fulltext 13436 1064 21 :
+mog mogus-20080318032746-pnsfn44es29cfnlv line-delta 14500 422 23 :
+mog mogus-20080318051946-0eph9zlly6rmga0w line-delta 14922 254 24 :
+mog mogus-20080319003455-04im9z5daqkirfbf line-delta 15176 429 25 :
+mog mogus-20080410234555-agzrp8fo5pvhzvws fulltext 15605 939 26 :
+mog mogus-20080424034147-pfzigxi9z2xqu06r line-delta 16544 795 27 :
+mog mogus-20080424035709-2ucwc9zukta8mh3r line-delta 17339 256 28 :
+mog mogus-20080424040440-hk05q8t0rwycx5db line-delta 17595 321 28 :
+mog mogus-20080424043045-os0x74v18yukiply fulltext 17916 982 30 :
+mog mogus-20080424234249-moy3d3xfai13ve1h line-delta 18898 324 31 :
\ No newline at end of file
Added: trunk/.bzr/repository/inventory.knit
==============================================================================
Binary file. No diff available.
Added: trunk/.bzr/repository/knits/3b/b_doclet.vala-20080218204957-pl3fx0hj0l1su78a-10.kndx
==============================================================================
--- (empty file)
+++ trunk/.bzr/repository/knits/3b/b_doclet.vala-20080218204957-pl3fx0hj0l1su78a-10.kndx Sat Apr 26 14:47:35 2008
@@ -0,0 +1,6 @@
+# bzr knit index 8
+
+mog mogus-20080218211816-2nlpnze0t26036ln fulltext 0 1200 :
+mog mogus-20080218214948-waaiakvi9osd561d fulltext 1200 1199 :
+mog mogus-20080219025110-48xzygetv0zuen9i fulltext 2399 1201 :
+mog mogus-20080219025336-1o8epuaixnvvbixu fulltext 3600 1200 :
\ No newline at end of file
Added: trunk/.bzr/repository/knits/3b/b_doclet.vala-20080218204957-pl3fx0hj0l1su78a-10.knit
==============================================================================
Binary file. No diff available.
Added: trunk/.bzr/repository/knits/3f/makefile-20080218204957-pl3fx0hj0l1su78a-5.kndx
==============================================================================
--- (empty file)
+++ trunk/.bzr/repository/knits/3f/makefile-20080218204957-pl3fx0hj0l1su78a-5.kndx Sat Apr 26 14:47:35 2008
@@ -0,0 +1,8 @@
+# bzr knit index 8
+
+mog mogus-20080218211816-2nlpnze0t26036ln fulltext 0 350 :
+mog mogus-20080218214948-waaiakvi9osd561d fulltext 350 350 :
+mog mogus-20080219025110-48xzygetv0zuen9i fulltext 700 351 :
+mog mogus-20080219025336-1o8epuaixnvvbixu fulltext 1051 350 :
+mog mogus-20080410234555-agzrp8fo5pvhzvws line-delta 1401 157 3 :
+mog mogus-20080424034147-pfzigxi9z2xqu06r line-delta 1558 180 4 :
\ No newline at end of file
Added: trunk/.bzr/repository/knits/3f/makefile-20080218204957-pl3fx0hj0l1su78a-5.knit
==============================================================================
Binary file. No diff available.
Added: trunk/.bzr/repository/knits/44/b_taglet.vala-20080218204957-pl3fx0hj0l1su78a-13.kndx
==============================================================================
--- (empty file)
+++ trunk/.bzr/repository/knits/44/b_taglet.vala-20080218204957-pl3fx0hj0l1su78a-13.kndx Sat Apr 26 14:47:35 2008
@@ -0,0 +1,9 @@
+# bzr knit index 8
+
+mog mogus-20080218211816-2nlpnze0t26036ln fulltext 0 1019 :
+mog mogus-20080218214948-waaiakvi9osd561d fulltext 1019 1019 :
+mog mogus-20080219025110-48xzygetv0zuen9i fulltext 2038 1019 :
+mog mogus-20080219025336-1o8epuaixnvvbixu fulltext 3057 1019 :
+mog mogus-20080229011515-u63qsr7s69a8bppq line-delta 4076 164 3 :
+mog mogus-20080410234555-agzrp8fo5pvhzvws line-delta 4240 221 4 :
+mog mogus-20080424034147-pfzigxi9z2xqu06r line-delta 4461 198 5 :
\ No newline at end of file
Added: trunk/.bzr/repository/knits/44/b_taglet.vala-20080218204957-pl3fx0hj0l1su78a-13.knit
==============================================================================
Binary file. No diff available.
Added: trunk/.bzr/repository/knits/46/b_drawer.vala-20080218204957-pl3fx0hj0l1su78a-11.kndx
==============================================================================
--- (empty file)
+++ trunk/.bzr/repository/knits/46/b_drawer.vala-20080218204957-pl3fx0hj0l1su78a-11.kndx Sat Apr 26 14:47:35 2008
@@ -0,0 +1,6 @@
+# bzr knit index 8
+
+mog mogus-20080218211816-2nlpnze0t26036ln fulltext 0 297 :
+mog mogus-20080218214948-waaiakvi9osd561d fulltext 297 298 :
+mog mogus-20080219025110-48xzygetv0zuen9i fulltext 595 299 :
+mog mogus-20080219025336-1o8epuaixnvvbixu fulltext 894 298 :
\ No newline at end of file
Added: trunk/.bzr/repository/knits/46/b_drawer.vala-20080218204957-pl3fx0hj0l1su78a-11.knit
==============================================================================
Binary file. No diff available.
Added: trunk/.bzr/repository/knits/46/settings.vala-20080218204957-pl3fx0hj0l1su78a-7.kndx
==============================================================================
--- (empty file)
+++ trunk/.bzr/repository/knits/46/settings.vala-20080218204957-pl3fx0hj0l1su78a-7.kndx Sat Apr 26 14:47:35 2008
@@ -0,0 +1,10 @@
+# bzr knit index 8
+
+mog mogus-20080218211816-2nlpnze0t26036ln fulltext 0 817 :
+mog mogus-20080218214948-waaiakvi9osd561d fulltext 817 817 :
+mog mogus-20080219025110-48xzygetv0zuen9i fulltext 1634 815 :
+mog mogus-20080219025336-1o8epuaixnvvbixu fulltext 2449 816 :
+mog mogus-20080229011515-u63qsr7s69a8bppq line-delta 3265 180 3 :
+mog mogus-20080310002146-eyl11a5ey2qqs9ll line-delta 3445 254 4 :
+mog mogus-20080310002227-a16zz4yomvwsevjr line-delta 3699 255 4 :
+mog mogus-20080424034147-pfzigxi9z2xqu06r line-delta 3954 152 6 :
\ No newline at end of file
Added: trunk/.bzr/repository/knits/46/settings.vala-20080218204957-pl3fx0hj0l1su78a-7.knit
==============================================================================
Binary file. No diff available.
Added: trunk/.bzr/repository/knits/61/parser.vala-20080218204957-pl3fx0hj0l1su78a-6.kndx
==============================================================================
--- (empty file)
+++ trunk/.bzr/repository/knits/61/parser.vala-20080218204957-pl3fx0hj0l1su78a-6.kndx Sat Apr 26 14:47:35 2008
@@ -0,0 +1,16 @@
+# bzr knit index 8
+
+mog mogus-20080218211816-2nlpnze0t26036ln fulltext 0 3328 :
+mog mogus-20080218214948-waaiakvi9osd561d fulltext 3328 3328 :
+mog mogus-20080219025110-48xzygetv0zuen9i fulltext 6656 3327 :
+mog mogus-20080219025336-1o8epuaixnvvbixu fulltext 9983 3328 :
+mog mogus-20080226132421-7z009n1zgkcg7f4h line-delta 13311 178 3 :
+mog mogus-20080226132455-4dan632yhr1ridjz line-delta 13489 176 3 :
+mog mogus-20080226132729-ha1rf94hduqi2l7f line-delta 13665 176 3 :
+mog mogus-20080226132751-oyf3l3n8mip5fkyl line-delta 13841 177 3 :
+mog mogus-20080229011515-u63qsr7s69a8bppq line-delta 14018 300 7 :
+mog mogus-20080303223519-udgzruh11hzcyxkg line-delta 14318 253 8 :
+mog mogus-20080303223549-yp040ocss4q1eivz line-delta 14571 253 8 :
+mog mogus-20080318032746-pnsfn44es29cfnlv line-delta 14824 390 10 :
+mog mogus-20080410234555-agzrp8fo5pvhzvws line-delta 15214 150 11 :
+mog mogus-20080424034147-pfzigxi9z2xqu06r line-delta 15364 380 12 :
\ No newline at end of file
Added: trunk/.bzr/repository/knits/61/parser.vala-20080218204957-pl3fx0hj0l1su78a-6.knit
==============================================================================
Binary file. No diff available.
Added: trunk/.bzr/repository/knits/6e/errorreporter.vala-20080218204957-pl3fx0hj0l1su78a-3.kndx
==============================================================================
--- (empty file)
+++ trunk/.bzr/repository/knits/6e/errorreporter.vala-20080218204957-pl3fx0hj0l1su78a-3.kndx Sat Apr 26 14:47:35 2008
@@ -0,0 +1,8 @@
+# bzr knit index 8
+
+mog mogus-20080218211816-2nlpnze0t26036ln fulltext 0 1430 :
+mog mogus-20080218214948-waaiakvi9osd561d fulltext 1430 1430 :
+mog mogus-20080219025110-48xzygetv0zuen9i fulltext 2860 1430 :
+mog mogus-20080219025336-1o8epuaixnvvbixu fulltext 4290 1430 :
+mog mogus-20080226123107-gn4v9xrago59d78v line-delta 5720 287 3 :
+mog mogus-20080424034147-pfzigxi9z2xqu06r line-delta 6007 304 4 :
\ No newline at end of file
Added: trunk/.bzr/repository/knits/6e/errorreporter.vala-20080218204957-pl3fx0hj0l1su78a-3.knit
==============================================================================
Binary file. No diff available.
Added: trunk/.bzr/repository/knits/7e/doclet.vala-20080218204957-pl3fx0hj0l1su78a-14.kndx
==============================================================================
--- (empty file)
+++ trunk/.bzr/repository/knits/7e/doclet.vala-20080218204957-pl3fx0hj0l1su78a-14.kndx Sat Apr 26 14:47:35 2008
@@ -0,0 +1,22 @@
+# bzr knit index 8
+
+mog mogus-20080218211816-2nlpnze0t26036ln fulltext 0 5658 :
+mog mogus-20080218214948-waaiakvi9osd561d fulltext 5658 5659 :
+mog mogus-20080219025110-48xzygetv0zuen9i fulltext 11317 5687 :
+mog mogus-20080219025336-1o8epuaixnvvbixu fulltext 17004 5687 :
+mog mogus-20080221231041-enezxqkos46ln8f9 line-delta 22691 476 3 :
+mog mogus-20080221231048-n2zzx3dgyhi1vf3a line-delta 23167 474 3 :
+mog mogus-20080229011515-u63qsr7s69a8bppq line-delta 23641 444 5 :
+mog mogus-20080303223519-udgzruh11hzcyxkg line-delta 24085 1801 6 :
+mog mogus-20080303223549-yp040ocss4q1eivz line-delta 25886 1801 6 :
+mog mogus-20080304210421-sv90vgj62yzzw46m line-delta 27687 345 8 :
+mog mogus-20080304221841-2lmtqa16w5bdrcm4 line-delta 28032 421 9 :
+mog mogus-20080304222554-b6zm4m9npkdi6l8e line-delta 28453 189 10 :
+mog mogus-20080310002146-eyl11a5ey2qqs9ll line-delta 28642 3782 11 :
+mog mogus-20080310002227-a16zz4yomvwsevjr line-delta 32424 3784 11 :
+mog mogus-20080313211424-i4ig63m3e8qqept9 fulltext 36208 8787 13 :
+mog mogus-20080315221900-c4rmpw8qfjlg9087 line-delta 44995 118 14 :
+mog mogus-20080315221916-nsp28lrg966wxym3 line-delta 45113 119 14 :
+mog mogus-20080319003455-04im9z5daqkirfbf line-delta 45232 1182 16 :
+mog mogus-20080410234555-agzrp8fo5pvhzvws line-delta 46414 639 17 :
+mog mogus-20080424034147-pfzigxi9z2xqu06r line-delta 47053 1580 18 :
\ No newline at end of file
Added: trunk/.bzr/repository/knits/7e/doclet.vala-20080218204957-pl3fx0hj0l1su78a-14.knit
==============================================================================
Binary file. No diff available.
Added: trunk/.bzr/repository/knits/85/helper.vala-20080218204957-pl3fx0hj0l1su78a-16.kndx
==============================================================================
--- (empty file)
+++ trunk/.bzr/repository/knits/85/helper.vala-20080218204957-pl3fx0hj0l1su78a-16.kndx Sat Apr 26 14:47:35 2008
@@ -0,0 +1,10 @@
+# bzr knit index 8
+
+mog mogus-20080218211816-2nlpnze0t26036ln fulltext 0 961 :
+mog mogus-20080218214948-waaiakvi9osd561d fulltext 961 961 :
+mog mogus-20080219025110-48xzygetv0zuen9i fulltext 1922 961 :
+mog mogus-20080219025336-1o8epuaixnvvbixu fulltext 2883 961 :
+mog mogus-20080229011515-u63qsr7s69a8bppq line-delta 3844 229 3 :
+mog mogus-20080313211424-i4ig63m3e8qqept9 line-delta 4073 438 4 :
+mog mogus-20080410234555-agzrp8fo5pvhzvws line-delta 4511 509 5 :
+mog mogus-20080424034147-pfzigxi9z2xqu06r fulltext 5020 1457 6 :
\ No newline at end of file
Added: trunk/.bzr/repository/knits/85/helper.vala-20080218204957-pl3fx0hj0l1su78a-16.knit
==============================================================================
Binary file. No diff available.
Added: trunk/.bzr/repository/knits/88/taglet.vala-20080218204957-pl3fx0hj0l1su78a-18.kndx
==============================================================================
--- (empty file)
+++ trunk/.bzr/repository/knits/88/taglet.vala-20080218204957-pl3fx0hj0l1su78a-18.kndx Sat Apr 26 14:47:35 2008
@@ -0,0 +1,18 @@
+# bzr knit index 8
+
+mog mogus-20080218211816-2nlpnze0t26036ln fulltext 0 1887 :
+mog mogus-20080218214948-waaiakvi9osd561d fulltext 1887 1887 :
+mog mogus-20080219025110-48xzygetv0zuen9i fulltext 3774 1887 :
+mog mogus-20080219025336-1o8epuaixnvvbixu fulltext 5661 1888 :
+mog mogus-20080223211435-9o0ds9fd7dt067zo line-delta 7549 306 3 :
+mog mogus-20080226123107-gn4v9xrago59d78v line-delta 7855 276 4 :
+mog mogus-20080226132421-7z009n1zgkcg7f4h line-delta 8131 1090 5 :
+mog mogus-20080226132455-4dan632yhr1ridjz line-delta 9221 1090 5 :
+mog mogus-20080226132729-ha1rf94hduqi2l7f line-delta 10311 1089 5 :
+mog mogus-20080226132751-oyf3l3n8mip5fkyl line-delta 11400 1089 5 :
+mog mogus-20080229011515-u63qsr7s69a8bppq line-delta 12489 454 9 :
+mog mogus-20080303223519-udgzruh11hzcyxkg fulltext 12943 2449 10 :
+mog mogus-20080303223549-yp040ocss4q1eivz fulltext 15392 2448 10 :
+mog mogus-20080318032746-pnsfn44es29cfnlv line-delta 17840 702 12 :
+mog mogus-20080410234555-agzrp8fo5pvhzvws line-delta 18542 152 13 :
+mog mogus-20080424034147-pfzigxi9z2xqu06r line-delta 18694 497 14 :
\ No newline at end of file
Added: trunk/.bzr/repository/knits/88/taglet.vala-20080218204957-pl3fx0hj0l1su78a-18.knit
==============================================================================
Binary file. No diff available.
Added: trunk/.bzr/repository/knits/89/drawer.vala-20080218204957-pl3fx0hj0l1su78a-15.kndx
==============================================================================
--- (empty file)
+++ trunk/.bzr/repository/knits/89/drawer.vala-20080218204957-pl3fx0hj0l1su78a-15.kndx Sat Apr 26 14:47:35 2008
@@ -0,0 +1,6 @@
+# bzr knit index 8
+
+mog mogus-20080218211816-2nlpnze0t26036ln fulltext 0 407 :
+mog mogus-20080218214948-waaiakvi9osd561d fulltext 407 407 :
+mog mogus-20080219025110-48xzygetv0zuen9i fulltext 814 414 :
+mog mogus-20080219025336-1o8epuaixnvvbixu fulltext 1228 414 :
\ No newline at end of file
Added: trunk/.bzr/repository/knits/89/drawer.vala-20080218204957-pl3fx0hj0l1su78a-15.knit
==============================================================================
Binary file. No diff available.
Added: trunk/.bzr/repository/knits/a9/b_langlet.vala-20080218204957-pl3fx0hj0l1su78a-12.kndx
==============================================================================
--- (empty file)
+++ trunk/.bzr/repository/knits/a9/b_langlet.vala-20080218204957-pl3fx0hj0l1su78a-12.kndx Sat Apr 26 14:47:35 2008
@@ -0,0 +1,8 @@
+# bzr knit index 8
+
+mog mogus-20080218211816-2nlpnze0t26036ln fulltext 0 996 :
+mog mogus-20080218214948-waaiakvi9osd561d fulltext 996 996 :
+mog mogus-20080219025110-48xzygetv0zuen9i fulltext 1992 997 :
+mog mogus-20080219025336-1o8epuaixnvvbixu fulltext 2989 998 :
+mog mogus-20080319003455-04im9z5daqkirfbf line-delta 3987 216 3 :
+mog mogus-20080424034147-pfzigxi9z2xqu06r line-delta 4203 566 4 :
\ No newline at end of file
Added: trunk/.bzr/repository/knits/a9/b_langlet.vala-20080218204957-pl3fx0hj0l1su78a-12.knit
==============================================================================
Binary file. No diff available.
Added: trunk/.bzr/repository/knits/b1/valadoc.vala-20080218204957-pl3fx0hj0l1su78a-9.kndx
==============================================================================
--- (empty file)
+++ trunk/.bzr/repository/knits/b1/valadoc.vala-20080218204957-pl3fx0hj0l1su78a-9.kndx Sat Apr 26 14:47:35 2008
@@ -0,0 +1,16 @@
+# bzr knit index 8
+
+mog mogus-20080218211816-2nlpnze0t26036ln fulltext 0 3429 :
+mog mogus-20080218214948-waaiakvi9osd561d fulltext 3429 3428 :
+mog mogus-20080219025110-48xzygetv0zuen9i fulltext 6857 3428 :
+mog mogus-20080219025336-1o8epuaixnvvbixu fulltext 10285 3429 :
+mog mogus-20080221231041-enezxqkos46ln8f9 line-delta 13714 163 3 :
+mog mogus-20080221231048-n2zzx3dgyhi1vf3a line-delta 13877 163 3 :
+mog mogus-20080226123107-gn4v9xrago59d78v line-delta 14040 263 5 :
+mog mogus-20080229011515-u63qsr7s69a8bppq line-delta 14303 524 6 :
+mog mogus-20080315221900-c4rmpw8qfjlg9087 line-delta 14827 292 7 :
+mog mogus-20080315221916-nsp28lrg966wxym3 line-delta 15119 292 7 :
+mog mogus-20080318032746-pnsfn44es29cfnlv line-delta 15411 212 9 :
+mog mogus-20080410234555-agzrp8fo5pvhzvws line-delta 15623 134 10 :
+mog mogus-20080424034147-pfzigxi9z2xqu06r line-delta 15757 210 11 :
+mog mogus-20080424043045-os0x74v18yukiply line-delta 15967 480 12 :
\ No newline at end of file
Added: trunk/.bzr/repository/knits/b1/valadoc.vala-20080218204957-pl3fx0hj0l1su78a-9.knit
==============================================================================
Binary file. No diff available.
Added: trunk/.bzr/repository/knits/b3/drawer.vala-20080424040412-d6uhuycghl9gg0s7-1.kndx
==============================================================================
--- (empty file)
+++ trunk/.bzr/repository/knits/b3/drawer.vala-20080424040412-d6uhuycghl9gg0s7-1.kndx Sat Apr 26 14:47:35 2008
@@ -0,0 +1,3 @@
+# bzr knit index 8
+
+mog mogus-20080424040440-hk05q8t0rwycx5db fulltext 0 1611 :
\ No newline at end of file
Added: trunk/.bzr/repository/knits/b3/drawer.vala-20080424040412-d6uhuycghl9gg0s7-1.knit
==============================================================================
Binary file. No diff available.
Added: trunk/.bzr/repository/knits/b5/html-20080218204957-pl3fx0hj0l1su78a-4.kndx
==============================================================================
--- (empty file)
+++ trunk/.bzr/repository/knits/b5/html-20080218204957-pl3fx0hj0l1su78a-4.kndx Sat Apr 26 14:47:35 2008
@@ -0,0 +1,6 @@
+# bzr knit index 8
+
+mog mogus-20080218211816-2nlpnze0t26036ln fulltext 0 113 :
+mog mogus-20080218214948-waaiakvi9osd561d fulltext 113 112 :
+mog mogus-20080219025110-48xzygetv0zuen9i fulltext 225 111 :
+mog mogus-20080219025336-1o8epuaixnvvbixu fulltext 336 112 :
\ No newline at end of file
Added: trunk/.bzr/repository/knits/b5/html-20080218204957-pl3fx0hj0l1su78a-4.knit
==============================================================================
Binary file. No diff available.
Added: trunk/.bzr/repository/knits/b6/doctree.vala-20080218204957-pl3fx0hj0l1su78a-2.kndx
==============================================================================
--- (empty file)
+++ trunk/.bzr/repository/knits/b6/doctree.vala-20080218204957-pl3fx0hj0l1su78a-2.kndx Sat Apr 26 14:47:35 2008
@@ -0,0 +1,27 @@
+# bzr knit index 8
+
+mog mogus-20080218211816-2nlpnze0t26036ln fulltext 0 10610 :
+mog mogus-20080218214948-waaiakvi9osd561d fulltext 10610 10609 :
+mog mogus-20080219025110-48xzygetv0zuen9i fulltext 21219 10627 :
+mog mogus-20080219025336-1o8epuaixnvvbixu fulltext 31846 10627 :
+mog mogus-20080221231041-enezxqkos46ln8f9 line-delta 42473 1684 3 :
+mog mogus-20080221231048-n2zzx3dgyhi1vf3a line-delta 44157 1685 3 :
+mog mogus-20080223211435-9o0ds9fd7dt067zo line-delta 45842 1144 5 :
+mog mogus-20080226123107-gn4v9xrago59d78v line-delta 46986 1312 6 :
+mog mogus-20080229011515-u63qsr7s69a8bppq line-delta 48298 1786 7 :
+mog mogus-20080303223519-udgzruh11hzcyxkg line-delta 50084 974 8 :
+mog mogus-20080303223549-yp040ocss4q1eivz line-delta 51058 971 8 :
+mog mogus-20080304221841-2lmtqa16w5bdrcm4 line-delta 52029 360 10 :
+mog mogus-20080310002146-eyl11a5ey2qqs9ll line-delta 52389 1796 11 :
+mog mogus-20080310002227-a16zz4yomvwsevjr line-delta 54185 1797 11 :
+mog mogus-20080313211424-i4ig63m3e8qqept9 line-delta 55982 4073 13 :
+mog mogus-20080315221900-c4rmpw8qfjlg9087 fulltext 60055 14879 14 :
+mog mogus-20080315221916-nsp28lrg966wxym3 fulltext 74934 14881 14 :
+mog mogus-20080318032746-pnsfn44es29cfnlv line-delta 89815 755 16 :
+mog mogus-20080318051946-0eph9zlly6rmga0w line-delta 90570 489 17 :
+mog mogus-20080319003455-04im9z5daqkirfbf line-delta 91059 1632 18 :
+mog mogus-20080410234555-agzrp8fo5pvhzvws line-delta 92691 1171 19 :
+mog mogus-20080424034147-pfzigxi9z2xqu06r line-delta 93862 6314 20 :
+mog mogus-20080424035709-2ucwc9zukta8mh3r line-delta 100176 126 21 :
+mog mogus-20080424040440-hk05q8t0rwycx5db line-delta 100302 125 21 :
+mog mogus-20080424234249-moy3d3xfai13ve1h line-delta 100427 310 23 :
\ No newline at end of file
Added: trunk/.bzr/repository/knits/b6/doctree.vala-20080218204957-pl3fx0hj0l1su78a-2.knit
==============================================================================
Binary file. No diff available.
Added: trunk/.bzr/repository/knits/de/valadoc-20080218204957-pl3fx0hj0l1su78a-8.kndx
==============================================================================
--- (empty file)
+++ trunk/.bzr/repository/knits/de/valadoc-20080218204957-pl3fx0hj0l1su78a-8.kndx Sat Apr 26 14:47:35 2008
@@ -0,0 +1,11 @@
+# bzr knit index 8
+
+mog mogus-20080218211816-2nlpnze0t26036ln no-eol,fulltext 0 125536 :
+mog mogus-20080218214948-waaiakvi9osd561d no-eol,fulltext 125536 125536 :
+mog mogus-20080219025110-48xzygetv0zuen9i no-eol,fulltext 251072 125788 :
+mog mogus-20080219025336-1o8epuaixnvvbixu no-eol,fulltext 376860 125792 :
+mog mogus-20080221231041-enezxqkos46ln8f9 no-eol,line-delta 502652 124009 3 :
+mog mogus-20080221231048-n2zzx3dgyhi1vf3a no-eol,line-delta 626661 124011 3 :
+mog mogus-20080221232121-5n6d944d0m9hbttk no-eol,line-delta 750672 119359 5 :
+mog mogus-20080223211435-9o0ds9fd7dt067zo no-eol,fulltext 870031 127404 6 :
+mog mogus-20080226123107-gn4v9xrago59d78v no-eol,line-delta 997435 127349 7 :
\ No newline at end of file
Added: trunk/.bzr/repository/knits/de/valadoc-20080218204957-pl3fx0hj0l1su78a-8.knit
==============================================================================
Binary file. No diff available.
Added: trunk/.bzr/repository/knits/ed/langlet.vala-20080218204957-pl3fx0hj0l1su78a-17.kndx
==============================================================================
--- (empty file)
+++ trunk/.bzr/repository/knits/ed/langlet.vala-20080218204957-pl3fx0hj0l1su78a-17.kndx Sat Apr 26 14:47:35 2008
@@ -0,0 +1,16 @@
+# bzr knit index 8
+
+mog mogus-20080218211816-2nlpnze0t26036ln fulltext 0 3577 :
+mog mogus-20080218214948-waaiakvi9osd561d fulltext 3577 3576 :
+mog mogus-20080219025110-48xzygetv0zuen9i fulltext 7153 3574 :
+mog mogus-20080219025336-1o8epuaixnvvbixu fulltext 10727 3578 :
+mog mogus-20080221231041-enezxqkos46ln8f9 line-delta 14305 989 3 :
+mog mogus-20080221231048-n2zzx3dgyhi1vf3a line-delta 15294 989 3 :
+mog mogus-20080221232121-5n6d944d0m9hbttk line-delta 16283 176 5 :
+mog mogus-20080223211435-9o0ds9fd7dt067zo line-delta 16459 186 6 :
+mog mogus-20080229011515-u63qsr7s69a8bppq line-delta 16645 824 7 :
+mog mogus-20080313211424-i4ig63m3e8qqept9 line-delta 17469 160 8 :
+mog mogus-20080319003455-04im9z5daqkirfbf line-delta 17629 339 9 :
+mog mogus-20080410234555-agzrp8fo5pvhzvws line-delta 17968 246 10 :
+mog mogus-20080424034147-pfzigxi9z2xqu06r line-delta 18214 1422 11 :
+mog mogus-20080424234249-moy3d3xfai13ve1h fulltext 19636 4792 12 :
\ No newline at end of file
Added: trunk/.bzr/repository/knits/ed/langlet.vala-20080218204957-pl3fx0hj0l1su78a-17.knit
==============================================================================
Binary file. No diff available.
Added: trunk/.bzr/repository/knits/ff/basic-20080218204957-pl3fx0hj0l1su78a-1.kndx
==============================================================================
--- (empty file)
+++ trunk/.bzr/repository/knits/ff/basic-20080218204957-pl3fx0hj0l1su78a-1.kndx Sat Apr 26 14:47:35 2008
@@ -0,0 +1,6 @@
+# bzr knit index 8
+
+mog mogus-20080218211816-2nlpnze0t26036ln fulltext 0 113 :
+mog mogus-20080218214948-waaiakvi9osd561d fulltext 113 112 :
+mog mogus-20080219025110-48xzygetv0zuen9i fulltext 225 111 :
+mog mogus-20080219025336-1o8epuaixnvvbixu fulltext 336 112 :
\ No newline at end of file
Added: trunk/.bzr/repository/knits/ff/basic-20080218204957-pl3fx0hj0l1su78a-1.knit
==============================================================================
Binary file. No diff available.
Added: trunk/.bzr/repository/revisions.kndx
==============================================================================
--- (empty file)
+++ trunk/.bzr/repository/revisions.kndx Sat Apr 26 14:47:35 2008
@@ -0,0 +1,24 @@
+# bzr knit index 8
+
+mog mogus-20080219025336-1o8epuaixnvvbixu fulltext 0 296 :
+mog mogus-20080221231048-n2zzx3dgyhi1vf3a fulltext 296 331 0 :
+mog mogus-20080221232121-5n6d944d0m9hbttk fulltext 627 339 1 :
+mog mogus-20080223211435-9o0ds9fd7dt067zo fulltext 966 396 2 :
+mog mogus-20080226123107-gn4v9xrago59d78v fulltext 1362 346 3 :
+mog mogus-20080226132751-oyf3l3n8mip5fkyl fulltext 1708 332 4 :
+mog mogus-20080229011515-u63qsr7s69a8bppq fulltext 2040 338 5 :
+mog mogus-20080303223549-yp040ocss4q1eivz fulltext 2378 333 6 :
+mog mogus-20080304210421-sv90vgj62yzzw46m fulltext 2711 355 7 :
+mog mogus-20080304221841-2lmtqa16w5bdrcm4 fulltext 3066 334 8 :
+mog mogus-20080304222554-b6zm4m9npkdi6l8e fulltext 3400 325 9 :
+mog mogus-20080310002227-a16zz4yomvwsevjr fulltext 3725 334 10 :
+mog mogus-20080313211424-i4ig63m3e8qqept9 fulltext 4059 343 11 :
+mog mogus-20080315221916-nsp28lrg966wxym3 fulltext 4402 334 12 :
+mog mogus-20080318032746-pnsfn44es29cfnlv fulltext 4736 335 13 :
+mog mogus-20080318051946-0eph9zlly6rmga0w fulltext 5071 334 14 :
+mog mogus-20080319003455-04im9z5daqkirfbf fulltext 5405 338 15 :
+mog mogus-20080410234555-agzrp8fo5pvhzvws fulltext 5743 350 16 :
+mog mogus-20080424034147-pfzigxi9z2xqu06r fulltext 6093 586 17 :
+mog mogus-20080424040440-hk05q8t0rwycx5db fulltext 6679 326 18 :
+mog mogus-20080424043045-os0x74v18yukiply fulltext 7005 371 19 :
+mog mogus-20080424234249-moy3d3xfai13ve1h fulltext 7376 331 20 :
\ No newline at end of file
Added: trunk/.bzr/repository/revisions.knit
==============================================================================
Binary file. No diff available.
Added: trunk/.bzr/repository/signatures.kndx
==============================================================================
--- (empty file)
+++ trunk/.bzr/repository/signatures.kndx Sat Apr 26 14:47:35 2008
@@ -0,0 +1 @@
+# bzr knit index 8
Added: trunk/.bzr/repository/signatures.knit
==============================================================================
Added: trunk/MAINTAINERS
==============================================================================
--- (empty file)
+++ trunk/MAINTAINERS Sat Apr 26 14:47:35 2008
@@ -0,0 +1,4 @@
+Florian Brosch
+E-mail: flo brosch gmail com
+Userid: flobrosch
+
Added: trunk/Makefile
==============================================================================
--- (empty file)
+++ trunk/Makefile Sat Apr 26 14:47:35 2008
@@ -0,0 +1,31 @@
+#pkg-config --variable=vapidir vala-1.0
+
+# G_DEBUG=fatal_warnings
+
+NULL =
+
+SOURCES = \
+ html/taglet.vala \
+ html/helper.vala \
+ basic/b_taglet.vala \
+ errorreporter.vala \
+ settings.vala \
+ parser.vala \
+ doctree.vala \
+ valadoc.vala \
+ basic/b_langlet.vala \
+ html/langlet.vala \
+ html/doclet.vala \
+ drawer.vala \
+ $(NULL)
+
+PACKAGES = \
+ --pkg vala-1.0 \
+ --pkg cairo --disable-non-null \
+ $(NULL)
+
+
+prog:
+ valac -o valadoc $(SOURCES) $(PACKAGES)
+
+
Added: trunk/basic/b_doclet.vala
==============================================================================
--- (empty file)
+++ trunk/basic/b_doclet.vala Sat Apr 26 14:47:35 2008
@@ -0,0 +1,186 @@
+/*
+ * Valadoc - a documentation tool for vala.
+ * Copyright (C) 2008 Florian Brosch
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+
+using Valadoc;
+using GLib;
+
+
+
+public class Valadoc.Doclet : Object {
+ public Doclet ( construct Langlet langlet, construct Settings settings ) {
+ }
+
+ public virtual void initialisation ( ) {
+ }
+
+ protected Langlet langlet {
+ construct set;
+ get;
+ }
+
+ protected Settings settings {
+ construct set;
+ get;
+ }
+
+ public virtual void file_block_start ( ) {
+ }
+
+ public virtual void file_block_end ( ) {
+ }
+
+ public virtual void namespace_block_start ( ) {
+ }
+
+ public virtual void namespace_block_end ( ) {
+ }
+
+ public virtual void global_field_block_start ( Gee.Collection<Valadoc.Field> fields ) {
+ }
+
+ public virtual void global_field_block_end ( Gee.Collection<Valadoc.Field> fields ) {
+ }
+
+ public virtual void global_method_block_start ( Gee.Collection<Valadoc.Method> methods ) {
+ }
+
+ public virtual void global_method_block_end ( Gee.Collection<Valadoc.Method> methods ) {
+ }
+
+ public virtual void method_block_start ( Gee.Collection<Valadoc.Method> methods ) {
+ }
+
+ public virtual void method_block_end ( Gee.Collection<Valadoc.Method> methods ) {
+ }
+
+ public virtual void field_block_start ( Gee.Collection<Valadoc.Field> fields ) {
+ }
+
+ public virtual void field_block_end ( Gee.Collection<Valadoc.Field> fields ) {
+ }
+
+ public virtual void enum_value_block_start ( Gee.Collection<Valadoc.EnumValue> envals ) {
+ }
+
+ public virtual void enum_value_block_end ( Gee.Collection<Valadoc.EnumValue> envals ) {
+ }
+
+ public virtual void delegate_block_start ( Gee.Collection<Valadoc.Delegate> delegates ) {
+ }
+
+ public virtual void delegate_block_end ( Gee.Collection<Valadoc.Delegate> delegates ) {
+ }
+
+ public virtual void enum_block_start ( Gee.Collection<Valadoc.Enum> enums ) {
+ }
+
+ public virtual void enum_block_end ( Gee.Collection<Valadoc.Enum> enums ) {
+ }
+
+ public virtual void interface_block_start ( Gee.Collection<Valadoc.Interface> ifaces ) {
+ }
+
+ public virtual void interface_block_end ( Gee.Collection<Valadoc.Interface> ifaces ) {
+ }
+
+ public virtual void class_block_start ( Gee.Collection<Valadoc.Class> classes ) {
+ }
+
+ public virtual void class_block_end ( Gee.Collection<Valadoc.Class> classes ) {
+ }
+
+ public virtual void struct_block_start ( Gee.Collection<Valadoc.Struct> structs ) {
+ }
+
+ public virtual void struct_block_end ( Gee.Collection<Valadoc.Struct> structs ) {
+ }
+
+ public virtual void construction_method_block_start ( Gee.Collection<Valadoc.Method> methods ) {
+ }
+
+ public virtual void construction_method_block_end ( Gee.Collection<Valadoc.Method> methods ) {
+ }
+
+ public virtual void signal_block_start ( Gee.Collection<Valadoc.Signal> signals ) {
+ }
+
+ public virtual void signal_block_end ( Gee.Collection<Valadoc.Signal> signals ) {
+ }
+
+ public virtual void property_block_start ( Gee.Collection<Valadoc.Property> properties ) {
+ }
+
+ public virtual void property_block_end ( Gee.Collection<Valadoc.Property> properties ) {
+ }
+
+ public virtual void file_start ( File file ) {
+ }
+
+ public virtual void file_end ( File file ) {
+ }
+
+ public virtual void namespace_start ( Namespace ns ) {
+ }
+
+ public virtual void namespace_end ( Namespace ns ) {
+ }
+
+ public virtual void interface_start ( Interface iface ) {
+ }
+
+ public virtual void interface_end ( Interface iface ) {
+ }
+
+ public virtual void class_start ( Class cl ) {
+ }
+
+ public virtual void class_end ( Class cl ) {
+ }
+
+ public virtual void struct_start ( Struct stru ) {
+ }
+
+ public virtual void struct_end ( Struct stru ) {
+ }
+
+ public virtual void enum_start ( Enum en ) {
+ }
+
+ public virtual void enum_end ( Enum en ) {
+ }
+
+ public virtual void property ( Property prop ) {
+ }
+
+ public virtual void field ( Field field, FieldHandler parent ) {
+ }
+
+ public virtual void enum_value ( EnumValue enval ) {
+ }
+
+ public virtual void _delegate ( Delegate del ) {
+ }
+
+ public virtual void _signal ( Signal sig ) {
+ }
+
+ public virtual void method ( Method m, Valadoc.MethodHandler parent ) {
+ }
+}
+
Added: trunk/basic/b_langlet.vala
==============================================================================
--- (empty file)
+++ trunk/basic/b_langlet.vala Sat Apr 26 14:47:35 2008
@@ -0,0 +1,91 @@
+/*
+ * Valadoc - a documentation tool for vala.
+ * Copyright (C) 2008 Florian Brosch
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+
+using GLib;
+
+
+public class Valadoc.Langlet : Object {
+ public signal void puts_keyword ( void* ptr, string str );
+ public signal void puts ( void* ptr, string str );
+
+ public virtual void write_type_parameter ( TypeParameter param, void* ptr ) {
+ }
+
+ public virtual void write_template_parameters ( TemplateParameterListHandler thandler, void* ptr ) {
+ }
+
+ public void write_parent_type_list ( Valadoc.ContainerDataType dtype, void* ptr ) {
+ }
+
+ public virtual void write_parameter_list ( ParameterListHandler thandler, void* ptr ) {
+ }
+
+ public virtual void write_field ( Valadoc.Field field, Valadoc.FieldHandler parent, void* ptr ) {
+ }
+
+ public virtual void write_type_reference ( Valadoc.TypeReference tref, void* ptr ) {
+ }
+
+ public virtual void write_formal_parameter ( Valadoc.FormalParameter param, void* ptr ) {
+ }
+
+ public virtual void write_property_accessor ( Valadoc.PropertyAccessor propac, void* ptr ) {
+ }
+
+ public virtual void write_property ( Valadoc.Property prop, void* ptr ) {
+ }
+
+ public virtual void write_signal ( Valadoc.Signal sig, void* ptr ) {
+ }
+
+ public virtual void write_method ( void* ptr, weak Valadoc.Method m, Valadoc.MethodHandler parent ) {
+ }
+
+ public virtual void write_error_domain ( Valadoc.ErrorDomain errdom, void* ptr ) {
+ }
+
+ public virtual void write_error_code ( Valadoc.ErrorCode errcode, void* ptr ) {
+ }
+
+ public virtual void write_enum_value ( Valadoc.EnumValue enval, void* ptr ) {
+ }
+
+ public virtual void write_delegate ( Valadoc.Delegate del, void* ptr ) {
+ }
+
+ public virtual void write_class ( Valadoc.Class cl, void* ptr ) {
+ }
+
+ public virtual void write_enum ( Valadoc.Enum en, void* ptr ) {
+ }
+
+ public virtual void write_struct ( Valadoc.Struct stru, void* ptr ) {
+ }
+
+ public virtual void write_interface ( Valadoc.Interface iface, void* ptr ) {
+ }
+
+ public virtual void write_namespace ( Valadoc.Namespace ns, void* ptr ) {
+ }
+
+ public virtual void write_file ( Valadoc.File file, void* ptr ) {
+ }
+}
+
+
Added: trunk/basic/b_taglet.vala
==============================================================================
--- (empty file)
+++ trunk/basic/b_taglet.vala Sat Apr 26 14:47:35 2008
@@ -0,0 +1,101 @@
+/*
+ * Valadoc - a documentation tool for vala.
+ * Copyright (C) 2008 Florian Brosch
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+
+using GLib;
+
+
+public static delegate BasicTaglet Valadoc.TagletCreator ( Valadoc.Tree tree, Valadoc.Basic element,
+ Valadoc.ErrorReporter err, Valadoc.Settings settings );
+
+
+
+public abstract class Valadoc.BasicTaglet : Object {
+ public uint indenture_number;
+
+ public virtual void write ( void* ptr ) {
+ }
+}
+
+
+public class Valadoc.StringTaglet : BasicTaglet {
+ public string str;
+
+ public static Valadoc.StringTaglet create ( Valadoc.Basic element ) {
+ return new Valadoc.StringTaglet ();
+ }
+
+ public void parse ( string str ) {
+ this.str = str;
+ }
+
+ public override void write ( void* ptr ) {
+ ((GLib.FileStream)ptr).puts ( this.str );
+ }
+}
+
+
+public abstract class Valadoc.InlineTaglet : BasicTaglet {
+ public Valadoc.Basic element {
+ construct set;
+ get;
+ }
+
+ public Valadoc.Tree doctree {
+ construct set;
+ get;
+ }
+
+ public Valadoc.ErrorReporter err {
+ construct set;
+ get;
+ }
+
+ public virtual void parse ( string str ) {
+ }
+}
+
+public abstract class Valadoc.MainTaglet : BasicTaglet {
+ protected bool block_type = false;
+ protected bool unique = false;
+
+ public Valadoc.Basic element {
+ construct set;
+ get;
+ }
+
+ public Valadoc.Tree doctree {
+ construct set;
+ get;
+ }
+
+ public Valadoc.ErrorReporter err {
+ construct set;
+ get;
+ }
+
+ public virtual void parse ( Gee.Collection<Valadoc.BasicTaglet> lst ) {
+ }
+
+ public virtual void start_block ( void* ptr ) {
+ }
+
+ public virtual void end_block ( void* ptr ) {
+ }
+}
+
Added: trunk/doctree.vala
==============================================================================
--- (empty file)
+++ trunk/doctree.vala Sat Apr 26 14:47:35 2008
@@ -0,0 +1,3950 @@
+/*
+ * Valadoc - a documentation tool for vala.
+ * Copyright (C) 2008 Florian Brosch
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+
+using Drawer;
+using Vala;
+using GLib;
+using Gee;
+
+
+
+public enum ExpressionType {
+ NOT_SET,
+ STRING,
+ CHAR,
+ REAL,
+ BOOL,
+ INT,
+ NULL
+}
+
+
+
+public class Valadoc.Basic : Object {
+ protected static string get_comment_string ( Vala.Symbol symbol ) {
+ SourceReference sref = symbol.source_reference;
+ if ( sref == null )
+ return null;
+
+ return sref.comment;
+ }
+
+ public virtual Basic? search_in_upper_namespace ( string[] params, int pos ) {
+ return null;
+ }
+
+ protected void parse_comment_string ( string comment, CommentContext context ) {
+ this.comment = new CommentParser();
+ this.comment.initialisation ( comment, this, this.head, this.err, context, this.settings );
+ this.comment.parse ( );
+ }
+
+ protected void parse_comment_helper ( Vala.Symbol symbol, CommentContext context ) {
+ if ( this.comment != null )
+ return ;
+
+ string str = this.get_comment_string ( symbol );
+ if ( str == null )
+ return ;
+
+ if ( CommentParser.is_comment_string( str ) )
+ this.parse_comment_string ( str, context );
+ }
+
+ public int line {
+ get {
+ Vala.SourceReference vsref = this.vsymbol.source_reference;
+ if ( vsref == null )
+ return 0;
+
+ return vsref.first_line;
+ }
+ }
+
+ public Valadoc.Settings settings {
+ construct set;
+ protected get;
+ }
+
+ public DataType parent_data_type {
+ get {
+ if ( this.parent is DataType )
+ return (DataType)this.parent;
+
+ return null;
+ }
+ }
+
+ public string# file_name {
+ get {
+ Basic element = this;
+ while ( element != null ) {
+ if ( element is File )
+ return element.name;
+
+ element = element.parent;
+ }
+ return null;
+ }
+ }
+
+ public File file {
+ get {
+ Valadoc.Basic ast = this;
+ while ( ast is Valadoc.File == false ) {
+ ast = ast.parent;
+ if ( ast == null )
+ return null;
+ }
+ return (Valadoc.File)ast;
+ }
+ }
+
+ public Namespace nspace {
+ get {
+ Valadoc.Basic ast = this;
+ while ( ast is Valadoc.Namespace == false ) {
+ ast = ast.parent;
+ if ( ast == null )
+ return null;
+ }
+ return (Valadoc.Namespace)ast;
+ }
+ }
+
+ public CommentParser comment {
+ protected set;
+ get;
+ }
+
+ public Basic parent {
+ construct set;
+ get;
+ }
+
+ protected Vala.Symbol vsymbol {
+ get;
+ set;
+ }
+
+ public ErrorReporter err {
+ construct set;
+ get;
+ }
+
+ public Tree head {
+ construct set;
+ protected get;
+ }
+
+ public virtual string# name {
+ get {
+ return null;
+ }
+ }
+
+ // Move to Valadoc.SymbolAccessibility
+ public bool is_public {
+ get {
+ Vala.SymbolAccessibility access = vsymbol.access;
+ return ( access == Vala.SymbolAccessibility.PUBLIC )?
+ true : false;
+ }
+ }
+
+ // Move to Valadoc.SymbolAccessibility
+ public bool is_protected {
+ get {
+ Vala.SymbolAccessibility access = vsymbol.access;
+ return ( access == Vala.SymbolAccessibility.PROTECTED )?
+ true : false;
+ }
+ }
+
+ // Move to Valadoc.SymbolAccessibility
+ public bool is_private {
+ get {
+ Vala.SymbolAccessibility access = vsymbol.access;
+ return ( access == Vala.SymbolAccessibility.PRIVATE )?
+ true : false;
+ }
+ }
+
+ // remove
+ public string# accessibility_str {
+ get {
+ if ( is_public )
+ return "public";
+ if ( is_private )
+ return "private";
+ if ( is_protected )
+ return "protected";
+ return null;
+ }
+ }
+
+ protected Basic find_member_lst ( Gee.Collection<Basic> lst, string name ) {
+ foreach ( Basic element in lst ) {
+ if ( element.name == name )
+ return element;
+ }
+ return null;
+ }
+}
+
+
+
+public interface Valadoc.NamespaceHandler : Basic {
+ public abstract Gee.ArrayList<Namespace> namespaces {
+ private set;
+ get;
+ }
+
+ public Gee.ReadOnlyCollection<Namespace> get_namespace_list () {
+ return new Gee.ReadOnlyCollection<Namespace> ( this.namespaces );
+ }
+
+ public void visit_namespaces ( Doclet doclet ) {
+ foreach ( Namespace ns in this.namespaces ) {
+ ns.visit ( doclet );
+ }
+ }
+
+ private Gee.ArrayList<Vala.Namespace> create_parent_vnamespace_list ( Vala.Symbol vsymbol ) {
+ var lst = new Gee.ArrayList<Vala.Namespace> ();
+
+ while ( vsymbol != null ) {
+ if ( vsymbol is Vala.Namespace ) {
+ lst.insert ( 0, (Vala.Namespace)vsymbol );
+ }
+ vsymbol = vsymbol.parent_symbol;
+ }
+ return lst;
+ }
+
+ public void add__namespace ( Namespace ns ) {
+ this.namespaces.add ( ns );
+ }
+
+ public Namespace get_namespace_helper ( Vala.Symbol node, Gee.List<Vala.Namespace> vnspaces, int pos ) {
+ Vala.Namespace vns = vnspaces.get( pos );
+
+ Namespace ns = this.find_namespace_without_childs ( vns );
+ if ( ns == null ) {
+ ns = new Namespace( this.settings, vns, this, this.head, this.err );
+ this.namespaces.add ( ns );
+ }
+
+ if ( vnspaces.size == pos+1 ) {
+ return ns;
+ }
+
+ return ns.get_namespace_helper ( node, vnspaces, pos+1 );
+ }
+
+ // TODO: Rename vars
+ protected Namespace get_namespace ( Vala.Symbol node ) {
+ Vala.Symbol vnd = ((Vala.Symbol)node).parent_symbol;
+ if ( vnd is Vala.Namespace == false )
+ vnd = vnd.parent_symbol;
+
+ Vala.Namespace vnspace = (Vala.Namespace)vnd;
+ var nspace = this.find_namespace ( vnspace );
+ if ( nspace != null )
+ return nspace;
+
+
+ var vnspaces = this.create_parent_vnamespace_list ( node );
+
+ if ( vnspaces.size > 2 ) {
+ return this.get_namespace_helper ( node, vnspaces, 1 );
+ }
+ else {
+ var ns = new Namespace( this.settings, vnspace, this, this.head, this.err );
+ this.namespaces.add( ns );
+ return ns;
+ }
+ }
+
+ public Namespace find_vnamespace_helper ( Gee.List<Vala.Namespace> vnspaces, int pos ) {
+ Vala.Namespace vns = vnspaces.get ( pos );
+ if ( vns == null )
+ return null;
+
+ foreach ( Namespace ns in this.namespaces ) {
+ if ( !ns.is_vnspace( vns ) )
+ continue ;
+
+ if ( pos+1 == vnspaces.size )
+ return ns;
+
+ return ns.find_vnamespace_helper ( vnspaces, pos+1 );
+ }
+
+ return null;
+ }
+
+ // inline?
+ private Namespace find_namespace_without_childs ( Vala.Namespace vns ) {
+ Namespace ns2 = null;
+
+ foreach ( Namespace ns in this.namespaces ) {
+ if ( ns.is_vnspace(vns) )
+ ns2 = ns;
+ }
+
+ return ns2;
+ }
+
+ public Namespace find_namespace ( Vala.Namespace vns ) {
+ var vnspaces = this.create_parent_vnamespace_list ( vns );
+ return this.find_vnamespace_helper ( vnspaces, vnspaces.index_of( vns ) );
+ }
+
+ public void set_namespace_type_references ( ) {
+ foreach ( Namespace ns in this.namespaces ){
+ ns.set_type_references ();
+ }
+ }
+
+ public void namespace_inheritance ( ) {
+ foreach ( Namespace ns in this.namespaces ){
+ ns.inheritance( );
+ }
+ }
+
+ public void parse_namespace_comments ( ) {
+ foreach ( Namespace ns in this.namespaces ){
+ ns.parse_comments ();
+ }
+ }
+
+ public void create_namespace_images ( ) {
+ foreach ( Namespace ns in this.namespaces ) {
+ ns.create_images ( );
+ }
+ }
+}
+
+
+
+/**
+ * A helper for all data types who could contain classes.
+ */
+public interface Valadoc.ClassHandler : Basic {
+ protected abstract Gee.ArrayList<Class> classes {
+ set;
+ get;
+ }
+
+ public abstract uint bracket_level {
+ construct set;
+ protected get;
+ }
+
+ protected inline Basic? search_class ( string[] params, int pos ) {
+ foreach ( Class cl in this.classes ) {
+ Basic element = cl.search_in_upper_namespace ( params, pos+1 );
+ if ( element != null )
+ return element;
+ }
+ return null;
+ }
+
+ public Class find_vclass ( Vala.Class vcl ) {
+ foreach ( Class cl in this.classes ) {
+ if ( cl.is_vclass ( vcl ) )
+ return cl;
+
+ var tmp = cl.find_vclass ( vcl );
+ if ( tmp != null )
+ return tmp;
+ }
+ return null;
+ }
+
+ /**
+ * Returns a list of all visitable classes.
+ */
+ public Gee.ReadOnlyCollection<Class> get_class_list ( ) {
+ var lst = new Gee.ArrayList<Class> ();
+ foreach ( Class cl in this.classes ) {
+ if ( !cl.is_type_visitor_accessible ( this ) )
+ continue ;
+
+ lst.add ( cl );
+ }
+
+ return new Gee.ReadOnlyCollection<Class>( lst );
+ }
+
+ /**
+ * Appends a class. Make sure that the parent of the class is set to the
+ * ClassHandler.
+ *
+ * @param cl a { @link Valadoc.Class }.
+ */
+ public void append_class ( Valadoc.Class cl ) {
+ this.classes.add( cl );
+ }
+
+ /**
+ * Calls { @link Doclet.class_visitor } for all visitables classes.
+ */
+ public void visit_classes ( Doclet doclet ) {
+ foreach ( Class cl in this.get_class_list() ) {
+ cl.visit ( doclet );
+ }
+ }
+
+ protected void set_class_references ( ) {
+ foreach ( Class cl in this.classes ) {
+ cl.set_type_references ();
+ }
+ }
+
+ protected void parse_class_comments ( ) {
+ foreach ( Class cl in this.classes ) {
+ cl.parse_comments ( );
+ }
+ }
+}
+
+
+
+public interface Valadoc.PropertyHandler : ContainerDataType {
+ protected abstract Gee.ArrayList<Property> properties {
+ get;
+ set;
+ }
+
+ protected inline Basic? search_property ( string[] params, int pos ) {
+ pos++;
+
+ if ( params[pos+1] != null )
+ return null;
+
+ foreach ( Property prop in this.properties ) {
+ if ( prop.name == params[pos] )
+ return prop;
+ }
+ return null;
+ }
+
+ protected bool is_overwritten_property ( Property prop ) {
+ foreach ( Property p in this.properties ) {
+ if ( p.parent != this )
+ continue ;
+
+ if ( !p.is_override )
+ continue ;
+
+ if ( p.equals ( prop ) )
+ return true;
+ }
+ return false;
+ }
+
+ public Gee.Collection<Property> get_property_list ( ) {
+ var lst = new Gee.ArrayList<Property> ();
+ foreach ( Property p in this.properties ) {
+ if ( !p.is_type_visitor_accessible ( this ) )
+ continue ;
+
+ lst.add ( p );
+ }
+
+ return new Gee.ReadOnlyCollection<Property>( lst );
+ }
+
+ protected void parse_property_comments ( ) {
+ foreach ( Property prop in this.properties ) {
+ prop.parse_comment ( );
+ }
+ }
+
+ public void visit_properties ( Doclet doclet ) {
+ foreach ( Property prop in this.get_property_list () )
+ prop.visit ( doclet );
+ }
+
+ protected void set_property_type_reference () {
+ foreach ( Property prop in this.properties ) {
+ prop.set_type_references ( );
+ }
+ }
+
+ protected void add_properties ( Gee.Collection<Vala.Property> vproperties ) {
+ foreach ( Vala.Property vprop in vproperties ) {
+ var tmp = new Property ( this.settings, vprop, this, this.head, this.err, this.bracket_level + 1 );
+ tmp.initialisation ( );
+ this.properties.add ( tmp );
+ }
+ }
+}
+
+
+public interface Valadoc.ConstructionMethodHandler : DataType, MethodHandler {
+ protected abstract Gee.ArrayList<Method> construction_methods {
+ set;
+ get;
+ }
+
+ protected inline Basic? search_construction_method ( string[] params, int pos ) {
+ pos++;
+
+ if ( params[pos+1] == null )
+ return null;
+
+ if ( params[pos+2] != null )
+ return null;
+
+ string name = params[pos] + "." + params[pos+1];
+
+ foreach ( Method m in this.construction_methods ) {
+ if ( m.name == name )
+ return m;
+ }
+ return null;
+ }
+
+ public Gee.Collection<Method> get_construction_method_list ( ) {
+ var lst = new Gee.ArrayList<Method> ();
+ foreach ( Method cm in this.construction_methods ) {
+ if ( !cm.is_type_visitor_accessible ( this ) )
+ continue ;
+
+ lst.add ( cm );
+ }
+
+ return new Gee.ReadOnlyCollection<Method>( lst );
+ }
+
+ protected void parse_construction_method_comments ( ) {
+ foreach ( Method cm in this.construction_methods ) {
+ cm.parse_comment ( );
+ }
+ }
+
+ protected void set_construction_method_references ( ) {
+ foreach ( Method cm in this.construction_methods ) {
+ cm.set_type_references ( );
+ }
+ }
+
+ public void visit_construction_methods ( Doclet doclet ) {
+ foreach ( Method m in this.get_construction_method_list() ) {
+ m.visit ( doclet, null );
+ }
+ }
+
+ /**
+ * Adds a list of methods to { @link Vala.MethodHandler } and { @link Vala.ConstructionMethodHandler }.
+ */
+ protected void add_methods_and_construction_methods ( Gee.Collection<Vala.Method> vmethods ) {
+ foreach ( Vala.Method vm in vmethods ) {
+ var tmp = new Method ( this.settings, vm, this, this.head, this.err, this.bracket_level + 1 );
+ tmp.initialisation ( );
+ if ( tmp.is_constructor )
+ this.construction_methods.add ( tmp );
+ else
+ this.methods.add ( tmp );
+ }
+ }
+}
+
+
+
+public interface Valadoc.SignalHandler : ContainerDataType {
+ protected abstract Gee.ArrayList<Signal> signals {
+ get;
+ set;
+ }
+
+ protected inline Basic? search_signal ( string[] params, int pos ) {
+ pos++;
+
+ if ( params[pos+1] != null )
+ return null;
+
+ foreach ( Signal sig in this.signals ) {
+ if ( sig.name == params[pos] )
+ return sig;
+ }
+ return null;
+ }
+
+ public void add_signals ( Gee.Collection<Vala.Signal> vsignals ) {
+ foreach ( Vala.Signal vsig in vsignals ) {
+ var tmp = new Signal ( this.settings, vsig, this, this.head, this.err, this.bracket_level + 1 );
+ tmp.initialisation ();
+ this.signals.add ( tmp );
+ }
+ }
+
+ public void visit_signals ( Doclet doclet ) {
+ foreach ( Signal sig in this.get_signal_list ( ) ) {
+ sig.visit ( doclet );
+ }
+ }
+
+ public Gee.Collection<Signal> get_signal_list () {
+ var lst = new Gee.ArrayList<Signal> ();
+ foreach ( Signal sig in this.signals ) {
+ if ( !sig.is_type_visitor_accessible ( this ) )
+ continue ;
+
+ lst.add ( sig );
+ }
+
+ return new Gee.ReadOnlyCollection<Signal>( lst );
+ }
+
+ protected void set_signal_type_references () {
+ foreach ( Signal sig in this.signals ) {
+ sig.set_type_references ( );
+ }
+ }
+
+ protected void parse_signal_comments () {
+ foreach ( Signal sig in this.signals ) {
+ sig.parse_comment ( );
+ }
+ }
+}
+
+
+
+public interface Valadoc.StructHandler : Basic {
+ protected abstract Gee.ArrayList<Struct> structs {
+ set;
+ get;
+ }
+
+ public abstract uint bracket_level {
+ construct set;
+ protected get;
+ }
+
+ protected inline Basic? search_struct ( string[] params, int pos ) {
+ foreach ( Struct stru in this.structs ) {
+ Basic element = stru.search_in_upper_namespace ( params, pos+1 );
+ if ( element != null )
+ return element;
+ }
+ return null;
+ }
+
+ public Gee.Collection<Struct> get_struct_list ( ) {
+ var lst = new Gee.ArrayList<Struct> ();
+ foreach ( Struct stru in this.structs ) {
+ if ( !stru.is_type_visitor_accessible ( this ) )
+ continue ;
+
+ lst.add ( stru );
+ }
+
+ return new Gee.ReadOnlyCollection<Struct>( lst );
+ }
+
+ public void append_struct ( Valadoc.Struct stru ) {
+ this.structs.add( stru );
+ }
+
+ public void visit_structs ( Doclet doclet ) {
+ foreach ( Struct stru in this.get_struct_list() ) {
+ stru.visit ( doclet );
+ }
+ }
+
+ protected void set_struct_references ( ) {
+ foreach ( Struct stru in this.structs ) {
+ stru.set_type_references ( );
+ }
+ }
+ protected void parse_struct_comments ( ) {
+ foreach ( Struct stru in this.structs ) {
+ stru.parse_comments ( );
+ }
+ }
+}
+
+
+
+public interface Valadoc.Visitable : Basic {
+ public bool is_type_visitor_accessible ( Valadoc.Basic element ) {
+ if ( !this.settings._private && this.is_private )
+ return false;
+
+ if ( !this.settings._protected && this.is_protected )
+ return false;
+
+ if ( this.parent != element && !this.settings.add_inherited )
+ return false;
+
+ return true;
+ }
+
+ public bool is_visitor_accessible ( ) {
+ if ( !this.settings._private && this.is_private )
+ return false;
+
+ if ( !this.settings._protected && this.is_protected )
+ return false;
+
+ return true;
+ }
+}
+
+
+public interface Valadoc.SymbolAccessibility : Basic {
+ protected abstract Vala.Symbol vsymbol {
+ get;
+ set;
+ }
+
+ public abstract bool is_public {
+ get;
+ }
+
+ public abstract bool is_protected {
+ get;
+ }
+
+ public abstract bool is_private {
+ get;
+ }
+
+ public abstract string# accessibility_str {
+ get;
+ }
+}
+
+
+
+public interface Valadoc.ReturnTypeHandler : Basic {
+ public abstract TypeReference return_type {
+ protected set;
+ get;
+ }
+
+ public void set_return_type_references ( ) {
+ if ( this.return_type == null )
+ return ;
+
+ this.return_type.set_type_references ( );
+ }
+
+ protected void set_ret_type ( Vala.DataType vtref ) {
+ var tmp = new TypeReference.return_type ( this.settings, vtref, this, this.head, this.err );
+ this.return_type = tmp;
+ }
+}
+
+
+// ????
+public interface Valadoc.TypeHandler : Basic {
+ public abstract TypeReference type_reference {
+ protected set;
+ get;
+ }
+
+ public void set_type_references ( ) {
+ if ( this.type_reference == null )
+ return ;
+
+ this.type_reference.set_type_references ( );
+ }
+
+ protected void set_ret_type ( Vala.DataType vtref ) {
+ var tmp = new TypeReference ( this.settings, vtref, this, this.head, this.err );
+ this.type_reference = tmp;
+ }
+}
+
+
+
+public interface Valadoc.FieldHandler : Basic {
+ protected abstract Gee.ArrayList<Field> fields {
+ protected set;
+ get;
+ }
+
+ public abstract uint bracket_level {
+ construct set;
+ get;
+ }
+
+ protected inline Basic? search_field ( string[] params, int pos ) {
+ pos++;
+
+ if ( params[pos+1] != null )
+ return null;
+
+ foreach ( Field f in this.fields ) {
+ if ( f.name == params[pos] )
+ return f;
+ }
+ return null;
+ }
+
+ public Gee.ReadOnlyCollection<Field> get_field_list ( ) {
+ var lstd = new Gee.ArrayList<Field> ();
+ foreach ( Field f in this.fields ) {
+ if ( !f.is_type_visitor_accessible ( this ) )
+ continue ;
+
+ lstd.add ( f );
+
+ if ( f.is_private )
+ stdout.printf ( "wtf - %s\n", f.name );
+ }
+
+ return new Gee.ReadOnlyCollection<Type>( lstd );
+ }
+
+ public void add_fields ( Gee.Collection<Vala.Field> vfields ) {
+ foreach ( Vala.Field vf in vfields ) {
+ var tmp = new Field ( this.settings, vf, this, this.head, this.err, this.bracket_level + 1 );
+ tmp.initialisation ( );
+ this.fields.add ( tmp );
+ }
+ }
+
+ public void set_field_type_references ( ) {
+ foreach ( Field field in this.fields ) {
+ field.set_type_references ( );
+ }
+ }
+
+ public void parse_field_comments ( ) {
+ foreach ( Field field in this.fields ) {
+ field.parse_comment ( );
+ }
+ }
+
+ public void visit_fields ( Doclet doclet ) {
+ foreach ( Field field in this.get_field_list() ) {
+ field.visit ( doclet, this );
+ }
+ }
+}
+
+
+
+public interface Valadoc.ExceptionHandler : Basic {
+ protected abstract Gee.ArrayList<TypeReference> err_domains {
+ protected set;
+ get;
+ }
+
+ public Gee.ReadOnlyCollection<TypeReference> get_error_domains ( ) {
+ return new Gee.ReadOnlyCollection<FormalParameter> ( this.err_domains );
+ }
+
+ public void add_error_domains ( Gee.Collection<Vala.DataType> vexceptions ) {
+ foreach ( Vala.DataType vtref in vexceptions ) {
+ var tmp = new TypeReference ( this.settings, vtref, (Valadoc.Basic)this, this.head, this.err );
+ this.err_domains.add ( tmp );
+ }
+ }
+
+ public void set_exception_type_references ( ) {
+ foreach ( TypeReference tref in this.err_domains ) {
+ tref.set_type_references ( );
+ }
+ }
+}
+
+
+
+public interface Valadoc.ParameterListHandler : Basic {
+ protected abstract Gee.ArrayList<FormalParameter> param_list {
+ protected set;
+ get;
+ }
+
+ public abstract uint bracket_level {
+ construct set;
+ get;
+ }
+
+ public Gee.ReadOnlyCollection<FormalParameter> get_parameter_list ( ) {
+ return new Gee.ReadOnlyCollection<FormalParameter> ( this.param_list );
+ }
+
+ protected void add_parameter_list ( Gee.Collection<Vala.FormalParameter> vparams ) {
+ foreach ( Vala.FormalParameter vfparam in vparams ) {
+ var tmp = new FormalParameter ( this.settings, vfparam, this, this.head, this.err );
+ tmp.initialisation ( );
+ this.param_list.add ( tmp );
+ }
+ }
+
+ public void set_parameter_list_type_references ( ) {
+ foreach ( FormalParameter fparam in this.param_list ) {
+ fparam.set_type_references ( );
+ }
+ }
+}
+
+
+
+public interface Valadoc.MethodHandler : Basic {
+ protected abstract Gee.ArrayList<Method> methods {
+ protected set;
+ get;
+ }
+
+ public abstract uint bracket_level {
+ construct set;
+ get;
+ }
+
+ protected inline Basic? search_method ( string[] params, int pos ) {
+ pos++;
+
+ if ( params[pos+1] != null )
+ return null;
+
+ foreach ( Method m in this.methods ) {
+ if ( m.name == params[pos] )
+ return m;
+ }
+ return null;
+ }
+
+ public void set_method_type_references ( ) {
+ foreach ( Method m in this.methods ) {
+ m.set_type_references ( );
+ }
+ }
+
+ public void parse_method_comments ( ) {
+ foreach ( Method m in this.methods ) {
+ m.parse_comment ( );
+ }
+ }
+
+ protected void add_method ( Vala.Method vmethod ) {
+ var tmp = new Method ( this.settings, vmethod, this, this.head, this.err, bracket_level + 1 );
+ tmp.initialisation ( );
+ this.methods.add ( tmp );
+ }
+
+ protected void add_methods ( Gee.Collection<Vala.Method> vmethods ) {
+ foreach ( Vala.Method vm in vmethods ) {
+ var tmp = new Method ( this.settings, vm, this, this.head, this.err, bracket_level + 1 );
+ tmp.initialisation ( );
+ this.methods.add ( tmp );
+ }
+ }
+
+ public void visit_methods ( Doclet doclet ) {
+ foreach ( Method m in this.get_method_list() ) {
+ m.visit ( doclet, this );
+ }
+ }
+
+
+ public Gee.ReadOnlyCollection<Method> get_method_list ( ) {
+ var lst = new Gee.ArrayList<Method> ();
+ foreach ( Method m in this.methods ) {
+ if ( !m.is_type_visitor_accessible ( this ) )
+ continue ;
+
+ lst.add ( m );
+ }
+
+ return new Gee.ReadOnlyCollection<Method>( lst );
+ }
+}
+
+
+
+public interface Valadoc.TemplateParameterListHandler : Basic {
+ protected abstract Gee.ArrayList<TypeParameter> template_param_lst {
+ set;
+ get;
+ }
+
+ public Gee.ReadOnlyCollection<TypeParameter> get_template_param_list ( ) {
+ return new Gee.ReadOnlyCollection<TypeParameter> ( this.template_param_lst );
+ }
+
+ public void set_template_parameter_list ( Gee.Collection<Vala.TypeParameter> vtparams ) {
+ foreach ( Vala.TypeParameter vtparam in vtparams ) {
+ var tmp = new TypeParameter ( this.settings, vtparam, this, this.head, this.err );
+ tmp.initialisation ( );
+ this.template_param_lst.add ( tmp );
+ }
+ }
+
+ public void set_template_parameter_list_references ( ) {
+ foreach ( TypeParameter tparam in this.template_param_lst ) {
+ tparam.set_type_reference ( );
+ }
+ }
+}
+
+
+
+public abstract class Valadoc.Variable : Basic {
+}
+
+
+
+public class Valadoc.Field : Variable, SymbolAccessibility, TypeHandler, Visitable {
+ public Field ( Valadoc.Settings settings,
+ Vala.Field vfield,
+ Basic parent,
+ Tree head,
+ ErrorReporter err,
+ uint bracket_level ) {
+ this.bracket_level = bracket_level;
+ this.settings = settings;
+ this.vfield = vfield;
+ this.parent = parent;
+ this.head = head;
+ this.err = err;
+ }
+
+ public uint bracket_level {
+ construct set;
+ get;
+ }
+
+ public TypeReference type_reference {
+ protected set;
+ get;
+ }
+
+ public override string# name {
+ get {
+ return this.vfield.name;
+ }
+ }
+
+ public void initialisation ( ) {
+ this.vsymbol = this.vfield;
+
+ var vret = this.vfield.type_reference;
+ this.set_ret_type ( vret );
+ }
+
+ public Vala.Field vfield {
+ construct set;
+ protected get;
+ }
+
+ public bool is_global {
+ get {
+ return ( this.parent is Valadoc.Namespace )
+ ? true : false;
+ }
+ }
+
+ public void set_type_references ( ) {
+ ((TypeHandler)this).set_type_references ( );
+ }
+
+ public void parse_comment ( ) {
+ this.parse_comment_helper ( this.vsymbol, CommentContext.VARIABLE );
+ }
+
+ public void visit ( Doclet doclet, FieldHandler parent ) {
+ if ( !this.is_visitor_accessible ( ) )
+ return ;
+
+ doclet.visit_field ( this, parent );
+ }
+
+ public void write ( Langlet langlet, void* ptr, FieldHandler parent ) {
+ langlet.write_field ( this, parent, ptr );
+ }
+
+ public void write_comment ( void* ptr ) {
+ if ( this.comment == null )
+ return ;
+
+ this.comment.write ( ptr );
+ }
+}
+
+
+
+public class Valadoc.TypeReference : Variable {
+ public TypeReference ( Valadoc.Settings settings,
+ Vala.DataType vtyperef,
+ Basic parent,
+ Tree head,
+ ErrorReporter err ) {
+ this.is_return_type = false;
+ this.settings = settings;
+ this.vtyperef = vtyperef;
+ this.parent = parent;
+ this.head = head;
+ this.err = err;
+ }
+
+ public TypeReference.return_type ( Valadoc.Settings settings,
+ Vala.DataType vtyperef,
+ Basic parent,
+ Tree head,
+ ErrorReporter err ) {
+ this.is_return_type = true;
+ this.settings = settings;
+ this.vtyperef = vtyperef;
+ this.parent = parent;
+ this.head = head;
+ this.err = err;
+ }
+
+ public bool is_return_type {
+ construct set;
+ protected get;
+ }
+
+ protected Gee.ArrayList<TypeReference> type_arguments = new Gee.ArrayList<TypeReference> ();
+
+ public Gee.ReadOnlyCollection<TypeReference> get_type_arguments ( ) {
+ return new Gee.ReadOnlyCollection<TypeReference> ( this.type_arguments );
+ }
+
+ private void set_template_argument_list ( Gee.Collection<Vala.DataType> varguments ) {
+ foreach ( Vala.DataType vdtype in varguments ) {
+ var dtype = new TypeReference ( this.settings, vdtype, this, this.head, this.err );
+ dtype.set_type_references ( );
+ this.type_arguments.add ( dtype );
+ }
+ }
+
+ public DataType data_type {
+ private set;
+ get;
+ }
+
+ public Vala.DataType vtyperef {
+ construct set;
+ protected get;
+ }
+
+ public bool pass_ownership {
+ get {
+ return false;
+ }
+ }
+
+ public bool is_nullable {
+ get {
+ return vtyperef.nullable && this.vtyperef is Vala.PointerType == false;
+ }
+ }
+
+ public bool is_weak {
+ get {
+ return false;
+ }
+ }
+
+ public bool is_pointer {
+ get {
+ return this.vtyperef is Vala.PointerType;
+ }
+ }
+
+ public uint pointer_rank {
+ get {
+ if ( !this.is_pointer )
+ return 0;
+
+ Vala.DataType vdtype = this.vtyperef;
+ for ( uint i = 0 ;; i++ ) {
+ if ( vdtype is Vala.PointerType == false )
+ return i;
+
+ vdtype = ((Vala.PointerType)vdtype).base_type;
+ }
+ return 0;
+ }
+ }
+
+ public bool is_array {
+ get {
+ return this.vtyperef.is_array();
+ }
+ }
+
+ public uint array_rank {
+ get {
+ if ( !this.is_array )
+ return 0;
+
+ return ((Vala.ArrayType)vtyperef).rank;
+ }
+ }
+
+ public string# type_nspace_name {
+ get {
+
+ if ( this.data_type == null )
+ return null;
+
+ if ( this.data_type.nspace == null )
+ return null;
+
+ return this.data_type.nspace.name;
+ }
+ }
+
+ public string# type_name {
+ get {
+ if ( this.vtyperef is Vala.PointerType ) {
+ string str = ((Vala.PointerType)this.vtyperef).to_string();
+ weak string str2 = str.str ( "*" );
+ return str.ndup ( str.len() - str2.len() );
+ }
+
+ if ( this.is_array ) {
+ return ((Vala.ArrayType)this.vtyperef).element_type.data_type.name;
+ }
+
+ var dtype = this.vtyperef.data_type;
+ if ( dtype == null )
+ return this.vtyperef.to_string();
+
+ return dtype.name;
+ }
+ }
+
+ private DataType _get_data_type ( Vala.Typesymbol vdtype, File file, Namespace ns ) {
+ if ( vdtype is Vala.Enum ) {
+ return ns.find_enum ( (Vala.Enum)vdtype );
+ }
+ else if ( vdtype is Vala.ArrayType ) {
+ var vtsym = ((Vala.ArrayType)vdtype).data_type;
+ return this._get_data_type ( vtsym, file, ns );
+ }
+ else if ( vdtype is Vala.Class ) {
+ return ns.find_class ( (Vala.Class)vdtype );
+ }
+ else if ( vdtype is Vala.Struct ) {
+ return ns.find_struct ( (Vala.Struct)vdtype );
+ }
+ else if ( vdtype is Vala.Interface ) {
+ return ns.find_interface ( (Vala.Interface)vdtype );
+ }
+ else if ( vdtype is Vala.PointerIndirection ) {
+ Vala.Typesymbol vtsym = ((Vala.PointerType)vdtype).data_type;
+ return this._get_data_type ( vtsym, file, ns );
+ }
+ return null;
+ }
+
+ private File get_file ( Vala.Typesymbol vdtype ) {
+ if ( vdtype.source_reference == null ) {
+ return null;
+ }
+
+ Vala.SourceFile vfile = vdtype.source_reference.file;
+ File file = this.head.find_file ( vfile );
+ return file;
+ }
+
+ private Namespace get_nspace ( File file, Vala.Symbol vns ) {
+ while ( vns is Vala.Namespace == false ) {
+ vns = vns.parent_symbol;
+ }
+
+ Namespace ns = file.find_namespace ( (Vala.Namespace)vns );
+ return ns;
+ }
+
+ public virtual void set_type_references ( ) {
+ this.data_type = this.get_type_references ( this.vtyperef );
+ }
+
+ public DataType get_type_references ( Vala.DataType vtyperef ) {
+ if ( this.vtyperef is Vala.DelegateType ) {
+ Vala.Delegate vdel = ((Vala.DelegateType)vtyperef).delegate_symbol;
+ File file = this.get_file ( vdel );
+ if ( file == null )
+ return null; // err
+
+ Namespace ns = this.get_nspace ( file, vdel );
+ Valadoc.Delegate del = ns.find_delegate ( (Vala.Delegate)vdel );
+ return del;
+ }
+
+ if ( vtyperef is Vala.PointerType ) {
+ Vala.DataType vptr = ((Vala.PointerType)vtyperef).base_type;
+ if ( vptr == null )
+ return null;
+ return this.get_type_references ( vptr );
+ }
+
+ if ( vtyperef is Vala.ArrayType ) {
+ Vala.DataType vptr = ((Vala.ArrayType)vtyperef).element_type;
+ if ( vptr == null )
+ return null;
+ return this.get_type_references ( vptr );
+ }
+
+ Vala.Typesymbol vdtype = vtyperef.data_type;
+ if ( vdtype == null ) {
+ return null;
+ }
+
+ var varguments = vtyperef.get_type_arguments ();
+ this.set_template_argument_list ( varguments );
+
+ File file = this.get_file ( vdtype );
+ if ( file == null )
+ return null; // err
+
+ Namespace ns = this.get_nspace ( file, vdtype );
+ return this._get_data_type ( vdtype, file, ns );
+ }
+
+ public void write ( Langlet langlet, void* ptr ) {
+ langlet.write_type_reference ( this, ptr );
+ }
+}
+
+// TODO: Remove unused stuff
+// You just need it for the name in a template-parameter-list.
+// remove TypeHandler-interface
+public class Valadoc.TypeParameter : Variable, TypeHandler {
+ public TypeParameter ( Valadoc.Settings settings,
+ Vala.TypeParameter vtypeparam,
+ Basic parent,
+ Tree head,
+ ErrorReporter err ) {
+ this.vtypeparam = vtypeparam;
+ this.settings = settings;
+ this.parent = parent;
+ this.head = head;
+ this.err = err;
+ }
+
+ public TypeReference type_reference {
+ protected set;
+ get;
+ }
+
+ public void write ( Langlet langlet, void* ptr ) {
+ langlet.write_type_parameter ( this, ptr );
+ }
+
+ public Vala.TypeParameter vtypeparam {
+ construct set;
+ protected get;
+ }
+
+ public string# datatype_name {
+ get {
+ return this.vtypeparam.name;
+ }
+ }
+
+ public void initialisation ( ) {
+ }
+
+ public void set_type_reference ( ) {
+ }
+}
+
+
+public class Valadoc.FormalParameter : Variable, TypeHandler {
+ public FormalParameter ( Valadoc.Settings settings,
+ Vala.FormalParameter vformalparam,
+ Basic parent,
+ Tree head,
+ ErrorReporter err ) {
+ this.settings = settings;
+ this.vformalparam = vformalparam;
+ this.parent = parent;
+ this.head = head;
+ this.err = err;
+ }
+
+ public bool is_out {
+ get {
+ return this.vformalparam.direction == ParameterDirection.OUT;
+ }
+ }
+
+ public bool is_ref {
+ get {
+ return this.vformalparam.direction == ParameterDirection.REF;
+ }
+ }
+
+ public ExpressionType default_vaule_type {
+ default = ExpressionType.NOT_SET;
+ private set;
+ get;
+ }
+
+ public string? default_value {
+ private set;
+ public get;
+ }
+
+ public void initialisation ( ) {
+ this.vsymbol = this.vformalparam;
+
+ var vformparam = this.vformalparam.type_reference;
+ this.set_ret_type ( vformparam );
+
+ var def = this.vformalparam.default_expression;
+ if ( def != null ) {
+ {
+ if ( def is Vala.StringLiteral ) {
+ this.default_value = ((Vala.StringLiteral)def).value;
+ this.default_vaule_type = ExpressionType.STRING;
+ }
+ else if ( def is Vala.CharacterLiteral ) {
+ this.default_value = ((Vala.CharacterLiteral)def).value;
+ this.default_vaule_type = ExpressionType.CHAR;
+ }
+ else if ( def is Vala.RealLiteral ) {
+ this.default_vaule_type = ExpressionType.REAL;
+ this.default_value = ((Vala.RealLiteral)def).value;
+ }
+ else if ( def is BooleanLiteral ) {
+ this.default_value = ((Vala.BooleanLiteral)def).value;
+ this.default_vaule_type = ExpressionType.BOOL;
+ }
+ else if ( def is IntegerLiteral ) {
+ this.default_value = ((Vala.IntegerLiteral)def).value;
+ this.default_vaule_type = ExpressionType.INT;
+ }
+ else if ( def is NullLiteral ) {
+ this.default_vaule_type = ExpressionType.NULL;
+ this.default_value = "null";
+ }
+ }
+ }
+ }
+
+ public TypeReference type_reference {
+ protected set;
+ get;
+ }
+
+ public bool ellipsis {
+ get {
+ return this.vformalparam.ellipsis;
+ }
+ }
+
+ public bool is_construct {
+ get {
+ return this.vformalparam.construct_parameter;
+ }
+ }
+
+ public override string# name {
+ get {
+ return ( this.vformalparam.name == null )
+ ? "" : this.vformalparam.name;
+ }
+ }
+
+ public Vala.FormalParameter vformalparam {
+ construct set;
+ protected get;
+ }
+
+ public void set_type_references ( ) {
+ if ( this.vformalparam.ellipsis )
+ return ;
+
+ ((TypeHandler)this).set_type_references ( );
+ }
+
+ public void write ( Langlet langlet, void* ptr ) {
+ langlet.write_formal_parameter ( this, ptr );
+ }
+}
+
+
+
+public class Valadoc.PropertyAccessor : Object {
+ public PropertyAccessor ( Valadoc.Settings settings,
+ Vala.PropertyAccessor vpropacc,
+ Property parent,
+ Tree head,
+ ErrorReporter err )
+ {
+ this.parent = parent;
+ this.settings = settings;
+ this.vpropacc = vpropacc;
+ this.head = head;
+ this.err = err;
+ }
+
+ public void construction ( ) {
+ }
+
+ public Tree head {
+ construct;
+ get;
+ }
+
+ public Vala.PropertyAccessor vpropacc {
+ construct;
+ private get;
+ }
+
+ public Settings settings {
+ construct;
+ get;
+ }
+
+ public Property parent {
+ private set;
+ get;
+ }
+
+ public Tree tree {
+ construct;
+ get;
+ }
+
+ public ErrorReporter err {
+ construct;
+ get;
+ }
+
+ public bool is_construct {
+ get {
+ return this.vpropacc.construction;
+ }
+ }
+
+ public bool is_protected {
+ get {
+ return this.vpropacc.access == Vala.SymbolAccessibility.PROTECTED;
+ }
+ }
+
+ public bool is_public {
+ get {
+ return this.vpropacc.access == Vala.SymbolAccessibility.PUBLIC;
+ }
+ }
+
+ public bool is_private {
+ get {
+ return this.vpropacc.access == Vala.SymbolAccessibility.PRIVATE;
+ }
+ }
+
+ public bool is_set {
+ get {
+ return this.vpropacc.writable;
+ }
+ }
+
+ public bool is_get {
+ get {
+ return this.vpropacc.readable;
+ }
+ }
+
+ public void write ( Langlet langlet, void* ptr ) {
+ langlet.write_property_accessor ( this, ptr );
+ }
+}
+
+
+public class Valadoc.Property : Basic, SymbolAccessibility, ReturnTypeHandler, Visitable {
+ public Property ( Valadoc.Settings settings,
+ Vala.Property vproperty,
+ ContainerDataType parent,
+ Tree head,
+ ErrorReporter err,
+ uint bracket_level ) {
+ this.settings = settings;
+ this.vproperty = vproperty;
+ this.parent = parent;
+ this.head = head;
+ this.err = err;
+ this.bracket_level = bracket_level;
+ }
+
+ public uint bracket_level {
+ construct set;
+ get;
+ }
+
+ public bool equals ( Property p ) {
+ return this.vproperty.equals ( p.vproperty );
+ }
+
+ public TypeReference return_type {
+ protected set;
+ get;
+ }
+
+ public bool is_virtual {
+ get {
+ return this.vproperty.is_virtual;
+ }
+ }
+
+ public bool is_abstract {
+ get {
+ return this.vproperty.is_abstract;
+ }
+ }
+
+ public bool is_override {
+ get {
+ return this.vproperty.overrides;
+ }
+ }
+
+ public PropertyAccessor setter {
+ private set;
+ get;
+ }
+
+ public PropertyAccessor getter {
+ private set;
+ get;
+ }
+
+ public void initialisation ( ) {
+ this.vsymbol = vproperty;
+
+ var ret = this.vproperty.type_reference;
+ this.set_ret_type ( ret );
+
+ if ( this.vproperty.get_accessor != null )
+ this.getter = new PropertyAccessor ( this.settings, this.vproperty.get_accessor, this, this.head, this.err );
+
+ if ( this.vproperty.set_accessor != null )
+ this.setter = new PropertyAccessor ( this.settings, this.vproperty.set_accessor, this, this.head, this.err );
+ }
+
+ public Vala.Property vproperty {
+ construct set;
+ protected get;
+ }
+
+ public override string# name {
+ get {
+ return this.vproperty.name;
+ }
+ }
+
+ public void set_type_references ( ) {
+ this.set_return_type_references ( );
+ }
+
+ public void parse_comment ( ) {
+ this.parse_comment_helper ( this.vproperty, CommentContext.PROPERTY );
+ }
+
+ public void visit ( Doclet doclet ) {
+ if ( !this.is_visitor_accessible ( ) )
+ return ;
+
+ doclet.visit_property ( this );
+ }
+
+ public void write ( Langlet langlet, void* ptr ) {
+ langlet.write_property ( this, ptr );
+ }
+
+ public void write_comment ( void* ptr ) {
+ if ( this.comment == null )
+ return ;
+
+ this.comment.write ( ptr );
+ }
+}
+
+
+
+public class Valadoc.Signal : Basic, ParameterListHandler, SymbolAccessibility,
+ ReturnTypeHandler, Visitable {
+ public Signal ( Valadoc.Settings settings,
+ Vala.Signal vsignal,
+ ContainerDataType parent,
+ Tree head,
+ ErrorReporter err,
+ uint bracket_level ) {
+ this.settings = settings;
+ this.vsignal = vsignal;
+ this.parent = parent;
+ this.head = head;
+ this.err = err;
+ this.bracket_level = bracket_level;
+ }
+
+ construct {
+ this.param_list = new Gee.ArrayList<FormalParameter> ();
+ }
+
+ public uint bracket_level {
+ construct set;
+ get;
+ }
+
+ public TypeReference return_type {
+ protected set;
+ get;
+ }
+
+ public void initialisation ( ) {
+ this.vsymbol = vsignal;
+
+ var vparamlst = this.vsignal.get_parameters ();
+ this.add_parameter_list ( vparamlst );
+
+ var ret = this.vsignal.return_type;
+ this.set_ret_type ( ret );
+ }
+
+ protected Gee.ArrayList<FormalParameter> param_list {
+ protected set;
+ get;
+ }
+
+ public Vala.Signal vsignal {
+ construct set;
+ protected get;
+ }
+
+ public void set_type_references ( ) {
+ this.set_parameter_list_type_references ( );
+ this.set_return_type_references ( );
+ }
+
+ public void parse_comment ( ) {
+ this.parse_comment_helper ( this.vsignal, CommentContext.SIGNAL );
+ }
+
+ public override string# name {
+ get {
+ return this.vsignal.name;
+ }
+ }
+
+ public void visit ( Doclet doclet ) {
+ if ( !this.is_visitor_accessible ( ) )
+ return ;
+
+ doclet.visit_signal ( this );
+ }
+
+ public void write ( Langlet langlet, void* ptr ) {
+ langlet.write_signal ( this, ptr );
+ }
+
+ public void write_comment ( void* ptr ) {
+ if ( this.comment == null )
+ return ;
+
+ this.comment.write ( ptr );
+ }
+}
+
+
+
+public class Valadoc.Method : Basic, ParameterListHandler, ExceptionHandler, TemplateParameterListHandler,
+ SymbolAccessibility, ReturnTypeHandler, Visitable {
+ public Method ( Valadoc.Settings settings,
+ Vala.Method vmethod,
+ Basic parent,
+ Tree head,
+ ErrorReporter err,
+ uint bracket_level ) {
+ this.settings = settings;
+ this.vmethod = vmethod;
+ this.parent = parent;
+ this.head = head;
+ this.err = err;
+ this.bracket_level = bracket_level;
+ }
+
+
+ construct {
+ this.err_domains = new Gee.ArrayList<TypeReference>();
+ this.param_list = new Gee.ArrayList<FormalParameter>();
+ this.template_param_lst = new Gee.ArrayList<TypeParameter> ();
+ }
+
+ public Method base_method {
+ get;
+ set;
+ }
+
+ public uint bracket_level {
+ construct set;
+ get;
+ }
+
+ public TypeReference return_type {
+ protected set;
+ get;
+ }
+
+ public Gee.ArrayList<TypeParameter> template_param_lst {
+ protected set;
+ get;
+ }
+
+ public Gee.ArrayList<FormalParameter> param_list {
+ protected set;
+ get;
+ }
+
+ public Gee.ArrayList<TypeReference> err_domains {
+ protected set;
+ get;
+ }
+
+ public string comment_str {
+ get {
+ return this.vmethod.source_reference.comment;
+ }
+ }
+
+ public void write_comment ( void* ptr ) {
+ if ( this.comment == null )
+ return ;
+
+ this.comment.write ( ptr );
+ }
+
+ public bool equals ( Method m ) {
+ return ( m.vmethod == this.vmethod );
+// return this.vmethod.equals ( m.vmethod );
+ }
+
+ public void parse_comment ( ) {
+ if ( this.comment != null )
+ return ;
+
+ string str = this.get_comment_string ( this.vmethod );
+ if ( str == null )
+ return ;
+
+ if ( !CommentParser.is_comment_string( str ) )
+ return ;
+
+ if ( this.is_override && CommentParser.is_inherit_doc( str ) ) {
+ this.base_method.parse_comment ( );
+ this.comment = this.base_method.comment;
+ return ;
+ }
+
+ this.parse_comment_string ( str, CommentContext.METHOD );
+ }
+
+ public void initialisation ( ) {
+ this.vsymbol = vmethod;
+
+ var vret = this.vmethod.return_type;
+ this.set_ret_type ( vret );
+
+ var vparamlst = this.vmethod.get_parameters ();
+ this.add_parameter_list ( vparamlst );
+
+ var vexceptionlst = this.vmethod.get_error_domains ();
+ this.add_error_domains ( vexceptionlst );
+ }
+
+ public Vala.Method vmethod {
+ construct set;
+ protected get;
+ }
+
+ public bool is_abstract {
+ get {
+ return this.vmethod.is_abstract;
+ }
+ }
+
+ public bool is_virtual {
+ get {
+ return this.vmethod.is_virtual;
+ }
+ }
+
+ public bool is_override {
+ get {
+ return this.vmethod.overrides;
+ }
+ }
+
+ public bool is_static {
+ get {
+ return !this.vmethod.instance;
+ }
+ }
+
+ public string# parent_name {
+ get {
+ return this.parent.name;
+ }
+ }
+
+ public bool is_global {
+ get {
+ return ( this.parent is Namespace )
+ ? true : false;
+ }
+ }
+
+ public bool is_constructor {
+ get {
+ return ( this.vmethod is Vala.CreationMethod )?
+ true : false;
+ }
+ }
+
+ public override string# name {
+ get {
+ if ( this.is_constructor )
+ return this.parent_name + this.vmethod.name.offset( ".new".len() );
+ else
+ return this.vmethod.name;
+ }
+ }
+
+ public void set_type_references ( ) {
+ this.set_return_type_references ( );
+
+ this.set_exception_type_references ( );
+ this.set_parameter_list_type_references ( );
+ }
+
+ public void visit ( Doclet doclet, Valadoc.MethodHandler in_type ) {
+ if ( !this.is_visitor_accessible ( ) )
+ return ;
+
+ doclet.visit_method ( this, in_type );
+ }
+
+ public void write ( Langlet langlet, void* ptr, Valadoc.MethodHandler parent ) {
+ langlet.write_method ( ptr, this, parent );
+ }
+}
+
+
+
+public class Valadoc.EnumValue: Basic {
+ public EnumValue ( Valadoc.Settings settings,
+ Vala.EnumValue venval,
+ Enum parent,
+ Tree head,
+ ErrorReporter err ) {
+ this.settings = settings;
+ this.venval = venval;
+ this.parent = parent;
+ this.head = head;
+ this.err = err;
+ }
+
+ public void initialisation ( ) {
+ this.bracket_level = 1;
+ this.vsymbol = venval;
+ }
+
+ public uint bracket_level {
+ construct set;
+ get;
+ }
+
+ public override string# name {
+ get {
+ return this.venval.name;
+ }
+ }
+
+ public Vala.EnumValue venval {
+ construct set;
+ protected get;
+ }
+
+ public void parse_comment ( ) {
+ this.parse_comment_helper ( this.venval, CommentContext.ENUM_VALUE );
+ }
+
+ public void write ( Langlet langlet, void* ptr ) {
+ langlet.write_enum_value ( this, ptr );
+ }
+
+ // move to a interface
+ public void write_comment ( void* ptr ) {
+ if ( this.comment == null )
+ return ;
+
+ this.comment.write ( ptr );
+ }
+
+ public void visit ( Doclet doclet ) {
+ doclet.visit_enum_value ( this );
+ }
+}
+
+
+
+public class Valadoc.ErrorCode : Basic {
+ public ErrorCode ( Valadoc.Settings settings,
+ Vala.ErrorCode verrcode,
+ ErrorDomain parent,
+ Tree head,
+ ErrorReporter err ) {
+ this.settings = settings;
+ this.verrcode = verrcode;
+ this.parent = parent;
+ this.head = head;
+ this.err = err;
+ }
+
+ public void initialisation ( ) {
+ this.bracket_level = 1;
+ this.vsymbol = verrcode;
+ }
+
+ public void parse_comments ( ) {
+ // TODO: Change Context
+ this.parse_comment_helper ( this.verrcode, CommentContext.ENUM_VALUE );
+ }
+
+ public uint bracket_level {
+ construct set;
+ get;
+ }
+
+ public override string# name {
+ get {
+ return this.verrcode.name;
+ }
+ }
+
+ public Vala.ErrorCode verrcode {
+ construct set;
+ protected get;
+ }
+
+ public void write ( Langlet langlet, void* ptr ) {
+ langlet.write_error_code ( this, ptr );
+ }
+
+ public void parse_comment ( ) {
+ // TODO: Change the CommentContext!
+ this.parse_comment_helper ( this.verrcode, CommentContext.ENUM_VALUE );
+ }
+
+ // move to a interface
+ public void write_comment ( void* ptr ) {
+ if ( this.comment == null )
+ return ;
+
+ this.comment.write ( ptr );
+ }
+
+ public void visit ( Doclet doclet ) {
+ doclet.visit_error_code ( this );
+ }
+}
+
+
+
+public abstract class Valadoc.DataType: Basic, SymbolAccessibility, Visitable {
+ public override string# name {
+ get {
+ return this.vsymbol.name;
+ }
+ }
+
+ public uint bracket_level {
+ construct set;
+ get;
+ }
+
+ public virtual void set_type_references ( ) {
+ }
+
+ public virtual void visit ( Doclet doclet ) {
+ }
+
+ public virtual void write ( Langlet langlet, void* ptr ) {
+ }
+
+ // move to a interface
+ public virtual void write_comment ( void* ptr ) {
+ if ( this.comment == null )
+ return ;
+
+ this.comment.write ( ptr );
+ }
+}
+
+
+public class Valadoc.Delegate : DataType, ParameterListHandler, SymbolAccessibility,
+ ReturnTypeHandler, TemplateParameterListHandler,
+ ExceptionHandler {
+ public Delegate ( Valadoc.Settings settings,
+ Vala.Delegate vdelegate,
+ Namespace parent,
+ Tree head,
+ ErrorReporter err,
+ uint bracket_level ) {
+ this.settings = settings;
+ this.vdelegate = vdelegate;
+ this.parent = parent;
+ this.head = head;
+ this.err = err;
+ this.bracket_level = bracket_level;
+ }
+
+ construct {
+ this.err_domains = new Gee.ArrayList<TypeReference>();
+ this.param_list = new Gee.ArrayList<FormalParameter> ();
+ this.template_param_lst = new Gee.ArrayList<TypeParameter> ();
+ }
+
+ public TypeReference return_type {
+ protected set;
+ get;
+ }
+
+ public void visit ( Doclet doclet ) {
+ if ( !this.is_visitor_accessible ( ) )
+ return ;
+
+ doclet.visit_delegate ( this );
+ }
+
+ public Gee.ArrayList<TypeParameter> template_param_lst {
+ protected set;
+ get;
+ }
+
+ protected Gee.ArrayList<FormalParameter> param_list {
+ protected set;
+ get;
+ }
+
+ protected Gee.ArrayList<TypeReference> err_domains {
+ protected set;
+ get;
+ }
+
+ public void initialisation ( ) {
+ this.vsymbol = this.vdelegate;
+
+ var vparamlst = this.vdelegate.get_parameters ();
+ this.add_parameter_list ( vparamlst );
+
+ var ret = this.vdelegate.return_type;
+ this.set_ret_type ( ret );
+ }
+
+ public Vala.Delegate vdelegate {
+ construct set;
+ protected get;
+ }
+
+ public bool is_static {
+ get {
+ return !this.vdelegate.instance;
+ }
+ }
+
+ public void set_type_references ( ) {
+ this.set_template_parameter_list_references ( );
+ this.set_parameter_list_type_references ( );
+ this.set_return_type_references ( );
+ }
+
+ public void parse_comments ( ) {
+ this.parse_comment_helper ( this.vdelegate, CommentContext.DELEGATE );
+ }
+
+ public bool is_vdelegate ( Vala.Delegate vdel ) {
+ return ( this.vdelegate == vdel )? true : false;
+ }
+
+ public override void write ( Langlet langlet, void* ptr ) {
+ langlet.write_delegate ( this, ptr );
+ }
+}
+
+
+
+public abstract class Valadoc.ContainerDataType : DataType, MethodHandler, Visitable,
+ TemplateParameterListHandler {
+ protected Gee.ArrayList<DataType> parent_types = new Gee.ArrayList<DataType>();
+
+ construct {
+ this.template_param_lst = new Gee.ArrayList<TypeParameter> ();
+ this.methods = new Gee.ArrayList<Method> ();
+ }
+
+ protected Gee.ArrayList<Method> methods {
+ set;
+ get;
+ }
+
+ public virtual string# comment_str {
+ get {
+ return null;
+ }
+ }
+
+ protected Gee.ArrayList<TypeParameter> template_param_lst {
+ set;
+ get;
+ }
+
+ public Gee.Collection<DataType> get_parent_types ( ) {
+ return this.parent_types;
+ }
+
+ public bool derived_from_interface ( Interface iface ) {
+ foreach ( DataType dtype in this.parent_types ) {
+ if ( dtype == iface )
+ return true;
+ }
+ return false;
+ }
+
+ public virtual void parse_comments ( ) {
+ this.parse_method_comments ( );
+ }
+
+ protected void set_parent_references ( Gee.Collection<Vala.DataType> lst ) {
+ if ( ((Gee.Collection)this.parent_types).size != 0 )
+ return ;
+
+ foreach ( Vala.DataType vtyperef in lst ) {
+ var vtype = vtyperef.data_type;
+ if ( vtype == null )
+ return ;
+
+ Vala.SourceFile vfile = vtype.source_reference.file;
+ File file = this.head.find_file ( vfile );
+
+ Vala.Symbol vns = vtype;
+ while ( vns is Vala.Namespace == false ) {
+ vns = vns.parent_symbol;
+ }
+
+ Namespace ns = file.find_namespace ( (Vala.Namespace)vns );
+
+
+ if ( vtype is Vala.Class ) {
+ var tmp = ns.find_vclass ( (Vala.Class)vtype );
+ this.parent_types.add ( tmp );
+ }
+ else if ( vtype is Vala.Interface ) {
+ var tmp = ns.find_interface ( (Vala.Interface)vtype );
+ this.parent_types.add ( tmp );
+ }
+ }
+ }
+
+ public override void set_type_references ( ) {
+ this.set_template_parameter_list_references ( );
+ this.set_method_type_references ( );
+ base.set_type_references ( );
+ }
+
+ public bool is_double_method ( Method met ) {
+ foreach ( Method m2 in this.methods ) {
+ if ( met == m2 )
+ continue;
+
+ if ( met.name == m2.name )
+ return true;
+ }
+ return false;
+ }
+}
+
+
+
+public class Valadoc.Class : ContainerDataType, Visitable, ClassHandler, StructHandler, SignalHandler,
+ PropertyHandler, ConstructionMethodHandler, FieldHandler {
+ public Class ( Valadoc.Settings settings,
+ Vala.Class vclass,
+ Basic parent,
+ Tree head,
+ ErrorReporter err,
+ uint bracket_level ) {
+ this.settings = settings;
+ this.vclass = vclass;
+ this.parent = parent;
+ this.head = head;
+ this.err = err;
+ this.bracket_level = bracket_level;
+ }
+
+ private bool inherited = false;
+ private Drawer.Class img;
+
+ protected Gee.ArrayList<Field> fields {
+ set;
+ get;
+ }
+
+ protected Gee.ArrayList<Method> construction_methods {
+ set;
+ get;
+ }
+
+ protected Gee.ArrayList<Property> properties {
+ get;
+ set;
+ }
+ protected Gee.ArrayList<Class> classes {
+ set;
+ get;
+ }
+
+ protected Gee.ArrayList<Struct> structs {
+ set;
+ get;
+ }
+
+ protected Gee.ArrayList<Signal> signals {
+ get;
+ set;
+ }
+
+ public override Basic? search_in_upper_namespace ( string[] params, int pos ) {
+ if ( this.name != params[pos] )
+ return null;
+
+ if ( params[pos+1] == null )
+ return this;
+
+ var element = this.search_field ( params, pos );
+ if ( element != null )
+ return element;
+
+ element = this.search_method ( params, pos );
+ if ( element != null )
+ return element;
+
+ element = this.search_construction_method ( params, pos );
+ if ( element != null )
+ return element;
+
+ element = this.search_signal ( params, pos );
+ if ( element != null )
+ return element;
+
+ element = this.search_property ( params, pos );
+ if ( element != null )
+ return element;
+
+
+ element = this.search_struct ( params, pos );
+ if ( element != null )
+ return element;
+
+ element = this.search_class ( params, pos );
+ if ( element != null )
+ return element;
+
+ return null;
+ }
+
+ public void initialisation ( ) {
+ this.construction_methods = new Gee.ArrayList<Method>();
+ this.properties = new Gee.ArrayList<Property>();
+ this.structs = new Gee.ArrayList<Struct> ();
+ this.classes = new Gee.ArrayList<Class> ();
+ this.signals = new Gee.ArrayList<Signal>();
+ this.fields = new Gee.ArrayList<Field> ();
+ this.vsymbol = this.vclass;
+
+ var vtparams = this.vclass.get_type_parameters ();
+ this.set_template_parameter_list ( vtparams );
+
+ Gee.Collection<Vala.Field> vfields = this.vclass.get_fields();
+ this.add_fields ( vfields );
+
+ Gee.Collection<Vala.Method> vmethods = this.vclass.get_methods ();
+ this.add_methods_and_construction_methods ( vmethods );
+
+ Gee.Collection<Vala.Signal> vsignals = this.vclass.get_signals();
+ this.add_signals ( vsignals );
+
+ Gee.Collection<Vala.Property> vproperties = this.vclass.get_properties();
+ this.add_properties ( vproperties );
+ }
+
+ public override string# comment_str {
+ get {
+ return this.vclass.source_reference.comment;
+ }
+ }
+
+ public Vala.Class vclass {
+ construct set;
+ protected get;
+ }
+
+ public bool is_vclass ( Vala.Class vcl ) {
+ return this.vclass == vcl;
+ }
+
+ public override void write ( Langlet langlet, void* ptr ) {
+ langlet.write_class ( this, ptr );
+ }
+
+ public bool is_abstract {
+ get {
+ return this.vclass.is_abstract;
+ }
+ }
+
+ public bool is_static {
+ get {
+ return this.vclass.is_static;
+ }
+ }
+
+ public override void visit ( Doclet doclet ) {
+ if ( !this.is_visitor_accessible ( ) )
+ return ;
+
+ doclet.visit_class ( this );
+ }
+
+ public override void parse_comments ( ) {
+ this.parse_comment_helper ( this.vclass, CommentContext.CLASS );
+ this.parse_construction_method_comments ( );
+ this.parse_property_comments ( );
+ this.parse_struct_comments ( );
+ this.parse_signal_comments ( );
+ this.parse_class_comments ( );
+ this.parse_field_comments ( );
+ base.parse_comments ( );
+ }
+
+ protected bool is_double_field ( Field f ) {
+ foreach ( Field f2 in this.fields ) {
+ if ( f == f2 )
+ continue ;
+
+ if ( f.name == f2.name )
+ return true;
+ }
+ return false;
+ }
+
+ protected Method find_base_method ( Method mt ) {
+ foreach ( Method m in this.methods ) {
+ if ( m.parent != this )
+ continue ;
+
+ if ( !m.is_override )
+ continue ;
+
+ if ( m.equals ( mt ) )
+ return m;
+ }
+ return null;
+ }
+
+/*
+ protected bool is_overwritten_method ( Method mt ) {
+ foreach ( Method m in this.methods ) {
+ if ( m.parent != this )
+ continue ;
+
+ if ( !m.is_override )
+ continue ;
+
+ if ( m.equals ( mt ) )
+ return true;
+ }
+ return false;
+ }
+*/
+ public override void set_type_references ( ) {
+ base.set_type_references ( );
+
+ var lst = this.vclass.get_base_types ();
+ this.set_parent_references ( lst );
+
+ this.set_construction_method_references ( );
+ this.set_property_type_reference ( );
+ this.set_signal_type_references ( );
+ this.set_field_type_references ( );
+ this.set_struct_references ( );
+ this.set_class_references ( );
+ }
+
+ private void inheritance_class ( Class dtype ) {
+ dtype.inheritance ( );
+
+ if ( dtype.name == "Object" )
+ return ;
+
+ var flst = dtype.get_field_list ( );
+ foreach ( Field f in flst ) {
+ this.fields.add ( f );
+ }
+
+ var plst = dtype.get_property_list ( );
+ foreach ( Property prop in plst ) {
+ this.properties.add ( prop );
+ }
+
+ var proplst = dtype.get_property_list ( );
+ foreach ( Property p in proplst ) {
+ if ( p.is_private )
+ continue ;
+
+ if ( p.is_override ) {
+ if ( this.is_overwritten_property ( p ) )
+ continue ;
+ }
+
+ this.properties.add ( p );
+ }
+
+ var mlst = dtype.get_method_list ( );
+ foreach ( Method m in mlst ) {
+ if ( m.is_private )
+ continue ;
+
+ if ( m.is_virtual || m.is_override ) {
+ Method basem = find_base_method ( m );
+ if ( basem != null )
+ basem.base_method = m;
+ continue ;
+ }
+
+ this.methods.add ( m );
+ }
+ }
+
+ private void inheritance_interface ( Interface dtype ) {
+ /*if ( dtype.derived_from_interface ( dtype ) )
+ return ; */
+
+ var plst = dtype.get_property_list ( );
+ foreach ( Property p in plst ) {
+ if ( p.is_private )
+ continue ;
+
+ if ( p.is_abstract )
+ continue ;
+
+ this.properties.add ( p );
+ }
+
+ var mlst = dtype.get_method_list ( );
+ foreach ( Method m in mlst ) {
+ if ( m.is_private )
+ continue ;
+
+ if ( m.is_abstract )
+ continue ;
+
+ this.methods.add ( m );
+ }
+
+ var slst = dtype.get_signal_list ( );
+ foreach ( Signal sig in slst ) {
+ if ( sig.is_private )
+ continue ;
+
+ this.signals.add ( sig );
+ }
+ }
+
+ public void inheritance ( ) {
+ if ( inherited == true )
+ return ;
+
+ inherited = true;
+ foreach ( DataType dtype in this.parent_types ) {
+ if ( dtype is Class )
+ this.inheritance_class ( (Class)dtype );
+ else if ( dtype is Interface )
+ this.inheritance_interface ( (Interface)dtype );
+ }
+
+ foreach ( Class cl in this.classes ) {
+ cl.inheritance( );
+ }
+ }
+
+ public Drawer.Class get_image ( ) {
+ if ( this.img == null ) {
+ var lst = new Gee.ArrayList<Drawer.Interface> ();
+ Drawer.Class parent = null;
+
+ foreach ( DataType dtype in this.get_parent_types ( ) ) {
+ if ( dtype is Valadoc.Class ) {
+ parent = ((Valadoc.Class)dtype).get_image ( );
+ continue ;
+ }
+ lst.add ( ((Valadoc.Interface)dtype).get_image() );
+ }
+ this.img = new Drawer.Class ( this.name, this.nspace.name, parent, lst );
+ }
+ return img;
+ }
+}
+
+
+
+public class Valadoc.ErrorDomain : DataType, MethodHandler, Visitable {
+ public ErrorDomain ( Valadoc.Settings settings,
+ Vala.ErrorDomain verrdom,
+ Namespace parent,
+ Tree head,
+ ErrorReporter err ) {
+ this.settings = settings;
+ this.verrdom = verrdom;
+ this.parent = parent;
+ this.head = head;
+ this.err = err;
+ }
+
+ private Gee.ArrayList<ErrorCode> errcodes = new Gee.ArrayList<ErrorCode> ();
+
+ private Vala.ErrorDomain verrdom {
+ protected set;
+ get;
+ }
+
+ protected Gee.ArrayList<Method> methods {
+ protected set;
+ get;
+ }
+
+ private inline Basic? search_error_code ( string[] params, int pos ) {
+ pos++;
+
+ if ( params[pos+1] != null )
+ return null;
+
+ foreach ( ErrorCode errcode in this.errcodes ) {
+ if ( errcode.name == params[pos] )
+ return errcode;
+ }
+ return null;
+ }
+
+ public override Basic? search_in_upper_namespace ( string[] params, int pos ) {
+ if ( this.name != params[pos] )
+ return null;
+
+ if ( params[pos+1] == null )
+ return this;
+
+ var element = this.search_method ( params, pos );
+ if ( element != null )
+ return element;
+
+ element = this.search_error_code ( params, pos );
+ if ( element != null )
+ return element;
+
+ return null;
+ }
+
+ public void parse_comments ( ) {
+ this.parse_comment_helper ( this.verrdom, CommentContext.ENUM );
+ this.parse_method_comments ( );
+
+ foreach ( ErrorCode errcode in this.errcodes ) {
+ errcode.parse_comments ( );
+ }
+ }
+
+ public void visit_error_codes ( Doclet doclet ) {
+ foreach ( ErrorCode errcode in this.errcodes )
+ errcode.visit ( doclet );
+ }
+
+ public Gee.ReadOnlyCollection<ErrorCode> get_error_code_list ( ) {
+ return new Gee.ReadOnlyCollection<ErrorCode> ( this.errcodes );
+ }
+
+ public void visit ( Doclet doclet ) {
+ if ( !this.is_visitor_accessible ( ) )
+ return ;
+
+ doclet.visit_error_domain ( this );
+ }
+
+ public override void write ( Langlet langlet, void* ptr ) {
+ langlet.write_error_domain ( this, ptr );
+ }
+
+ private inline void append_error_code ( Gee.Collection<Vala.ErrorCode> verrcodes ) {
+ foreach ( Vala.ErrorCode verrcode in verrcodes ) {
+ var tmp = new ErrorCode ( this.settings, verrcode, this, this.head, this.err );
+ tmp.initialisation ( );
+ this.errcodes.add ( tmp );
+ }
+ }
+
+ public override void set_type_references ( ) {
+ this.set_method_type_references ( );
+ }
+
+ public void initialisation ( ) {
+ this.vsymbol = this.verrdom;
+
+ Gee.Collection<Vala.Method> vmethods = this.verrdom.get_methods ();
+ this.methods = new Gee.ArrayList<Method> ();
+ this.add_methods ( vmethods );
+
+ Gee.Collection<Vala.ErrorCode> verrcodes = this.verrdom.get_codes ();
+ this.append_error_code ( verrcodes );
+ }
+}
+
+
+
+public class Valadoc.Enum : DataType, MethodHandler, Visitable {
+ public Enum ( Valadoc.Settings settings,
+ Vala.Enum venum,
+ Namespace parent,
+ Tree head,
+ ErrorReporter err ) {
+ this.settings = settings;
+ this.venum = venum;
+ this.parent = parent;
+ this.head = head;
+ this.err = err;
+ }
+
+ private inline Basic? search_enum_value ( string[] params, int pos ) {
+ pos++;
+
+ if ( params[pos+1] != null )
+ return null;
+
+ foreach ( EnumValue enval in this.en_values ) {
+ if ( enval.name == params[pos] )
+ return enval;
+ }
+ return null;
+ }
+
+ public override Basic? search_in_upper_namespace ( string[] params, int pos ) {
+ if ( this.name != params[pos] )
+ return null;
+
+ if ( params[pos+1] == null )
+ return this;
+
+
+ var element = this.search_method ( params, pos );
+ if ( element != null )
+ return element;
+
+ element = this.search_enum_value ( params, pos );
+ if ( element != null )
+ return element;
+
+ return null;
+ }
+
+ public override void set_type_references ( ) {
+ this.set_method_type_references ( );
+ }
+
+ construct {
+ this.en_values = new Gee.ArrayList<EnumValue> ();
+ this.methods = new Gee.ArrayList<Method> ();
+ }
+
+ protected Gee.ArrayList<Method> methods {
+ protected set;
+ get;
+ }
+
+ protected Gee.ArrayList<EnumValue> en_values {
+ get;
+ set;
+ }
+
+ public Gee.ReadOnlyCollection<EnumValue> get_enum_values () {
+ return new Gee.ReadOnlyCollection<EnumValue>( this.en_values );
+ }
+
+ public void parse_comments ( ) {
+ this.parse_comment_helper ( this.venum, CommentContext.ENUM );
+ this.parse_enum_value_comments ( );
+ this.parse_method_comments ( );
+ }
+
+ private inline void add_enum_values ( Gee.Collection<Vala.EnumValue> venvals ) {
+ foreach ( Vala.EnumValue venval in venvals ) {
+ var tmp = new EnumValue ( this.settings, venval, this, this.head, this.err );
+ tmp.initialisation ( );
+ this.en_values.add ( tmp );
+ }
+ }
+
+ public void initialisation ( ) {
+ this.vsymbol = this.venum;
+
+ Gee.Collection<Vala.Method> vmethods = this.venum.get_methods ();
+ this.add_methods ( vmethods );
+
+ Gee.Collection<Vala.EnumValue> venvals = this.venum.get_values ();
+ this.add_enum_values ( venvals );
+ }
+
+ public void visit_enum_values ( Doclet doclet ) {
+ foreach ( EnumValue enval in this.en_values )
+ enval.visit ( doclet );
+ }
+
+ public override void visit ( Doclet doclet ) {
+ if ( !this.is_visitor_accessible ( ) )
+ return ;
+
+ doclet.visit_enum ( this );
+ }
+
+ public Vala.Enum venum {
+ construct set;
+ protected get;
+ }
+
+ public bool is_venum ( Vala.Enum ven ) {
+ return ( this.venum == ven )? true : false;
+ }
+
+ public override void write ( Langlet langlet, void* ptr ) {
+ langlet.write_enum ( this, ptr );
+ }
+
+ public void parse_enum_value_comments ( ) {
+ foreach ( EnumValue enval in this.en_values ) {
+ enval.parse_comment ( );
+ }
+ }
+}
+
+
+
+public class Valadoc.Struct : ContainerDataType, Visitable, ConstructionMethodHandler, FieldHandler {
+ public Struct ( Valadoc.Settings settings,
+ Vala.Struct vstruct,
+ Basic parent,
+ Tree head,
+ ErrorReporter err,
+ uint bracket_level ) {
+ this.settings = settings;
+ this.vstruct = vstruct;
+ this.parent = parent;
+ this.head = head;
+ this.err = err;
+ this.bracket_level = bracket_level;
+ }
+
+ protected Gee.ArrayList<Field> fields {
+ set;
+ get;
+ }
+
+ protected Gee.ArrayList<Method> construction_methods {
+ set;
+ get;
+ }
+
+ public override Basic? search_in_upper_namespace ( string[] params, int pos ) {
+ if ( this.name != params[pos] )
+ return null;
+
+ if ( params[pos+1] == null )
+ return this;
+
+ var element = this.search_field ( params, pos );
+ if ( element != null )
+ return element;
+
+ element = this.search_method ( params, pos );
+ if ( element != null )
+ return element;
+
+ return this.search_construction_method ( params, pos );
+ }
+
+ public void initialisation ( ) {
+ this.construction_methods = new Gee.ArrayList<Method>();
+ this.fields = new Gee.ArrayList<Field> ();
+ this.vsymbol = this.vstruct;
+
+ Gee.Collection<Vala.Field> vfields = this.vstruct.get_fields();
+ this.add_fields ( vfields );
+
+ Gee.Collection<Vala.Method> vmethods = this.vstruct.get_methods ();
+ this.add_methods_and_construction_methods ( vmethods );
+ }
+
+ public virtual string# comment_str {
+ get {
+ return this.vstruct.source_reference.comment;
+ }
+ }
+
+ public Vala.Struct vstruct {
+ construct set;
+ protected get;
+ }
+
+ public bool is_vstruct ( Vala.Struct vstru ) {
+ return ( this.vstruct == vstru )? true : false;
+ }
+
+ public override void visit ( Doclet doclet ) {
+ if ( !this.is_visitor_accessible ( ) )
+ return ;
+
+ doclet.visit_struct ( this );
+ }
+
+ public override void write ( Langlet langlet, void* ptr ) {
+ langlet.write_struct ( this, ptr );
+ }
+
+ public override void parse_comments ( ) {
+ this.parse_comment_helper ( this.vstruct, CommentContext.STRUCT );
+ this.parse_construction_method_comments ( );
+ this.parse_field_comments ( );
+ base.parse_comments ( );
+ }
+
+ public override void set_type_references ( ) {
+ this.set_construction_method_references ( );
+ this.set_field_type_references ( );
+ base.set_type_references ( );
+
+ var lst = this.vstruct.get_base_types ();
+ this.set_parent_references ( lst );
+ }
+}
+
+
+
+public class Valadoc.Interface : ContainerDataType, Visitable, SignalHandler, PropertyHandler {
+ public Interface ( Valadoc.Settings settings,
+ Vala.Interface vinterface,
+ Namespace parent,
+ Tree head,
+ ErrorReporter err ) {
+ this.settings = settings;
+ this.vinterface = vinterface;
+ this.parent = parent;
+ this.head = head;
+ this.err = err;
+ }
+
+ private Drawer.Interface img;
+
+ protected Gee.ArrayList<Property> properties {
+ get;
+ set;
+ }
+
+ protected Gee.ArrayList<Signal> signals {
+ get;
+ set;
+ }
+
+ public Vala.Interface vinterface {
+ construct set;
+ protected get;
+ }
+
+ public override Basic? search_in_upper_namespace ( string[] params, int pos ) {
+ if ( this.name != params[pos] )
+ return null;
+
+ if ( params[pos+1] == null )
+ return this;
+
+ var element = this.search_method ( params, pos );
+ if ( element != null )
+ return element;
+
+ element = this.search_signal ( params, pos );
+ if ( element != null )
+ return element;
+
+ element = this.search_property ( params, pos );
+ if ( element != null )
+ return element;
+
+ return null;
+ }
+
+ public void initialisation ( ) {
+ this.properties = new Gee.ArrayList<Property>();
+ this.signals = new Gee.ArrayList<Signal>();
+ this.vsymbol = this.vinterface;
+
+ var vtparams = this.vinterface.get_type_parameters ();
+ this.set_template_parameter_list ( vtparams );
+
+ Gee.Collection<Method> methods = this.vinterface.get_methods ();
+ this.add_methods ( methods );
+
+ Gee.Collection<Signal> signals = this.vinterface.get_signals();
+ this.add_signals ( signals );
+
+ Gee.Collection<Property> properties = this.vinterface.get_properties();
+ this.add_properties ( properties );
+ }
+
+ public virtual string# comment_str {
+ get {
+ return this.vinterface.source_reference.comment;
+ }
+ }
+
+ public bool is_vinterface ( Vala.Interface viface ) {
+ return ( this.vinterface == viface )? true : false;
+ }
+
+ public override void visit ( Doclet doclet ) {
+ if ( !this.is_visitor_accessible ( ) )
+ return ;
+
+ doclet.visit_interface ( this );
+ }
+
+ public override void write ( Langlet langlet, void* ptr ) {
+ langlet.write_interface ( this, ptr );
+ }
+
+ public override void parse_comments ( ) {
+ this.parse_comment_helper ( this.vinterface, CommentContext.INTERFACE );
+ this.parse_property_comments ( );
+ this.parse_signal_comments ( );
+ base.parse_comments ( );
+ }
+
+ public override void set_type_references ( ) {
+ base.set_type_references ( );
+
+ this.set_property_type_reference ();
+ this.set_signal_type_references ();
+
+ var lst = this.vinterface.get_prerequisites ( );
+ this.set_parent_references ( lst );
+ }
+
+ public Drawer.Interface get_image ( ) {
+ if ( this.img == null ) {
+ // not done!
+ this.img = new Drawer.Interface ( this.name, this.nspace.name, null, null );
+ }
+ return img;
+ }
+}
+
+
+public class Valadoc.Namespace : Basic, MethodHandler, FieldHandler, Visitable, NamespaceHandler,
+ SymbolAccessibility, ClassHandler, StructHandler
+{
+ private Gee.ArrayList<Interface> interfaces = new Gee.ArrayList<Interface>();
+ private Gee.ArrayList<Delegate> delegates = new Gee.ArrayList<Delegate>();
+ private Gee.ArrayList<Enum> enums = new Gee.ArrayList<Enum>();
+ private Gee.ArrayList<ErrorDomain> errdoms = new Gee.ArrayList<ErrorDomain>();
+
+ private string _full_name = null;
+
+ public Gee.ArrayList<Namespace> namespaces {
+ private set;
+ get;
+ }
+
+ protected Gee.ArrayList<Class> classes {
+ private set;
+ get;
+ }
+
+ protected Gee.ArrayList<Struct> structs {
+ private set;
+ get;
+ }
+
+ public string full_name {
+ get {
+ if ( this.name == null )
+ return null;
+
+ if ( this._full_name == null ) {
+ this._full_name = this.name;
+ Basic pos = this.parent;
+
+ while ( pos is Namespace ) {
+ this._full_name = pos.name + "." + this._full_name;
+ pos = pos.parent;
+ }
+ }
+
+ return this._full_name;
+ }
+ }
+
+ construct {
+ this.namespaces = new Gee.ArrayList<Namespace> ();
+ this.methods = new Gee.ArrayList<Method> ();
+ this.structs = new Gee.ArrayList<Struct>();
+ this.classes = new Gee.ArrayList<Class>();
+ this.fields = new Gee.ArrayList<Field> ();
+ this.bracket_level = 0;
+ }
+
+ private inline Basic? search_namespace ( string[] params, int pos ) {
+ foreach ( Namespace ns in this.namespaces ) {
+ Basic element = ns.search_in_upper_namespace ( params, pos+1 );
+ if ( element != null )
+ return element;
+ }
+ return null;
+ }
+
+ private inline Basic? search_interface ( string[] params, int pos ) {
+ foreach ( Interface iface in this.interfaces ) {
+ Basic element = iface.search_in_upper_namespace ( params, pos+1 );
+ if ( element != null )
+ return element;
+ }
+ return null;
+ }
+
+ private inline Basic? search_enum ( string[] params, int pos ) {
+ foreach ( Enum en in this.enums ) {
+ Basic element = en.search_in_upper_namespace ( params, pos+1 );
+ if ( element != null )
+ return element;
+ }
+ return null;
+ }
+
+ private inline Basic? search_error_domain ( string[] params, int pos ) {
+ foreach ( ErrorDomain errdom in this.errdoms ) {
+ Basic element = errdom.search_in_upper_namespace ( params, pos+1 );
+ if ( element != null )
+ return element;
+ }
+ return null;
+ }
+
+ protected inline Basic? search_delegate ( string[] params, int pos ) {
+ pos++;
+
+ if ( params[pos+1] != null )
+ return null;
+
+ foreach ( Delegate del in this.delegates ) {
+ if ( del.name == params[pos] )
+ return del;
+ }
+ return null;
+ }
+
+ public override Basic? search_in_upper_namespace ( string[] params, int pos ) {
+ if ( this.name != params[pos] )
+ return null;
+
+ if ( params[pos+1] == null )
+ return this;
+
+
+ Basic element = this.search_namespace ( params, pos );
+ if ( element != null )
+ return element;
+
+ element = this.search_class ( params, pos );
+ if ( element != null )
+ return element;
+
+ element = this.search_interface ( params, pos );
+ if ( element != null )
+ return element;
+
+ element = this.search_struct ( params, pos );
+ if ( element != null )
+ return element;
+
+ element = this.search_enum ( params, pos );
+ if ( element != null )
+ return element;
+
+ element = this.search_error_domain ( params, pos );
+ if ( element != null )
+ return element;
+
+ element = this.search_method ( params, pos );
+ if ( element != null )
+ return element;
+
+ element = this.search_field ( params, pos );
+ if ( element != null )
+ return element;
+
+ element = this.search_delegate ( params, pos );
+ if ( element != null )
+ return element;
+
+ return null;
+ }
+
+ public void create_images ( ) {
+ this.create_namespace_images ( );
+
+ var drawer = new Drawer.Drawer ( );
+ drawer.interface_arrow_len = 20;
+ drawer.class_arrow_len = 20;
+ drawer.block_height = 30;
+ drawer.block_width = 120;
+
+ foreach ( Class cl in this.classes ) {
+ var climg = cl.get_image ( );
+ drawer.draw_class ( climg, cl.name + ".png" );
+ }
+ }
+
+ public Gee.Collection<Delegate> get_delegate_list ( ) {
+ var lst = new Gee.ArrayList<Delegate> ();
+ foreach ( Delegate del in this.delegates ) {
+ if ( !del.is_type_visitor_accessible ( this ) )
+ continue ;
+
+ lst.add ( del );
+ }
+
+ return new Gee.ReadOnlyCollection<Delegate>( lst );
+ }
+
+ public uint bracket_level {
+ construct set;
+ get;
+ }
+
+ public string# path {
+ get {
+ return this.name;
+ }
+ }
+
+ protected Gee.ArrayList<Field> fields {
+ set;
+ get;
+ }
+
+ protected Gee.ArrayList<Method> methods {
+ set;
+ get;
+ }
+
+ public File file {
+ get {
+ return (File)this.parent;
+ }
+ }
+
+ public Interface find_interface ( Vala.Interface viface ) {
+ foreach ( Interface iface in this.interfaces ) {
+ if ( iface.is_vinterface( viface ) )
+ return iface;
+ }
+
+ return null;
+ }
+
+ public Delegate find_delegate ( Vala.Delegate vdel ) {
+ foreach ( Delegate del in this.delegates ) {
+ if ( del.is_vdelegate( vdel ) )
+ return del;
+ }
+
+ return null;
+ }
+
+ public Struct find_struct ( Vala.Struct vstruct ) {
+ foreach ( Struct stru in this.structs ) {
+ if ( stru.is_vstruct( vstruct ) )
+ return stru;
+ }
+
+ return null;
+ }
+
+ public Class find_class ( Vala.Class vclass ) {
+ foreach ( Class cl in this.classes ) {
+ if ( cl.is_vclass( vclass ) )
+ return cl;
+ }
+
+ return null;
+ }
+
+ public Enum find_enum ( Vala.Enum venum ) {
+ foreach ( Enum en in this.enums ) {
+ if ( en.is_venum( venum ) )
+ return en;
+ }
+
+ return null;
+ }
+
+ public Namespace ( Valadoc.Settings settings,
+ Vala.Namespace vnspace,
+ NamespaceHandler parent,
+ Tree head,
+ ErrorReporter err ) {
+ this.settings = settings;
+ this.vnspace = vnspace;
+ this.parent = parent;
+ this.head = head;
+ this.err = err;
+ }
+
+ public void visit_delegates ( Doclet doclet ) {
+ foreach ( Delegate del in this.delegates ) {
+ del.visit ( doclet );
+ }
+ }
+
+ public void visit_enums ( Doclet doclet ) {
+ foreach ( Enum en in this.enums ) {
+ en.visit( doclet );
+ }
+ }
+
+ public void visit_error_domains ( Doclet doclet ) {
+ foreach ( ErrorDomain errdom in this.errdoms ) {
+ errdom.visit ( doclet );
+ }
+ }
+
+ // Whats about the interface-handler?
+ public void visit_interfaces ( Doclet doclet ) {
+ foreach ( Interface iface in this.interfaces ) {
+ iface.visit( doclet );
+ }
+ }
+
+ public void visit ( Doclet doclet ) {
+ doclet.visit_namespace ( this );
+ }
+
+ public Vala.Namespace vnspace {
+ construct set;
+ protected get;
+ }
+
+ public override string# name {
+ get {
+ return this.vnspace.name;
+ }
+ }
+
+ public void append_interface ( Vala.Interface viface ) {
+ var tmp = new Interface ( this.settings, viface, this, this.head, this.err );
+ tmp.initialisation ( );
+ this.interfaces.add ( tmp );
+ }
+
+ private Valadoc.Class create_subclasses ( Vala.Class vcl, Basic parent,
+ Gee.HashMap<Vala.Class, Gee.ArrayList<Vala.Class> > sub_classes,
+ Gee.HashMap<Vala.Class, Gee.ArrayList<Vala.Struct> > sub_structs,
+ uint rank )
+ {
+ var cl = new Class ( this.settings, vcl, parent, this.head, this.err, rank++ );
+ cl.initialisation( );
+
+ foreach ( Vala.Struct vsubstruct in sub_structs.get( vcl ) ) {
+ var substru = new Struct ( this.settings, vsubstruct, cl, this.head, this.err, rank );
+ substru.initialisation( );
+ cl.append_struct ( substru );
+ }
+
+ foreach ( Vala.Class vsubcl in sub_classes.get ( vcl ) ) {
+ var subcl = this.create_subclasses ( vsubcl, cl,sub_classes, sub_structs, rank );
+ cl.append_class ( subcl );
+ }
+ return cl;
+ }
+
+ public void append_global_class ( Vala.Class vclass, Gee.HashMap<Vala.Class, Gee.ArrayList<Vala.Class> > vsubclasses,
+ Gee.HashMap<Vala.Class, Gee.ArrayList<Vala.Class> > vsubstructs )
+ {
+ var tmp = this.create_subclasses ( vclass, this, vsubclasses, vsubstructs, 0 );
+ this.append_class ( tmp );
+ }
+
+ public void append_global_struct ( Vala.Struct vstruct ) {
+ var tmp = new Struct ( this.settings, vstruct, this, this.head, this.err, 0 );
+ tmp.initialisation ( );
+ this.append_struct ( tmp );
+ }
+
+ public void append_enum ( Vala.Enum venum ) {
+ var tmp = new Enum ( this.settings, venum, this, this.head, this.err );
+ tmp.initialisation ( );
+ this.enums.add( tmp );
+ }
+
+ public void append_error_domain ( Vala.ErrorDomain verrdom ) {
+ var tmp = new ErrorDomain ( this.settings, verrdom, this, this.head, this.err );
+ tmp.initialisation ( );
+ this.errdoms.add ( tmp );
+ }
+
+ public void append_global_method ( Vala.Method vm ) {
+ var tmp = new Method ( this.settings, vm, this, this.head, this.err, 0 );
+ tmp.initialisation ( );
+ this.methods.add ( tmp );
+ }
+
+ public void append_global_field ( Vala.Field vf ) {
+ var tmp = new Field ( this.settings, vf, this, this.head, this.err, 0 );
+ tmp.initialisation ( );
+ this.fields.add( tmp );
+ }
+
+ public void append_delegate ( Vala.Delegate vdel ) {
+ var tmp = new Delegate ( this.settings, vdel, this, this.head, this.err, 0 );
+ tmp.initialisation ( );
+ this.delegates.add ( tmp );
+ }
+
+ // use interface-functions
+ public void set_type_references ( ) {
+ this.set_namespace_type_references ( );
+ this.set_method_type_references ( );
+ this.set_field_type_references ( );
+ this.set_struct_references ( );
+ this.set_class_references ( );
+
+ foreach ( Interface iface in this.interfaces ) {
+ iface.set_type_references ( );
+ }
+
+ foreach ( Delegate del in this.delegates ) {
+ del.set_type_references ( );
+ }
+
+ foreach ( Enum en in this.enums ) {
+ en.set_type_references ( );
+ }
+
+ foreach ( ErrorDomain errdom in this.errdoms ) {
+ errdom.set_type_references ( );
+ }
+ }
+
+ public void inheritance ( ) {
+ this.namespace_inheritance ( );
+
+ foreach ( Class cl in this.classes ) {
+ cl.inheritance ( );
+ }
+ }
+
+ public void parse_comments ( ) {
+ this.parse_field_comments ( );
+ this.parse_class_comments ( );
+ this.parse_method_comments ( );
+ this.parse_struct_comments ( );
+ this.parse_namespace_comments ( );
+
+ foreach ( Interface iface in this.interfaces ) {
+ iface.parse_comments ( );
+ }
+
+ foreach ( Delegate del in this.delegates ) {
+ del.parse_comments ( );
+ }
+
+ foreach ( ErrorDomain errdom in this.errdoms ) {
+ errdom.parse_comments ( );
+ }
+
+ foreach ( Enum en in this.enums ) {
+ en.parse_comments ( );
+ }
+ }
+
+ public bool is_vnspace ( Vala.Namespace vns ) {
+ return ( this.vnspace == vns )? true : false ;
+ }
+
+ public void write ( Langlet langlet, void* ptr ) {
+ langlet.write_namespace ( this, ptr );
+ }
+}
+
+
+public class Valadoc.File : Basic, NamespaceHandler, Visitable {
+ public Gee.ArrayList<Namespace> namespaces {
+ get;
+ private set;
+ default = new Gee.ArrayList<Namespace>();
+ }
+
+ public File ( Valadoc.Settings settings,
+ Vala.SourceFile vfile,
+ Tree head,
+ ErrorReporter err ) {
+ this.settings = settings;
+ this.vfile = vfile;
+ this.head = head;
+ this.err = err;
+ }
+
+ public string name {
+ get {
+ return this.vfile.filename;
+ }
+ }
+
+ public Vala.SourceFile vfile {
+ construct set;
+ protected get;
+ }
+
+ public override Basic? search_in_upper_namespace ( string[] params, int pos ) {
+ foreach ( Namespace ns in this.namespaces ) {
+ Basic element = ns.search_in_upper_namespace( params, pos );
+ if ( element != null )
+ return element;
+ }
+ return null;
+ }
+
+ public bool is_file ( Vala.SourceFile vfile ) {
+ return ( vfile == this.vfile )? true : false;
+ }
+
+ public void visit ( Doclet doclet ) {
+ if ( !settings.to_doc ( this.name ) )
+ return ;
+
+ doclet.visit_file ( this );
+ }
+
+ public void append_interface ( Vala.Interface viface ) {
+ var ns = this.get_namespace ( viface );
+ ns.append_interface ( viface );
+ }
+
+ public void append_class ( Vala.Class vclass,
+ Gee.HashMap< Gee.Collection<Vala.Class> > vsubclasses,
+ Gee.HashMap< Gee.Collection<Vala.Struct> > vsubstructs ) {
+ var ns = this.get_namespace ( vclass );
+ ns.append_global_class ( vclass, vsubclasses, vsubstructs );
+ }
+
+ public void append_struct ( Vala.Struct vstruct ) {
+ var ns = this.get_namespace ( vstruct );
+ ns.append_global_struct ( vstruct );
+ }
+
+ public void append_enum ( Vala.Enum venum ) {
+ var ns = this.get_namespace ( venum );
+ ns.append_enum ( venum );
+ }
+
+ public void append_error_domain ( Vala.ErrorDomain verrdom ) {
+ var ns = this.get_namespace ( verrdom );
+ ns.append_error_domain ( verrdom );
+ }
+
+ public void append_global_method ( Vala.Method vm ){
+ var ns = this.get_namespace ( vm );
+ ns.append_global_method ( vm );
+ }
+
+ public void append_global_field ( Vala.Field vf ) {
+ var ns = this.get_namespace ( vf );
+ ns.append_global_field( vf );
+ }
+
+ public void append_delegate ( Vala.Delegate vdel ) {
+ var ns = this.get_namespace ( vdel );
+ ns.append_delegate ( vdel );
+ }
+
+ public void inheritance ( ) {
+ this.namespace_inheritance ( );
+ }
+
+ public void parse_comments ( ) {
+ this.parse_namespace_comments ( );
+ }
+
+ public void create_images ( ) {
+ this.create_namespace_images ( );
+ }
+
+ public void set_type_references ( ) {
+ this.set_namespace_type_references ( );
+ }
+
+ public void write ( Langlet langlet, void* ptr ) {
+ langlet.write_file ( this, ptr );
+ }
+}
+
+
+
+public class Valadoc.Tree : Vala.CodeVisitor {
+ private uint level = 0;
+ private Gee.ArrayList<File> files = new Gee.ArrayList<File>();
+
+ private Vala.Typesymbol current_type = null;
+
+ private Gee.HashMap<Vala.Class, Gee.ArrayList<Vala.Class> > sub_classes
+ = new Gee.HashMap<Vala.Class, Gee.ArrayList<Vala.Class> > ();
+
+ private Gee.HashMap<Vala.Class, Gee.ArrayList<Vala.Struct> > sub_structs
+ = new Gee.HashMap<Vala.Class, Gee.ArrayList<Vala.Struct> > ();
+
+
+ public Valadoc.Settings settings {
+ construct set;
+ get;
+ }
+
+ public Tree ( Valadoc.Settings settings,
+ Vala.CodeContext context,
+ ErrorReporter err ) {
+ this.settings = settings;
+ this.context = context;
+ this.err = err;
+ }
+
+ public CodeContext context {
+ construct set;
+ get;
+ }
+
+ public ErrorReporter err {
+ construct set;
+ get;
+ }
+
+ public void visit ( Doclet doclet ) {
+ foreach ( File file in this.files ) {
+ file.visit ( doclet );
+ }
+ }
+
+
+ private string[] expand_param_field ( string[] params, string str, int params_offset = 0 ) {
+ string[] field = str.split( ".", -1 );
+
+ int field_length; for ( field_length=0; field[field_length] != null ; field_length++ );
+ int params_length; for ( params_length=0; params[params_length] != null ; params_length++ );
+
+ string[] ret = new string[ field_length + params_length + 1 ];
+
+ int i;
+ for ( i = 0; field[i] != null; i++ ) {
+ ret[i] = field[i];
+ }
+
+ for ( int ii = params_offset; params[ii] != null; ii++, i++ ) {
+ ret[i] = params[ii];
+ }
+
+ return ret;
+ }
+
+ private Basic? search_symbol_in_namespace ( Basic element, string[] params ) {
+ return this.search_symbol_in_symbol ( element.nspace, params );
+ }
+
+ private Basic? search_symbol_in_type ( Basic element, string[] params, int params_offset = 0 ) {
+ if ( !( element.parent is ContainerDataType || element.parent is Enum || element.parent is ErrorDomain ) )
+ return null;
+
+ return this.search_symbol_in_symbol ( element.parent, params, params_offset );
+ }
+
+ private Basic? search_symbol_in_symbol ( Basic element, string[] params, int params_offset = 0 ) {
+ Basic el = element;
+ string str = null;
+ while ( el.parent != null ) {
+ if ( el != element )
+ str = el.name + "." + str;
+ else
+ str = el.name;
+
+ el = el.parent;
+ }
+
+ if ( str == null )
+ return null;
+
+ var fullparams = this.expand_param_field ( params, str, params_offset );
+ return this.search_symbol_in_namespaces ( element, fullparams );
+ }
+
+ private Basic? search_symbol_in_global_namespaces ( Basic element, string[] params ) {
+ int param_size = 0;
+ for ( param_size = 0; params[param_size] != null; param_size++ );
+
+ string[] global_params = new string [ param_size +1];
+
+ global_params[0] = null;
+ for ( int i = 0; params[i-1] != null ; i++ ) {
+ global_params[i+1] = params[i];
+ }
+
+ foreach ( File f in this.files ) {
+ Basic element = f.search_in_upper_namespace ( global_params, 0 );
+ if ( element != null )
+ return element;
+ }
+ return null;
+ }
+
+ private Basic? search_symbol_in_namespaces ( Basic element, string[] params ) {
+ foreach ( File f in this.files ) {
+ Basic element = f.search_in_upper_namespace ( params, 0 );
+ if ( element != null )
+ return element;
+ }
+ return null;
+ }
+
+ /**
+ * Looks for the element adressed by params in the tree.
+ *
+ * @param params a null terminated string of names of element in the trees.
+ * ( { "glib", "String", "append", null } for example )
+ * @return The element or null if it is not available.
+ */
+ private Basic? search_in_upper_namespace ( Basic element, string[] params ) {
+ if ( params[0] == "this" ) {
+ return search_symbol_in_type ( element, params, 1 );
+ }
+
+ // Global Namespace:
+ var tmp = search_symbol_in_global_namespaces ( element, params );
+ if ( tmp != null )
+ return tmp;
+
+ // In the other Namespaces:
+ tmp = this.search_symbol_in_namespaces ( element, params );
+ if ( tmp != null )
+ return tmp;
+
+ // In the same namespace as element:
+ tmp = this.search_symbol_in_namespace ( element, params );
+ if ( tmp != null )
+ return tmp;
+
+ // In the same datatype:
+ tmp = search_symbol_in_type ( element, params );
+ if ( tmp != null )
+ return tmp;
+
+ return null;
+ }
+
+ public Basic? search_symbol_str ( Valadoc.Basic element, string symname ) {
+ string[] params = symname.split( ".", -1 );
+ return this.search_in_upper_namespace ( element, params );
+ }
+
+ public override void visit_namespace ( Vala.Namespace vns ) {
+ vns.accept_children ( this );
+ }
+
+ public override void visit_field ( Vala.Field vf ) {
+ if ( this.level > 0 )
+ return ;
+
+ Vala.SourceReference vsrcref = vf.source_reference;
+ Vala.SourceFile vsrc = vsrcref.file;
+
+ File file = get_file ( vsrc );
+ file.append_global_field ( vf );
+ }
+
+ public override void visit_method ( Vala.Method vm ) {
+ if ( this.level > 0 )
+ return ;
+
+ Vala.SourceReference vsrcref = vm.source_reference;
+ Vala.SourceFile vsrc = vsrcref.file;
+
+ File file = get_file ( vsrc );
+ file.append_global_method ( vm );
+ }
+
+ public override void visit_struct ( Vala.Struct vstruct ) {
+ this.level++;
+
+ if ( this.level == 1 ) {
+ Vala.SourceReference vsrcref = vstruct.source_reference;
+ Vala.SourceFile vsrc = vsrcref.file;
+
+ File file = get_file ( vsrc );
+ file.append_struct ( vstruct );
+ }
+ else {
+ Gee.ArrayList<Vala.Class> vstrulist = this.sub_structs.get ( this.current_type );
+ vstrulist.add ( vstruct );
+ }
+
+ this.level--;
+ }
+
+ public override void visit_interface ( Vala.Interface viface ) {
+ Vala.SourceReference vsrcref = viface.source_reference;
+ Vala.SourceFile vsrc = vsrcref.file;
+
+ File file = get_file ( vsrc );
+ file.append_interface ( viface );
+ }
+
+
+ public override void visit_class ( Vala.Class vcl ) {
+ Vala.Typesymbol parent_type = this.current_type;
+ this.current_type = vcl;
+ this.level++;
+
+ var vcllist = new Gee.ArrayList<Vala.Class> ();
+ this.sub_classes.set ( vcl, vcllist );
+
+ var vstrulist = new Gee.ArrayList<Vala.Class> ();
+ this.sub_structs.set ( vcl, vstrulist );
+
+ vcl.accept_children ( this );
+
+ if ( this.level == 1 ) {
+ Vala.SourceReference vsrcref = vcl.source_reference;
+ Vala.SourceFile vsrc = vsrcref.file;
+
+ File file = get_file ( vsrc );
+ file.append_class ( vcl, this.sub_classes, this.sub_structs );
+ this.sub_classes.clear ();
+ this.sub_structs.clear ();
+ }
+ else {
+ Gee.ArrayList<Vala.Class> vcllist = this.sub_classes.get ( parent_type );
+ vcllist.add ( vcl );
+ }
+
+ this.current_type = parent_type;
+ this.level--;
+ }
+
+ public override void visit_delegate ( Vala.Delegate vdel ) {
+ Vala.SourceReference vsrcref = vdel.source_reference;
+ Vala.SourceFile vsrc = vsrcref.file;
+
+ File file = get_file ( vsrc );
+ file.append_delegate ( vdel );
+ }
+
+ public override void visit_error_domain ( Vala.ErrorDomain verrdom ) {
+ Vala.SourceReference vsrcref = verrdom.source_reference;
+ Vala.SourceFile vsrc = vsrcref.file;
+ File file = get_file ( vsrc );
+
+ file.append_error_domain ( verrdom );
+ }
+
+ public override void visit_enum ( Vala.Enum ven ) {
+ Vala.SourceReference vsrcref = ven.source_reference;
+ Vala.SourceFile vsrc = vsrcref.file;
+ File file = get_file ( vsrc );
+
+ file.append_enum ( ven );
+ }
+
+ private void create_images ( ) {
+ foreach ( File f in this.files ) {
+ f.create_images ( );
+ }
+ }
+
+ public void create ( ) {
+ this.context.accept( this );
+ this.set_type_references ( );
+ this.inheritance ( );
+ this.parse_comments ( );
+ this.create_images ( );
+ }
+
+ public File find_file ( Vala.SourceFile vfile ) {
+ foreach ( File f in this.files ) {
+ if ( f.is_file( vfile ) )
+ return f;
+ }
+ return null;
+ }
+
+ private void set_type_references ( ) {
+ foreach ( File f in this.files ) {
+ f.set_type_references( );
+ }
+ }
+
+ public void inheritance ( ) {
+ foreach ( File f in this.files ) {
+ f.inheritance( );
+ }
+ }
+
+ private void parse_comments ( ) {
+ foreach ( File f in this.files ) {
+ f.parse_comments( );
+ }
+ }
+
+ public File get_file ( Vala.SourceFile vfile ) {
+ File file = this.find_file( vfile );
+ if ( file != null )
+ return file;
+
+ var tmp = new File ( this.settings,vfile, this, this.err );
+ this.files.add ( tmp );
+ return tmp;
+ }
+}
+
+
Added: trunk/drawer.vala
==============================================================================
--- (empty file)
+++ trunk/drawer.vala Sat Apr 26 14:47:35 2008
@@ -0,0 +1,245 @@
+
+
+using Cairo;
+using GLib;
+using Gee;
+
+
+public abstract class Drawer.Base : Object {
+ public string name {
+ construct set;
+ get;
+ }
+
+ public string nspace {
+ construct set;
+ get;
+ }
+
+ public Class parent {
+ construct set;
+ get;
+ }
+
+ public Gee.Collection<Interface> ifaces {
+ construct set;
+ get;
+ }
+
+ public int implemented_interfaces {
+ get {
+ return this.ifaces.size;
+ }
+ }
+}
+
+
+public class Drawer.Interface : Base {
+ public Interface ( string name,
+ string nspace,
+ Class parent,
+ Gee.Collection<Interface> ifaces ) {
+ this.name = name;
+ this.nspace = nspace;
+ this.parent = parent;
+ this.ifaces = ifaces;
+ }
+}
+
+
+
+public class Drawer.Class : Base {
+ public Class ( string name,
+ string nspace,
+ Class parent,
+ Gee.Collection<Interface> ifaces ) {
+ this.name = name;
+ this.nspace = nspace;
+ this.parent = parent;
+ this.ifaces = ifaces;
+ }
+}
+
+
+
+public class Drawer.Drawer : Object {
+ public int block_height {
+ get;
+ set;
+ }
+
+ public int block_width {
+ get;
+ set;
+ }
+
+ public int class_arrow_len {
+ get;
+ set;
+ }
+
+ public int interface_arrow_len {
+ get;
+ set;
+ }
+
+ private int get_height ( Class cl ) {
+ int blocks;
+
+ for ( blocks = 0; cl != null ; blocks++ ) {
+ cl = cl.parent;
+ }
+
+ return blocks * this.block_height + (blocks - 1) * this.class_arrow_len;
+ }
+
+ private int get_width ( Class cl ) {
+ int blocks = 0;
+
+ while ( cl != null ) {
+ if ( cl.ifaces != null ) {
+ int size = 0;
+
+ foreach ( Interface iface in cl.ifaces ) {
+ if ( this.redefined_interface ( cl, iface ) )
+ size++;
+ }
+
+ if ( size > blocks )
+ blocks = size;
+ }
+ cl = cl.parent;
+ }
+
+ return ( blocks +1 ) * this.block_width + blocks * this.interface_arrow_len;
+ }
+
+ private void draw_cass_box ( Class cl, Cairo.Context context, int pos ) {
+
+ }
+
+ private int parent_classes ( Class cl ) {
+ int i;
+
+ for ( i = 0; cl.parent != null ; i++ )
+ cl = cl.parent;
+
+ return i;
+ }
+
+ private void draw_data_type ( Cairo.Context context, string name, int x, int y ) {
+ FontExtents fe;
+ TextExtents te;
+ int tx;
+ int ty;
+
+ // draw the box:
+ context.rectangle( x, y, this.block_width, this.block_height );
+ context.set_source_rgb( 0, 0, 0 );
+ context.fill( );
+
+ context.rectangle( x+1, y+1, this.block_width-2, this.block_height-2 );
+ context.set_source_rgb( 1, 1, 1 );
+ context.fill( );
+
+
+ // text:
+ context.set_font_size ( 12 );
+ context.select_font_face ( "Georgia", FontSlant.NORMAL, FontWeight.NORMAL );
+ context.text_extents ( name, ref te);
+
+ tx = x + ( this.block_width - 2 ) / 2 - (int)te.width / 2;
+ ty = y + this.block_height / 2 + (int)te.height / 2;
+
+ context.move_to ( tx, ty ); context.set_source_rgb ( 0, 0, 0);
+ context.show_text ( name );
+ }
+
+ private void draw_arrow ( Cairo.Context context, int x, int y, int len, bool down ) {
+ context.move_to ( x, y );
+ context.set_source_rgb( 0, 0, 0 );
+
+ if ( down == true ) {
+ context.line_to ( x, y+this.class_arrow_len );
+ context.stroke( );
+
+ context.move_to ( x, y+this.class_arrow_len );
+ context.line_to ( x+5, y+this.class_arrow_len-5 );
+ context.stroke( );
+
+ context.move_to ( x, y+this.class_arrow_len );
+ context.line_to ( x-5, y+this.class_arrow_len-5 );
+ context.stroke( );
+ }
+ else {
+ context.line_to ( x-this.interface_arrow_len, y );
+ context.stroke( );
+
+ context.move_to ( x-this.interface_arrow_len, y );
+ context.line_to ( x-this.interface_arrow_len+5, y+5 );
+ context.stroke( );
+
+ context.move_to ( x-this.interface_arrow_len, y );
+ context.line_to ( x-this.interface_arrow_len+5, y-5 );
+ context.stroke( );
+ }
+ }
+
+ private bool redefined_interface ( Class cl, Interface iface ) {
+ cl = cl.parent;
+ while ( cl != null ) {
+ if ( cl.ifaces == null )
+ continue ;
+
+ foreach ( Interface iface2 in cl.ifaces ) {
+ if ( iface2 == iface )
+ return true;
+ }
+ cl = cl.parent;
+ }
+ return false;
+ }
+
+ public void draw_class ( Class cl, string path ) {
+ int height = this.get_height ( cl );
+ int width = this.get_width ( cl );
+
+ // create a picture with a white background:
+ var img = new Cairo.ImageSurface ( Cairo.Format.RGB24, width , height );
+ var context = new Cairo.Context ( img );
+
+ context.rectangle( 0, 0, width, height );
+ context.set_source_rgb( 1, 1, 1 );
+ context.fill( );
+
+ // draw the classes:
+ for ( int i = 0; cl != null ; i++ ) {
+ int y = ( i == 0 )? height - this.block_height :
+ (this.parent_classes(cl)-i+1) * (this.block_height + this.class_arrow_len);
+
+ int x = this.block_width / 2;
+
+ this.draw_data_type ( context, cl.name, 0, y );
+ this.draw_arrow ( context, x, y+this.block_height, 10, true );
+
+ if ( cl.ifaces != null ) {
+ int i = 0;
+ foreach ( Interface iface in cl.ifaces ) {
+ if ( this.redefined_interface( cl, iface ) )
+ continue ;
+
+ i++;
+ int xh = (this.block_width + this.interface_arrow_len)*i;
+
+ this.draw_arrow ( context, xh, y+(this.block_height / 2), 10, false );
+ this.draw_data_type ( context, iface.name, xh, y );
+ }
+ }
+
+ cl = cl.parent;
+ }
+
+ //img.write_to_png ( path );
+ }
+}
+
Added: trunk/errorreporter.vala
==============================================================================
--- (empty file)
+++ trunk/errorreporter.vala Sat Apr 26 14:47:35 2008
@@ -0,0 +1,151 @@
+/*
+ * Valadoc - a documentation tool for vala.
+ * Copyright (C) 2008 Florian Brosch
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+
+using GLib;
+using Vala;
+using Gee;
+
+
+[ErrorDomain]
+public enum CommentParserError {
+ UNKNOWN_SYMBOL,
+ SUBPARSER,
+ BRACKET_ERROR,
+ UNKNOWN_OPTION,
+ NO_COMMENT_STRING,
+ NESTED_BRACKETS,
+ SYNTAX_ERROR,
+ CONTEXT_ERROR
+}
+
+
+public class Valadoc.Error : Object {
+ public string cmnd {
+ construct set;
+ get;
+ }
+
+ public bool is_warning {
+ construct set;
+ get;
+ }
+
+ public Basic element {
+ construct set;
+ get;
+ }
+
+ public string description {
+ construct set;
+ get;
+ }
+
+
+ public CommentParserError err {
+ construct set;
+ get;
+ }
+
+ public Error ( Basic element,
+ bool is_warning,
+ string cmnd,
+ CommentParserError err ) {
+ this.element = element;
+ this.is_warning = is_warning;
+ this.cmnd = cmnd;
+ this.err = err;
+ }
+
+ public Error.Message ( Basic element,
+ bool is_warning,
+ string cmnd,
+ string description ) {
+ this.element = element;
+ this.is_warning = is_warning;
+ this.cmnd = cmnd;
+ this.description = description;
+ }
+
+ public void print ( ) {
+ string file = this.element.file.name;
+ string type = ( this.is_warning )? "warning" : "error";
+ string element = this.element.name;
+
+ string desc = null;
+ if ( this.description == null ) {
+ switch ( this.err ) {
+ case CommentParserError.UNKNOWN_SYMBOL:
+ desc = "unnown symbol"; break;
+ case CommentParserError.SUBPARSER:
+ desc = "subparser"; break;
+ case CommentParserError.UNKNOWN_OPTION:
+ desc = "unnown option \"" + this.cmnd + "\"" ; break;
+ case CommentParserError.NO_COMMENT_STRING:
+ desc = "no comment string"; break;
+ case CommentParserError.NESTED_BRACKETS:
+ desc = "nested brackets"; break;
+ case CommentParserError.SYNTAX_ERROR:
+ desc = "syntax error"; break;
+ case CommentParserError.CONTEXT_ERROR:
+ desc = "context error"; break;
+ case CommentParserError.BRACKET_ERROR:
+ desc = "open brackets"; break;
+ default: desc = "unknown error"; break;
+ }
+ }
+ else {
+ desc = this.description;
+ }
+///home/mog/Desktop/vendy/vendy/Vendy.Magtek.vala, read: error: linked type is not available.
+
+ if ( this.element.line == 0 )
+ stdout.printf ( "%s: %s: in %s: %s\n", file, type, element, desc );
+ else
+ stdout.printf ( "%s:%d: %s: in %s: %s\n", file, this.element.line, type, element, desc );
+ }
+}
+
+public class Valadoc.ErrorReporter : Object {
+ Gee.ArrayList<Error> lst = new Gee.ArrayList<Error> ();
+
+ public int numbers {
+ get {
+ return ((Gee.Collection)this.lst).size;
+ }
+ }
+
+ public void print_errors ( ) {
+ foreach ( Error err in this.lst ) {
+ err.print();
+ }
+ }
+
+ public void add_with_message ( Basic element, bool is_warning, string cmnd, string desc ) {
+ var tmp = new Error.Message ( element, is_warning, cmnd, desc );
+ this.lst.add ( tmp );
+ }
+
+ public void add ( Basic element, bool is_warning, string cmnd, CommentParserError err ) {
+ var tmp = new Error ( element, is_warning, cmnd,CommentParserError.UNKNOWN_OPTION );
+ this.lst.add ( tmp );
+ }
+}
+
+
+
Added: trunk/html/doclet.vala
==============================================================================
--- (empty file)
+++ trunk/html/doclet.vala Sat Apr 26 14:47:35 2008
@@ -0,0 +1,1518 @@
+/*
+ * Valadoc - a documentation tool for vala.
+ * Copyright (C) 2008 Florian Brosch
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+
+using Valadoc;
+using GLib;
+
+
+
+public static class CssFile {
+ public const string css = "body {\n font-family: sans-serif;\n margin-top: 2.8em;\n}\n\nh1, h2, h3, h4 {\n color: #005a9c;\n}\n\nh5 {\n color: #005a9c;\n margin: 0;\n}\n\na {\n color: #005a9c;\n text-decoration: none;\n}\n\n.toc {\n font-weight: bold;\n font-size: larger;\n}\n\n.toc li {\n list-style-type: none;\n}\n\n.toc li li {\n font-size: smaller;\n}\n\nh3 a {\n position: relative;\n top: -2.8em;\n}\n\n.header {\n background-color: #005a9c;\n font-weight: bold;\n padding: .35em;\n position: fixed;\n left: 0;\n top: 0;\n width: 100%;\n height: 1.4em;\n}\n\n.header a {\n color: white;\n}\n\ndiv.note {\n border: 3px solid #005a9c;\n padding: 1em;\n margin: 0 2em 1em 2em;\n}\n\ndiv.note p, div.note h4 {\n margin: 0;\n}\n\npre {\n background-color: #eee;\n border: 1px solid black;\n padding: .5em 1em;\n margin: 0 2em 1em 2em;\n}\n\nblockquote {\n font-style: italic;\n white-space: pre;\n}\n\nhr {\n width: 95%;\n color: #005a9c;\n background-color: #005a9c;\n}\n\np.foother {
\n text-align: center;\n color: #005a9c;\n margin-top: 1px;\n margin-bottom: 1px;\n}";
+
+ public static void create ( string path ) {
+ var file = FileStream.open ( path, "w+" );
+ file.puts ( css );
+ }
+}
+
+
+
+public class File : Object {
+ protected FileStream file;
+ protected int level = 0;
+
+ public string path {
+ construct set;
+ get;
+ }
+
+ public void start_file ( string title, string parent, string to_root ) {
+ string file_header = "<?xml version=\"1.0\"?>\n<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\">\n<html xmlns=\"http://www.w3.org/1999/xhtml\">\n\t<head>\n\t\t<meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\" />\n\t\t<title>%s</title>\n\t\t<link rel=\"stylesheet\" type=\"text/css\" href=\"%sdefault.css\" />\n\t</head>\n\t<body>\n\t\t<div class=\"header\">\n\t\t\t<a href=\"%s\">%s</a>\n\t\t</div>";
+
+ this.file = FileStream.open ( this.path, "w+" );
+ this.file.printf ( file_header, title, to_root, parent, title );
+ }
+
+ public void end_file ( ) {
+ this.file.puts ( "\n\t\t<hr><p class=\"foother\">Created by Valadoc</p>\n\t</body>\n</html>" );
+ }
+}
+
+
+
+public class DocFile : File, LinkHelper {
+ private LangletIndex langlet;
+ private int headlinelvl = 1;
+
+ public void initialisation ( ) {
+ this.langlet = new LangletIndex( this.settings );
+ }
+
+ public DocFile ( string path, Settings settings ) {
+ this.path = path;
+ this.settings = settings;
+ }
+
+ public Settings settings {
+ construct set;
+ get;
+ }
+
+ public void index_space ( int[] sizes, int pos ) {
+ int elements = 0;
+
+ if ( pos + 1 == sizes.length )
+ return ;
+
+ if ( sizes[pos] == 0 )
+ return ;
+
+ for ( int i = pos+1; i < sizes.length ; i++ )
+ elements += sizes[i];
+
+ if ( elements != 0 )
+ this.file.puts ( "\n\n" );
+ }
+
+ public void index_start_synopsis ( ) {
+ this.headlinelvl++;
+
+ this.langlet.with_link = true;
+ this.file.puts ( "<h%d>Synopsis</h%d>\n".printf( this.headlinelvl, this.headlinelvl) );
+ this.file.puts ( "<pre>\n" );
+ }
+
+ public void index_end_synopsis ( ) {
+ this.langlet.with_link = false;
+ this.file.puts ( "</pre><br>" );
+ this.headlinelvl--;
+ }
+
+ public void index_add_method ( Valadoc.Method m, Valadoc.MethodHandler parent ) {
+ m.write ( this.langlet, this.file, parent );
+ this.file.puts ( "\n" );
+ }
+
+ public void index_add_delegate ( Valadoc.Delegate del ) {
+ del.write ( this.langlet, this.file );
+ this.file.puts ( "\n" );
+ }
+
+ public void index_add_field ( Valadoc.Field f, Valadoc.FieldHandler parent ) {
+ f.write ( this.langlet, this.file, parent );
+ this.file.puts ( "\n" );
+ }
+
+ public void index_add_property ( Valadoc.Property prop ) {
+ prop.write ( this.langlet, this.file );
+ this.file.puts ( "\n" );
+ }
+
+ public void index_add_signal ( Valadoc.Signal sig ) {
+ sig.write ( this.langlet, this.file );
+ this.file.puts ( "\n" );
+ }
+
+ public void index_start_error_domain ( Valadoc.ErrorDomain errdom ) {
+ errdom.write ( this.langlet, this.file );
+ this.file.puts ( " {\n" );
+ }
+
+ public void index_end_error_domain ( ) {
+ this.file.puts ( "}\n" );
+ }
+
+ public void index_start_enum ( Valadoc.Enum en ) {
+ en.write ( this.langlet, this.file );
+ this.file.puts ( " {\n" );
+ }
+
+ public void index_end_enum ( ) {
+ this.file.puts ( "}\n" );
+ }
+
+ public void index_start_interface ( Valadoc.Interface iface ) {
+ iface.write ( this.langlet, this.file );
+ this.file.puts ( " {\n" );
+ }
+
+ public void index_end_interface ( ) {
+ this.file.puts ( "}\n" );
+ }
+
+ public void index_add_error_code ( Valadoc.ErrorCode errcode ) {
+ errcode.write ( this.langlet, this.file );
+ this.file.puts ( "\n" );
+ }
+
+ public void index_add_enum_value ( Valadoc.EnumValue enval ) {
+ enval.write ( this.langlet, this.file );
+ this.file.puts ( "\n" );
+ }
+
+ public void index_start_struct ( Valadoc.Struct stru ) {
+ stru.write ( this.langlet, this.file );
+ this.file.puts ( " {\n" );
+ }
+
+ public void index_end_struct ( Valadoc.Struct stru ) {
+ // TODO: Teach langlet to write a \t -> ' '
+ this.file.puts ( string.nfill( stru.bracket_level*4,' ' ) );
+ this.file.puts ( "}\n" );
+ }
+
+ public void index_start_class ( Valadoc.Class cl ) {
+ cl.write ( this.langlet, this.file );
+ this.file.puts ( " {\n" );
+ }
+
+ public void index_end_class ( Valadoc.Class cl ) {
+ // TODO: Teach langlet to write a \t -> ' '
+ this.file.puts ( string.nfill( cl.bracket_level*4,' ' ) );
+ this.file.puts ( "}\n" );
+ }
+
+ public void doc_delegate_block_start ( ) {
+ this.headlinelvl++;
+ this.file.puts ( "<h%d>Delegate Details</h%d>\n".printf ( this.headlinelvl, this.headlinelvl ) );
+ }
+
+ public void doc_delegate_block_end ( ) {
+ this.headlinelvl--;
+ }
+
+
+ public void add_description ( DataType type ) {
+ type.write_comment ( this.file );
+ }
+
+ // replace with add_description + headline
+ public void start_description ( DataType type ) {
+ this.headlinelvl++;
+ this.file.printf( "\t\t<h%d>%s</h%d>\n", this.headlinelvl, "Description", this.headlinelvl );
+ type.write_comment ( this.file );
+ }
+
+ public void end_description ( ) {
+ this.headlinelvl--;
+ }
+
+ public void start_type_detail ( string typename ) {
+ this.headlinelvl++;
+ this.file.printf( "\t\t<h%d>%s %s</h%d>\n", this.headlinelvl, typename, "Description", this.headlinelvl );
+ }
+
+ public void end_type_detail ( ) {
+ this.headlinelvl--;
+ }
+
+ public void start_detail ( ) {
+ this.headlinelvl++;
+ this.file.printf ( "\t\t<h%d>Details</h%d>\n", this.headlinelvl, this.headlinelvl );
+ }
+
+ public void end_detail ( ) {
+ this.headlinelvl--;
+ }
+
+ public void start_detail_method ( ) {
+ this.headlinelvl++;
+ this.file.printf ( "\t\t<h%d>Method Details</h%d>\n", this.headlinelvl, this.headlinelvl );
+ }
+
+ public void end_detail_method ( ) {
+ this.headlinelvl--;
+ }
+
+ public void start_detail_construction_method ( ) {
+ this.headlinelvl++;
+ this.file.printf ( "\t\t<h%d>Constructor Details</h%d>\n", this.headlinelvl, this.headlinelvl );
+ }
+
+ public void end_detail_construction_method ( ) {
+ this.headlinelvl--;
+ }
+
+ public void add_detail_method ( Valadoc.Method m, Valadoc.MethodHandler parent ) {
+ this.file.printf ( "\t\t<h%d>%s ()</h%d> <a name=\"%s\"></a>\n", this.headlinelvl+1, m.name,
+ this.headlinelvl+1, this.get_mark_name ( m ) );
+
+ this.file.puts ( "\t\t<pre>\n" );
+ m.write ( this.langlet, this.file, parent );
+ this.file.puts ( "\t\t</pre>\n" );
+
+ m.write_comment ( this.file );
+ this.file.puts ( "\n\t\t<hr>\n" );
+ }
+
+ public void start_detail_field ( ) {
+ this.headlinelvl++;
+ this.file.printf ( "\t\t<h%d>Field Details</h%d>\n", this.headlinelvl, this.headlinelvl );
+ }
+
+ public void end_detail_field ( ) {
+ this.headlinelvl--;
+ }
+
+ public void add_detail_field ( Valadoc.Field f, Valadoc.FieldHandler parent ) {
+ this.file.printf ( "\t\t<h%d>%s</h%d> <a name=\"%s\"></a>\n", this.headlinelvl+1, f.name,
+ this.headlinelvl+1, this.get_mark_name ( f ) );
+
+ this.file.puts ( "\t\t<pre>\n" );
+ f.write ( this.langlet, this.file, parent );
+ this.file.puts ( "\t\t</pre>\n" );
+
+ f.write_comment ( this.file );
+ this.file.puts ( "\n\t\t<hr>\n" );
+ }
+
+ public void start_detail_property ( ) {
+ this.headlinelvl++;
+ this.file.printf ( "\t\t<h%d>Property Details</h%d>\n", this.headlinelvl, this.headlinelvl );
+ }
+
+ public void end_detail_property ( ) {
+ this.headlinelvl--;
+ }
+
+ public void add_detail_property ( Valadoc.Property prop ) {
+ this.file.printf ( "\t\t<h%d>%s</h%d> <a name=\"%s\"></a>\n", this.headlinelvl+1, prop.name,
+ this.headlinelvl+1, this.get_mark_name ( prop ) );
+
+ this.file.puts ( "\t\t<pre>\n" );
+ prop.write ( this.langlet, this.file );
+ this.file.puts ( "\t\t</pre>\n" );
+
+ prop.write_comment ( this.file );
+ this.file.puts ( "\n\t\t<hr>\n" );
+ }
+
+ public void start_detail_signal ( ) {
+ this.headlinelvl++;
+ this.file.printf( "\t\t<h%d>Signal Details</h%d>\n", this.headlinelvl, this.headlinelvl );
+ }
+
+ public void end_detail_signal ( ) {
+ this.headlinelvl--;
+ }
+
+ public void add_detail_signal ( Valadoc.Signal sig ) {
+ this.file.printf ( "\t\t<h%d>%s</h%d> <a name=\"%s\"></a>\n", this.headlinelvl+1, sig.name,
+ this.headlinelvl+1, this.get_mark_name ( sig ) );
+
+ this.file.puts ( "\t\t<pre>\n" );
+ sig.write ( this.langlet, this.file );
+ this.file.puts ( "\t\t</pre>\n" );
+
+ sig.write_comment ( this.file );
+ this.file.puts ( "\n\t\t<hr>\n" );
+ }
+
+
+ public void start_detail_delegate ( ) {
+ this.headlinelvl++;
+ this.file.printf( "\t\t<h%d>Delegate Details</h%d>\n", this.headlinelvl, this.headlinelvl );
+ }
+
+ public void end_detail_delegate ( ) {
+ this.headlinelvl--;
+ }
+
+ public void add_detail_delegate ( Valadoc.Delegate del ) {
+ this.file.printf ( "\t\t<h%d>%s ()</h%d> <a name=\"%s\"></a>\n", this.headlinelvl+1, del.name,
+ this.headlinelvl+1, this.get_mark_name ( del ) );
+
+ this.file.puts ( "\t\t<pre>\n" );
+ del.write ( this.langlet, this.file );
+ this.file.puts ( "\t\t</pre>\n" );
+
+ del.write_comment ( this.file );
+ this.file.puts ( "\n\t\t<hr>\n" );
+ }
+
+ public void start_detail_error_code ( ) {
+ this.headlinelvl++;
+ this.file.printf( "\t\t<h%d>Error Code Details</h%d>\n", this.headlinelvl, this.headlinelvl );
+ }
+
+ public void end_detail_error_code ( ) {
+ this.headlinelvl--;
+ }
+
+ public void start_detail_enum_value ( ) {
+ this.headlinelvl++;
+ this.file.printf( "\t\t<h%d>Enum Value Details</h%d>\n", this.headlinelvl, this.headlinelvl );
+ }
+
+ public void end_detail_enum_value ( ) {
+ this.headlinelvl--;
+ }
+
+ public void add_detail_error_code ( Valadoc.ErrorCode errcode ) {
+ this.file.printf ( "\t\t<h%d>%s</h%d> <a name=\"%s\"></a>\n", this.headlinelvl+1, errcode.name,
+ this.headlinelvl+1, this.get_mark_name( errcode ) );
+
+ this.file.puts ( "\t\t<pre>\n" );
+ errcode.write ( this.langlet, this.file );
+ this.file.puts ( "\t\t</pre>\n" );
+
+ errcode.write_comment ( this.file );
+ this.file.puts ( "\n\t\t<hr>\n" );
+ }
+
+ public void add_detail_enum_value ( Valadoc.EnumValue enval ) {
+ this.file.printf ( "\t\t<h%d>%s</h%d> <a name=\"%s\"></a>\n", this.headlinelvl+1, enval.name,
+ this.headlinelvl+1, this.get_mark_name( enval ) );
+
+ this.file.puts ( "\t\t<pre>\n" );
+ enval.write ( this.langlet, this.file );
+ this.file.puts ( "\t\t</pre>\n" );
+
+ enval.write_comment ( this.file );
+ this.file.puts ( "\n\t\t<hr>\n" );
+ }
+}
+
+
+
+public class IndexFile : File {
+ public IndexFile ( string path ) {
+ this.path = path;
+ }
+
+ public void open_point ( string name, string link ) {
+ string space = string.nfill ( this.level, '\t' );
+ this.level++;
+
+ if ( this.level == 1 ) {
+ file.puts ( space );
+ file.puts( "<ul class=\"toc\">\n" );
+ }
+
+ file.puts ( space );
+ file.printf( "\t\t<li><a href=\"%s\">%s</a>\n", link, name );
+
+ file.puts ( space );
+ file.puts ( "\t\t\t" );
+ file.puts( "<ul>\n" );
+ }
+
+ public void add_point ( string name, string link ) {
+ file.puts ( string.nfill ( this.level, '\t' ) );
+ file.printf( "\t\t\t<li><a href=\"%s\">%s</a></li>\n", link, name );
+ }
+
+ public void close_point ( ) {
+ this.level--;
+ string space = string.nfill ( this.level, '\t' );
+
+ file.puts ( space );
+ file.puts( "\t\t\t</ul>\n" );
+
+ file.puts ( space );
+ file.puts( "\t\t</li>\n" );
+
+ if ( this.level == 0 ) {
+ file.puts ( space );
+ file.puts( "</ul>\n" );
+ }
+ }
+}
+
+
+// Move to GlobalIndexFile
+private class Element : Object {
+ public Element ( string name, string link ) {
+ this.name = name;
+ this.link = link;
+ }
+
+ public string link {
+ construct set;
+ get;
+ }
+
+ public string name {
+ construct set;
+ get;
+ }
+}
+
+
+// Move to GlobalIndexFile
+private class Headline< T > : Object {
+ private Gee.ArrayList< T > elements = new Gee.ArrayList<T> ();
+
+ public Headline ( string name, string link ) {
+ this.name = name;
+ this.link = link;
+ }
+
+ public Gee.Collection<T> get_elements ( ) {
+ return this.elements;
+ }
+
+ public void add ( T element ) {
+ this.elements.add ( element );
+ }
+
+ public string link {
+ construct set;
+ get;
+ }
+
+ public string name {
+ construct set;
+ get;
+ }
+}
+
+// TODO: Store the objects instead of strings
+// TODO: Create a common index-creator class for doclets
+public class GlobalIndexFile : Object {
+ private Gee.HashMap< string, Gee.ArrayList<Headline> > tree
+ = new Gee.HashMap< string, Gee.ArrayList<Headline> > ( GLib.str_hash, GLib.str_equal );
+
+ private Gee.ArrayList<Element> vapi_files = new Gee.ArrayList<Element> ( );
+
+
+ public string path {
+ construct set;
+ get;
+ }
+
+ public GlobalIndexFile ( string path ) {
+ this.path = path;
+ }
+
+ // Workarround for the destructor-issue
+ public void @delete ( ) {
+ this.write ();
+ }
+
+ private string# ns_part_path ( string nsname, string partname ) {
+ string str2;
+ try {
+ string str = new Regex ( Regex.escape_string (" ")).replace_literal ( partname, -1, 0, "_" );
+ str2 = new Regex ( Regex.escape_string (":")).replace_literal ( partname, -1, 0, "" );
+ }
+ catch ( RegexError err ) {
+ return null;
+ }
+ return "ns." + nsname + "." + str2 + ".html";
+ }
+
+ // cleanup var-names ..
+ private void write ( ) {
+ IndexFile main = new IndexFile ( this.path + "index.html" );
+ main.start_file ( "Reference Manual", "", "" );
+
+ // <Namespaces>:
+ foreach ( string key in this.tree.get_keys() ) {
+ string nspath = "ns." + key + ".html";
+ IndexFile ns = new IndexFile ( this.path + nspath );
+ ns.start_file ( key, "", "" );
+ ns.open_point ( key, nspath );
+
+ Gee.ArrayList< Headline<Headline> > nspaces = this.tree.get ( key );
+ main.open_point ( key, nspath );
+
+ foreach ( Headline<Element> nspace in nspaces ) {
+ var headlines = nspace.get_elements ();
+ string nspath = this.ns_part_path ( key, nspace.name );
+
+ IndexFile partindex = new IndexFile ( this.path + nspath );
+ partindex.start_file ( key, "", "" );
+
+ partindex.open_point ( nspace.name, nspace.link );
+ main.open_point ( nspace.name, nspace.link );
+ ns.open_point ( nspace.name, nspace.link );
+
+ foreach ( Element* type in headlines ) {
+ main.add_point ( type->name, type->link );
+ ns.add_point ( type->name, type->link );
+ partindex.add_point ( type->name, type->link );
+ }
+
+ partindex.close_point ( );
+ partindex.end_file ( );
+ main.close_point ( );
+ ns.close_point ( );
+ }
+ main.close_point ( );
+ ns.close_point ( );
+ ns.end_file ( );
+ } // </Namespaces>:
+
+ // vapis:
+ if ( this.vapi_files.size != 0 ) {
+ main.open_point ( "vapi-files:", "" );
+ foreach ( Element file in this.vapi_files ) {
+ var str2 = Path.get_basename ( file.name );
+ main.add_point ( str2, file.link );
+ }
+ main.close_point ( );
+ }
+ main.end_file ( );
+ }
+
+ public void add_file ( string file, string link ) {
+ if ( file.has_suffix( ".vapi" ) ) {
+ var tmp = new Element ( file, link );
+ this.vapi_files.add ( tmp );
+ }
+ }
+
+ public void add_namespace ( string file, string name, string link ) {
+ if ( file.has_suffix( ".vapi" ) )
+ return ;
+
+ if ( name == null )
+ name = "Global Namespace";
+
+ Gee.ArrayList< Headline<Headline> > headlines = this.tree.get ( name );
+ if ( headlines == null ) {
+ headlines = new Gee.ArrayList< Headline<Headline> > ();
+ this.tree.set ( name, headlines );
+ }
+ }
+
+ private void add_type ( string title, string file, string nspace, string name, string link ) {
+ if ( file.has_suffix( ".vapi" ) )
+ return ;
+
+ if ( nspace == null )
+ nspace = "Global Namespace";
+
+ // FIXME: Bug: will free the subtime at the end of the method-body without pointer
+ // FIXME: Mem-Leak! I don't free the garbage
+
+ Gee.ArrayList< Headline<Headline> > headlines = this.tree.get ( nspace );
+ Headline<Element*> element = null;
+
+ foreach ( Headline<Element*> element2 in headlines ) {
+ element = element2;
+ if ( element.name == title )
+ break;
+
+ element = null;
+ }
+
+ if ( element == null ) {
+ string nspath = this.ns_part_path ( nspace, title );
+ element = new Headline<Element*> ( title, nspath );
+ headlines.add ( element );
+ }
+
+ Element* tmp = new Element ( name, link );
+ element.add ( tmp );
+ }
+
+ public void add_delegate ( string file, string nspace, string name, string link ) {
+ this.add_type ( "Delegate:", file, nspace, name, link );
+ }
+
+ public void add_enum ( string file, string nspace, string name, string link ) {
+ this.add_type ( "Enums:", file, nspace, name, link );
+ }
+
+ public void add_error_domain ( string file, string nspace, string name, string link ) {
+ this.add_type ( "Errordomains:", file, nspace, name, link );
+ }
+
+ public void add_interface ( string file, string nspace, string name, string link ) {
+ this.add_type ( "Interfaces:", file, nspace, name, link );
+ }
+
+ public void add_class ( string file, string nspace, string name, string link ) {
+ this.add_type ( "Classes:", file, nspace, name, link );
+ }
+
+ public void add_struct ( string file, string nspace, string name, string link ) {
+ this.add_type ( "Structs:", file, nspace, name, link );
+ }
+
+ public void add_global_method ( string file, string nspace, string name, string link ) {
+ this.add_type ( "Functions:", file, nspace, name, link );
+ }
+
+ public void add_global_field ( string file, string nspace, string name, string link ) {
+ this.add_type ( "Global Fields:", file, nspace, name, link );
+ }
+}
+
+
+public class Valadoc.Doclet : Object, LinkHelper {
+ private GlobalIndexFile ns_view_index;
+
+ /**
+ * Index of all global fieds in current namespace.
+ */
+ private IndexFile global_var_index;
+ /**
+ * Index of all global functions in current namespace.
+ */
+ private IndexFile function_index;
+ /**
+ * Index of all interfaces in current namespace.
+ */
+ private IndexFile iface_index;
+ /**
+ * Index of all functions, fields, enums, etc. in current namespace.
+ */
+ private IndexFile main_index;
+ /**
+ * Index of all structs in current namespace.
+ */
+ private IndexFile stru_index;
+ /**
+ * Index of all delegates in current namespace.
+ */
+ private IndexFile del_index;
+ /**
+ * Index of all classes in current namespace.
+ */
+ private IndexFile cl_index;
+ /**
+ * Index of all enums in current namespace.
+ */
+ private IndexFile en_index;
+ /**
+ * Index of all errordomains in current namespace.
+ */
+ private IndexFile er_index;
+ /**
+ * Index of all interfaces in current namespace.
+ */
+ private IndexFile ns_index;
+
+ /**
+ * Documentation of the current root class in { @link ns_name }.
+ *
+ * @see root_class
+ */
+ private DocFile type_doc;
+ /**
+ * Documentation of all global fields in { @link ns_name }.
+ */
+ private DocFile glob_doc;
+ /**
+ * Documentation of all global functions in { @link ns_name }.
+ */
+ private DocFile func_doc;
+ /**
+ * Documentation of all delegates in { @link ns_name }.
+ */
+ private DocFile del_doc;
+
+ /**
+ * The name of the top class of nested types.
+ */
+ private string root_class;
+ /**
+ * The name of the current source-file.
+ */
+ private string file_name;
+ /**
+ * Name of the current namespace.
+ */
+ private string ns_name;
+ /**
+ * The path to the documentation for the current namespace.
+ */
+ private string path;
+ /**
+ * the title of the current source-file.
+ */
+ private string pkg;
+
+
+ public Doclet ( Settings settings, Valadoc.ErrorReporter err ) {
+ this.settings = settings;
+ this.err = err;
+ }
+
+ public virtual void initialisation ( ) {
+ var rt = DirUtils.create ( this.settings.path, 0777 );
+ CssFile.create ( this.settings.path + "default.css" );
+
+ this.ns_view_index = new GlobalIndexFile ( this.settings.path );
+ }
+
+ public Valadoc.ErrorReporter err {
+ construct set;
+ protected get;
+ }
+
+ public Settings settings {
+ construct set;
+ protected get;
+ }
+
+ private void global_field_visitor ( Valadoc.Namespace ns ) {
+ this.path = this.settings.path + this.file_name + "/" + this.ns_name + "/";
+ string path = this.path + "index_fields.html";
+ string title = "Global Fields:";
+
+ this.global_var_index = new IndexFile ( path );
+ this.global_var_index.start_file ( this.pkg, "", "../../" );
+ this.global_var_index.open_point ( title, "globals.html" );
+
+ this.main_index.open_point ( title, this.ns_name + "/index_fields.html" );
+ this.ns_index.open_point ( title, "index_fields.html" );
+
+ this.glob_doc = new DocFile ( this.settings.path + this.file_name + "/" + this.ns_name + "/globals.html",
+ this.settings );
+
+ this.glob_doc.initialisation ( );
+ this.glob_doc.start_file ( this.pkg, "", "../../" );
+ this.glob_doc.index_start_synopsis ( );
+
+ foreach ( Field f in ns.get_field_list() )
+ this.glob_doc.index_add_field ( f, null );
+
+ this.glob_doc.index_end_synopsis ( );
+ this.glob_doc.start_detail ( );
+
+ ns.visit_fields ( this );
+
+ this.glob_doc.end_detail ( );
+ this.global_var_index.close_point ( );
+ this.global_var_index.end_file ( );
+ this.global_var_index = null;
+
+ this.main_index.close_point ( );
+ this.ns_index.close_point ( );
+
+ this.glob_doc.end_file ( );
+ this.glob_doc = null;
+ this.path = null;
+ }
+
+ private void globa_method_visitor ( Namespace ns ) {
+ this.path = this.settings.path + this.file_name + "/" + this.ns_name + "/";
+ string path = this.path + "index_functions.html";
+ string title = "Functions:";
+
+ this.function_index = new IndexFile ( path );
+ this.function_index.start_file ( this.pkg, "", "../../" );
+ this.function_index.open_point ( title, "functions.html" );
+
+ this.main_index.open_point ( title, this.ns_name + "/index_functions.html" );
+ this.ns_index.open_point ( title, "index_functions.html" );
+
+ this.func_doc = new DocFile ( this.settings.path + this.file_name + "/" + this.ns_name + "/functions.html",
+ this.settings );
+
+ this.func_doc.initialisation ( );
+ this.func_doc.start_file ( this.pkg, "", "../../" );
+ this.func_doc.index_start_synopsis ( );
+
+ foreach ( Method m in ns.get_method_list() )
+ this.func_doc.index_add_method ( m, null );
+
+ this.func_doc.index_end_synopsis ( );
+ this.func_doc.start_detail ( );
+
+
+ ns.visit_methods ( this );
+
+
+ this.func_doc.end_detail ( );
+
+ this.function_index.close_point ( );
+ this.function_index.end_file ( );
+ this.function_index = null;
+
+ this.main_index.close_point ( );
+ this.ns_index.close_point ( );
+
+ this.func_doc.end_file ( );
+ this.func_doc = null;
+ this.path = null;
+ }
+
+ private void property_visitor ( PropertyHandler ph ) {
+ this.type_doc.start_detail_property ( );
+ ph.visit_properties ( this );
+ this.type_doc.end_detail_property ( );
+ }
+
+ private void method_visitor ( MethodHandler mh ) {
+ this.type_doc.start_detail_method ( );
+ mh.visit_methods ( this );
+ this.type_doc.end_detail_method ( );
+ }
+
+ private void construction_methods_visitor ( ConstructionMethodHandler cmh ) {
+ this.type_doc.start_detail_construction_method ( );
+ cmh.visit_construction_methods ( this );
+ this.type_doc.end_detail_construction_method ( );
+ }
+
+ private void field_visitor ( Valadoc.FieldHandler fh ) {
+ this.type_doc.start_detail_field ( );
+ fh.visit_fields ( this );
+ this.type_doc.end_detail_field ( );
+ }
+
+ private void delegate_visitor ( Namespace ns ) {
+ this.path = this.settings.path + this.file_name + "/" + this.ns_name + "/";
+ string path = this.path + "index_delegates.html";
+ string title = "Delegates:";
+
+ this.del_index = new IndexFile ( path );
+ this.del_index.start_file ( this.pkg, "", "../../" );
+ this.del_index.open_point ( title, "delegates.html" );
+
+ this.main_index.open_point ( title, this.ns_name + "/index_delegates.html" );
+ this.ns_index.open_point ( title, "index_delegates.html" );
+
+ this.del_doc = new DocFile ( this.settings.path + this.file_name + "/" + this.ns_name + "/delegates.html",
+ this.settings );
+
+ this.del_doc.initialisation ( );
+ this.del_doc.start_file ( this.pkg, "", "../../" );
+ this.del_doc.index_start_synopsis ( );
+
+ foreach ( Delegate del in ns.get_delegate_list() )
+ this.del_doc.index_add_delegate ( del );
+
+ this.del_doc.index_end_synopsis ( );
+ this.del_doc.start_detail ( );
+
+ ns.visit_delegates ( this );
+
+ this.del_index.close_point ( );
+ this.del_index.end_file ( );
+ this.del_index = null;
+
+ this.main_index.close_point ( );
+ this.ns_index.close_point ( );
+
+ this.del_doc.end_detail ( );
+ this.del_doc.end_file ( );
+ this.del_doc = null;
+ this.path = null;
+ }
+
+ private void error_domain_visitor ( Namespace ns ) {
+ this.path = this.settings.path + this.file_name + "/" + this.ns_name + "/";
+ string path = this.path + "index_error_domains.html";
+ string title = "Errordomains:";
+
+ this.er_index = new IndexFile ( path );
+ this.er_index.start_file ( this.pkg, "", "../../" );
+ this.er_index.open_point ( title, "" );
+
+ this.main_index.open_point ( title, this.ns_name + "/index_error_domains.html" );
+ this.ns_index.open_point ( title, "index_error_domains.html" );
+
+ ns.visit_error_domains ( this );
+
+ this.er_index.close_point ( );
+ this.er_index.end_file ( );
+ this.er_index = null;
+
+ this.main_index.close_point ( );
+ this.ns_index.close_point ( );
+ this.path = null;
+ }
+
+ private void enum_visitor ( Namespace ns ) {
+ this.path = this.settings.path + this.file_name + "/" + this.ns_name + "/";
+ string path = this.path + "index_enums.html";
+ string title = "Enums:";
+
+ this.en_index = new IndexFile ( path );
+ this.en_index.start_file ( this.pkg, "", "../../" );
+ this.en_index.open_point ( title, "" );
+
+ this.main_index.open_point ( title, this.ns_name + "/index_enums.html" );
+ this.ns_index.open_point ( title, "index_enums.html" );
+
+ ns.visit_enums ( this );
+
+ this.en_index.close_point ( );
+ this.en_index.end_file ( );
+ this.en_index = null;
+
+ this.main_index.close_point ( );
+ this.ns_index.close_point ( );
+ this.path = null;
+ }
+
+ private void interface_visitor ( Namespace ns ) {
+ this.path = this.settings.path + this.file_name + "/" + this.ns_name + "/";
+ string path = this.path + "index_classes.html";
+ string title = "Interfaces:";
+
+ this.iface_index = new IndexFile ( path );
+ this.iface_index.start_file ( this.pkg, "", "../../" );
+ this.iface_index.open_point ( title, "" );
+
+ this.main_index.open_point ( title, "" );
+ this.ns_index.open_point ( title, "" );
+
+ ns.visit_interfaces ( this );
+
+ this.iface_index.close_point ( );
+ this.iface_index.end_file ( );
+ this.iface_index = null;
+
+ this.main_index.close_point ( );
+ this.ns_index.close_point ( );
+ this.path = null;
+ }
+
+ private void global_class_visitor ( Namespace ns ) {
+ this.path = this.settings.path + this.file_name + "/" + this.ns_name + "/";
+ string path = this.path + "index_classes.html";
+ string title = "Classes:";
+
+ this.cl_index = new IndexFile ( path );
+ this.cl_index.start_file ( this.pkg, "", "../../" );
+ this.cl_index.open_point ( title, "" );
+
+ this.main_index.open_point ( title, this.ns_name + "/index_classes.html" );
+ this.ns_index.open_point ( title, "index_classes.html" );
+
+ ns.visit_classes ( this );
+
+ this.cl_index.close_point ( );
+ this.cl_index.end_file ( );
+ this.cl_index = null;
+
+ this.main_index.close_point ( );
+ this.ns_index.close_point ( );
+ this.path = null;
+ }
+
+ private void global_struct_visitor ( Namespace ns ) {
+ this.path = this.settings.path + this.file_name + "/" + this.ns_name + "/";
+ string path = this.path + "index_structs.html";
+ string title = "Structs:";
+
+ this.stru_index = new IndexFile ( path );
+ this.stru_index.start_file ( this.pkg, "", "../../" );
+ this.stru_index.open_point ( title, "" );
+
+ this.main_index.open_point ( title, this.ns_name + "/index_structs.html" );
+ this.ns_index.open_point ( title, "index_structs.html" );
+
+ ns.visit_structs ( this );
+
+ this.stru_index.close_point ( );
+ this.stru_index.end_file ( );
+ this.stru_index = null;
+
+ this.main_index.close_point ( );
+ this.ns_index.close_point ( );
+ this.path = null;
+ }
+
+ private void signal_visitor ( SignalHandler sigh ) {
+ this.type_doc.start_detail_signal ( );
+ sigh.visit_signals ( this );
+ this.type_doc.end_detail_signal ( );
+ }
+
+ private void namespace_visitor ( ) {
+
+ }
+
+ public virtual void visit_file ( File file ) {
+ this.file_name = Path.get_basename ( file.name );
+ if ( this.file_name.has_suffix ( ".vapi" ) ) {
+ var size = this.file_name.size() - ".vapi".size();
+ this.pkg = this.file_name.ndup ( size );
+ }
+ else {
+ this.pkg = this.file_name;
+ }
+ this.pkg += " Reference Manual";
+
+ var rt = DirUtils.create ( this.settings.path + this.file_name, 0777 );
+ var path = this.file_name + "/index.html";
+
+ this.main_index = new IndexFile ( this.settings.path + path );
+ this.main_index.start_file ( this.pkg, "", "../" );
+ this.ns_view_index.add_file ( file.name, path );
+
+ file.visit_namespaces ( this );
+
+ this.ns_view_index.delete ( );
+ this.main_index.end_file ( );
+ this.main_index = null;
+ this.file_name = null;
+ }
+
+ public virtual void visit_namespace ( Namespace ns ) {
+ var full_name = ns.full_name;
+
+ string title = ( ns.name == null )? "Global Namespace:" : full_name;
+ string name = ( ns.name == null )? "(Global)" : full_name;
+ this.ns_name = name;
+
+ string path = name + "/index.html";
+
+ this.main_index.open_point ( title, path );
+
+ var rt = DirUtils.create ( this.settings.path + this.file_name + "/" + name, 0777 );
+ this.ns_index = new IndexFile ( this.settings.path + this.file_name + "/" + path );
+ this.ns_index.start_file ( this.pkg, "", "../../" );
+ this.ns_index.open_point ( title, path );
+
+ this.ns_view_index.add_namespace ( this.file_name, full_name, "../" + this.path );
+
+ this.global_field_visitor ( ns );
+ this.globa_method_visitor ( ns );
+ this.delegate_visitor ( ns );
+
+ this.enum_visitor ( ns );
+ this.error_domain_visitor ( ns );
+ this.global_struct_visitor ( ns );
+ this.interface_visitor ( ns );
+ this.global_class_visitor ( ns );
+
+ this.main_index.close_point ( );
+ this.ns_index.close_point ( );
+ this.ns_index.end_file ( );
+ this.ns_index = null;
+
+ ns.visit_namespaces ( this );
+ }
+
+ public virtual void visit_interface ( Interface iface ) {
+ this.path = this.settings.path + this.file_name + "/" + this.ns_name + "/";
+ string path = this.path + iface.name + ".htm";
+
+ this.main_index.add_point ( iface.name, "../../" + path );
+ this.iface_index.add_point ( iface.name, "../../../" + path );
+ this.ns_index.add_point ( iface.name, "../../../" + path );
+
+ this.type_doc = new DocFile ( path, this.settings );
+ this.type_doc.initialisation ( );
+ this.type_doc.start_file ( this.pkg, "", "../../" );
+ this.type_doc.index_start_synopsis ( );
+ this.type_doc.index_start_interface ( iface );
+
+ this.ns_view_index.add_interface ( this.file_name, iface.nspace.full_name, iface.name, "../" + path );
+
+ var methods = iface.get_method_list();
+ var properties = iface.get_property_list();
+ var signals = iface.get_signal_list();
+
+ int[] space_lst = new int[3];
+ space_lst[0] = properties.size;
+ space_lst[1] = signals.size;
+ space_lst[2] = methods.size;
+
+ foreach ( Property prop in properties ) {
+ this.type_doc.index_add_property ( prop );
+ }
+
+ this.type_doc.index_space ( space_lst, 0 );
+
+ foreach ( Signal sig in signals ) {
+ this.type_doc.index_add_signal ( sig );
+ }
+
+ this.type_doc.index_space ( space_lst, 1 );
+
+ foreach ( Method m in methods ) {
+ this.type_doc.index_add_method ( m, iface );
+ }
+
+ this.type_doc.index_end_interface ( );
+ this.type_doc.index_end_synopsis ( );
+
+
+ this.type_doc.start_description ( iface );
+ this.type_doc.start_detail ( );
+
+ this.signal_visitor ( iface );
+ this.property_visitor ( iface );
+ this.method_visitor ( iface );
+
+ this.type_doc.end_detail ( );
+ this.type_doc.end_description ( );
+ this.type_doc.end_file ( );
+ this.type_doc = null;
+ this.path = null;
+ }
+
+ private inline void class_synopsis ( Class cl ) {
+ var methods = cl.get_method_list();
+ var signals = cl.get_signal_list();
+ var construction_methods = cl.get_construction_method_list();
+ var properties = cl.get_property_list();
+ var fields = cl.get_field_list();
+ var structs = cl.get_struct_list();
+ var classes = cl.get_class_list();
+
+ int[] space_lst = new int[7];
+ space_lst[0] = classes.size;
+ space_lst[1] = structs.size;
+ space_lst[2] = fields.size;
+ space_lst[3] = properties.size;
+ space_lst[4] = construction_methods.size;
+ space_lst[5] = signals.size;
+ space_lst[6] = methods.size;
+
+ this.type_doc.index_start_class ( cl );
+
+ foreach ( Class cl in classes ) {
+ this.class_synopsis ( cl );
+ }
+
+ this.type_doc.index_space ( space_lst, 0 );
+
+ foreach ( Struct stru in structs ) {
+ this.struct_synopsis ( stru );
+ }
+
+ this.type_doc.index_space ( space_lst, 1 );
+
+ foreach ( Field f in fields ) {
+ this.type_doc.index_add_field ( f, cl );
+ }
+
+ this.type_doc.index_space ( space_lst, 2 );
+
+ foreach ( Property prop in properties ) {
+ this.type_doc.index_add_property ( prop );
+ }
+
+ this.type_doc.index_space ( space_lst, 3 );
+
+
+ foreach ( Method m in construction_methods ) {
+ this.type_doc.index_add_method ( m, cl );
+ }
+
+ this.type_doc.index_space ( space_lst, 4 );
+
+ foreach ( Signal sig in signals ) {
+ this.type_doc.index_add_signal ( sig );
+ }
+
+ this.type_doc.index_space ( space_lst, 5 );
+
+ foreach ( Method m in methods ) {
+ this.type_doc.index_add_method ( m, cl );
+ }
+
+ this.type_doc.index_end_class ( cl );
+ }
+
+ public virtual void visit_class ( Class cl ) {
+ if ( cl.bracket_level == 0 ) {
+ this.path = this.settings.path + this.file_name + "/" + this.ns_name + "/";
+ this.root_class = cl.name;
+
+ string path = this.path + this.root_class + ".htm";
+ this.main_index.add_point ( cl.name, "../../" + path );
+ this.cl_index.add_point ( cl.name, "../../../" + path );
+ this.ns_index.add_point ( cl.name, "../../../" + path );
+
+ this.ns_view_index.add_class ( this.file_name, cl.nspace.full_name, cl.name, "../" + path );
+
+ this.type_doc = new DocFile ( path, this.settings );
+ this.type_doc.initialisation ( );
+ this.type_doc.start_file ( this.pkg, "", "../../" );
+
+ this.type_doc.index_start_synopsis ( );
+ this.class_synopsis ( cl );
+ this.type_doc.index_end_synopsis ( );
+ }
+
+ this.type_doc.start_type_detail ( cl.name ); // rename to description
+ this.type_doc.add_description ( cl );
+ this.type_doc.start_detail ( );
+
+ this.construction_methods_visitor ( cl );
+ this.field_visitor ( cl );
+ this.signal_visitor ( cl );
+ this.property_visitor ( cl );
+ this.method_visitor ( cl );
+
+ this.type_doc.end_detail ( );
+ this.type_doc.end_type_detail ( );
+
+ cl.visit_classes ( this );
+ cl.visit_structs ( this );
+
+ if ( cl.bracket_level == 0 ) {
+ this.type_doc.end_file ( );
+ this.root_class = null;
+ this.path = null;
+ }
+ }
+
+ private void struct_synopsis ( Struct stru ) {
+ var construction_methods = stru.get_construction_method_list();
+ var methods = stru.get_method_list();
+ var fields = stru.get_field_list();
+
+ int[] space_lst = new int[3];
+ space_lst[0] = fields.size;
+ space_lst[1] = construction_methods.size;
+ space_lst[2] = methods.size;
+
+ this.type_doc.index_start_struct ( stru );
+
+ foreach ( Field f in fields ) {
+ if ( f.is_visitor_accessible() )
+ this.type_doc.index_add_field ( f, stru );
+ }
+
+ this.type_doc.index_space ( space_lst, 0 );
+
+ foreach ( Method m in construction_methods ) {
+ this.type_doc.index_add_method ( m, stru );
+ }
+
+ this.type_doc.index_space ( space_lst, 1 );
+
+ foreach ( Method m in methods ) {
+ this.type_doc.index_add_method ( m, stru );
+ }
+
+ this.type_doc.index_end_struct ( stru );
+ }
+
+ public virtual void visit_struct ( Struct stru ) {
+ if ( stru.bracket_level == 0 ) {
+ this.path = this.settings.path + this.file_name + "/" + this.ns_name + "/";
+ this.root_class = stru.name;
+
+ string path = this.path + this.root_class + ".htm";
+ this.main_index.add_point ( stru.name, "../../" + path );
+ this.stru_index.add_point ( stru.name, "../../../" + path );
+ this.ns_index.add_point ( stru.name, "../../../" + path );
+
+ this.ns_view_index.add_struct ( this.file_name, stru.nspace.full_name, stru.name, "../" + path );
+
+ this.type_doc = new DocFile ( path, this.settings );
+ this.type_doc.initialisation ( );
+ this.type_doc.start_file ( this.pkg, "", "../../" );
+
+ this.type_doc.index_start_synopsis ( );
+ this.struct_synopsis ( stru );
+ this.type_doc.index_end_synopsis ( );
+
+ this.type_doc.start_type_detail ( "" );
+ this.type_doc.add_description ( stru );
+ this.type_doc.start_detail ( );
+ }
+ else {
+ this.type_doc.start_type_detail ( stru.name );
+ this.type_doc.add_description ( stru );
+ this.type_doc.start_detail ( );
+ }
+
+ //stru.visit_construction_methods ( this );
+ this.construction_methods_visitor ( stru );
+
+ this.field_visitor ( stru );
+ //stru.visit_methods ( this );
+ this.method_visitor ( stru );
+
+ if ( stru.bracket_level != 0 ) {
+ this.type_doc.end_detail ( );
+ this.type_doc.end_type_detail ( );
+ return ;
+ }
+
+ this.type_doc.end_detail ( );
+ this.type_doc.end_file ( );
+ this.type_doc = null;
+ this.path = null;
+ }
+
+ public virtual void visit_error_domain ( ErrorDomain errdom ) {
+ this.path = this.settings.path + this.file_name + "/" + this.ns_name + "/";
+ string path = this.path + errdom.name + ".htm";
+
+ this.er_index.add_point ( errdom.name, "../../../" + path );
+ this.main_index.add_point ( errdom.name, "../../" + path );
+ this.ns_index.add_point ( errdom.name, "../../../" + path );
+
+ this.type_doc = new DocFile ( path, this.settings );
+ this.type_doc.initialisation ( );
+ this.type_doc.start_file ( this.pkg, "", "../../" );
+ this.type_doc.index_start_synopsis ( );
+
+ this.type_doc.index_start_error_domain ( errdom );
+
+ var errcodes = errdom.get_error_code_list();
+ var methods = errdom.get_method_list();
+
+ int[] space_lst = new int[2];
+ space_lst[0] = errcodes.size;
+ space_lst[1] = methods.size;
+
+ foreach ( ErrorCode errcode in errcodes ) {
+ this.type_doc.index_add_error_code ( errcode );
+ }
+
+ this.type_doc.index_space ( space_lst, 0 );
+
+ foreach ( Method m in methods ) {
+ if ( m.is_visitor_accessible() )
+ this.type_doc.index_add_method ( m, errdom );
+ }
+
+ this.type_doc.index_end_error_domain ( );
+ this.type_doc.index_end_synopsis ( );
+ this.type_doc.start_description ( errdom );
+
+
+ this.ns_view_index.add_error_domain ( this.file_name, errdom.nspace.full_name, errdom.name, "../" + path );
+
+
+ this.type_doc.start_detail_error_code ( );
+ errdom.visit_error_codes ( this );
+ this.type_doc.end_detail_error_code ( );
+
+ this.method_visitor ( errdom );
+
+ this.type_doc.end_file ( );
+ this.type_doc.end_description ( );
+ this.type_doc = null;
+ this.path = null;
+ }
+
+ public virtual void visit_enum ( Enum en ) {
+ this.path = this.settings.path + this.file_name + "/" + this.ns_name + "/";
+ string path = this.path + en.name + ".htm";
+
+ this.en_index.add_point ( en.name, "../../../" + path );
+ this.main_index.add_point ( en.name, "../../" + path );
+ this.ns_index.add_point ( en.name, "../../../" + path );
+
+ this.type_doc = new DocFile ( path, this.settings );
+ this.type_doc.initialisation ( );
+ this.type_doc.start_file ( this.pkg, "", "../../" );
+ this.type_doc.index_start_synopsis ( );
+
+ this.type_doc.index_start_enum ( en );
+
+ var envals = en.get_enum_values( );
+ var methods = en.get_method_list( );
+
+
+ int[] space_lst = new int[2];
+ space_lst[0] = envals.size;
+ space_lst[1] = methods.size;
+
+
+ foreach ( EnumValue enval in envals ) {
+ this.type_doc.index_add_enum_value ( enval );
+ }
+
+ this.type_doc.index_space ( space_lst, 0 );
+
+ foreach ( Method m in methods ) {
+ this.type_doc.index_add_method ( m, en );
+ }
+
+ this.type_doc.index_end_enum ( );
+ this.type_doc.index_end_synopsis ( );
+
+ this.type_doc.start_description ( en );
+ this.ns_view_index.add_enum ( this.file_name, en.nspace.full_name, en.name, "../" + path );
+
+
+ this.type_doc.start_detail_enum_value ( );
+ en.visit_enum_values ( this );
+ this.type_doc.end_detail_enum_value ( );
+
+ this.method_visitor ( en );
+
+ this.type_doc.end_file ( );
+ this.type_doc.end_description ( );
+ this.type_doc = null;
+ this.path = null;
+ }
+
+ public virtual void visit_property ( Property prop ) {
+ this.type_doc.add_detail_property ( prop );
+ }
+
+ public virtual void visit_field ( Field field, FieldHandler parent ) {
+ if ( field.is_global ) {
+ string path = this.path + "globals.html";
+ this.ns_index.add_point ( field.name, "../../../" + path + "#" + this.get_mark_name ( field ) );
+ this.main_index.add_point ( field.name, "../../" + path + "#" + this.get_mark_name ( field ) );
+ this.global_var_index.add_point ( field.name, "../../../" + path + "#" + this.get_mark_name ( field ) );
+
+ this.ns_view_index.add_global_field ( this.file_name, field.nspace.full_name, field.name,
+ "../" + path + "#" + this.get_mark_name ( field ) );
+
+ this.glob_doc.add_detail_field( field, parent );
+ return ;
+ }
+
+ this.type_doc.add_detail_field ( field, parent );
+ }
+
+ public virtual void visit_error_code ( ErrorCode errcode ) {
+ this.type_doc.add_detail_error_code ( errcode );
+ }
+
+ public virtual void visit_enum_value ( EnumValue enval ) {
+ this.type_doc.add_detail_enum_value ( enval );
+ //this.type_doc.add_description ( enval );
+ }
+
+ public virtual void visit_delegate ( Delegate del ) {
+ string path = this.path + "delegates.html";
+ this.main_index.add_point ( del.name, "../../" + path + "#" + this.get_mark_name ( del ) );
+ this.del_index.add_point ( del.name, "../../../" + path + "#" + this.get_mark_name ( del ) );
+ this.ns_index.add_point ( del.name, "../../../" + path + "#" + this.get_mark_name ( del ) );
+
+ this.del_doc.add_detail_delegate ( del );
+
+ this.ns_view_index.add_delegate ( this.file_name, del.nspace.full_name, del.name,
+ "../" + path + "#" + this.get_mark_name ( del ) );
+ }
+
+ public virtual void visit_signal ( Signal sig ) {
+ this.type_doc.add_detail_signal ( sig );
+ }
+
+ public virtual void visit_method ( Method m, Valadoc.MethodHandler parent ) {
+ if ( m.is_global ) {
+ string path = this.path + "functions.html";
+ this.ns_index.add_point ( m.name, "../../../" + path + "#" + this.get_mark_name ( m ) );
+ this.main_index.add_point ( m.name, "../../" + path + "#" + this.get_mark_name ( m ) );
+ this.function_index.add_point ( m.name, "../../../" + path + "#" + this.get_mark_name ( m ) );
+
+ this.func_doc.add_detail_method ( m, parent );
+ this.ns_view_index.add_global_method ( this.file_name, m.nspace.full_name, m.name,
+ "../" + path + "#" + this.get_mark_name ( m ) );
+ return ;
+ }
+
+ this.type_doc.add_detail_method ( m, parent );
+ }
+}
+
Added: trunk/html/helper.vala
==============================================================================
--- (empty file)
+++ trunk/html/helper.vala Sat Apr 26 14:47:35 2008
@@ -0,0 +1,101 @@
+/*
+ * Valadoc - a documentation tool for vala.
+ * Copyright (C) 2008 Florian Brosch
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+
+using GLib;
+
+
+public interface Valadoc.LinkHelper {
+ public abstract Settings settings {
+ construct set;
+ get;
+ }
+
+ public string? get_mark_name ( Valadoc.Basic type ) {
+ if ( type is Class || type is Struct || type is Enum || type is ErrorDomain || type is Interface )
+ return "";
+
+ string? strd = null;
+ while ( type is Namespace == false ) {
+ if ( strd == null )
+ strd = type.name;
+ else if ( type.name != null )
+ strd = type.name + "." + strd;
+
+ type = type.parent;
+ }
+
+ return strd;
+ }
+
+ // just use get_file_name for classes and structs!
+ private string get_file_name ( Valadoc.ContainerDataType ctype ) {
+ Basic dtype = ctype;
+
+ while ( dtype.parent is Namespace == false )
+ dtype = dtype.parent;
+
+ return dtype.name;
+ }
+
+ protected string? get_link ( Valadoc.Basic tag ) {
+ if ( !this.settings.to_doc( tag.file_name ) )
+ return null;
+
+ string nspace_name = ( tag.nspace.name == null )? "(Global)" : tag.nspace.full_name;
+ if ( tag is Valadoc.Namespace )
+ return "../../ns.%s.html".printf( nspace_name );
+
+ string docsubdir = Path.get_basename( tag.file_name );
+ string markname = this.get_mark_name ( tag );
+
+ if ( tag is Valadoc.EnumValue || tag is Valadoc.ErrorCode )
+ return "../../%s/%s/%s.htm#%s".printf( docsubdir, nspace_name, tag.parent.name, markname );
+
+ if ( tag is Valadoc.Field && tag.parent is Valadoc.Namespace )
+ return "../../%s/%s/globals.html#%s".printf( docsubdir, nspace_name, markname );
+
+ if ( tag is Valadoc.Delegate )
+ return "../../%s/%s/delegates.html#%s".printf( docsubdir, nspace_name, markname );
+
+ if ( tag is Valadoc.Method && tag.parent is Valadoc.Namespace )
+ return "../../%s/%s/functions.html#%s".printf( docsubdir, nspace_name, markname );
+
+
+ if ( tag is Valadoc.ContainerDataType ) {
+ string filename = this.get_file_name ( (ContainerDataType)tag );
+ return "../../%s/%s/%s.htm".printf ( docsubdir, nspace_name, filename );
+ }
+
+ if ( tag is Valadoc.Enum || tag is Valadoc.ErrorDomain )
+ return "../../%s/%s/%s.htm".printf ( docsubdir, nspace_name, tag.name );
+
+
+ if ( tag.parent is Valadoc.Enum || tag.parent is Valadoc.ErrorDomain )
+ return "../../%s/%s/%s.htm#%s".printf ( docsubdir, nspace_name, tag.parent.name, markname );
+
+ if ( tag.parent is Valadoc.ContainerDataType ) {
+ string filename = this.get_file_name ( (ContainerDataType)tag.parent );
+ return "../../%s/%s/%s.htm#%s".printf ( docsubdir, nspace_name, filename, markname );
+ }
+
+ return null;
+ }
+}
+
+
Added: trunk/html/langlet.vala
==============================================================================
--- (empty file)
+++ trunk/html/langlet.vala Sat Apr 26 14:47:35 2008
@@ -0,0 +1,686 @@
+/*
+ * Valadoc - a documentation tool for vala.
+ * Copyright (C) 2008 Florian Brosch
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+
+using GLib;
+using Gee;
+
+
+public enum WriterState {
+ KEY,
+ STANDARD,
+ NULL
+}
+
+
+
+public class Valadoc.LangletIndex : Valadoc.Langlet, Valadoc.LinkHelper {
+ private StringBuilder write_buffer = new StringBuilder ( "" );
+ private WriterState wstate = WriterState.NULL;
+
+ private ulong name_len = 0;
+
+ private int space_width = 4;
+ private int acess_area = 10;
+ private int typeref_area = 20;
+ private int name_area = 25;
+
+ public bool with_link {
+ get;
+ set;
+ }
+
+ public LangletIndex ( Settings settings ) {
+ this.settings = settings;
+ }
+
+ public Settings settings {
+ construct set;
+ get;
+ }
+
+ construct {
+ this.with_link = false;
+
+ this.puts_keyword += ( @this, ptr, str ) => {
+ ((FileStream)ptr).puts ( "<i>" );
+ ((FileStream)ptr).puts ( str );
+ ((FileStream)ptr).puts ( "</i>" );
+ };
+
+ this.puts += ( @this, ptr, str ) => {
+ ((FileStream)ptr).puts ( str );
+ };
+ }
+
+ protected void writer_flush ( void* ptr ) {
+ if ( this.wstate == WriterState.STANDARD )
+ this.puts ( ptr, this.write_buffer.str );
+ else if ( this.wstate == WriterState.KEY )
+ this.puts_keyword ( ptr, this.write_buffer.str );
+
+ this.write_buffer.erase ( 0, -1 );
+ }
+
+ protected void write_keywrd ( void* ptr, string str ) {
+ if ( wstate == WriterState.STANDARD ) {
+ if ( write_buffer.str != "" )
+ this.puts ( ptr, this.write_buffer.str );
+ this.write_buffer.erase ( 0, -1 );
+ }
+
+ this.write_buffer.append ( str );
+ wstate = WriterState.KEY;
+ }
+
+ protected void write ( void* ptr, string str ) {
+ if ( wstate == WriterState.KEY ) {
+ if ( write_buffer.str != "" )
+ this.puts_keyword ( ptr, this.write_buffer.str );
+ this.write_buffer.erase ( 0, -1 );
+ }
+
+ this.write_buffer.append ( str );
+ wstate = WriterState.STANDARD;
+ }
+
+ private void write_name ( void* ptr, Valadoc.Basic type ) {
+ long len = this.name_area - type.name.len ();
+ if ( len < 0 ) {
+ this.name_len += this.name_area + len;
+ len = 0;
+ }
+ else {
+ this.name_len += this.name_area;
+ }
+
+ if ( this.with_link )
+ this.write ( ptr, "<a href=\"#%s\">%s</a>".printf( this.get_mark_name ( type ), type.name ) );
+ else
+ this.write ( ptr, type.name );
+
+ this.name_len += type.name.len();
+ this.write ( ptr, string.nfill ( len, ' ' ) );
+ }
+
+ private void write_ident ( void* ptr, uint rank_lvl ) {
+ uint ident = this.space_width * rank_lvl;
+ this.write ( ptr, string.nfill( ident, ' ' ) );
+ this.name_len = ident;
+ }
+
+ private void write_accessibility ( Valadoc.SymbolAccessibility bs, void* ptr ) {
+ var str = new StringBuilder ( "" );
+ if ( bs.is_public )
+ str.append ( "public " );
+ else if ( bs.is_protected )
+ str.append ( "protected" );
+ else if ( bs.is_private )
+ str.append ( "private " );
+
+ long ln = this.acess_area - str.str.len();
+ ln = ( ln < 0 )? 0 : ln;
+ str.append ( string.nfill( ln,' ' ) );
+
+ this.write_keywrd ( ptr, str.str );
+ this.name_len += ln + 3;
+ }
+
+ public override void write_type_parameter ( TypeParameter param, void* ptr ) {
+ this.write ( ptr, param.datatype_name );
+ }
+
+ public override void write_template_parameters ( TemplateParameterListHandler thandler, void* ptr ) {
+ var lst = thandler.get_template_param_list( );
+ if ( ((Gee.Collection)lst).size == 0 )
+ return ;
+
+ this.write ( ptr, " < " );
+
+ int i = 1;
+
+ foreach ( TypeParameter param in lst ) {
+ param.write ( this, ptr );
+ if ( ((Gee.Collection)lst).size > i )
+ this.write ( ptr, ", " );
+ i++;
+ }
+ this.write ( ptr, " > " );
+ }
+
+ public void write_parent_type_list ( Valadoc.ContainerDataType dtype, void* ptr ) {
+ var lst = dtype.get_parent_types ( );
+ int size = lst.size;
+ int i = 1;
+
+ if ( size == 0 )
+ return ;
+
+ this.write ( ptr, " : " );
+ foreach ( DataType cntype in lst ) {
+ string link = this.get_link ( cntype );
+ string str;
+
+ if ( link == null ) {
+ str = cntype.name;
+ }
+ else
+ str = "<a href=\"%s\">%s</a>".printf( link, cntype.name );
+
+ this.write ( ptr, str );
+
+ if ( size > i )
+ this.write ( ptr, ", " );
+
+ i++;
+ }
+
+ this.write ( ptr, " " );
+ }
+
+ private void write_error_domain_list ( ExceptionHandler exhandler, void* ptr ) {
+ var tmp = this.space_width + this.acess_area + this.typeref_area + this.name_area + 9;
+ var str = string.nfill ( tmp, ' ' );
+
+ long space = 0;
+ int i = 1;
+
+ var lst = exhandler.get_error_domains ( );
+ if ( ((Gee.Collection)lst).size == 0 )
+ return ;
+
+
+ this.write ( ptr, "\n" );
+ this.write ( ptr, str.offset ( 7 ) );
+ this.write_keywrd ( ptr, "throws " );
+
+ foreach ( TypeReference tref in lst ) {
+ if ( i != 1 )
+ this.write ( ptr, str );
+
+ this.write_nested_type_reference ( tref, ptr, out space );
+
+ if ( ((Gee.Collection)lst).size > i )
+ this.write ( ptr, ",\n" );
+ i++;
+ }
+ }
+
+ public override void write_parameter_list ( ParameterListHandler thandler, void* ptr ) {
+ var tmp = this.space_width + this.acess_area + this.typeref_area + this.name_area + 9;
+
+ string margin = string.nfill ( tmp, ' ' );
+ string open_bracket = " ( ";
+ this.write ( ptr, open_bracket );
+ this.name_len += open_bracket.len();
+
+ var lst = thandler.get_parameter_list ( );
+ var it = lst.iterator ( );
+ bool last ;
+
+ for ( int i = 1; last = it.next(); i++ ) {
+ FormalParameter fp = it.get ();
+ fp.write ( this, ptr );
+
+ if ( i < ((Gee.Collection)lst).size ) {
+ this.write ( ptr, ",\n" );
+ this.write ( ptr, margin );
+ }
+ }
+
+ this.write ( ptr, " ) " );
+ this.writer_flush ( ptr );
+ }
+
+ public override void write_field ( Valadoc.Field field, Valadoc.FieldHandler parent, void* ptr ) {
+ this.name_len = 0;
+ this.write_ident ( ptr, field.bracket_level );
+
+ this.write_accessibility ( field, ptr );
+ this.write_type_reference ( field.type_reference, ptr );
+
+ if ( field.parent != parent ) {
+ if ( parent is Class ) {
+ if ( ((Class)parent).is_double_field ( field ) ) {
+ this.write ( ptr, "(" );
+ this.write ( ptr, field.parent.name );
+ this.write ( ptr, ")" );
+ }
+ }
+ }
+
+
+ if ( with_link )
+ this.write ( ptr, "<a href=\"#%s\">%s</a>".printf( this.get_mark_name ( field ), field.name ) );
+ else
+ this.write ( ptr, field.name );
+
+ this.write ( ptr, " ;" );
+ this.writer_flush ( ptr );
+ }
+
+ private void write_type_reference_keywords ( Valadoc.TypeReference tref, void* ptr, out long strlen ) {
+ if ( tref.is_weak ) {
+ string str = "weak ";
+ this.write_keywrd ( ptr, str );
+ strlen += str.len ();
+ }
+ }
+
+ private string write_type_reference_name_helper ( Valadoc.TypeReference tref, out long strlen ) {
+ string typensname = tref.data_type.nspace.name;
+ string nsname = tref.nspace.name;
+ StringBuilder str = new StringBuilder ( "" );
+
+ if ( !( typensname == null || nsname == null ) ) {
+ if ( typensname != nsname ) {
+ str.append ( typensname );
+ str.append_unichar ( '.' );
+ strlen += typensname.len();
+ strlen++;
+ }
+ }
+ str.append ( tref.type_name );
+ strlen += tref.type_name.len();
+ return str.str;
+ }
+
+ private void write_type_reference_name ( Valadoc.TypeReference tref, void* ptr, out long strlen ) {
+ if ( tref.type_name == "void" ) {
+ string str = "void ";
+ this.write_keywrd ( ptr, str );
+ strlen += str.len();
+ }
+ else {
+ StringBuilder str = new StringBuilder ( "" );
+
+ if ( tref.data_type != null ) {
+ string link = this.get_link ( tref.data_type );
+ if ( link == null ) {
+ str.append ( this.write_type_reference_name_helper( tref, out strlen ) );
+ }
+ else {
+ str.append ( "<a href=\"%s\">".printf( link ) );
+ str.append ( this.write_type_reference_name_helper( tref, out strlen ) );
+ str.append ( "</a>" );
+ }
+ }
+ else {
+ str.append ( tref.type_name );
+ strlen += str.str.len();
+ }
+
+ this.write ( ptr, str.str );
+ str = null;
+
+ this.write_type_reference_template_arguments ( tref, ptr, out strlen );
+ }
+ }
+
+ private void write_type_reference_template_arguments ( Valadoc.TypeReference tref, void* ptr, out long strlen ) {
+ var arglst = tref.get_type_arguments ( );
+ if ( ((Gee.Collection)arglst).size != 0 ) {
+ string open_lst = "< ";
+ this.write ( ptr, open_lst );
+ foreach ( TypeReference arg in arglst ) {
+ this.write_nested_type_reference ( arg, ptr, out strlen );
+ this.write ( ptr, " " );
+ strlen++;
+ }
+ string close_lst = ">";
+ this.write ( ptr, close_lst );
+ strlen += open_lst.len() + close_lst.len();
+ }
+ }
+
+ // rename to something more common
+ private void write_nested_type_reference ( Valadoc.TypeReference tref, void* ptr, out long strlen ) {
+ if ( tref.type_name == null )
+ return ;
+
+ this.write_type_reference_keywords ( tref, ptr, out strlen );
+ this.write_type_reference_name ( tref, ptr, out strlen );
+
+ if ( tref.is_nullable ) {
+ this.write ( ptr, "?" );
+ strlen++;
+ }
+
+ if ( tref.pass_ownership ) {
+ this.write ( ptr, "#" );
+ strlen++;
+ }
+
+ if ( tref.is_array ) {
+ var str = new StringBuilder ( "[" );
+ for ( uint i = 0 ; i < tref.array_rank - 1 ; i++ ) {
+ str.append (",");
+ }
+ str.append ("]");
+ this.write ( ptr, str.str );
+ strlen += str.str.len();
+ }
+
+ this.write ( ptr, string.nfill ( tref.pointer_rank, '*' ) );
+ strlen += tref.pointer_rank;
+
+ this.writer_flush ( ptr );
+ }
+
+ public override void write_type_reference ( Valadoc.TypeReference tref, void* ptr ) {
+ long strlen = 0;
+
+ if ( tref.type_name == null )
+ return ;
+
+
+ this.write_nested_type_reference ( tref, ptr, out strlen );
+
+
+ this.write ( ptr, " " );
+ strlen++;
+
+
+ long space = this.space_width + this.acess_area + this.typeref_area - strlen - (long)this.name_len;
+ space = ( space > 0 )? space : 1;
+ this.write ( ptr, string.nfill ( space, ' ' ) );
+ this.name_len += space;
+
+ this.writer_flush ( ptr );
+ }
+
+ private inline void write_formal_parameter_keywords ( Valadoc.FormalParameter param, void* ptr, out long strlen ) {
+ if ( param.is_construct ) {
+ this.write_keywrd ( ptr, "construct " );
+ }
+
+ if ( param.is_ref ) {
+ string str = "ref ";
+ this.write_keywrd ( ptr, str );
+ strlen += str.len ();
+ }
+ else if ( param.is_out ) {
+ string str = "out ";
+ this.write_keywrd ( ptr, str );
+ strlen += str.len ();
+ }
+ }
+
+ public override void write_formal_parameter ( Valadoc.FormalParameter param, void* ptr ) {
+ if ( param.ellipsis ) {
+ this.write ( ptr, "..." );
+ return ;
+ }
+
+ long len = 0;
+ this.write_formal_parameter_keywords ( param, ptr, out len );
+
+ if ( param.type_reference != null ) {
+ //this.write_type_return_type ( param.return_type, ptr );
+ this.write_nested_type_reference ( param.type_reference, ptr, out len );
+ len = ( len > this.typeref_area )? 1 : this.typeref_area - len;
+ this.write ( ptr, string.nfill( len, ' ' ) );
+ this.name_len += len;
+ }
+
+ this.write ( ptr, param.name );
+ if ( param.default_value != null )
+ this.write ( ptr, " = " + param.default_value );
+
+ this.writer_flush ( ptr );
+ }
+
+ public override void write_property_accessor ( Valadoc.PropertyAccessor propac, void* ptr ) {
+ if ( propac.is_private && !propac.parent.is_private ) {
+ this.write_keywrd ( ptr, " private" );
+ }
+ else if ( propac.is_protected && !propac.parent.is_protected ) {
+ this.write_keywrd ( ptr, " protected" );
+ }
+ else if ( propac.is_public && !propac.parent.is_public ) {
+ this.write_keywrd ( ptr, " public" );
+ }
+
+ if ( propac.is_construct ) {
+ string str = " construct";
+ this.write_keywrd ( ptr, str );
+ }
+
+ if ( propac.is_set ) {
+ string str = " set";
+ string str2 = ";";
+ this.write_keywrd ( ptr, str );
+ this.write ( ptr, str2 );
+ }
+ else if ( propac.is_get ) {
+ string str = " get";
+ string str2 = ";";
+ this.write_keywrd ( ptr, str );
+ this.write ( ptr, str2 );
+ }
+ }
+
+ public override void write_property ( Valadoc.Property prop, void* ptr ) {
+ this.name_len = 0;
+ this.write_ident ( ptr, prop.bracket_level );
+
+ this.write_accessibility ( prop, ptr );
+
+ this.write_type_reference ( prop.return_type, ptr );
+
+ this.write_name ( ptr, prop );
+
+ this.write ( ptr, " {" );
+
+ if ( prop.getter != null )
+ prop.getter.write ( this, ptr );
+
+ if ( prop.setter != null )
+ prop.setter.write ( this, ptr );
+
+ this.write ( ptr, " } ;" );
+ this.writer_flush ( ptr );
+ }
+
+ public override void write_signal ( Valadoc.Signal sig, void* ptr ) {
+ this.name_len = 0;
+ this.write_ident ( ptr, sig.bracket_level );
+ this.write_accessibility ( sig, ptr );
+
+ string strsig = "signal ";
+ this.write_keywrd ( ptr, strsig );
+ this.name_len += strsig.len();
+
+ this.write_type_reference ( sig.return_type, ptr );
+ this.write_name ( ptr, sig );
+ this.write_parameter_list ( sig, ptr );
+ this.write ( ptr, " ;" );
+ this.writer_flush ( ptr );
+ }
+
+ public override void write_method ( void* ptr, weak Valadoc.Method m, Valadoc.MethodHandler parent ) {
+ this.name_len = 0;
+ this.write_ident ( ptr, m.bracket_level );
+ this.write_accessibility ( m, ptr );
+
+ if ( m.is_abstract ) {
+ string str = "abstract ";
+ this.write_keywrd ( ptr, str );
+ this.name_len += str.len();
+ }
+
+ if ( m.is_virtual ) {
+ string str = "virtual ";
+ this.write_keywrd ( ptr, str );
+ this.name_len += str.len();
+ }
+ else if ( m.is_override ) {
+ string str = "override ";
+ this.write_keywrd ( ptr, str );
+ this.name_len += str.len();
+ }
+
+ if ( m.is_static && !m.is_constructor ) {
+ string str = "static ";
+ this.write_keywrd ( ptr, str );
+ this.name_len += str.len();
+ }
+
+ if ( m.is_constructor ) {
+ long space = this.space_width + this.acess_area + this.typeref_area - (long)this.name_len;
+ space = ( space > 0 )? space : 1;
+ this.write ( ptr, string.nfill ( space, ' ' ) );
+ }
+ else
+ this.write_type_reference ( m.return_type, ptr );
+
+ if ( m.parent != parent ) {
+ if ( parent is Class ) {
+ if ( ((ContainerDataType)parent).is_double_method ( m ) ) {
+ var str = "(%s)".printf( m.parent.name );
+ this.name_len += str.len();
+ this.write ( ptr, str );
+ }
+ }
+ }
+
+ this.write_name ( ptr, m );
+
+ this.write_template_parameters ( m, ptr );
+ this.write_parameter_list ( m, ptr );
+ this.write_error_domain_list ( m, ptr );
+ this.write ( ptr, ";" );
+ this.writer_flush ( ptr );
+ }
+
+ public override void write_enum_value ( Valadoc.EnumValue enval, void* ptr ) {
+ this.name_len = 0;
+ this.write_ident ( ptr, enval.bracket_level );
+
+ this.write ( ptr, enval.name );
+ this.write ( ptr, "," );
+ this.writer_flush ( ptr );
+ }
+
+ public override void write_error_code ( Valadoc.ErrorCode errcode, void* ptr ) {
+ this.name_len = 0;
+ this.write_ident ( ptr, errcode.bracket_level );
+
+ this.write ( ptr, errcode.name );
+ this.write ( ptr, "," );
+ this.writer_flush ( ptr );
+ }
+
+ public override void write_delegate ( Valadoc.Delegate del, void* ptr ) {
+ this.name_len = 0;
+ this.write_ident ( ptr, del.bracket_level );
+
+ this.write_accessibility ( del, ptr );
+
+ if ( del.is_static ) {
+ string str = "static ";
+ this.write_keywrd ( ptr, str );
+ this.name_len += str.len();
+ }
+
+ string strkey = "delegate ";
+ this.write_keywrd ( ptr, strkey );
+ this.name_len += strkey.len();
+
+ this.write_type_reference ( del.return_type, ptr );
+
+ this.write_name ( ptr, del );
+
+ this.write_template_parameters ( del, ptr );
+ this.write_parameter_list ( del, ptr );
+ this.write ( ptr, " ;" );
+ this.writer_flush ( ptr );
+ }
+
+ public override void write_class ( Valadoc.Class cl, void* ptr ) {
+ this.name_len = 0;
+ this.write_ident ( ptr, cl.bracket_level );
+
+ this.write_keywrd ( ptr, cl.accessibility_str );
+
+ if ( cl.is_abstract )
+ this.write_keywrd ( ptr, " abstract" );
+
+ this.write_keywrd ( ptr, " class " );
+ this.write ( ptr, cl.name );
+ this.write_template_parameters ( cl, ptr );
+ this.write_parent_type_list ( cl, ptr );
+ this.writer_flush ( ptr );
+ }
+
+ public override void write_enum ( Valadoc.Enum en, void* ptr ) {
+ this.name_len = 0;
+ this.write_ident ( ptr, en.bracket_level );
+
+ this.write_keywrd ( ptr, en.accessibility_str );
+ this.write_keywrd ( ptr, " enum " );
+ this.write ( ptr, en.name );
+ this.writer_flush ( ptr );
+ }
+
+ public override void write_error_domain ( Valadoc.ErrorDomain errdom, void* ptr ) {
+ this.name_len = 0;
+ this.write_ident ( ptr, errdom.bracket_level );
+
+ this.write_keywrd ( ptr, errdom.accessibility_str );
+ this.write_keywrd ( ptr, " errordomain " );
+ this.write ( ptr, errdom.name );
+ this.writer_flush ( ptr );
+ }
+
+ public override void write_struct ( Valadoc.Struct stru, void* ptr ) {
+ this.name_len = 0;
+ this.write_ident ( ptr, stru.bracket_level );
+
+ this.write_keywrd ( ptr, stru.accessibility_str );
+ this.write_keywrd ( ptr, " struct " );
+ this.write ( ptr, stru.name );
+ this.write_template_parameters ( stru, ptr );
+ this.writer_flush ( ptr );
+ }
+
+ public override void write_interface ( Valadoc.Interface iface, void* ptr ) {
+ this.name_len = 0;
+ this.write_ident ( ptr, iface.bracket_level );
+
+ this.write_keywrd ( ptr, iface.accessibility_str );
+ this.write_keywrd ( ptr, " interface " );
+ this.write ( ptr, iface.name );
+ this.write_template_parameters ( iface, ptr );
+ this.writer_flush ( ptr );
+ }
+
+ public override void write_namespace ( Valadoc.Namespace ns, void* ptr ) {
+ this.write_keywrd ( ptr, ns.accessibility_str );
+ this.write_keywrd ( ptr, " namespace " );
+ this.write ( ptr, ns.name );
+ this.write ( ptr, " ;" );
+ this.writer_flush ( ptr );
+ }
+
+ public override void write_file ( Valadoc.File file, void* ptr ) {
+// this.writer_flush ( ptr );
+ }
+}
+
+
Added: trunk/html/taglet.vala
==============================================================================
--- (empty file)
+++ trunk/html/taglet.vala Sat Apr 26 14:47:35 2008
@@ -0,0 +1,355 @@
+/*
+ * Valadoc - a documentation tool for vala.
+ * Copyright (C) 2008 Florian Brosch
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+
+using GLib;
+
+
+public class Valadoc.GlobalTaglet : MainTaglet {
+ private Gee.Collection<Valadoc.BasicTaglet> lst;
+
+ construct {
+ this.indenture_number = 0;
+ }
+
+ public GlobalTaglet ( Valadoc.Basic element ) {
+ this.element = element;
+ }
+
+ public override void parse ( Gee.Collection<Valadoc.BasicTaglet> lst ) {
+ this.lst = lst;
+ }
+
+ public override void write ( void* ptr ) {
+ foreach ( Valadoc.BasicTaglet tag in this.lst ) {
+ tag.write ( ptr );
+ }
+ }
+
+ public static Valadoc.BasicTaglet create ( Valadoc.Tree tree, Valadoc.Basic element,
+ Valadoc.ErrorReporter err, Valadoc.Settings settings ) {
+ return new Valadoc.GlobalTaglet( element );
+ }
+}
+
+
+public class Valadoc.ReturnTaglet : MainTaglet {
+ Gee.Collection<Valadoc.BasicTaglet> lst;
+
+ construct {
+ this.indenture_number = 5000;
+ }
+
+ public ReturnTaglet ( Valadoc.Basic element ) {
+ this.element = element;
+ }
+
+ public override void parse ( Gee.Collection<Valadoc.BasicTaglet> lst ) {
+ this.lst = lst;
+ }
+
+ public static Valadoc.BasicTaglet create ( Valadoc.Tree tree, Valadoc.Basic element,
+ Valadoc.ErrorReporter err, Valadoc.Settings settings ) {
+ return new Valadoc.ReturnTaglet ( element );
+ }
+
+ public override void write ( void* ptr ) {
+ ((GLib.FileStream)ptr).puts ( "\t\t<table align=\"center\" width=\"80%\">\n\t\t\t<tr>\t\t\t\t<td colspan=\"2\"><h5>Return:</h5></td>\n\t\t\t</tr>\n\t\t\t\t<td width=\"5\"> </td>\n\t\t\t\t<td>" );
+
+ foreach ( Valadoc.BasicTaglet tag in this.lst ) {
+ tag.write ( ptr );
+ }
+ ((FileStream)ptr).puts ( "</td>\n\t\t\t</tr>\n\t\t</table>\n" );
+ }
+}
+
+
+
+
+public class Valadoc.SeeTaglet : MainTaglet, LinkHelper {
+ private string link;
+ private string name;
+
+ construct {
+ this.indenture_number = 10000;
+ }
+
+ public Settings settings {
+ construct set;
+ get;
+ }
+
+ public SeeTaglet ( Valadoc.Basic element,
+ Valadoc.Tree doctree,
+ Valadoc.ErrorReporter err,
+ Valadoc.Settings settings ) {
+ this.element = element;
+ this.doctree = doctree;
+ this.err = err;
+ this.settings = settings;
+ }
+
+ public override void parse ( Gee.Collection<Valadoc.BasicTaglet> lst ) {
+ if ( lst.size != 1 ) {
+ this.err.add_with_message ( this.element, false, "see", "no inline-tags are allowed." );
+ return ;
+ }
+
+ foreach ( Valadoc.BasicTaglet tag in lst ) {
+ if ( tag is Valadoc.StringTaglet == false ) {
+ this.err.add_with_message ( this.element, false, "see", "no inline-tags are allowed." );
+ return ;
+ }
+
+ this.name = ((Valadoc.StringTaglet)tag).str;
+
+ var element = this.doctree.search_symbol_str ( this.element, name.strip() );
+ if ( element == null ) {
+ this.err.add_with_message ( this.element, false, "see",
+ "linked type \"%s\" is not available.".printf( this.name ) );
+ return ;
+ }
+
+ this.link = this.get_link ( element );
+ }
+ }
+
+ public override void start_block ( void* ptr ) {
+ string str = "\t\t<br><br>\n\t\t<h5>See:</h5>\n\t\t<table>\n\t\t<tr>\n\t\t<td> </td>\n\t\t<td>\n";
+ ((GLib.FileStream)ptr).puts ( str );
+ }
+
+ public override void end_block ( void* ptr ) {
+ ((GLib.FileStream)ptr).puts ( "\t\t</td>\n\t\t</tr>\t\t</table>" );
+ }
+
+ public static Valadoc.BasicTaglet create ( Valadoc.Tree tree, Valadoc.Basic element,
+ Valadoc.ErrorReporter err, Valadoc.Settings settings ) {
+ return new Valadoc.SeeTaglet ( element, tree, err, settings );
+ }
+
+ public override void write ( void* ptr ) {
+ if ( this.link == null )
+ ((FileStream)ptr).puts ( this.name );
+ else
+ ((FileStream)ptr).puts ( "<a href=\"%s\">%s</a> ".printf( this.link, this.name ) );
+ }
+}
+
+
+public class Valadoc.LinkTaglet : InlineTaglet, LinkHelper {
+ private string name;
+ private string link;
+
+ public LinkTaglet ( Valadoc.Basic element,
+ Valadoc.Tree doctree,
+ Valadoc.ErrorReporter err,
+ Valadoc.Settings settings ) {
+ this.element = element;
+ this.doctree = doctree;
+ this.err = err;
+ this.settings = settings;
+ }
+
+ public Settings settings {
+ construct set;
+ get;
+ }
+
+ public override void parse ( string str ) {
+ this.name = str;
+
+ var element = this.doctree.search_symbol_str ( this.element, this.name.strip() );
+ if ( element == null ) {
+ this.err.add_with_message ( this.element, false, "link",
+ "linked type \"%s\" is not available.".printf( this.name ) );
+ return ;
+ }
+
+ this.link = this.get_link ( element );
+ }
+
+ public override void write ( void* ptr ) {
+ if ( this.link == null )
+ ((FileStream)ptr).puts ( this.name );
+ else
+ ((FileStream)ptr).puts ( "<a href=\"%s\">%s</a> ".printf( this.link, this.name ) );
+ }
+
+ public static Valadoc.BasicTaglet create ( Valadoc.Tree tree, Valadoc.Basic element,
+ Valadoc.ErrorReporter err, Valadoc.Settings settings ) {
+ return new Valadoc.LinkTaglet ( element, tree, err, settings );
+ }
+}
+
+
+
+public abstract class Valadoc.SingleTextHelper : MainTaglet {
+ protected string element_name;
+ protected string text = "";
+
+ public override void parse ( Gee.Collection<Valadoc.BasicTaglet> lst ) {
+ if ( lst.size != 1 ) {
+ this.err.add_with_message ( this.element, false, this.element_name, "Inline taglets are not allowed." );
+ return ;
+ }
+
+ Valadoc.BasicTaglet element = ((Gee.List<BasicTaglet>)lst).get ( 0 );
+ if ( element is StringTaglet == false ) {
+ this.err.add_with_message ( this.element, false, this.element_name, "Syntax error" );
+ return ;
+ }
+
+ this.text = ((StringTaglet)element).str;
+ }
+}
+
+
+
+public class Valadoc.VersionTaglet : SingleTextHelper {
+ construct {
+ this.indenture_number = 10;
+ }
+
+ public VersionTaglet ( Basic element, Valadoc.ErrorReporter err ) {
+ this.element = element;
+ this.err = err;
+ }
+
+ public static Valadoc.VersionTaglet create ( Valadoc.Tree tree, Valadoc.Basic element,
+ Valadoc.ErrorReporter err, Valadoc.Settings settings ) {
+ return new Valadoc.VersionTaglet( element, err );
+ }
+
+ public override void write ( void* ptr ) {
+ ((FileStream)ptr).puts ( "<br /><b>Version: </b>" + this.text + "<br />" );
+ }
+}
+
+
+public abstract class Valadoc.ParameterTagletHelper : MainTaglet {
+ private Gee.ArrayList<Valadoc.BasicTaglet> lst = new Gee.ArrayList<Valadoc.BasicTaglet> ();
+ private string param = null;
+
+ protected string parameter_error_msg = "parameter-name was expected.";
+ protected string element_name = "param";
+ protected string headline = "Parameter:";
+
+ /*
+ public ParameterTaglet ( construct Valadoc.Basic element, construct Valadoc.ErrorReporter err ) {
+ }
+ */
+
+ public override void parse ( Gee.Collection<Valadoc.BasicTaglet> lst ) {
+ int i = 0;
+ foreach ( Valadoc.BasicTaglet tag in lst ) {
+ if ( i == 0 ) {
+ if ( tag is Valadoc.StringTaglet == false ) {
+ this.err.add_with_message ( this.element, false, this.element_name, this.parameter_error_msg );
+ return ;
+ }
+
+ var str = ((Valadoc.StringTaglet)tag).str;
+
+ var vstr = str.split ( " ", 2 );
+ int vstr_len = 0; foreach ( string s in vstr ) { vstr_len++; }
+ if ( vstr_len >= 1 )
+ this.param = vstr[0];
+ if ( vstr_len >= 2 ) {
+ var tmp = Valadoc.StringTaglet.create ( this.element );
+ tmp.parse ( vstr[1] );
+ this.lst.add ( tmp );
+ }
+ }
+ else {
+ this.lst.add ( tag );
+ }
+
+ i++;
+ }
+ }
+
+ /*
+ public static Valadoc.ParameterTaglet create ( Valadoc.Tree tree, Valadoc.Basic element, Valadoc.ErrorReporter err ) {
+ return new Valadoc.ParameterTaglet( element, err );
+ }
+ */
+
+ public override void start_block (void* ptr ) {
+ ((GLib.FileStream)ptr).puts ( "\t\t<table align=\"center\" width=\"80%\">\n\t\t\t<tr>\t\t\t\t<td colspan=\"3\"><h5>" );
+ ((GLib.FileStream)ptr).puts ( this.headline );
+ ((GLib.FileStream)ptr).puts ( "</h5></td>\n\t\t\t</tr>\n" );
+ }
+
+ public override void end_block ( void* ptr ) {
+ ((GLib.FileStream)ptr).puts ( "\t\t</table>\n" );
+ }
+
+ public override void write ( void* ptr ) {
+ ((FileStream)ptr).printf ( "\t\t\t<tr>\n\t\t\t\t<td width=\"5\"> </td>\n\t\t\t<td width=\"70\"><i>%s:</i></td>\n", this.param );
+ foreach ( Valadoc.BasicTaglet tag in this.lst ) {
+ ((FileStream)ptr).puts ( "\n\t\t\t\t<td>" );
+ tag.write ( ptr );
+ ((FileStream)ptr).puts ( "</td>\n\t\t\t</tr>\n" );
+ }
+ }
+}
+
+
+
+public class Valadoc.ParameterTaglet : ParameterTagletHelper {
+ construct {
+ this.parameter_error_msg = "parameter-name was expected.";
+ this.element_name = "param";
+ this.headline = "Parameter:";
+ this.indenture_number = 3000;
+ }
+
+ public ParameterTaglet ( Valadoc.Basic element, Valadoc.ErrorReporter err ) {
+ this.element = element;
+ this.err = err;
+ }
+
+ public static Valadoc.ParameterTaglet create ( Valadoc.Tree tree, Valadoc.Basic element,
+ Valadoc.ErrorReporter err, Valadoc.Settings settings ) {
+ return new Valadoc.ParameterTaglet( element, err );
+ }
+}
+
+
+public class Valadoc.ExceptionTaglet : ParameterTagletHelper {
+ construct {
+ this.parameter_error_msg = "exception-name was expected.";
+ this.element_name = "throws";
+ this.headline = "Exceptions:";
+ this.indenture_number = 5500;
+ }
+
+ public ExceptionTaglet ( Valadoc.Basic element, Valadoc.ErrorReporter err ) {
+ this.element = element;
+ this.err = err;
+ }
+
+ public static Valadoc.ExceptionTaglet create ( Valadoc.Tree tree, Valadoc.Basic element,
+ Valadoc.ErrorReporter err, Valadoc.Settings settings ) {
+ return new Valadoc.ExceptionTaglet( element, err );
+ }
+}
+
+
+
Added: trunk/parser.vala
==============================================================================
--- (empty file)
+++ trunk/parser.vala Sat Apr 26 14:47:35 2008
@@ -0,0 +1,427 @@
+/*
+ * Valadoc - a documentation tool for vala.
+ * Copyright (C) 2008 Florian Brosch
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+
+using GLib;
+using Gee;
+
+
+
+
+
+public enum CommentContext {
+ STRUCT = 1 << 1,
+ METHOD = 1 << 2,
+ CREATION_METHOD = 1 << 3,
+ ENUM_VALUE = 1 << 4,
+ DELEGATE = 1 << 5,
+ SIGNAL = 1 << 6,
+ VARIABLE = 1 << 7,
+ PROPERTY = 1 << 8,
+ CLASS = 1 << 9,
+ ENUM = 1 << 10,
+ INTERFACE = 1 << 11,
+ NAMESPACE = 1 << 12,
+ SOURCEFILE = 1 << 13,
+ ALL = long.MAX
+}
+
+
+
+
+
+public class CommentParser : Object {
+ private Gee.HashMap<string, Valadoc.TagletCreator> entries
+ = new Gee.HashMap<string, Valadoc.TagletCreator>(GLib.str_hash, GLib.str_equal);
+ private Gee.ArrayList<Valadoc.BasicTaglet> tree = new Gee.ArrayList<Valadoc.BasicTaglet>();
+ private CommentContext context;
+ private Valadoc.Basic element;
+ private StringBuilder comment;
+
+ private Valadoc.ErrorReporter err;
+ private Valadoc.Tree doctree;
+
+
+ construct {
+ this.entries.set ( "", (Valadoc.TagletCreator)Valadoc.GlobalTaglet.create );
+ this.entries.set ( "see", (Valadoc.TagletCreator)Valadoc.SeeTaglet.create );
+ this.entries.set ( "link", (Valadoc.TagletCreator)Valadoc.LinkTaglet.create );
+ this.entries.set ( "param", (Valadoc.TagletCreator)Valadoc.ParameterTaglet.create );
+ this.entries.set ( "return", (Valadoc.TagletCreator)Valadoc.ReturnTaglet.create );
+ this.entries.set ( "throws", (Valadoc.TagletCreator)Valadoc.ExceptionTaglet.create );
+ //this.entries.set ( "version", (Valadoc.TagletCreator)Valadoc.VersionTaglet.create );
+ }
+
+ public Valadoc.Settings settings {
+ construct set;
+ get;
+ }
+
+ public Gee.Collection<Valadoc.BasicTaglet> comment_tree {
+ get {
+ return this.tree;
+ }
+ }
+
+ private Gee.Collection< Gee.Collection<Valadoc.MainTaglet> > sort_collection (
+ Gee.Collection< Gee.ArrayList<Valadoc.BasicTaglet> > lst2 )
+ {
+ bool switched;
+
+ var lst = new Gee.ArrayList< Gee.ArrayList<Valadoc.MainTaglet> > ();
+ foreach ( Gee.ArrayList<Valadoc.BasicTaglet> taglst in lst2 )
+ lst.add ( (Gee.ArrayList<Valadoc.MainTaglet>)taglst );
+
+ do {
+ switched = false;
+ int i = 0;
+
+ for ( i = 0; i < ((Gee.Collection)lst).size-1 ; i++ ) {
+ Gee.ArrayList<Valadoc.MainTaglet> sublst = lst.get (i);
+ Gee.ArrayList<Valadoc.MainTaglet> nsublst = lst.get(i+1);
+
+ Valadoc.MainTaglet tag = sublst.get(0);
+ Valadoc.MainTaglet ntag = nsublst.get(0);
+
+ if ( tag.indenture_number > ntag.indenture_number ) {
+ lst.remove ( sublst );
+ lst.insert ( i+1, sublst );
+ switched = true;
+ }
+ }
+ i --;
+ } while ( switched );
+ return lst;
+ }
+
+ public void write ( void* file ) {
+ var entries = new Gee.HashMap<Type, Gee.ArrayList<Valadoc.MainTaglet> >( GLib.direct_hash, GLib.direct_equal );
+
+ foreach ( Valadoc.BasicTaglet tag in this.tree ) {
+ Type id = ((Valadoc.MainTaglet)tag).get_type();
+ if ( entries.contains( id ) ) {
+ var lst = entries.get ( id );
+ lst.add ( ((Valadoc.MainTaglet)tag) );
+ }
+ else {
+ var arlst = new Gee.ArrayList<Valadoc.MainTaglet> ();
+ arlst.add ( tag );
+ entries.set ( id, arlst );
+ }
+ }
+
+ Gee.Collection< Gee.ArrayList<Valadoc.MainTaglet> > slst = this.sort_collection ( entries.get_values() );
+// var slst = entries.get_values();
+
+ foreach ( Gee.ArrayList<Valadoc.MainTaglet> lst in slst ) {
+ int i = 0;
+ foreach ( Valadoc.MainTaglet tag in lst ) {
+ i++;
+
+ if ( i == 1 )
+ tag.start_block ( file );
+
+ tag.write ( file );
+
+ if ( ((Gee.Collection)lst).size <= i )
+ tag.end_block ( file );
+ }
+ }
+ }
+
+ private Valadoc.BasicTaglet get_taglet ( string name ) {
+ Valadoc.TagletCreator creator = this.entries.get ( name );
+ if ( creator == null )
+ return null;
+ else
+ return creator( this.doctree, this.element, this.err, this.settings );
+ }
+
+ public static bool is_comment_string ( string str ) {
+ if ( str == null )
+ return false;
+
+ return ( str[0] == '*' )? true : false;
+ }
+
+ protected static bool is_inherit_doc ( string cmnt ) {
+ bool ret;
+ try {
+ var regexp = new Regex ( "^[\\s\\*\n]*{[\\s\n]* inheritDoc[\\s\n]*}[\\s\n\\*]*$" );
+ ret = regexp.match ( cmnt );
+ }
+ catch ( RegexError err ) {
+ return false;
+ }
+ return ret;
+ }
+
+ public Valadoc.BasicTaglet create_taglet ( string name,
+ Gee.Collection<Valadoc.BasicTaglet> vtaglets,
+ bool in_line ) {
+ var tag = this.get_taglet ( name );
+ if ( tag == null ) {
+ this.err.add ( this.element, false, name, CommentParserError.UNKNOWN_OPTION );
+ return null;
+ }
+
+ if ( !( in_line == true && tag is Valadoc.InlineTaglet ) ) {
+ this.err.add ( this.element, true, name, CommentParserError.CONTEXT_ERROR );
+ return null;
+ }
+
+ // add context check!
+
+ return tag;
+ }
+
+ // TODO: move parameters to constructor
+ public void initialisation ( string str, Valadoc.Basic element,
+ Valadoc.Tree tree,
+ Valadoc.ErrorReporter err,
+ CommentContext context,
+ Valadoc.Settings settings ) {
+ this.settings = settings;
+ this.element = element;
+ this.doctree = tree;
+ this.err = err;
+
+ if ( str[0] != '*' ) {
+ this.err.add ( this.element, false, null, CommentParserError.NO_COMMENT_STRING );
+ return ;
+ }
+ this.strip ( str );
+ }
+
+ private string strip_line ( string line ) {
+ line = line.strip ( );
+ if ( line == "" || line == "*" || line == null )
+ return "";
+
+ if ( line.get_char() != '*' )
+ this.err.add ( this.element, false, null, CommentParserError.SYNTAX_ERROR );
+
+ line = line.offset ( 1 ).strip ();
+
+ var ret = new StringBuilder ( "" );
+ for ( unichar ch = line.get_char(); ch != '\0' ; line = line.next_char(), ch = line.get_char() ) {
+ if ( ch.isspace() ) {
+ string tmp = line.prev_char();
+ if ( tmp.get_char().isspace() )
+ continue;
+
+ ret.append_unichar ( ' ' );
+ continue;
+ }
+ ret.append_unichar ( ch );
+ }
+ return ret.str;
+ }
+
+ private void strip ( string cmnt ) {
+ string[] lines = cmnt.split( "\n" );
+ this.comment = new StringBuilder ( "" );
+ bool fline = false;
+
+ foreach ( string line in lines ) {
+ line = this.strip_line ( line );
+ if ( line != "" )
+ fline = true;
+
+ if ( line == "" && !fline )
+ continue ;
+
+ this.comment.append_unichar ( '\n' );
+ this.comment.append ( line );
+ }
+ }
+
+ private Valadoc.InlineTaglet create_inline_taglet ( StringBuilder str ) {
+ var cmnd = new StringBuilder ( "" );
+ bool command = false;
+
+ int i = 0;
+ string pos = str.str;
+ for ( unichar ch = pos.get_char(); ch != '\0' ; pos = pos.next_char(), ch = pos.get_char(), i++ ) {
+ if ( ch == '@' && !command ) {
+ command = true;
+ continue ;
+ }
+ else if ( !command && !ch.isspace() ) {
+ this.err.add ( this.element, false, null, CommentParserError.SYNTAX_ERROR );
+ return null;
+ }
+ if ( command && ch.isspace() ) {
+ Valadoc.InlineTaglet tmp = (Valadoc.InlineTaglet)this.get_taglet ( cmnd.str );
+ if ( tmp == null ) {
+ this.err.add ( this.element, false, cmnd.str, CommentParserError.UNKNOWN_OPTION );
+ return null;
+ }
+
+
+ str.erase ( 0, i );
+ tmp.parse( str.str );
+ str.erase ( 0, -1 );
+ return tmp;
+ }
+ cmnd.append_unichar ( ch );
+ }
+
+ return null;
+ }
+
+ private void append_tree ( string cmnd, Gee.Collection<Valadoc.BasicTaglet> vtag ) {
+ Valadoc.MainTaglet tag;
+
+ // add context check
+ tag = (Valadoc.MainTaglet)this.get_taglet ( cmnd );
+ if ( tag == null) {
+ this.err.add ( this.element, false, cmnd, CommentParserError.UNKNOWN_SYMBOL );
+ return ;
+ }
+
+ var cvtag = new Gee.ArrayList<Valadoc.BasicTaglet>();
+
+ // copy
+ foreach ( Valadoc.BasicTaglet tagt in vtag ) {
+ cvtag.add ( tagt );
+ }
+
+ tag.parse ( cvtag );
+ this.tree.add ( tag );
+ vtag.clear();
+ }
+
+ // constructor-issue
+ private bool parse_comment ( ) {
+ if ( this.element is Valadoc.Method == false )
+ return true;
+
+ void* ptr = ((Valadoc.Method)element).parent_data_type;
+ if ( !((Valadoc.Method)element).is_constructor )
+ return true;
+
+ return ( ((Valadoc.Method)element).comment_str == ((Valadoc.ContainerDataType)ptr).comment_str )
+ ? false : true;
+ }
+
+ public void parse ( ) {
+ if ( !this.parse_comment ( ) )
+ return ;
+
+ var brackets = new StringBuilder ( "" );
+ var cmnd = new StringBuilder ( "" );
+ var str = new StringBuilder ( "" );
+ bool in_brackets = false;
+ bool command = false;
+
+ var tags = new Gee.ArrayList<Valadoc.BasicTaglet>();
+
+ int i;
+ weak string pos = this.comment.str;
+
+ for ( unichar ch = pos.get_char(); ch != '\0' ; pos = pos.next_char(), ch = pos.get_char() ) {
+ var pch = pos.prev_char().get_char();
+
+ if ( ch == '}' ) {
+ Valadoc.InlineTaglet tmp;
+
+ if ( in_brackets == false ) {
+ this.err.add ( this.element, false, null, CommentParserError.SYNTAX_ERROR );
+ return ;
+ }
+
+ tmp = this.create_inline_taglet ( brackets );
+ if ( tmp == null )
+ return ;
+
+ tags.add ( tmp );
+
+ in_brackets = false;
+ continue ;
+ }
+ else if ( in_brackets == true ) {
+ if ( brackets.len == 0 ) {
+ if ( ( ch.isspace() ) )
+ continue ;
+ }
+
+ brackets.append_unichar ( ch );
+ continue ;
+ }
+ else if ( ch == '{' ) {
+ if ( in_brackets == true ) {
+ this.err.add ( this.element, false, null, CommentParserError.SYNTAX_ERROR );
+ return ;
+ }
+
+ var strtag = new Valadoc.StringTaglet ( );
+ strtag.parse ( str.str );
+ tags.add ( strtag );
+
+ str.erase( 0, -1 );
+ in_brackets = true;
+ continue ;
+ }
+ else if ( command == true ) {
+ if ( ch.isspace() )
+ command = false;
+ else
+ cmnd.append_unichar( ch );
+
+ continue ;
+ }
+ else if ( ch == '@' ) {
+ if ( pch.isspace() ) {
+ var strtag = new Valadoc.StringTaglet ( );
+ strtag.parse ( str.str );
+ tags.add ( strtag );
+ str.erase( 0, -1 );
+
+ this.append_tree( cmnd.str, tags );
+
+ cmnd.erase ( 0, -1 );
+ command = true;
+ continue ;
+ }
+ }
+
+ str.append_unichar( ch );
+ }
+
+ if ( in_brackets ) {
+ // unreached
+ this.err.add ( this.element, false, null, CommentParserError.BRACKET_ERROR );
+ return ;
+ }
+
+ var strtag = new Valadoc.StringTaglet ( );
+ strtag.parse ( str.str );
+ tags.add ( strtag );
+ str.erase( 0, -1 );
+
+ this.append_tree( cmnd.str, tags );
+ }
+
+ private bool check_comment_context ( CommentContext context ) {
+ long tmp = this.context & context;
+ return ( tmp == 0 )? true : false;
+ }
+}
+
+
Added: trunk/settings.vala
==============================================================================
--- (empty file)
+++ trunk/settings.vala Sat Apr 26 14:47:35 2008
@@ -0,0 +1,57 @@
+/*
+ * Valadoc - a documentation tool for vala.
+ * Copyright (C) 2008 Florian Brosch
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+
+using GLib;
+
+
+public class Valadoc.Settings : Object {
+ public Gee.ArrayList<string> files;
+ public string path = "documentation/";
+ public bool _private = false;
+ public bool _protected = false;
+ public bool with_deps = false;
+ public bool add_inherited = false;
+
+ public bool application {
+ get {
+ foreach ( string path in this.files ) {
+ if ( path.has_prefix ( ".vapi" ) )
+ return true;
+ }
+ return false;
+ }
+ }
+
+ public bool to_doc ( string name ) {
+ if ( with_deps == true )
+ return true;
+
+ // FIXME: Compare with full path
+ string nstr = Path.get_basename ( name ) ;
+
+ foreach ( string str in this.files ) {
+ if ( Path.get_basename ( str ) == nstr )
+ return true;
+ }
+ return false;
+ }
+}
+
+
+
Added: trunk/testcases/definitions/class.vala
==============================================================================
--- (empty file)
+++ trunk/testcases/definitions/class.vala Sat Apr 26 14:47:35 2008
@@ -0,0 +1,26 @@
+
+using GLib;
+
+public class Foo : Object {
+ public int foo1;
+ public int foo2;
+ public int foo3;
+
+ public int bar4 { get; set; }
+ public int bar5 { get { return 0; } }
+ public int bar6 { private get; set; }
+
+ public signal int foobar1 ( int foo );
+ public signal int foobar2 ( int foo );
+ private signal int foobar3 ( int foo );
+
+ public Foo ( ) {}
+ public Foo.foo ( ) {}
+ public Foo.foo1 ( int bar4 ) {}
+
+ public int foobaz1 ( int foo = 9 ) { return 0; }
+ public int foobaz2 () { return 0; }
+ public int foobaz3 () { return 0; }
+}
+
+
Added: trunk/testcases/definitions/enum.vala
==============================================================================
--- (empty file)
+++ trunk/testcases/definitions/enum.vala Sat Apr 26 14:47:35 2008
@@ -0,0 +1,11 @@
+
+
+
+public enum ErrDom {
+ FOO,
+ BAR;
+
+ public void foobar ( ) {
+ }
+}
+
Added: trunk/testcases/definitions/errordomain.vala
==============================================================================
--- (empty file)
+++ trunk/testcases/definitions/errordomain.vala Sat Apr 26 14:47:35 2008
@@ -0,0 +1,10 @@
+
+
+
+public errordomain ErrDom {
+ FOO,
+ BAR;
+
+ public void foobar ( ) {
+ }
+}
Added: trunk/testcases/definitions/interface.vala
==============================================================================
--- (empty file)
+++ trunk/testcases/definitions/interface.vala Sat Apr 26 14:47:35 2008
@@ -0,0 +1,16 @@
+
+using GLib;
+
+public interface Foo {
+ public abstract int foo1 { private get; construct set; }
+ public abstract int foo2 { get; set; }
+ public abstract int foo3 { get; set; }
+
+ public signal int bar1 ( );
+ public signal int bar2 ( );
+ public signal int bar3 ( );
+
+ public int foobar1 ( ref StringBuilder foo, float dd = 0.3f ) { return 0; }
+ public int foobar2 ( ) { return 0; }
+ public int foobar3 ( ) { return 0; }
+}
Added: trunk/testcases/definitions/structs.vala
==============================================================================
--- (empty file)
+++ trunk/testcases/definitions/structs.vala Sat Apr 26 14:47:35 2008
@@ -0,0 +1,37 @@
+
+
+/**
+ * Struct Comment
+ */
+public struct Struct {
+ /**
+ * field1
+ */
+ public int field1;
+ /**
+ * field2
+ */
+ public int field2;
+
+
+ /**
+ * method1
+ */
+ public int method1 ( string inte ) { return 0; }
+ /**
+ * method2
+ */
+ public int method2 ( string inte ) { return 0; }
+ /**
+ * Struct
+ */
+ public Struct ( string inte ) { }
+ /**
+ * Struct.constr1
+ */
+ public Struct.constr1 ( string inte ) { }
+ /**
+ * Struct.constr2
+ */
+ public Struct.constr2 ( string inte ) { }
+}
Added: trunk/testcases/test.vala
==============================================================================
--- (empty file)
+++ trunk/testcases/test.vala Sat Apr 26 14:47:35 2008
@@ -0,0 +1,169 @@
+
+using GLib;
+
+
+
+
+
+public int GlobalTestfunktion () { return 0; }
+public delegate int GlobalTestDelegate ( );
+
+namespace Foo {
+ public delegate int DelegateInFoo ( );
+ public int FieldInFoo;
+
+ public int MethodInFoo ( int bar ) {
+ return 0;
+ }
+
+ namespace BARAKUDA {
+ /**
+ * { @link Foo.BARAKUDA }
+ * { @link MethodInBarakuda }
+ * { @link Foo.BARAKUDA.MethodInBarakuda }
+ */
+ public delegate int DelegateInBARAKUDA ( );
+
+ public int MethodInBarakuda ( ) {
+ return 0;
+ }
+
+ namespace BAR2 {
+ public enum EnumInBarD {
+
+ }
+
+ public errordomain ErrorDomainInBarD {
+ ErrorValueInErrorDomainInBarD;
+
+ public void MethodInErrorDomainInBarD ( ) {
+ }
+ }
+
+ public struct StructInBarD {
+ public int FieldInStruct;
+ public int MethodInStruct () {
+ return 0;
+ }
+
+ public StructInBarD.ConstructionMethod () {
+ }
+ }
+
+ public interface InterfaceInBarD {
+ public int MethodInInterface ( ) {
+ return 0;
+ }
+
+ public signal int SignalInInterface ( int foo );
+
+ public abstract int PropertyInInterface { get; set; }
+ }
+
+ public class SuperInBarD : Object {
+ public SuperInBarD.construction ( ) {
+ }
+
+ public int SuperInBarDProperty {
+ get; set;
+ }
+
+ public struct SuperInBarDStruct {
+ /**
+ * { @link this.SuperIntBarDStructField }
+ */
+ public int SuperIntBarDStructField;
+ public int SuperIntBarDStructField2;
+ public int SuperIntBarDStructField3;
+
+ public int SuperIntBarDStructMethod ( ) {
+ return 0;
+ }
+
+ public SuperInBarDStruct.construction ( ) {
+ }
+ }
+ /*
+ * { @link Foo.BARAKUDA.BAR2.SuperInBarD.SuperInBarDStruct.SuperIntBarDStructField }
+ */
+ public signal int SuperInBarDSignal ( );
+ public int SuperInBarDField;
+
+ public int SuperInBarDMethod ( ) {
+ return 0;
+ }
+ }
+ }
+
+
+
+
+ /**
+ * <br>{ @link Foo.BARAKUDA.BAR2.StructInBarD.MethodInStruct }
+ * <br>{ @link Foo.BARAKUDA.BAR2.StructInBarD.FieldInStruct }
+ * <br>{ @link Foo.BARAKUDA.BAR2.StructInBarD.StructInBarD.ConstructionMethod }
+ * <br>{ @link Foo.BARAKUDA.BAR2.SuperInBarD.SuperInBarD.construction }
+ * <br>{ @link Foo.BARAKUDA.BAR2.SuperInBarD.SuperInBarDProperty }
+ * <br>{ @link Foo.BARAKUDA.BAR2.SuperInBarD.SuperInBarDSignal }
+ * <br>{ @link Foo.BARAKUDA.BAR2.SuperInBarD.SuperInBarDMethod }
+ * <br>{ @link Foo.BARAKUDA.BAR2.SuperInBarD.SuperInBarDField }
+ * <br>{ @link Foo.BARAKUDA.BAR2.SuperInBarD.SuperInBarDStruct.SuperInBarDStruct.construction }
+ * <br>{ @link Foo.BARAKUDA.BAR2.SuperInBarD.SuperInBarDStruct.SuperIntBarDStructMethod }
+ * <br>{ @link Foo.BARAKUDA.BAR2.SuperInBarD.SuperInBarDStruct }
+ * <br>{ @link Foo.BARAKUDA.BAR2.InterfaceInBarD.PropertyInInterface }
+ * <br>{ @link Foo.BARAKUDA.BAR2.InterfaceInBarD.MethodInInterface }
+ * <br>{ @link Foo.BARAKUDA.BAR2.InterfaceInBarD.SignalInInterface }
+ * <br>{ @link Foo.BARAKUDA.BAR2.InterfaceInBarD }
+ * <br>{ @link Foo.BARAKUDA.BAR2.StructInBarD }
+ * <br>{ @link Foo.BARAKUDA.BAR2.ErrorDomainInBarD.MethodInErrorDomainInBarD }
+ * <br>{ @link Foo.BARAKUDA.BAR2.ErrorDomainInBarD }
+ * <br>{ @link Foo.BARAKUDA.BAR2.ErrorDomainInBarD.ErrorValueInErrorDomainInBarD }
+ * <br>{ @link Foo.BARAKUDA.BAR2.EnumInBarD }
+ * <br>{ @link Foo.BARAKUDA.BAR2.SuperInBarD }
+ * <br>{ @link Foo.BARAKUDA.BAR2 }
+ * <br>{ @link Foo.BARAKUDA.SuperInBar.SuperInSubBar }
+ * <br>{ @link Foo.BARAKUDA.SuperInBar.SuperInSubBar.SuperInSubBarMethod }
+ * <br>{ @link Foo.BARAKUDA.SuperInBar.SuperInSubBar.SuperInSubSubBar.SuperInSubSubBarMethod }
+ * <br>{ @link Foo.BARAKUDA.DelegateInBARAKUDA }
+ * <br>{ @link Foo.BARAKUDA.SuperInBar }
+ * <br>{ @link Foo.BARAKUDA }
+ * <br>{ @link Foo.DelegateInFoo }
+ * <br>{ @link Foo.MethodInFoo }
+ * <br>{ @link Foo.SuperInFoo }
+ * <br>{ @link Foo.FieldInFoo }
+ * <br>{ @link Foo }
+ */
+ public class SuperInBar : Object {
+ public class SuperInSubBar : Object {
+ public class SuperInSubSubBar : Object {
+ public int SuperInSubSubBarMethod () { return 0; }
+ }
+
+ public int SuperInSubBarMethod () { return 0; }
+ }
+
+ public int bar;
+ public int foo () { return 0; }
+ public signal int barfoo ( int foo );
+ public int foobar { get; set; }
+ }
+ }
+
+ /*
+ * { @link GlobalTestDelegate }
+ * { @link GlobalTestfunktion }
+ */
+ public class SuperInFoo : Object {
+ public class Foo : Object {
+ public int bar;
+ public int foo () { return 0; }
+ public signal int barfoo ( int foo );
+ public int foobar { get; set; }
+ }
+
+ public int bar;
+ public int foo () { return 0; }
+ public signal int barfoo ( int foo );
+ public int foobar { get; set; }
+ }
+}
Added: trunk/valadoc.vala
==============================================================================
--- (empty file)
+++ trunk/valadoc.vala Sat Apr 26 14:47:35 2008
@@ -0,0 +1,428 @@
+/*
+ * Valadoc - a documentation tool for vala.
+ * Copyright (C) 2008 Florian Brosch
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+
+using Drawer;
+using GLib;
+using Vala;
+using Gee;
+
+
+
+public class ValaDoc : Object {
+ private static string basedir;
+ private static string directory;
+
+ private static bool add_documentation = false;
+ private static bool add_inherited = false;
+ private static bool _protected = false;
+ private static bool with_deps = false;
+ private static bool _private = false;
+ private static bool version;
+
+ private static bool non_null_experimental = false;
+ private static bool disable_non_null = false;
+ private static bool disable_checking;
+
+ [NoArrayLength ()]
+ private static string[] vapi_directories;
+ [NoArrayLength ()]
+ private static weak string[] tsources;
+ [NoArrayLength ()]
+ private static string library;
+ [NoArrayLength ()]
+ private static weak string[] tpackages;
+
+
+ private Gee.ArrayList<string> packages = new Gee.ArrayList<string>();
+ private Gee.ArrayList<string> sources = new Gee.ArrayList<string>();
+
+
+
+ private const GLib.OptionEntry[] options = {
+ { "vapidir", 0, 0, OptionArg.FILENAME_ARRAY, out vapi_directories,
+ "Look for package bindings in DIRECTORY", "DIRECTORY..." },
+ { "pkg", 0, 0, OptionArg.STRING_ARRAY, out tpackages, "Include binding for PACKAGE", "PACKAGE..." },
+ //{ "library", 0, 0, OptionArg.STRING, out library, "Library name", "NAME" },
+ //{ "basedir", 'b', 0, OptionArg.FILENAME, out basedir, "Base source directory", "DIRECTORY" },
+ { "directory", 'o', 0, OptionArg.FILENAME, out directory, "Output directory", "DIRECTORY" },
+ { "protected", 0, 0, OptionArg.NONE, ref _protected, "Adds protected elements to documentation", null },
+ { "private", 0, 0, OptionArg.NONE, ref _private, "Adds private elements to documentation", null },
+ { "inherit", 0, 0, OptionArg.NONE, ref add_inherited, "Adds inherited elements to a class", null },
+// { "extend", 0, 0, OptionArg.NONE, ref add_documentation, "Adds documentation to a given directory", null },
+ { "deps", 0, 0, OptionArg.NONE, ref with_deps, "Adds packages to the documentation", null },
+ { "disable-non-null", 0, 0, OptionArg.NONE, ref disable_non_null, "Disable non-null types", null },
+ { "enable-non-null-experimental", 0, 0, OptionArg.NONE, ref non_null_experimental, "Enable experimentalenhancements for non-null types", null },
+ { "", 0, 0, OptionArg.FILENAME_ARRAY, out tsources, null, "FILE..." },
+ { null }
+ };
+
+ private int quit () {
+ if (Report.get_errors () == 0) {
+ stdout.printf ("Succeeded - %d warning(s)\n", Report.get_warnings ());
+ return 0;
+ }
+ else {
+ stdout.printf ("Failed: %d error(s), %d warning(s)\n", Report.get_errors (), Report.get_warnings ());
+ return 1;
+ }
+ }
+
+ private bool add_package (CodeContext context, string pkg) {
+ if (context.has_package (pkg)) {
+ // ignore multiple occurences of the same package
+ return true;
+ }
+
+ var package_path = get_package_path (pkg);
+
+ if (package_path == null) {
+ return false;
+ }
+
+ context.add_package (pkg);
+ context.add_source_file (new SourceFile (context, package_path, true));
+
+ var deps_filename = Path.build_filename (Path.get_dirname (package_path), "%s.deps".printf (pkg));
+
+ if (FileUtils.test (deps_filename, FileTest.EXISTS)) {
+ try {
+ string deps_content;
+ //ulong deps_len;
+ FileUtils.get_contents (deps_filename, out deps_content, null );
+ foreach (string dep in deps_content.split ("\n")) {
+ if (dep != "") {
+ if (!add_package (context, dep)) {
+ Report.error (null, "%s, dependency of %s, not found in specified Vala API directories".printf (dep, pkg));
+ }
+ }
+ }
+ } catch (FileError e) {
+ Report.error (null, "Unable to read dependency file: %s".printf (e.message));
+ }
+ }
+
+ return true;
+ }
+
+ private string get_package_path (string pkg) {
+ if (FileUtils.test ( pkg, FileTest.EXISTS))
+ return pkg;
+
+ string basename = "%s.vapi".printf (pkg);
+
+ if ( this.vapi_directories != null ) {
+ foreach (string vapidir in this.vapi_directories ) {
+ var filename = Path.build_filename (vapidir, basename);
+ if (FileUtils.test (filename, FileTest.EXISTS)) {
+ return filename;
+ }
+ }
+ }
+
+/*
+ string filename = Path.build_filename (Config.PACKAGE_DATADIR, "vapi", basename);
+ if (FileUtils.test (filename, FileTest.EXISTS)) {
+ return filename;
+ }
+*/
+
+ string filename = Path.build_filename ("/usr/local/share/vala/vapi", basename);
+ if (FileUtils.test (filename, FileTest.EXISTS)) {
+ return filename;
+ }
+
+ filename = Path.build_filename ("/usr/share/vala/vapi", basename);
+ if (FileUtils.test (filename, FileTest.EXISTS)) {
+ return filename;
+ }
+ return null;
+ }
+
+ private void add_files ( Vala.CodeContext context ) {
+ foreach ( string source in this.sources ) {
+ if (FileUtils.test (source, FileTest.EXISTS)) {
+ var rpath = realpath (source);
+ if (source.has_suffix (".vala")) {
+ context.add_source_file (new SourceFile (context, rpath, false));
+ }
+ else if (source.has_suffix (".vapi")) {
+ context.add_source_file (new SourceFile (context, rpath, true));
+ }
+ else {
+ Report.error (null, "%s is not a supported source file type.".printf (source));
+ }
+ }
+ else {
+ Report.error (null, "%s not found".printf (source));
+ }
+ }
+ }
+
+
+ //ported from glibc
+ private string realpath (string name) {
+ string rpath;
+
+ if (name.get_char () != '/') {
+ // relative path
+ rpath = Environment.get_current_dir ();
+ }
+ else {
+ rpath = "/";
+ }
+
+ weak string start;
+ weak string end;
+
+ for (start = end = name; start.get_char () != 0; start = end) {
+ // skip sequence of multiple path-separators
+ while (start.get_char () == '/') {
+ start = start.next_char ();
+ }
+
+ // find end of path component
+ long len = 0;
+ for (end = start; end.get_char () != 0 && end.get_char () != '/'; end = end.next_char ()) {
+ len++;
+ }
+
+ if (len == 0) {
+ break;
+ }
+ else if (len == 1 && start.get_char () == '.') {
+ // do nothing
+ }
+ else if (len == 2 && start.has_prefix ("..")) {
+ // back up to previous component, ignore if at root already
+ if (rpath.len () > 1) {
+ do {
+ rpath = rpath.substring (0, rpath.len () - 1);
+ }
+ while (!rpath.has_suffix ("/"));
+ }
+ }
+ else {
+ if (!rpath.has_suffix ("/")) {
+ rpath += "/";
+ }
+
+ rpath += start.substring (0, len);
+ }
+ }
+
+ if (rpath.len () > 1 && rpath.has_suffix ("/")) {
+ rpath = rpath.substring (0, rpath.len () - 1);
+ }
+
+ return rpath;
+ }
+
+
+ private Gee.ArrayList<string> sort_sources ( ) {
+ var to_doc = new Gee.ArrayList<string>();
+
+ if ( tsources != null ) {
+ foreach ( string str in this.tsources ) {
+ string rpath = this.realpath ( str );
+ if ( str.has_suffix ( ".vala" ) )
+ this.sources.add ( str );
+ else
+ this.packages.add ( str );
+
+ to_doc.add ( rpath );
+ }
+ }
+
+ if ( tpackages != null ) {
+ foreach ( string str in this.tpackages ) {
+ this.packages.add ( str );
+ }
+ }
+
+ this.tpackages = null;
+ this.tsources = null;
+ return to_doc;
+ }
+
+
+
+ private void add_vapi ( ) {
+
+ }
+
+ private void add_source_file ( ) {
+
+ }
+
+ private int run ( ) {
+ var settings = new Valadoc.Settings ( );
+
+ settings.add_inherited = this.add_inherited;
+ settings.files = this.sort_sources ( );
+ settings._protected = this._protected;
+ settings.with_deps = this.with_deps;
+ settings._private = this._private;
+ settings.path = this.directory;
+
+
+ var context = new Vala.CodeContext();
+ context.library = this.library;
+ context.memory_management = false;
+ context.assert = false;
+ context.checking = false;
+ context.ccode_only = false;
+ context.compile_only = false;
+ context.output = null;
+
+ context.checking = !disable_checking;
+ context.non_null = !disable_non_null || non_null_experimental;
+ context.non_null_experimental = non_null_experimental;
+
+
+ if ( this.basedir != null ) {
+ context.basedir = realpath ( this.basedir );
+ }
+
+ if ( this.directory != null ) {
+ context.directory = realpath ( this.directory );
+ }
+ else {
+ context.directory = context.basedir;
+ }
+
+ context.optlevel = 0;
+ context.debug = false;
+ context.thread = false;
+ context.save_temps = false;
+
+
+ if ( this.packages != null ) {
+ foreach (string package in this.packages ) {
+ if (!add_package (context, package)) {
+ Report.error (null, "%s not found in specified Vala API directories".printf (package));
+ }
+ }
+ this.packages = null;
+ }
+
+ if (Report.get_errors () > 0) {
+ return quit ();
+ }
+
+
+ if ( this.sources != null ) {
+ this.add_files( context );
+ this.sources = null;
+ if (Report.get_errors () > 0) {
+ return quit ();
+ }
+ }
+
+ var parser = new Vala.Parser ();
+ parser.parse ( context );
+ if (Report.get_errors () > 0) {
+ return quit ();
+ }
+
+ var attributeprocessor = new AttributeProcessor ();
+ attributeprocessor.process( context );
+ if (Report.get_errors () > 0) {
+ return quit ();
+ }
+
+ var resolver = new SymbolResolver ();
+ resolver.resolve( context );
+ if (Report.get_errors () > 0) {
+ return quit ();
+ }
+
+ var analyzer = new SemanticAnalyzer ( );
+ analyzer.analyze( context );
+ if (Report.get_errors () > 0) {
+ return quit ();
+ }
+
+ if (context.non_null_experimental) {
+ var null_checker = new NullChecker ();
+ null_checker.check (context);
+
+ if (Report.get_errors () > 0) {
+ return quit ();
+ }
+ }
+
+ var err = new Valadoc.ErrorReporter ( );
+ var docparser = new Valadoc.Tree( settings, context, err );
+ docparser.create( );
+ if ( err.numbers > 0 ) {
+ err.print_errors ( );
+ return 1;
+ }
+
+ var doclet = new Valadoc.Doclet ( settings, err );
+ doclet.initialisation ( );
+ docparser.visit ( doclet );
+ return quit ();
+ }
+
+ static int main ( string[] args ) {
+ try {
+ var opt_context = new OptionContext ("- Vala Documentation Tool");
+ opt_context.set_help_enabled (true);
+ opt_context.add_main_entries (options, null);
+ opt_context.parse ( ref args);
+ }
+ catch (OptionError e) {
+ stdout.printf ("%s\n", e.message);
+ stdout.printf ("Run '%s --help' to see a full list of available command line options.\n", args[0]);
+ return 1;
+ }
+
+ if ( version ) {
+ stdout.printf ("Valadoc %s\n", "0.1" );
+ return 0;
+ }
+
+ if ( tsources == null ) {
+ stderr.printf ("No source file specified.\n");
+ return -1;
+ }
+
+ if ( directory == null ) {
+ stderr.printf ("No output directory specified.\n");
+ return -1;
+ }
+
+ if ( directory[ directory.len() - 1 ] != '/' ) {
+ directory += "/";
+ }
+
+ if ( !add_documentation ) {
+ if ( FileUtils.test ( directory, FileTest.EXISTS ) ) {
+ stderr.printf ("File already exists.\n");
+ return -1;
+ }
+ }
+
+ var valadoc = new ValaDoc( );
+ valadoc.run();
+ return 0;
+ }
+}
+
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]