~ubuntu-branches/ubuntu/intrepid/libgtkada2/intrepid

« back to all changes in this revision

Viewing changes to src/gtk-extra-plot_data.adb

  • Committer: Bazaar Package Importer
  • Author(s): Ludovic Brenta
  • Date: 2008-07-31 18:10:47 UTC
  • mfrom: (1.1.3 upstream)
  • mto: This revision was merged to the branch mainline in revision 7.
  • Revision ID: james.westby@ubuntu.com-20080731181047-6m1y25zjad0p2yjr
Tags: 2.12.0-2

Correct the project files to add a Library_ALI_Dir and correct the
Library_Name.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
-----------------------------------------------------------------------
2
2
--          GtkAda - Ada95 binding for the Gimp Toolkit              --
3
3
--                                                                   --
 
4
--                       Copyright (C) 2000                          --
4
5
--        Emmanuel Briot, Joel Brobecker and Arnaud Charlet          --
 
6
--                 Copyright (C) 2001-2008, AdaCore                  --
5
7
--                                                                   --
6
8
-- This library is free software; you can redistribute it and/or     --
7
9
-- modify it under the terms of the GNU General Public               --
25
25
with Ada.Unchecked_Conversion;
26
26
with Interfaces.C; use Interfaces.C;
27
27
 
28
 
with Gdk.Color;    use Gdk.Color;
29
 
with Gdk.GC;       use Gdk.GC;
30
 
with Gtk.Widget;   use Gtk.Widget;
31
 
with Gtkada.Types; use Gtkada.Types;
 
28
with Gdk.Color;       use Gdk.Color;
 
29
with Gdk.GC;          use Gdk.GC;
 
30
with Gtk.Widget;      use Gtk.Widget;
 
31
with Gtkada.Bindings; use Gtkada.Bindings;
 
32
with Gtkada.Types;    use Gtkada.Types;
 
33
 
 
34
with Glib.Type_Conversion_Hooks;
32
35
 
33
36
package body Gtk.Extra.Plot_Data is
34
37
 
 
38
   package Type_Conversion is new Glib.Type_Conversion_Hooks.Hook_Registrator
 
39
     (Get_Type'Access, Gtk_Plot_Data_Record);
 
40
   pragma Warnings (Off, Type_Conversion);
 
41
 
35
42
   type Color_Access is access Gdk_Color;
36
43
   function Convert is new Ada.Unchecked_Conversion
37
44
     (System.Address, Color_Access);
472
479
   function Get_Labels (Data : access Gtk_Plot_Data_Record)
473
480
      return Gtkada.Types.Chars_Ptr_Array
474
481
   is
475
 
      type Str_Array is array (Natural) of Chars_Ptr;
476
 
      type Str_Array_Access is access all Str_Array;
477
 
      pragma Convention (C, Str_Array_Access);
478
 
 
479
 
      function Internal (Data : System.Address) return Str_Array_Access;
 
482
      function Internal (Data : System.Address) return chars_ptr_array_access;
480
483
      pragma Import (C, Internal, "gtk_plot_data_get_labels");
481
484
 
482
485
      N : constant size_t := size_t (Get_Numpoints (Data));
483
486
 
484
487
   begin
485
488
      return Chars_Ptr_Array
486
 
        (Internal (Get_Object (Data))(0 .. Integer (N) - 1));
 
489
        (Internal (Get_Object (Data))(0 .. N - 1));
487
490
   end Get_Labels;
488
491
 
489
492
   -----------------