~ubuntu-branches/ubuntu/precise/gnat-gps/precise

« back to all changes in this revision

Viewing changes to kernel/src/gps-editors-line_information.ads

  • Committer: Package Import Robot
  • Author(s): Ludovic Brenta
  • Date: 2012-01-15 15:42:21 UTC
  • mfrom: (10.1.10 sid)
  • Revision ID: package-import@ubuntu.com-20120115154221-ccysuzvh02pkhuwq
Tags: 5.0-6
Rebuild against libgtkada 2.24.1.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
-----------------------------------------------------------------------
 
2
--                               G P S                               --
 
3
--                                                                   --
 
4
--                    Copyright (C) 2010, AdaCore                    --
 
5
--                                                                   --
 
6
-- GPS is free  software;  you can redistribute it and/or modify  it --
 
7
-- under the terms of the GNU General Public License as published by --
 
8
-- the Free Software Foundation; either version 2 of the License, or --
 
9
-- (at your option) any later version.                               --
 
10
--                                                                   --
 
11
-- This program is  distributed in the hope that it will be  useful, --
 
12
-- but  WITHOUT ANY WARRANTY;  without even the  implied warranty of --
 
13
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU --
 
14
-- General Public License for more details. You should have received --
 
15
-- a copy of the GNU General Public License along with this program; --
 
16
-- if not,  write to the  Free Software Foundation, Inc.,  59 Temple --
 
17
-- Place - Suite 330, Boston, MA 02111-1307, USA.                    --
 
18
-----------------------------------------------------------------------
 
19
 
 
20
with Gdk.Pixbuf;
 
21
with Commands;
 
22
with GNAT.Strings;     use GNAT.Strings;
 
23
with Ada.Unchecked_Deallocation;
 
24
 
 
25
package GPS.Editors.Line_Information is
 
26
 
 
27
   type GPS_Editor_Buffer is abstract new Editor_Buffer with null record;
 
28
 
 
29
   ----------------------
 
30
   -- Line information --
 
31
   ----------------------
 
32
 
 
33
   type Line_Information_Record is record
 
34
      Text               : GNAT.Strings.String_Access := null;
 
35
      Tooltip_Text       : GNAT.Strings.String_Access := null;
 
36
      --  A text to be displayed in a tooltip
 
37
      Image              : Gdk.Pixbuf.Gdk_Pixbuf := Gdk.Pixbuf.Null_Pixbuf;
 
38
      Associated_Command : Commands.Command_Access := null;
 
39
   end record;
 
40
   --  Text must be a valid UTF8 string, which may contain markups in the pango
 
41
   --  markup format.
 
42
 
 
43
   Empty_Line_Information : constant Line_Information_Record;
 
44
 
 
45
   type Line_Information_Array is array (Integer range <>)
 
46
     of Line_Information_Record;
 
47
 
 
48
   type Line_Information_Data is access Line_Information_Array;
 
49
   for Line_Information_Data'Size use Standard'Address_Size;
 
50
   pragma No_Strict_Aliasing (Line_Information_Data);
 
51
 
 
52
   procedure Free (X : in out Line_Information_Record);
 
53
   --  Free memory associated with X
 
54
 
 
55
   procedure Unchecked_Free is new Ada.Unchecked_Deallocation
 
56
     (Line_Information_Array, Line_Information_Data);
 
57
 
 
58
   procedure Add_File_Information
 
59
     (This       : GPS_Editor_Buffer;
 
60
      Identifier : String;
 
61
      Info       : Line_Information_Data)
 
62
   is abstract;
 
63
   --  Add Info to Buffer.
 
64
 
 
65
   function Add_Special_Line
 
66
     (This       : GPS_Editor_Buffer;
 
67
      Start_Line : Integer;
 
68
      Text       : String;
 
69
      Category   : String := "";
 
70
      Name       : String := "";
 
71
      Column_Id  : String := "";
 
72
      Info       : Line_Information_Data := null)
 
73
      return Editor_Mark'Class is abstract;
 
74
   --  Adds one non-editable line to the buffer, starting at line start_line
 
75
   --  and contains string text. If category is specified, use it for
 
76
   --  highlighting. Create a mark at beginning of block and return it. If name
 
77
   --  is specified, retuned mark will have this name
 
78
   --  Column_Id and Info, if not empty and null, indicate the Side information
 
79
   --  to add to the buffer lines that we are inserting.
 
80
 
 
81
   procedure Add_Special_Line
 
82
     (This       : GPS_Editor_Buffer'Class;
 
83
      Start_Line : Integer;
 
84
      Text       : String;
 
85
      Category   : String := "";
 
86
      Name       : String := "";
 
87
      Column_Id  : String := "";
 
88
      Info       : Line_Information_Data := null);
 
89
   --  Same as above, but doesn't return mark
 
90
 
 
91
   procedure Remove_Special_Lines
 
92
     (This  : GPS_Editor_Buffer;
 
93
      Mark  : Editor_Mark'Class;
 
94
      Lines : Integer) is abstract;
 
95
   --  Removes specified number of special lines at the specified mark. It
 
96
   --  doesn't delete the mark
 
97
 
 
98
private
 
99
 
 
100
   Empty_Line_Information : constant Line_Information_Record :=
 
101
                              (null, null, Gdk.Pixbuf.Null_Pixbuf, null);
 
102
 
 
103
end GPS.Editors.Line_Information;