PageRenderTime 38ms CodeModel.GetById 16ms app.highlight 10ms RepoModel.GetById 1ms app.codeStats 1ms

/src/wrappers/gtk/examples/gtk-eiffel-doc/eiffel_documentation_text_buffer.e

http://github.com/tybor/Liberty
Specman e | 659 lines | 495 code | 84 blank | 80 comment | 48 complexity | 18844d70f6225f0376e7ef991992db18 MD5 | raw file
  1indexing
  2	description: "."
  3	copyright: "[
  4					Copyright (C) 2007 Paolo Redaelli
  5					
  6					This program is free software; you can redistribute it and/or
  7					modify it under the terms of the GNU General Public License
  8					as published by the Free Software Foundation; either version 2.0 of
  9					the License, or (at your option) any later version.
 10					
 11					This library is distributed in the hope that it will be useful, but
 12					WITHOUT ANY WARRANTY; without even the implied warranty of
 13					MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 14					Lesser General Public License for more details.
 15
 16					You should have received a copy of the GNU General Public
 17					License along with this library; if not, write to the Free Software
 18					Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
 19					02110-1301 USA
 20			]"
 21
 22class EIFFEL_DOCUMENTATION_TEXT_BUFFER
 23	-- TODO: Recognize class names stored into comments and add proper link to them
 24
 25inherit
 26	GTK_TEXT_BUFFER
 27	
 28	CLASS_NAME_VISITOR undefine is_equal, copy end
 29	CLASS_NAME_LIST_VISITOR  undefine is_equal, copy end
 30	CLASS_TEXT_VISITOR undefine is_equal, copy end
 31	INDEX_LIST_VISITOR undefine is_equal, copy end
 32	INDEX_CLAUSE_VISITOR undefine is_equal, copy end
 33
 34	COMMENT_VISITOR  undefine is_equal, copy end
 35	
 36	FEATURE_CLAUSE_LIST_VISITOR undefine is_equal, copy end
 37	FEATURE_CLAUSE_VISITOR undefine is_equal, copy end
 38
 39	PARENT_LISTS_VISITOR undefine is_equal, copy end
 40	PARENT_EDGE_VISITOR undefine is_equal, copy end
 41
 42	CREATION_CLAUSE_LIST_VISITOR undefine is_equal, copy end
 43	CREATION_CLAUSE_VISITOR undefine is_equal, copy end
 44	
 45	CLIENT_LIST_VISITOR undefine is_equal, copy end
 46	FEATURE_NAME_LIST_VISITOR undefine is_equal, copy end
 47	FEATURE_NAME_VISITOR undefine is_equal, copy end
 48
 49	ASSERTION_LIST_VISITOR undefine is_equal, copy end
 50		-- ASSERTION_LIST_VISITOR is an heir of CHECK_INVARIANT_VISITOR,
 51		-- CLASS_INVARIANT_VISITOR, E_ENSURE_VISITOR,
 52		-- LOOP_INVARIANT_VISITOR, REQUIRE_ITEM_VISITOR so there's no
 53		-- need to inherit them anew.
 54	
 55insert
 56	PANGO_SCALES
 57	PANGO_STYLE
 58	PANGO_WEIGHT
 59
 60creation from_class_name
 61
 62feature {GTK_EIFFEL_DOC} -- Creation
 63	from_class_name (a_class_name: CLASS_NAME) is
 64		require
 65			class_name_not_void: a_class_name/=Void
 66		do
 67			class_name := a_class_name
 68			class_text := class_name.class_text
 69			debug
 70				io.put_string(once "{EIFFEL_DOCUMENTATION_TEXT_BUFFER}.from_class_name(")
 71				io.put_string(a_class_name.to_string)
 72				io.put_line(once ")")
 73			end
 74			make; add_tags; iter := start_iter
 75			
 76			if  class_text = Void then insert_at(iter, once "No class text")
 77			else
 78				put_indexing 
 79				-- remove the line above and put "if
 80				-- class_text.index_list/=Void then put_indexing end" when
 81				-- 2.4 is out.
 82				put_comment(class_text.heading_comment1)
 83				put_main_class_name
 84				put_comment(class_text.heading_comment2)
 85				if class_text.obsolete_mark/=Void then 
 86					insert_with_tag(iter,once "obsolete ", class_tag)
 87					insert_with_tag(iter,class_text.obsolete_mark.to_string, string_tag)
 88					insert_at(iter,newline)
 89				end
 90				if class_text.parent_lists /= Void then put_parent_lists end
 91				if class_text.creation_clause_list /= Void then put_creation_clause_list end
 92				if class_text.feature_clause_list /= Void then put_feature_clause_list end
 93				if class_text.class_invariant/=Void then put_class_invariant(class_text.class_invariant) end
 94				put_comment(class_text.end_comment)
 95			end
 96		end
 97	
 98feature
 99	iter: GTK_TEXT_ITER
100			-- The insertion point used in all the features that add text
101			-- to the buffer.
102	
103	put_indexing is
104			-- Append the indexing clauses to Current buffer; TODO:
105			-- currently only a small note is printed since the real
106			-- implementation is commented out; in fact SmartEiffel 2.3
107			-- does not export to visitors enought features to implement
108			-- this. A couple of one-liner patches have already been
109			-- applied to the SE repository.
110		do
111			insert_with_tag(iter,once "SmartEiffel 2.3 does not export to visitors enought features to implement this. A couple of one-liner patches have already been applied to the compiler SVN repository.%N",note_tag)
112			-- require index_list_not_void: class_text.index_list /= Void
113			-- local
114			--	index_list: INDEX_LIST; string: STRING
115			--	ici: ITERATOR[INDEX_CLAUSE]; index_clause: INDEX_CLAUSE;
116			-- 		do
117			-- 			index_list := class_name.class_text.index_list
118			-- 			-- insert_at(iter, once "indexing")
119			-- 			from ici:=index_list.list.get_new_iterator; ici.start; until ici.is_off
120			-- 			loop
121			-- 				index_clause := ici.item
122			-- 				if index_clause /= Void then
123			-- 					if index_clause.tag /= Void
124			-- 					then insert_with_tag(iter,index_clause.tag.to_string+" ",keyword_tag)
125			-- 					else insert_at(iter, once " (No tag?!?!) ")
126			-- 					end
127			-- 					if index_clause.list /= Void then
128			-- 						string := merged_manifest_strings(index_clause.list)
129			-- 						string.append_character('%N')
130			-- 						insert_with_tag(iter,string,string_tag)
131			-- 					end -- index_clause.list /= Void
132			-- 				else
133			-- 					debug io.put_line("Void index clause") end
134			-- 				end -- index_claue /= Void
135			-- 				ici.next
136			-- 			end -- Loop over index list
137		end
138
139	put_comment (a_comment: COMMENT) is
140		do
141			if a_comment/=Void then
142				insert_with_tag(iter,merged_strings(a_comment.list),comment_tag)
143			end
144		end
145
146	put_main_class_name is
147			-- Append to `iter' the name of the class text with full
148			-- details as expected when you start reading an Eiffel
149			-- class; i.e.  "deferred class FOO [ITEM_->BAR]" or
150			-- "expanded class MAMAN"
151		local i: INTEGER; an_arg: FORMAL_GENERIC_ARG
152		do
153			if class_text.is_deferred
154			then insert_with_tag(iter,once "deferred class ",class_tag)
155			elseif class_text.is_expanded
156			then insert_with_tag(iter,once "expanded class ",class_tag)
157			else insert_with_tag(iter,once "class ",class_tag)
158			end
159			insert_with_tag(iter,class_name.to_string,class_tag)
160			if class_text.formal_generic_list /= Void then
161				insert_with_tag(iter,once " [",class_tag)
162				from i := 1 until i > class_text.formal_generic_list.count - 1 loop
163					an_arg := class_text.formal_generic_list.item(i)
164					check arg_not_void: an_arg /= Void end
165					put_formal_generic_arg(an_arg)		
166					insert_with_tag(iter,once ", ",class_tag)
167					i := i + 1
168				end
169				put_formal_generic_arg(class_text.formal_generic_list.item(i))
170				insert_with_tag(iter,once "]",class_tag)				
171			end
172			put_newline
173		end
174
175	put_formal_generic_arg (an_arg: FORMAL_GENERIC_ARG) is
176		do
177			insert_with_tag(iter,an_arg.name.to_string,class_tag)
178			if an_arg.constrained then
179				insert_with_tag(iter,left_arrow,class_tag) -- "->"
180				insert_with_tag(iter,an_arg.constraint.written_mark,class_tag)
181			end
182		end
183				
184	put_parent_lists is
185			-- Put parent_lists if not Void
186		require class_text.parent_lists /= Void
187		local parents: PARENT_LISTS
188		do	
189			parents := class_text.parent_lists
190			if parents.inherit_count > 0 then
191				if parents.inherit_count = 1
192				then insert_with_tag(iter,once "Direct parent ",keyword_tag)
193				else insert_with_tag(iter,once "Direct parents ",keyword_tag)
194				end
195				put_comment(parents.inherit_comment)
196				if parents.inherit_list /= Void
197				then put_parent_edges(parents.inherit_list)
198				end
199			end
200			
201			if parents.insert_count > 0 then
202				insert_with_tag(iter,once "Directly inserting ",keyword_tag)
203				put_comment(parents.insert_comment)
204				if parents.default_insert_any_added_flag
205				then insert_with_tag(iter,once "ANY has been automatically inserted%N",comment_tag)
206				end
207				if parents.insert_list /= Void
208				then put_parent_edges(parents.insert_list)
209				end
210			end
211		end
212	
213	put_parent_edges (some_parent_edges: COLLECTION[PARENT_EDGE]) is
214		require some_parent_edges /= Void
215		local i: INTEGER; edge: PARENT_EDGE
216		do
217			from i:=some_parent_edges.lower until i>some_parent_edges.upper-1
218			loop
219				edge := some_parent_edges.item(i)
220				insert_with_tag(iter, edge.class_text_name+", ",feature_name_tag)
221				i := i + 1
222			end
223			insert_with_tag(iter,some_parent_edges.item(i).class_text_name,
224								 feature_name_tag)
225			insert_at(iter,newline)
226		end
227	
228	put_creation_clause_list is
229		require class_text.creation_clause_list /= Void
230		local cci: ITERATOR[CREATION_CLAUSE]; cc: CREATION_CLAUSE; i, a_count: INTEGER
231		do
232			insert_with_tag(iter,once "creation features: ",feature_clause_tag)
233			put_newline
234
235			if class_text.creation_clause_list.list /= Void then
236				from cci:=class_text.creation_clause_list.list.get_new_iterator
237				until cci.is_off loop
238					cc:=cci.item
239					if cc/=Void then put_creation_clause(cc) end
240					put_newline
241					cci.next
242				end -- loop over creation clauses
243			end
244		end
245
246	put_creation_clause (a_creation_clause: CREATION_CLAUSE) is
247		require non_void_clause: a_creation_clause/=Void
248		do
249			if a_creation_clause.clients/=Void then
250				put_client_list(a_creation_clause.clients)
251			end
252			if a_creation_clause.comment/=Void then
253				put_comment(a_creation_clause.comment)
254			end
255			if a_creation_clause.procedure_list/=Void then
256				put_feature_name_list(a_creation_clause.procedure_list)
257			else io.put_line(once "Void procedure list in creation clause list.")
258			end
259		end
260
261	put_client_list (some_clients: CLIENT_LIST) is
262		require clients_not_void: some_clients/=Void
263		local i: INTEGER 
264		do
265			if some_clients.class_name_list/=Void then
266				from i:=1 until i>some_clients.class_name_list.count-1 loop
267					insert_with_tag(iter,some_clients.class_name_list.item(i).to_string,feature_clause_tag)
268					i := i + 1
269				end
270			end
271		end
272	
273	put_feature_clause_list is
274		require class_text.feature_clause_list /= Void
275		local
276			fci: ITERATOR[FEATURE_CLAUSE] -- Feature Clause Iterator
277			fc: FEATURE_CLAUSE -- Feature Clause
278			i: INTEGER
279		do
280			fci := class_text.feature_clause_list.list.get_new_iterator
281			from fci.start until fci.is_off loop
282				fc := fci.item
283				-- clients: CLIENT_LIST The clients allowed to use these
284				-- features.
285				insert_with_tag(iter, "Feature clause "+fc.clients.eiffel_view,
286									 feature_name_tag)
287
288				-- comment: COMMENT The heading comment comming with the
289				-- clause.
290				put_comment(fc.comment)
291				
292				-- list: FAST_ARRAY[FEATURE_TEXT] Only the features of the
293				-- current clause.
294				if fc.list/=Void then 
295					from i := fc.list.lower until i > fc.list.upper loop
296						put_feature_text(fc.list.item(i))
297						i := i + 1
298					end
299				else insert_with_tag(iter, once "no feature text into a feature clause%N", note_tag)
300				end
301
302				fci.next
303			end -- Loop over Feature Clause
304		end
305	
306	put_feature_name_list (a_list: FEATURE_NAME_LIST) is
307		require list_not_void: a_list/=Void
308		local i: INTEGER
309		do
310			from i:=1 until i> a_list.count-1 loop
311				put_feature_name(a_list.item(i))
312				insert_with_tag(iter,once ", ",feature_name_tag)
313				i:=i+1
314			end
315		end
316	
317	put_feature_name (a_name: FEATURE_NAME) is
318		require name_not_void: a_name /= Void
319		do
320			if a_name.is_frozen then
321				insert_with_tag(iter,once "frozen ",feature_name_tag)
322			end
323			if a_name.is_infix_name then
324				insert_with_tag(iter,once "infix ",feature_name_tag)
325			end
326			if a_name.is_prefix_name then
327				insert_with_tag(iter,once "prefix ",feature_name_tag)
328			end
329			insert_with_tag(iter,a_name.to_string,feature_name_tag)
330		end
331
332	put_feature_text (a_text: FEATURE_TEXT) is
333		require text_not_void: a_text/=Void
334		local i, a_count: INTEGER
335		do
336			-- names: FEATURE_NAME_LIST All the names of the feature.
337			if a_text.names/=Void then
338				from i:=1; a_count:=a_text.names.count until i>a_count-1 
339				loop
340					put_feature_name(a_text.names.item(i))
341					insert_with_tag(iter, once ",",feature_name_tag)
342					i:=i+1
343				end 
344				put_feature_name(a_text.names.item(a_count))
345			else io.put_line(once "Void feature names list!")
346			end
347
348			if a_text.arguments/=Void
349			then put_formal_arg_list(a_text.arguments)
350			end
351			
352			if a_text.result_type/=Void then 
353				-- result_type: TYPE_MARK Result type if any.
354				insert_with_tag(iter,once ": ",argument_type_tag)
355				insert_with_tag(iter,a_text.result_type.written_mark,argument_type_tag)
356			end
357			
358			put_newline
359
360			put_comment(a_text.header_comment) -- Header comment for a routine or following comment for an attribute.
361			
362			if a_text.obsolete_mark/=Void then
363				-- obsolete_mark: MANIFEST_STRING The obsolete mark if any.
364				insert_with_tag(iter,once "obsolete ", feature_clause_tag)
365				insert_with_tag(iter,a_text.obsolete_mark.to_string, string_tag)
366				put_newline
367			end
368			
369			if a_text.clients/=Void then
370				-- clients: CLIENT_LIST
371			end
372			
373			if a_text.require_assertion/=Void then
374				-- require_assertion: E_REQUIRE Not Void if any.
375			end
376
377			if a_text.ensure_assertion/=Void then 
378				-- ensure_assertion: E_ENSURE Not Void if any.
379				put_ensure_assertion(a_text.ensure_assertion)
380			end
381		end
382	
383	put_class_invariant (an_invariant: CLASS_INVARIANT) is
384		require class_text.class_invariant/=Void
385		local assertion_iter: ITERATOR[ASSERTION]; an_assertion: ASSERTION
386		do
387			if an_invariant.list/=Void then
388				assertion_iter:=an_invariant.list.get_new_iterator
389				from assertion_iter.start until assertion_iter.is_off
390				loop
391					an_assertion := assertion_iter.item
392					if an_assertion/=Void then put_assertion(an_assertion) end
393					assertion_iter.next
394				end
395			else io.put_line(once "Empty assertion list in a class invariant.")
396			end
397		end
398
399	put_assertion (an_assertion: ASSERTION) is
400		require an_assertion/=Void
401		do
402			-- tag: TAG_NAME
403			-- expression: EXPRESSION
404			-- comment: COMMENT
405		end
406	
407	put_formal_arg_list (some_arguments: FORMAL_ARG_LIST) is
408			-- Put formal arguments
409		require some_arguments/=Void
410		local i, a_count: INTEGER; a_name: ARGUMENT_NAME1; a_type_mark: TYPE_MARK
411		do
412			insert_with_tag(iter, once " (",feature_clause_tag)
413			from i:=1; a_count:=some_arguments.count 
414			until i > a_count-1 loop
415				a_name := some_arguments.name(i)
416				a_type_mark := some_arguments.type_mark(i)
417				i := i + 1
418				check
419					name_not_void: a_name /= Void
420					type_not_void: a_type_mark /= Void
421				end
422				-- if a_name=Void then io.put_line(once "Void argument name") end
423				-- if a_type_mark=Void then io.put_line(once "Void argument type 
424				-- mark") end
425				insert_with_tag(iter, a_name.to_string,argument_name_tag)
426				insert_with_tag(iter, once ": ",argument_name_tag)
427				insert_with_tag(iter, a_type_mark.written_mark,argument_type_tag)
428				insert_with_tag(iter, once ", ",feature_clause_tag)
429			end
430			a_name := some_arguments.name(a_count)
431			a_type_mark := some_arguments.type_mark(a_count)
432			check
433				name_not_void: a_name /= Void
434				type_not_void: a_type_mark /= Void
435			end
436			insert_with_tag(iter,a_name.to_string,argument_name_tag)
437			insert_with_tag(iter, once ": ",argument_name_tag)
438			insert_with_tag(iter, a_type_mark.written_mark,argument_type_tag)
439			insert_with_tag(iter, once ")",feature_clause_tag)
440		end
441	
442	put_require_assertion (a_require_assertion: E_REQUIRE) is
443		require a_require_assertion/=Void
444		do
445			
446		end
447
448	put_ensure_assertion (an_ensure_assertion: E_ENSURE) is
449		require an_ensure_assertion /= Void
450		do
451			
452		end
453
454	
455feature -- Visitor features. Mostly empty
456	visit_class_name (visited: CLASS_NAME) is do raise(dead_code) end
457	visit_class_name_list (visited: CLASS_NAME_LIST) is do raise(dead_code) end
458	visit_class_text (visited: CLASS_TEXT) is do raise(dead_code) end
459	visit_index_list (visited: INDEX_LIST) is do raise(dead_code) end
460	visit_index_clause (visited: INDEX_CLAUSE) is do raise(dead_code) end
461
462	visit_comment (visited: COMMENT) is do raise(dead_code) end
463	
464	visit_feature_clause_list (some_features: FEATURE_CLAUSE_LIST) is do raise(dead_code) end
465	visit_feature_clause (a_feature_clause: FEATURE_CLAUSE) is do raise(dead_code) end
466
467	visit_parent_lists (visited: PARENT_LISTS) is do raise(dead_code) end
468	visit_parent_edge (visited: PARENT_EDGE) is do raise(dead_code) end
469		
470	visit_creation_clause_list (visited: CREATION_CLAUSE_LIST) is do raise(dead_code) end
471	visit_creation_clause (visited: CREATION_CLAUSE) is do raise(dead_code) end
472	visit_client_list (visited: CLIENT_LIST) is do raise(dead_code) end
473	visit_feature_name (visited: FEATURE_NAME) is do raise(dead_code) end
474	visit_feature_name_list (visited: FEATURE_NAME_LIST) is do raise(dead_code) end
475	
476	-- ASSERTION_LIST_VISITOR features
477	visit_loop_invariant (visited: LOOP_INVARIANT) is do raise(dead_code) end
478	visit_require_item (visited: REQUIRE_ITEM) is do raise(dead_code) end
479	visit_check_invariant (visited: CHECK_INVARIANT) is do raise(dead_code) end
480	visit_e_ensure (an_ensure: E_ENSURE) is do raise(dead_code) end
481	visit_e_require (a_require: E_REQUIRE) is do raise(dead_code) end
482	visit_class_invariant (visited: CLASS_INVARIANT) is do raise(dead_code) end
483	
484	visit_assertion (visited: ASSERTION) is do raise(dead_code) end
485	
486	dead_code: STRING is "Visitor feature of an EIFFEL_DOCUMENTATION_TEXT_BUFFER invoked. They should never be invoked by design, since they're empty."
487
488feature -- Tags
489	add_tags is
490			-- Creates all the tags and add the them to the `tag_table'
491		do
492			create keyword_tag.with_name(once "keyword")
493			-- keyword_tag.set_foreground(once "blue")
494			keyword_tag.set_weight(pango_weight_semibold)
495			tag_table.add(keyword_tag)
496			
497			create comment_tag.with_name(once "comment")
498			-- comment_tag.set_foreground(once "green")
499			comment_tag.set_style(pango_style_italic)
500			comment_tag.set_left_margin(25)
501			comment_tag.set_justification(gtk_justify_left) -- TODO: when supported gtk_justify_fill)
502			tag_table.add(comment_tag)
503
504			create string_tag.with_name(once "string")
505			-- string_tag.set_foreground(once "gray")
506			string_tag.set_style(pango_style_italic)
507			string_tag.set_justification(gtk_justify_left) -- TODO: when supported gtk_justify_fill)
508			tag_table.add(string_tag)
509			
510			create class_tag.with_name(once "class")
511			class_tag.set_scale(pango_scale_xx_large*pango_scale_large)
512			class_tag.set_weight(pango_weight_ultrabold)
513			class_tag.set_pixels_above_lines(10)
514			class_tag.set_pixels_below_lines(10)
515			tag_table.add(class_tag)
516			
517			create feature_clause_tag.with_name(once "feature-clause")
518			feature_clause_tag.set_weight(pango_weight_bold)
519			feature_clause_tag.set_scale(pango_scale_x_large)
520			feature_clause_tag.set_pixels_above_lines(5)
521			feature_clause_tag.set_pixels_below_lines(5)
522			tag_table.add(feature_clause_tag)
523
524			create feature_name_tag.with_name(once "feature-name")
525			feature_name_tag.set_weight(pango_weight_bold)
526			feature_name_tag.set_scale(pango_scale_large)
527			feature_clause_tag.set_pixels_above_lines(2)
528			tag_table.add(feature_name_tag)
529			
530			create argument_name_tag.with_name(once "argument-name")
531			argument_name_tag.set_scale(pango_scale_large)
532			tag_table.add(argument_name_tag)
533
534			create argument_type_tag.with_name(once "argument-type")
535			argument_type_tag.set_weight(pango_weight_bold)
536			argument_type_tag.set_scale(pango_scale_large)
537			tag_table.add(argument_type_tag)
538
539			-- TODO: instead of argument make argument-name and
540			-- argument-type
541
542			create cluster_tag.with_name(once "cluster")
543			tag_table.add(cluster_tag)
544
545			create note_tag.with_name(once "note")
546			note_tag.set_scale(pango_scale_xx_small)
547			note_tag.set_weight(pango_weight_ultralight)
548			tag_table.add(note_tag)
549		ensure
550			keyword_tag /= Void
551			comment_tag /= Void
552			string_tag /= Void
553			class_tag /= Void
554			feature_clause_tag /= Void
555			feature_name_tag /= Void
556			argument_name_tag /= Void
557			argument_type_tag /= Void
558			cluster_tag /= Void
559			note_tag /= Void
560		end
561	
562	keyword_tag: GTK_TEXT_TAG 
563	comment_tag: GTK_TEXT_TAG 
564	string_tag: GTK_TEXT_TAG 
565	class_tag: GTK_TEXT_TAG 
566	feature_clause_tag: GTK_TEXT_TAG
567	feature_name_tag: GTK_TEXT_TAG
568	argument_name_tag: GTK_TEXT_TAG
569	argument_type_tag: GTK_TEXT_TAG
570	cluster_tag: GTK_TEXT_TAG
571
572	note_tag: GTK_TEXT_TAG
573
574feature {} -- Implementation, syntactic sugar
575	class_name: CLASS_NAME
576	class_text: CLASS_TEXT
577	
578	not_homogeneous: BOOLEAN is False
579	dont_expand: BOOLEAN is False
580	expand: BOOLEAN is True
581
582	dont_fill: BOOLEAN is False
583	fill: BOOLEAN is True
584
585	no_padding: INTEGER is 0
586
587	newline: STRING is "%N"
588	
589	put_newline is 
590		do 
591			insert_at(iter,newline) 
592		end
593
594	merged_strings (some_strings: COLLECTION[STRING]): STRING is
595			-- A new string with all the strings in `some_strings'
596			-- appended; all carriage return are replaced with a space. A
597			-- newline is added at the end.
598		require some_strings_not_void: some_strings /= Void
599		local capacity: INTEGER;i: ITERATOR[STRING]
600		do
601			i := some_strings.get_new_iterator
602			from i.start until i.is_off loop
603				if i.item/=Void then capacity:=capacity+i.item.count end
604				i.next
605			end
606			create Result.with_capacity(capacity+1)
607			from i.start until i.is_off loop
608				if i.item/=Void then Result.append(i.item) end
609				i.next
610			end
611			Result.replace_all('%N',' ')
612			Result.append_character('%N') 
613		ensure not_void: Result /= Void
614		end
615	
616	merged_manifest_strings (some_strings: COLLECTION[MANIFEST_STRING]): STRING is
617			-- A new string with all the strings in `some_strings'
618			-- appended; all new lines are replaced with a space, except
619			-- the ending one.
620		require some_strings_not_void: some_strings /= Void
621		local capacity: INTEGER;i: ITERATOR[MANIFEST_STRING]
622		do
623			-- Compute Result's length
624			i := some_strings.get_new_iterator
625			from i.start until i.is_off loop
626				if i.item/=Void then capacity:=capacity+i.item.count end
627				i.next
628			end
629			create Result.with_capacity(capacity)
630			from i.start until i.is_off loop
631				if i.item/=Void then Result.append(i.item.to_string) end
632				i.next
633			end
634			Result.replace_all('%N',' ')
635			if Result.last=' ' then Result.put('%N',Result.upper) end 
636		ensure not_void: Result /= Void
637		end
638
639	left_arrow: STRING is
640			-- A right arrow in Unicode converted into UTF8
641		do
642			Result := (U"%/Ux2192/").to_string 
643		end
644
645
646	midcolor (a,b: GDK_COLOR): GDK_COLOR is
647		require
648			a /= Void
649			b /= Void
650		do
651			create Result.make
652			Result.set_red((a.red+b.red)//2)
653			Result.set_green((a.green+b.green)//2)
654			Result.set_blue((a.blue+b.blue)//2)
655		end
656	
657invariant
658	class_name/=Void
659end -- class EIFFEL_DOCUMENTATION_TEXT_BUFFER