1------------------------------------------------------------------------------ 2-- GtkAda - Ada95 binding for Gtk+/Gnome -- 3-- -- 4-- Copyright (C) 2014-2015, 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 24package Gtkada.Canvas_View.Models.Layers is 25 26 procedure Layout 27 (Self : not null access Canvas_Model_Record'Class; 28 View : access Canvas_View_Record'Class := null; 29 Horizontal : Boolean := True; 30 Add_Waypoints : Boolean := False; 31 Space_Between_Items : Gdouble := 10.0; 32 Space_Between_Layers : Gdouble := 20.0); 33 -- This algorithm is a wrapper for Glib.Graphs.Layouts.Layer_Layout. 34 -- 35 -- It Organizes the items into layers: items in layer n never have an 36 -- out-link to any item in a layer 1 .. (n - 1). Within a layer, the 37 -- items are then reorganized to try and minimize the edge crossings. 38 -- 39 -- If Add_Waypoints is True, then long edges are split with waypoints. 40 -- This generally limits the number of edge crossing, but make moving 41 -- items move cumbersome since the waypoints are not moved at the same 42 -- time. 43 -- 44 -- It is provided as an example, and might be changed or removed in the 45 -- future. 46 -- 47 -- When a non-null value is provided for view, the items will be animated 48 -- to their new position. Otherwise, they are moved directly to the new 49 -- position. Items whose current position is No_Position will not be 50 -- animated, they are assumed not yet to be on the view seen by the user. 51 52end Gtkada.Canvas_View.Models.Layers; 53