1-----------------------------------------------------------------------
2--          GtkAda - Ada95 binding for the Gimp Toolkit              --
3--                                                                   --
4--                       Copyright (C) 2000                          --
5--        Emmanuel Briot, Joel Brobecker and Arnaud Charlet          --
6--                 Copyright (C) 2001-2013, AdaCore                  --
7--                                                                   --
8-- This library is free software; you can redistribute it and/or     --
9-- modify it under the terms of the GNU General Public               --
10-- License as published by the Free Software Foundation; either      --
11-- version 2 of the License, or (at your option) any later version.  --
12--                                                                   --
13-- This library is distributed in the hope that it will be useful,   --
14-- but WITHOUT ANY WARRANTY; without even the implied warranty of    --
15-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU --
16-- General Public License for more details.                          --
17--                                                                   --
18-- You should have received a copy of the GNU General Public         --
19-- License along with this library; if not, write to the             --
20-- Free Software Foundation, Inc., 59 Temple Place - Suite 330,      --
21-- Boston, MA 02111-1307, USA.                                       --
22--                                                                   --
23-- As a special exception, if other files instantiate generics from  --
24-- this unit, or you link this unit with other files to produce an   --
25-- executable, this  unit  does not  by itself cause  the resulting  --
26-- executable to be covered by the GNU General Public License. This  --
27-- exception does not however invalidate any other reasons why the   --
28-- executable file  might be covered by the  GNU Public License.     --
29-----------------------------------------------------------------------
30
31with Ada.Unchecked_Conversion;
32with Interfaces.C; use Interfaces.C;
33
34with Gdk.Color;       use Gdk.Color;
35with Gdk.GC;          use Gdk.GC;
36with Gtk.Widget;      use Gtk.Widget;
37with Gtkada.Bindings; use Gtkada.Bindings;
38with Gtkada.Types;    use Gtkada.Types;
39
40with Glib.Type_Conversion_Hooks;
41
42package body Gtk.Extra.Plot_Data is
43
44   package Type_Conversion is new Glib.Type_Conversion_Hooks.Hook_Registrator
45     (Get_Type'Access, Gtk_Plot_Data_Record);
46   pragma Warnings (Off, Type_Conversion);
47
48   type Color_Access is access Gdk_Color;
49   function Convert is new Ada.Unchecked_Conversion
50     (System.Address, Color_Access);
51
52   -------------
53   -- Gtk_New --
54   -------------
55
56   procedure Gtk_New
57     (Data : out Gtk_Plot_Data; Func : Plot_Function := null) is
58   begin
59      Data := new Gtk_Plot_Data_Record;
60      Initialize (Data, Func);
61   end Gtk_New;
62
63   ----------------
64   -- Initialize --
65   ----------------
66
67   procedure Initialize
68     (Data : access Gtk_Plot_Data_Record'Class; Func : Plot_Function := null)
69   is
70      function Internal return System.Address;
71      pragma Import (C, Internal, "gtk_plot_data_new");
72
73      function Internal2 (Func : Plot_Function) return System.Address;
74      pragma Import (C, Internal2, "gtk_plot_data_new_function");
75   begin
76      if Func = null then
77         Set_Object (Data, Internal);
78      else
79         Set_Object (Data, Internal2 (Func));
80      end if;
81   end Initialize;
82
83   --------------
84   -- Set_Name --
85   --------------
86
87   procedure Set_Name (Data : access Gtk_Plot_Data_Record; Name : String) is
88      procedure Internal (Data : System.Address; Name : in String);
89      pragma Import (C, Internal, "gtk_plot_data_set_name");
90   begin
91      Internal (Get_Object (Data), Name & ASCII.NUL);
92   end Set_Name;
93
94   -----------
95   -- Paint --
96   -----------
97
98   procedure Paint (Data : access Gtk_Plot_Data_Record) is
99      procedure Internal (Data : System.Address);
100      pragma Import (C, Internal, "gtk_plot_data_paint");
101   begin
102      Internal (Get_Object (Data));
103   end Paint;
104
105   -----------------
106   -- Draw_Points --
107   -----------------
108
109   procedure Draw_Points (Data : access Gtk_Plot_Data_Record; N : Gint) is
110      procedure Internal (Data : System.Address; N : Gint);
111      pragma Import (C, Internal, "gtk_plot_data_draw_points");
112   begin
113      Internal (Get_Object (Data), N);
114   end Draw_Points;
115
116   -----------------
117   -- Draw_Symbol --
118   -----------------
119
120   procedure Draw_Symbol
121     (Data : access Gtk_Plot_Data_Record; X, Y : Gdouble)
122   is
123      procedure Internal (Data : System.Address; X, Y : Gdouble);
124      pragma Import (C, Internal, "gtk_plot_data_draw_symbol");
125   begin
126      Internal (Get_Object (Data), X, Y);
127   end Draw_Symbol;
128
129   ----------------
130   -- Set_Points --
131   ----------------
132
133   procedure Set_Points
134     (Data : access Gtk_Plot_Data_Record;
135      X    : Gdouble_Array_Access;
136      Y    : Gdouble_Array_Access;
137      Dx   : Gdouble_Array_Access;
138      Dy   : Gdouble_Array_Access)
139   is
140      procedure Internal (Data       : in System.Address;
141                          X          : in System.Address;
142                          Y          : in System.Address;
143                          Dx         : in System.Address;
144                          Dy         : in System.Address;
145                          Num_Points : in Gint);
146      pragma Import (C, Internal, "gtk_plot_data_set_points");
147      Xa, Ya, Dxa, Dya : System.Address := System.Null_Address;
148   begin
149      if X /= null then
150         Xa := X (X'First)'Address;
151      end if;
152
153      if Y /= null then
154         Ya := Y (Y'First)'Address;
155      end if;
156
157      if Dx /= null then
158         Dxa := Dx (Dx'First)'Address;
159      end if;
160
161      if Dy /= null then
162         Dya := Dy (Dy'First)'Address;
163      end if;
164
165      Internal (Get_Object (Data), Xa, Ya, Dxa, Dya, X'Length);
166   end Set_Points;
167
168   ----------------
169   -- Get_Points --
170   ----------------
171
172   procedure Get_Points
173     (Data : access Gtk_Plot_Data_Record;
174      X    : out Points_Array;
175      Y    : out Points_Array;
176      Dx   : out Points_Array;
177      Dy   : out Points_Array)
178   is
179      procedure Internal (Data       : in System.Address;
180                          X          : out System.Address;
181                          Y          : out System.Address;
182                          Dx         : out System.Address;
183                          Dy         : out System.Address;
184                          Num_Points : out Gint);
185      pragma Import (C, Internal, "gtk_plot_data_get_points");
186      Num_Points : Gint;
187      X1, Y1, Dx1, Dy1 : System.Address;
188   begin
189      Internal (Get_Object (Data), X1, Y1, Dx1, Dy1, Num_Points);
190      X  := (Points => To_Double_Array (X1),  Num_Points => Num_Points);
191      Y  := (Points => To_Double_Array (Y1),  Num_Points => Num_Points);
192      Dx := (Points => To_Double_Array (Dx1), Num_Points => Num_Points);
193      Dy := (Points => To_Double_Array (Dy1), Num_Points => Num_Points);
194   end Get_Points;
195
196   -----------
197   -- Set_X --
198   -----------
199
200   procedure Set_X
201     (Data : access Gtk_Plot_Data_Record; X : Gdouble_Array_Access)
202   is
203      procedure Internal (Data : System.Address; X : System.Address);
204      pragma Import (C, Internal, "gtk_plot_data_set_x");
205   begin
206      pragma Assert (Get_Numpoints (Data) = X'Length);
207      Internal (Get_Object (Data), X (X'First)'Address);
208   end Set_X;
209
210   -----------
211   -- Set_Y --
212   -----------
213
214   procedure Set_Y
215     (Data : access Gtk_Plot_Data_Record; Y : Gdouble_Array_Access)
216   is
217      procedure Internal (Data : System.Address; Y : System.Address);
218      pragma Import (C, Internal, "gtk_plot_data_set_y");
219   begin
220      pragma Assert (Get_Numpoints (Data) = Y'Length);
221      Internal (Get_Object (Data), Y (Y'First)'Address);
222   end Set_Y;
223
224   -----------
225   -- Set_Z --
226   -----------
227
228   procedure Set_Z
229     (Data : access Gtk_Plot_Data_Record; Z : Gdouble_Array_Access)
230   is
231      procedure Internal (Data : System.Address; Z : System.Address);
232      pragma Import (C, Internal, "gtk_plot_data_set_z");
233   begin
234      pragma Assert (Get_Numpoints (Data) = Z'Length);
235      Internal (Get_Object (Data), Z (Z'First)'Address);
236   end Set_Z;
237
238   -----------
239   -- Set_A --
240   -----------
241
242   procedure Set_A
243     (Data : access Gtk_Plot_Data_Record; A : Gdouble_Array_Access)
244   is
245      procedure Internal (Data : System.Address; A : System.Address);
246      pragma Import (C, Internal, "gtk_plot_data_set_a");
247   begin
248      pragma Assert (Get_Numpoints (Data) = A'Length);
249      Internal (Get_Object (Data), A (A'First)'Address);
250   end Set_A;
251
252   ------------
253   -- Set_Dx --
254   ------------
255
256   procedure Set_Dx
257     (Data : access Gtk_Plot_Data_Record; Dx : Gdouble_Array_Access)
258   is
259      procedure Internal (Data : System.Address; Dx : System.Address);
260      pragma Import (C, Internal, "gtk_plot_data_set_dx");
261   begin
262      pragma Assert (Get_Numpoints (Data) = Dx'Length);
263      Internal (Get_Object (Data), Dx (Dx'First)'Address);
264   end Set_Dx;
265
266   ------------
267   -- Set_Dy --
268   ------------
269
270   procedure Set_Dy
271     (Data : access Gtk_Plot_Data_Record; Dy : Gdouble_Array_Access)
272   is
273      procedure Internal (Data : System.Address; Dy : System.Address);
274      pragma Import (C, Internal, "gtk_plot_data_set_dy");
275   begin
276      pragma Assert (Get_Numpoints (Data) = Dy'Length);
277      Internal (Get_Object (Data), Dy (Dy'First)'Address);
278   end Set_Dy;
279
280   ------------
281   -- Set_Dz --
282   ------------
283
284   procedure Set_Dz
285     (Data : access Gtk_Plot_Data_Record; Dz : Gdouble_Array_Access)
286   is
287      procedure Internal (Data : System.Address; Dz : System.Address);
288      pragma Import (C, Internal, "gtk_plot_data_set_dz");
289   begin
290      pragma Assert (Get_Numpoints (Data) = Dz'Length);
291      Internal (Get_Object (Data), Dz (Dz'First)'Address);
292   end Set_Dz;
293
294   ------------
295   -- Set_Da --
296   ------------
297
298   procedure Set_Da
299     (Data : access Gtk_Plot_Data_Record; Da : Gdouble_Array_Access)
300   is
301      procedure Internal (Data : System.Address; Da : System.Address);
302      pragma Import (C, Internal, "gtk_plot_data_set_da");
303   begin
304      pragma Assert (Get_Numpoints (Data) = Da'Length);
305      Internal (Get_Object (Data), Da (Da'First)'Address);
306   end Set_Da;
307
308   -----------
309   -- Get_X --
310   -----------
311
312   function Get_X (Data : access Gtk_Plot_Data_Record) return Points_Array is
313      function Internal (Data : System.Address; Num_Points : System.Address)
314         return System.Address;
315      pragma Import (C, Internal, "gtk_plot_data_get_x");
316
317      Num_Points : aliased Gint;
318      S          : constant System.Address :=
319        Internal (Get_Object (Data), Num_Points'Address);
320
321   begin
322      return (Points => To_Double_Array (S), Num_Points => Num_Points);
323   end Get_X;
324
325   -----------
326   -- Get_Y --
327   -----------
328
329   function Get_Y (Data : access Gtk_Plot_Data_Record) return Points_Array is
330      function Internal (Data : System.Address; Num_Points : System.Address)
331         return System.Address;
332      pragma Import (C, Internal, "gtk_plot_data_get_y");
333
334      Num_Points : aliased Gint;
335      S          : constant System.Address :=
336        Internal (Get_Object (Data), Num_Points'Address);
337
338   begin
339      return (Points => To_Double_Array (S), Num_Points => Num_Points);
340   end Get_Y;
341
342   -----------
343   -- Get_Z --
344   -----------
345
346   function Get_Z (Data : access Gtk_Plot_Data_Record) return Points_Array is
347      function Internal (Data : System.Address; Num_Points : System.Address)
348         return System.Address;
349      pragma Import (C, Internal, "gtk_plot_data_get_z");
350
351      Num_Points : aliased Gint;
352      S          : constant System.Address :=
353        Internal (Get_Object (Data), Num_Points'Address);
354
355   begin
356      return (Points => To_Double_Array (S), Num_Points => Num_Points);
357   end Get_Z;
358
359   -----------
360   -- Get_A --
361   -----------
362
363   function Get_A (Data : access Gtk_Plot_Data_Record) return Points_Array is
364      function Internal (Data : System.Address; Num_Points : System.Address)
365         return System.Address;
366      pragma Import (C, Internal, "gtk_plot_data_get_a");
367
368      Num_Points : aliased Gint;
369      S          : constant System.Address :=
370        Internal (Get_Object (Data), Num_Points'Address);
371
372   begin
373      return (Points => To_Double_Array (S), Num_Points => Num_Points);
374   end Get_A;
375
376   ------------
377   -- Get_Dx --
378   ------------
379
380   function Get_Dx (Data : access Gtk_Plot_Data_Record) return Points_Array is
381      function Internal (Data : System.Address; Num_Points : System.Address)
382         return System.Address;
383      pragma Import (C, Internal, "gtk_plot_data_get_dx");
384
385      Num_Points : aliased Gint;
386      S          : constant System.Address :=
387        Internal (Get_Object (Data), Num_Points'Address);
388
389   begin
390      return (Points => To_Double_Array (S), Num_Points => Num_Points);
391   end Get_Dx;
392
393   ------------
394   -- Get_Dy --
395   ------------
396
397   function Get_Dy (Data : access Gtk_Plot_Data_Record) return Points_Array is
398      function Internal (Data : System.Address; Num_Points : System.Address)
399         return System.Address;
400      pragma Import (C, Internal, "gtk_plot_data_get_dy");
401
402      Num_Points : aliased Gint;
403      S          : constant System.Address :=
404        Internal (Get_Object (Data), Num_Points'Address);
405
406   begin
407      return (Points => To_Double_Array (S), Num_Points => Num_Points);
408   end Get_Dy;
409
410   ------------
411   -- Get_Dz --
412   ------------
413
414   function Get_Dz (Data : access Gtk_Plot_Data_Record) return Points_Array is
415      function Internal
416        (Data : System.Address; Num_Points : System.Address)
417         return System.Address;
418      pragma Import (C, Internal, "gtk_plot_data_get_dz");
419
420      Num_Points : aliased Gint;
421      S          : constant System.Address :=
422        Internal (Get_Object (Data), Num_Points'Address);
423
424   begin
425      return (Points => To_Double_Array (S), Num_Points => Num_Points);
426   end Get_Dz;
427
428   ------------
429   -- Get_Da --
430   ------------
431
432   function Get_Da  (Data : access Gtk_Plot_Data_Record) return Points_Array is
433      function Internal (Data : System.Address; Num_Points : System.Address)
434         return System.Address;
435      pragma Import (C, Internal, "gtk_plot_data_get_da");
436
437      Num_Points : aliased Gint;
438      S          : constant System.Address :=
439        Internal (Get_Object (Data), Num_Points'Address);
440
441   begin
442      return (Points => To_Double_Array (S), Num_Points => Num_Points);
443   end Get_Da;
444
445   -------------------
446   -- Set_Numpoints --
447   -------------------
448
449   procedure Set_Numpoints (Data : access Gtk_Plot_Data_Record; Num : Gint) is
450      procedure Internal (Data : System.Address; Num : Gint);
451      pragma Import (C, Internal, "gtk_plot_data_set_numpoints");
452   begin
453      Internal (Get_Object (Data), Num);
454   end Set_Numpoints;
455
456   -------------------
457   -- Get_Numpoints --
458   -------------------
459
460   function Get_Numpoints (Data : access Gtk_Plot_Data_Record) return Gint is
461      function Internal (Data : System.Address) return Gint;
462      pragma Import (C, Internal, "gtk_plot_data_get_numpoints");
463   begin
464      return Internal (Get_Object (Data));
465   end Get_Numpoints;
466
467   ----------------
468   -- Set_Labels --
469   ----------------
470
471   procedure Set_Labels
472     (Data : access Gtk_Plot_Data_Record;
473      Labels : Gtkada.Types.Chars_Ptr_Array)
474   is
475      procedure Internal (Data : System.Address; Labels : Chars_Ptr_Array);
476      pragma Import (C, Internal, "gtk_plot_data_set_labels");
477   begin
478      Internal (Get_Object (Data), Labels);
479   end Set_Labels;
480
481   ----------------
482   -- Get_Labels --
483   ----------------
484
485   function Get_Labels (Data : access Gtk_Plot_Data_Record)
486      return Gtkada.Types.Chars_Ptr_Array
487   is
488      function Internal (Data : System.Address) return chars_ptr_array_access;
489      pragma Import (C, Internal, "gtk_plot_data_get_labels");
490
491      N : constant size_t := size_t (Get_Numpoints (Data));
492
493   begin
494      return Chars_Ptr_Array
495        (Internal (Get_Object (Data))(0 .. N - 1));
496   end Get_Labels;
497
498   -----------------
499   -- Show_Labels --
500   -----------------
501
502   procedure Show_Labels
503     (Data : access Gtk_Plot_Data_Record; Show : Boolean)
504   is
505      procedure Internal (Data : System.Address; Show : Gint);
506      pragma Import (C, Internal, "gtk_plot_data_show_labels");
507   begin
508      Internal (Get_Object (Data), Boolean'Pos (Show));
509   end Show_Labels;
510
511   ---------------------------
512   -- Labels_Set_Attributes --
513   ---------------------------
514
515   procedure Labels_Set_Attributes
516     (Data : access Gtk_Plot_Data_Record;
517      Font : String;
518      Height : Gint;
519      Angle  : Plot_Angle;
520      Foreground : Gdk.Color.Gdk_Color;
521      Background : Gdk.Color.Gdk_Color)
522   is
523      procedure Internal
524        (Data : System.Address;
525         Font : String;
526         Height : Gint;
527         Angle : Plot_Angle;
528         Foreground, Background : System.Address);
529      pragma Import (C, Internal, "gtk_plot_data_labels_set_attributes");
530
531      F : aliased Gdk_Color := Foreground;
532      B : aliased Gdk_Color := Background;
533   begin
534      Internal (Get_Object (Data), Font & ASCII.NUL, Height, Angle,
535                F'Address, B'Address);
536   end Labels_Set_Attributes;
537
538   ----------------
539   -- Set_Symbol --
540   ----------------
541
542   procedure Set_Symbol
543     (Data         : access Gtk_Plot_Data_Record;
544      The_Type     : Plot_Symbol_Type;
545      Style        : Plot_Symbol_Style;
546      Size         : Gint;
547      Line_Width   : Gfloat;
548      Color        : Gdk.Color.Gdk_Color;
549      Border_Color : Gdk.Color.Gdk_Color)
550   is
551      procedure Internal
552        (Data                  : System.Address;
553         The_Type              : Plot_Symbol_Type;
554         Style                 : Plot_Symbol_Style;
555         Size                  : Gint;
556         Line_Width            : Gfloat;
557         Color, Border_Color   : System.Address);
558      pragma Import (C, Internal, "gtk_plot_data_set_symbol");
559
560      C : aliased Gdk_Color := Color;
561      B : aliased Gdk_Color := Border_Color;
562
563   begin
564      Internal
565        (Get_Object (Data), The_Type, Style, Size,
566         Line_Width, C'Address, B'Address);
567   end Set_Symbol;
568
569   ----------------
570   -- Get_Symbol --
571   ----------------
572
573   procedure Get_Symbol
574     (Data         : access Gtk_Plot_Data_Record;
575      The_Type     : out Plot_Symbol_Type;
576      Style        : out Plot_Symbol_Style;
577      Size         : out Gint;
578      Line_Width   : out Gint;
579      Color        : out Gdk.Color.Gdk_Color;
580      Border_Color : out Gdk.Color.Gdk_Color)
581   is
582      procedure Internal
583        (Data         : System.Address;
584         The_Type     : out Plot_Symbol_Type;
585         Style        : out Plot_Symbol_Style;
586         Size         : out Gint;
587         Line_Width   : out Gint;
588         Color        : System.Address;
589         Border_Color : System.Address);
590      pragma Import (C, Internal, "gtk_plot_data_get_symbol");
591      C, B : aliased Gdk_Color;
592   begin
593      Internal (Get_Object (Data), The_Type, Style, Size, Line_Width,
594                C'Address, B'Address);
595      Color := C;
596      Border_Color := B;
597   end Get_Symbol;
598
599   -------------------
600   -- Set_Connector --
601   -------------------
602
603   procedure Set_Connector
604     (Data : access Gtk_Plot_Data_Record; Connector : Plot_Connector)
605   is
606      procedure Internal (Data : System.Address; Connector : Plot_Connector);
607      pragma Import (C, Internal, "gtk_plot_data_set_connector");
608
609   begin
610      Internal (Get_Object (Data), Connector);
611   end Set_Connector;
612
613   -------------------
614   -- Get_Connector --
615   -------------------
616
617   function Get_Connector (Data : access Gtk_Plot_Data_Record)
618      return Plot_Connector
619   is
620      function Internal (Data : System.Address) return Gint;
621      pragma Import (C, Internal, "gtk_plot_data_get_connector");
622   begin
623      return Plot_Connector'Val (Internal (Get_Object (Data)));
624   end Get_Connector;
625
626   -------------------------
627   -- Set_Line_Attributes --
628   -------------------------
629
630   procedure Set_Line_Attributes
631     (Data       : access Gtk_Plot_Data_Record;
632      Style      : Plot_Line_Style;
633      Cap_Style  : Gdk.GC.Gdk_Cap_Style;
634      Join_Style : Gdk.GC.Gdk_Join_Style;
635      Width      : Gfloat;
636      Color      : Gdk.Color.Gdk_Color)
637   is
638      procedure Internal
639        (Data  : System.Address;
640         Style : Plot_Line_Style;
641         Cap_Style : Gdk_Cap_Style;
642         Join_Style : Gdk_Join_Style;
643         Width : Gfloat;
644         Color : System.Address);
645      pragma Import (C, Internal, "gtk_plot_data_set_line_attributes");
646
647      C : aliased Gdk_Color := Color;
648
649   begin
650      Internal
651        (Get_Object (Data), Style, Cap_Style, Join_Style, Width, C'Address);
652   end Set_Line_Attributes;
653
654   -------------------------
655   -- Get_Line_Attributes --
656   -------------------------
657
658   procedure Get_Line_Attributes
659     (Data       : access Gtk_Plot_Data_Record;
660      Style      : out Plot_Line_Style;
661      Cap_Style  : out Gdk.GC.Gdk_Cap_Style;
662      Join_Style : out Gdk.GC.Gdk_Join_Style;
663      Width      : out Gfloat;
664      Color      : out Gdk.Color.Gdk_Color)
665   is
666      procedure Internal
667        (Data       : System.Address;
668         Style      : out Plot_Line_Style;
669         Cap_Style  : out Gdk.GC.Gdk_Cap_Style;
670         Join_Style : out Gdk.GC.Gdk_Join_Style;
671         Width      : out Gfloat;
672         Color      : System.Address);
673      pragma Import (C, Internal, "gtk_plot_data_get_line_attributes");
674      C : aliased Gdk_Color;
675   begin
676      Internal
677        (Get_Object (Data), Style, Cap_Style, Join_Style, Width, C'Address);
678      Color := C;
679   end Get_Line_Attributes;
680
681   ----------------------
682   -- Set_X_Attributes --
683   ----------------------
684
685   procedure Set_X_Attributes
686     (Data       : access Gtk_Plot_Data_Record;
687      Style      : Plot_Line_Style;
688      Cap_Style  : Gdk.GC.Gdk_Cap_Style;
689      Join_Style : Gdk.GC.Gdk_Join_Style;
690      Width      : Gfloat;
691      Color      : Gdk.Color.Gdk_Color)
692   is
693      procedure Internal
694        (Data  : System.Address;
695         Style : Plot_Line_Style;
696         Cap_Style : Gdk_Cap_Style;
697         Join_Style : Gdk_Join_Style;
698         Width : Gfloat;
699         Color : System.Address);
700      pragma Import (C, Internal, "gtk_plot_data_set_x_attributes");
701
702      C : aliased Gdk_Color := Color;
703
704   begin
705      Internal
706        (Get_Object (Data), Style, Cap_Style, Join_Style, Width, C'Address);
707   end Set_X_Attributes;
708
709   ----------------------
710   -- Set_Y_Attributes --
711   ----------------------
712
713   procedure Set_Y_Attributes
714     (Data       : access Gtk_Plot_Data_Record;
715      Style      : Plot_Line_Style;
716      Cap_Style  : Gdk.GC.Gdk_Cap_Style;
717      Join_Style : Gdk.GC.Gdk_Join_Style;
718      Width      : Gfloat;
719      Color      : Gdk.Color.Gdk_Color)
720   is
721      procedure Internal
722        (Data       : System.Address;
723         Style      : Plot_Line_Style;
724         Cap_Style  : Gdk.GC.Gdk_Cap_Style;
725         Join_Style : Gdk.GC.Gdk_Join_Style;
726         Width      : Gfloat;
727         Color      : System.Address);
728      pragma Import (C, Internal, "gtk_plot_data_set_y_attributes");
729
730      C : aliased Gdk_Color := Color;
731
732   begin
733      Internal
734        (Get_Object (Data), Style, Cap_Style, Join_Style, Width, C'Address);
735   end Set_Y_Attributes;
736
737   ----------------------
738   -- Set_Z_Attributes --
739   ----------------------
740
741   procedure Set_Z_Attributes
742     (Data       : access Gtk_Plot_Data_Record;
743      Style      : Plot_Line_Style;
744      Cap_Style  : Gdk.GC.Gdk_Cap_Style;
745      Join_Style : Gdk.GC.Gdk_Join_Style;
746      Width      : Gfloat;
747      Color      : Gdk.Color.Gdk_Color)
748   is
749      procedure Internal
750        (Data       : System.Address;
751         Style      : Plot_Line_Style;
752         Cap_Style  : Gdk.GC.Gdk_Cap_Style;
753         Join_Style : Gdk.GC.Gdk_Join_Style;
754         Width      : Gfloat;
755         Color      : System.Address);
756      pragma Import (C, Internal, "gtk_plot_data_set_z_attributes");
757
758      C : aliased Gdk_Color := Color;
759
760   begin
761      Internal
762        (Get_Object (Data), Style, Cap_Style, Join_Style, Width, C'Address);
763   end Set_Z_Attributes;
764
765   -------------------
766   -- Show_Xerrbars --
767   -------------------
768
769   procedure Show_Xerrbars (Data : access Gtk_Plot_Data_Record) is
770      procedure Internal (Data : System.Address);
771      pragma Import (C, Internal, "gtk_plot_data_show_xerrbars");
772   begin
773      Internal (Get_Object (Data));
774   end Show_Xerrbars;
775
776   -------------------
777   -- Show_Yerrbars --
778   -------------------
779
780   procedure Show_Yerrbars (Data : access Gtk_Plot_Data_Record) is
781      procedure Internal (Data : System.Address);
782      pragma Import (C, Internal, "gtk_plot_data_show_yerrbars");
783   begin
784      Internal (Get_Object (Data));
785   end Show_Yerrbars;
786
787   -------------------
788   -- Show_Zerrbars --
789   -------------------
790
791   procedure Show_Zerrbars (Data : access Gtk_Plot_Data_Record) is
792      procedure Internal (Data : System.Address);
793      pragma Import (C, Internal, "gtk_plot_data_show_zerrbars");
794   begin
795      Internal (Get_Object (Data));
796   end Show_Zerrbars;
797
798   -------------------
799   -- Hide_Xerrbars --
800   -------------------
801
802   procedure Hide_Xerrbars (Data : access Gtk_Plot_Data_Record) is
803      procedure Internal (Data : System.Address);
804      pragma Import (C, Internal, "gtk_plot_data_hide_xerrbars");
805   begin
806      Internal (Get_Object (Data));
807   end Hide_Xerrbars;
808
809   -------------------
810   -- Hide_Yerrbars --
811   -------------------
812
813   procedure Hide_Yerrbars (Data : access Gtk_Plot_Data_Record) is
814      procedure Internal (Data : System.Address);
815      pragma Import (C, Internal, "gtk_plot_data_hide_yerrbars");
816   begin
817      Internal (Get_Object (Data));
818   end Hide_Yerrbars;
819
820   -------------------
821   -- Hide_Zerrbars --
822   -------------------
823
824   procedure Hide_Zerrbars (Data : access Gtk_Plot_Data_Record) is
825      procedure Internal (Data : System.Address);
826      pragma Import (C, Internal, "gtk_plot_data_hide_zerrbars");
827   begin
828      Internal (Get_Object (Data));
829   end Hide_Zerrbars;
830
831   ---------------
832   -- Fill_Area --
833   ---------------
834
835   procedure Fill_Area (Data : access Gtk_Plot_Data_Record; Fill : Boolean) is
836      procedure Internal (Data : System.Address; Fill : Gint);
837      pragma Import (C, Internal, "gtk_plot_data_fill_area");
838   begin
839      Internal (Get_Object (Data), Boolean'Pos (Fill));
840   end Fill_Area;
841
842   --------------------
843   -- Area_Is_Filled --
844   --------------------
845
846   function Area_Is_Filled (Data : access Gtk_Plot_Data_Record)
847      return Boolean
848   is
849      function Internal (Data : System.Address) return Gint;
850      pragma Import (C, Internal, "gtk_plot_data_area_is_filled");
851   begin
852      return Boolean'Val (Internal (Get_Object (Data)));
853   end Area_Is_Filled;
854
855   ----------------
856   -- Set_Legend --
857   ----------------
858
859   procedure Set_Legend (Data : access Gtk_Plot_Data_Record; Legend : String)
860   is
861      procedure Internal (Data : System.Address; Legend : String);
862      pragma Import (C, Internal, "gtk_plot_data_set_legend");
863   begin
864      Internal (Get_Object (Data), Legend & ASCII.NUL);
865   end Set_Legend;
866
867   -----------------
868   -- Show_Legend --
869   -----------------
870
871   procedure Show_Legend (Data : access Gtk_Plot_Data_Record) is
872      procedure Internal (Data : System.Address);
873      pragma Import (C, Internal, "gtk_plot_data_show_legend");
874   begin
875      Internal (Get_Object (Data));
876   end Show_Legend;
877
878   -----------------
879   -- Hide_Legend --
880   -----------------
881
882   procedure Hide_Legend (Data : access Gtk_Plot_Data_Record) is
883      procedure Internal (Data : System.Address);
884      pragma Import (C, Internal, "gtk_plot_data_hide_legend");
885   begin
886      Internal (Get_Object (Data));
887   end Hide_Legend;
888
889   --------------------------
890   -- Set_Legend_Precision --
891   --------------------------
892
893   procedure Set_Legend_Precision
894     (Data : access Gtk_Plot_Data_Record; Precision : Gint)
895   is
896      procedure Internal (Data : System.Address; Precision : Gint);
897      pragma Import (C, Internal, "gtk_plot_data_set_legend_precision");
898   begin
899      Internal (Get_Object (Data), Precision);
900   end Set_Legend_Precision;
901
902   --------------------------
903   -- Get_Legend_Precision --
904   --------------------------
905
906   function Get_Legend_Precision (Data : access Gtk_Plot_Data_Record)
907      return Gint
908   is
909      function Internal (Data : System.Address) return Gint;
910      pragma Import (C, Internal, "gtk_plot_data_get_legend_precision");
911   begin
912      return Internal (Get_Object (Data));
913   end Get_Legend_Precision;
914
915   -----------------------
916   -- Set_Gradient_Mask --
917   -----------------------
918
919   procedure Set_Gradient_Mask
920     (Data : access Gtk_Plot_Data_Record; Mask : Plot_Gradient)
921   is
922      procedure Internal (Data : System.Address; Mask : Plot_Gradient);
923      pragma Import (C, Internal, "gtk_plot_data_set_gradient_mask");
924
925   begin
926      Internal (Get_Object (Data), Mask);
927   end Set_Gradient_Mask;
928
929   -----------------------
930   -- Get_Gradient_Mask --
931   -----------------------
932
933   function Get_Gradient_Mask (Data : access Gtk_Plot_Data_Record)
934      return Plot_Gradient
935   is
936      function Internal (Data : System.Address) return Gint;
937      pragma Import (C, Internal, "gtk_plot_data_get_gradient_mask");
938   begin
939      return Plot_Gradient'Val (Internal (Get_Object (Data)));
940   end Get_Gradient_Mask;
941
942   --------------------------
943   -- Gradient_Set_Visible --
944   --------------------------
945
946   procedure Gradient_Set_Visible
947     (Data : access Gtk_Plot_Data_Record; Visible : Boolean)
948   is
949      procedure Internal (Data : System.Address; Visible : Gint);
950      pragma Import (C, Internal, "gtk_plot_data_gradient_set_visible");
951   begin
952      Internal (Get_Object (Data), Boolean'Pos (Visible));
953   end Gradient_Set_Visible;
954
955   ----------------------
956   -- Gradient_Visible --
957   ----------------------
958
959   function Gradient_Visible (Data : access Gtk_Plot_Data_Record)
960      return Boolean
961   is
962      function Internal (Data : System.Address) return Gint;
963      pragma Import (C, Internal, "gtk_plot_data_gradient_visible");
964   begin
965      return Boolean'Val (Internal (Get_Object (Data)));
966   end Gradient_Visible;
967
968   -------------------------
969   -- Set_Gradient_Colors --
970   -------------------------
971
972   procedure Set_Gradient_Colors
973     (Data : access Gtk_Plot_Data_Record;
974      Min, Max : Gdk.Color.Gdk_Color)
975   is
976      procedure Internal (Data, Min, Max : System.Address);
977      pragma Import (C, Internal, "gtk_plot_data_set_gradient_colors");
978      Mi : aliased Gdk_Color := Min;
979      Ma : aliased Gdk_Color := Max;
980   begin
981      Internal (Get_Object (Data), Mi'Address, Ma'Address);
982   end Set_Gradient_Colors;
983
984   -------------------------
985   -- Get_Gradient_Colors --
986   -------------------------
987
988   procedure Get_Gradient_Colors
989     (Data : access Gtk_Plot_Data_Record;
990      Min, Max : out Gdk.Color.Gdk_Color)
991   is
992      procedure Internal (Data, Min, Max : System.Address);
993      pragma Import (C, Internal, "gtk_plot_data_get_gradient_colors");
994      Mi, Ma : aliased Gdk_Color;
995   begin
996      Internal (Get_Object (Data), Mi'Address, Ma'Address);
997      Min := Mi;
998      Max := Ma;
999   end Get_Gradient_Colors;
1000
1001   ------------------
1002   -- Set_Gradient --
1003   ------------------
1004
1005   procedure Set_Gradient
1006     (Data     : access Gtk_Plot_Data_Record;
1007      Min, Max : Gdouble;
1008      Nlevels  : Gint;
1009      Nsublevels : Gint)
1010   is
1011      procedure Internal
1012        (Data : System.Address; Min, Max : Gdouble; N, N2 : Gint);
1013      pragma Import (C, Internal, "gtk_plot_data_set_gradient");
1014   begin
1015      Internal (Get_Object (Data), Min, Max, Nlevels, Nsublevels);
1016   end Set_Gradient;
1017
1018   ------------------
1019   -- Get_Gradient --
1020   ------------------
1021
1022   procedure Get_Gradient
1023     (Data     : access Gtk_Plot_Data_Record;
1024      Min, Max : out Gdouble;
1025      Nlevels  : out Gint;
1026      Nsublevels : out Gint)
1027   is
1028      procedure Internal (Data : System.Address;
1029                          Min, Max : out Gdouble;
1030                          N, N2 : out Gint);
1031      pragma Import (C, Internal, "gtk_plot_data_get_gradient");
1032   begin
1033      Internal (Get_Object (Data), Min, Max, Nlevels, Nsublevels);
1034   end Get_Gradient;
1035
1036   ------------------------
1037   -- Get_Gradient_Level --
1038   ------------------------
1039
1040   procedure Get_Gradient_Level
1041     (Data  : access Gtk_Plot_Data_Record;
1042      Level : Gdouble;
1043      Color : out Gdk.Color.Gdk_Color)
1044   is
1045      procedure Internal (Data : System.Address;
1046                          Level : Gdouble;
1047                          Color : System.Address);
1048      pragma Import (C, Internal, "gtk_plot_data_get_gradient_level");
1049      C : aliased Gdk_Color;
1050   begin
1051      Internal (Get_Object (Data), Level, C'Address);
1052      Color := C;
1053   end Get_Gradient_Level;
1054
1055   --------------
1056   -- Set_Link --
1057   --------------
1058
1059   procedure Set_Link
1060     (Data : access Gtk_Plot_Data_Record;
1061      Link : System.Address)
1062   is
1063      procedure Internal (Data, Link : System.Address);
1064      pragma Import (C, Internal, "gtk_plot_data_set_link");
1065   begin
1066      Internal (Get_Object (Data), Link);
1067   end Set_Link;
1068
1069   --------------
1070   -- Get_Link --
1071   --------------
1072
1073   function Get_Link (Data : access Gtk_Plot_Data_Record)
1074      return System.Address
1075   is
1076      function Internal (Data : System.Address) return System.Address;
1077      pragma Import (C, Internal, "gtk_plot_data_get_link");
1078   begin
1079      return Internal (Get_Object (Data));
1080   end Get_Link;
1081
1082   -----------------
1083   -- Remove_Link --
1084   -----------------
1085
1086   procedure Remove_Link (Data : access Gtk_Plot_Data_Record) is
1087      procedure Internal (Data : System.Address);
1088      pragma Import (C, Internal, "gtk_plot_data_remove_link");
1089   begin
1090      Internal (Get_Object (Data));
1091   end Remove_Link;
1092
1093   ------------
1094   -- Update --
1095   ------------
1096
1097   procedure Update (Data : access Gtk_Plot_Data_Record) is
1098      procedure Internal (Data : System.Address);
1099      pragma Import (C, Internal, "gtk_plot_data_update");
1100   begin
1101      Internal (Get_Object (Data));
1102   end Update;
1103
1104   -----------------
1105   -- Set_A_Scale --
1106   -----------------
1107
1108   procedure Set_A_Scale
1109     (Data : access Gtk_Plot_Data_Record; A_Scale : Gdouble)
1110   is
1111      procedure Internal (Data : System.Address; A_Scale : Gdouble);
1112      pragma Import (C, Internal, "gtk_plot_data_set_a_scale");
1113   begin
1114      Internal (Get_Object (Data), A_Scale);
1115   end Set_A_Scale;
1116
1117   -----------------
1118   -- Get_A_Scale --
1119   -----------------
1120
1121   function Get_A_Scale
1122     (Data : access Gtk_Plot_Data_Record) return Gdouble
1123   is
1124      function Internal (Data : System.Address) return Gdouble;
1125      pragma Import (C, Internal, "gtk_plot_data_get_a_scale");
1126   begin
1127      return Internal (Get_Object (Data));
1128   end Get_A_Scale;
1129
1130   --------------------
1131   -- Reset_Gradient --
1132   --------------------
1133
1134   procedure Reset_Gradient (Data : access Gtk_Plot_Data_Record) is
1135      procedure Internal (Data : System.Address);
1136      pragma Import (C, Internal, "gtk_plot_data_reset_gradient");
1137   begin
1138      Internal (Get_Object (Data));
1139   end Reset_Gradient;
1140
1141   ---------------------------
1142   -- Reset_Gradient_Colors --
1143   ---------------------------
1144
1145   procedure Reset_Gradient_Colors (Data : access Gtk_Plot_Data_Record) is
1146      procedure Internal (Data : System.Address);
1147      pragma Import (C, Internal, "gtk_plot_data_reset_gradient_colors");
1148   begin
1149      Internal (Get_Object (Data));
1150   end Reset_Gradient_Colors;
1151
1152   ----------------------------
1153   -- Set_Gradient_Nth_Color --
1154   ----------------------------
1155
1156   procedure Set_Gradient_Nth_Color
1157     (Data  : access Gtk_Plot_Data_Record;
1158      Level : Guint;
1159      Color : Gdk.Color.Gdk_Color)
1160   is
1161      procedure Internal
1162        (Data : System.Address; Level : Guint; Color : System.Address);
1163      pragma Import (C, Internal, "gtk_plot_data_set_gradient_nth_color");
1164      C : aliased Gdk_Color := Color;
1165   begin
1166      Internal (Get_Object (Data), Level, C'Address);
1167   end Set_Gradient_Nth_Color;
1168
1169   ----------------------------
1170   -- Get_Gradient_Nth_Color --
1171   ----------------------------
1172
1173   function Get_Gradient_Nth_Color
1174     (Data  : access Gtk_Plot_Data_Record; Level : Guint)
1175      return Gdk.Color.Gdk_Color
1176   is
1177      function Internal (Data : System.Address; Level : Guint)
1178         return System.Address;
1179      pragma Import (C, Internal, "gtk_plot_data_get_gradient_nth_color");
1180
1181      C : constant Color_Access :=
1182        Convert (Internal (Get_Object (Data), Level));
1183   begin
1184      return C.all;
1185   end Get_Gradient_Nth_Color;
1186
1187   -------------------------------
1188   -- Set_Gradient_Outer_Colors --
1189   -------------------------------
1190
1191   procedure Set_Gradient_Outer_Colors
1192     (Data : access Gtk_Plot_Data_Record;
1193      Min, Max : Gdk.Color.Gdk_Color)
1194   is
1195      procedure Internal (D, Min, Max : System.Address);
1196      pragma Import (C, Internal, "gtk_plot_data_set_gradient_outer_colors");
1197      Mi : aliased Gdk_Color := Min;
1198      Ma : aliased Gdk_Color := Max;
1199   begin
1200      Internal (Get_Object (Data), Mi'Address, Ma'Address);
1201   end Set_Gradient_Outer_Colors;
1202
1203   --------------------------
1204   -- Gradient_Autoscale_A --
1205   --------------------------
1206
1207   procedure Gradient_Autoscale_A (Data : access Gtk_Plot_Data_Record) is
1208      procedure Internal (Data : System.Address);
1209      pragma Import (C, Internal, "gtk_plot_data_gradient_autoscale_a");
1210   begin
1211      Internal (Get_Object (Data));
1212   end Gradient_Autoscale_A;
1213
1214   ---------------------------
1215   -- Gradient_Autoscale_Da --
1216   ---------------------------
1217
1218   procedure Gradient_Autoscale_Da (Data : access Gtk_Plot_Data_Record) is
1219      procedure Internal (Data : System.Address);
1220      pragma Import (C, Internal, "gtk_plot_data_gradient_autoscale_da");
1221   begin
1222      Internal (Get_Object (Data));
1223   end Gradient_Autoscale_Da;
1224
1225   --------------------------
1226   -- Gradient_Autoscale_Z --
1227   --------------------------
1228
1229   procedure Gradient_Autoscale_Z (Data : access Gtk_Plot_Data_Record) is
1230      procedure Internal (Data : System.Address);
1231      pragma Import (C, Internal, "gtk_plot_data_gradient_autoscale_z");
1232   begin
1233      Internal (Get_Object (Data));
1234   end Gradient_Autoscale_Z;
1235
1236   ------------------------
1237   -- Gradient_Set_Style --
1238   ------------------------
1239
1240   procedure Gradient_Set_Style
1241     (Data      : access Gtk_Plot_Data_Record;
1242      Style     : Plot_Label_Style;
1243      Precision : Gint)
1244   is
1245      procedure Internal (D : System.Address; S : Plot_Label_Style; P : Gint);
1246      pragma Import (C, Internal, "gtk_plot_data_gradient_set_style");
1247   begin
1248      Internal (Get_Object (Data), Style, Precision);
1249   end Gradient_Set_Style;
1250
1251   ------------------------
1252   -- Gradient_Set_Scale --
1253   ------------------------
1254
1255   procedure Gradient_Set_Scale
1256     (Data      : access Gtk_Plot_Data_Record;
1257      Scale     : Plot_Scale)
1258   is
1259      procedure Internal (Data : System.Address; Scale : Plot_Scale);
1260      pragma Import (C, Internal, "gtk_plot_data_gradient_set_scale");
1261   begin
1262      Internal (Get_Object (Data), Scale);
1263   end Gradient_Set_Scale;
1264
1265   ----------------
1266   -- Add_Marker --
1267   ----------------
1268
1269   function Add_Marker
1270     (Data : access Gtk_Plot_Data_Record; Point : Guint)
1271      return Gtk_Plot_Marker
1272   is
1273      function Internal (D : System.Address; P : Guint) return Gtk_Plot_Marker;
1274      pragma Import (C, Internal, "gtk_plot_data_add_marker");
1275   begin
1276      return Internal (Get_Object (Data), Point);
1277   end Add_Marker;
1278
1279   -------------------
1280   -- Remove_Marker --
1281   -------------------
1282
1283   procedure Remove_Marker
1284     (Data : access Gtk_Plot_Data_Record; Marker : Gtk_Plot_Marker)
1285   is
1286      procedure Internal (Data : System.Address; Marker : Gtk_Plot_Marker);
1287      pragma Import (C, Internal, "gtk_plot_data_remove_marker");
1288   begin
1289      Internal (Get_Object (Data), Marker);
1290   end Remove_Marker;
1291
1292   --------------------
1293   -- Remove_Markers --
1294   --------------------
1295
1296   procedure Remove_Markers (Data : access Gtk_Plot_Data_Record) is
1297      procedure Internal (Data : System.Address);
1298      pragma Import (C, Internal, "gtk_plot_data_remove_markers");
1299   begin
1300      Internal (Get_Object (Data));
1301   end Remove_Markers;
1302
1303   ------------------
1304   -- Show_Markers --
1305   ------------------
1306
1307   procedure Show_Markers
1308     (Data : access Gtk_Plot_Data_Record; Show : Boolean)
1309   is
1310      procedure Internal (Data : System.Address; Show : Gboolean);
1311      pragma Import (C, Internal, "gtk_plot_data_show_markers");
1312   begin
1313      Internal (Get_Object (Data), Boolean'Pos (Show));
1314   end Show_Markers;
1315
1316   ---------------------
1317   -- Markers_Visible --
1318   ---------------------
1319
1320   function Markers_Visible (Data : access Gtk_Plot_Data_Record)
1321      return Boolean
1322   is
1323      function Internal (Data : System.Address) return Gboolean;
1324      pragma Import (C, Internal, "gtk_plot_data_markers_visible");
1325   begin
1326      return Internal (Get_Object (Data)) /= 0;
1327   end Markers_Visible;
1328
1329   -----------
1330   -- Clone --
1331   -----------
1332
1333   procedure Clone
1334     (Data : access Gtk_Plot_Data_Record;
1335      Copy : access Gtk_Plot_Data_Record'Class)
1336   is
1337      procedure Internal (Data, Copy : System.Address);
1338      pragma Import (C, Internal, "gtk_plot_data_clone");
1339   begin
1340      Internal (Get_Object (Data), Get_Object (Copy));
1341   end Clone;
1342
1343   --------------------------
1344   -- Dimension_Set_Points --
1345   --------------------------
1346
1347   procedure Dimension_Set_Points
1348     (Data   : access Gtk_Plot_Data_Record;
1349      Name   : String;
1350      Points : Gdouble_Array_Access)
1351   is
1352      procedure Internal
1353        (Data : System.Address; Name : String; Points : System.Address);
1354      pragma Import (C, Internal, "gtk_plot_data_dimension_set_points");
1355      P : System.Address := System.Null_Address;
1356   begin
1357      if Points /= null then
1358         P := Points (Points'First)'Address;
1359      end if;
1360
1361      Internal (Get_Object (Data), Name & ASCII.NUL, P);
1362   end Dimension_Set_Points;
1363
1364   -------------------
1365   -- Move_Gradient --
1366   -------------------
1367
1368   procedure Move_Gradient
1369     (Data : access Gtk_Plot_Data_Record; X, Y : Gdouble)
1370   is
1371      procedure Internal (Data : System.Address; X, Y : Gdouble);
1372      pragma Import (C, Internal, "gtk_plot_data_move_gradient");
1373   begin
1374      Internal (Get_Object (Data), X, Y);
1375   end Move_Gradient;
1376
1377   -----------------------
1378   -- Set_Gradient_Size --
1379   -----------------------
1380
1381   procedure Set_Gradient_Size
1382     (Data : access Gtk_Plot_Data_Record; Size : Gint)
1383   is
1384      procedure Internal (Data : System.Address; Size : Gint);
1385      pragma Import (C, Internal, "gtk_plot_data_set_gradient_size");
1386   begin
1387      Internal (Get_Object (Data), Size);
1388   end Set_Gradient_Size;
1389
1390   --------------------------------
1391   -- Gradient_Use_Custom_Colors --
1392   --------------------------------
1393
1394   procedure Gradient_Use_Custom_Colors
1395     (Data : access Gtk_Plot_Data_Record; Custom : Boolean)
1396   is
1397      procedure Internal (Data : System.Address; Custom : Gboolean);
1398      pragma Import (C, Internal, "gtk_plot_data_gradient_use_custom_colors");
1399   begin
1400      Internal (Get_Object (Data), Boolean'Pos (Custom));
1401   end Gradient_Use_Custom_Colors;
1402
1403   ----------------------------
1404   -- Gradient_Custom_Colors --
1405   ----------------------------
1406
1407   function Gradient_Custom_Colors
1408     (Data : access Gtk_Plot_Data_Record) return Boolean
1409   is
1410      function Internal (Data : System.Address) return Gboolean;
1411      pragma Import (C, Internal, "gtk_plot_data_gradient_custom_colors");
1412   begin
1413      return Boolean'Val (Internal (Get_Object (Data)));
1414   end Gradient_Custom_Colors;
1415
1416   -------------------------------
1417   -- Get_Gradient_Outer_Colors --
1418   -------------------------------
1419
1420   procedure Get_Gradient_Outer_Colors
1421     (Data     : access Gtk_Plot_Data_Record;
1422      Min, Max : out Gdk.Color.Gdk_Color)
1423   is
1424      procedure Internal
1425        (Data : System.Address;
1426         MinA, MaxA : out System.Address);
1427      pragma Import (C, Internal, "gtk_plot_data_get_gradient_outer_colors");
1428
1429      Mi, Ma : System.Address;
1430   begin
1431      Internal (Get_Object (Data), Mi, Ma);
1432      Min := Convert (Mi).all;
1433      Max := Convert (Ma).all;
1434   end Get_Gradient_Outer_Colors;
1435
1436end Gtk.Extra.Plot_Data;
1437