Automatic generation produced by ISE Eiffel
note description: "Cursor in editors" legal: "See notice at end of class." status: "See notice at end of class." date: "$Date: 2009-09-15 23:20:05 -0800 (Tue, 15 Sep 2009) $" revision: "$Revision: 80724 $" class interface EDITOR_CURSOR create make_from_relative_pos (a_line: like line; a_token: EDITOR_TOKEN; pos: INTEGER_32; a_text: like text) -- Create a cursor for `text`, at position given by -- a_line, a_token and pos. -- (from TEXT_CURSOR) require -- from TEXT_CURSOR a_line_not_void: a_line /= Void a_line_valid: a_line.is_valid a_token_not_void: a_token /= Void a_text_not_void: a_text /= Void pos_positive_not_null: pos >= 0 line_has_token: a_line.count > 0 make_from_character_pos (ch_num, y: INTEGER_32; a_text: like text) -- Create a cursor for `text`, at the ch_numth -- character in line y. -- (from TEXT_CURSOR) require -- from TEXT_CURSOR text_valid: a_text /= Void ch_num_valid: ch_num >= 1 y_valid: y >= 1 make_from_integer (ch_num: INTEGER_32; a_text: like text) -- Create a cursor in a_window, at the ch_numth -- character of the whole text. -- (from TEXT_CURSOR) require -- from TEXT_CURSOR txt_valid: a_text /= Void and then not a_text.is_empty ch_num_valid: ch_num >= 1 feature -- Access generating_type: TYPE [EDITOR_CURSOR] -- Type of current object -- (type of which it is a direct instance) -- (from ANY) ensure -- from ANY generating_type_not_void: Result /= Void generator: STRING_8 -- Name of current object's generating class -- (base class of the type of which it is a direct instance) -- (from ANY) ensure -- from ANY generator_not_void: Result /= Void generator_not_empty: not Result.is_empty feature -- Access initializing: BOOLEAN -- Is current cursor initializing? -- (from TEXT_CURSOR) line: EDITOR_LINE -- Line where Current is. -- (from TEXT_CURSOR) pos_in_characters: INTEGER_32 -- Position of Current, in characters from the start of the text. -- (from TEXT_CURSOR) pos_in_text: INTEGER_32 -- Position, given in characters, from the beginning -- of the text. Tabulations are counted as one character. -- (from TEXT_CURSOR) pos_in_token: INTEGER_32 -- Character (in `token`) Current points on. -- (from TEXT_CURSOR) token: EDITOR_TOKEN -- Token where Current is. -- (from TEXT_CURSOR) wide_item: CHARACTER_32 -- Character current points on -- (from TEXT_CURSOR) x_in_characters: INTEGER_32 -- Position of Current in line in characters as -- it can be counted in a file, i.e. each tabulation -- is counted as only one character. -- (from TEXT_CURSOR) require -- from TEXT_CURSOR line_has_token: line.count > 0 x_in_visible_characters: INTEGER_32 -- Position of Current in line in characters as -- it can be counted by someone who reads the text -- i.e. each tabulations is counted as several characters. -- (from TEXT_CURSOR) y_in_lines: INTEGER_32 -- Line number of Current in the whole text. -- (from TEXT_CURSOR) feature -- Comparison frozen deep_equal (a: ANY; b: like arg #1): BOOLEAN -- Are a and b either both void -- or attached to isomorphic object structures? -- (from ANY) ensure -- from ANY instance_free: class shallow_implies_deep: standard_equal (a, b) implies Result both_or_none_void: (a = Void) implies (Result = (b = Void)) same_type: (Result and (a /= Void)) implies (b /= Void and then a.same_type (b)) symmetric: Result implies deep_equal (b, a) frozen equal (a: ANY; b: like arg #1): BOOLEAN -- Are a and b either both void or attached -- to objects considered equal? -- (from ANY) ensure -- from ANY instance_free: class definition: Result = (a = Void and b = Void) or else ((a /= Void and b /= Void) and then a.is_equal (b)) frozen is_deep_equal alias "≡≡≡" (other: EDITOR_CURSOR): BOOLEAN -- Are Current and other attached to isomorphic object structures? -- (from ANY) require -- from ANY other_not_void: other /= Void ensure -- from ANY shallow_implies_deep: standard_is_equal (other) implies Result same_type: Result implies same_type (other) symmetric: Result implies other.is_deep_equal (Current) is_equal (other: EDITOR_CURSOR): BOOLEAN -- Is Current equal to other? -- (from TEXT_CURSOR) require -- from ANY other_not_void: other /= Void ensure -- from ANY symmetric: Result implies other ~ Current consistent: standard_is_equal (other) implies Result ensure then -- from COMPARABLE trichotomy: Result = (not (Current < other) and not (other < Current)) is_greater alias ">" (other: EDITOR_CURSOR): BOOLEAN -- Is current object greater than other? -- (from COMPARABLE) require -- from PART_COMPARABLE other_exists: other /= Void ensure then -- from COMPARABLE definition: Result = (other < Current) is_greater_equal alias ">=" alias "≥" (other: EDITOR_CURSOR): BOOLEAN -- Is current object greater than or equal to other? -- (from COMPARABLE) require -- from PART_COMPARABLE other_exists: other /= Void ensure then -- from COMPARABLE definition: Result = (other <= Current) is_less alias "<" (other: EDITOR_CURSOR): BOOLEAN -- Is current object less than other? -- (from TEXT_CURSOR) require -- from PART_COMPARABLE other_exists: other /= Void ensure then -- from COMPARABLE asymmetric: Result implies not (other < Current) is_less_equal alias "<=" alias "≤" (other: EDITOR_CURSOR): BOOLEAN -- Is current object less than or equal to other? -- (from COMPARABLE) require -- from PART_COMPARABLE other_exists: other /= Void ensure then -- from COMPARABLE definition: Result = ((Current < other) or (Current ~ other)) max alias "∨" (other: EDITOR_CURSOR): EDITOR_CURSOR -- The greater of current object and other -- (from COMPARABLE) require -- from COMPARABLE other_exists: other /= Void ensure -- from COMPARABLE current_if_not_smaller: Current >= other implies Result = Current other_if_smaller: Current < other implies Result = other min alias "∧" (other: EDITOR_CURSOR): EDITOR_CURSOR -- The smaller of current object and other -- (from COMPARABLE) require -- from COMPARABLE other_exists: other /= Void ensure -- from COMPARABLE current_if_not_greater: Current <= other implies Result = Current other_if_greater: Current > other implies Result = other frozen standard_equal (a: ANY; b: like arg #1): BOOLEAN -- Are a and b either both void or attached to -- field-by-field identical objects of the same type? -- Always uses default object comparison criterion. -- (from ANY) ensure -- from ANY instance_free: class definition: Result = (a = Void and b = Void) or else ((a /= Void and b /= Void) and then a.standard_is_equal (b)) frozen standard_is_equal alias "≜" (other: EDITOR_CURSOR): BOOLEAN -- Is other attached to an object of the same type -- as current object, and field-by-field identical to it? -- (from ANY) require -- from ANY other_not_void: other /= Void ensure -- from ANY same_type: Result implies same_type (other) symmetric: Result implies other.standard_is_equal (Current) three_way_comparison alias "⋚" (other: EDITOR_CURSOR): INTEGER_32 -- If current object equal to other, 0; -- if smaller, -1; if greater, 1 -- (from COMPARABLE) require -- from COMPARABLE other_exists: other /= Void ensure -- from COMPARABLE equal_zero: (Result = 0) = (Current ~ other) smaller_negative: (Result = -1) = (Current < other) greater_positive: (Result = 1) = (Current > other) feature -- Status report conforms_to (other: ANY): BOOLEAN -- Does type of current object conform to type -- of other (as per Eiffel: The Language, chapter 13)? -- (from ANY) require -- from ANY other_not_void: other /= Void is_alpha (a_char: CHARACTER_32): BOOLEAN -- Is a_char an alphabetic character? -- (from CHARACTER_PROPERTY) ensure -- from CHARACTER_PROPERTY definition: Result = (is_lower (a_char) or is_upper (a_char)) is_control (a_char: CHARACTER_32): BOOLEAN -- Is a_char a control character? -- (from CHARACTER_PROPERTY) is_digit (a_char: CHARACTER_32): BOOLEAN -- Is a_char a digit character? -- (from CHARACTER_PROPERTY) is_hexa_digit (a_char: CHARACTER_32): BOOLEAN -- Is a_char an hexadecimal character? -- (from CHARACTER_PROPERTY) is_lower (a_char: CHARACTER_32): BOOLEAN -- Is a_char a lower character? -- (from CHARACTER_PROPERTY) is_punctuation (a_char: CHARACTER_32): BOOLEAN -- Is a_char a punctuation character? -- (from CHARACTER_PROPERTY) is_space (a_char: CHARACTER_32): BOOLEAN -- Is a_char a space character? -- (from CHARACTER_PROPERTY) is_title (a_char: CHARACTER_32): BOOLEAN -- Is a_char a title character? -- (from CHARACTER_PROPERTY) is_upper (a_char: CHARACTER_32): BOOLEAN -- Is a_char an upper character? -- (from CHARACTER_PROPERTY) same_type (other: ANY): BOOLEAN -- Is type of current object identical to type of other? -- (from ANY) require -- from ANY other_not_void: other /= Void ensure -- from ANY definition: Result = (conforms_to (other) and other.conforms_to (Current)) feature -- Cursor movement char_is_separator (char: CHARACTER_32): BOOLEAN -- Is char considered a word separator? -- (from TEXT_CURSOR) go_down_line -- Move down one line (to next line), if possible. -- (from TEXT_CURSOR) go_end_line -- Move to end of line. -- (from TEXT_CURSOR) require -- from TEXT_CURSOR eol_token_not_void: line.eol_token /= Void go_end_word -- Move to end of word. -- (from TEXT_CURSOR) go_left_char -- Move to previous character, if there is one. -- (from TEXT_CURSOR) go_left_word -- Move Current to the beginning of the previous word. -- (from TEXT_CURSOR) go_right_char -- Move to next character, if there is one. -- (from TEXT_CURSOR) go_right_char_no_down_line -- Move to next character, if there is one. -- (from TEXT_CURSOR) go_right_word -- Move Current to the end of the next word. -- (from TEXT_CURSOR) go_smart_home -- Move to smart home position -- (from TEXT_CURSOR) require -- from TEXT_CURSOR first_token_not_void: line.first_token /= Void go_start_line -- Move to beginning of line. -- (from TEXT_CURSOR) require -- from TEXT_CURSOR first_token_not_void: line.first_token /= Void go_start_word -- Move to beginning of word. -- (from TEXT_CURSOR) go_to_position (a_position: INTEGER_32) -- Move Current to a_position of the text -- (from TEXT_CURSOR) go_up_line -- Move up one line (to preceding line), if possible. -- (from TEXT_CURSOR) feature -- Element change equivalent_length (position, tab_number: INTEGER_32): INTEGER_32 -- Length of a tabulation inserted after position in the text -- as it would appear to the reader. -- (from TEXT_CURSOR) set_current_char (a_token: EDITOR_TOKEN; a_position: INTEGER_32) -- Make a_token be the new value for `token`. -- Set the value of `pos_in_token` to a_position. -- Update x_in_pixels accordingly. require -- from TEXT_CURSOR a_token_exists: a_token /= Void a_position_positive_not_null: a_position >= 0 line_has_token: line.count > 0 set_from_character_pos (ch_num, y: INTEGER_32; a_text: like text) -- Set the cursor for `text`, at the ch_numth -- character in line y. -- (from TEXT_CURSOR) require -- from TEXT_CURSOR text_valid: a_text /= Void ch_num_valid: ch_num >= 1 y_valid: y >= 1 set_from_integer (ch_num: INTEGER_32; a_text: like text) -- Set the cursor in a_window, at the ch_numth -- character of the whole text. -- (from TEXT_CURSOR) require -- from TEXT_CURSOR txt_valid: a_text /= Void and then not a_text.is_empty ch_num_valid: ch_num >= 1 set_from_relative_pos (a_line: like line; a_token: EDITOR_TOKEN; pos: INTEGER_32; a_text: like text) -- Set the cursor for `text`, at position given by -- a_line, a_token and pos. -- (from TEXT_CURSOR) require -- from TEXT_CURSOR a_line_not_void: a_line /= Void a_line_valid: a_line.is_valid a_token_not_void: a_token /= Void a_text_not_void: a_text /= Void pos_positive_not_null: pos >= 0 line_has_token: a_line.count > 0 set_line (a_line: like line) -- Make a_line the new value of `line`. -- (from TEXT_CURSOR) require -- from TEXT_CURSOR a_line_exists: a_line /= Void a_line_valid: a_line.is_valid set_x_in_characters (x_in_ch: INTEGER_32) -- Set attributes so that `x_in_characters` return x_in_ch. -- (from TEXT_CURSOR) require -- from TEXT_CURSOR x_in_ch_valid: x_in_ch >= 1 set_y_in_lines (y: INTEGER_32) -- Make y be the new value of `y_in_lines`. -- Change `line` accordingly. -- (from TEXT_CURSOR) require -- from TEXT_CURSOR y_valid: y >= 1 token_length (tok: EDITOR_TOKEN; pos: INTEGER_32): INTEGER_32 -- Length of token tok after position in the text -- as it would appear to the reader. -- (from TEXT_CURSOR) require -- from TEXT_CURSOR tok_not_void: tok /= Void update_current_char -- Update the current token and the the position in it. -- It is required that the cursor is not in the left margin. require -- from TEXT_CURSOR x_in_visible_characters > 0 feature -- Conversion to_lower (a_char: CHARACTER_32): CHARACTER_32 -- Convert a_char to lower case. -- (from CHARACTER_PROPERTY) to_title (a_char: CHARACTER_32): CHARACTER_32 -- Convert a_char to title case. -- (from CHARACTER_PROPERTY) to_upper (a_char: CHARACTER_32): CHARACTER_32 -- Convert a_char to upper case. -- (from CHARACTER_PROPERTY) feature -- Duplication copy (other: EDITOR_CURSOR) -- Update current object using fields of object attached -- to other, so as to yield equal objects. -- (from ANY) require -- from ANY other_not_void: other /= Void type_identity: same_type (other) ensure -- from ANY is_equal: Current ~ other frozen deep_copy (other: EDITOR_CURSOR) -- Effect equivalent to that of: -- `copy` (other . `deep_twin`) -- (from ANY) require -- from ANY other_not_void: other /= Void ensure -- from ANY deep_equal: deep_equal (Current, other) frozen deep_twin: EDITOR_CURSOR -- New object structure recursively duplicated from Current. -- (from ANY) ensure -- from ANY deep_twin_not_void: Result /= Void deep_equal: deep_equal (Current, Result) frozen standard_copy (other: EDITOR_CURSOR) -- Copy every field of other onto corresponding field -- of current object. -- (from ANY) require -- from ANY other_not_void: other /= Void type_identity: same_type (other) ensure -- from ANY is_standard_equal: standard_is_equal (other) frozen standard_twin: EDITOR_CURSOR -- New object field-by-field identical to other. -- Always uses default copying semantics. -- (from ANY) ensure -- from ANY standard_twin_not_void: Result /= Void equal: standard_equal (Result, Current) frozen twin: EDITOR_CURSOR -- New object equal to Current -- `twin` calls `copy`; to change copying/twinning semantics, redefine `copy`. -- (from ANY) ensure -- from ANY twin_not_void: Result /= Void is_equal: Result ~ Current feature -- Basic operations frozen default: EDITOR_CURSOR -- Default value of object's type -- (from ANY) frozen default_pointer: POINTER -- Default value of type POINTER -- (Avoid the need to write p.`default` for -- some p of type POINTER.) -- (from ANY) ensure -- from ANY instance_free: class default_rescue -- Process exception for routines with no Rescue clause. -- (Default: do nothing.) -- (from ANY) frozen do_nothing -- Execute a null action. -- (from ANY) ensure -- from ANY instance_free: class feature -- Constants Max_ascii_value: NATURAL_32 = 127 -- (from CHARACTER_PROPERTY) Max_latin1_value: NATURAL_32 = 255 -- (from CHARACTER_PROPERTY) Max_unicode_value: NATURAL_32 = 1114111 -- Various maximal value for character range. -- (from CHARACTER_PROPERTY) feature -- Output Io: STD_FILES -- Handle to standard file setup -- (from ANY) ensure -- from ANY instance_free: class io_not_void: Result /= Void out: STRING_8 -- New string containing terse printable representation -- of current object -- (from ANY) ensure -- from ANY out_not_void: Result /= Void print (o: ANY) -- Write terse external representation of o -- on standard output. -- (from ANY) ensure -- from ANY instance_free: class frozen tagged_out: STRING_8 -- New string containing terse printable representation -- of current object -- (from ANY) ensure -- from ANY tagged_out_not_void: Result /= Void feature -- Platform Operating_environment: OPERATING_ENVIRONMENT -- Objects available from the operating system -- (from ANY) ensure -- from ANY instance_free: class operating_environment_not_void: Result /= Void feature -- Query initialized: BOOLEAN -- Have preferences been set and ready to be used? -- (from SHARED_EDITOR_DATA) feature -- Resources editor_preferences: EDITOR_DATA -- Editor preferences -- (from SHARED_EDITOR_DATA) Panel_manager: TEXT_PANEL_MANAGER -- List of open panels -- (from SHARED_EDITOR_DATA) invariant -- from TEXT_CURSOR y_in_lines_positive_or_null: y_in_lines >= 0 pos_in_token_positive: pos_in_token > 0 text_not_void: text /= Void -- from ANY reflexive_equality: standard_is_equal (Current) reflexive_conformance: conforms_to (Current) -- from COMPARABLE irreflexive_comparison: not (Current < Current) note copyright: "Copyright (c) 1984-2006, Eiffel Software and others" license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)" source: "[ Eiffel Software 356 Storke Road, Goleta, CA 93117 USA Telephone 805-685-1006, Fax 805-685-6869 Website http://www.eiffel.com Customer support http://support.eiffel.com ]" end -- class EDITOR_CURSOR -- Generated by Eiffel Studio --
For more details: eiffel.org