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

« back to all changes in this revision

Viewing changes to .pc/elaboration.patch/kernel/src/gps-kernel.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
1
-----------------------------------------------------------------------
2
2
--                               G P S                               --
3
3
--                                                                   --
 
4
--                 Copyright (C) 2001-2010, AdaCore                  --
4
5
--                                                                   --
5
6
-- GPS is free  software; you  can redistribute it and/or modify  it --
6
7
-- under the terms of the GNU General Public License as published by --
24
24
with Ada.Unchecked_Deallocation;
25
25
with System;
26
26
 
27
 
with GNATCOLL.Scripts;
28
27
with GNAT.Strings;
 
28
with GNATCOLL.Projects;
29
29
with GNAT.Regpat;
 
30
with GNATCOLL.Scripts;
 
31
with GNATCOLL.Symbols;
 
32
with GNATCOLL.VFS; use GNATCOLL.VFS;
30
33
 
31
34
with Glib.Object;  use Glib;
32
 
with Glib.Xml_Int;
33
 
with Gdk.Event;    use Gdk.Event;
34
 
with Gtk.Handlers;
35
 
with Gtk.Accel_Group;
36
 
with Gtk.Icon_Factory;
37
 
with Gtk.Main;
38
 
with Gtk.Toolbar;
39
 
with Gtk.Tooltips;
40
 
with Gtk.Widget;
41
35
with Gtk.Window;
42
 
with Gtkada.MDI;
43
36
 
44
37
with Basic_Types;
45
38
with Basic_Mapper;
 
39
with Commands;
46
40
with Entities;
47
41
with Entities.Queries;
48
42
with Generic_List;
52
46
with String_Hash;
53
47
with Default_Preferences;
54
48
with Histories;
55
 
with Projects.Registry;
 
49
with Projects;
 
50
with Refactoring;
56
51
with Switches_Chooser;
 
52
with String_List_Utils;
57
53
with Task_Manager;
58
 
with GNATCOLL.VFS;
 
54
with XML_Utils;
 
55
 
 
56
with GPS.Editors;
59
57
 
60
58
package GPS.Kernel is
61
59
 
64
62
   pragma No_Strict_Aliasing (Kernel_Handle);
65
63
   --  A kernel handle used to share information throughout GPS
66
64
 
67
 
   package Kernel_Desktop is new Gtkada.MDI.Desktop (Kernel_Handle);
 
65
   -------------------
 
66
   -- Kernel_Handle --
 
67
   -------------------
68
68
 
69
69
   procedure Gtk_New
70
70
     (Handle           : out Kernel_Handle;
71
71
      Main_Window      : Gtk.Window.Gtk_Window;
72
 
      Home_Dir         : String;
73
 
      Prefix_Directory : String);
 
72
      Home_Dir         : Virtual_File;
 
73
      Prefix_Directory : Virtual_File);
74
74
   --  Create a new GPS kernel.
75
75
   --  By default, it isn't associated with any project, nor any source editor.
76
76
   --  Home_Dir is the directory under which config files can be loaded/saved.
94
94
   procedure Destroy (Handle : access Kernel_Handle_Record);
95
95
   --  Free the memory occupied by the kernel
96
96
 
97
 
   function Get_Default_Accelerators
98
 
     (Handle : access Kernel_Handle_Record)
99
 
      return Gtk.Accel_Group.Gtk_Accel_Group;
100
 
   --  Returns the defauls accelerators group for the main window
101
 
 
102
97
   function Get_Preferences
103
98
     (Handle : access Kernel_Handle_Record)
104
99
      return Default_Preferences.Preferences_Manager;
105
100
   --  Return the preference manager associated with Handle
106
101
 
107
 
   function Has_User_Desktop
108
 
     (Handle : access Kernel_Handle_Record) return Boolean;
109
 
   --  Return True if an user-defined desktop is present, and False
110
 
   --  if the default desktop is used.
111
 
 
112
 
   procedure Save_Desktop
113
 
     (Handle             : access Kernel_Handle_Record;
114
 
      As_Default_Desktop : Boolean := False);
115
 
   --  Save the current desktop.
116
 
   --  If As_Default_Desktop is true, then this desktop will be loaded any time
117
 
   --  no other valid desktop is found in the future.
118
 
 
119
 
   function Load_Desktop (Handle : access Kernel_Handle_Record) return Boolean;
120
 
   --  Reload a saved desktop.
121
 
   --  Calls "Show_All" on Handle.Main_Window before loading the desktop.
122
 
   --  Return False if no desktop could be loaded (in which case the default
123
 
   --  desktop was loaded).
124
 
 
125
102
   function Get_Main_Window
126
103
     (Handle : access Kernel_Handle_Record) return Gtk.Window.Gtk_Window;
127
104
   --  Return the main window associated with the kernel
128
105
 
129
 
   function Get_Tooltips
130
 
     (Handle : access Kernel_Handle_Record) return Gtk.Tooltips.Gtk_Tooltips;
131
 
   --  Return the widget used to register tooltips for the graphical interface
132
 
 
133
 
   function Get_Toolbar
134
 
     (Handle : access Kernel_Handle_Record) return Gtk.Toolbar.Gtk_Toolbar;
135
 
   --  Return the main toolbar associated with the kernel
136
 
 
137
106
   function Get_History
138
107
     (Handle : access Kernel_Handle_Record) return Histories.History;
139
108
   --  Return the history database
175
144
     (Handle : access Kernel_Handle_Record'Class) return Boolean;
176
145
   --  Return whether the current state of the Kernel is a processing state
177
146
 
178
 
   function Get_Home_Dir (Handle : access Kernel_Handle_Record) return String;
 
147
   function Get_Home_Dir
 
148
     (Handle : access Kernel_Handle_Record)
 
149
     return Virtual_File;
179
150
   --  Return the Home directory. (eg ~/.gps/).
180
151
   --  The directory ends with a directory separator
181
152
 
182
153
   function Get_System_Dir
183
 
     (Handle : access Kernel_Handle_Record) return String;
 
154
     (Handle : access Kernel_Handle_Record)
 
155
     return Virtual_File;
184
156
   --  Return the installation directory for GPS. This always ends up with a
185
157
   --  directory separator.
186
158
 
202
174
   function GNAT_Version
203
175
     (Handle : access Kernel_Handle_Record) return String;
204
176
   --  Return a string containing the GNAT version number.
205
 
   --  The string has the form "3.16w (20020610)"
 
177
   --  The string has the form "Pro 6.4.0w (20100727-43)"
 
178
   --  See also Require_GNAT_Date below.
206
179
 
207
 
   function Get_Icon_Factory
208
 
     (Handle : access Kernel_Handle_Record)
209
 
      return Gtk.Icon_Factory.Gtk_Icon_Factory;
210
 
   --  Return the default icon factory
 
180
   function Require_GNAT_Date
 
181
     (Handle : access Kernel_Handle_Record;
 
182
      Date   : Basic_Types.Date_Type) return Boolean;
 
183
   --  Return True if the version of GNAT associated with Handle is at
 
184
   --  least Date.
211
185
 
212
186
   procedure Set_Destruction_Flag
213
187
     (Handle : access Kernel_Handle_Record;
219
193
   --  When return True, the kernel is in the process of being destroyed
220
194
 
221
195
   procedure Report_Preference_File_Error
222
 
     (Handle : access Kernel_Handle_Record;
223
 
      Filename : String);
 
196
     (Handle   : access Kernel_Handle_Record;
 
197
      Filename : Virtual_File);
224
198
   --  Print out an error message in messages window, or display a dialog
225
199
   --  if GPS is exiting.
226
200
 
240
214
   --  in vfs.ads.
241
215
 
242
216
   function Create
243
 
     (Name            : Glib.UTF8_String;
 
217
     (Name            : Filesystem_String;
244
218
      Kernel          : access Kernel_Handle_Record;
245
219
      Use_Source_Path : Boolean := True;
246
220
      Use_Object_Path : Boolean := True) return GNATCOLL.VFS.Virtual_File;
253
227
   --  if it doesn't directly belong to a project.
254
228
 
255
229
   function Create_From_Base
256
 
     (Name   : Glib.UTF8_String;
 
230
     (Name   : Filesystem_String;
257
231
      Kernel : access Kernel_Handle_Record) return GNATCOLL.VFS.Virtual_File;
258
232
   --  Create a new file. First try to resolve Base_Name (Name) to an absolute
259
233
   --  path based on the source and object paths. If no file is found,
270
244
 
271
245
   function Is_Hidden
272
246
     (Kernel    : access Kernel_Handle_Record;
273
 
      Base_Name : String) return Boolean;
 
247
      Base_Name : Filesystem_String) return Boolean;
274
248
   --  Return whether File or Directory identified by its Base_Name should be
275
249
   --  considered as hidden for all GUI purposes, such as the Project/File
276
250
   --  explorer or the VCS operations.
281
255
 
282
256
   procedure Parse_All_LI_Information
283
257
     (Kernel    : access Kernel_Handle_Record;
284
 
      Project   : Projects.Project_Type;
 
258
      Project   : GNATCOLL.Projects.Project_Type;
285
259
      Recursive : Boolean);
286
260
   --  Parse all the LI information in Project, for all the supported
287
261
   --  languages. This can be used in cases where there is no obvious way to
297
271
      return Language.Tree.Database.Construct_Database_Access;
298
272
   --  Return the database storing the construct information
299
273
 
 
274
   function Symbols
 
275
     (Kernel : access Kernel_Handle_Record)
 
276
      return GNATCOLL.Symbols.Symbol_Table_Access;
 
277
   --  Return the symbol table used to store various shared strings, in
 
278
   --  particular storing the name of all entities found in the source files
 
279
 
300
280
   procedure Find_Declaration_Or_Overloaded
301
281
     (Kernel            : access Kernel_Handle_Record;
302
282
      File              : Entities.Source_File;
306
286
      Ask_If_Overloaded : Boolean;
307
287
      Entity            : out Entities.Entity_Information;
308
288
      Closest_Ref       : out Entities.Entity_Reference;
309
 
      Status            : out Entities.Queries.Find_Decl_Or_Body_Query_Status);
 
289
      Status            : out Entities.Queries.Find_Decl_Or_Body_Query_Status;
 
290
      Fuzzy_Expected    : Boolean := False);
310
291
   --  Find the declaration of the given entity in the file.
311
292
   --  If Ask_If_Overloaded is True and there are several possible matches for
312
 
   --  the entiy (for instance because the xref info is not up-to-date), an
 
293
   --  the entity (for instance because the xref info is not up-to-date), an
313
294
   --  interactive dialog is opened.
 
295
   --  If Fast is True, get the entity information only from the
 
296
   --  constructs database, do not attempt to refine the search using the ALI
 
297
   --  database. ??? There is no Fast parameter
314
298
 
315
299
   --------------
316
300
   -- Contexts --
339
323
     (Context : Selection_Context) return Abstract_Module_ID;
340
324
   --  Return the module ID for the module that created the context
341
325
 
342
 
   function Get_Current_Context
343
 
     (Kernel : access Kernel_Handle_Record) return Selection_Context;
344
 
   --  Return the context associated with the current MDI child.
345
 
   --  The caller should not free the returned value, this is taken care of by
346
 
   --  the kernel automatically. If the caller needs to keep the context valid
347
 
   --  throughout its execution, it should first call Ref, and then Unref on
348
 
   --  the context, similarly for any caller that need to keep a valid context.
349
 
   --  The returned value might be null, if the current child doesn't support
350
 
   --  selection contexts.
351
 
   --  This function is mostly intended to be called for the callbacks in the
352
 
   --  menu bar.
353
 
   --  The context returned will be that of the active contextual menu if there
354
 
   --  is one at that point in time (therefore, we ignore cases where for
355
 
   --  instance a new child has been selected automatically at that point)
356
 
 
357
 
   function Get_Context_For_Child
358
 
     (Child : Gtkada.MDI.MDI_Child) return Selection_Context;
359
 
   --  Return the context associated with Child.
360
 
   --  The user should free the returned value.
361
 
 
362
 
   function Get_Current_Focus_Widget
363
 
     (Kernel : access Kernel_Handle_Record) return Gtk.Widget.Gtk_Widget;
364
 
   --  Return the widget which currently has the keyboard focus. null is
365
 
   --  returned if no widget has the focus, or if GPS itself doesn't have
366
 
   --  it.
367
 
 
368
326
   -------------
369
327
   -- Markers --
370
328
   -------------
385
343
   --  If this function returns False, it is assumed the marker is no longer
386
344
   --  legal, and should be removed from the history.
387
345
 
 
346
   function Clone
 
347
     (Marker : access Location_Marker_Record)
 
348
      return Location_Marker is abstract;
 
349
   --  Return a clone of Marker
 
350
 
388
351
   procedure Destroy (Marker : in out Location_Marker_Record);
389
 
   --  Free the memory used by Marker. By default, this does nothing
 
352
   --  Free the memory used by Marker. By default, this does nothing.
390
353
 
391
354
   function To_String
392
355
     (Marker : access Location_Marker_Record) return String is abstract;
396
359
 
397
360
   function Save
398
361
     (Marker : access Location_Marker_Record)
399
 
      return Xml_Int.Node_Ptr is abstract;
 
362
      return XML_Utils.Node_Ptr is abstract;
400
363
   --  Saves the marker to an XML node, so that it can be reloaded later on,
401
364
   --  possibly in a different GPS session.
402
365
 
407
370
   --  visited. This is the basic interface for the handling of the history of
408
371
   --  locations. It emits the hook Marker_Added_To_History.
409
372
 
 
373
   function Similar
 
374
     (Left  : access Location_Marker_Record;
 
375
      Right : access Location_Marker_Record'Class) return Boolean is abstract;
 
376
   --  Return True if Left and Right point to the same location in the sense
 
377
   --  that GPS should not add a new marker in history for two locations that
 
378
   --  are the same.
 
379
 
 
380
   --------------
 
381
   -- Commands --
 
382
   --------------
 
383
 
 
384
   procedure Register_Perma_Command
 
385
     (Kernel  : access Kernel_Handle_Record'Class;
 
386
      Command : access Commands.Root_Command'Class);
 
387
   --  Register a command to be freed when GPS exits. Such commands must not be
 
388
   --  added to command queues, and therefore this is mostly intended for
 
389
   --  commands used in actions or menus (but in such case the command is
 
390
   --  automatically added already). A given command can be registered
 
391
   --  several times though.
 
392
   --  The current reference to Command is stolen, ie you must not call Unref
 
393
   --  on the command before first calling Ref yourself.
 
394
 
410
395
   --------------------
411
396
   -- Action filters --
412
397
   --------------------
437
422
      is new Action_Filter_Record with private;
438
423
   type Base_Action_Filter is access all Base_Action_Filter_Record'Class;
439
424
 
 
425
   overriding
440
426
   function Filter_Matches_Primitive
441
427
     (Filter  : access Base_Action_Filter_Record;
442
428
      Context : Selection_Context) return Boolean;
590
576
   --  a string instead of an Action_Record.
591
577
 
592
578
   ---------------------
593
 
   -- Signal emission --
 
579
   --  Editor_Factory --
594
580
   ---------------------
595
581
 
596
 
   procedure Setup (Data : Glib.Object.GObject; Id : Gtk.Handlers.Handler_Id);
597
 
   --  Make sure that when Data is destroyed, Id is properly removed
598
 
 
599
 
   package Object_User_Callback is new Gtk.Handlers.User_Callback_With_Setup
600
 
     (Glib.Object.GObject_Record, Glib.Object.GObject, Setup);
601
 
   --  Generic callback that can be used to connect a signal to a kernel
602
 
 
603
 
   package Object_Return_Callback is new Gtk.Handlers.Return_Callback
604
 
     (Glib.Object.GObject_Record, Boolean);
605
 
   --  Generic callback that can be used to connect a signal to a kernel
606
 
 
607
 
   package Object_User_Return_Callback
608
 
     is new Gtk.Handlers.User_Return_Callback_With_Setup
609
 
     (Widget_Type => Glib.Object.GObject_Record,
610
 
      User_Type   => Glib.Object.GObject,
611
 
      Return_Type => Boolean,
612
 
      Setup       => Setup);
613
 
   --  Generic callback that can be used to connect a signal to a kernel
614
 
 
615
 
   package Kernel_Callback is new Gtk.Handlers.User_Callback
616
 
     (Glib.Object.GObject_Record, Kernel_Handle);
617
 
   --  Generic callback that can be used to connect a signal to a kernel
618
 
 
619
 
   package Object_Idle is new Gtk.Main.Idle (Glib.Object.GObject);
620
 
   --  General Idle loop for a GObject
621
 
 
622
 
   type File_Project_Record is record
623
 
      Project : Projects.Project_Type;
624
 
      File    : aliased GNATCOLL.VFS.Virtual_File;
625
 
   end record;
626
 
 
627
 
   package File_Project_Cb is new Gtk.Handlers.User_Callback
628
 
     (Glib.Object.GObject_Record, File_Project_Record);
629
 
   --  Generic callback that can be used to connect a signal to a kernel
630
 
 
631
 
   package Entity_Callback is new Gtk.Handlers.User_Callback
632
 
     (Glib.Object.GObject_Record, Entities.Entity_Information);
 
582
   function Get_Buffer_Factory
 
583
     (Kernel : access Kernel_Handle_Record)
 
584
      return GPS.Editors.Editor_Buffer_Factory_Access;
 
585
 
 
586
   procedure Set_Buffer_Factory
 
587
     (Kernel  : access Kernel_Handle_Record;
 
588
      Factory : GPS.Editors.Editor_Buffer_Factory_Access);
 
589
 
 
590
   -----------------
 
591
   -- Refactoring --
 
592
   -----------------
 
593
 
 
594
   function Refactoring_Context
 
595
     (Kernel : access Kernel_Handle_Record) return Refactoring.Factory_Context;
 
596
 
 
597
   ----------------
 
598
   -- Hyper_Mode --
 
599
   ----------------
 
600
 
 
601
   --  Handle the global state of the Hyper Mode
 
602
 
 
603
   procedure Enter_Hyper_Mode (Kernel : access Kernel_Handle_Record);
 
604
   --  Enter hyper mode
 
605
 
 
606
   procedure Leave_Hyper_Mode (Kernel : access Kernel_Handle_Record);
 
607
   --  Leave hyper mode
 
608
 
 
609
   function In_Hyper_Mode
 
610
     (Kernel : access Kernel_Handle_Record) return Boolean;
 
611
   --  Return True if we are in Hyper mode
633
612
 
634
613
   -----------
635
614
   -- Hooks --
683
662
     (Handle   : access Kernel_Handle_Record;
684
663
      Category : String;
685
664
      Quiet    : Boolean;
686
 
      Shadow   : Boolean) return Boolean;
 
665
      Shadow   : Boolean;
 
666
      Background : Boolean) return Boolean;
687
667
   --  Runs the "compilation_starting" hook.
688
668
   --  The Category corresponds to the location/highlighting category that
689
669
   --  will contain the compilation output.
692
672
   --  Return True if the compilation should be started.
693
673
 
694
674
   procedure Compilation_Finished
695
 
     (Handle   : access Kernel_Handle_Record;
696
 
      Category : String);
 
675
     (Handle      : access Kernel_Handle_Record;
 
676
      Category    : String;
 
677
      Target_Name : String;
 
678
      Mode_Name   : String;
 
679
      Shadow      : Boolean;
 
680
      Background  : Boolean;
 
681
      Status      : Integer);
697
682
   --  Runs the "compilation_finished" hook
698
683
   --  The Category corresponds to the location/highlighting category that
699
684
   --  contains the compilation output.
744
729
   Compilation_Starting_Hook     : constant Hook_Name :=
745
730
                                     "compilation_starting";
746
731
 
 
732
   Buffer_Modified_Hook : constant Hook_Name := "buffer_edited";
 
733
   --  Hook called after a buffer has been edited.
 
734
 
747
735
   --  Hooks with Context_Hooks_Args argument
748
736
   Context_Changed_Hook          : constant Hook_Name := "context_changed";
749
737
 
763
751
   File_Status_Changed_Hook      : constant Hook_Name := "file_status_changed";
764
752
   --  Called when the status of a file is changed : Modified, Unmodified...
765
753
 
 
754
   --  Hooks with String_Hooks_Args argument
 
755
   Compute_Build_Targets_Hook : constant Hook_Name := "compute_build_targets";
 
756
   --  Called when computing list of build targets, e.g. list of mains, or list
 
757
   --  of Makefile targets. The string parameter gives the kind of target to
 
758
   --  be computed (e.g. "main", "makefile").
 
759
 
766
760
private
767
761
 
768
762
   type Filter_Type is (Filter_And, Filter_Or, Filter_Not, Standard_Filter);
812
806
      Files             : GNATCOLL.VFS.File_Array_Access := null;
813
807
      --  The current selected files
814
808
 
815
 
      Project           : Projects.Project_Type := Projects.No_Project;
816
 
      Importing_Project : Projects.Project_Type := Projects.No_Project;
 
809
      Project           : GNATCOLL.Projects.Project_Type :=
 
810
        GNATCOLL.Projects.No_Project;
 
811
      Importing_Project : GNATCOLL.Projects.Project_Type :=
 
812
        GNATCOLL.Projects.No_Project;
817
813
      Line              : Integer := 0;
818
814
      Column            : Basic_Types.Visible_Column_Type := 0;
819
815
 
830
826
      --  When several lines are selected in a file. The selection starts
831
827
      --  at Line. Text is the current selection.
832
828
 
833
 
      Entity_Name   : GNAT.Strings.String_Access := null;  --  ??? Use Text
 
829
      Entity_Name   : GNATCOLL.Symbols.Symbol := GNATCOLL.Symbols.No_Symbol;
834
830
      Entity_Column : Basic_Types.Visible_Column_Type := 0;
835
831
 
836
832
      Expression    : GNAT.Strings.String_Access := null;
839
835
      Closest_Ref  : Entities.Entity_Reference := Entities.No_Entity_Reference;
840
836
      --  The entity on which the user has clicked
841
837
 
842
 
      Activity_Id : GNAT.Strings.String_Access := null;
843
 
      --  An activity
 
838
      Activities   : String_List_Utils.String_List.List :=
 
839
                       String_List_Utils.String_List.Null_List;
 
840
      --  Activities
844
841
 
845
842
      Entity_Resolved : Entities.Queries.Find_Decl_Or_Body_Query_Status :=
846
843
        Entities.Queries.Entity_Not_Found;
871
868
   --  Selection_Context should not be visibly tagged, otherwise we would have
872
869
   --  operations dispatching on multiple types above
873
870
 
 
871
   overriding
874
872
   procedure Adjust   (Context : in out Selection_Context_Controlled);
 
873
 
 
874
   overriding
875
875
   procedure Finalize (Context : in out Selection_Context_Controlled);
876
876
   --  See inherited documentation
877
877
 
878
878
   No_Context : constant Selection_Context :=
879
 
     (Data => (Ada.Finalization.Controlled with null));
 
879
                  (Data => (Ada.Finalization.Controlled with null));
880
880
 
881
881
   No_Tool : constant Tool_Properties_Record :=
882
 
     (null, null, null, null, null, False, null, null);
 
882
               (null, null, null, null, null, False, null, null);
883
883
 
884
884
   package Tools_List is new Ada.Containers.Doubly_Linked_Lists
885
885
     (Tool_Properties_Record);
908
908
   package Action_Filters_List is new Generic_List (Action_Filter, Free);
909
909
 
910
910
   type Action_Filter_Iterator is record
911
 
      Iterator : Action_Filters_Htable.String_Hash_Table.Iterator;
 
911
      Iterator : Action_Filters_Htable.String_Hash_Table.Cursor;
912
912
   end record;
913
913
 
914
914
   ----------
931
931
 
932
932
   procedure Free (L : in out Hook_Description_Base_Access);
933
933
   package Hooks_Hash is new HTables.Simple_HTable
934
 
     (Hook_Htable_Num, Hook_Description_Base_Access, Free, null,
935
 
      Hook_Name, Hash, "=");
 
934
     (Header_Num   => Hook_Htable_Num,
 
935
      Element      => Hook_Description_Base_Access,
 
936
      No_Element   => null,
 
937
      Key          => Hook_Name,
 
938
      Hash         => Hash,
 
939
      Equal        => "=",
 
940
      Free_Element => Free);
936
941
 
937
942
   type Location_Marker_Record is abstract tagged null record;
938
943
 
942
947
   --  User_Level   : system and user custom files loaded
943
948
 
944
949
   type Kernel_Scripts_Repository is
945
 
      new GNATCOLL.Scripts.Scripts_Repository_Record with record
 
950
     new GNATCOLL.Scripts.Scripts_Repository_Record
 
951
   with record
946
952
      Kernel : Kernel_Handle;
947
953
   end record;
948
954
 
957
963
      Construct_Database : Language.Tree.Database.Construct_Database_Access;
958
964
      --  The construct information
959
965
 
 
966
      Symbols : GNATCOLL.Symbols.Symbol_Table_Access;
 
967
      --  The symbol used to store common strings read from sources
 
968
 
960
969
      Tools   : Tools_List.List;
961
970
      --  The tools registered in the kernel
962
971
 
969
978
      Startup_Scripts : Root_Table_Access;
970
979
      --  The list of startup scripts and whether they should be loaded
971
980
 
972
 
      Hooks : Hooks_Hash.HTable;
 
981
      Hooks : Hooks_Hash.Instance;
973
982
      --  The hooks registered in the kernel
974
983
 
975
 
      Action_Filters : Action_Filters_Htable.String_Hash_Table.HTable;
 
984
      Action_Filters : Action_Filters_Htable.String_Hash_Table.Instance;
976
985
      All_Action_Filters : Action_Filters_List.List;
977
986
      --  The action contexts registered in the kernel
978
987
 
983
992
      Main_Window : Gtk.Window.Gtk_Window;
984
993
      --  The main GPS window
985
994
 
986
 
      Tooltips : Gtk.Tooltips.Gtk_Tooltips;
987
 
      --  The widget used to register all tooltips
988
 
 
989
 
      Registry : Projects.Registry.Project_Registry_Access;
 
995
      Registry : Projects.Project_Registry_Access;
990
996
      --  The project registry
991
997
 
992
998
      Scripts : GNATCOLL.Scripts.Scripts_Repository;
1005
1011
      Preferences : Default_Preferences.Preferences_Manager;
1006
1012
      --  The current setting for the preferences
1007
1013
 
 
1014
      Perma_Commands : Commands.Command_Lists.List;
 
1015
      --  The list of global commands associated with menus, actions or
 
1016
      --  contextual menus, so that they can be freed on exit. These commands
 
1017
      --  are automatically added to the list when the menu or action is
 
1018
      --  created
 
1019
 
1008
1020
      Last_Context_For_Contextual : Selection_Context := No_Context;
1009
1021
      --  The context used in the last contextual menu.
1010
1022
      --  This variable should remain not null and unchanged while a contextual
1015
1027
      --  Whether Last_Context_For_Contextual has been obtain from a contextual
1016
1028
      --  menu.
1017
1029
 
1018
 
      Last_Event_For_Contextual   : Gdk.Event.Gdk_Event;
1019
 
      --  The event triggering the last contextual menu
1020
 
 
1021
 
      Home_Dir : GNAT.Strings.String_Access;
 
1030
      Home_Dir : Virtual_File;
1022
1031
      --  The home directory (e.g ~/.gps)
1023
1032
 
1024
 
      Prefix : GNAT.Strings.String_Access;
 
1033
      Prefix   : Virtual_File;
1025
1034
      --  Prefix directory (e.g. /opt/gps)
1026
1035
 
1027
1036
      Logs_Mapper : Basic_Mapper.File_Mapper_Access;
1042
1051
      Custom_Files_Loaded : Custom_Load_State := None;
1043
1052
      --  Whether all custom files have already been loaded
1044
1053
 
1045
 
      Customization_Strings : Glib.Xml_Int.Node_Ptr;
 
1054
      Customization_Strings : XML_Utils.Node_Ptr;
1046
1055
      --  The customization strings hard-coded by the modules, and they have
1047
1056
      --  been registered before all modules are loaded.
1048
1057
 
1049
 
      Icon_Factory : Gtk.Icon_Factory.Gtk_Icon_Factory;
1050
 
      --  The icon factory specific to GPS
1051
 
 
1052
1058
      Contextual : System.Address := System.Null_Address;
1053
1059
      --  The contextual menus registered by the user. This is only used in
1054
1060
      --  GPS.Kernel.Modules, and cast to the appropriate type in that
1062
1068
      --  Determies wether the kernel is being destroyed
1063
1069
 
1064
1070
      Hidden_File_Matcher : Pattern_Matcher_Access;
 
1071
 
 
1072
      Editor_Factory               : GPS.Editors.Editor_Buffer_Factory_Access;
 
1073
 
 
1074
      Hyper_Mode                   : Boolean := False;
 
1075
      --  Whether we are in hyper mode
 
1076
 
 
1077
      Messages_Container : System.Address := System.Null_Address;
 
1078
      --  The message container for this instance of kernel
 
1079
 
 
1080
      Locations_View_Manager : System.Address := System.Null_Address;
 
1081
      --  The locations view manager
 
1082
 
 
1083
      Refactoring : Standard.Refactoring.Factory_Context;
1065
1084
   end record;
1066
1085
 
1067
1086
end GPS.Kernel;