Files
gnatcoll-bindings/python/gnatcoll-any_types-python.ads

40 lines
2.4 KiB
Ada
Raw Permalink Normal View History

------------------------------------------------------------------------------
-- G N A T C O L L --
-- --
-- Copyright (C) 2009-2017, AdaCore --
-- --
-- This library is free software; you can redistribute it and/or modify it --
-- under terms of the GNU General Public License as published by the Free --
-- Software Foundation; either version 3, or (at your option) any later --
-- version. This library is distributed in the hope that it will be useful, --
-- but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHAN- --
-- TABILITY or FITNESS FOR A PARTICULAR PURPOSE. --
-- --
-- As a special exception under Section 7 of GPL version 3, you are granted --
-- additional permissions described in the GCC Runtime Library Exception, --
-- version 3.1, as published by the Free Software Foundation. --
-- --
-- You should have received a copy of the GNU General Public License and --
-- a copy of the GCC Runtime Library Exception along with this program; --
-- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see --
-- <http://www.gnu.org/licenses/>. --
-- --
------------------------------------------------------------------------------
* build_command_manager.adb: (Execute): The hook for Compute_Build_Targets_Hook now returns an Any_Type. * builder_facility_module.adb: (On_Compute_Build_Targets): This now returns an Any_Type. The structure of this Any_Type is described in shell_commands.xml. (Install_Button_For_Target): The hook for Compute_Build_Targets_Hook now returns an Any_Type, adapt. (Add_Menu_For_Target): Likewise. * gnatcoll-any_types.adb: Initial revision. * gnatcoll-any_types.ads: Initial revision. * gnatcoll-scripts-shell.adb: Implement overriding subprogram Execute [Any_Type]. * gnatcoll-scripts-shell.ads: Declare overriding subprogram Execute [Any_Type]. * gnatcoll-scripts.ads: (Execute): New abstract subprogram, returning an Any_Type. * gnatcoll-any_types-python.adb: Initial revision. * gnatcoll-any_types-python.ads: Initial revision. * gnatcoll-scripts-python.adb: (Execute): Declare overriding subprogram. Implement. (Execute_Command): New subprogram. * gnatcoll-scripts-python.ads: (Execute_Command): New subprogram. * gps-kernel-hooks.adb: (Command_Handler_Return_Any): New subprogram. (Wrapper_Return_Any): New type. (Execute): Implement wrappers. (Destroy): Implement. (Run_Hook_Until_Not_Empty): New subprogram. (Register_Standard_Hooks): The hook Compute_Build_Targets_Hook now returns an Any_Type. * gps-kernel-hooks.ads: Add functions allowing to launch hooks that return Any_Types. Add documentation. * Makefile.py: Adapt to new return types of compute_build_targets hook. * shell_commands.xml: Document new return type of compute_build_targets hook. Follow-up on I302-024. We want to display the base names of "main" targets in the Build menu, and we also want the hook to contain the full path to the main file in order to support "%TT". We cannot do a simple "base_name" on the target when it comes to adding it to the menu, because this suppresses useful information coming from targets from Makefile.py. To solve this, the hook "compute_build_targets" now returns a list of targets, with, for each target, the name to display in the menu, and the full name. In order to implement this, we introduce a way for hooks to return complex information, mapping a subset of the Python types. git-svn-id: svn+ssh://svn.eu.adacore.com/Dev/trunk/gps@143141 936e1b1b-40f2-da11-902a-00137254ae57
2009-04-22 13:16:40 +00:00
-- This package provides a utilities to manipulate Python objects. This is not
-- meant to be very performance-efficient, but to provide an interface simpler
-- than the direct manipulation of PyObjects.
with GNATCOLL.Python; use GNATCOLL.Python;
package GNATCOLL.Any_Types.Python is
function From_PyObject (Object : PyObject) return Any_Type;
-- Create an Any_Type from the contents of Object. This creates copies in
-- of any data in Object.
-- Empty_Any_Type is returned if the underlying Python type (or its
-- children in case of container types) is not supported.
-- The result must be freed by the caller, by calling Free.
end GNATCOLL.Any_Types.Python;