This file is indexed.

/usr/share/ada/adainclude/gtkada/pango-layout.adb is in libgtkada16.1.0-dev 17.0.2017-2.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

   1
   2
   3
   4
   5
   6
   7
   8
   9
  10
  11
  12
  13
  14
  15
  16
  17
  18
  19
  20
  21
  22
  23
  24
  25
  26
  27
  28
  29
  30
  31
  32
  33
  34
  35
  36
  37
  38
  39
  40
  41
  42
  43
  44
  45
  46
  47
  48
  49
  50
  51
  52
  53
  54
  55
  56
  57
  58
  59
  60
  61
  62
  63
  64
  65
  66
  67
  68
  69
  70
  71
  72
  73
  74
  75
  76
  77
  78
  79
  80
  81
  82
  83
  84
  85
  86
  87
  88
  89
  90
  91
  92
  93
  94
  95
  96
  97
  98
  99
 100
 101
 102
 103
 104
 105
 106
 107
 108
 109
 110
 111
 112
 113
 114
 115
 116
 117
 118
 119
 120
 121
 122
 123
 124
 125
 126
 127
 128
 129
 130
 131
 132
 133
 134
 135
 136
 137
 138
 139
 140
 141
 142
 143
 144
 145
 146
 147
 148
 149
 150
 151
 152
 153
 154
 155
 156
 157
 158
 159
 160
 161
 162
 163
 164
 165
 166
 167
 168
 169
 170
 171
 172
 173
 174
 175
 176
 177
 178
 179
 180
 181
 182
 183
 184
 185
 186
 187
 188
 189
 190
 191
 192
 193
 194
 195
 196
 197
 198
 199
 200
 201
 202
 203
 204
 205
 206
 207
 208
 209
 210
 211
 212
 213
 214
 215
 216
 217
 218
 219
 220
 221
 222
 223
 224
 225
 226
 227
 228
 229
 230
 231
 232
 233
 234
 235
 236
 237
 238
 239
 240
 241
 242
 243
 244
 245
 246
 247
 248
 249
 250
 251
 252
 253
 254
 255
 256
 257
 258
 259
 260
 261
 262
 263
 264
 265
 266
 267
 268
 269
 270
 271
 272
 273
 274
 275
 276
 277
 278
 279
 280
 281
 282
 283
 284
 285
 286
 287
 288
 289
 290
 291
 292
 293
 294
 295
 296
 297
 298
 299
 300
 301
 302
 303
 304
 305
 306
 307
 308
 309
 310
 311
 312
 313
 314
 315
 316
 317
 318
 319
 320
 321
 322
 323
 324
 325
 326
 327
 328
 329
 330
 331
 332
 333
 334
 335
 336
 337
 338
 339
 340
 341
 342
 343
 344
 345
 346
 347
 348
 349
 350
 351
 352
 353
 354
 355
 356
 357
 358
 359
 360
 361
 362
 363
 364
 365
 366
 367
 368
 369
 370
 371
 372
 373
 374
 375
 376
 377
 378
 379
 380
 381
 382
 383
 384
 385
 386
 387
 388
 389
 390
 391
 392
 393
 394
 395
 396
 397
 398
 399
 400
 401
 402
 403
 404
 405
 406
 407
 408
 409
 410
 411
 412
 413
 414
 415
 416
 417
 418
 419
 420
 421
 422
 423
 424
 425
 426
 427
 428
 429
 430
 431
 432
 433
 434
 435
 436
 437
 438
 439
 440
 441
 442
 443
 444
 445
 446
 447
 448
 449
 450
 451
 452
 453
 454
 455
 456
 457
 458
 459
 460
 461
 462
 463
 464
 465
 466
 467
 468
 469
 470
 471
 472
 473
 474
 475
 476
 477
 478
 479
 480
 481
 482
 483
 484
 485
 486
 487
 488
 489
 490
 491
 492
 493
 494
 495
 496
 497
 498
 499
 500
 501
 502
 503
 504
 505
 506
 507
 508
 509
 510
 511
 512
 513
 514
 515
 516
 517
 518
 519
 520
 521
 522
 523
 524
 525
 526
 527
 528
 529
 530
 531
 532
 533
 534
 535
 536
 537
 538
 539
 540
 541
 542
 543
 544
 545
 546
 547
 548
 549
 550
 551
 552
 553
 554
 555
 556
 557
 558
 559
 560
 561
 562
 563
 564
 565
 566
 567
 568
 569
 570
 571
 572
 573
 574
 575
 576
 577
 578
 579
 580
 581
 582
 583
 584
 585
 586
 587
 588
 589
 590
 591
 592
 593
 594
 595
 596
 597
 598
 599
 600
 601
 602
 603
 604
 605
 606
 607
 608
 609
 610
 611
 612
 613
 614
 615
 616
 617
 618
 619
 620
 621
 622
 623
 624
 625
 626
 627
 628
 629
 630
 631
 632
 633
 634
 635
 636
 637
 638
 639
 640
 641
 642
 643
 644
 645
 646
 647
 648
 649
 650
 651
 652
 653
 654
 655
 656
 657
 658
 659
 660
 661
 662
 663
 664
 665
 666
 667
 668
 669
 670
 671
 672
 673
 674
 675
 676
 677
 678
 679
 680
 681
 682
 683
 684
 685
 686
 687
 688
 689
 690
 691
 692
 693
 694
 695
 696
 697
 698
 699
 700
 701
 702
 703
 704
 705
 706
 707
 708
 709
 710
 711
 712
 713
 714
 715
 716
 717
 718
 719
 720
 721
 722
 723
 724
 725
 726
 727
 728
 729
 730
 731
 732
 733
 734
 735
 736
 737
 738
 739
 740
 741
 742
 743
 744
 745
 746
 747
 748
 749
 750
 751
 752
 753
 754
 755
 756
 757
 758
 759
 760
 761
 762
 763
 764
 765
 766
 767
 768
 769
 770
 771
 772
 773
 774
 775
 776
 777
 778
 779
 780
 781
 782
 783
 784
 785
 786
 787
 788
 789
 790
 791
 792
 793
 794
 795
 796
 797
 798
 799
 800
 801
 802
 803
 804
 805
 806
 807
 808
 809
 810
 811
 812
 813
 814
 815
 816
 817
 818
 819
 820
 821
 822
 823
 824
 825
 826
 827
 828
 829
 830
 831
 832
 833
 834
 835
 836
 837
 838
 839
 840
 841
 842
 843
 844
 845
 846
 847
 848
 849
 850
 851
 852
 853
 854
 855
 856
 857
 858
 859
 860
 861
 862
 863
 864
 865
 866
 867
 868
 869
 870
 871
 872
 873
 874
 875
 876
 877
 878
 879
 880
 881
 882
 883
 884
 885
 886
 887
 888
 889
 890
 891
 892
 893
 894
 895
 896
 897
 898
 899
 900
 901
 902
 903
 904
 905
 906
 907
 908
 909
 910
 911
 912
 913
 914
 915
 916
 917
 918
 919
 920
 921
 922
 923
 924
 925
 926
 927
 928
 929
 930
 931
 932
 933
 934
 935
 936
 937
 938
 939
 940
 941
 942
 943
 944
 945
 946
 947
 948
 949
 950
 951
 952
 953
 954
 955
 956
 957
 958
 959
 960
 961
 962
 963
 964
 965
 966
 967
 968
 969
 970
 971
 972
 973
 974
 975
 976
 977
 978
 979
 980
 981
 982
 983
 984
 985
 986
 987
 988
 989
 990
 991
 992
 993
 994
 995
 996
 997
 998
 999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
------------------------------------------------------------------------------
--                                                                          --
--      Copyright (C) 1998-2000 E. Briot, J. Brobecker and A. Charlet       --
--                     Copyright (C) 2000-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.                            --
--                                                                          --
--                                                                          --
--                                                                          --
--                                                                          --
--                                                                          --
-- 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/>.                                          --
--                                                                          --
------------------------------------------------------------------------------

pragma Style_Checks (Off);
pragma Warnings (Off, "*is already use-visible*");
with Glib.Type_Conversion_Hooks; use Glib.Type_Conversion_Hooks;
with Gtkada.Bindings;            use Gtkada.Bindings;
pragma Warnings(Off);  --  might be unused
with Interfaces.C.Strings;       use Interfaces.C.Strings;
pragma Warnings(On);

package body Pango.Layout is

   function Get_Text (Layout : access Pango_Layout_Record)
   return Gtkada.Types.Chars_Ptr
   is
      function Internal (Layout : System.Address)
      return Interfaces.C.Strings.chars_ptr;
      pragma Import (C, Internal, "pango_layout_get_text");
   begin
      return Internal (Get_Object (Layout));
   end Get_Text;

   function From_Object_Free
     (B : access Pango_Layout_Iter'Class) return Pango_Layout_Iter
   is
      Result : constant Pango_Layout_Iter := Pango_Layout_Iter (B.all);
   begin
      Glib.g_free (B.all'Address);
      return Result;
   end From_Object_Free;

   function From_Object (Object : System.Address) return Pango_Layout_Iter is
      S : Pango_Layout_Iter;
   begin
      S.Set_Object (Object);
      return S;
   end From_Object;

   function From_Object_Free (B : access Pango_Layout_Line) return Pango_Layout_Line is
      Result : constant Pango_Layout_Line := B.all;
   begin
      Glib.g_free (B.all'Address);
      return Result;
   end From_Object_Free;

   package Type_Conversion_Pango_Layout is new Glib.Type_Conversion_Hooks.Hook_Registrator
     (Get_Type'Access, Pango_Layout_Record);
   pragma Unreferenced (Type_Conversion_Pango_Layout);

   -------------
   -- Gdk_New --
   -------------

   procedure Gdk_New
      (Layout  : out Pango_Layout;
       Context : not null access Pango.Context.Pango_Context_Record'Class)
   is
   begin
      Layout := new Pango_Layout_Record;
      Pango.Layout.Initialize (Layout, Context);
   end Gdk_New;

   ----------------
   -- Initialize --
   ----------------

   procedure Initialize
      (Layout  : not null access Pango_Layout_Record'Class;
       Context : not null access Pango.Context.Pango_Context_Record'Class)
   is
      function Internal (Context : System.Address) return System.Address;
      pragma Import (C, Internal, "pango_layout_new");
   begin
      if not Layout.Is_Created then
         Set_Object (Layout, Internal (Get_Object (Context)));
      end if;
   end Initialize;

   ----------------------
   -- Pango_Layout_New --
   ----------------------

   function Pango_Layout_New
      (Context : not null access Pango.Context.Pango_Context_Record'Class)
       return Pango_Layout
   is
      Layout : constant Pango_Layout := new Pango_Layout_Record;
   begin
      Pango.Layout.Initialize (Layout, Context);
      return Layout;
   end Pango_Layout_New;

   ------------------
   -- At_Last_Line --
   ------------------

   function At_Last_Line (Self : Pango_Layout_Iter) return Boolean is
      function Internal (Self : System.Address) return Glib.Gboolean;
      pragma Import (C, Internal, "pango_layout_iter_at_last_line");
   begin
      return Internal (Get_Object (Self)) /= 0;
   end At_Last_Line;

   ---------------------
   -- Context_Changed --
   ---------------------

   procedure Context_Changed (Layout : not null access Pango_Layout_Record) is
      procedure Internal (Layout : System.Address);
      pragma Import (C, Internal, "pango_layout_context_changed");
   begin
      Internal (Get_Object (Layout));
   end Context_Changed;

   ----------
   -- Copy --
   ----------

   function Copy
      (Layout : not null access Pango_Layout_Record) return Pango_Layout
   is
      function Internal (Layout : System.Address) return System.Address;
      pragma Import (C, Internal, "pango_layout_copy");
      Stub_Pango_Layout : Pango_Layout_Record;
   begin
      return Pango.Layout.Pango_Layout (Get_User_Data (Internal (Get_Object (Layout)), Stub_Pango_Layout));
   end Copy;

   ----------
   -- Copy --
   ----------

   function Copy (Self : Pango_Layout_Iter) return Pango_Layout_Iter is
      function Internal (Self : System.Address) return System.Address;
      pragma Import (C, Internal, "pango_layout_iter_copy");
   begin
      return From_Object (Internal (Get_Object (Self)));
   end Copy;

   ----------
   -- Free --
   ----------

   procedure Free (Self : Pango_Layout_Iter) is
      procedure Internal (Self : System.Address);
      pragma Import (C, Internal, "pango_layout_iter_free");
   begin
      Internal (Get_Object (Self));
   end Free;

   -------------------
   -- Get_Alignment --
   -------------------

   function Get_Alignment
      (Layout : not null access Pango_Layout_Record)
       return Pango.Enums.Alignment
   is
      function Internal
         (Layout : System.Address) return Pango.Enums.Alignment;
      pragma Import (C, Internal, "pango_layout_get_alignment");
   begin
      return Internal (Get_Object (Layout));
   end Get_Alignment;

   --------------------
   -- Get_Attributes --
   --------------------

   function Get_Attributes
      (Layout : not null access Pango_Layout_Record)
       return Pango.Attributes.Pango_Attr_List
   is
      function Internal (Layout : System.Address) return System.Address;
      pragma Import (C, Internal, "pango_layout_get_attributes");
   begin
      return From_Object (Internal (Get_Object (Layout)));
   end Get_Attributes;

   ------------------
   -- Get_Auto_Dir --
   ------------------

   function Get_Auto_Dir
      (Layout : not null access Pango_Layout_Record) return Boolean
   is
      function Internal (Layout : System.Address) return Glib.Gboolean;
      pragma Import (C, Internal, "pango_layout_get_auto_dir");
   begin
      return Internal (Get_Object (Layout)) /= 0;
   end Get_Auto_Dir;

   ------------------
   -- Get_Baseline --
   ------------------

   function Get_Baseline
      (Layout : not null access Pango_Layout_Record) return Gint
   is
      function Internal (Layout : System.Address) return Gint;
      pragma Import (C, Internal, "pango_layout_get_baseline");
   begin
      return Internal (Get_Object (Layout));
   end Get_Baseline;

   ------------------
   -- Get_Baseline --
   ------------------

   function Get_Baseline (Self : Pango_Layout_Iter) return Gint is
      function Internal (Self : System.Address) return Gint;
      pragma Import (C, Internal, "pango_layout_iter_get_baseline");
   begin
      return Internal (Get_Object (Self));
   end Get_Baseline;

   ----------------------
   -- Get_Char_Extents --
   ----------------------

   procedure Get_Char_Extents
      (Self         : Pango_Layout_Iter;
       Logical_Rect : out Pango_Rectangle)
   is
      procedure Internal
         (Self         : System.Address;
          Logical_Rect : out Pango_Rectangle);
      pragma Import (C, Internal, "pango_layout_iter_get_char_extents");
   begin
      Internal (Get_Object (Self), Logical_Rect);
   end Get_Char_Extents;

   -------------------------
   -- Get_Character_Count --
   -------------------------

   function Get_Character_Count
      (Layout : not null access Pango_Layout_Record) return Gint
   is
      function Internal (Layout : System.Address) return Gint;
      pragma Import (C, Internal, "pango_layout_get_character_count");
   begin
      return Internal (Get_Object (Layout));
   end Get_Character_Count;

   -------------------------
   -- Get_Cluster_Extents --
   -------------------------

   procedure Get_Cluster_Extents
      (Self         : Pango_Layout_Iter;
       Ink_Rect     : out Pango_Rectangle;
       Logical_Rect : out Pango_Rectangle)
   is
      procedure Internal
         (Self         : System.Address;
          Ink_Rect     : out Pango_Rectangle;
          Logical_Rect : out Pango_Rectangle);
      pragma Import (C, Internal, "pango_layout_iter_get_cluster_extents");
   begin
      Internal (Get_Object (Self), Ink_Rect, Logical_Rect);
   end Get_Cluster_Extents;

   -----------------
   -- Get_Context --
   -----------------

   function Get_Context
      (Layout : not null access Pango_Layout_Record)
       return Pango.Context.Pango_Context
   is
      function Internal (Layout : System.Address) return System.Address;
      pragma Import (C, Internal, "pango_layout_get_context");
      Stub_Pango_Context : Pango.Context.Pango_Context_Record;
   begin
      return Pango.Context.Pango_Context (Get_User_Data (Internal (Get_Object (Layout)), Stub_Pango_Context));
   end Get_Context;

   --------------------
   -- Get_Cursor_Pos --
   --------------------

   procedure Get_Cursor_Pos
      (Layout     : not null access Pango_Layout_Record;
       Index      : Gint;
       Strong_Pos : out Pango_Rectangle;
       Weak_Pos   : out Pango_Rectangle)
   is
      procedure Internal
         (Layout     : System.Address;
          Index      : Gint;
          Strong_Pos : out Pango_Rectangle;
          Weak_Pos   : out Pango_Rectangle);
      pragma Import (C, Internal, "pango_layout_get_cursor_pos");
   begin
      Internal (Get_Object (Layout), Index, Strong_Pos, Weak_Pos);
   end Get_Cursor_Pos;

   -------------------
   -- Get_Ellipsize --
   -------------------

   function Get_Ellipsize
      (Layout : not null access Pango_Layout_Record)
       return Pango_Ellipsize_Mode
   is
      function Internal
         (Layout : System.Address) return Pango_Ellipsize_Mode;
      pragma Import (C, Internal, "pango_layout_get_ellipsize");
   begin
      return Internal (Get_Object (Layout));
   end Get_Ellipsize;

   -----------------
   -- Get_Extents --
   -----------------

   procedure Get_Extents
      (Layout       : not null access Pango_Layout_Record;
       Ink_Rect     : out Pango_Rectangle;
       Logical_Rect : out Pango_Rectangle)
   is
      procedure Internal
         (Layout       : System.Address;
          Ink_Rect     : out Pango_Rectangle;
          Logical_Rect : out Pango_Rectangle);
      pragma Import (C, Internal, "pango_layout_get_extents");
   begin
      Internal (Get_Object (Layout), Ink_Rect, Logical_Rect);
   end Get_Extents;

   --------------------------
   -- Get_Font_Description --
   --------------------------

   function Get_Font_Description
      (Layout : not null access Pango_Layout_Record)
       return Pango.Font.Pango_Font_Description
   is
      function Internal
         (Layout : System.Address) return Pango.Font.Pango_Font_Description;
      pragma Import (C, Internal, "pango_layout_get_font_description");
   begin
      return Internal (Get_Object (Layout));
   end Get_Font_Description;

   ----------------
   -- Get_Height --
   ----------------

   function Get_Height
      (Layout : not null access Pango_Layout_Record) return Gint
   is
      function Internal (Layout : System.Address) return Gint;
      pragma Import (C, Internal, "pango_layout_get_height");
   begin
      return Internal (Get_Object (Layout));
   end Get_Height;

   ----------------
   -- Get_Indent --
   ----------------

   function Get_Indent
      (Layout : not null access Pango_Layout_Record) return Gint
   is
      function Internal (Layout : System.Address) return Gint;
      pragma Import (C, Internal, "pango_layout_get_indent");
   begin
      return Internal (Get_Object (Layout));
   end Get_Indent;

   ---------------
   -- Get_Index --
   ---------------

   function Get_Index (Self : Pango_Layout_Iter) return Gint is
      function Internal (Self : System.Address) return Gint;
      pragma Import (C, Internal, "pango_layout_iter_get_index");
   begin
      return Internal (Get_Object (Self));
   end Get_Index;

   --------------
   -- Get_Iter --
   --------------

   function Get_Iter
      (Layout : not null access Pango_Layout_Record'Class)
       return Pango_Layout_Iter
   is
      function Internal (Layout : System.Address) return System.Address;
      pragma Import (C, Internal, "pango_layout_get_iter");
   begin
      return From_Object (Internal (Get_Object (Layout)));
   end Get_Iter;

   -----------------
   -- Get_Justify --
   -----------------

   function Get_Justify
      (Layout : not null access Pango_Layout_Record) return Boolean
   is
      function Internal (Layout : System.Address) return Glib.Gboolean;
      pragma Import (C, Internal, "pango_layout_get_justify");
   begin
      return Internal (Get_Object (Layout)) /= 0;
   end Get_Justify;

   ----------------
   -- Get_Layout --
   ----------------

   function Get_Layout (Self : Pango_Layout_Iter) return Pango_Layout is
      function Internal (Self : System.Address) return System.Address;
      pragma Import (C, Internal, "pango_layout_iter_get_layout");
      Stub_Pango_Layout : Pango_Layout_Record;
   begin
      return Pango.Layout.Pango_Layout (Get_User_Data (Internal (Get_Object (Self)), Stub_Pango_Layout));
   end Get_Layout;

   ------------------------
   -- Get_Layout_Extents --
   ------------------------

   procedure Get_Layout_Extents
      (Self         : Pango_Layout_Iter;
       Ink_Rect     : out Pango_Rectangle;
       Logical_Rect : out Pango_Rectangle)
   is
      procedure Internal
         (Self         : System.Address;
          Ink_Rect     : out Pango_Rectangle;
          Logical_Rect : out Pango_Rectangle);
      pragma Import (C, Internal, "pango_layout_iter_get_layout_extents");
   begin
      Internal (Get_Object (Self), Ink_Rect, Logical_Rect);
   end Get_Layout_Extents;

   --------------
   -- Get_Line --
   --------------

   function Get_Line
      (Layout : not null access Pango_Layout_Record;
       Line   : Gint) return Pango_Layout_Line
   is
      function Internal
         (Layout : System.Address;
          Line   : Gint) return access Pango_Layout_Line;
      pragma Import (C, Internal, "pango_layout_get_line");
   begin
      return Internal (Get_Object (Layout), Line).all;
   end Get_Line;

   --------------
   -- Get_Line --
   --------------

   function Get_Line (Self : Pango_Layout_Iter) return Pango_Layout_Line is
      function Internal
         (Self : System.Address) return access Pango_Layout_Line;
      pragma Import (C, Internal, "pango_layout_iter_get_line");
   begin
      return From_Object_Free (Internal (Get_Object (Self)));
   end Get_Line;

   --------------------
   -- Get_Line_Count --
   --------------------

   function Get_Line_Count
      (Layout : not null access Pango_Layout_Record) return Gint
   is
      function Internal (Layout : System.Address) return Gint;
      pragma Import (C, Internal, "pango_layout_get_line_count");
   begin
      return Internal (Get_Object (Layout));
   end Get_Line_Count;

   ----------------------
   -- Get_Line_Extents --
   ----------------------

   procedure Get_Line_Extents
      (Self         : Pango_Layout_Iter;
       Ink_Rect     : out Pango_Rectangle;
       Logical_Rect : out Pango_Rectangle)
   is
      procedure Internal
         (Self         : System.Address;
          Ink_Rect     : out Pango_Rectangle;
          Logical_Rect : out Pango_Rectangle);
      pragma Import (C, Internal, "pango_layout_iter_get_line_extents");
   begin
      Internal (Get_Object (Self), Ink_Rect, Logical_Rect);
   end Get_Line_Extents;

   -----------------------
   -- Get_Line_Readonly --
   -----------------------

   function Get_Line_Readonly
      (Layout : not null access Pango_Layout_Record;
       Line   : Gint) return Pango_Layout_Line
   is
      function Internal
         (Layout : System.Address;
          Line   : Gint) return access Pango_Layout_Line;
      pragma Import (C, Internal, "pango_layout_get_line_readonly");
   begin
      return Internal (Get_Object (Layout), Line).all;
   end Get_Line_Readonly;

   -----------------------
   -- Get_Line_Readonly --
   -----------------------

   function Get_Line_Readonly
      (Self : Pango_Layout_Iter) return Pango_Layout_Line
   is
      function Internal
         (Self : System.Address) return access Pango_Layout_Line;
      pragma Import (C, Internal, "pango_layout_iter_get_line_readonly");
   begin
      return Internal (Get_Object (Self)).all;
   end Get_Line_Readonly;

   ---------------------
   -- Get_Line_Yrange --
   ---------------------

   procedure Get_Line_Yrange
      (Self : Pango_Layout_Iter;
       Y0   : out Gint;
       Y1   : out Gint)
   is
      procedure Internal
         (Self : System.Address;
          Y0   : out Gint;
          Y1   : out Gint);
      pragma Import (C, Internal, "pango_layout_iter_get_line_yrange");
   begin
      Internal (Get_Object (Self), Y0, Y1);
   end Get_Line_Yrange;

   -----------------------
   -- Get_Pixel_Extents --
   -----------------------

   procedure Get_Pixel_Extents
      (Layout       : not null access Pango_Layout_Record;
       Ink_Rect     : out Pango_Rectangle;
       Logical_Rect : out Pango_Rectangle)
   is
      procedure Internal
         (Layout       : System.Address;
          Ink_Rect     : out Pango_Rectangle;
          Logical_Rect : out Pango_Rectangle);
      pragma Import (C, Internal, "pango_layout_get_pixel_extents");
   begin
      Internal (Get_Object (Layout), Ink_Rect, Logical_Rect);
   end Get_Pixel_Extents;

   --------------------
   -- Get_Pixel_Size --
   --------------------

   procedure Get_Pixel_Size
      (Layout : not null access Pango_Layout_Record;
       Width  : out Gint;
       Height : out Gint)
   is
      procedure Internal
         (Layout : System.Address;
          Width  : out Gint;
          Height : out Gint);
      pragma Import (C, Internal, "pango_layout_get_pixel_size");
   begin
      Internal (Get_Object (Layout), Width, Height);
   end Get_Pixel_Size;

   ---------------------
   -- Get_Run_Extents --
   ---------------------

   procedure Get_Run_Extents
      (Self         : Pango_Layout_Iter;
       Ink_Rect     : out Pango_Rectangle;
       Logical_Rect : out Pango_Rectangle)
   is
      procedure Internal
         (Self         : System.Address;
          Ink_Rect     : out Pango_Rectangle;
          Logical_Rect : out Pango_Rectangle);
      pragma Import (C, Internal, "pango_layout_iter_get_run_extents");
   begin
      Internal (Get_Object (Self), Ink_Rect, Logical_Rect);
   end Get_Run_Extents;

   ----------------
   -- Get_Serial --
   ----------------

   function Get_Serial
      (Layout : not null access Pango_Layout_Record) return Guint
   is
      function Internal (Layout : System.Address) return Guint;
      pragma Import (C, Internal, "pango_layout_get_serial");
   begin
      return Internal (Get_Object (Layout));
   end Get_Serial;

   -------------------------------
   -- Get_Single_Paragraph_Mode --
   -------------------------------

   function Get_Single_Paragraph_Mode
      (Layout : not null access Pango_Layout_Record) return Boolean
   is
      function Internal (Layout : System.Address) return Glib.Gboolean;
      pragma Import (C, Internal, "pango_layout_get_single_paragraph_mode");
   begin
      return Internal (Get_Object (Layout)) /= 0;
   end Get_Single_Paragraph_Mode;

   --------------
   -- Get_Size --
   --------------

   procedure Get_Size
      (Layout : not null access Pango_Layout_Record;
       Width  : out Gint;
       Height : out Gint)
   is
      procedure Internal
         (Layout : System.Address;
          Width  : out Gint;
          Height : out Gint);
      pragma Import (C, Internal, "pango_layout_get_size");
   begin
      Internal (Get_Object (Layout), Width, Height);
   end Get_Size;

   -----------------
   -- Get_Spacing --
   -----------------

   function Get_Spacing
      (Layout : not null access Pango_Layout_Record) return Gint
   is
      function Internal (Layout : System.Address) return Gint;
      pragma Import (C, Internal, "pango_layout_get_spacing");
   begin
      return Internal (Get_Object (Layout));
   end Get_Spacing;

   --------------
   -- Get_Tabs --
   --------------

   function Get_Tabs
      (Layout : not null access Pango_Layout_Record)
       return Pango.Tabs.Pango_Tab_Array
   is
      function Internal (Layout : System.Address) return System.Address;
      pragma Import (C, Internal, "pango_layout_get_tabs");
   begin
      return From_Object (Internal (Get_Object (Layout)));
   end Get_Tabs;

   --------------
   -- Get_Text --
   --------------

   function Get_Text
      (Layout : not null access Pango_Layout_Record) return UTF8_String
   is
      function Internal
         (Layout : System.Address) return Interfaces.C.Strings.chars_ptr;
      pragma Import (C, Internal, "pango_layout_get_text");
   begin
      return Gtkada.Bindings.Value_Allowing_Null (Internal (Get_Object (Layout)));
   end Get_Text;

   ------------------------------
   -- Get_Unknown_Glyphs_Count --
   ------------------------------

   function Get_Unknown_Glyphs_Count
      (Layout : not null access Pango_Layout_Record) return Gint
   is
      function Internal (Layout : System.Address) return Gint;
      pragma Import (C, Internal, "pango_layout_get_unknown_glyphs_count");
   begin
      return Internal (Get_Object (Layout));
   end Get_Unknown_Glyphs_Count;

   ---------------
   -- Get_Width --
   ---------------

   function Get_Width
      (Layout : not null access Pango_Layout_Record) return Gint
   is
      function Internal (Layout : System.Address) return Gint;
      pragma Import (C, Internal, "pango_layout_get_width");
   begin
      return Internal (Get_Object (Layout));
   end Get_Width;

   --------------
   -- Get_Wrap --
   --------------

   function Get_Wrap
      (Layout : not null access Pango_Layout_Record)
       return Pango.Enums.Wrap_Mode
   is
      function Internal
         (Layout : System.Address) return Pango.Enums.Wrap_Mode;
      pragma Import (C, Internal, "pango_layout_get_wrap");
   begin
      return Internal (Get_Object (Layout));
   end Get_Wrap;

   ---------------------
   -- Index_To_Line_X --
   ---------------------

   procedure Index_To_Line_X
      (Layout   : not null access Pango_Layout_Record;
       Index    : Gint;
       Trailing : Boolean;
       Line     : out Gint;
       X_Pos    : out Gint)
   is
      procedure Internal
         (Layout   : System.Address;
          Index    : Gint;
          Trailing : Glib.Gboolean;
          Line     : out Gint;
          X_Pos    : out Gint);
      pragma Import (C, Internal, "pango_layout_index_to_line_x");
   begin
      Internal (Get_Object (Layout), Index, Boolean'Pos (Trailing), Line, X_Pos);
   end Index_To_Line_X;

   ------------------
   -- Index_To_Pos --
   ------------------

   procedure Index_To_Pos
      (Layout : not null access Pango_Layout_Record;
       Index  : Gint;
       Pos    : out Pango_Rectangle)
   is
      procedure Internal
         (Layout : System.Address;
          Index  : Gint;
          Pos    : out Pango_Rectangle);
      pragma Import (C, Internal, "pango_layout_index_to_pos");
   begin
      Internal (Get_Object (Layout), Index, Pos);
   end Index_To_Pos;

   -------------------
   -- Is_Ellipsized --
   -------------------

   function Is_Ellipsized
      (Layout : not null access Pango_Layout_Record) return Boolean
   is
      function Internal (Layout : System.Address) return Glib.Gboolean;
      pragma Import (C, Internal, "pango_layout_is_ellipsized");
   begin
      return Internal (Get_Object (Layout)) /= 0;
   end Is_Ellipsized;

   ----------------
   -- Is_Wrapped --
   ----------------

   function Is_Wrapped
      (Layout : not null access Pango_Layout_Record) return Boolean
   is
      function Internal (Layout : System.Address) return Glib.Gboolean;
      pragma Import (C, Internal, "pango_layout_is_wrapped");
   begin
      return Internal (Get_Object (Layout)) /= 0;
   end Is_Wrapped;

   --------------------------
   -- Move_Cursor_Visually --
   --------------------------

   procedure Move_Cursor_Visually
      (Layout       : not null access Pango_Layout_Record;
       Strong       : Boolean;
       Old_Index    : Gint;
       Old_Trailing : Gint;
       Direction    : Gint;
       New_Index    : out Gint;
       New_Trailing : out Gint)
   is
      procedure Internal
         (Layout       : System.Address;
          Strong       : Glib.Gboolean;
          Old_Index    : Gint;
          Old_Trailing : Gint;
          Direction    : Gint;
          New_Index    : out Gint;
          New_Trailing : out Gint);
      pragma Import (C, Internal, "pango_layout_move_cursor_visually");
   begin
      Internal (Get_Object (Layout), Boolean'Pos (Strong), Old_Index, Old_Trailing, Direction, New_Index, New_Trailing);
   end Move_Cursor_Visually;

   ---------------
   -- Next_Char --
   ---------------

   function Next_Char (Self : Pango_Layout_Iter) return Boolean is
      function Internal (Self : System.Address) return Glib.Gboolean;
      pragma Import (C, Internal, "pango_layout_iter_next_char");
   begin
      return Internal (Get_Object (Self)) /= 0;
   end Next_Char;

   ------------------
   -- Next_Cluster --
   ------------------

   function Next_Cluster (Self : Pango_Layout_Iter) return Boolean is
      function Internal (Self : System.Address) return Glib.Gboolean;
      pragma Import (C, Internal, "pango_layout_iter_next_cluster");
   begin
      return Internal (Get_Object (Self)) /= 0;
   end Next_Cluster;

   ---------------
   -- Next_Line --
   ---------------

   function Next_Line (Self : Pango_Layout_Iter) return Boolean is
      function Internal (Self : System.Address) return Glib.Gboolean;
      pragma Import (C, Internal, "pango_layout_iter_next_line");
   begin
      return Internal (Get_Object (Self)) /= 0;
   end Next_Line;

   --------------
   -- Next_Run --
   --------------

   function Next_Run (Self : Pango_Layout_Iter) return Boolean is
      function Internal (Self : System.Address) return Glib.Gboolean;
      pragma Import (C, Internal, "pango_layout_iter_next_run");
   begin
      return Internal (Get_Object (Self)) /= 0;
   end Next_Run;

   -------------------
   -- Set_Alignment --
   -------------------

   procedure Set_Alignment
      (Layout    : not null access Pango_Layout_Record;
       Alignment : Pango.Enums.Alignment)
   is
      procedure Internal
         (Layout    : System.Address;
          Alignment : Pango.Enums.Alignment);
      pragma Import (C, Internal, "pango_layout_set_alignment");
   begin
      Internal (Get_Object (Layout), Alignment);
   end Set_Alignment;

   --------------------
   -- Set_Attributes --
   --------------------

   procedure Set_Attributes
      (Layout : not null access Pango_Layout_Record;
       Attrs  : Pango.Attributes.Pango_Attr_List)
   is
      procedure Internal (Layout : System.Address; Attrs : System.Address);
      pragma Import (C, Internal, "pango_layout_set_attributes");
   begin
      Internal (Get_Object (Layout), Get_Object (Attrs));
   end Set_Attributes;

   ------------------
   -- Set_Auto_Dir --
   ------------------

   procedure Set_Auto_Dir
      (Layout   : not null access Pango_Layout_Record;
       Auto_Dir : Boolean)
   is
      procedure Internal (Layout : System.Address; Auto_Dir : Glib.Gboolean);
      pragma Import (C, Internal, "pango_layout_set_auto_dir");
   begin
      Internal (Get_Object (Layout), Boolean'Pos (Auto_Dir));
   end Set_Auto_Dir;

   -------------------
   -- Set_Ellipsize --
   -------------------

   procedure Set_Ellipsize
      (Layout    : not null access Pango_Layout_Record;
       Ellipsize : Pango_Ellipsize_Mode)
   is
      procedure Internal
         (Layout    : System.Address;
          Ellipsize : Pango_Ellipsize_Mode);
      pragma Import (C, Internal, "pango_layout_set_ellipsize");
   begin
      Internal (Get_Object (Layout), Ellipsize);
   end Set_Ellipsize;

   --------------------------
   -- Set_Font_Description --
   --------------------------

   procedure Set_Font_Description
      (Layout : not null access Pango_Layout_Record;
       Desc   : Pango.Font.Pango_Font_Description)
   is
      procedure Internal
         (Layout : System.Address;
          Desc   : Pango.Font.Pango_Font_Description);
      pragma Import (C, Internal, "pango_layout_set_font_description");
   begin
      Internal (Get_Object (Layout), Desc);
   end Set_Font_Description;

   ----------------
   -- Set_Height --
   ----------------

   procedure Set_Height
      (Layout : not null access Pango_Layout_Record;
       Height : Gint)
   is
      procedure Internal (Layout : System.Address; Height : Gint);
      pragma Import (C, Internal, "pango_layout_set_height");
   begin
      Internal (Get_Object (Layout), Height);
   end Set_Height;

   ----------------
   -- Set_Indent --
   ----------------

   procedure Set_Indent
      (Layout : not null access Pango_Layout_Record;
       Indent : Gint)
   is
      procedure Internal (Layout : System.Address; Indent : Gint);
      pragma Import (C, Internal, "pango_layout_set_indent");
   begin
      Internal (Get_Object (Layout), Indent);
   end Set_Indent;

   -----------------
   -- Set_Justify --
   -----------------

   procedure Set_Justify
      (Layout  : not null access Pango_Layout_Record;
       Justify : Boolean)
   is
      procedure Internal (Layout : System.Address; Justify : Glib.Gboolean);
      pragma Import (C, Internal, "pango_layout_set_justify");
   begin
      Internal (Get_Object (Layout), Boolean'Pos (Justify));
   end Set_Justify;

   ----------------
   -- Set_Markup --
   ----------------

   procedure Set_Markup
      (Layout : not null access Pango_Layout_Record;
       Markup : UTF8_String)
   is
      procedure Internal
         (Layout : System.Address;
          Markup : Interfaces.C.Strings.chars_ptr;
          Length : Gint);
      pragma Import (C, Internal, "pango_layout_set_markup");
      Tmp_Markup : Interfaces.C.Strings.chars_ptr := New_String (Markup);
   begin
      Internal (Get_Object (Layout), Tmp_Markup, -1);
      Free (Tmp_Markup);
   end Set_Markup;

   ---------------------------
   -- Set_Markup_With_Accel --
   ---------------------------

   procedure Set_Markup_With_Accel
      (Layout       : not null access Pango_Layout_Record;
       Markup       : UTF8_String;
       Length       : Gint;
       Accel_Marker : Gunichar;
       Accel_Char   : out Gunichar)
   is
      procedure Internal
         (Layout       : System.Address;
          Markup       : Interfaces.C.Strings.chars_ptr;
          Length       : Gint;
          Accel_Marker : Gunichar;
          Accel_Char   : out Gunichar);
      pragma Import (C, Internal, "pango_layout_set_markup_with_accel");
      Tmp_Markup : Interfaces.C.Strings.chars_ptr := New_String (Markup);
   begin
      Internal (Get_Object (Layout), Tmp_Markup, Length, Accel_Marker, Accel_Char);
      Free (Tmp_Markup);
   end Set_Markup_With_Accel;

   -------------------------------
   -- Set_Single_Paragraph_Mode --
   -------------------------------

   procedure Set_Single_Paragraph_Mode
      (Layout  : not null access Pango_Layout_Record;
       Setting : Boolean)
   is
      procedure Internal (Layout : System.Address; Setting : Glib.Gboolean);
      pragma Import (C, Internal, "pango_layout_set_single_paragraph_mode");
   begin
      Internal (Get_Object (Layout), Boolean'Pos (Setting));
   end Set_Single_Paragraph_Mode;

   -----------------
   -- Set_Spacing --
   -----------------

   procedure Set_Spacing
      (Layout  : not null access Pango_Layout_Record;
       Spacing : Gint)
   is
      procedure Internal (Layout : System.Address; Spacing : Gint);
      pragma Import (C, Internal, "pango_layout_set_spacing");
   begin
      Internal (Get_Object (Layout), Spacing);
   end Set_Spacing;

   --------------
   -- Set_Tabs --
   --------------

   procedure Set_Tabs
      (Layout : not null access Pango_Layout_Record;
       Tabs   : Pango.Tabs.Pango_Tab_Array)
   is
      procedure Internal (Layout : System.Address; Tabs : System.Address);
      pragma Import (C, Internal, "pango_layout_set_tabs");
   begin
      Internal (Get_Object (Layout), Get_Object (Tabs));
   end Set_Tabs;

   --------------
   -- Set_Text --
   --------------

   procedure Set_Text
      (Layout : not null access Pango_Layout_Record;
       Text   : UTF8_String)
   is
      procedure Internal
         (Layout : System.Address;
          Text   : Interfaces.C.Strings.chars_ptr;
          Length : Gint);
      pragma Import (C, Internal, "pango_layout_set_text");
      Tmp_Text : Interfaces.C.Strings.chars_ptr := New_String (Text);
   begin
      Internal (Get_Object (Layout), Tmp_Text, -1);
      Free (Tmp_Text);
   end Set_Text;

   ---------------
   -- Set_Width --
   ---------------

   procedure Set_Width
      (Layout : not null access Pango_Layout_Record;
       Width  : Gint)
   is
      procedure Internal (Layout : System.Address; Width : Gint);
      pragma Import (C, Internal, "pango_layout_set_width");
   begin
      Internal (Get_Object (Layout), Width);
   end Set_Width;

   --------------
   -- Set_Wrap --
   --------------

   procedure Set_Wrap
      (Layout : not null access Pango_Layout_Record;
       Wrap   : Pango.Enums.Wrap_Mode)
   is
      procedure Internal
         (Layout : System.Address;
          Wrap   : Pango.Enums.Wrap_Mode);
      pragma Import (C, Internal, "pango_layout_set_wrap");
   begin
      Internal (Get_Object (Layout), Wrap);
   end Set_Wrap;

   -----------------
   -- Xy_To_Index --
   -----------------

   procedure Xy_To_Index
      (Layout   : not null access Pango_Layout_Record;
       X        : Gint;
       Y        : Gint;
       Index    : out Gint;
       Trailing : out Gint;
       Exact    : out Boolean)
   is
      function Internal
         (Layout       : System.Address;
          X            : Gint;
          Y            : Gint;
          Acc_Index    : access Gint;
          Acc_Trailing : access Gint) return Glib.Gboolean;
      pragma Import (C, Internal, "pango_layout_xy_to_index");
      Acc_Index    : aliased Gint;
      Acc_Trailing : aliased Gint;
      Tmp_Return   : Glib.Gboolean;
   begin
      Tmp_Return := Internal (Get_Object (Layout), X, Y, Acc_Index'Access, Acc_Trailing'Access);
      Index := Acc_Index;
      Trailing := Acc_Trailing;
      Exact := Tmp_Return /= 0;
   end Xy_To_Index;

end Pango.Layout;