bixbite 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- data/LICENSE +20 -0
- data/README.markdown +49 -0
- data/VERSION +1 -0
- data/bin/bixbite +73 -0
- data/lib/bixbite.rb +13 -0
- data/lib/bixbite/command.rb +14 -0
- data/lib/bixbite/create.rb +76 -0
- data/template/Rakefile +25 -0
- data/template/assets/bixbite/Rakefile.rb +297 -0
- data/template/assets/naturaldocs/NaturalDocs/Config/Languages.txt +286 -0
- data/template/assets/naturaldocs/NaturalDocs/Config/Topics.txt +382 -0
- data/template/assets/naturaldocs/NaturalDocs/Help/customizinglanguages.html +52 -0
- data/template/assets/naturaldocs/NaturalDocs/Help/customizingtopics.html +74 -0
- data/template/assets/naturaldocs/NaturalDocs/Help/documenting.html +58 -0
- data/template/assets/naturaldocs/NaturalDocs/Help/documenting/reference.html +146 -0
- data/template/assets/naturaldocs/NaturalDocs/Help/documenting/walkthrough.html +180 -0
- data/template/assets/naturaldocs/NaturalDocs/Help/example/Default.css +528 -0
- data/template/assets/naturaldocs/NaturalDocs/Help/example/NaturalDocs.js +204 -0
- data/template/assets/naturaldocs/NaturalDocs/Help/examples.css +90 -0
- data/template/assets/naturaldocs/NaturalDocs/Help/images/header/background.png +0 -0
- data/template/assets/naturaldocs/NaturalDocs/Help/images/header/leftside.png +0 -0
- data/template/assets/naturaldocs/NaturalDocs/Help/images/header/logo.png +0 -0
- data/template/assets/naturaldocs/NaturalDocs/Help/images/header/overbody.png +0 -0
- data/template/assets/naturaldocs/NaturalDocs/Help/images/header/overbodybg.png +0 -0
- data/template/assets/naturaldocs/NaturalDocs/Help/images/header/overleftmargin.png +0 -0
- data/template/assets/naturaldocs/NaturalDocs/Help/images/header/overmenu.png +0 -0
- data/template/assets/naturaldocs/NaturalDocs/Help/images/header/overmenubg.png +0 -0
- data/template/assets/naturaldocs/NaturalDocs/Help/images/header/rightside.png +0 -0
- data/template/assets/naturaldocs/NaturalDocs/Help/images/logo.gif +0 -0
- data/template/assets/naturaldocs/NaturalDocs/Help/images/menu/about.png +0 -0
- data/template/assets/naturaldocs/NaturalDocs/Help/images/menu/background.png +0 -0
- data/template/assets/naturaldocs/NaturalDocs/Help/images/menu/bottomleft.png +0 -0
- data/template/assets/naturaldocs/NaturalDocs/Help/images/menu/bottomright.png +0 -0
- data/template/assets/naturaldocs/NaturalDocs/Help/images/menu/community.png +0 -0
- data/template/assets/naturaldocs/NaturalDocs/Help/images/menu/customizing.png +0 -0
- data/template/assets/naturaldocs/NaturalDocs/Help/images/menu/using.png +0 -0
- data/template/assets/naturaldocs/NaturalDocs/Help/index.html +9 -0
- data/template/assets/naturaldocs/NaturalDocs/Help/javascript/BrowserStyles.js +77 -0
- data/template/assets/naturaldocs/NaturalDocs/Help/javascript/PNGHandling.js +72 -0
- data/template/assets/naturaldocs/NaturalDocs/Help/keywords.html +38 -0
- data/template/assets/naturaldocs/NaturalDocs/Help/languages.html +32 -0
- data/template/assets/naturaldocs/NaturalDocs/Help/menu.html +79 -0
- data/template/assets/naturaldocs/NaturalDocs/Help/output.html +84 -0
- data/template/assets/naturaldocs/NaturalDocs/Help/running.html +40 -0
- data/template/assets/naturaldocs/NaturalDocs/Help/styles.css +290 -0
- data/template/assets/naturaldocs/NaturalDocs/Help/styles.html +52 -0
- data/template/assets/naturaldocs/NaturalDocs/Help/troubleshooting.html +18 -0
- data/template/assets/naturaldocs/NaturalDocs/Info/CSSGuide.txt +947 -0
- data/template/assets/naturaldocs/NaturalDocs/Info/File Parsing.txt +83 -0
- data/template/assets/naturaldocs/NaturalDocs/Info/HTMLTestCases.pm +269 -0
- data/template/assets/naturaldocs/NaturalDocs/Info/Languages.txt +107 -0
- data/template/assets/naturaldocs/NaturalDocs/Info/NDMarkup.txt +91 -0
- data/template/assets/naturaldocs/NaturalDocs/Info/Symbol Management.txt +59 -0
- data/template/assets/naturaldocs/NaturalDocs/Info/images/Logo.png +0 -0
- data/template/assets/naturaldocs/NaturalDocs/JavaScript/NaturalDocs.js +836 -0
- data/template/assets/naturaldocs/NaturalDocs/License-GPL.txt +341 -0
- data/template/assets/naturaldocs/NaturalDocs/Modules/NaturalDocs/BinaryFile.pm +294 -0
- data/template/assets/naturaldocs/NaturalDocs/Modules/NaturalDocs/Builder.pm +280 -0
- data/template/assets/naturaldocs/NaturalDocs/Modules/NaturalDocs/Builder/Base.pm +348 -0
- data/template/assets/naturaldocs/NaturalDocs/Modules/NaturalDocs/Builder/FramedHTML.pm +345 -0
- data/template/assets/naturaldocs/NaturalDocs/Modules/NaturalDocs/Builder/HTML.pm +398 -0
- data/template/assets/naturaldocs/NaturalDocs/Modules/NaturalDocs/Builder/HTMLBase.pm +3693 -0
- data/template/assets/naturaldocs/NaturalDocs/Modules/NaturalDocs/ClassHierarchy.pm +860 -0
- data/template/assets/naturaldocs/NaturalDocs/Modules/NaturalDocs/ClassHierarchy/Class.pm +412 -0
- data/template/assets/naturaldocs/NaturalDocs/Modules/NaturalDocs/ClassHierarchy/File.pm +157 -0
- data/template/assets/naturaldocs/NaturalDocs/Modules/NaturalDocs/ConfigFile.pm +497 -0
- data/template/assets/naturaldocs/NaturalDocs/Modules/NaturalDocs/Constants.pm +165 -0
- data/template/assets/naturaldocs/NaturalDocs/Modules/NaturalDocs/DefineMembers.pm +100 -0
- data/template/assets/naturaldocs/NaturalDocs/Modules/NaturalDocs/Error.pm +305 -0
- data/template/assets/naturaldocs/NaturalDocs/Modules/NaturalDocs/File.pm +540 -0
- data/template/assets/naturaldocs/NaturalDocs/Modules/NaturalDocs/ImageReferenceTable.pm +383 -0
- data/template/assets/naturaldocs/NaturalDocs/Modules/NaturalDocs/ImageReferenceTable/Reference.pm +44 -0
- data/template/assets/naturaldocs/NaturalDocs/Modules/NaturalDocs/ImageReferenceTable/String.pm +110 -0
- data/template/assets/naturaldocs/NaturalDocs/Modules/NaturalDocs/Languages.pm +1475 -0
- data/template/assets/naturaldocs/NaturalDocs/Modules/NaturalDocs/Languages/ActionScript.pm +1473 -0
- data/template/assets/naturaldocs/NaturalDocs/Modules/NaturalDocs/Languages/Ada.pm +38 -0
- data/template/assets/naturaldocs/NaturalDocs/Modules/NaturalDocs/Languages/Advanced.pm +828 -0
- data/template/assets/naturaldocs/NaturalDocs/Modules/NaturalDocs/Languages/Advanced/Scope.pm +95 -0
- data/template/assets/naturaldocs/NaturalDocs/Modules/NaturalDocs/Languages/Advanced/ScopeChange.pm +70 -0
- data/template/assets/naturaldocs/NaturalDocs/Modules/NaturalDocs/Languages/Base.pm +832 -0
- data/template/assets/naturaldocs/NaturalDocs/Modules/NaturalDocs/Languages/CSharp.pm +1484 -0
- data/template/assets/naturaldocs/NaturalDocs/Modules/NaturalDocs/Languages/PLSQL.pm +319 -0
- data/template/assets/naturaldocs/NaturalDocs/Modules/NaturalDocs/Languages/Pascal.pm +143 -0
- data/template/assets/naturaldocs/NaturalDocs/Modules/NaturalDocs/Languages/Perl.pm +1370 -0
- data/template/assets/naturaldocs/NaturalDocs/Modules/NaturalDocs/Languages/Prototype.pm +92 -0
- data/template/assets/naturaldocs/NaturalDocs/Modules/NaturalDocs/Languages/Prototype/Parameter.pm +87 -0
- data/template/assets/naturaldocs/NaturalDocs/Modules/NaturalDocs/Languages/Simple.pm +503 -0
- data/template/assets/naturaldocs/NaturalDocs/Modules/NaturalDocs/Languages/Tcl.pm +219 -0
- data/template/assets/naturaldocs/NaturalDocs/Modules/NaturalDocs/Menu.pm +3406 -0
- data/template/assets/naturaldocs/NaturalDocs/Modules/NaturalDocs/Menu/Entry.pm +201 -0
- data/template/assets/naturaldocs/NaturalDocs/Modules/NaturalDocs/NDMarkup.pm +76 -0
- data/template/assets/naturaldocs/NaturalDocs/Modules/NaturalDocs/Parser.pm +1331 -0
- data/template/assets/naturaldocs/NaturalDocs/Modules/NaturalDocs/Parser/JavaDoc.pm +464 -0
- data/template/assets/naturaldocs/NaturalDocs/Modules/NaturalDocs/Parser/Native.pm +1060 -0
- data/template/assets/naturaldocs/NaturalDocs/Modules/NaturalDocs/Parser/ParsedTopic.pm +253 -0
- data/template/assets/naturaldocs/NaturalDocs/Modules/NaturalDocs/Project.pm +1402 -0
- data/template/assets/naturaldocs/NaturalDocs/Modules/NaturalDocs/Project/ImageFile.pm +160 -0
- data/template/assets/naturaldocs/NaturalDocs/Modules/NaturalDocs/Project/SourceFile.pm +113 -0
- data/template/assets/naturaldocs/NaturalDocs/Modules/NaturalDocs/ReferenceString.pm +334 -0
- data/template/assets/naturaldocs/NaturalDocs/Modules/NaturalDocs/Settings.pm +1418 -0
- data/template/assets/naturaldocs/NaturalDocs/Modules/NaturalDocs/Settings/BuildTarget.pm +66 -0
- data/template/assets/naturaldocs/NaturalDocs/Modules/NaturalDocs/SourceDB.pm +678 -0
- data/template/assets/naturaldocs/NaturalDocs/Modules/NaturalDocs/SourceDB/Extension.pm +84 -0
- data/template/assets/naturaldocs/NaturalDocs/Modules/NaturalDocs/SourceDB/File.pm +129 -0
- data/template/assets/naturaldocs/NaturalDocs/Modules/NaturalDocs/SourceDB/Item.pm +201 -0
- data/template/assets/naturaldocs/NaturalDocs/Modules/NaturalDocs/SourceDB/ItemDefinition.pm +45 -0
- data/template/assets/naturaldocs/NaturalDocs/Modules/NaturalDocs/SourceDB/WatchedFileDefinitions.pm +159 -0
- data/template/assets/naturaldocs/NaturalDocs/Modules/NaturalDocs/StatusMessage.pm +102 -0
- data/template/assets/naturaldocs/NaturalDocs/Modules/NaturalDocs/SymbolString.pm +212 -0
- data/template/assets/naturaldocs/NaturalDocs/Modules/NaturalDocs/SymbolTable.pm +1984 -0
- data/template/assets/naturaldocs/NaturalDocs/Modules/NaturalDocs/SymbolTable/File.pm +186 -0
- data/template/assets/naturaldocs/NaturalDocs/Modules/NaturalDocs/SymbolTable/IndexElement.pm +522 -0
- data/template/assets/naturaldocs/NaturalDocs/Modules/NaturalDocs/SymbolTable/Reference.pm +273 -0
- data/template/assets/naturaldocs/NaturalDocs/Modules/NaturalDocs/SymbolTable/ReferenceTarget.pm +97 -0
- data/template/assets/naturaldocs/NaturalDocs/Modules/NaturalDocs/SymbolTable/Symbol.pm +428 -0
- data/template/assets/naturaldocs/NaturalDocs/Modules/NaturalDocs/SymbolTable/SymbolDefinition.pm +96 -0
- data/template/assets/naturaldocs/NaturalDocs/Modules/NaturalDocs/Topics.pm +1319 -0
- data/template/assets/naturaldocs/NaturalDocs/Modules/NaturalDocs/Topics/Type.pm +151 -0
- data/template/assets/naturaldocs/NaturalDocs/Modules/NaturalDocs/Version.pm +384 -0
- data/template/assets/naturaldocs/NaturalDocs/NaturalDocs +400 -0
- data/template/assets/naturaldocs/NaturalDocs/NaturalDocs.bat +17 -0
- data/template/assets/naturaldocs/NaturalDocs/Styles/Default.css +767 -0
- data/template/assets/naturaldocs/NaturalDocs/Styles/Roman.css +765 -0
- data/template/assets/naturaldocs/NaturalDocs/Styles/Small.css +763 -0
- data/template/assets/utilities/pngout +0 -0
- data/template/deploy/public_html/.htaccess +0 -0
- data/template/documentation/js/.htaccess +0 -0
- data/template/src/html/.htaccess +76 -0
- data/template/src/html/css/cmn/global.css +96 -0
- data/template/src/html/css/cmn/ie.css +15 -0
- data/template/src/html/css/cmn/ie6.css +15 -0
- data/template/src/html/images/cmn/.htaccess +0 -0
- data/template/src/html/images/tmp/.htaccess +0 -0
- data/template/src/html/includes/debug.inc +5 -0
- data/template/src/html/includes/footer.inc +52 -0
- data/template/src/html/includes/header.inc +61 -0
- data/template/src/html/includes/html.inc +3 -0
- data/template/src/html/includes/namespace.inc +19 -0
- data/template/src/html/includes/page.inc +151 -0
- data/template/src/html/index.html +35 -0
- data/template/src/html/js/cmn/bootstrap.js +74 -0
- data/template/src/html/js/cmn/global.js +142 -0
- data/template/src/html/js/cmn/lib/LAB.js +348 -0
- data/template/src/html/min/.htaccess +4 -0
- data/template/src/html/min/MinifyCLI.php +19 -0
- data/template/src/html/min/README.txt +132 -0
- data/template/src/html/min/builder/_index.js +242 -0
- data/template/src/html/min/builder/bm.js +36 -0
- data/template/src/html/min/builder/index.php +182 -0
- data/template/src/html/min/builder/ocCheck.php +36 -0
- data/template/src/html/min/builder/rewriteTest.js +1 -0
- data/template/src/html/min/config.php +187 -0
- data/template/src/html/min/groupsConfig.php +34 -0
- data/template/src/html/min/index.php +66 -0
- data/template/src/html/min/lib/FirePHP.php +1370 -0
- data/template/src/html/min/lib/HTTP/ConditionalGet.php +348 -0
- data/template/src/html/min/lib/HTTP/Encoder.php +326 -0
- data/template/src/html/min/lib/JSMin.php +314 -0
- data/template/src/html/min/lib/JSMinPlus.php +1872 -0
- data/template/src/html/min/lib/Minify.php +532 -0
- data/template/src/html/min/lib/Minify/Build.php +103 -0
- data/template/src/html/min/lib/Minify/CSS.php +83 -0
- data/template/src/html/min/lib/Minify/CSS/Compressor.php +250 -0
- data/template/src/html/min/lib/Minify/CSS/UriRewriter.php +270 -0
- data/template/src/html/min/lib/Minify/Cache/APC.php +130 -0
- data/template/src/html/min/lib/Minify/Cache/File.php +125 -0
- data/template/src/html/min/lib/Minify/Cache/Memcache.php +137 -0
- data/template/src/html/min/lib/Minify/ClosureCompiler.php +85 -0
- data/template/src/html/min/lib/Minify/CommentPreserver.php +90 -0
- data/template/src/html/min/lib/Minify/Controller/Base.php +202 -0
- data/template/src/html/min/lib/Minify/Controller/Files.php +78 -0
- data/template/src/html/min/lib/Minify/Controller/Groups.php +94 -0
- data/template/src/html/min/lib/Minify/Controller/MinApp.php +132 -0
- data/template/src/html/min/lib/Minify/Controller/Page.php +82 -0
- data/template/src/html/min/lib/Minify/Controller/Version1.php +118 -0
- data/template/src/html/min/lib/Minify/HTML.php +245 -0
- data/template/src/html/min/lib/Minify/ImportProcessor.php +157 -0
- data/template/src/html/min/lib/Minify/Lines.php +131 -0
- data/template/src/html/min/lib/Minify/Logger.php +45 -0
- data/template/src/html/min/lib/Minify/Packer.php +37 -0
- data/template/src/html/min/lib/Minify/Source.php +187 -0
- data/template/src/html/min/lib/Minify/YUICompressor.php +139 -0
- data/template/src/html/min/lib/Solar/Dir.php +199 -0
- data/template/src/html/min/lib/closure-compiler.jar +0 -0
- data/template/src/html/min/lib/yuicompressor-2.4.2.jar +0 -0
- data/template/src/html/min/utils.php +90 -0
- data/template/src/templates/css/template.css +7 -0
- data/template/src/templates/js/template.js +72 -0
- data/template/src/templates/template.html +18 -0
- data/template/src/yaml/config.yml +46 -0
- data/template/src/yaml/deploy.yml +35 -0
- data/test/bixbite_test.rb +7 -0
- data/test/test_helper.rb +10 -0
- metadata +278 -0
@@ -0,0 +1,160 @@
|
|
1
|
+
###############################################################################
|
2
|
+
#
|
3
|
+
# Class: NaturalDocs::Project::ImageFile
|
4
|
+
#
|
5
|
+
###############################################################################
|
6
|
+
#
|
7
|
+
# A simple information class about project image files.
|
8
|
+
#
|
9
|
+
###############################################################################
|
10
|
+
|
11
|
+
# This file is part of Natural Docs, which is Copyright (C) 2003-2008 Greg Valure
|
12
|
+
# Natural Docs is licensed under the GPL
|
13
|
+
|
14
|
+
use strict;
|
15
|
+
use integer;
|
16
|
+
|
17
|
+
package NaturalDocs::Project::ImageFile;
|
18
|
+
|
19
|
+
|
20
|
+
|
21
|
+
###############################################################################
|
22
|
+
# Group: Implementation
|
23
|
+
|
24
|
+
#
|
25
|
+
# Constants: Members
|
26
|
+
#
|
27
|
+
# The class is implemented as a blessed arrayref. The following constants are used as indexes.
|
28
|
+
#
|
29
|
+
# LAST_MODIFIED - The integer timestamp of when the file was last modified.
|
30
|
+
# STATUS - <FileStatus> since the last build.
|
31
|
+
# REFERENCE_COUNT - The number of references to the image from the source files.
|
32
|
+
# WAS_USED - Whether the image was used the last time Natural Docs was run.
|
33
|
+
# WIDTH - The image width. Undef if can't be determined, -1 if haven't attempted to determine yet.
|
34
|
+
# HEIGHT - The image height. Undef if can't be determined, -1 if haven't attempted to determine yet.
|
35
|
+
#
|
36
|
+
|
37
|
+
use NaturalDocs::DefineMembers 'LAST_MODIFIED', 'LastModified()', 'SetLastModified()',
|
38
|
+
'STATUS', 'Status()', 'SetStatus()',
|
39
|
+
'REFERENCE_COUNT', 'ReferenceCount()',
|
40
|
+
'WAS_USED', 'WasUsed()', 'SetWasUsed()',
|
41
|
+
'WIDTH', 'Width()',
|
42
|
+
'HEIGHT', 'Height()';
|
43
|
+
|
44
|
+
|
45
|
+
#
|
46
|
+
# Topic: WasUsed versus References
|
47
|
+
#
|
48
|
+
# <WasUsed()> is a simple true/false that notes whether this image file was used the last time Natural Docs was run.
|
49
|
+
# <ReferenceCount()> is a counter for the number of times it's used *this* run. As such, it starts at zero regardless of whether
|
50
|
+
# <WasUsed()> is set or not.
|
51
|
+
#
|
52
|
+
|
53
|
+
|
54
|
+
###############################################################################
|
55
|
+
# Group: Functions
|
56
|
+
|
57
|
+
#
|
58
|
+
# Function: New
|
59
|
+
#
|
60
|
+
# Creates and returns a new file object.
|
61
|
+
#
|
62
|
+
# Parameters:
|
63
|
+
#
|
64
|
+
# lastModified - The image file's last modification timestamp
|
65
|
+
# status - The <FileStatus>.
|
66
|
+
# wasUsed - Whether this image file was used the *last* time Natural Docs was run.
|
67
|
+
#
|
68
|
+
sub New #(timestamp lastModified, FileStatus status, bool wasUsed)
|
69
|
+
{
|
70
|
+
my ($package, $lastModified, $status, $width, $height, $wasUsed) = @_;
|
71
|
+
|
72
|
+
my $object = [ ];
|
73
|
+
$object->[LAST_MODIFIED] = $lastModified;
|
74
|
+
$object->[STATUS] = $status;
|
75
|
+
$object->[REFERENCE_COUNT] = 0;
|
76
|
+
$object->[WAS_USED] = $wasUsed;
|
77
|
+
$object->[WIDTH] = -1;
|
78
|
+
$object->[HEIGHT] = -1;
|
79
|
+
|
80
|
+
bless $object, $package;
|
81
|
+
|
82
|
+
return $object;
|
83
|
+
};
|
84
|
+
|
85
|
+
|
86
|
+
#
|
87
|
+
# Functions: Member Functions
|
88
|
+
#
|
89
|
+
# LastModified - Returns the integer timestamp of when the file was last modified.
|
90
|
+
# SetLastModified - Sets the file's last modification timestamp.
|
91
|
+
# Status - Returns the <FileStatus> since the last build.
|
92
|
+
# SetStatus - Sets the <FileStatus> since the last build.
|
93
|
+
#
|
94
|
+
|
95
|
+
#
|
96
|
+
# Function: ReferenceCount
|
97
|
+
# Returns the current number of references to this image file during *this* Natural Docs execution.
|
98
|
+
#
|
99
|
+
|
100
|
+
#
|
101
|
+
# Function: AddReference
|
102
|
+
# Increases the number of references to this image file by one. Returns the new reference count.
|
103
|
+
#
|
104
|
+
sub AddReference
|
105
|
+
{
|
106
|
+
my $self = shift;
|
107
|
+
|
108
|
+
$self->[REFERENCE_COUNT]++;
|
109
|
+
return $self->[REFERENCE_COUNT];
|
110
|
+
};
|
111
|
+
|
112
|
+
#
|
113
|
+
# Function: DeleteReference
|
114
|
+
# Decreases the number of references to this image file by one. Returns the new reference count.
|
115
|
+
#
|
116
|
+
sub DeleteReference
|
117
|
+
{
|
118
|
+
my $self = shift;
|
119
|
+
$self->[REFERENCE_COUNT]--;
|
120
|
+
|
121
|
+
if ($self->[REFERENCE_COUNT] < 0)
|
122
|
+
{ die "Deleted more references to an image file than existed."; };
|
123
|
+
|
124
|
+
return $self->[REFERENCE_COUNT];
|
125
|
+
};
|
126
|
+
|
127
|
+
|
128
|
+
#
|
129
|
+
# Functions: Member Functions
|
130
|
+
#
|
131
|
+
# WasUsed - Returns whether this image file was used during the *last* Natural Docs execution.
|
132
|
+
# SetWasUsed - Sets whether this image file was used during the *last* Natural Docs execution.
|
133
|
+
# Width - Returns the width in pixels, undef if it can't be determined, and -1 if determination hasn't been attempted yet.
|
134
|
+
# Height - Returns the width in pixels, undef if it can't be determined, and -1 if determination hasn't been attempted yet.
|
135
|
+
#
|
136
|
+
|
137
|
+
|
138
|
+
#
|
139
|
+
# Function: SetDimensions
|
140
|
+
# Sets the width and height of the image. Set to undef if they can't be determined.
|
141
|
+
#
|
142
|
+
sub SetDimensions #(int width, int height)
|
143
|
+
{
|
144
|
+
my ($self, $width, $height) = @_;
|
145
|
+
|
146
|
+
# If either are undef, both should be undef. This will also convert zeroes to undef.
|
147
|
+
if (!$width || !$height)
|
148
|
+
{
|
149
|
+
$self->[WIDTH] = undef;
|
150
|
+
$self->[HEIGHT] = undef;
|
151
|
+
}
|
152
|
+
else
|
153
|
+
{
|
154
|
+
$self->[WIDTH] = $width;
|
155
|
+
$self->[HEIGHT] = $height;
|
156
|
+
};
|
157
|
+
};
|
158
|
+
|
159
|
+
|
160
|
+
1;
|
@@ -0,0 +1,113 @@
|
|
1
|
+
###############################################################################
|
2
|
+
#
|
3
|
+
# Class: NaturalDocs::Project::SourceFile
|
4
|
+
#
|
5
|
+
###############################################################################
|
6
|
+
#
|
7
|
+
# A simple information class about project files.
|
8
|
+
#
|
9
|
+
###############################################################################
|
10
|
+
|
11
|
+
# This file is part of Natural Docs, which is Copyright (C) 2003-2008 Greg Valure
|
12
|
+
# Natural Docs is licensed under the GPL
|
13
|
+
|
14
|
+
use strict;
|
15
|
+
use integer;
|
16
|
+
|
17
|
+
package NaturalDocs::Project::SourceFile;
|
18
|
+
|
19
|
+
|
20
|
+
|
21
|
+
###############################################################################
|
22
|
+
# Group: Implementation
|
23
|
+
|
24
|
+
#
|
25
|
+
# Constants: Members
|
26
|
+
#
|
27
|
+
# The class is implemented as a blessed arrayref. The following constants are used as indexes.
|
28
|
+
#
|
29
|
+
# HAS_CONTENT - Whether the file contains Natural Docs content or not.
|
30
|
+
# LAST_MODIFIED - The integer timestamp of when the file was last modified.
|
31
|
+
# STATUS - <FileStatus> since the last build.
|
32
|
+
# DEFAULT_MENU_TITLE - The file's default title in the menu.
|
33
|
+
#
|
34
|
+
|
35
|
+
# DEPENDENCY: New() depends on its parameter list being in the same order as these constants. If the order changes, New()
|
36
|
+
# needs to be changed.
|
37
|
+
use NaturalDocs::DefineMembers 'HAS_CONTENT', 'LAST_MODIFIED', 'STATUS', 'DEFAULT_MENU_TITLE';
|
38
|
+
|
39
|
+
|
40
|
+
###############################################################################
|
41
|
+
# Group: Functions
|
42
|
+
|
43
|
+
#
|
44
|
+
# Function: New
|
45
|
+
#
|
46
|
+
# Creates and returns a new file object.
|
47
|
+
#
|
48
|
+
# Parameters:
|
49
|
+
#
|
50
|
+
# hasContent - Whether the file contains Natural Docs content or not.
|
51
|
+
# lastModified - The integer timestamp of when the file was last modified.
|
52
|
+
# status - The <FileStatus> since the last build.
|
53
|
+
# defaultMenuTitle - The file's title in the menu.
|
54
|
+
#
|
55
|
+
# Returns:
|
56
|
+
#
|
57
|
+
# A reference to the new object.
|
58
|
+
#
|
59
|
+
sub New #(hasContent, lastModified, status, defaultMenuTitle)
|
60
|
+
{
|
61
|
+
# DEPENDENCY: This function depends on its parameter list being in the same order as the member constants. If either order
|
62
|
+
# changes, this function needs to be changed.
|
63
|
+
|
64
|
+
my $package = shift;
|
65
|
+
|
66
|
+
my $object = [ @_ ];
|
67
|
+
bless $object, $package;
|
68
|
+
|
69
|
+
return $object;
|
70
|
+
};
|
71
|
+
|
72
|
+
# Function: HasContent
|
73
|
+
# Returns whether the file contains Natural Docs content or not.
|
74
|
+
sub HasContent
|
75
|
+
{ return $_[0]->[HAS_CONTENT]; };
|
76
|
+
|
77
|
+
# Function: SetHasContent
|
78
|
+
# Sets whether the file contains Natural Docs content or not.
|
79
|
+
sub SetHasContent #(hasContent)
|
80
|
+
{ $_[0]->[HAS_CONTENT] = $_[1]; };
|
81
|
+
|
82
|
+
# Function: LastModified
|
83
|
+
# Returns the integer timestamp of when the file was last modified.
|
84
|
+
sub LastModified
|
85
|
+
{ return $_[0]->[LAST_MODIFIED]; };
|
86
|
+
|
87
|
+
# Function: SetLastModified
|
88
|
+
# Sets the file's last modification timestamp.
|
89
|
+
sub SetLastModified #(lastModified)
|
90
|
+
{ $_[0]->[LAST_MODIFIED] = $_[1]; };
|
91
|
+
|
92
|
+
# Function: Status
|
93
|
+
# Returns the <FileStatus> since the last build.
|
94
|
+
sub Status
|
95
|
+
{ return $_[0]->[STATUS]; };
|
96
|
+
|
97
|
+
# Function: SetStatus
|
98
|
+
# Sets the <FileStatus> since the last build.
|
99
|
+
sub SetStatus #(status)
|
100
|
+
{ $_[0]->[STATUS] = $_[1]; };
|
101
|
+
|
102
|
+
# Function: DefaultMenuTitle
|
103
|
+
# Returns the file's default title on the menu.
|
104
|
+
sub DefaultMenuTitle
|
105
|
+
{ return $_[0]->[DEFAULT_MENU_TITLE]; };
|
106
|
+
|
107
|
+
# Function: SetDefaultMenuTitle
|
108
|
+
# Sets the file's default title on the menu.
|
109
|
+
sub SetDefaultMenuTitle #(menuTitle)
|
110
|
+
{ $_[0]->[DEFAULT_MENU_TITLE] = $_[1]; };
|
111
|
+
|
112
|
+
|
113
|
+
1;
|
@@ -0,0 +1,334 @@
|
|
1
|
+
###############################################################################
|
2
|
+
#
|
3
|
+
# Package: NaturalDocs::ReferenceString
|
4
|
+
#
|
5
|
+
###############################################################################
|
6
|
+
#
|
7
|
+
# A package to manage <ReferenceString> handling throughout the program.
|
8
|
+
#
|
9
|
+
###############################################################################
|
10
|
+
|
11
|
+
# This file is part of Natural Docs, which is Copyright (C) 2003-2008 Greg Valure
|
12
|
+
# Natural Docs is licensed under the GPL
|
13
|
+
|
14
|
+
use strict;
|
15
|
+
use integer;
|
16
|
+
|
17
|
+
package NaturalDocs::ReferenceString;
|
18
|
+
|
19
|
+
use vars '@ISA', '@EXPORT';
|
20
|
+
@ISA = 'Exporter';
|
21
|
+
@EXPORT = ( 'BINARYREF_NOTYPE', 'BINARYREF_NORESOLVINGFLAGS',
|
22
|
+
|
23
|
+
'REFERENCE_TEXT', 'REFERENCE_CH_CLASS', 'REFERENCE_CH_PARENT',
|
24
|
+
|
25
|
+
'RESOLVE_RELATIVE', 'RESOLVE_ABSOLUTE', 'RESOLVE_NOPLURAL', 'RESOLVE_NOUSING' );
|
26
|
+
|
27
|
+
|
28
|
+
#
|
29
|
+
# Constants: Binary Format Flags
|
30
|
+
#
|
31
|
+
# These flags can be combined to specify the format when using <ToBinaryFile()> and <FromBinaryFile()>. All are exported
|
32
|
+
# by default.
|
33
|
+
#
|
34
|
+
# BINARYREF_NOTYPE - Do not include the <ReferenceType>.
|
35
|
+
# BINARYREF_NORESOLVEFLAGS - Do not include the <Resolving Flags>.
|
36
|
+
#
|
37
|
+
use constant BINARYREF_NOTYPE => 0x01;
|
38
|
+
use constant BINARYREF_NORESOLVINGFLAGS => 0x02;
|
39
|
+
|
40
|
+
|
41
|
+
#
|
42
|
+
# Constants: ReferenceType
|
43
|
+
#
|
44
|
+
# The type of a reference.
|
45
|
+
#
|
46
|
+
# REFERENCE_TEXT - The reference appears in the text of the documentation.
|
47
|
+
# REFERENCE_CH_CLASS - A class reference handled by <NaturalDocs::ClassHierarchy>.
|
48
|
+
# REFERENCE_CH_PARENT - A parent class reference handled by <NaturalDocs::ClassHierarchy>.
|
49
|
+
#
|
50
|
+
# Dependencies:
|
51
|
+
#
|
52
|
+
# - <ToBinaryFile()> and <FromBinaryFile()> require that these values fit into a UInt8, i.e. are <= 255.
|
53
|
+
#
|
54
|
+
use constant REFERENCE_TEXT => 1;
|
55
|
+
use constant REFERENCE_CH_CLASS => 2;
|
56
|
+
use constant REFERENCE_CH_PARENT => 3;
|
57
|
+
|
58
|
+
|
59
|
+
#
|
60
|
+
# Constants: Resolving Flags
|
61
|
+
#
|
62
|
+
# Used to influence the method of resolving references in <NaturalDocs::SymbolTable>.
|
63
|
+
#
|
64
|
+
# RESOLVE_RELATIVE - The reference text is truly relative, rather than Natural Docs' semi-relative.
|
65
|
+
# RESOLVE_ABSOLUTE - The reference text is always absolute. No local or relative references.
|
66
|
+
# RESOLVE_NOPLURAL - The reference text may not be interpreted as a plural, and thus match singular forms as well.
|
67
|
+
# RESOLVE_NOUSING - The reference text may not include "using" statements when being resolved.
|
68
|
+
#
|
69
|
+
# If neither <RESOLVE_RELATIVE> or <RESOLVE_ABSOLUTE> is specified, Natural Docs' semi-relative kicks in instead,
|
70
|
+
# which is where links are interpreted as local, then global, then relative. <RESOLVE_RELATIVE> states that links are
|
71
|
+
# local, then relative, then global.
|
72
|
+
#
|
73
|
+
# Dependencies:
|
74
|
+
#
|
75
|
+
# - <ToBinaryFile()> and <FromBinaryFile()> require that these values fit into a UInt8, i.e. are <= 255.
|
76
|
+
#
|
77
|
+
use constant RESOLVE_RELATIVE => 0x01;
|
78
|
+
use constant RESOLVE_ABSOLUTE => 0x02;
|
79
|
+
use constant RESOLVE_NOPLURAL => 0x04;
|
80
|
+
use constant RESOLVE_NOUSING => 0x08;
|
81
|
+
|
82
|
+
|
83
|
+
#
|
84
|
+
#
|
85
|
+
# Function: MakeFrom
|
86
|
+
#
|
87
|
+
# Encodes the passed information as a <ReferenceString>. The format of the string should be treated as opaque. However, the
|
88
|
+
# characteristic you can rely on is that the same string will always be made from the same parameters, and thus it's suitable
|
89
|
+
# for comparison and use as hash keys.
|
90
|
+
#
|
91
|
+
# Parameters:
|
92
|
+
#
|
93
|
+
# type - The <ReferenceType>.
|
94
|
+
# symbol - The <SymbolString> of the reference.
|
95
|
+
# language - The name of the language that defines the file this reference appears in.
|
96
|
+
# scope - The scope <SymbolString> the reference appears in, or undef if none.
|
97
|
+
# using - An arrayref of scope <SymbolStrings> that are also available for checking due to the equivalent a "using" statement,
|
98
|
+
# or undef if none.
|
99
|
+
# resolvingFlags - The <Resolving Flags> to use with this reference. They are ignored if the type is <REFERENCE_TEXT>.
|
100
|
+
#
|
101
|
+
# Returns:
|
102
|
+
#
|
103
|
+
# The encoded <ReferenceString>.
|
104
|
+
#
|
105
|
+
sub MakeFrom #(ReferenceType type, SymbolString symbol, string language, SymbolString scope, SymbolString[]* using, flags resolvingFlags)
|
106
|
+
{
|
107
|
+
my ($self, $type, $symbol, $language, $scope, $using, $resolvingFlags) = @_;
|
108
|
+
|
109
|
+
if ($type == ::REFERENCE_TEXT() || $resolvingFlags == 0)
|
110
|
+
{ $resolvingFlags = undef; };
|
111
|
+
|
112
|
+
# The format is [type] 0x1E [resolving flags] 0x1E [symbol] 0x1E [scope] ( 0x1E [using] )*
|
113
|
+
# If there is no scope and/or using, the separator characters still remain.
|
114
|
+
|
115
|
+
# DEPENDENCY: SymbolString->FromText() removed all 0x1E characters.
|
116
|
+
# DEPENDENCY: SymbolString->FromText() doesn't use 0x1E characters in its encoding.
|
117
|
+
|
118
|
+
my $string = $type . "\x1E" . $symbol . "\x1E" . $language . "\x1E" . $resolvingFlags . "\x1E";
|
119
|
+
|
120
|
+
if (defined $scope)
|
121
|
+
{
|
122
|
+
$string .= $scope;
|
123
|
+
};
|
124
|
+
|
125
|
+
$string .= "\x1E";
|
126
|
+
|
127
|
+
if (defined $using)
|
128
|
+
{
|
129
|
+
$string .= join("\x1E", @$using);
|
130
|
+
};
|
131
|
+
|
132
|
+
return $string;
|
133
|
+
};
|
134
|
+
|
135
|
+
|
136
|
+
#
|
137
|
+
# Function: ToBinaryFile
|
138
|
+
#
|
139
|
+
# Writes a <ReferenceString> to the passed filehandle. Can also encode an undef.
|
140
|
+
#
|
141
|
+
# Parameters:
|
142
|
+
#
|
143
|
+
# fileHandle - The filehandle to write to.
|
144
|
+
# referenceString - The <ReferenceString> to write, or undef.
|
145
|
+
# binaryFormatFlags - Any <Binary Format Flags> you want to use to influence encoding.
|
146
|
+
#
|
147
|
+
# Format:
|
148
|
+
#
|
149
|
+
# > [SymbolString: Symbol or undef for an undef reference]
|
150
|
+
# > [AString16: language]
|
151
|
+
# > [SymbolString: Scope or undef for none]
|
152
|
+
# >
|
153
|
+
# > [SymbolString: Using or undef for none]
|
154
|
+
# > [SymbolString: Using or undef for no more]
|
155
|
+
# > ...
|
156
|
+
# >
|
157
|
+
# > [UInt8: Type unless BINARYREF_NOTYPE is set]
|
158
|
+
# > [UInt8: Resolving Flags unless BINARYREF_NORESOLVINGFLAGS is set]
|
159
|
+
#
|
160
|
+
# Dependencies:
|
161
|
+
#
|
162
|
+
# - <ReferenceTypes> must fit into a UInt8. All values must be <= 255.
|
163
|
+
# - All <Resolving Flags> must fit into a UInt8. All values must be <= 255.
|
164
|
+
#
|
165
|
+
sub ToBinaryFile #(FileHandle fileHandle, ReferenceString referenceString, flags binaryFormatFlags)
|
166
|
+
{
|
167
|
+
my ($self, $fileHandle, $referenceString, $binaryFormatFlags) = @_;
|
168
|
+
|
169
|
+
my ($type, $symbol, $language, $scope, $using, $resolvingFlags) = $self->InformationOf($referenceString);
|
170
|
+
|
171
|
+
# [SymbolString: Symbol or undef for an undef reference]
|
172
|
+
|
173
|
+
NaturalDocs::SymbolString->ToBinaryFile($fileHandle, $symbol);
|
174
|
+
|
175
|
+
# [AString16: language]
|
176
|
+
|
177
|
+
print $fileHandle pack('nA*', length $language, $language);
|
178
|
+
|
179
|
+
# [SymbolString: scope or undef if none]
|
180
|
+
|
181
|
+
NaturalDocs::SymbolString->ToBinaryFile($fileHandle, $scope);
|
182
|
+
|
183
|
+
# [SymbolString: using or undef if none/no more] ...
|
184
|
+
|
185
|
+
if (defined $using)
|
186
|
+
{
|
187
|
+
foreach my $usingScope (@$using)
|
188
|
+
{ NaturalDocs::SymbolString->ToBinaryFile($fileHandle, $usingScope); };
|
189
|
+
};
|
190
|
+
|
191
|
+
NaturalDocs::SymbolString->ToBinaryFile($fileHandle, undef);
|
192
|
+
|
193
|
+
# [UInt8: Type unless BINARYREF_NOTYPE is set]
|
194
|
+
|
195
|
+
if (!($binaryFormatFlags & BINARYREF_NOTYPE))
|
196
|
+
{ print $fileHandle pack('C', $type); };
|
197
|
+
|
198
|
+
# [UInt8: Resolving Flags unless BINARYREF_NORESOLVINGFLAGS is set]
|
199
|
+
|
200
|
+
if (!($binaryFormatFlags & BINARYREF_NORESOLVINGFLAGS))
|
201
|
+
{ print $fileHandle pack('C', $type); };
|
202
|
+
};
|
203
|
+
|
204
|
+
|
205
|
+
#
|
206
|
+
# Function: FromBinaryFile
|
207
|
+
#
|
208
|
+
# Reads a <ReferenceString> or undef from the passed filehandle.
|
209
|
+
#
|
210
|
+
# Parameters:
|
211
|
+
#
|
212
|
+
# fileHandle - The filehandle to read from.
|
213
|
+
# binaryFormatFlags - Any <Binary Format Flags> you want to use to influence decoding.
|
214
|
+
# type - The <ReferenceType> to use if <BINARYREF_NOTYPE> is set.
|
215
|
+
# resolvingFlags - The <Resolving Flags> to use if <BINARYREF_NORESOLVINGFLAGS> is set.
|
216
|
+
#
|
217
|
+
# Returns:
|
218
|
+
#
|
219
|
+
# The <ReferenceString> or undef.
|
220
|
+
#
|
221
|
+
# See Also:
|
222
|
+
#
|
223
|
+
# See <ToBinaryFile()> for format and dependencies.
|
224
|
+
#
|
225
|
+
sub FromBinaryFile #(FileHandle fileHandle, flags binaryFormatFlags, ReferenceType type, flags resolvingFlags)
|
226
|
+
{
|
227
|
+
my ($self, $fileHandle, $binaryFormatFlags, $type, $resolvingFlags) = @_;
|
228
|
+
my $raw;
|
229
|
+
|
230
|
+
# [SymbolString: Symbol or undef for an undef reference]
|
231
|
+
|
232
|
+
my $symbol = NaturalDocs::SymbolString->FromBinaryFile($fileHandle);
|
233
|
+
|
234
|
+
if (!defined $symbol)
|
235
|
+
{ return undef; };
|
236
|
+
|
237
|
+
|
238
|
+
# [AString16: language]
|
239
|
+
|
240
|
+
read($fileHandle, $raw, 2);
|
241
|
+
my $languageLength = unpack('n', $raw);
|
242
|
+
|
243
|
+
my $language;
|
244
|
+
read($fileHandle, $language, $languageLength);
|
245
|
+
|
246
|
+
|
247
|
+
# [SymbolString: scope or undef if none]
|
248
|
+
|
249
|
+
my $scope = NaturalDocs::SymbolString->FromBinaryFile($fileHandle);
|
250
|
+
|
251
|
+
# [SymbolString: using or undef if none/no more] ...
|
252
|
+
|
253
|
+
my $usingSymbol;
|
254
|
+
my @using;
|
255
|
+
|
256
|
+
while ($usingSymbol = NaturalDocs::SymbolString->FromBinaryFile($fileHandle))
|
257
|
+
{ push @using, $usingSymbol; };
|
258
|
+
|
259
|
+
if (scalar @using)
|
260
|
+
{ $usingSymbol = \@using; }
|
261
|
+
else
|
262
|
+
{ $usingSymbol = undef; };
|
263
|
+
|
264
|
+
# [UInt8: Type unless BINARYREF_NOTYPE is set]
|
265
|
+
|
266
|
+
if (!($binaryFormatFlags & BINARYREF_NOTYPE))
|
267
|
+
{
|
268
|
+
my $raw;
|
269
|
+
read($fileHandle, $raw, 1);
|
270
|
+
$type = unpack('C', $raw);
|
271
|
+
};
|
272
|
+
|
273
|
+
# [UInt8: Resolving Flags unless BINARYREF_NORESOLVINGFLAGS is set]
|
274
|
+
|
275
|
+
if (!($binaryFormatFlags & BINARYREF_NORESOLVINGFLAGS))
|
276
|
+
{
|
277
|
+
my $raw;
|
278
|
+
read($fileHandle, $raw, 1);
|
279
|
+
$resolvingFlags = unpack('C', $raw);
|
280
|
+
};
|
281
|
+
|
282
|
+
return $self->MakeFrom($type, $symbol, $language, $scope, $usingSymbol, $resolvingFlags);
|
283
|
+
};
|
284
|
+
|
285
|
+
|
286
|
+
#
|
287
|
+
# Function: InformationOf
|
288
|
+
#
|
289
|
+
# Returns the information encoded in a <ReferenceString>.
|
290
|
+
#
|
291
|
+
# Parameters:
|
292
|
+
#
|
293
|
+
# referenceString - The <ReferenceString> to decode.
|
294
|
+
#
|
295
|
+
# Returns:
|
296
|
+
#
|
297
|
+
# The array ( type, symbol, language, scope, using, resolvingFlags ).
|
298
|
+
#
|
299
|
+
# type - The <ReferenceType>.
|
300
|
+
# symbol - The <SymbolString>.
|
301
|
+
# language - The name of the language that defined the file the reference was defined in.
|
302
|
+
# scope - The scope <SymbolString>, or undef if none.
|
303
|
+
# using - An arrayref of scope <SymbolStrings> that the reference also has access to via "using" statements, or undef if none.
|
304
|
+
# resolvingFlags - The <Resolving Flags> of the reference.
|
305
|
+
#
|
306
|
+
sub InformationOf #(ReferenceString referenceString)
|
307
|
+
{
|
308
|
+
my ($self, $referenceString) = @_;
|
309
|
+
|
310
|
+
my ($type, $symbolString, $language, $resolvingFlags, $scopeString, @usingStrings) = split(/\x1E/, $referenceString);
|
311
|
+
|
312
|
+
if (!length $resolvingFlags)
|
313
|
+
{ $resolvingFlags = undef; };
|
314
|
+
|
315
|
+
return ( $type, $symbolString, $language, $scopeString, [ @usingStrings ], $resolvingFlags );
|
316
|
+
};
|
317
|
+
|
318
|
+
|
319
|
+
#
|
320
|
+
# Function: TypeOf
|
321
|
+
#
|
322
|
+
# Returns the <ReferenceType> encoded in the reference string. This is faster than <InformationOf()> if this is
|
323
|
+
# the only information you need.
|
324
|
+
#
|
325
|
+
sub TypeOf #(ReferenceString referenceString)
|
326
|
+
{
|
327
|
+
my ($self, $referenceString) = @_;
|
328
|
+
|
329
|
+
$referenceString =~ /^([^\x1E]+)/;
|
330
|
+
return $1;
|
331
|
+
};
|
332
|
+
|
333
|
+
|
334
|
+
1;
|