Commit Graph

317 Commits

Author SHA1 Message Date
Emmanuel Briot
48aa2efd2b (GNATCOLL.Scripts): store common information about registered commands
in a structure shared among all scripting languages. This saves a minor
 amount of memory (avoid duplicating the name of the commands in memory),
 but more importantly provides a good place to store (once) the parameter
 names for JB12-019
(Register_Command, for a scripting_language): profile changed. Users should
 no longer call this procedure directly, but go through the one at the
 repository level.

git-svn-id: svn+ssh://svn.eu.adacore.com/Dev/trunk/gps@167171 936e1b1b-40f2-da11-902a-00137254ae57
2010-11-17 12:06:29 +00:00
Nicolas Setton
ca9ed0729d * gps.texi:
Add documentation for GPS_PYTHONHOME.

* gnatcoll-python.adb:
(Py_SetPythonHome): New binding.

* gnatcoll-python.ads:
(Py_SetPythonHome): Declare.

* gnatcoll-scripts-python.adb:
(Register_Python_Scripting): New parameters Program_Name and Python_Home.

* gnatcoll-scripts-python.ads:
(Register_Python_Scripting): New parameters Program_Name and Python_Home,
 allowing finer control on the initialization of the Python interpreter.

* gps-main.adb:
(Init_Settings): Do not modify PYTHONHOME.
(Finish_Setup): Likewise.

* python_module.adb:
(Register_Module): Set the Python home explicitely, either to the directory
 pointed to by GPS_PYTHONHOME if it is set, or to the install dir.

For JA20-017.




git-svn-id: svn+ssh://svn.eu.adacore.com/Dev/trunk/gps@166155 936e1b1b-40f2-da11-902a-00137254ae57
2010-10-20 14:58:09 +00:00
Arnaud Charlet
6c2347c168 Split most Gtk+ related subprograms out of GPS.Kernel.Modules, in
GPS.Kernel.Modules.UI.
Part of IA26-021


git-svn-id: svn+ssh://svn.eu.adacore.com/Dev/trunk/gps@161730 936e1b1b-40f2-da11-902a-00137254ae57
2010-06-29 06:29:51 +00:00
Arnaud Charlet
0654ff76e6 Code clean up.
git-svn-id: svn+ssh://svn.eu.adacore.com/Dev/trunk/gps@161710 936e1b1b-40f2-da11-902a-00137254ae57
2010-06-28 15:46:54 +00:00
Emmanuel Briot
2271e6e3cc Use a symbol table to share string_access, to limit the number of
mallocs, and save memory for structures that are kept permanently
 in memory
J603-022

git-svn-id: svn+ssh://svn.eu.adacore.com/Dev/trunk/gps@161002 936e1b1b-40f2-da11-902a-00137254ae57
2010-06-09 16:16:50 +00:00
Emmanuel Briot
80bf316b8f Set all Object_Dir and Library_Dir attributes in projects from the value in
gnatcoll_shared.gpr
This is for convenience when working with multiple branches in git:
 by changing the value (in a single place) on each branch, we can keep
 the build tree for each branch, and avoid extra recompilation when
 changing branches. For instance, one can set Object_Dir and Library_Dir
 to the following value in gnatcoll_shared.gpr (not checked in):
    for Object_Dir use "obj/" & External ("GIT_BRANCH", "");
    for Library_Dir use "lib/" & External ("GIT_BRANCH", "");
 provided the environment variable GIT_BRANCH is set automatically every
 time you change the branch (that's under control of the shell)

git-svn-id: svn+ssh://svn.eu.adacore.com/Dev/trunk/gps@160904 936e1b1b-40f2-da11-902a-00137254ae57
2010-06-08 10:45:36 +00:00
Emmanuel Briot
b3216e7219 (GNATCOLL.Projects): new API, moved from GPS
Remove project manager from GPS, since it is now in GNATCOLL
 I422-003

git-svn-id: svn+ssh://svn.eu.adacore.com/Dev/trunk/gps@158310 936e1b1b-40f2-da11-902a-00137254ae57
2010-03-30 08:12:23 +00:00
Emmanuel Briot
1cd402c5be (Save_Desktop): Fixed, since this might be called when the python
console does not even exist (apparently this is new with IA27-021)

git-svn-id: svn+ssh://svn.eu.adacore.com/Dev/trunk/gps@153512 936e1b1b-40f2-da11-902a-00137254ae57
2009-11-27 14:28:09 +00:00
Pascal Obry
a06083dbdb Fix permissions
git-svn-id: svn+ssh://svn.eu.adacore.com/Dev/trunk/gps@152738 936e1b1b-40f2-da11-902a-00137254ae57
2009-11-23 20:11:05 +00:00
Nicolas Setton
381194f82b Rename package GNATCOLL.Command_Lines to GNATCOLL.Arg_Lists and type
Command_Line to Arg_List.
For IB19-006.




git-svn-id: svn+ssh://svn.eu.adacore.com/Dev/trunk/gps@152729 936e1b1b-40f2-da11-902a-00137254ae57
2009-11-23 17:31:43 +00:00
Nicolas Setton
19c879101e * aliases_module.adb:
(Execute): Adapt to new profile of Execute_GPS_Shell_Command.

* build_command_manager.adb:
Start replacing command line handling with use of GNATCOLL.Command_Line.

* builder_module.adb:
Do not use a GNAT.OS_Lib.Argument_List to represent a command line.

* commands-builder.adb:
(Launch_Build_Command): Use type GNATCOLL.Command_Lines.Command_Line.

* commands-builder.ads:
(Launch_Build_Command): Use type GNATCOLL.Command_Lines.Command_Line.

* code_peer-module-bridge.adb:
(Add_Audit_Record): Adapt to new profile of Launch_Process.
(Inspection): Ditto.
(Review_Message): Ditto.

* code_peer-shell_commands.adb:
(Build_Target): Adapt to new profile of Execute_GPS_Shell_Command.
(Build_Target_Execute): Ditto.
(Get_Build_Mode): Ditto.
(Set_Build_Mode): Ditto.

* codefix_module.adb:
(Compilation_Finished_Cb): Adapt to new profile of Execute_GPS_Shell_Command.

* custom_module.adb:
(Parse_Entry_Node): Adapt to new profile of Execute_GPS_Shell_Command.

* expect_interface.adb:
 (Interactive_Expect): Adapt to new profile of Spawn.
(Custom_Spawn_Handler): Likewise.

* xml_viewer.adb:
(On_Click): Adapt to new profile of Execute_GPS_Shell_Command.

* gnatcoll-command_lines.adb:
Initial revision.

* gnatcoll-command_lines.ads:
Initial revision.

* gnatcoll-scripts-shell.ads:
(Initialize): Remove parameter Arguments_Count, no longer needed.
(Command_Line_Treatment): Declare.
(Execute_Command): Adapt to new profile of parent.
(Execute_Command_With_Args): Likewise.
(Set_Nth_Arg): Likewise.

* gnatcoll-scripts-utils.ads:
Add ??? comment.

* gnatcoll-scripts.adb:
(Command_Line_Treatment): Declare.
(Set_Nth_Arg): Adapt to new parameters of parent.
(Execute_Command): Likewise.
(Execute_Command_With_Args): Likewise.


* gnatcoll-scripts.ads:
(Command_Line_Treatment): Add new subprogram, which enables scripts to specify
 how they would like their command line to be handled.
(Set_Nth_Arg): Adapt to new parameters of parent.
(Execute_Command): Likewise.
(Execute_Command_With_Args): Likewise.

* gnatcoll-scripts-python-gtkada.adb:
(Init_PyGtk_Support): Adapt to new profile of Execute_Command.

* gnatcoll-scripts-python.adb:
(Command_Line_Treatment): Implement.
(Set_Nth_Arg): Adapt to profile of parent.
(Execute_Command): Ditto.
(Execute_File): Adapt to new profile of Execute_Command.

* gnatcoll-scripts-python.ads:
(Command_Line_Treatment): Declare.
(Execute_Command, Set_Nth_Arg): Adjust to new profiles of abstract parent.

* gps-main.adb:
(Execute_Batch): Adapt to new profile of Execute_Command.

* debugger.adb:
(General_Spawn): Adapt to new profile of Spawn.

* debugger.ads:
Add ??? comment.

* gvd-proc_utils.adb:
(Open_Processes): Adapt to new profile of Spawn.

* gvd-source_editor-gps.adb:
(Highlight_Current_Line): Adapt to new profile of Execute_GPS_Shell_Command.
(Unhighlight_Current_Line): Ditto.
(Initialize): Ditto.
(Free_Debug_Info): Ditto.

* help_module.adb:
(On_Load_HTML): Adapt to new profile of Execute_Command.

* commands-custom.adb:
Rewrite handling of command line. Use type GNATCOLL.Command_Lines.Command_Line.

* gps-kernel-macros.adb:
(Substitute): No need to protect paths.

* gps-kernel-remote.adb:
(Spawn): Use type Command_Line rather than GNAT.OS_Lib.Argument_List to
 represent command lines.


* gps-kernel-remote.ads:
(Spawn): Use type Command_Line rather than GNAT.OS_Lib.Argument_List to
 represent command lines.

* gps-kernel-scripts.adb:
(Execute_GPS_Shell_Command): Remove versions based on String + GNAT.OS_Lib.
 Argument_List. Replace all by use of type Command_Line.
(Set_Nth_Arg): Adjust mode of Callback_Data.

* gps-kernel-scripts.ads:
(Execute_GPS_Shell_Command): Remove versions based on String + GNAT.OS_Lib.
 Argument_List. Replace all by use of type Command_Line.
(Set_Nth_Arg): Adjust mode of Callback_Data.

* gps-kernel-timeout.adb:
(Free): No longer need to free Args.
(Execute): Ditto. Adapt to new profile for Spawn.
(Launch_Process): Use type Command_Line to represent a command line.

* gps-kernel-timeout.ads:
(Launch_Process): Use type GNATCOLL.Command_Lines.Command_Line to represent a
 command line.

* gps-kernel.adb:
(Filter_Matches_Primitive): Adapt to new profile of Execute_Command.

* navigation_module.adb:
(Go_To): Adapt to new profile of Execute_Command.

* project_properties.adb:
(For_Each_Item_In_List): Adapt to new profile of Execute_Command.

* python_module.adb:
(Load_Dir): Adapt to new profile of Execute_Command.

* remote-rsync.adb:
(On_Rsync_Hook): Adapt to new profile of Launch_Process.

* clearcase.xml:
Conform to the command line API design: parameters such as "$2-" and "$*" need
 to not be surrounded by quotes, so that they expand into multiple arguments.

* cvs.xml:
Conform to the command line API design: parameters such as "$2-" and "$*" need
 to not be surrounded by quotes, so that they expand into multiple arguments.

* gnatpp.xml:
Remove unneeded triple quoting.

* subversion.xml:
Conform to the command line API design: parameters such as "$2-" and "$*" need
 to not be surrounded by quotes, so that they expand into multiple arguments.

* shell_script.adb:
(Module_Command_Handler): Adapt to new profile of Execute_GPS_Shell_Command.
(Create): No longer need to take into account Arguments_Count.
 Add ??? comment.

* commands-socket.adb:
(Execute): Adapt to new profile of Execute_GPS_Shell_Command.

* casing_exceptions.adb:
(Set_Casing): Adapt to new profile of Execute_GPS_Shell_Command.

* src_editor_buffer.adb:
(Edition_Timeout): Adapt to new profile of Execute_GPS_Shell_Command.

* src_editor_module.adb:
(On_Print): Adapt to new profile of Execute_GPS_Shell_Command.

* log_utils.adb:
(Get_ChangeLog_From_File): Adapt to new profile of Execute_GPS_Shell_Command.

* vcs-generic_vcs.adb:
(Parse_Annotations): Adapt to new profile of Execute_GPS_Shell_Command.

* vcs_activities_view_api.adb:
(Execute): Adapt to new profile of Execute_GPS_Shell_Command.

* vcs_view_api.adb:
(Get_Location): Adapt to new profile of Execute_GPS_Shell_Command.
(On_Menu_Edit_ChangeLog): Ditto.
(On_Menu_View_Log_Rev): Ditto.
(Comparison): Ditto.

* vdiff2_command_block.adb:
(Close_Difference): Adapt to new profile of Execute_GPS_Shell_Command.

* vdiff2_module-callback.adb:
(Setup_Ref): Adapt to new profile of Execute_GPS_Shell_Command.

* vdiff2_module-utils-shell_command.adb:
(Add_Line Adapt to new profile of Execute_GPS_Shell_Command.
(Edit, Synchronize_Scrolling, Get_Chars, Get_File_Last_Line,
Get_Line_Number, Highlight_Line, Highlight_Range, Register_Highlighting,
Remove_Blank_Lines, Replace_Text, Unhighlight, Unhighlight_Range): Ditto.

* vdiff2_module-utils.adb:
(Is_Ref_Editor_Opened): Adapt to new profile of Execute_GPS_Shell_Command.

* clipboard_views.adb:
(Button_Press): Adapt to new profile of Execute_GPS_Shell_Command.

* interactive_consoles.adb:
(Default_Command_Handler): Adapt to new profile of Execute_Command.

Change the way GPS handles command lines. Introduce a new type
 (GNATCOLL.Command_Lines.Command_Line) and use it in most areas where we
 manipulate command lines.

For H926-007.




git-svn-id: svn+ssh://svn.eu.adacore.com/Dev/trunk/gps@152411 936e1b1b-40f2-da11-902a-00137254ae57
2009-11-17 17:51:13 +00:00
Emmanuel Briot
c6bd8bdcd5 (dependencies.py): the hash table computed for projects (Hash_Type) is
sometimes out of range of Integer, and resulted in a Constraint_Error.
 Make the algorithm much faster by only reporting a single file
 dependency per project dependency, by default.
 IB12-015

git-svn-id: svn+ssh://svn.eu.adacore.com/Dev/trunk/gps@152250 936e1b1b-40f2-da11-902a-00137254ae57
2009-11-13 13:02:14 +00:00
Emmanuel Briot
1ab0792923 (htables.ads): change API to get closer to what GNAT.Dynamic_Htables
currently is, and to what I422-031 aims at.
 The goal is to be able to replace this package with
 GNAT.Dynamic_Htables when the latter has been updated
(String_Utils.Hash): moved from htables.ads

git-svn-id: svn+ssh://svn.eu.adacore.com/Dev/trunk/gps@147780 936e1b1b-40f2-da11-902a-00137254ae57
2009-07-29 01:39:05 +00:00
Jerome Lambourg
8d01d8e0a3 (Load_Dir): Make sure that there are no trailing '\' when setting the python
sys.dir.
Correction of a regression brought by I325-007



git-svn-id: svn+ssh://svn.eu.adacore.com/Dev/trunk/gps@142530 936e1b1b-40f2-da11-902a-00137254ae57
2009-04-10 06:03:41 +00:00
Jerome Lambourg
dfdbed0121 Major reorganisation of the Virtual Files handling and of the remote mode
configuration management.
Major VFSification of GPS: GPS should now be using Virtual Files almost
 everywhere possible.

Part of I325-007




git-svn-id: svn+ssh://svn.eu.adacore.com/Dev/trunk/gps@142501 936e1b1b-40f2-da11-902a-00137254ae57
2009-04-09 14:37:02 +00:00
Nicolas Setton
512e2e99f2 Implement steps 1) and 2) of the transition away from Glib.XML:
1) introduce a package XML_Utils which mimics completely the interface 
     of Glib.Xml_Int
  2) replace all uses of Glib.XML_Int by uses to XML_Utils everywhere in GPS 
     (except in the GtkAda part, like the MDI, of course)
For E810-014.


git-svn-id: svn+ssh://svn.eu/Dev/trunk/gps@139944 936e1b1b-40f2-da11-902a-00137254ae57
2009-02-13 11:28:11 +00:00
Nicolas Setton
6c0f21c180 Introduce type Filesystem_String, used to represent strings coming
from the filesystem.
For I205-006.


git-svn-id: svn+ssh://svn.eu/Dev/trunk/gps@139821 936e1b1b-40f2-da11-902a-00137254ae57
2009-02-10 18:51:41 +00:00
Arnaud Charlet
56c4388038 Removed, no longer used.
Part of HA28-015


git-svn-id: svn+ssh://svn.eu/Dev/trunk/gps@132211 936e1b1b-40f2-da11-902a-00137254ae57
2008-11-10 10:03:40 +00:00
Pascal Obry
48e0e3d297 Minor reformatting and style fixes.
git-svn-id: svn+ssh://svn.eu/Dev/trunk/gps@132152 936e1b1b-40f2-da11-902a-00137254ae57
2008-11-09 11:23:03 +00:00
Arnaud Charlet
6fc50baaf4 (Load_Dir): Remove old commented out code.
Normalize directory name, since python 2.5 no longer handles unix style dirs
 properly under Windows
Part of H713-007


git-svn-id: svn+ssh://svn.eu/Dev/trunk/gps@128167 936e1b1b-40f2-da11-902a-00137254ae57
2008-08-28 16:57:06 +00:00
Arnaud Charlet
9fc2e915aa Add missing overriding keyword.
Minor reformatting.




git-svn-id: svn+ssh://svn.eu/Dev/trunk/gps@127973 936e1b1b-40f2-da11-902a-00137254ae57
2008-08-21 09:09:22 +00:00
Jerome Lambourg
969af00e00 (Python_File_Command_Handler): in __cmp__, take care of case where we make
a comparison with a non-file object. This allows to test "if file == None:"
 without raising exceptions.
Discovered while testing gnatcheck.py module.
Part of H421-019



git-svn-id: svn+ssh://svn.eu/Dev/trunk/gps@125115 936e1b1b-40f2-da11-902a-00137254ae57
2008-05-30 09:17:01 +00:00
Emmanuel Briot
7e4e8898de (GNATCOLL.VFS): new package, which contains the code previously in vfs.ad?
This code is now independent from the GPS and GtkAda codes.
 Last technical part of H114-016
(GNATCOLL.VFS.Create): we now take a filesystem as a parameter, rather than
 a host nickname, since the latter is specific to GPS, and not portable to
 gnatcoll. Appropriate backward compatible subprograms were left in GPS,
 in the filesystems.ads package
(GNATCOLL.Filesystem.Locale_To_Display): New function to handle file name
 encoding issues, as discussed in H114-016


git-svn-id: svn+ssh://svn.eu/Dev/trunk/gps@124380 936e1b1b-40f2-da11-902a-00137254ae57
2008-04-30 10:33:56 +00:00
Emmanuel Briot
7542f626a8 Renamed gnatlib => gnatcoll (H411-006)
Renamed GNAT.* packages into GNATCOLL.*
Fixed headers in gnatlib, so that they reference "G N A T C O L L", rather
 than the misc. names we have before.
Update copyright dates


git-svn-id: svn+ssh://svn.eu/Dev/trunk/gps@124025 936e1b1b-40f2-da11-902a-00137254ae57
2008-04-17 12:12:00 +00:00
Arnaud Charlet
0d4e86914c Remove pragma Unmodified, now that warning has been tuned in GNAT.
git-svn-id: svn+ssh://svn.eu/Dev/trunk/gps@120349 936e1b1b-40f2-da11-902a-00137254ae57
2008-01-03 14:24:57 +00:00