1 | package CFPlus::Pod; |
1 | package DC::Pod; |
2 | |
2 | |
3 | use strict; |
3 | use strict; |
4 | use utf8; |
4 | use utf8; |
5 | |
5 | |
6 | use Storable; |
6 | use Storable; |
… | |
… | |
12 | |
12 | |
13 | my $MA_BEG = "\x{fcd0}"; |
13 | my $MA_BEG = "\x{fcd0}"; |
14 | my $MA_SEP = "\x{fcd1}"; |
14 | my $MA_SEP = "\x{fcd1}"; |
15 | my $MA_END = "\x{fcd2}"; |
15 | my $MA_END = "\x{fcd2}"; |
16 | |
16 | |
17 | *wiki = Storable::retrieve CFPlus::find_rcfile "docwiki.pst"; |
17 | *wiki = Storable::retrieve DC::find_rcfile "docwiki.pst"; |
18 | |
18 | |
19 | sub goto_document($) { |
19 | sub goto_document($) { |
20 | $goto_document->(split /\//, $_[0]); |
20 | $goto_document->(split /\//, $_[0]); |
21 | } |
21 | } |
22 | |
22 | |
… | |
… | |
114 | "<small>img</small>" |
114 | "<small>img</small>" |
115 | }, |
115 | }, |
116 | link => sub { |
116 | link => sub { |
117 | my ($par, $text, $link) = @_; |
117 | my ($par, $text, $link) = @_; |
118 | |
118 | |
119 | "<span foreground='#ffff00'>↺</span><span foreground='#c0c0ff' underline='single'>" . (CFPlus::asxml $text) . "</span>" |
119 | "<span foreground='#ffff00'>↺</span><span foreground='#c0c0ff' underline='single'>" . (DC::asxml $text) . "</span>" |
120 | }, |
120 | }, |
121 | ); |
121 | ); |
122 | |
122 | |
123 | sub as_label(@) { |
123 | sub as_label(@) { |
124 | thaw_section @_, %as_label; |
124 | thaw_section @_, %as_label; |
… | |
… | |
136 | |
136 | |
137 | my %as_paragraphs = ( |
137 | my %as_paragraphs = ( |
138 | image => sub { |
138 | image => sub { |
139 | my ($par, $path, $flags) = @_; |
139 | my ($par, $path, $flags) = @_; |
140 | |
140 | |
141 | push @{ $par->{widget} }, new CFPlus::UI::Image path => $path, |
141 | push @{ $par->{widget} }, new DC::UI::Image path => $path, |
142 | $flags & 1 ? (max_h => $::FONTSIZE) : (); |
142 | $flags & 1 ? (max_h => $::FONTSIZE) : (); |
143 | |
143 | |
144 | "\x{fffc}" |
144 | "\x{fffc}" |
145 | }, |
145 | }, |
146 | link => sub { |
146 | link => sub { |
147 | my ($par, $text, $link) = @_; |
147 | my ($par, $text, $link) = @_; |
148 | |
148 | |
149 | push @{ $par->{widget} }, new CFPlus::UI::Label |
149 | push @{ $par->{widget} }, new DC::UI::Label |
150 | markup => "<span foreground='#ffff00'>↺</span><span foreground='#c0c0ff' underline='single'>" . (CFPlus::asxml $text) . "</span>", |
150 | markup => "<span foreground='#ffff00'>↺</span><span foreground='#c0c0ff' underline='single'>" . (DC::asxml $text) . "</span>", |
151 | fontsize => 0.8, |
151 | fontsize => 0.8, |
152 | can_hover => 1, |
152 | can_hover => 1, |
153 | can_events => 1, |
153 | can_events => 1, |
154 | padding_x => 0, |
154 | padding_x => 0, |
155 | padding_y => 0, |
155 | padding_y => 0, |
156 | tooltip => "Go to <i>" . (CFPlus::asxml $link) . "</i>", |
156 | tooltip => "Go to <i>" . (DC::asxml $link) . "</i>", |
157 | on_button_up => sub { |
157 | on_button_up => sub { |
158 | goto_document $link; |
158 | goto_document $link; |
159 | }; |
159 | }; |
160 | |
160 | |
161 | "\x{fffc}" |
161 | "\x{fffc}" |