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 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 1464 1465 1466 1467 1468 1469 1470 1471 1472 1473 1474 1475 1476 1477 1478 1479 1480 1481 1482 1483 1484 1485 1486 1487 1488 1489 1490 1491 1492 1493 1494 1495 1496 1497 1498 1499 1500 1501 1502 1503 1504 1505 1506 1507 1508 1509 1510 1511 1512 1513 1514 1515 1516 1517 1518 1519 1520 1521 1522 1523 1524 1525 1526 1527 1528 1529 1530 1531 1532 1533 1534 1535 1536 1537 1538 1539 1540 1541 1542 1543 1544 1545 1546 1547 1548 1549 1550 1551 1552 1553 1554 1555 1556 1557 1558 1559 1560 1561 1562 1563 1564 1565 1566 1567 1568 1569 1570 1571 1572 1573 1574 1575 1576 1577
|
<?xml version="1.0" standalone="no"?>
<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN" "http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd">
<refentry id="class-gtksourceprintjob">
<refnamediv>
<refname>gtksourceview.SourcePrintJob</refname>
<refpurpose>Print Job object for <link linkend="class-gtksourceview">gtksourceview.SourceView</link></refpurpose>
</refnamediv>
<!-- *********************************** -->
<!-- BEGIN OF GTKSOURCEPRINTJOB SYNOPSIS -->
<!-- *********************************** -->
<refsect1>
<title>Synopsis</title>
<classsynopsis language="python">
<ooclass><classname>gtksourceview.SourcePrintJob</classname></ooclass>
<ooclass><classname><link linkend="class-gobject">gobject.GObject</link></classname></ooclass>
<constructorsynopsis language="python">
<methodname><link linkend="constructor-gtksourceprintjob">gtksourceview.SourcePrintJob</link></methodname>
<methodparam><parameter role="keyword">buffer</parameter><initializer>None</initializer></methodparam>
</constructorsynopsis>
<methodsynopsis language="python">
<methodname><link linkend="method-gtksourceprintjob--set-config">set_config</link></methodname>
<methodparam><parameter role="keyword">config</parameter></methodparam>
</methodsynopsis>
<methodsynopsis language="python">
<methodname><link linkend="method-gtksourceprintjob--get-config">get_config</link></methodname>
<methodparam></methodparam>
</methodsynopsis>
<methodsynopsis language="python">
<methodname><link linkend="method-gtksourceprintjob--set-buffer">set_buffer</link></methodname>
<methodparam><parameter role="keyword">buffer</parameter></methodparam>
</methodsynopsis>
<methodsynopsis language="python">
<methodname><link linkend="method-gtksourceprintjob--get-buffer">get_buffer</link></methodname>
<methodparam></methodparam>
</methodsynopsis>
<methodsynopsis language="python">
<methodname><link linkend="method-gtksourceprintjob--setup-from-view">setup_from_view</link></methodname>
<methodparam><parameter role="keyword">view</parameter></methodparam>
</methodsynopsis>
<methodsynopsis language="python">
<methodname><link linkend="method-gtksourceprintjob--set-tabs-width">set_tabs_width</link></methodname>
<methodparam><parameter role="keyword">tabs_width</parameter></methodparam>
</methodsynopsis>
<methodsynopsis language="python">
<methodname><link linkend="method-gtksourceprintjob--get-tabs-width">get_tabs_width</link></methodname>
<methodparam></methodparam>
</methodsynopsis>
<methodsynopsis language="python">
<methodname><link linkend="method-gtksourceprintjob--set-wrap-mode">set_wrap_mode</link></methodname>
<methodparam><parameter role="keyword">wrap</parameter></methodparam>
</methodsynopsis>
<methodsynopsis language="python">
<methodname><link linkend="method-gtksourceprintjob--get-wrap-mode">get_wrap_mode</link></methodname>
<methodparam></methodparam>
</methodsynopsis>
<methodsynopsis language="python">
<methodname><link linkend="method-gtksourceprintjob--set-highlight">set_highlight</link></methodname>
<methodparam><parameter role="keyword">highlight</parameter></methodparam>
</methodsynopsis>
<methodsynopsis language="python">
<methodname><link linkend="method-gtksourceprintjob--get-highlight">get_highlight</link></methodname>
<methodparam></methodparam>
</methodsynopsis>
<methodsynopsis language="python">
<methodname><link linkend="method-gtksourceprintjob--set-font-desc">set_font_desc</link></methodname>
<methodparam><parameter role="keyword">font_desc</parameter></methodparam>
</methodsynopsis>
<methodsynopsis language="python">
<methodname><link linkend="method-gtksourceprintjob--get-font-desc">get_font_desc</link></methodname>
<methodparam></methodparam>
</methodsynopsis>
<methodsynopsis language="python">
<methodname><link linkend="method-gtksourceprintjob--set-font">set_font</link></methodname>
<methodparam><parameter role="keyword">highlight</parameter></methodparam>
</methodsynopsis>
<methodsynopsis language="python">
<methodname><link linkend="method-gtksourceprintjob--get-font">get_font</link></methodname>
<methodparam></methodparam>
</methodsynopsis>
<methodsynopsis language="python">
<methodname><link linkend="method-gtksourceprintjob--set-numbers-font-desc">set_numbers_font_desc</link></methodname>
<methodparam><parameter role="keyword">desc</parameter></methodparam>
</methodsynopsis>
<methodsynopsis language="python">
<methodname><link linkend="method-gtksourceprintjob--get-numbers-font-desc">get_numbers_font_desc</link></methodname>
<methodparam></methodparam>
</methodsynopsis>
<methodsynopsis language="python">
<methodname><link linkend="method-gtksourceprintjob--set-numbers-font">set_numbers_font</link></methodname>
<methodparam><parameter role="keyword">font_name</parameter></methodparam>
</methodsynopsis>
<methodsynopsis language="python">
<methodname><link linkend="method-gtksourceprintjob--get-numbers-font">get_numbers_font</link></methodname>
<methodparam></methodparam>
</methodsynopsis>
<methodsynopsis language="python">
<methodname><link linkend="method-gtksourceprintjob--get-font">get_font</link></methodname>
<methodparam></methodparam>
</methodsynopsis>
<methodsynopsis language="python">
<methodname><link linkend="method-gtksourceprintjob--set-print-numbers">set_print_numbers</link></methodname>
<methodparam><parameter role="keyword">interval</parameter></methodparam>
</methodsynopsis>
<methodsynopsis language="python">
<methodname><link linkend="method-gtksourceprintjob--get-print-numbers">get_print_numbers</link></methodname>
<methodparam></methodparam>
</methodsynopsis>
<methodsynopsis language="python">
<methodname><link linkend="method-gtksourceprintjob--set-text-margins">set_text_margins</link></methodname>
<methodparam><parameter role="keyword">top</parameter></methodparam>
<methodparam><parameter role="keyword">bottom</parameter></methodparam>
<methodparam><parameter role="keyword">left</parameter></methodparam>
<methodparam><parameter role="keyword">right</parameter></methodparam>
</methodsynopsis>
<methodsynopsis language="python">
<methodname><link linkend="method-gtksourceprintjob--get-text-margins">get_text_margins</link></methodname>
<methodparam></methodparam>
</methodsynopsis>
<methodsynopsis language="python">
<methodname><link linkend="method-gtksourceprintjob--print">print</link></methodname>
<methodparam></methodparam>
</methodsynopsis>
<methodsynopsis language="python">
<methodname><link linkend="method-gtksourceprintjob--print-range">print_range</link></methodname>
<methodparam><parameter role="keyword">start</parameter></methodparam>
<methodparam><parameter role="keyword">end</parameter></methodparam>
</methodsynopsis>
<methodsynopsis language="python">
<methodname><link linkend="method-gtksourceprintjob--print-range-async">print_range_async</link></methodname>
<methodparam><parameter role="keyword">start</parameter></methodparam>
<methodparam><parameter role="keyword">end</parameter></methodparam>
</methodsynopsis>
<methodsynopsis language="python">
<methodname><link linkend="method-gtksourceprintjob--cancel">cancel</link></methodname>
<methodparam></methodparam>
</methodsynopsis>
<methodsynopsis language="python">
<methodname><link linkend="method-gtksourceprintjob--get-print-job">get_print_job</link></methodname>
<methodparam></methodparam>
</methodsynopsis>
<methodsynopsis language="python">
<methodname><link linkend="method-gtksourceprintjob--get-page">get_page</link></methodname>
<methodparam></methodparam>
</methodsynopsis>
<methodsynopsis language="python">
<methodname><link linkend="method-gtksourceprintjob--get-page-count">get_page_count</link></methodname>
<methodparam></methodparam>
</methodsynopsis>
<methodsynopsis language="python">
<methodname><link linkend="method-gtksourceprintjob--get-print-context">get_print_context</link></methodname>
<methodparam></methodparam>
</methodsynopsis>
<methodsynopsis language="python">
<methodname><link linkend="method-gtksourceprintjob--set-print-header">set_print_header</link></methodname>
<methodparam><parameter role="keyword">setting</parameter></methodparam>
</methodsynopsis>
<methodsynopsis language="python">
<methodname><link linkend="method-gtksourceprintjob--get-print-header">get_print_header</link></methodname>
<methodparam></methodparam>
</methodsynopsis>
<methodsynopsis language="python">
<methodname><link linkend="method-gtksourceprintjob--set-print-footer">set_print_footer</link></methodname>
<methodparam><parameter role="keyword">setting</parameter></methodparam>
</methodsynopsis>
<methodsynopsis language="python">
<methodname><link linkend="method-gtksourceprintjob--get-print-footer">get_print_footer</link></methodname>
<methodparam></methodparam>
</methodsynopsis>
<methodsynopsis language="python">
<methodname><link linkend="method-gtksourceprintjob--set-header-footer-font-desc">set_header_footer_font_desc</link></methodname>
<methodparam><parameter role="keyword">desc</parameter></methodparam>
</methodsynopsis>
<methodsynopsis language="python">
<methodname><link linkend="method-gtksourceprintjob--get-header-footer-font-desc">get_header_footer_font_desc</link></methodname>
<methodparam></methodparam>
</methodsynopsis>
<methodsynopsis language="python">
<methodname><link linkend="method-gtksourceprintjob--set-header-footer-font">set_header_footer_font</link></methodname>
<methodparam><parameter role="keyword">font_name</parameter></methodparam>
</methodsynopsis>
<methodsynopsis language="python">
<methodname><link linkend="method-gtksourceprintjob--get-header-footer-font">get_header_footer_font</link></methodname>
<methodparam></methodparam>
</methodsynopsis>
<methodsynopsis language="python">
<methodname><link linkend="method-gtksourceprintjob--set-header-format">set_header_format</link></methodname>
<methodparam><parameter role="keyword">left</parameter></methodparam>
<methodparam><parameter role="keyword">center</parameter></methodparam>
<methodparam><parameter role="keyword">right</parameter></methodparam>
<methodparam><parameter role="keyword">separator</parameter></methodparam>
</methodsynopsis>
<methodsynopsis language="python">
<methodname><link linkend="method-gtksourceprintjob--set-footer-format">set_footer_format</link></methodname>
<methodparam><parameter role="keyword">left</parameter></methodparam>
<methodparam><parameter role="keyword">center</parameter></methodparam>
<methodparam><parameter role="keyword">right</parameter></methodparam>
<methodparam><parameter role="keyword">separator</parameter></methodparam>
</methodsynopsis>
</classsynopsis>
</refsect1>
<!-- *********************************** -->
<!-- BEGIN OF GTKSOURCEPRINTJOB ANCESTRY -->
<!-- *********************************** -->
<refsect1>
<title>Ancestry</title>
<synopsis>+-- <link linkend="class-gobject">gobject.GObject</link>
+-- <link linkend="class-gtksourceprintjob">gtksourceview.SourcePrintJob</link>
</synopsis>
</refsect1>
<!-- ************************************* -->
<!-- BEGIN OF GTKSOURCEPRINTJOB PROPERTIES -->
<!-- ************************************* -->
<refsect1>
<title>Properties</title>
<blockquote role="properties">
<informaltable pgwide="1" frame="none">
<tgroup cols="3">
<colspec column="1" colwidth="1in"/>
<colspec column="2" colwidth="1in"/>
<colspec column="3" colwidth="4in"/>
<tbody>
<row valign="top">
<entry>"buffer"</entry>
<entry>Read-Write</entry>
<entry>The <link linked="class-gtksourcebuffer">gtksourceview.SourceBuffer</link> to print.</entry>
</row>
<row valign="top">
<entry>"config"</entry>
<entry>Read-Write</entry>
<entry>Configuration options for the print job.</entry>
</row>
<row valign="top">
<entry>"font"</entry>
<entry>Read-Write</entry>
<entry>GnomeFont name to use for the document text (deprecated), default None.</entry>
</row>
<row valign="top">
<entry>"font-desc"</entry>
<entry>Read-Write</entry>
<entry>Font to use for the document text (e.g. "Monospace 10").</entry>
</row>
<row valign="top">
<entry>"header-footer-font"</entry>
<entry>Read-Write</entry>
<entry>GnomeFont name to use for the header and footer (deprecated), default None.</entry>
</row>
<row valign="top">
<entry>"header-footer-font-desc"</entry>
<entry>Read-Write</entry>
<entry>Font to use for headers and footers (e.g. "Monospace 10").</entry>
</row>
<row valign="top">
<entry>"highlight"</entry>
<entry>Read-Write</entry>
<entry>Whether to print the document with highlighted syntax, default True.</entry>
</row>
<row valign="top">
<entry>"numbers-font"</entry>
<entry>Read-Write</entry>
<entry>GnomeFont name to use for the line numbers (deprecated), default None.</entry>
</row>
<row valign="top">
<entry>"numbers-font-desc"</entry>
<entry>Read-Write</entry>
<entry>Font description to use for the line numbers (e.g. "Monospace 10").</entry>
</row>
<row valign="top">
<entry>"print-footer"</entry>
<entry>Read-Write</entry>
<entry>Whether to print a footer in each page, default False.</entry>
</row>
<row valign="top">
<entry>"print-header"</entry>
<entry>Read-Write</entry>
<entry>Whether to print an header in each page, default False.</entry>
</row>
<row valign="top">
<entry>"print-numbers"</entry>
<entry>Read-Write</entry>
<entry>Interval of printed line numbers (0 means no numbers), allowed values: minor or equal to 100, default value: 1.</entry>
</row>
<row valign="top">
<entry>"tabs-width"</entry>
<entry>Read-Write</entry>
<entry>Width in equivalent space characters of tabs, allowed values: minor or equal to 100, default value: 8.</entry>
</row>
<row valign="top">
<entry>"wrap-mode"</entry>
<entry>Read-Write</entry>
<entry>Word wrapping mode, default value: GTK_WRAP_NONE.</entry>
</row>
</tbody>
</tgroup>
</informaltable>
</blockquote>
</refsect1>
<!-- ******************************************** -->
<!-- BEGIN OF GTKSOURCEPRINTJOB SIGNAL PROTOTYPES -->
<!-- ******************************************** -->
<refsect1>
<title>Signal Prototypes</title>
<variablelist>
<varlistentry>
<term><link linkend="signal-gtksourceprintjob--begin-page">"begin-page"</link></term>
<listitem>
<methodsynopsis language="python"><methodname>callback</methodname>
<methodparam><parameter>sourceprintjob</parameter></methodparam>
<methodparam><parameter>arg1</parameter></methodparam>
<methodparam><parameter>user_param1</parameter></methodparam>
<methodparam><parameter>...</parameter></methodparam>
</methodsynopsis>
</listitem>
</varlistentry>
<varlistentry>
<term><link linkend="signal-gtksourceprintjob--finished">"finished"</link></term>
<listitem>
<methodsynopsis language="python"><methodname>callback</methodname>
<methodparam><parameter>sourceprintjob</parameter></methodparam>
<methodparam><parameter>arg1</parameter></methodparam>
<methodparam><parameter>user_param1</parameter></methodparam>
<methodparam><parameter>...</parameter></methodparam>
</methodsynopsis>
</listitem>
</varlistentry>
</variablelist>
</refsect1>
<!-- ************************************** -->
<!-- BEGIN OF GTKSOURCEPRINTJOB DESCRIPTION -->
<!-- ************************************** -->
<refsect1 id="description-gtksourceprintjob">
<title>Description</title>
<para>
The <link linkend="class-gtksourceprintjob">gtksourceview.SourcePrintJob</link> object is used to print the contents of a
<link linkend="class-gtksourcebuffer">gtksourceview.SourceBuffer</link>. You can set various configuration options to
customize the printed output, and the result is obtained as a
<link linkend="class-gtksourceview">gtksourceview.SourcePrintJob</link> object, which you can then preview with
<link linkend="class-gnomeprintuijobpreview">gnomeprint.ui.JobPreview</link> or print directly with
<link linkend="class-gnomeprintjob-print">gnomeprint.Job.print</link>
</para>
<para>
Printing can be done synchronously and asynchronously. Asynchronous methods are provided so you can give the user feedback
about what's going on when printing long documents (see the <link linkend="signal-gtksourceprintjob--begin-page">"begin-page"</link>
and <link linkend="signal-gtksourceprintjob--finished">"finished"</link> signals).
</para>
<para>
The task of a <link linkend="class-gtksourceprintjob">gtksourceview.SourcePrintJob</link> is to produce a
<link linkend="class-gnomeprintjob">gnomeprint.Job</link>. What this means is that once you get the resulting
<link linkend="class-gnomeprintjob">gnomeprint.Job</link>, you might reuse the
<link linkend="class-gtksourceprintjob">gtksourceview.SourcePrintJob</link> to produce another output
(with different configuration options for example) or just unreference it and forget about it.
The lifetime of the produced object is independent of that of the producer.
</para>
<para>
Before printing you should at least set the <link linkend="class-gtksourcebuffer">gtksourceview.SourceBuffer</link>
you want to print (using <link linkend="method-gtksourceprintjob--set-buffer">set_buffer</link>).
Besides that, you might configure word wrapping, font, whether to print hightlighted text as seen in the
<link linkend="class-gtksourceview">gtksourceview.SourceView</link>, line numbers, basic headers and footers.
</para>
<para>
<link linkend="class-gtksourceprintjob">gtksourceview.SourcePrintJob</link> can print basic headers and footers in each page.
You can specify the time like strings for text on the left, right and center of the top and bottom of the page.
You can also make <link linkend="class-gtksourceprintjob">gtksourceview.SourcePrintJob</link> draw a separator line between
the text document and the header and footer. And you can specify a different font (from that used for the text document).
</para>
<para>
Customization beyond that is possible, but you have to do the printing manually. To do that, you need to connect to the
<link linkend="signal-gtksourceprintjob--begin-page">"begin-page"</link> signal of the job and allocate some space in the
page using <link linkend="method-gtksourceprintjob--set-text-margins">set_text_margins</link>.
Whenever <link linkend="class-gtksourceprintjob">gtksourceview.SourcePrintJob</link> is about to print a new text page,
the signal will be emitted. You can then get the <link linkend="class-gnomeprintcontext">gnomeprint.Context</link> being
used with <link linkend="method-gtksourceprintjob--get-print-context">get_print_context</link> and use Gnome Print functions
directly. The space you allocate is inside the document margins defined in the specified
<link linkend="class-gnomeprintconfig">gnomeprint.Config</link>, but outside all print area used by
<link linkend="class-gtksourceprintjob">gtksourceview.SourcePrintJob</link> itself.
</para>
</refsect1>
<!-- ************************************** -->
<!-- BEGIN OF GTKSOURCEPRINTJOB CONSTRUCTOR -->
<!-- ************************************** -->
<refsect1 id="constructor-gtksourceprintjob">
<title>Constructor</title>
<programlisting><constructorsynopsis language="python">
<methodname>gtksourceview.SourcePrintJob</methodname>
<methodparam><parameter role="keyword">buffer</parameter><initializer>None</initializer></methodparam>
</constructorsynopsis></programlisting>
<variablelist>
<varlistentry>
<term><parameter role="keyword">buffer</parameter> :</term>
<listitem><simpara>a <link linkend="class-gtksourcebuffer"><classname>gtksourceview.SourceBuffer</classname></link>
or <literal>None</literal></simpara></listitem>
</varlistentry>
<varlistentry>
<term><emphasis>Returns</emphasis> :</term>
<listitem><simpara>a new <link linkend="class-gtksourceprintjob"><classname>gtksourceview.SourcePrintJob</classname></link>.
</simpara></listitem>
</varlistentry>
</variablelist>
<para>
Creates a new <link linkend="class-gtksourceprintjob"><classname>gtksourceview.SourcePrintJob</classname></link> object.
</para>
</refsect1>
<!-- ********************************** -->
<!-- BEGIN OF GTKSOURCEPRINTJOB METHODS -->
<!-- ********************************** -->
<refsect1>
<title>Methods</title>
<refsect2 id="method-gtksourceprintjob--set-config">
<title>gtksourceview.SourcePrintJob.set_config</title>
<programlisting><methodsynopsis language="python">
<methodname>set_config</methodname>
<methodparam><parameter role="keyword">config</parameter></methodparam>
</methodsynopsis></programlisting>
<variablelist>
<varlistentry>
<term><parameter role="keyword">config</parameter> :</term>
<listitem><simpara> a <link linkend="class-gnomeprintconfig">gnomeprint.Config</link> object to get printing configuration from.</simpara></listitem>
</varlistentry>
</variablelist>
<para>
The <methodname>set_config</methodname>() method sets the print configuration for the job.
If you don't set a configuration object for the print job, when needed one
will be created with <link linkend="class-gnomeprintconfig">gnomeprint.Config</link>
</para>
</refsect2>
<refsect2 id="method-gtksourceprintjob--get-config">
<title>gtksourceview.SourcePrintJob.get_config</title>
<programlisting><methodsynopsis language="python">
<methodname>get_config</methodname>
<methodparam></methodparam></methodsynopsis></programlisting>
<variablelist>
<varlistentry>
<term><emphasis>Returns</emphasis> :</term>
<listitem><simpara> the <link linkend="class-gnomeprintconfig">gnomeprint.Config</link> for the print job.</simpara></listitem>
</varlistentry>
</variablelist>
<para>
The <methodname>get_config</methodname>() method gets the current <link linkend="class-gnomeprintconfig">gnomeprint.Config</link>
the print job will use. If not previously set, this will create a default configuration and return it. The returned object reference
is owned by the print job.
</para>
</refsect2>
<refsect2 id="method-gtksourceprintjob--set-buffer">
<title>gtksourceview.SourcePrintJob.set_buffer</title>
<programlisting><methodsynopsis language="python">
<methodname>set_buffer</methodname>
<methodparam><parameter role="keyword">buffer</parameter></methodparam>
</methodsynopsis></programlisting>
<variablelist>
<varlistentry>
<term><parameter role="keyword">buffer</parameter> :</term>
<listitem><simpara> a <link linkend="class-gtksourcebuffer">gtksourceview.SourceBuffer</link>.</simpara></listitem>
</varlistentry>
</variablelist>
<para>
The <methodname>set_buffer</methodname>() method sets the <link linkend="class-gtksourcebuffer">gtksourceview.SourceBuffer</link>
the print job will print. You need to specify a buffer to print, either by the use of this function or by creating the print
job passing the parameter <methodparam>buffer</methodparam> at the constructor.
</para>
</refsect2>
<refsect2 id="method-gtksourceprintjob--get-buffer">
<title>gtksourceview.SourcePrintJob.get_buffer</title>
<programlisting><methodsynopsis language="python">
<methodname>get_buffer</methodname>
<methodparam></methodparam></methodsynopsis></programlisting>
<variablelist>
<varlistentry>
<term><emphasis>Returns</emphasis> :</term>
<listitem><simpara> the <link linkend="class-gtksourcebuffer">gtksourceview.SourceBuffer</link> to print.</simpara></listitem>
</varlistentry>
</variablelist>
<para>
The <methodname>get_buffer</methodname>() method gets the <link linkend="class-gtksourcebuffer">gtksourceview.SourceBuffer</link>
the print job would print. The returned object reference (if non <literal>None</literal>) is owned by the job object and should not be unreferenced
</para>
</refsect2>
<refsect2 id="method-gtksourceprintjob--setup-from-view">
<title>gtksourceview.SourcePrintJob.setup_from_view</title>
<programlisting><methodsynopsis language="python">
<methodname>setup_from_view</methodname>
<methodparam><parameter role="keyword">view</parameter></methodparam>
</methodsynopsis></programlisting>
<variablelist>
<varlistentry>
<term><parameter role="keyword">view</parameter> :</term>
<listitem><simpara> a <link linkend="class-gtksourceview">gtksourceview.SourceView</link> to get configuration from.</simpara></listitem>
</varlistentry>
</variablelist>
<para>
The <methodname>setup_from_view</methodname>() method is a convenience function to set several configuration options at once,
so that the printed output matches view. The options set are buffer (if not set already), tabs width, highlighting, wrap mode
and default font.
</para>
</refsect2>
<refsect2 id="method-gtksourceprintjob--set-tabs-width">
<title>gtksourceview.SourcePrintJob.set_tabs_width</title>
<programlisting><methodsynopsis language="python">
<methodname>set_tabs_width</methodname>
<methodparam><parameter role="keyword">tabs_width</parameter></methodparam>
</methodsynopsis></programlisting>
<variablelist>
<varlistentry>
<term><parameter role="keyword">tabs_width</parameter> :</term>
<listitem><simpara> the number of equivalent spaces for a tabulation.</simpara></listitem>
</varlistentry>
</variablelist>
<para>
The <methodname>set_tabs_width</methodname>() method sets the width (in equivalent spaces) of tabulations for the printed text.
The width in printing units will be calculated as the width of a string containing tabs_width spaces of the default font.
Tabulation stops are set for the full width of printed text.
</para>
</refsect2>
<refsect2 id="method-gtksourceprintjob--get-tabs-width">
<title>gtksourceview.SourcePrintJob.get_tabs_width</title>
<programlisting><methodsynopsis language="python">
<methodname>get_tabs_width</methodname>
<methodparam></methodparam></methodsynopsis></programlisting>
<variablelist>
<varlistentry>
<term><emphasis>Returns</emphasis> :</term>
<listitem><simpara> the width (in equivalent spaces) of a tabulation.</simpara></listitem>
</varlistentry>
</variablelist>
<para>
The <methodname>get_tabs_width</methodname>() method determines the configured width (in equivalent spaces) of tabulations.
The default value is 8.
</para>
</refsect2>
<refsect2 id="method-gtksourceprintjob--set-wrap-mode">
<title>gtksourceview.SourcePrintJob.set_wrap_mode</title>
<programlisting><methodsynopsis language="python">
<methodname>set_wrap_mode</methodname>
<methodparam><parameter role="keyword">wrap</parameter></methodparam>
</methodsynopsis></programlisting>
<variablelist>
<varlistentry>
<term><parameter role="keyword">wrap</parameter> :</term>
<listitem><simpara> the wrap mode.</simpara></listitem>
</varlistentry>
</variablelist>
<para>
The <methodname>set_wrap_mode</methodname>() method sets the wrap mode for lines of text larger than the printable width.
See GtkWrapMode for a definition of the possible values.
</para>
</refsect2>
<refsect2 id="method-gtksourceprintjob--get-wrap-mode">
<title>gtksourceview.SourcePrintJob.get_wrap_mode</title>
<programlisting><methodsynopsis language="python">
<methodname>get_wrap_mode</methodname>
<methodparam></methodparam></methodsynopsis></programlisting>
<variablelist>
<varlistentry>
<term><emphasis>Returns</emphasis> :</term>
<listitem><simpara> the current wrapping mode for the print job.</simpara></listitem>
</varlistentry>
</variablelist>
<para>
The <methodname>get_tabs_width</methodname>() method determines the wrapping style for text lines wider than the printable width.
The default is no wrapping.
</para>
</refsect2>
<refsect2 id="method-gtksourceprintjob--set-highlight">
<title>gtksourceview.SourcePrintJob.set_highlight</title>
<programlisting><methodsynopsis language="python">
<methodname>set_highlight</methodname>
<methodparam><parameter role="keyword">highlight</parameter></methodparam>
</methodsynopsis></programlisting>
<variablelist>
<varlistentry>
<term><parameter role="keyword">highlight</parameter> :</term>
<listitem><simpara> if <literal>TRUE</literal> the printed text should be highlighted.</simpara></listitem>
</varlistentry>
</variablelist>
<para>
The <methodname>set_highlight</methodname>() method sets whether the printed text will be highlighted according to the buffer
rules. Both color and font style are applied.
</para>
</refsect2>
<refsect2 id="method-gtksourceprintjob--get-highlight">
<title>gtksourceview.SourcePrintJob.get_highlight</title>
<programlisting><methodsynopsis language="python">
<methodname>get_highlight</methodname>
<methodparam></methodparam></methodsynopsis></programlisting>
<variablelist>
<varlistentry>
<term><emphasis>Returns</emphasis> :</term>
<listitem><simpara><literal>TRUE</literal> if the printed output will be highlighted.</simpara></listitem>
</varlistentry>
</variablelist>
<para>
The <methodname>get_tabs_width</methodname>() method determines if the job is configured to print the text highlighted with
colors and font styles. Note that highlighting will happen only if the buffer to print has highlighting activated.
</para>
</refsect2>
<refsect2 id="method-gtksourceprintjob--set-font-desc">
<title>gtksourceview.SourcePrintJob.set_font_desc</title>
<programlisting><methodsynopsis language="python">
<methodname>set_font_desc</methodname>
<methodparam><parameter role="keyword">desc</parameter></methodparam>
</methodsynopsis></programlisting>
<variablelist>
<varlistentry>
<term><parameter role="keyword">desc</parameter> :</term>
<listitem><simpara> the PangoFontDescription for the default font.</simpara></listitem>
</varlistentry>
</variablelist>
<para>
The <methodname>set_font_desc</methodname>() method sets the default font for the printed text.
</para>
</refsect2>
<refsect2 id="method-gtksourceprintjob--get-font-desc">
<title>gtksourceview.SourcePrintJob.get_font_desc</title>
<programlisting><methodsynopsis language="python">
<methodname>get_font_desc</methodname>
<methodparam></methodparam></methodsynopsis></programlisting>
<variablelist>
<varlistentry>
<term><emphasis>Returns</emphasis> :</term>
<listitem><simpara> the current text font description.</simpara></listitem>
</varlistentry>
</variablelist>
<para>
The <methodname>get_font_desc</methodname>() method determines the default font to be used for the printed text.
The returned string is of the form "Fontfamily Style Size", for example "Monospace Regular 10.0".
</para>
</refsect2>
<refsect2 id="method-gtksourceprintjob--set-font">
<title>gtksourceview.SourcePrintJob.set_font</title>
<programlisting><methodsynopsis language="python">
<methodname>set_font</methodname>
<methodparam><parameter role="keyword">font_name</parameter></methodparam>
</methodsynopsis></programlisting>
<variablelist>
<varlistentry>
<term><parameter role="keyword">font_name</parameter> :</term>
<listitem><simpara> the name of the default font.</simpara></listitem>
</varlistentry>
</variablelist>
<para>
The <methodname>set_font</methodname>() method sets the default font for the printed text.
<parameter>font_name</parameter> should be a full font name GnomePrint can understand (e.g. "Monospace Regular 10.0")
</para>
<note>
Note that font_name is a GnomeFont name not a Pango font description string. This function is deprecated since GnomeFont
is no longer used when implementing printing for GtkSourceView;
you should use <link linkend="method-gtksourceprintjob--set-font-desc">set_font_desc</link> instead.
</note>
</refsect2>
<refsect2 id="method-gtksourceprintjob--get-font">
<title>gtksourceview.SourcePrintJob.get_font</title>
<programlisting><methodsynopsis language="python">
<methodname>get_font</methodname>
<methodparam></methodparam></methodsynopsis></programlisting>
<variablelist>
<varlistentry>
<term><emphasis>Returns</emphasis> :</term>
<listitem><simpara> a newly allocated string with the name of the current text font.</simpara></listitem>
</varlistentry>
</variablelist>
<para>
The <methodname>get_font</methodname>() method determines the default font to be used for the printed text.
The returned string is of the form "Fontfamily Style Size", for example "Monospace Regular 10.0".
</para>
<note>
Note that font_name is a GnomeFont name not a Pango font description string. This function is deprecated since GnomeFont
is no longer used when implementing printing for GtkSourceView;
you should use <link linkend="method-gtksourceprintjob--get-font-desc">get_font_desc</link> instead.
</note>
</refsect2>
<refsect2 id="method-gtksourceprintjob--set-numbers-font-desc">
<title>gtksourceview.SourcePrintJob.set_numbers_font_desc</title>
<programlisting><methodsynopsis language="python">
<methodname>set_numbers_font_desc</methodname>
<methodparam><parameter role="keyword">desc</parameter></methodparam>
</methodsynopsis></programlisting>
<variablelist>
<varlistentry>
<term><parameter role="keyword">desc</parameter> :</term>
<listitem><simpara> the PangoFontDescription for the default font for the line numbers or <literal>None</literal>.</simpara></listitem>
</varlistentry>
</variablelist>
<para>
The <methodname>set_numbers_font_desc</methodname>() method sets the font for printing line numbers on the left margin.
If <literal>None</literal> is supplied, the default font (i.e. the one being used for the text) will be used instead.
</para>
</refsect2>
<refsect2 id="method-gtksourceprintjob--get-numbers-font-desc">
<title>gtksourceview.SourcePrintJob.get_numbers_font_desc</title>
<programlisting><methodsynopsis language="python">
<methodname>get_numbers_font_desc</methodname>
<methodparam></methodparam></methodsynopsis></programlisting>
<variablelist>
<varlistentry>
<term><emphasis>Returns</emphasis> :</term>
<listitem><simpara> the line numbers font description or <literal>None</literal>.</simpara></listitem>
</varlistentry>
</variablelist>
<para>
The <methodname>get_font_desc</methodname>() method determines the font to be used for the line numbers.
This function might return <literal>None</literal> if a specific font for numbers has not been set.
</para>
</refsect2>
<refsect2 id="method-gtksourceprintjob--set-numbers-font">
<title>gtksourceview.SourcePrintJob.set_numbers_font</title>
<programlisting><methodsynopsis language="python">
<methodname>set_numbers_font</methodname>
<methodparam><parameter role="keyword">font_name</parameter></methodparam>
</methodsynopsis></programlisting>
<variablelist>
<varlistentry>
<term><parameter role="keyword">font_name</parameter> :</term>
<listitem><simpara> the full name of the font for line numbers, or <literal>None</literal>.</simpara></listitem>
</varlistentry>
</variablelist>
<para>
The <methodname>set_font</methodname>() method sets the font for printing line numbers on the left margin.
If <literal>None</literal> is supplied, the default font (i.e. the one being used for the text) will be used instead.
</para>
<note>
Note that font_name is a GnomeFont name not a Pango font description string. This function is deprecated since GnomeFont
is no longer used when implementing printing for GtkSourceView;
you should use <link linkend="method-gtksourceprintjob--set-numbers-font">set_numbers_font</link> instead.
</note>
</refsect2>
<refsect2 id="method-gtksourceprintjob--get-numbers-font">
<title>gtksourceview.SourcePrintJob.get_numbers_font</title>
<programlisting><methodsynopsis language="python">
<methodname>get_numbers_font</methodname>
<methodparam></methodparam></methodsynopsis></programlisting>
<variablelist>
<varlistentry>
<term><emphasis>Returns</emphasis> :</term>
<listitem><simpara> a newly allocated string with the name of the current line numbers font, or <literal>None</literal>.</simpara></listitem>
</varlistentry>
</variablelist>
<para>
The <methodname>get_numbers_font</methodname>() method determines the font to be used for the line numbers.
The returned string is of the form "Fontfamily Style Size", for example "Monospace Regular 10.0".
This function might return <literal>None</literal> if a specific font for numbers has not been set.
</para>
<note>
Note that font_name is a GnomeFont name not a Pango font description string. This function is deprecated since GnomeFont
is no longer used when implementing printing for GtkSourceView;
you should use <link linkend="method-gtksourceprintjob--get-numbers-font">get_numbers_font</link> instead.
</note>
</refsect2>
<refsect2 id="method-gtksourceprintjob--set-print-numbers">
<title>gtksourceview.SourcePrintJob.set_print_numbers</title>
<programlisting><methodsynopsis language="python">
<methodname>set_print_numbers</methodname>
<methodparam><parameter role="keyword">interval</parameter></methodparam>
</methodsynopsis></programlisting>
<variablelist>
<varlistentry>
<term><parameter role="keyword">interval</parameter> :</term>
<listitem><simpara> interval for printed line numbers.</simpara></listitem>
</varlistentry>
</variablelist>
<para>
The <methodname>set_print_numbers</methodname>() method sets the interval for printed line numbers.
If interval is 0 no numbers will be printed. If greater than 0, a number will be printed every interval lines
(i.e. 1 will print all line numbers).
</para>
</refsect2>
<refsect2 id="method-gtksourceprintjob--get-print-numbers">
<title>gtksourceview.SourcePrintJob.get_print_numbers</title>
<programlisting><methodsynopsis language="python">
<methodname>get_print_numbers</methodname>
<methodparam></methodparam></methodsynopsis></programlisting>
<variablelist>
<varlistentry>
<term><emphasis>Returns</emphasis> :</term>
<listitem><simpara> the interval of printed line numbers.</simpara></listitem>
</varlistentry>
</variablelist>
<para>
The <methodname>get_font_desc</methodname>() method determines the interval used for line number printing.
If the value is 0, no line numbers will be printed. The default value is 1 (i.e. numbers printed in all lines).
</para>
</refsect2>
<refsect2 id="method-gtksourceprintjob--set-text-margins">
<title>gtksourceview.SourcePrintJob.set_text_margins</title>
<programlisting><methodsynopsis language="python">
<methodname>set_text_margins</methodname>
<methodparam><parameter role="keyword">top</parameter></methodparam>
<methodparam><parameter role="keyword">bottom</parameter></methodparam>
<methodparam><parameter role="keyword">left</parameter></methodparam>
<methodparam><parameter role="keyword">right</parameter></methodparam>
</methodsynopsis></programlisting>
<variablelist>
<varlistentry>
<term><parameter role="keyword">top</parameter> :</term>
<listitem><simpara> the top user margin.</simpara></listitem>
</varlistentry>
</variablelist>
<variablelist>
<varlistentry>
<term><parameter role="keyword">bottom</parameter> :</term>
<listitem><simpara> the bottom user margin.</simpara></listitem>
</varlistentry>
</variablelist>
<variablelist>
<varlistentry>
<term><parameter role="keyword">left</parameter> :</term>
<listitem><simpara> the left user margin.</simpara></listitem>
</varlistentry>
</variablelist>
<variablelist>
<varlistentry>
<term><parameter role="keyword">right</parameter> :</term>
<listitem><simpara> the right user margin.</simpara></listitem>
</varlistentry>
</variablelist>
<para>
The <methodname>set_text_margins</methodname>() method sets the four user margins for the print job.
These margins are in addition to the document margins provided in the GnomePrintConfig and will not be used for headers,
footers or line numbers (those are calculated separatedly). You can print in the space allocated by these margins by
connecting to the "begin_page" signal. The space is around the printed text, and inside the margins specified in
the GnomePrintConfig.
</para>
<para>
The margin numbers are given in device units. If any of the given values is less than 0, that particular
margin is not altered by this function.
</para>
</refsect2>
<refsect2 id="method-gtksourceprintjob--get-text-margins">
<title>gtksourceview.SourcePrintJob.get_text_margins</title>
<programlisting><methodsynopsis language="python">
<methodname>get_text_margins</methodname>
<methodparam></methodparam></methodsynopsis></programlisting>
<variablelist>
<varlistentry>
<term><emphasis>Returns</emphasis> :</term>
<listitem><simpara> a list of margin numbers.</simpara></listitem>
</varlistentry>
</variablelist>
<para>
The <methodname>get_text_margins</methodname>() method determines the user set margins for the job.
This function retrieves the values previously set by
<link linkend="method-gtksourceprintjob--set-text-margins">set_text_margins</link>.
The default for all four margins is 0. Any of the pointers can be <literal>None</literal> if you want to ignore that value.
</para>
</refsect2>
<refsect2 id="method-gtksourceprintjob--print">
<title>gtksourceview.SourcePrintJob.print</title>
<programlisting><methodsynopsis language="python">
<methodname>print</methodname>
<methodparam></methodparam></methodsynopsis></programlisting>
<variablelist>
<varlistentry>
<term><emphasis>Returns</emphasis> :</term>
<listitem><simpara> a closed GnomePrintJob with the printed document, or <literal>None</literal> if printing
could not be completed.</simpara></listitem>
</varlistentry>
</variablelist>
<para>
The <methodname>print</methodname>() method produces a GnomePrintJob with the printed document.
The whole contents of the configured <link linkend="class-gtksourcebuffer"><classname>gtksourceview.SourceBuffer</classname></link>
are printed. The returned job is already closed and ready to be previewed
(using <link linkend="class-gnomeprintuijobpreview">gnomeprint.ui.JobPreview</link>) or printed directly.
The caller of this function owns a reference to the returned object, so job can be destroyed and the output will still be valid,
or the document can be printed again with different settings.
</para>
</refsect2>
<refsect2 id="method-gtksourceprintjob--print-range">
<title>gtksourceview.SourcePrintJob.print_range</title>
<programlisting><methodsynopsis language="python">
<methodname>print_range</methodname>
<methodparam></methodparam></methodsynopsis></programlisting>
<variablelist>
<varlistentry>
<term><parameter role="keyword">start</parameter> :</term>
<listitem><simpara> the start of the region of text to print.</simpara></listitem>
</varlistentry>
</variablelist>
<variablelist>
<varlistentry>
<term><parameter role="keyword">end</parameter> :</term>
<listitem><simpara> the end of the region of text to print.</simpara></listitem>
</varlistentry>
</variablelist>
<variablelist>
<varlistentry>
<term><emphasis>Returns</emphasis> :</term>
<listitem><simpara> a closed GnomePrintJob with the text from start to end printed, or <literal>None</literal>
if job could not print.</simpara></listitem>
</varlistentry>
</variablelist>
<para>
The <methodname>print_range</methodname>() method is similar to <link linkend="method-gtksourceprintjob--print">print</link>,
except you can specify a range of text to print. The passed GtkTextIter values might be out of order.
</para>
</refsect2>
<refsect2 id="method-gtksourceprintjob--print-range-async">
<title>gtksourceview.SourcePrintJob.print_range_async</title>
<programlisting><methodsynopsis language="python">
<methodname>print_range_async</methodname>
<methodparam></methodparam></methodsynopsis></programlisting>
<variablelist>
<varlistentry>
<term><parameter role="keyword">start</parameter> :</term>
<listitem><simpara> the start of the region of text to print.</simpara></listitem>
</varlistentry>
</variablelist>
<variablelist>
<varlistentry>
<term><parameter role="keyword">end</parameter> :</term>
<listitem><simpara> the end of the region of text to print.</simpara></listitem>
</varlistentry>
</variablelist>
<variablelist>
<varlistentry>
<term><emphasis>Returns</emphasis> :</term>
<listitem><simpara> <literal>True</literal> if the print started.</simpara></listitem>
</varlistentry>
</variablelist>
<para>
The <methodname>print_range_async</methodname>() method starts to print job asynchronously.
This function will ready the job for printing and install an idle handler that will render one page at a time.
</para>
<para>
This function will not return immediatly, as only page rendering is done asynchronously.
Text retrieval and paginating happens within this function. Also, if highlighting is enabled, the whole buffer
needs to be highlighted first.
</para>
<para>
To get notification when the job has finished, you must connect to the
<link linkend="signal-gtksourceprintjob--finished">"finished"</link> signal.
After this signal is emitted you can retrieve the resulting GnomePrintJob with
<link linkend="method-gtksourceprintjob--get-print-job">get_print_job</link>.
You may cancel the job with <link linkend="method-gtksourceprintjob--cancel">cancel</link>
</para>
</refsect2>
<refsect2 id="method-gtksourceprintjob--cancel">
<title>gtksourceview.SourcePrintJob.cancel</title>
<programlisting><methodsynopsis language="python">
<methodname>cancel</methodname>
<methodparam></methodparam></methodsynopsis></programlisting>
<para>
The <methodname>cancel</methodname>() method cancels an asynchronous printing operation.
This will remove any pending print idle handler and unref the current GnomePrintJob
</para>
<para>
Note that if you got a reference to the job's GnomePrintJob
(using <link linkend="method-gtksourceprintjob--get-print-job">get_print_job</link>) it will not be destroyed
(since you hold a reference to it), but it will not be closed either.
If you wish to show or print the partially printed document you need to close it yourself.
</para>
<para>
This function has no effect when called from a non-asynchronous print operation.
</para>
</refsect2>
<refsect2 id="method-gtksourceprintjob--get-print-job">
<title>gtksourceview.SourcePrintJob.get_print_job</title>
<programlisting><methodsynopsis language="python">
<methodname>get_print_job</methodname>
<methodparam></methodparam></methodsynopsis></programlisting>
<variablelist>
<varlistentry>
<term><emphasis>Returns</emphasis> :</term>
<listitem><simpara> a new reference to the job's GnomePrintJob, or <literal>None</literal>.</simpara></listitem>
</varlistentry>
</variablelist>
<para>
The <methodname>get_font_desc</methodname>() method gets a reference to the GnomePrintJob which the job is printing
or has recently finished printing. You need to unref the returned object.
</para>
You may call this function in the middle of an asynchronous printing operation, but the returned GnomePrintJob
will not be closed until the last page is printed and the "finished" signal is emitted.
<para>
</para>
</refsect2>
<refsect2 id="method-gtksourceprintjob--get-page">
<title>gtksourceview.SourcePrintJob.get_page</title>
<programlisting><methodsynopsis language="python">
<methodname>get_page</methodname>
<methodparam></methodparam></methodsynopsis></programlisting>
<variablelist>
<varlistentry>
<term><emphasis>Returns</emphasis> :</term>
<listitem><simpara> the current page number.</simpara></listitem>
</varlistentry>
</variablelist>
<para>
The <methodname>get_page</methodname>() method determines the currently printing page number.
This function is only valid while printing (either synchronously or asynchronously).
</para>
</refsect2>
<refsect2 id="method-gtksourceprintjob--get-page-count">
<title>gtksourceview.SourcePrintJob.get_page_count</title>
<programlisting><methodsynopsis language="python">
<methodname>get_page_count</methodname>
<methodparam></methodparam></methodsynopsis></programlisting>
<variablelist>
<varlistentry>
<term><emphasis>Returns</emphasis> :</term>
<listitem><simpara> the number of pages of the printed job.</simpara></listitem>
</varlistentry>
</variablelist>
<para>
The <methodname>get_page_count</methodname>() method determines the total number of pages the job will print.
The returned value is only meaninful after pagination has finished. In practice, for synchronous printing this means when
<link linkend="signal-gtksourceprintjob--begin-page">"begin-page"</link> is emitted, or after
<link linkend="method-gtksourceprintjob--print-range-async">print_range_async</link> has returned.
</para>
</refsect2>
<refsect2 id="method-gtksourceprintjob--get-print-context">
<title>gtksourceview.SourcePrintJob.get_print_context</title>
<programlisting><methodsynopsis language="python">
<methodname>get_print_context</methodname>
<methodparam></methodparam></methodsynopsis></programlisting>
<variablelist>
<varlistentry>
<term><emphasis>Returns</emphasis> :</term>
<listitem><simpara> the current GnomePrintContext. The returned object is owned by job.</simpara></listitem>
</varlistentry>
</variablelist>
<para>
The <methodname>get_print_context</methodname>() method determines the GnomePrintContext of the current job.
This function is only valid while printing. Normally you would use this function to print in the margins set by
<link linkend="method-gtksourceprintjob--set-text-margins">set_text_margins</link> in a handler for the
<link linkend="signal-gtksourceprintjob--begin-page">"begin-page"</link> signal.
</para>
</refsect2>
<refsect2 id="method-gtksourceprintjob--set-print-header">
<title>gtksourceview.SourcePrintJob.set_print_header</title>
<programlisting><methodsynopsis language="python">
<methodname>set_print_header</methodname>
<methodparam><parameter role="keyword">setting</parameter></methodparam>
</methodsynopsis></programlisting>
<variablelist>
<varlistentry>
<term><parameter role="keyword">setting</parameter> :</term>
<listitem><simpara> if <literal>TRUE</literal> you want the header to be printed.</simpara></listitem>
</varlistentry>
</variablelist>
<para>
The <methodname>set_print_header</methodname>() method sets whether you want to print a header in each page. The default header consists of three pieces
of text and an optional line separator, configurable with <link linkend="method-gtksourceprintjob--set-header-format">set_header_format</link>.
</para>
</refsect2>
<refsect2 id="method-gtksourceprintjob--get-print-header">
<title>gtksourceview.SourcePrintJob.get_print_header</title>
<programlisting><methodsynopsis language="python">
<methodname>get_print_header</methodname>
<methodparam></methodparam></methodsynopsis></programlisting>
<variablelist>
<varlistentry>
<term><emphasis>Returns</emphasis> :</term>
<listitem><simpara> <literal>TRUE</literal> if the header is set to be printed.</simpara></listitem>
</varlistentry>
</variablelist>
<para>
The <methodname>get_print_header</methodname>() method Determines if a header is set to be printed for each page. A header will be printed if this
function returns <literal>TRUE</literal> and some format strings have been specified with
<link linkend="method-gtksourceprintjob--set-header-format">set_header_format</link>.
</para>
</refsect2>
<refsect2 id="method-gtksourceprintjob--set-print-footer">
<title>gtksourceview.SourcePrintJob.set_print_footer</title>
<programlisting><methodsynopsis language="python">
<methodname>set_print_footer</methodname>
<methodparam><parameter role="keyword">setting</parameter></methodparam>
</methodsynopsis></programlisting>
<variablelist>
<varlistentry>
<term><parameter role="keyword">setting</parameter> :</term>
<listitem><simpara> if <literal>TRUE</literal> you want the footer to be printed.</simpara></listitem>
</varlistentry>
</variablelist>
<para>
The <methodname>set_print_footer</methodname>() method sets whether you want to print a footer in each page. The default header consists of three pieces
of text and an optional line separator, configurable with <link linkend="method-gtksourceprintjob--set-footer-format">set_footer_format</link>.
</para>
<note>
By default the footer format is unspecified, and if it's empty it will not be printed, regardless of this setting.
</note>
</refsect2>
<refsect2 id="method-gtksourceprintjob--get-print-footer">
<title>gtksourceview.SourcePrintJob.get_print_footer</title>
<programlisting><methodsynopsis language="python">
<methodname>get_print_footer</methodname>
<methodparam></methodparam></methodsynopsis></programlisting>
<variablelist>
<varlistentry>
<term><emphasis>Returns</emphasis> :</term>
<listitem><simpara> <literal>TRUE</literal> if the footer is set to be printed.</simpara></listitem>
</varlistentry>
</variablelist>
<para>
The <methodname>get_print_footer</methodname>() method determines if a footer is set to be printed for each page. A header will be printed if this
function returns <literal>TRUE</literal> and some format strings have been specified with
<link linkend="method-gtksourceprintjob--set-footer-format">set_header_format</link>.
</para>
</refsect2>
<refsect2 id="method-gtksourceprintjob--set-header-footer-font-desc">
<title>gtksourceview.SourcePrintJob.set_header_footer_font_desc</title>
<programlisting><methodsynopsis language="python">
<methodname>set_header_footer_font_desc</methodname>
<methodparam><parameter role="keyword">desc</parameter></methodparam>
</methodsynopsis></programlisting>
<variablelist>
<varlistentry>
<term><parameter role="keyword">desc</parameter> :</term>
<listitem><simpara> the PangoFontDescription for the font to be used in headers and footers, or <literal>None</literal>.</simpara></listitem>
</varlistentry>
</variablelist>
<para>
The <methodname>set_header_footer_font_desc</methodname>() method sets the font for printing headers and footers. If <literal>None</literal> is supplied,
the default font (i.e. the one being used for the text) will be used instead.
</para>
</refsect2>
<refsect2 id="method-gtksourceprintjob--get-header-footer-desc">
<title>gtksourceview.SourcePrintJob.get_header_footer_font_desc</title>
<programlisting><methodsynopsis language="python">
<methodname>get_header_footer_font_desc</methodname>
<methodparam></methodparam></methodsynopsis></programlisting>
<variablelist>
<varlistentry>
<term><emphasis>Returns</emphasis> :</term>
<listitem><simpara> the header and footer font description or <literal>None</literal>.</simpara></listitem>
</varlistentry>
</variablelist>
<para>
The <methodname>get_header_footer_font_desc</methodname>() method determines the font to be used for the header and footer. This function might return
<literal>None</literal> if a specific font has not been set.
</para>
</refsect2>
<refsect2 id="method-gtksourceprintjob--set-header-footer-font">
<title>gtksourceview.SourcePrintJob.set_header_footer_font</title>
<programlisting><methodsynopsis language="python">
<methodname>set_header_footer_font</methodname>
<methodparam><parameter role="keyword">font_name</parameter></methodparam>
</methodsynopsis></programlisting>
<variablelist>
<varlistentry>
<term><parameter role="keyword">font_name</parameter> :</term>
<listitem><simpara> the full name of the font to be used in headers and footers, or <literal>None</literal>.</simpara></listitem>
</varlistentry>
</variablelist>
<para>
The <methodname>set_header_footer_font</methodname>() method sets the font for printing headers and footers. If <literal>None</literal> is supplied, the
default font (i.e. the one being used for the text) will be used instead.
</para>
<note>
the result is a GnomeFont name not a Pango font description string. This function is deprecated since GnomeFont is no longer used when implementing
printing for <link linkend="class-gtksourceview">gtksourceview.SourceView</link>; you should use
<link linkend="method-gtksourceprintjob--set-header-footer-font-desc">set_header_footer_font_desc</link> instead.
</note>
</refsect2>
<refsect2 id="method-gtksourceprintjob--get-header-footer-font">
<title>gtksourceview.SourcePrintJob.get_header_footer_font</title>
<programlisting><methodsynopsis language="python">
<methodname>get_header_footer_font</methodname>
<methodparam></methodparam></methodsynopsis></programlisting>
<variablelist>
<varlistentry>
<term><emphasis>Returns</emphasis> :</term>
<listitem><simpara> a newly allocated string with the name of the current header and footer font, or <literal>None</literal>.</simpara></listitem>
</varlistentry>
</variablelist>
<para>
The <methodname>get_header_footer_font_desc</methodname>() method determines the font to be used for the header and footer. The returned string is of the
form "Fontfamily Style Size", for example "Monospace Regular 10.0". The returned value should be freed when no longer needed. This function might return
<literal>None</literal> if a specific font has not been set.
</para>
<note>
the result is a GnomeFont name not a Pango font description string. This function is deprecated since GnomeFont is no longer used when implementing
printing for <link linkend="class-gtksourceview">gtksourceview.SourceView</link>; you should use
<link linkend="method-gtksourceprintjob--get-header-footer-font-desc">get_header_footer_font_desc</link> instead.
</note>
</refsect2>
<refsect2 id="method-gtksourceprintjob--set-header-format">
<title>gtksourceview.SourcePrintJob.set_header_format</title>
<programlisting><methodsynopsis language="python">
<methodname>set_header_format</methodname>
<methodparam><parameter role="keyword">left</parameter></methodparam>
<methodparam><parameter role="keyword">center</parameter></methodparam>
<methodparam><parameter role="keyword">right</parameter></methodparam>
<methodparam><parameter role="keyword">separator</parameter></methodparam>
</methodsynopsis></programlisting>
<variablelist>
<varlistentry>
<term><parameter role="keyword">left</parameter> :</term>
<listitem><simpara> a format string to print on the left of the header.</simpara></listitem>
</varlistentry>
</variablelist>
<variablelist>
<varlistentry>
<term><parameter role="keyword">center</parameter> :</term>
<listitem><simpara> a format string to print on the center of the header.</simpara></listitem>
</varlistentry>
</variablelist>
<variablelist>
<varlistentry>
<term><parameter role="keyword">right</parameter> :</term>
<listitem><simpara> a format string to print on the right of the header.</simpara></listitem>
</varlistentry>
</variablelist>
<variablelist>
<varlistentry>
<term><parameter role="keyword">right</parameter> :</term>
<listitem><simpara> <literal>TRUE</literal> if you want a separator line to be printed.</simpara></listitem>
</varlistentry>
</variablelist>
<para>
The <methodname>set_header_format</methodname>() method sets time() like header format strings, to be printed on the left, center and right of the top of
each page. The strings may include strftime(3) codes which will be expanded at print time. All time() codes are accepted, with the addition of N for the
page number and Q for the page count.
</para>
<para>
Separator specifies if a solid line should be drawn to separate the header from the document text.
</para>
<para>
If <literal>None</literal> is given for any of the three arguments, that particular string will not be printed. For the header to be printed, in addition to specifying format strings, you need to enable header printing with <link linkend="method-gtksourceprintjob--set-print-header">set_print_header</link>.
</para>
</refsect2>
<refsect2 id="method-gtksourceprintjob--set-footer-format">
<title>gtksourceview.SourcePrintJob.set_footer_format</title>
<programlisting><methodsynopsis language="python">
<methodname>set_footer_format</methodname>
<methodparam><parameter role="keyword">left</parameter></methodparam>
<methodparam><parameter role="keyword">center</parameter></methodparam>
<methodparam><parameter role="keyword">right</parameter></methodparam>
<methodparam><parameter role="keyword">separator</parameter></methodparam>
</methodsynopsis></programlisting>
<variablelist>
<varlistentry>
<term><parameter role="keyword">left</parameter> :</term>
<listitem><simpara> a format string to print on the left of the footer.</simpara></listitem>
</varlistentry>
</variablelist>
<variablelist>
<varlistentry>
<term><parameter role="keyword">center</parameter> :</term>
<listitem><simpara> a format string to print on the center of the footer.</simpara></listitem>
</varlistentry>
</variablelist>
<variablelist>
<varlistentry>
<term><parameter role="keyword">right</parameter> :</term>
<listitem><simpara> a format string to print on the right of the footer.</simpara></listitem>
</varlistentry>
</variablelist>
<variablelist>
<varlistentry>
<term><parameter role="keyword">right</parameter> :</term>
<listitem><simpara> <literal>TRUE</literal> if you want a separator line to be printed.</simpara></listitem>
</varlistentry>
</variablelist>
<para>
The <methodname>set_footer_format</methodname>() method sets time() like footer format strings, to be printed on the left, center and right of the top of
each page. The strings may include strftime(3) codes which will be expanded at print time. All time() codes are accepted, with the addition of N for the
page number and Q for the page count.
</para>
<para>
Separator specifies if a solid line should be drawn to separate the header from the document text.
</para>
<para>
If <literal>None</literal> is given for any of the three arguments, that particular string will not be printed. For the header to be printed, in addition to specifying format strings, you need to enable header printing with <link linkend="method-gtksourceprintjob--set-print-footer">set_print_footer</link>.
</para>
</refsect2>
</refsect1>
<!-- ******************************** -->
<!-- BEGIN OF GTKSOURCEBUFFER SIGNALS -->
<!-- ******************************** -->
<refsect1>
<title>Signals</title>
<refsect2 id="signal-gtksourceprintjob--begin-page">
<title>The "begin-page" gtksourceprintjob.SourcePrintJob Signal</title>
<programlisting><methodsynopsis language="python">
<methodname>callback</methodname>
<methodparam><parameter>sourceprintjob</parameter></methodparam>
<methodparam><parameter>user_param1</parameter></methodparam>
<methodparam><parameter>...</parameter></methodparam>
</methodsynopsis></programlisting>
<variablelist>
<varlistentry>
<term><parameter>sourceprintjob</parameter> :</term>
<listitem><simpara>the sourceprintjob that received the signal</simpara></listitem>
</varlistentry>
<varlistentry>
<term><parameter>user_param1</parameter> :</term>
<listitem><simpara>the first user parameter (if any) specified with the
<link linkend="method-gobject--connect"><methodname>connect</methodname>()</link> method</simpara></listitem>
</varlistentry>
<varlistentry>
<term><parameter>...</parameter> :</term>
<listitem><simpara>additional user parameters (if any)</simpara></listitem>
</varlistentry>
</variablelist>
<para>
The "begin-page" signal is emitted when the sourceprintjob is about to print a new text page. You can connect to this signal to provide the user with
feedback about the progress of printing, or to customize the printed page by for example, printing your own headers and footers.
</para>
</refsect2>
<refsect2 id="signal-gtksourceprintjob--finished">
<title>The "finished" gtksourceprintjob.SourcePrintJob Signal</title>
<programlisting><methodsynopsis language="python">
<methodname>callback</methodname>
<methodparam><parameter>sourceprintjob</parameter></methodparam>
<methodparam><parameter>user_param1</parameter></methodparam>
<methodparam><parameter>...</parameter></methodparam>
</methodsynopsis></programlisting>
<variablelist>
<varlistentry>
<term><parameter>sourcebuffer</parameter> :</term>
<listitem><simpara>the sourcebuffer that received the signal</simpara></listitem>
</varlistentry>
<varlistentry>
<term><parameter>user_param1</parameter> :</term>
<listitem><simpara>the first user parameter (if any) specified with the
<link linkend="method-gobject--connect"><methodname>connect</methodname>()</link> method</simpara></listitem>
</varlistentry>
<varlistentry>
<term><parameter>...</parameter> :</term>
<listitem><simpara>additional user parameters (if any)</simpara></listitem>
</varlistentry>
</variablelist>
<para>
The "finished" signal is emitted whenever an asynchronous print job has finished. You can connect to this signal to get notification when a job has
finished printing. When it's emitted, the GnomePrintJob the sourceprintjob was producing has been closed and it can be either previewed or printed to the
physical device.
</para>
</refsect2>
</refsect1>
</refentry>
|