1. ------------------------------------------------------------------------------ 
  2. --                                                                          -- 
  3. --      Copyright (C) 1998-2000 E. Briot, J. Brobecker and A. Charlet       -- 
  4. --                     Copyright (C) 2000-2014, AdaCore                     -- 
  5. --                                                                          -- 
  6. -- This library is free software;  you can redistribute it and/or modify it -- 
  7. -- under terms of the  GNU General Public License  as published by the Free -- 
  8. -- Software  Foundation;  either version 3,  or (at your  option) any later -- 
  9. -- version. This library is distributed in the hope that it will be useful, -- 
  10. -- but WITHOUT ANY WARRANTY;  without even the implied warranty of MERCHAN- -- 
  11. -- TABILITY or FITNESS FOR A PARTICULAR PURPOSE.                            -- 
  12. --                                                                          -- 
  13. -- As a special exception under Section 7 of GPL version 3, you are granted -- 
  14. -- additional permissions described in the GCC Runtime Library Exception,   -- 
  15. -- version 3.1, as published by the Free Software Foundation.               -- 
  16. --                                                                          -- 
  17. -- You should have received a copy of the GNU General Public License and    -- 
  18. -- a copy of the GCC Runtime Library Exception along with this program;     -- 
  19. -- see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see    -- 
  20. -- <http://www.gnu.org/licenses/>.                                          -- 
  21. --                                                                          -- 
  22. ------------------------------------------------------------------------------ 
  23.  
  24. --  <description> 
  25. --  You may wish to begin by reading the <link linkend="TextWidget">text 
  26. --  widget conceptual overview</link> which gives an overview of all the 
  27. --  objects and data types related to the text widget and how they work 
  28. --  together. 
  29. -- 
  30. --  </description> 
  31. pragma Ada_2005; 
  32.  
  33. pragma Warnings (Off, "*is already use-visible*"); 
  34. with Gdk;                   use Gdk; 
  35. with Gdk.Event;             use Gdk.Event; 
  36. with Gdk.Rectangle;         use Gdk.Rectangle; 
  37. with Glib;                  use Glib; 
  38. with Glib.Object;           use Glib.Object; 
  39. with Glib.Properties;       use Glib.Properties; 
  40. with Glib.Types;            use Glib.Types; 
  41. with Gtk.Adjustment;        use Gtk.Adjustment; 
  42. with Gtk.Buildable;         use Gtk.Buildable; 
  43. with Gtk.Container;         use Gtk.Container; 
  44. with Gtk.Enums;             use Gtk.Enums; 
  45. with Gtk.Scrollable;        use Gtk.Scrollable; 
  46. with Gtk.Text_Attributes;   use Gtk.Text_Attributes; 
  47. with Gtk.Text_Buffer;       use Gtk.Text_Buffer; 
  48. with Gtk.Text_Child_Anchor; use Gtk.Text_Child_Anchor; 
  49. with Gtk.Text_Iter;         use Gtk.Text_Iter; 
  50. with Gtk.Text_Mark;         use Gtk.Text_Mark; 
  51. with Gtk.Widget;            use Gtk.Widget; 
  52. with Pango.Tabs;            use Pango.Tabs; 
  53.  
  54. package Gtk.Text_View is 
  55.  
  56.    type Gtk_Text_View_Record is new Gtk_Container_Record with null record; 
  57.    type Gtk_Text_View is access all Gtk_Text_View_Record'Class; 
  58.  
  59.    ------------------ 
  60.    -- Constructors -- 
  61.    ------------------ 
  62.  
  63.    procedure Gtk_New (View : out Gtk_Text_View); 
  64.    procedure Initialize (View : not null access Gtk_Text_View_Record'Class); 
  65.    --  Creates a new Gtk.Text_View.Gtk_Text_View. If you don't call 
  66.    --  Gtk.Text_View.Set_Buffer before using the text view, an empty default 
  67.    --  buffer will be created for you. Get the buffer with 
  68.    --  Gtk.Text_View.Get_Buffer. If you want to specify your own buffer, 
  69.    --  consider Gtk.Text_View.Gtk_New. 
  70.  
  71.    function Gtk_Text_View_New return Gtk_Text_View; 
  72.    --  Creates a new Gtk.Text_View.Gtk_Text_View. If you don't call 
  73.    --  Gtk.Text_View.Set_Buffer before using the text view, an empty default 
  74.    --  buffer will be created for you. Get the buffer with 
  75.    --  Gtk.Text_View.Get_Buffer. If you want to specify your own buffer, 
  76.    --  consider Gtk.Text_View.Gtk_New. 
  77.  
  78.    procedure Gtk_New 
  79.       (View   : out Gtk_Text_View; 
  80.        Buffer : not null access Gtk.Text_Buffer.Gtk_Text_Buffer_Record'Class); 
  81.    procedure Initialize 
  82.       (View   : not null access Gtk_Text_View_Record'Class; 
  83.        Buffer : not null access Gtk.Text_Buffer.Gtk_Text_Buffer_Record'Class); 
  84.    --  Creates a new Gtk.Text_View.Gtk_Text_View widget displaying the buffer 
  85.    --  Buffer. One buffer can be shared among many widgets. Buffer may be null 
  86.    --  to create a default buffer, in which case this function is equivalent to 
  87.    --  Gtk.Text_View.Gtk_New. The text view adds its own reference count to the 
  88.    --  buffer; it does not take over an existing reference. 
  89.    --  "buffer": a Gtk.Text_Buffer.Gtk_Text_Buffer 
  90.  
  91.    function Gtk_Text_View_New_With_Buffer 
  92.       (Buffer : not null access Gtk.Text_Buffer.Gtk_Text_Buffer_Record'Class) 
  93.        return Gtk_Text_View; 
  94.    --  Creates a new Gtk.Text_View.Gtk_Text_View widget displaying the buffer 
  95.    --  Buffer. One buffer can be shared among many widgets. Buffer may be null 
  96.    --  to create a default buffer, in which case this function is equivalent to 
  97.    --  Gtk.Text_View.Gtk_New. The text view adds its own reference count to the 
  98.    --  buffer; it does not take over an existing reference. 
  99.    --  "buffer": a Gtk.Text_Buffer.Gtk_Text_Buffer 
  100.  
  101.    function Get_Type return Glib.GType; 
  102.    pragma Import (C, Get_Type, "gtk_text_view_get_type"); 
  103.  
  104.    ------------- 
  105.    -- Methods -- 
  106.    ------------- 
  107.  
  108.    procedure Add_Child_At_Anchor 
  109.       (View   : not null access Gtk_Text_View_Record; 
  110.        Child  : not null access Gtk.Widget.Gtk_Widget_Record'Class; 
  111.        Anchor : not null access Gtk.Text_Child_Anchor.Gtk_Text_Child_Anchor_Record'Class); 
  112.    --  Adds a child widget in the text buffer, at the given Anchor. 
  113.    --  "child": a Gtk.Widget.Gtk_Widget 
  114.    --  "anchor": a Gtk.Text_Child_Anchor.Gtk_Text_Child_Anchor in the 
  115.    --  Gtk.Text_Buffer.Gtk_Text_Buffer for Text_View 
  116.  
  117.    procedure Add_Child_In_Window 
  118.       (View         : not null access Gtk_Text_View_Record; 
  119.        Child        : not null access Gtk.Widget.Gtk_Widget_Record'Class; 
  120.        Which_Window : Gtk.Enums.Gtk_Text_Window_Type; 
  121.        Xpos         : Gint; 
  122.        Ypos         : Gint); 
  123.    --  Adds a child at fixed coordinates in one of the text widget's windows. 
  124.    --  The window must have nonzero size (see 
  125.    --  Gtk.Text_View.Set_Border_Window_Size). Note that the child coordinates 
  126.    --  are given relative to the Gdk.Gdk_Window in question, and that these 
  127.    --  coordinates have no sane relationship to scrolling. When placing a child 
  128.    --  in GTK_TEXT_WINDOW_WIDGET, scrolling is irrelevant, the child floats 
  129.    --  above all scrollable areas. But when placing a child in one of the 
  130.    --  scrollable windows (border windows or text window), you'll need to 
  131.    --  compute the child's correct position in buffer coordinates any time 
  132.    --  scrolling occurs or buffer changes occur, and then call 
  133.    --  Gtk.Text_View.Move_Child to update the child's position. 
  134.    --  "child": a Gtk.Widget.Gtk_Widget 
  135.    --  "which_window": which window the child should appear in 
  136.    --  "xpos": X position of child in window coordinates 
  137.    --  "ypos": Y position of child in window coordinates 
  138.  
  139.    function Backward_Display_Line 
  140.       (View : not null access Gtk_Text_View_Record; 
  141.        Iter : Gtk.Text_Iter.Gtk_Text_Iter) return Boolean; 
  142.    --  Moves the given Iter backward by one display (wrapped) line. A display 
  143.    --  line is different from a paragraph. Paragraphs are separated by newlines 
  144.    --  or other paragraph separator characters. Display lines are created by 
  145.    --  line-wrapping a paragraph. If wrapping is turned off, display lines and 
  146.    --  paragraphs will be the same. Display lines are divided differently for 
  147.    --  each view, since they depend on the view's width; paragraphs are the 
  148.    --  same in all views, since they depend on the contents of the 
  149.    --  Gtk.Text_Buffer.Gtk_Text_Buffer. 
  150.    --  "iter": a Gtk.Text_Iter.Gtk_Text_Iter 
  151.  
  152.    function Backward_Display_Line_Start 
  153.       (View : not null access Gtk_Text_View_Record; 
  154.        Iter : Gtk.Text_Iter.Gtk_Text_Iter) return Boolean; 
  155.    --  Moves the given Iter backward to the next display line start. A display 
  156.    --  line is different from a paragraph. Paragraphs are separated by newlines 
  157.    --  or other paragraph separator characters. Display lines are created by 
  158.    --  line-wrapping a paragraph. If wrapping is turned off, display lines and 
  159.    --  paragraphs will be the same. Display lines are divided differently for 
  160.    --  each view, since they depend on the view's width; paragraphs are the 
  161.    --  same in all views, since they depend on the contents of the 
  162.    --  Gtk.Text_Buffer.Gtk_Text_Buffer. 
  163.    --  "iter": a Gtk.Text_Iter.Gtk_Text_Iter 
  164.  
  165.    procedure Buffer_To_Window_Coords 
  166.       (View     : not null access Gtk_Text_View_Record; 
  167.        Win      : Gtk.Enums.Gtk_Text_Window_Type; 
  168.        Buffer_X : Gint; 
  169.        Buffer_Y : Gint; 
  170.        Window_X : out Gint; 
  171.        Window_Y : out Gint); 
  172.    --  Converts coordinate (Buffer_X, Buffer_Y) to coordinates for the window 
  173.    --  Win, and stores the result in (Window_X, Window_Y). 
  174.    --  Note that you can't convert coordinates for a nonexisting window (see 
  175.    --  Gtk.Text_View.Set_Border_Window_Size). 
  176.    --  "win": a Gtk.Enums.Gtk_Text_Window_Type except GTK_TEXT_WINDOW_PRIVATE 
  177.    --  "buffer_x": buffer x coordinate 
  178.    --  "buffer_y": buffer y coordinate 
  179.    --  "window_x": window x coordinate return location or null 
  180.    --  "window_y": window y coordinate return location or null 
  181.  
  182.    function Forward_Display_Line 
  183.       (View : not null access Gtk_Text_View_Record; 
  184.        Iter : Gtk.Text_Iter.Gtk_Text_Iter) return Boolean; 
  185.    --  Moves the given Iter forward by one display (wrapped) line. A display 
  186.    --  line is different from a paragraph. Paragraphs are separated by newlines 
  187.    --  or other paragraph separator characters. Display lines are created by 
  188.    --  line-wrapping a paragraph. If wrapping is turned off, display lines and 
  189.    --  paragraphs will be the same. Display lines are divided differently for 
  190.    --  each view, since they depend on the view's width; paragraphs are the 
  191.    --  same in all views, since they depend on the contents of the 
  192.    --  Gtk.Text_Buffer.Gtk_Text_Buffer. 
  193.    --  "iter": a Gtk.Text_Iter.Gtk_Text_Iter 
  194.  
  195.    function Forward_Display_Line_End 
  196.       (View : not null access Gtk_Text_View_Record; 
  197.        Iter : Gtk.Text_Iter.Gtk_Text_Iter) return Boolean; 
  198.    --  Moves the given Iter forward to the next display line end. A display 
  199.    --  line is different from a paragraph. Paragraphs are separated by newlines 
  200.    --  or other paragraph separator characters. Display lines are created by 
  201.    --  line-wrapping a paragraph. If wrapping is turned off, display lines and 
  202.    --  paragraphs will be the same. Display lines are divided differently for 
  203.    --  each view, since they depend on the view's width; paragraphs are the 
  204.    --  same in all views, since they depend on the contents of the 
  205.    --  Gtk.Text_Buffer.Gtk_Text_Buffer. 
  206.    --  "iter": a Gtk.Text_Iter.Gtk_Text_Iter 
  207.  
  208.    function Get_Accepts_Tab 
  209.       (View : not null access Gtk_Text_View_Record) return Boolean; 
  210.    --  Returns whether pressing the Tab key inserts a tab characters. 
  211.    --  Gtk.Text_View.Set_Accepts_Tab. 
  212.    --  Since: gtk+ 2.4 
  213.  
  214.    procedure Set_Accepts_Tab 
  215.       (View        : not null access Gtk_Text_View_Record; 
  216.        Accepts_Tab : Boolean); 
  217.    --  Sets the behavior of the text widget when the Tab key is pressed. If 
  218.    --  Accepts_Tab is True, a tab character is inserted. If Accepts_Tab is 
  219.    --  False the keyboard focus is moved to the next widget in the focus chain. 
  220.    --  Since: gtk+ 2.4 
  221.    --  "accepts_tab": True if pressing the Tab key should insert a tab 
  222.    --  character, False, if pressing the Tab key should move the keyboard 
  223.    --  focus. 
  224.  
  225.    function Get_Border_Window_Size 
  226.       (View     : not null access Gtk_Text_View_Record; 
  227.        The_Type : Gtk.Enums.Gtk_Text_Window_Type) return Gint; 
  228.    --  Gets the width of the specified border window. See 
  229.    --  Gtk.Text_View.Set_Border_Window_Size. 
  230.    --  "type": window to return size from 
  231.  
  232.    procedure Set_Border_Window_Size 
  233.       (View     : not null access Gtk_Text_View_Record; 
  234.        The_Type : Gtk.Enums.Gtk_Text_Window_Type; 
  235.        Size     : Gint); 
  236.    --  Sets the width of Gtk.Enums.Text_Window_Left or 
  237.    --  Gtk.Enums.Text_Window_Right, or the height of Gtk.Enums.Text_Window_Top 
  238.    --  or Gtk.Enums.Text_Window_Bottom. Automatically destroys the 
  239.    --  corresponding window if the size is set to 0, and creates the window if 
  240.    --  the size is set to non-zero. This function can only be used for the 
  241.    --  "border windows," it doesn't work with GTK_TEXT_WINDOW_WIDGET, 
  242.    --  GTK_TEXT_WINDOW_TEXT, or GTK_TEXT_WINDOW_PRIVATE. 
  243.    --  "type": window to affect 
  244.    --  "size": width or height of the window 
  245.  
  246.    function Get_Buffer 
  247.       (View : not null access Gtk_Text_View_Record) 
  248.        return Gtk.Text_Buffer.Gtk_Text_Buffer; 
  249.    --  Returns the Gtk.Text_Buffer.Gtk_Text_Buffer being displayed by this 
  250.    --  text view. The reference count on the buffer is not incremented; the 
  251.    --  caller of this function won't own a new reference. 
  252.  
  253.    procedure Set_Buffer 
  254.       (View   : not null access Gtk_Text_View_Record; 
  255.        Buffer : access Gtk.Text_Buffer.Gtk_Text_Buffer_Record'Class); 
  256.    --  Sets Buffer as the buffer being displayed by Text_View. The previous 
  257.    --  buffer displayed by the text view is unreferenced, and a reference is 
  258.    --  added to Buffer. If you owned a reference to Buffer before passing it to 
  259.    --  this function, you must remove that reference yourself; 
  260.    --  Gtk.Text_View.Gtk_Text_View will not "adopt" it. 
  261.    --  "buffer": a Gtk.Text_Buffer.Gtk_Text_Buffer 
  262.  
  263.    procedure Get_Cursor_Locations 
  264.       (View   : not null access Gtk_Text_View_Record; 
  265.        Iter   : Gtk.Text_Iter.Gtk_Text_Iter; 
  266.        Strong : out Gdk.Rectangle.Gdk_Rectangle; 
  267.        Weak   : out Gdk.Rectangle.Gdk_Rectangle); 
  268.    --  Given an Iter within a text layout, determine the positions of the 
  269.    --  strong and weak cursors if the insertion point is at that iterator. The 
  270.    --  position of each cursor is stored as a zero-width rectangle. The strong 
  271.    --  cursor location is the location where characters of the directionality 
  272.    --  equal to the base direction of the paragraph are inserted. The weak 
  273.    --  cursor location is the location where characters of the directionality 
  274.    --  opposite to the base direction of the paragraph are inserted. 
  275.    --  If Iter is null, the actual cursor position is used. 
  276.    --  Note that if Iter happens to be the actual cursor position, and there 
  277.    --  is currently an IM preedit sequence being entered, the returned 
  278.    --  locations will be adjusted to account for the preedit cursor's offset 
  279.    --  within the preedit sequence. 
  280.    --  The rectangle position is in buffer coordinates; use 
  281.    --  Gtk.Text_View.Buffer_To_Window_Coords to convert these coordinates to 
  282.    --  coordinates for one of the windows in the text view. 
  283.    --  Since: gtk+ 3.0 
  284.    --  "iter": a Gtk.Text_Iter.Gtk_Text_Iter 
  285.    --  "strong": location to store the strong cursor position (may be null) 
  286.    --  "weak": location to store the weak cursor position (may be null) 
  287.  
  288.    function Get_Cursor_Visible 
  289.       (View : not null access Gtk_Text_View_Record) return Boolean; 
  290.    --  Find out whether the cursor is being displayed. 
  291.  
  292.    procedure Set_Cursor_Visible 
  293.       (View    : not null access Gtk_Text_View_Record; 
  294.        Setting : Boolean); 
  295.    --  Toggles whether the insertion point is displayed. A buffer with no 
  296.    --  editable text probably shouldn't have a visible cursor, so you may want 
  297.    --  to turn the cursor off. 
  298.    --  "setting": whether to show the insertion cursor 
  299.  
  300.    function Get_Default_Attributes 
  301.       (View : not null access Gtk_Text_View_Record) 
  302.        return Gtk.Text_Attributes.Gtk_Text_Attributes; 
  303.    --  Obtains a copy of the default text attributes. These are the attributes 
  304.    --  used for text unless a tag overrides them. You'd typically pass the 
  305.    --  default attributes in to Gtk.Text_Iter.Get_Attributes in order to get 
  306.    --  the attributes in effect at a given text position. 
  307.    --  The return value is a copy owned by the caller of this function, and 
  308.    --  should be freed. 
  309.  
  310.    function Get_Editable 
  311.       (View : not null access Gtk_Text_View_Record) return Boolean; 
  312.    --  Returns the default editability of the Gtk.Text_View.Gtk_Text_View. 
  313.    --  Tags in the buffer may override this setting for some ranges of text. 
  314.  
  315.    procedure Set_Editable 
  316.       (View    : not null access Gtk_Text_View_Record; 
  317.        Setting : Boolean); 
  318.    --  Sets the default editability of the Gtk.Text_View.Gtk_Text_View. You 
  319.    --  can override this default setting with tags in the buffer, using the 
  320.    --  "editable" attribute of tags. 
  321.    --  "setting": whether it's editable 
  322.  
  323.    function Get_Indent 
  324.       (View : not null access Gtk_Text_View_Record) return Gint; 
  325.    --  Gets the default indentation of paragraphs in Text_View. Tags in the 
  326.    --  view's buffer may override the default. The indentation may be negative. 
  327.  
  328.    procedure Set_Indent 
  329.       (View   : not null access Gtk_Text_View_Record; 
  330.        Indent : Gint); 
  331.    --  Sets the default indentation for paragraphs in Text_View. Tags in the 
  332.    --  buffer may override the default. 
  333.    --  "indent": indentation in pixels 
  334.  
  335.    function Get_Input_Hints 
  336.       (View : not null access Gtk_Text_View_Record) 
  337.        return Gtk.Enums.Gtk_Input_Hints; 
  338.    --  Gets the value of the Gtk.Text_View.Gtk_Text_View:input-hints property. 
  339.    --  Since: gtk+ 3.6 
  340.  
  341.    procedure Set_Input_Hints 
  342.       (View  : not null access Gtk_Text_View_Record; 
  343.        Hints : Gtk.Enums.Gtk_Input_Hints); 
  344.    --  Sets the Gtk.Text_View.Gtk_Text_View:input-hints property, which allows 
  345.    --  input methods to fine-tune their behaviour. 
  346.    --  Since: gtk+ 3.6 
  347.    --  "hints": the hints 
  348.  
  349.    function Get_Input_Purpose 
  350.       (View : not null access Gtk_Text_View_Record) 
  351.        return Gtk.Enums.Gtk_Input_Purpose; 
  352.    --  Gets the value of the Gtk.Text_View.Gtk_Text_View:input-purpose 
  353.    --  property. 
  354.    --  Since: gtk+ 3.6 
  355.  
  356.    procedure Set_Input_Purpose 
  357.       (View    : not null access Gtk_Text_View_Record; 
  358.        Purpose : Gtk.Enums.Gtk_Input_Purpose); 
  359.    --  Sets the Gtk.Text_View.Gtk_Text_View:input-purpose property which can 
  360.    --  be used by on-screen keyboards and other input methods to adjust their 
  361.    --  behaviour. 
  362.    --  Since: gtk+ 3.6 
  363.    --  "purpose": the purpose 
  364.  
  365.    procedure Get_Iter_At_Location 
  366.       (View : not null access Gtk_Text_View_Record; 
  367.        Iter : out Gtk.Text_Iter.Gtk_Text_Iter; 
  368.        X    : Gint; 
  369.        Y    : Gint); 
  370.    --  Retrieves the iterator at buffer coordinates X and Y. Buffer 
  371.    --  coordinates are coordinates for the entire buffer, not just the 
  372.    --  currently-displayed portion. If you have coordinates from an event, you 
  373.    --  have to convert those to buffer coordinates with 
  374.    --  Gtk.Text_View.Window_To_Buffer_Coords. 
  375.    --  "iter": a Gtk.Text_Iter.Gtk_Text_Iter 
  376.    --  "x": x position, in buffer coordinates 
  377.    --  "y": y position, in buffer coordinates 
  378.  
  379.    procedure Get_Iter_At_Position 
  380.       (View     : not null access Gtk_Text_View_Record; 
  381.        Iter     : out Gtk.Text_Iter.Gtk_Text_Iter; 
  382.        Trailing : out Gint; 
  383.        X        : Gint; 
  384.        Y        : Gint); 
  385.    --  Retrieves the iterator pointing to the character at buffer coordinates 
  386.    --  X and Y. Buffer coordinates are coordinates for the entire buffer, not 
  387.    --  just the currently-displayed portion. If you have coordinates from an 
  388.    --  event, you have to convert those to buffer coordinates with 
  389.    --  Gtk.Text_View.Window_To_Buffer_Coords. 
  390.    --  Note that this is different from Gtk.Text_View.Get_Iter_At_Location, 
  391.    --  which returns cursor locations, i.e. positions *between* characters. 
  392.    --  Since: gtk+ 2.6 
  393.    --  "iter": a Gtk.Text_Iter.Gtk_Text_Iter 
  394.    --  "trailing": if non-null, location to store an integer indicating where 
  395.    --  in the grapheme the user clicked. It will either be zero, or the number 
  396.    --  of characters in the grapheme. 0 represents the trailing edge of the 
  397.    --  grapheme. 
  398.    --  "x": x position, in buffer coordinates 
  399.    --  "y": y position, in buffer coordinates 
  400.  
  401.    procedure Get_Iter_Location 
  402.       (View     : not null access Gtk_Text_View_Record; 
  403.        Iter     : Gtk.Text_Iter.Gtk_Text_Iter; 
  404.        Location : out Gdk.Rectangle.Gdk_Rectangle); 
  405.    --  Gets a rectangle which roughly contains the character at Iter. The 
  406.    --  rectangle position is in buffer coordinates; use 
  407.    --  Gtk.Text_View.Buffer_To_Window_Coords to convert these coordinates to 
  408.    --  coordinates for one of the windows in the text view. 
  409.    --  "iter": a Gtk.Text_Iter.Gtk_Text_Iter 
  410.    --  "location": bounds of the character at Iter 
  411.  
  412.    function Get_Justification 
  413.       (View : not null access Gtk_Text_View_Record) 
  414.        return Gtk.Enums.Gtk_Justification; 
  415.    --  Gets the default justification of paragraphs in Text_View. Tags in the 
  416.    --  buffer may override the default. 
  417.  
  418.    procedure Set_Justification 
  419.       (View          : not null access Gtk_Text_View_Record; 
  420.        Justification : Gtk.Enums.Gtk_Justification); 
  421.    --  Sets the default justification of text in Text_View. Tags in the view's 
  422.    --  buffer may override the default. 
  423.    --  "justification": justification 
  424.  
  425.    function Get_Left_Margin 
  426.       (View : not null access Gtk_Text_View_Record) return Gint; 
  427.    --  Gets the default left margin size of paragraphs in the Text_View. Tags 
  428.    --  in the buffer may override the default. 
  429.  
  430.    procedure Set_Left_Margin 
  431.       (View        : not null access Gtk_Text_View_Record; 
  432.        Left_Margin : Gint); 
  433.    --  Sets the default left margin for text in Text_View. Tags in the buffer 
  434.    --  may override the default. 
  435.    --  "left_margin": left margin in pixels 
  436.  
  437.    procedure Get_Line_At_Y 
  438.       (View        : not null access Gtk_Text_View_Record; 
  439.        Target_Iter : out Gtk.Text_Iter.Gtk_Text_Iter; 
  440.        Y           : Gint; 
  441.        Line_Top    : out Gint); 
  442.    --  Gets the Gtk.Text_Iter.Gtk_Text_Iter at the start of the line 
  443.    --  containing the coordinate Y. Y is in buffer coordinates, convert from 
  444.    --  window coordinates with Gtk.Text_View.Window_To_Buffer_Coords. If 
  445.    --  non-null, Line_Top will be filled with the coordinate of the top edge of 
  446.    --  the line. 
  447.    --  "target_iter": a Gtk.Text_Iter.Gtk_Text_Iter 
  448.    --  "y": a y coordinate 
  449.    --  "line_top": return location for top coordinate of the line 
  450.  
  451.    procedure Get_Line_Yrange 
  452.       (View   : not null access Gtk_Text_View_Record; 
  453.        Iter   : Gtk.Text_Iter.Gtk_Text_Iter; 
  454.        Y      : out Gint; 
  455.        Height : out Gint); 
  456.    --  Gets the y coordinate of the top of the line containing Iter, and the 
  457.    --  height of the line. The coordinate is a buffer coordinate; convert to 
  458.    --  window coordinates with Gtk.Text_View.Buffer_To_Window_Coords. 
  459.    --  "iter": a Gtk.Text_Iter.Gtk_Text_Iter 
  460.    --  "y": return location for a y coordinate 
  461.    --  "height": return location for a height 
  462.  
  463.    function Get_Overwrite 
  464.       (View : not null access Gtk_Text_View_Record) return Boolean; 
  465.    --  Returns whether the Gtk.Text_View.Gtk_Text_View is in overwrite mode or 
  466.    --  not. 
  467.    --  Since: gtk+ 2.4 
  468.  
  469.    procedure Set_Overwrite 
  470.       (View      : not null access Gtk_Text_View_Record; 
  471.        Overwrite : Boolean); 
  472.    --  Changes the Gtk.Text_View.Gtk_Text_View overwrite mode. 
  473.    --  Since: gtk+ 2.4 
  474.    --  "overwrite": True to turn on overwrite mode, False to turn it off 
  475.  
  476.    function Get_Pixels_Above_Lines 
  477.       (View : not null access Gtk_Text_View_Record) return Gint; 
  478.    --  Gets the default number of pixels to put above paragraphs. 
  479.  
  480.    procedure Set_Pixels_Above_Lines 
  481.       (View               : not null access Gtk_Text_View_Record; 
  482.        Pixels_Above_Lines : Gint); 
  483.    --  Sets the default number of blank pixels above paragraphs in Text_View. 
  484.    --  Tags in the buffer for Text_View may override the defaults. 
  485.    --  "pixels_above_lines": pixels above paragraphs 
  486.  
  487.    function Get_Pixels_Below_Lines 
  488.       (View : not null access Gtk_Text_View_Record) return Gint; 
  489.    --  Gets the value set by Gtk.Text_View.Set_Pixels_Below_Lines. 
  490.  
  491.    procedure Set_Pixels_Below_Lines 
  492.       (View               : not null access Gtk_Text_View_Record; 
  493.        Pixels_Below_Lines : Gint); 
  494.    --  Sets the default number of pixels of blank space to put below 
  495.    --  paragraphs in Text_View. May be overridden by tags applied to 
  496.    --  Text_View's buffer. 
  497.    --  "pixels_below_lines": pixels below paragraphs 
  498.  
  499.    function Get_Pixels_Inside_Wrap 
  500.       (View : not null access Gtk_Text_View_Record) return Gint; 
  501.    --  Gets the value set by Gtk.Text_View.Set_Pixels_Inside_Wrap. 
  502.  
  503.    procedure Set_Pixels_Inside_Wrap 
  504.       (View               : not null access Gtk_Text_View_Record; 
  505.        Pixels_Inside_Wrap : Gint); 
  506.    --  Sets the default number of pixels of blank space to leave between 
  507.    --  display/wrapped lines within a paragraph. May be overridden by tags in 
  508.    --  Text_View's buffer. 
  509.    --  "pixels_inside_wrap": default number of pixels between wrapped lines 
  510.  
  511.    function Get_Right_Margin 
  512.       (View : not null access Gtk_Text_View_Record) return Gint; 
  513.    --  Gets the default right margin for text in Text_View. Tags in the buffer 
  514.    --  may override the default. 
  515.  
  516.    procedure Set_Right_Margin 
  517.       (View         : not null access Gtk_Text_View_Record; 
  518.        Right_Margin : Gint); 
  519.    --  Sets the default right margin for text in the text view. Tags in the 
  520.    --  buffer may override the default. 
  521.    --  "right_margin": right margin in pixels 
  522.  
  523.    function Get_Tabs 
  524.       (View : not null access Gtk_Text_View_Record) 
  525.        return Pango.Tabs.Pango_Tab_Array; 
  526.    --  Gets the default tabs for Text_View. Tags in the buffer may override 
  527.    --  the defaults. The returned array will be null if "standard" (8-space) 
  528.    --  tabs are used. Free the return value with Pango.Tabs.Free. 
  529.  
  530.    procedure Set_Tabs 
  531.       (View : not null access Gtk_Text_View_Record; 
  532.        Tabs : Pango.Tabs.Pango_Tab_Array); 
  533.    --  Sets the default tab stops for paragraphs in Text_View. Tags in the 
  534.    --  buffer may override the default. 
  535.    --  "tabs": tabs as a Pango.Tabs.Pango_Tab_Array 
  536.  
  537.    procedure Get_Visible_Rect 
  538.       (View         : not null access Gtk_Text_View_Record; 
  539.        Visible_Rect : out Gdk.Rectangle.Gdk_Rectangle); 
  540.    --  Fills Visible_Rect with the currently-visible region of the buffer, in 
  541.    --  buffer coordinates. Convert to window coordinates with 
  542.    --  Gtk.Text_View.Buffer_To_Window_Coords. 
  543.    --  "visible_rect": rectangle to fill 
  544.  
  545.    function Get_Window 
  546.       (View : not null access Gtk_Text_View_Record; 
  547.        Win  : Gtk.Enums.Gtk_Text_Window_Type) return Gdk.Gdk_Window; 
  548.    --  Retrieves the Gdk.Gdk_Window corresponding to an area of the text view; 
  549.    --  possible windows include the overall widget window, child windows on the 
  550.    --  left, right, top, bottom, and the window that displays the text buffer. 
  551.    --  Windows are null and nonexistent if their width or height is 0, and are 
  552.    --  nonexistent before the widget has been realized. 
  553.    --  "win": window to get 
  554.  
  555.    function Get_Window_Type 
  556.       (View   : not null access Gtk_Text_View_Record; 
  557.        Window : Gdk.Gdk_Window) return Gtk.Enums.Gtk_Text_Window_Type; 
  558.    --  Usually used to find out which window an event corresponds to. If you 
  559.    --  connect to an event signal on Text_View, this function should be called 
  560.    --  on 'event->window' to see which window it was. 
  561.    --  "window": a window type 
  562.  
  563.    function Get_Wrap_Mode 
  564.       (View : not null access Gtk_Text_View_Record) 
  565.        return Gtk.Enums.Gtk_Wrap_Mode; 
  566.    --  Gets the line wrapping for the view. 
  567.  
  568.    procedure Set_Wrap_Mode 
  569.       (View      : not null access Gtk_Text_View_Record; 
  570.        Wrap_Mode : Gtk.Enums.Gtk_Wrap_Mode); 
  571.    --  Sets the line wrapping for the view. 
  572.    --  "wrap_mode": a Gtk.Enums.Gtk_Wrap_Mode 
  573.  
  574.    function Im_Context_Filter_Keypress 
  575.       (View  : not null access Gtk_Text_View_Record; 
  576.        Event : Gdk.Event.Gdk_Event_Key) return Boolean; 
  577.    --  Allow the Gtk.Text_View.Gtk_Text_View input method to internally handle 
  578.    --  key press and release events. If this function returns True, then no 
  579.    --  further processing should be done for this key event. See 
  580.    --  Gtk.IM_Context.Filter_Keypress. 
  581.    --  Note that you are expected to call this function from your handler when 
  582.    --  overriding key event handling. This is needed in the case when you need 
  583.    --  to insert your own key handling between the input method and the default 
  584.    --  key event handling of the Gtk.Text_View.Gtk_Text_View. 
  585.    --  |[ static gboolean gtk_foo_bar_key_press_event (GtkWidget *widget, 
  586.    --  GdkEventKey *event) { if ((key->keyval == GDK_KEY_Return || key->keyval 
  587.    --  == GDK_KEY_KP_Enter)) { if (gtk_text_view_im_context_filter_keypress 
  588.    --  (GTK_TEXT_VIEW (view), event)) return TRUE; } 
  589.    --  /* Do some stuff */ 
  590.    --  return GTK_WIDGET_CLASS (gtk_foo_bar_parent_class)->key_press_event 
  591.    --  (widget, event); } ]| 
  592.    --  Since: gtk+ 2.22 
  593.    --  "event": the key event 
  594.  
  595.    procedure Move_Child 
  596.       (View  : not null access Gtk_Text_View_Record; 
  597.        Child : not null access Gtk.Widget.Gtk_Widget_Record'Class; 
  598.        Xpos  : Gint; 
  599.        Ypos  : Gint); 
  600.    --  Updates the position of a child, as for 
  601.    --  Gtk.Text_View.Add_Child_In_Window. 
  602.    --  "child": child widget already added to the text view 
  603.    --  "xpos": new X position in window coordinates 
  604.    --  "ypos": new Y position in window coordinates 
  605.  
  606.    function Move_Mark_Onscreen 
  607.       (View : not null access Gtk_Text_View_Record; 
  608.        Mark : not null access Gtk.Text_Mark.Gtk_Text_Mark_Record'Class) 
  609.        return Boolean; 
  610.    --  Moves a mark within the buffer so that it's located within the 
  611.    --  currently-visible text area. 
  612.    --  "mark": a Gtk.Text_Mark.Gtk_Text_Mark 
  613.  
  614.    function Move_Visually 
  615.       (View  : not null access Gtk_Text_View_Record; 
  616.        Iter  : Gtk.Text_Iter.Gtk_Text_Iter; 
  617.        Count : Gint) return Boolean; 
  618.    --  Move the iterator a given number of characters visually, treating it as 
  619.    --  the strong cursor position. If Count is positive, then the new strong 
  620.    --  cursor position will be Count positions to the right of the old cursor 
  621.    --  position. If Count is negative then the new strong cursor position will 
  622.    --  be Count positions to the left of the old cursor position. 
  623.    --  In the presence of bi-directional text, the correspondence between 
  624.    --  logical and visual order will depend on the direction of the current 
  625.    --  run, and there may be jumps when the cursor is moved off of the end of a 
  626.    --  run. 
  627.    --  "iter": a Gtk.Text_Iter.Gtk_Text_Iter 
  628.    --  "count": number of characters to move (negative moves left, positive 
  629.    --  moves right) 
  630.  
  631.    function Place_Cursor_Onscreen 
  632.       (View : not null access Gtk_Text_View_Record) return Boolean; 
  633.    --  Moves the cursor to the currently visible region of the buffer, it it 
  634.    --  isn't there already. 
  635.  
  636.    procedure Reset_Im_Context (View : not null access Gtk_Text_View_Record); 
  637.    --  Reset the input method context of the text view if needed. 
  638.    --  This can be necessary in the case where modifying the buffer would 
  639.    --  confuse on-going input method behavior. 
  640.    --  Since: gtk+ 2.22 
  641.  
  642.    procedure Scroll_Mark_Onscreen 
  643.       (View : not null access Gtk_Text_View_Record; 
  644.        Mark : not null access Gtk.Text_Mark.Gtk_Text_Mark_Record'Class); 
  645.    --  Scrolls Text_View the minimum distance such that Mark is contained 
  646.    --  within the visible area of the widget. 
  647.    --  "mark": a mark in the buffer for Text_View 
  648.  
  649.    function Scroll_To_Iter 
  650.       (View          : not null access Gtk_Text_View_Record; 
  651.        Iter          : Gtk.Text_Iter.Gtk_Text_Iter; 
  652.        Within_Margin : Gdouble; 
  653.        Use_Align     : Boolean; 
  654.        Xalign        : Gdouble; 
  655.        Yalign        : Gdouble) return Boolean; 
  656.    --  Scrolls Text_View so that Iter is on the screen in the position 
  657.    --  indicated by Xalign and Yalign. An alignment of 0.0 indicates left or 
  658.    --  top, 1.0 indicates right or bottom, 0.5 means center. If Use_Align is 
  659.    --  False, the text scrolls the minimal distance to get the mark onscreen, 
  660.    --  possibly not scrolling at all. The effective screen for purposes of this 
  661.    --  function is reduced by a margin of size Within_Margin. 
  662.    --  Note that this function uses the currently-computed height of the lines 
  663.    --  in the text buffer. Line heights are computed in an idle handler; so 
  664.    --  this function may not have the desired effect if it's called before the 
  665.    --  height computations. To avoid oddness, consider using 
  666.    --  Gtk.Text_View.Scroll_To_Mark which saves a point to be scrolled to after 
  667.    --  line validation. 
  668.    --  "iter": a Gtk.Text_Iter.Gtk_Text_Iter 
  669.    --  "within_margin": margin as a [0.0,0.5) fraction of screen size 
  670.    --  "use_align": whether to use alignment arguments (if False, just get the 
  671.    --  mark onscreen) 
  672.    --  "xalign": horizontal alignment of mark within visible area 
  673.    --  "yalign": vertical alignment of mark within visible area 
  674.  
  675.    procedure Scroll_To_Mark 
  676.       (View          : not null access Gtk_Text_View_Record; 
  677.        Mark          : not null access Gtk.Text_Mark.Gtk_Text_Mark_Record'Class; 
  678.        Within_Margin : Gdouble; 
  679.        Use_Align     : Boolean; 
  680.        Xalign        : Gdouble; 
  681.        Yalign        : Gdouble); 
  682.    --  Scrolls Text_View so that Mark is on the screen in the position 
  683.    --  indicated by Xalign and Yalign. An alignment of 0.0 indicates left or 
  684.    --  top, 1.0 indicates right or bottom, 0.5 means center. If Use_Align is 
  685.    --  False, the text scrolls the minimal distance to get the mark onscreen, 
  686.    --  possibly not scrolling at all. The effective screen for purposes of this 
  687.    --  function is reduced by a margin of size Within_Margin. 
  688.    --  "mark": a Gtk.Text_Mark.Gtk_Text_Mark 
  689.    --  "within_margin": margin as a [0.0,0.5) fraction of screen size 
  690.    --  "use_align": whether to use alignment arguments (if False, just get the 
  691.    --  mark onscreen) 
  692.    --  "xalign": horizontal alignment of mark within visible area 
  693.    --  "yalign": vertical alignment of mark within visible area 
  694.  
  695.    function Starts_Display_Line 
  696.       (View : not null access Gtk_Text_View_Record; 
  697.        Iter : Gtk.Text_Iter.Gtk_Text_Iter) return Boolean; 
  698.    --  Determines whether Iter is at the start of a display line. See 
  699.    --  Gtk.Text_View.Forward_Display_Line for an explanation of display lines 
  700.    --  vs. paragraphs. 
  701.    --  "iter": a Gtk.Text_Iter.Gtk_Text_Iter 
  702.  
  703.    procedure Window_To_Buffer_Coords 
  704.       (View     : not null access Gtk_Text_View_Record; 
  705.        Win      : Gtk.Enums.Gtk_Text_Window_Type; 
  706.        Window_X : Gint; 
  707.        Window_Y : Gint; 
  708.        Buffer_X : out Gint; 
  709.        Buffer_Y : out Gint); 
  710.    --  Converts coordinates on the window identified by Win to buffer 
  711.    --  coordinates, storing the result in (Buffer_X,Buffer_Y). 
  712.    --  Note that you can't convert coordinates for a nonexisting window (see 
  713.    --  Gtk.Text_View.Set_Border_Window_Size). 
  714.    --  "win": a Gtk.Enums.Gtk_Text_Window_Type except GTK_TEXT_WINDOW_PRIVATE 
  715.    --  "window_x": window x coordinate 
  716.    --  "window_y": window y coordinate 
  717.    --  "buffer_x": buffer x coordinate return location or null 
  718.    --  "buffer_y": buffer y coordinate return location or null 
  719.  
  720.    --------------------------------------------- 
  721.    -- Inherited subprograms (from interfaces) -- 
  722.    --------------------------------------------- 
  723.    --  Methods inherited from the Buildable interface are not duplicated here 
  724.    --  since they are meant to be used by tools, mostly. If you need to call 
  725.    --  them, use an explicit cast through the "-" operator below. 
  726.  
  727.    function Get_Hadjustment 
  728.       (Self : not null access Gtk_Text_View_Record) 
  729.        return Gtk.Adjustment.Gtk_Adjustment; 
  730.  
  731.    procedure Set_Hadjustment 
  732.       (Self        : not null access Gtk_Text_View_Record; 
  733.        Hadjustment : access Gtk.Adjustment.Gtk_Adjustment_Record'Class); 
  734.  
  735.    function Get_Hscroll_Policy 
  736.       (Self : not null access Gtk_Text_View_Record) 
  737.        return Gtk.Enums.Gtk_Scrollable_Policy; 
  738.  
  739.    procedure Set_Hscroll_Policy 
  740.       (Self   : not null access Gtk_Text_View_Record; 
  741.        Policy : Gtk.Enums.Gtk_Scrollable_Policy); 
  742.  
  743.    function Get_Vadjustment 
  744.       (Self : not null access Gtk_Text_View_Record) 
  745.        return Gtk.Adjustment.Gtk_Adjustment; 
  746.  
  747.    procedure Set_Vadjustment 
  748.       (Self        : not null access Gtk_Text_View_Record; 
  749.        Vadjustment : access Gtk.Adjustment.Gtk_Adjustment_Record'Class); 
  750.  
  751.    function Get_Vscroll_Policy 
  752.       (Self : not null access Gtk_Text_View_Record) 
  753.        return Gtk.Enums.Gtk_Scrollable_Policy; 
  754.  
  755.    procedure Set_Vscroll_Policy 
  756.       (Self   : not null access Gtk_Text_View_Record; 
  757.        Policy : Gtk.Enums.Gtk_Scrollable_Policy); 
  758.  
  759.    ---------------- 
  760.    -- Properties -- 
  761.    ---------------- 
  762.    --  The following properties are defined for this widget. See 
  763.    --  Glib.Properties for more information on properties) 
  764.  
  765.    Accepts_Tab_Property : constant Glib.Properties.Property_Boolean; 
  766.  
  767.    Buffer_Property : constant Glib.Properties.Property_Object; 
  768.    --  Type: Gtk.Text_Buffer.Gtk_Text_Buffer 
  769.  
  770.    Cursor_Visible_Property : constant Glib.Properties.Property_Boolean; 
  771.  
  772.    Editable_Property : constant Glib.Properties.Property_Boolean; 
  773.  
  774.    Im_Module_Property : constant Glib.Properties.Property_String; 
  775.    --  Which IM (input method) module should be used for this text_view. See 
  776.    --  Gtk.IM_Context.Gtk_IM_Context. 
  777.    -- 
  778.    --  Setting this to a non-null value overrides the system-wide IM module 
  779.    --  setting. See the GtkSettings Gtk.Settings.Gtk_Settings:gtk-im-module 
  780.    --  property. 
  781.  
  782.    Indent_Property : constant Glib.Properties.Property_Int; 
  783.  
  784.    Input_Hints_Property : constant Gtk.Enums.Property_Gtk_Input_Hints; 
  785.    --  Additional hints (beyond Gtk.Text_View.Gtk_Text_View:input-purpose) 
  786.    --  that allow input methods to fine-tune their behaviour. 
  787.  
  788.    Input_Purpose_Property : constant Gtk.Enums.Property_Gtk_Input_Purpose; 
  789.    --  The purpose of this text field. 
  790.    -- 
  791.    --  This property can be used by on-screen keyboards and other input 
  792.    --  methods to adjust their behaviour. 
  793.  
  794.    Justification_Property : constant Gtk.Enums.Property_Gtk_Justification; 
  795.  
  796.    Left_Margin_Property : constant Glib.Properties.Property_Int; 
  797.  
  798.    Overwrite_Property : constant Glib.Properties.Property_Boolean; 
  799.  
  800.    Pixels_Above_Lines_Property : constant Glib.Properties.Property_Int; 
  801.  
  802.    Pixels_Below_Lines_Property : constant Glib.Properties.Property_Int; 
  803.  
  804.    Pixels_Inside_Wrap_Property : constant Glib.Properties.Property_Int; 
  805.  
  806.    Populate_All_Property : constant Glib.Properties.Property_Boolean; 
  807.  
  808.    Right_Margin_Property : constant Glib.Properties.Property_Int; 
  809.  
  810.    Tabs_Property : constant Glib.Properties.Property_Boxed; 
  811.    --  Type: Pango.Tab_Array 
  812.  
  813.    Wrap_Mode_Property : constant Gtk.Enums.Property_Gtk_Wrap_Mode; 
  814.  
  815.    ------------- 
  816.    -- Signals -- 
  817.    ------------- 
  818.  
  819.    type Cb_Gtk_Text_View_Void is not null access procedure (Self : access Gtk_Text_View_Record'Class); 
  820.  
  821.    type Cb_GObject_Void is not null access procedure 
  822.      (Self : access Glib.Object.GObject_Record'Class); 
  823.  
  824.    Signal_Backspace : constant Glib.Signal_Name := "backspace"; 
  825.    procedure On_Backspace 
  826.       (Self  : not null access Gtk_Text_View_Record; 
  827.        Call  : Cb_Gtk_Text_View_Void; 
  828.        After : Boolean := False); 
  829.    procedure On_Backspace 
  830.       (Self  : not null access Gtk_Text_View_Record; 
  831.        Call  : Cb_GObject_Void; 
  832.        Slot  : not null access Glib.Object.GObject_Record'Class; 
  833.        After : Boolean := False); 
  834.    --  The ::backspace signal is a <link 
  835.    --  linkend="keybinding-signals">keybinding signal</link> which gets emitted 
  836.    --  when the user asks for it. 
  837.    -- 
  838.    --  The default bindings for this signal are Backspace and Shift-Backspace. 
  839.  
  840.    Signal_Copy_Clipboard : constant Glib.Signal_Name := "copy-clipboard"; 
  841.    procedure On_Copy_Clipboard 
  842.       (Self  : not null access Gtk_Text_View_Record; 
  843.        Call  : Cb_Gtk_Text_View_Void; 
  844.        After : Boolean := False); 
  845.    procedure On_Copy_Clipboard 
  846.       (Self  : not null access Gtk_Text_View_Record; 
  847.        Call  : Cb_GObject_Void; 
  848.        Slot  : not null access Glib.Object.GObject_Record'Class; 
  849.        After : Boolean := False); 
  850.    --  The ::copy-clipboard signal is a <link 
  851.    --  linkend="keybinding-signals">keybinding signal</link> which gets emitted 
  852.    --  to copy the selection to the clipboard. 
  853.    -- 
  854.    --  The default bindings for this signal are Ctrl-c and Ctrl-Insert. 
  855.  
  856.    Signal_Cut_Clipboard : constant Glib.Signal_Name := "cut-clipboard"; 
  857.    procedure On_Cut_Clipboard 
  858.       (Self  : not null access Gtk_Text_View_Record; 
  859.        Call  : Cb_Gtk_Text_View_Void; 
  860.        After : Boolean := False); 
  861.    procedure On_Cut_Clipboard 
  862.       (Self  : not null access Gtk_Text_View_Record; 
  863.        Call  : Cb_GObject_Void; 
  864.        Slot  : not null access Glib.Object.GObject_Record'Class; 
  865.        After : Boolean := False); 
  866.    --  The ::cut-clipboard signal is a <link 
  867.    --  linkend="keybinding-signals">keybinding signal</link> which gets emitted 
  868.    --  to cut the selection to the clipboard. 
  869.    -- 
  870.    --  The default bindings for this signal are Ctrl-x and Shift-Delete. 
  871.  
  872.    type Cb_Gtk_Text_View_Gtk_Delete_Type_Gint_Void is not null access procedure 
  873.      (Self     : access Gtk_Text_View_Record'Class; 
  874.       The_Type : Gtk.Enums.Gtk_Delete_Type; 
  875.       Count    : Gint); 
  876.  
  877.    type Cb_GObject_Gtk_Delete_Type_Gint_Void is not null access procedure 
  878.      (Self     : access Glib.Object.GObject_Record'Class; 
  879.       The_Type : Gtk.Enums.Gtk_Delete_Type; 
  880.       Count    : Gint); 
  881.  
  882.    Signal_Delete_From_Cursor : constant Glib.Signal_Name := "delete-from-cursor"; 
  883.    procedure On_Delete_From_Cursor 
  884.       (Self  : not null access Gtk_Text_View_Record; 
  885.        Call  : Cb_Gtk_Text_View_Gtk_Delete_Type_Gint_Void; 
  886.        After : Boolean := False); 
  887.    procedure On_Delete_From_Cursor 
  888.       (Self  : not null access Gtk_Text_View_Record; 
  889.        Call  : Cb_GObject_Gtk_Delete_Type_Gint_Void; 
  890.        Slot  : not null access Glib.Object.GObject_Record'Class; 
  891.        After : Boolean := False); 
  892.    --  The ::delete-from-cursor signal is a <link 
  893.    --  linkend="keybinding-signals">keybinding signal</link> which gets emitted 
  894.    --  when the user initiates a text deletion. 
  895.    -- 
  896.    --  If the Type is Gtk.Enums.Delete_Chars, GTK+ deletes the selection if 
  897.    --  there is one, otherwise it deletes the requested number of characters. 
  898.    -- 
  899.    --  The default bindings for this signal are Delete for deleting a 
  900.    --  character, Ctrl-Delete for deleting a word and Ctrl-Backspace for 
  901.    --  deleting a word backwords. 
  902.    --  
  903.    --  Callback parameters: 
  904.    --    --  "type": the granularity of the deletion, as a Gtk.Enums.Gtk_Delete_Type 
  905.    --    --  "count": the number of Type units to delete 
  906.  
  907.    type Cb_Gtk_Text_View_UTF8_String_Void is not null access procedure 
  908.      (Self   : access Gtk_Text_View_Record'Class; 
  909.       String : UTF8_String); 
  910.  
  911.    type Cb_GObject_UTF8_String_Void is not null access procedure 
  912.      (Self   : access Glib.Object.GObject_Record'Class; 
  913.       String : UTF8_String); 
  914.  
  915.    Signal_Insert_At_Cursor : constant Glib.Signal_Name := "insert-at-cursor"; 
  916.    procedure On_Insert_At_Cursor 
  917.       (Self  : not null access Gtk_Text_View_Record; 
  918.        Call  : Cb_Gtk_Text_View_UTF8_String_Void; 
  919.        After : Boolean := False); 
  920.    procedure On_Insert_At_Cursor 
  921.       (Self  : not null access Gtk_Text_View_Record; 
  922.        Call  : Cb_GObject_UTF8_String_Void; 
  923.        Slot  : not null access Glib.Object.GObject_Record'Class; 
  924.        After : Boolean := False); 
  925.    --  The ::insert-at-cursor signal is a <link 
  926.    --  linkend="keybinding-signals">keybinding signal</link> which gets emitted 
  927.    --  when the user initiates the insertion of a fixed string at the cursor. 
  928.    -- 
  929.    --  This signal has no default bindings. 
  930.  
  931.    type Cb_Gtk_Text_View_Gtk_Movement_Step_Gint_Boolean_Void is not null access procedure 
  932.      (Self             : access Gtk_Text_View_Record'Class; 
  933.       Step             : Gtk.Enums.Gtk_Movement_Step; 
  934.       Count            : Gint; 
  935.       Extend_Selection : Boolean); 
  936.  
  937.    type Cb_GObject_Gtk_Movement_Step_Gint_Boolean_Void is not null access procedure 
  938.      (Self             : access Glib.Object.GObject_Record'Class; 
  939.       Step             : Gtk.Enums.Gtk_Movement_Step; 
  940.       Count            : Gint; 
  941.       Extend_Selection : Boolean); 
  942.  
  943.    Signal_Move_Cursor : constant Glib.Signal_Name := "move-cursor"; 
  944.    procedure On_Move_Cursor 
  945.       (Self  : not null access Gtk_Text_View_Record; 
  946.        Call  : Cb_Gtk_Text_View_Gtk_Movement_Step_Gint_Boolean_Void; 
  947.        After : Boolean := False); 
  948.    procedure On_Move_Cursor 
  949.       (Self  : not null access Gtk_Text_View_Record; 
  950.        Call  : Cb_GObject_Gtk_Movement_Step_Gint_Boolean_Void; 
  951.        Slot  : not null access Glib.Object.GObject_Record'Class; 
  952.        After : Boolean := False); 
  953.    --  The ::move-cursor signal is a <link 
  954.    --  linkend="keybinding-signals">keybinding signal</link> which gets emitted 
  955.    --  when the user initiates a cursor movement. If the cursor is not visible 
  956.    --  in Text_View, this signal causes the viewport to be moved instead. 
  957.    -- 
  958.    --  Applications should not connect to it, but may emit it with 
  959.    --  g_signal_emit_by_name if they need to control the cursor 
  960.    --  programmatically. 
  961.    -- 
  962.    --  The default bindings for this signal come in two variants, the variant 
  963.    --  with the Shift modifier extends the selection, the variant without the 
  964.    --  Shift modifer does not. There are too many key combinations to list them 
  965.    --  all here. 
  966.    -- 
  967.    --     * Arrow keys move by individual characters/lines 
  968.    -- 
  969.    --     * Ctrl-arrow key combinations move by words/paragraphs 
  970.    -- 
  971.    --     * Home/End keys move to the ends of the buffer 
  972.    -- 
  973.    --     * PageUp/PageDown keys move vertically by pages 
  974.    -- 
  975.    --     * Ctrl-PageUp/PageDown keys move horizontally by pages 
  976.    --  
  977.    --  Callback parameters: 
  978.    --    --  "step": the granularity of the move, as a Gtk.Enums.Gtk_Movement_Step 
  979.    --    --  "count": the number of Step units to move 
  980.    --    --  "extend_selection": True if the move should extend the selection 
  981.  
  982.    type Cb_Gtk_Text_View_Gtk_Scroll_Step_Gint_Void is not null access procedure 
  983.      (Self  : access Gtk_Text_View_Record'Class; 
  984.       Step  : Gtk.Enums.Gtk_Scroll_Step; 
  985.       Count : Gint); 
  986.  
  987.    type Cb_GObject_Gtk_Scroll_Step_Gint_Void is not null access procedure 
  988.      (Self  : access Glib.Object.GObject_Record'Class; 
  989.       Step  : Gtk.Enums.Gtk_Scroll_Step; 
  990.       Count : Gint); 
  991.  
  992.    Signal_Move_Viewport : constant Glib.Signal_Name := "move-viewport"; 
  993.    procedure On_Move_Viewport 
  994.       (Self  : not null access Gtk_Text_View_Record; 
  995.        Call  : Cb_Gtk_Text_View_Gtk_Scroll_Step_Gint_Void; 
  996.        After : Boolean := False); 
  997.    procedure On_Move_Viewport 
  998.       (Self  : not null access Gtk_Text_View_Record; 
  999.        Call  : Cb_GObject_Gtk_Scroll_Step_Gint_Void; 
  1000.        Slot  : not null access Glib.Object.GObject_Record'Class; 
  1001.        After : Boolean := False); 
  1002.    --  The ::move-viewport signal is a <link 
  1003.    --  linkend="keybinding-signals">keybinding signal</link> which can be bound 
  1004.    --  to key combinations to allow the user to move the viewport, i.e. change 
  1005.    --  what part of the text view is visible in a containing scrolled window. 
  1006.    -- 
  1007.    --  There are no default bindings for this signal. 
  1008.    --  
  1009.    --  Callback parameters: 
  1010.    --    --  "step": the granularity of the move, as a Gtk.Enums.Gtk_Movement_Step 
  1011.    --    --  "count": the number of Step units to move 
  1012.  
  1013.    Signal_Paste_Clipboard : constant Glib.Signal_Name := "paste-clipboard"; 
  1014.    procedure On_Paste_Clipboard 
  1015.       (Self  : not null access Gtk_Text_View_Record; 
  1016.        Call  : Cb_Gtk_Text_View_Void; 
  1017.        After : Boolean := False); 
  1018.    procedure On_Paste_Clipboard 
  1019.       (Self  : not null access Gtk_Text_View_Record; 
  1020.        Call  : Cb_GObject_Void; 
  1021.        Slot  : not null access Glib.Object.GObject_Record'Class; 
  1022.        After : Boolean := False); 
  1023.    --  The ::paste-clipboard signal is a <link 
  1024.    --  linkend="keybinding-signals">keybinding signal</link> which gets emitted 
  1025.    --  to paste the contents of the clipboard into the text view. 
  1026.    -- 
  1027.    --  The default bindings for this signal are Ctrl-v and Shift-Insert. 
  1028.  
  1029.    type Cb_Gtk_Text_View_Gtk_Widget_Void is not null access procedure 
  1030.      (Self  : access Gtk_Text_View_Record'Class; 
  1031.       Popup : not null access Gtk.Widget.Gtk_Widget_Record'Class); 
  1032.  
  1033.    type Cb_GObject_Gtk_Widget_Void is not null access procedure 
  1034.      (Self  : access Glib.Object.GObject_Record'Class; 
  1035.       Popup : not null access Gtk.Widget.Gtk_Widget_Record'Class); 
  1036.  
  1037.    Signal_Populate_Popup : constant Glib.Signal_Name := "populate-popup"; 
  1038.    procedure On_Populate_Popup 
  1039.       (Self  : not null access Gtk_Text_View_Record; 
  1040.        Call  : Cb_Gtk_Text_View_Gtk_Widget_Void; 
  1041.        After : Boolean := False); 
  1042.    procedure On_Populate_Popup 
  1043.       (Self  : not null access Gtk_Text_View_Record; 
  1044.        Call  : Cb_GObject_Gtk_Widget_Void; 
  1045.        Slot  : not null access Glib.Object.GObject_Record'Class; 
  1046.        After : Boolean := False); 
  1047.    --  The ::populate-popup signal gets emitted before showing the context 
  1048.    --  menu of the text view. 
  1049.    -- 
  1050.    --  If you need to add items to the context menu, connect to this signal 
  1051.    --  and append your items to the Popup, which will be a Gtk.Menu.Gtk_Menu in 
  1052.    --  this case. 
  1053.    -- 
  1054.    --  If Gtk.GEntry.Gtk_Entry::populate-toolbar is True, this signal will 
  1055.    --  also be emitted to populate touch popups. In this case, Popup will be a 
  1056.    --  different container, e.g. a Gtk.Toolbar.Gtk_Toolbar. 
  1057.    -- 
  1058.    --  The signal handler should not make assumptions about the type of 
  1059.    --  Widget, but check whether Popup is a Gtk.Menu.Gtk_Menu or 
  1060.    --  Gtk.Toolbar.Gtk_Toolbar or another kind of container. 
  1061.  
  1062.    Signal_Preedit_Changed : constant Glib.Signal_Name := "preedit-changed"; 
  1063.    procedure On_Preedit_Changed 
  1064.       (Self  : not null access Gtk_Text_View_Record; 
  1065.        Call  : Cb_Gtk_Text_View_UTF8_String_Void; 
  1066.        After : Boolean := False); 
  1067.    procedure On_Preedit_Changed 
  1068.       (Self  : not null access Gtk_Text_View_Record; 
  1069.        Call  : Cb_GObject_UTF8_String_Void; 
  1070.        Slot  : not null access Glib.Object.GObject_Record'Class; 
  1071.        After : Boolean := False); 
  1072.    --  If an input method is used, the typed text will not immediately be 
  1073.    --  committed to the buffer. So if you are interested in the text, connect 
  1074.    --  to this signal. 
  1075.    -- 
  1076.    --  This signal is only emitted if the text at the given position is 
  1077.    --  actually editable. 
  1078.  
  1079.    type Cb_Gtk_Text_View_Boolean_Void is not null access procedure 
  1080.      (Self       : access Gtk_Text_View_Record'Class; 
  1081.       Gtk_Select : Boolean); 
  1082.  
  1083.    type Cb_GObject_Boolean_Void is not null access procedure 
  1084.      (Self       : access Glib.Object.GObject_Record'Class; 
  1085.       Gtk_Select : Boolean); 
  1086.  
  1087.    Signal_Select_All : constant Glib.Signal_Name := "select-all"; 
  1088.    procedure On_Select_All 
  1089.       (Self  : not null access Gtk_Text_View_Record; 
  1090.        Call  : Cb_Gtk_Text_View_Boolean_Void; 
  1091.        After : Boolean := False); 
  1092.    procedure On_Select_All 
  1093.       (Self  : not null access Gtk_Text_View_Record; 
  1094.        Call  : Cb_GObject_Boolean_Void; 
  1095.        Slot  : not null access Glib.Object.GObject_Record'Class; 
  1096.        After : Boolean := False); 
  1097.    --  The ::select-all signal is a <link 
  1098.    --  linkend="keybinding-signals">keybinding signal</link> which gets emitted 
  1099.    --  to select or unselect the complete contents of the text view. 
  1100.    -- 
  1101.    --  The default bindings for this signal are Ctrl-a and Ctrl-/ for 
  1102.    --  selecting and Shift-Ctrl-a and Ctrl-\ for unselecting. 
  1103.  
  1104.    Signal_Set_Anchor : constant Glib.Signal_Name := "set-anchor"; 
  1105.    procedure On_Set_Anchor 
  1106.       (Self  : not null access Gtk_Text_View_Record; 
  1107.        Call  : Cb_Gtk_Text_View_Void; 
  1108.        After : Boolean := False); 
  1109.    procedure On_Set_Anchor 
  1110.       (Self  : not null access Gtk_Text_View_Record; 
  1111.        Call  : Cb_GObject_Void; 
  1112.        Slot  : not null access Glib.Object.GObject_Record'Class; 
  1113.        After : Boolean := False); 
  1114.    --  The ::set-anchor signal is a <link 
  1115.    --  linkend="keybinding-signals">keybinding signal</link> which gets emitted 
  1116.    --  when the user initiates setting the "anchor" mark. The "anchor" mark 
  1117.    --  gets placed at the same position as the "insert" mark. 
  1118.    -- 
  1119.    --  This signal has no default bindings. 
  1120.  
  1121.    Signal_Toggle_Cursor_Visible : constant Glib.Signal_Name := "toggle-cursor-visible"; 
  1122.    procedure On_Toggle_Cursor_Visible 
  1123.       (Self  : not null access Gtk_Text_View_Record; 
  1124.        Call  : Cb_Gtk_Text_View_Void; 
  1125.        After : Boolean := False); 
  1126.    procedure On_Toggle_Cursor_Visible 
  1127.       (Self  : not null access Gtk_Text_View_Record; 
  1128.        Call  : Cb_GObject_Void; 
  1129.        Slot  : not null access Glib.Object.GObject_Record'Class; 
  1130.        After : Boolean := False); 
  1131.    --  The ::toggle-cursor-visible signal is a <link 
  1132.    --  linkend="keybinding-signals">keybinding signal</link> which gets emitted 
  1133.    --  to toggle the visibility of the cursor. 
  1134.    -- 
  1135.    --  The default binding for this signal is F7. 
  1136.  
  1137.    Signal_Toggle_Overwrite : constant Glib.Signal_Name := "toggle-overwrite"; 
  1138.    procedure On_Toggle_Overwrite 
  1139.       (Self  : not null access Gtk_Text_View_Record; 
  1140.        Call  : Cb_Gtk_Text_View_Void; 
  1141.        After : Boolean := False); 
  1142.    procedure On_Toggle_Overwrite 
  1143.       (Self  : not null access Gtk_Text_View_Record; 
  1144.        Call  : Cb_GObject_Void; 
  1145.        Slot  : not null access Glib.Object.GObject_Record'Class; 
  1146.        After : Boolean := False); 
  1147.    --  The ::toggle-overwrite signal is a <link 
  1148.    --  linkend="keybinding-signals">keybinding signal</link> which gets emitted 
  1149.    --  to toggle the overwrite mode of the text view. 
  1150.    -- 
  1151.    --  The default bindings for this signal is Insert. 
  1152.  
  1153.    ---------------- 
  1154.    -- Interfaces -- 
  1155.    ---------------- 
  1156.    --  This class implements several interfaces. See Glib.Types 
  1157.    -- 
  1158.    --  - "Buildable" 
  1159.    -- 
  1160.    --  - "Scrollable" 
  1161.  
  1162.    package Implements_Gtk_Buildable is new Glib.Types.Implements 
  1163.      (Gtk.Buildable.Gtk_Buildable, Gtk_Text_View_Record, Gtk_Text_View); 
  1164.    function "+" 
  1165.      (Widget : access Gtk_Text_View_Record'Class) 
  1166.    return Gtk.Buildable.Gtk_Buildable 
  1167.    renames Implements_Gtk_Buildable.To_Interface; 
  1168.    function "-" 
  1169.      (Interf : Gtk.Buildable.Gtk_Buildable) 
  1170.    return Gtk_Text_View 
  1171.    renames Implements_Gtk_Buildable.To_Object; 
  1172.  
  1173.    package Implements_Gtk_Scrollable is new Glib.Types.Implements 
  1174.      (Gtk.Scrollable.Gtk_Scrollable, Gtk_Text_View_Record, Gtk_Text_View); 
  1175.    function "+" 
  1176.      (Widget : access Gtk_Text_View_Record'Class) 
  1177.    return Gtk.Scrollable.Gtk_Scrollable 
  1178.    renames Implements_Gtk_Scrollable.To_Interface; 
  1179.    function "-" 
  1180.      (Interf : Gtk.Scrollable.Gtk_Scrollable) 
  1181.    return Gtk_Text_View 
  1182.    renames Implements_Gtk_Scrollable.To_Object; 
  1183.  
  1184. private 
  1185.    Wrap_Mode_Property : constant Gtk.Enums.Property_Gtk_Wrap_Mode := 
  1186.      Gtk.Enums.Build ("wrap-mode"); 
  1187.    Tabs_Property : constant Glib.Properties.Property_Boxed := 
  1188.      Glib.Properties.Build ("tabs"); 
  1189.    Right_Margin_Property : constant Glib.Properties.Property_Int := 
  1190.      Glib.Properties.Build ("right-margin"); 
  1191.    Populate_All_Property : constant Glib.Properties.Property_Boolean := 
  1192.      Glib.Properties.Build ("populate-all"); 
  1193.    Pixels_Inside_Wrap_Property : constant Glib.Properties.Property_Int := 
  1194.      Glib.Properties.Build ("pixels-inside-wrap"); 
  1195.    Pixels_Below_Lines_Property : constant Glib.Properties.Property_Int := 
  1196.      Glib.Properties.Build ("pixels-below-lines"); 
  1197.    Pixels_Above_Lines_Property : constant Glib.Properties.Property_Int := 
  1198.      Glib.Properties.Build ("pixels-above-lines"); 
  1199.    Overwrite_Property : constant Glib.Properties.Property_Boolean := 
  1200.      Glib.Properties.Build ("overwrite"); 
  1201.    Left_Margin_Property : constant Glib.Properties.Property_Int := 
  1202.      Glib.Properties.Build ("left-margin"); 
  1203.    Justification_Property : constant Gtk.Enums.Property_Gtk_Justification := 
  1204.      Gtk.Enums.Build ("justification"); 
  1205.    Input_Purpose_Property : constant Gtk.Enums.Property_Gtk_Input_Purpose := 
  1206.      Gtk.Enums.Build ("input-purpose"); 
  1207.    Input_Hints_Property : constant Gtk.Enums.Property_Gtk_Input_Hints := 
  1208.      Gtk.Enums.Build ("input-hints"); 
  1209.    Indent_Property : constant Glib.Properties.Property_Int := 
  1210.      Glib.Properties.Build ("indent"); 
  1211.    Im_Module_Property : constant Glib.Properties.Property_String := 
  1212.      Glib.Properties.Build ("im-module"); 
  1213.    Editable_Property : constant Glib.Properties.Property_Boolean := 
  1214.      Glib.Properties.Build ("editable"); 
  1215.    Cursor_Visible_Property : constant Glib.Properties.Property_Boolean := 
  1216.      Glib.Properties.Build ("cursor-visible"); 
  1217.    Buffer_Property : constant Glib.Properties.Property_Object := 
  1218.      Glib.Properties.Build ("buffer"); 
  1219.    Accepts_Tab_Property : constant Glib.Properties.Property_Boolean := 
  1220.      Glib.Properties.Build ("accepts-tab"); 
  1221. end Gtk.Text_View;