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 1578 1579 1580 1581 1582 1583 1584 1585 1586 1587 1588 1589 1590 1591 1592 1593 1594 1595 1596 1597 1598 1599 1600 1601 1602 1603 1604 1605 1606 1607 1608 1609 1610 1611 1612 1613 1614 1615 1616 1617 1618 1619 1620 1621 1622 1623 1624 1625 1626 1627 1628 1629 1630 1631 1632 1633 1634 1635 1636 1637 1638 1639 1640 1641 1642 1643 1644 1645 1646 1647 1648 1649 1650 1651 1652 1653 1654 1655 1656 1657 1658 1659 1660 1661 1662 1663 1664 1665 1666 1667 1668 1669 1670 1671 1672 1673 1674 1675 1676 1677 1678 1679 1680 1681 1682 1683 1684 1685 1686 1687 1688 1689 1690 1691 1692 1693 1694 1695 1696 1697 1698 1699 1700 1701 1702 1703 1704 1705 1706 1707 1708 1709 1710 1711 1712 1713 1714 1715 1716 1717 1718 1719 1720 1721 1722 1723 1724 1725 1726 1727 1728 1729 1730 1731 1732 1733 1734 1735 1736 1737 1738 1739 1740 1741 1742 1743 1744 1745 1746 1747 1748 1749 1750 1751 1752 1753 1754 1755 1756 1757 1758 1759 1760 1761 1762 1763 1764 1765 1766 1767 1768 1769 1770 1771 1772 1773 1774 1775 1776 1777 1778 1779 1780 1781 1782 1783 1784 1785 1786 1787 1788 1789 1790 1791 1792 1793 1794 1795 1796 1797 1798 1799 1800 1801 1802 1803 1804 1805 1806 1807 1808 1809 1810 1811 1812 1813 1814 1815 1816 1817 1818 1819 1820 1821 1822 1823 1824 1825 1826 1827 1828 1829 1830 1831 1832 1833 1834 1835 1836 1837 1838 1839 1840 1841 1842 1843 1844 1845 1846 1847 1848 1849 1850 1851 1852 1853 1854 1855 1856 1857 1858 1859 1860 1861 1862 1863 1864 1865 1866 1867 1868 1869 1870 1871 1872 1873 1874 1875 1876 1877 1878 1879 1880 1881 1882 1883 1884 1885 1886 1887 1888 1889 1890 1891 1892 1893 1894 1895 1896 1897 1898 1899 1900 1901 1902 1903 1904 1905 1906 1907 1908 1909 1910 1911 1912 1913 1914 1915 1916 1917 1918 1919 1920 1921 1922 1923 1924 1925 1926 1927 1928 1929 1930 1931 1932 1933 1934 1935 1936 1937 1938 1939 1940 1941 1942 1943 1944 1945 1946 1947 1948 1949 1950 1951 1952 1953 1954 1955 1956 1957 1958 1959 1960 1961 1962 1963 1964 1965 1966 1967 1968 1969 1970 1971 1972 1973 1974 1975 1976 1977 1978 1979 1980 1981 1982 1983 1984 1985 1986 1987 1988 1989 1990 1991 1992 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 2018 2019 2020 2021 2022 2023 2024 2025 2026 2027 2028 2029 2030 2031 2032 2033 2034 2035 2036 2037 2038 2039 2040 2041 2042 2043 2044 2045 2046 2047 2048 2049 2050 2051 2052 2053 2054 2055 2056 2057 2058 2059 2060 2061 2062 2063 2064 2065 2066 2067 2068 2069 2070 2071 2072 2073 2074 2075 2076 2077 2078 2079 2080 2081 2082 2083 2084 2085 2086 2087 2088 2089 2090 2091 2092 2093 2094 2095 2096 2097 2098 2099 2100 2101 2102 2103 2104 2105 2106 2107 2108 2109 2110 2111 2112 2113 2114 2115 2116 2117 2118 2119 2120 2121 2122 2123 2124 2125 2126 2127 2128 2129 2130 2131 2132 2133 2134 2135 2136 2137 2138 2139 2140 2141 2142 2143 2144 2145 2146 2147 2148 2149 2150
|
From: Mario Haustein <mario.haustein@hrz.tu-chemnitz.de>
Date: Sun, 2 Feb 2025 17:37:11 +0100
Origin: upstream, https://sourceforge.net/p/mcj/xfig/ci/92a8262
Forwarded: not-needed
Bug: https://sourceforge.net/p/mcj/tickets/194/
Bug-Debian: https://bugs.debian.org/1098137
Last-Update: 2025-09-05
Subject: Fix prototypes for manipulation callbacks
--- a/src/e_addpt.c
+++ b/src/e_addpt.c
@@ -17,6 +17,7 @@
#include "e_addpt.h"
+#include <stdarg.h>
#include <stddef.h>
#include "resources.h"
@@ -38,7 +39,7 @@
#include "w_modepanel.h"
-static void init_point_adding(F_line *p, int type, int x, int y, int px, int py);
+static void init_point_adding(void *obj, int type, int x, int y, ...);
static void fix_linepoint_adding(int x, int y, unsigned int shift);
static void fix_splinepoint_adding(int x, int y, unsigned int shift);
static void init_linepointadding(int px, int py);
@@ -65,23 +66,32 @@ point_adding_selected(void)
}
static void
-init_point_adding(F_line *p, int type, int x, int y, int px, int py)
+init_point_adding(void *obj, int type, int x, int y, ...)
{
+ va_list args;
+ int px;
+ int py;
+
(void)x;
(void)y;
+ va_start(args, y);
+ px = va_arg(args, int);
+ py = va_arg(args, int);
+ va_end(args);
+
set_action_on();
set_mousefun("place new point", "", "cancel", LOC_OBJ, LOC_OBJ, LOC_OBJ);
draw_mousefun_canvas();
set_cursor(null_cursor);
switch (type) {
case O_POLYLINE:
- cur_l = (F_line *) p;
+ cur_l = (F_line *) obj;
/* the search routine will ensure that we don't have a box */
init_linepointadding(px, py);
break;
case O_SPLINE:
- cur_s = (F_spline *) p;
+ cur_s = (F_spline *) obj;
init_splinepointadding(px, py);
break;
default:
--- a/src/e_align.c
+++ b/src/e_align.c
@@ -51,7 +51,7 @@ static Boolean pos_spline(F_spline *s, i
static Boolean pos_text(F_text *t, int *min, int *size, int dir);
static Boolean pos_compound(F_compound *c, int *min, int *size, int dir);
-static void init_align(F_line *p, int type, int x, int y, int px, int py);
+static void init_align(void *obj, int type, int x, int y, ...);
static void init_align_canvas(int x, int y, unsigned int shift);
static void align_arc(void);
static void align_ellipse(void);
@@ -139,16 +139,14 @@ init_align_canvas(int x, int y, unsigned
}
static void
-init_align(F_line *p, int type, int x, int y, int px, int py)
+init_align(void *obj, int type, int x, int y, ...)
{
(void)x;
(void)y;
- (void)px;
- (void)py;
if (type != O_COMPOUND)
return;
- cur_c = (F_compound *) p;
+ cur_c = (F_compound *) obj;
toggle_compoundmarker(cur_c);
draw_compoundelements(cur_c, ERASE);
old_c = copy_compound(cur_c);
--- a/src/e_arrow.c
+++ b/src/e_arrow.c
@@ -18,6 +18,7 @@
#include "e_arrow.h"
+#include <stdarg.h>
#include <stdlib.h>
#include "resources.h"
@@ -34,10 +35,8 @@
#include "w_mousefun.h"
-static void add_arrow_head(F_line *obj, int type, int x, int y,
- F_point *p, F_point *q, int pnum);
-static void delete_arrow_head(F_line *obj, int type, int x, int y,
- F_point *p, F_point *q, int pnum);
+static void add_arrow_head(void *obj, int type, int x, int y, ...);
+static void delete_arrow_head(void *obj, int type, int x, int y, ...);
static void add_linearrow(F_line *line, F_point *prev_point,
F_point *selected_point);
static void add_arcarrow(F_arc *arc, int point_num);
@@ -63,12 +62,22 @@ arrow_head_selected(void)
}
static void
-add_arrow_head(F_line *obj, int type, int x, int y, F_point *p, F_point *q,
- int pnum)
+add_arrow_head(void *obj, int type, int x, int y, ...)
{
(void)x;
(void)y;
+ va_list args;
+ F_point *p;
+ F_point *q;
+ int pnum;
+
+ va_start(args, y);
+ p = va_arg(args, F_point*);
+ q = va_arg(args, F_point*);
+ pnum = va_arg(args, int);
+ va_end(args);
+
switch (type) {
case O_POLYLINE:
cur_l = (F_line *) obj;
@@ -86,12 +95,22 @@ add_arrow_head(F_line *obj, int type, in
}
static void
-delete_arrow_head(F_line *obj, int type, int x, int y, F_point *p, F_point *q,
- int pnum)
+delete_arrow_head(void *obj, int type, int x, int y, ...)
{
(void)x;
(void)y;
+ F_point *p;
+ F_point *q;
+ int pnum;
+
+ va_list args;
+ va_start(args, y);
+ p = va_arg(args, F_point*);
+ q = va_arg(args, F_point*);
+ pnum = va_arg(args, int);
+ va_end(args);
+
switch (type) {
case O_POLYLINE:
cur_l = (F_line *) obj;
--- a/src/e_break.c
+++ b/src/e_break.c
@@ -30,12 +30,9 @@
#include "w_mousefun.h"
-static void init_break(F_line *p, int type, int x, int y, int px, int py,
- int loc_tag);
-static void init_break_only(F_line *p, int type, int x, int y, int px,
- int py);
-static void init_break_tag(F_line *p, int type, int x, int y, int px,
- int py);
+static void init_break(void *obj, int type, int loc_tag);
+static void init_break_only(void *obj, int type, int x, int y, ...);
+static void init_break_tag(void *obj, int type, int x, int y, ...);
@@ -56,29 +53,28 @@ break_selected(void)
}
static void
-init_break_only(F_line *p, int type, int x, int y, int px, int py)
+init_break_only(void *obj, int type, int x, int y, ...)
{
- init_break(p, type, x, y, px, py, 0);
+ (void)x;
+ (void)y;
+ init_break(obj, type, 0);
}
static void
-init_break_tag(F_line *p, int type, int x, int y, int px, int py)
+init_break_tag(void *obj, int type, int x, int y, ...)
{
- init_break(p, type, x, y, px, py, 1);
+ (void)x;
+ (void)y;
+ init_break(obj, type, 1);
}
static void
-init_break(F_line *p, int type, int x, int y, int px, int py, int loc_tag)
+init_break(void *obj, int type, int loc_tag)
{
- (void)x;
- (void)y;
- (void)px;
- (void)py;
-
if (type != O_COMPOUND)
return;
- cur_c = (F_compound *) p;
+ cur_c = (F_compound *)obj;
mask_toggle_compoundmarker(cur_c);
clean_up();
list_delete_compound(&objects.compounds, cur_c);
--- a/src/e_chop.c
+++ b/src/e_chop.c
@@ -44,8 +44,8 @@
#include "w_snap.h"
#include "xfig_math.h"
-static void select_axe_object();
-static void select_log_object();
+static void select_axe_object(void *obj, int type, int x, int y, ...);
+static void select_log_object(void *obj, int type, int x, int y, ...);
static void clear_axe_objects(int x, int y, unsigned shift);
typedef struct {
@@ -107,9 +107,9 @@ chop_selected(void)
}
static void
-select_axe_object(void *obj, int type, int x, int y, F_point *p, F_point * q)
+select_axe_object(void *obj, int type, int x, int y, ...)
{
- (void)x; (void)y; (void)p; (void)q;
+ (void)x; (void)y;
int i;
@@ -826,10 +826,8 @@ chop_ellipse(F_ellipse * e, int x, int y
}
static void
-select_log_object(void *obj, int type, int x, int y, F_point *p, F_point *q)
+select_log_object(void *obj, int type, int x, int y, ...)
{
- (void)p;
- (void)q;
Boolean rc;
switch(type) {
--- a/src/e_compound.c
+++ b/src/e_compound.c
@@ -66,31 +66,25 @@ static void popup_close_compound (void);
static void
-init_open_compound(F_compound *c, int type, int x, int y, int px, int py)
+init_open_compound(void *obj, int type, int x, int y, ...)
{
(void)x;
(void)y;
- (void)px;
- (void)py;
if (type != O_COMPOUND)
return;
- open_this_compound(c, False);
+ open_this_compound((F_compound*)obj, False);
}
static void
-init_open_compound_vis(F_compound *c, int type, int x, int y, int px, int py,
- int loc_tag)
+init_open_compound_vis(void *obj, int type, int x, int y, ...)
{
(void)x;
(void)y;
- (void)px;
- (void)py;
- (void)loc_tag;
if (type != O_COMPOUND)
return;
- open_this_compound(c, True);
+ open_this_compound((F_compound*)obj, True);
}
void
--- a/src/e_convert.c
+++ b/src/e_convert.c
@@ -19,6 +19,7 @@
#include "e_convert.h"
+#include <stdarg.h>
#include <stdlib.h>
#include "resources.h"
@@ -41,10 +42,8 @@
#include "w_msgpanel.h"
-static void init_convert_line_spline(F_line *p, int type, int x, int y,
- int px, int py);
-static void init_convert_open_closed(F_line *obj, int type, int x, int y,
- F_point *p, F_point *q);
+static void init_convert_line_spline(void *obj, int type, int x, int y, ...);
+static void init_convert_open_closed(void *obj, int type, int x, int y, ...);
@@ -65,12 +64,20 @@ convert_selected(void)
}
static void
-init_convert_open_closed(F_line *obj, int type, int x, int y, F_point *p,
- F_point *q)
+init_convert_open_closed(void *obj, int type, int x, int y, ...)
{
(void)x;
(void)y;
+ va_list args;
+ F_point *p;
+ F_point *q;
+
+ va_start(args, y);
+ p = va_arg(args, F_point*);
+ q = va_arg(args, F_point*);
+ va_end(args);
+
switch (type) {
case O_POLYLINE:
cur_l = (F_line *) obj;
@@ -86,15 +93,15 @@ init_convert_open_closed(F_line *obj, in
}
static void
-init_convert_line_spline(F_line *p, int type, int x, int y, int px, int py)
+init_convert_line_spline(void *obj, int type, int x, int y, ...)
{
- (void)x; (void)y; (void)px; (void)py;
+ (void)x; (void)y;
static int flag = 0;
switch (type) {
case O_POLYLINE:
- cur_l = (F_line *) p;
+ cur_l = (F_line *) obj;
/* the search routine will ensure that we don't have a box */
if (cur_l->type == T_POLYLINE || cur_l->type == T_POLYGON) {
line_spline(cur_l, cur_l->type == T_POLYGON ?
@@ -105,7 +112,7 @@ init_convert_line_spline(F_line *p, int
}
break;
case O_SPLINE:
- cur_s = (F_spline *) p;
+ cur_s = (F_spline *) obj;
flag = (cur_s->type==T_OPEN_INTERP) || (cur_s->type==T_CLOSED_INTERP);
spline_line(cur_s);
break;
--- a/src/e_copy.c
+++ b/src/e_copy.c
@@ -39,12 +39,10 @@
#include "w_msgpanel.h"
/* local routine declarations */
-static void init_copy(F_line *p, int type, int x, int y, int px, int py);
-static void init_arb_copy(F_line *p, int type, int x, int y, int px,int py);
-static void init_constrained_copy(F_line *p, int type, int x, int y, int px,
- int py);
-static void init_copy_to_scrap(F_line *p, int type, int x, int y, int px,
- int py);
+static void init_copy(void *obj, int type, int x, int y, int px, int py);
+static void init_arb_copy(void *obj, int type, int x, int y, ...);
+static void init_constrained_copy(void *obj, int type, int x, int y, ...);
+static void init_copy_to_scrap(void *obj, int type, int x, int y, ...);
@@ -68,64 +66,82 @@ copy_selected(void)
}
static void
-init_arb_copy(F_line *p, int type, int x, int y, int px, int py)
+init_arb_copy(void *obj, int type, int x, int y, ...)
{
+ va_list args;
+ int px;
+ int py;
+
+ va_start(args, y);
+ px = va_arg(args, int);
+ py = va_arg(args, int);
+ va_end(args);
+
constrained = MOVE_ARB;
- init_copy(p, type, x, y, px, py);
+ init_copy(obj, type, x, y, px, py);
set_mousefun("place object", "array placement", "cancel",
LOC_OBJ, LOC_OBJ, LOC_OBJ);
draw_mousefun_canvas();
}
static void
-init_constrained_copy(F_line *p, int type, int x, int y, int px, int py)
+init_constrained_copy(void *obj, int type, int x, int y, ...)
{
+ va_list args;
+ int px;
+ int py;
+
+ va_start(args, y);
+ px = va_arg(args, int);
+ py = va_arg(args, int);
+ va_end(args);
+
constrained = MOVE_HORIZ_VERT;
- init_copy(p, type, x, y, px, py);
+ init_copy(obj, type, x, y, px, py);
set_mousefun("place object", "array placement", "cancel",
LOC_OBJ, LOC_OBJ, LOC_OBJ);
draw_mousefun_canvas();
}
static void
-init_copy(F_line *p, int type, int x, int y, int px, int py)
+init_copy(void *obj, int type, int x, int y, int px, int py)
{
/* turn off all markers */
update_markers(0);
switch (type) {
case O_COMPOUND:
set_cursor(null_cursor);
- cur_c = (F_compound *) p;
+ cur_c = (F_compound *) obj;
new_c = copy_compound(cur_c);
init_compounddragging(new_c, px, py);
break;
case O_POLYLINE:
set_cursor(null_cursor);
- cur_l = (F_line *) p;
+ cur_l = (F_line *) obj;
new_l = copy_line(cur_l);
init_linedragging(new_l, px, py);
break;
case O_TXT:
set_cursor(null_cursor);
- cur_t = (F_text *) p;
+ cur_t = (F_text *) obj;
new_t = copy_text(cur_t);
init_textdragging(new_t, x, y);
break;
case O_ELLIPSE:
set_cursor(null_cursor);
- cur_e = (F_ellipse *) p;
+ cur_e = (F_ellipse *) obj;
new_e = copy_ellipse(cur_e);
init_ellipsedragging(new_e, px, py);
break;
case O_ARC:
set_cursor(null_cursor);
- cur_a = (F_arc *) p;
+ cur_a = (F_arc *) obj;
new_a = copy_arc(cur_a);
init_arcdragging(new_a, px, py);
break;
case O_SPLINE:
set_cursor(null_cursor);
- cur_s = (F_spline *) p;
+ cur_s = (F_spline *) obj;
new_s = copy_spline(cur_s);
init_splinedragging(new_s, px, py);
break;
@@ -135,9 +151,9 @@ init_copy(F_line *p, int type, int x, in
}
static void
-init_copy_to_scrap(F_line *p, int type, int x, int y, int px, int py)
+init_copy_to_scrap(void *obj, int type, int x, int y, ...)
{
- (void)x; (void)y; (void)px; (void)py;
+ (void)x; (void)y;
FILE *fp;
FILE *open_cut_file(void);
@@ -149,27 +165,27 @@ init_copy_to_scrap(F_line *p, int type,
switch (type) {
case O_COMPOUND:
- cur_c = (F_compound *) p;
+ cur_c = (F_compound *)obj;
write_compound(fp, cur_c);
break;
case O_ARC:
- cur_a = (F_arc *) p;
+ cur_a = (F_arc *)obj;
write_arc(fp, cur_a);
break;
case O_ELLIPSE:
- cur_e = (F_ellipse *) p;
+ cur_e = (F_ellipse *)obj;
write_ellipse(fp, cur_e);
break;
case O_POLYLINE:
- cur_l = (F_line *) p;
+ cur_l = (F_line *)obj;
write_line(fp, cur_l);
break;
case O_TXT:
- cur_t = (F_text *) p;
+ cur_t = (F_text *)obj;
write_text(fp, cur_t);
break;
case O_SPLINE:
- cur_s = (F_spline *) p;
+ cur_s = (F_spline *)obj;
write_spline(fp, cur_s);
break;
default:
--- a/src/e_delete.c
+++ b/src/e_delete.c
@@ -52,11 +52,11 @@
#include "xfig_math.h"
-static void init_delete(F_line *p, int type, int x, int y, int px, int py);
+static void init_delete(void *obj, int type, int x, int y, ...);
static void init_delete_region(int x, int y, unsigned int shift);
static void delete_region(int x, int y, unsigned int shift);
static void cancel_delete_region(int x, int y, unsigned int shift);
-static void init_delete_to_scrap(F_line *p, int type, int x, int y, int px, int py);
+static void init_delete_to_scrap(void *obj, int type, int x, int y, ...);
@@ -78,38 +78,38 @@ delete_selected(void)
}
static void
-init_delete(F_line *p, int type, int x, int y, int px, int py)
+init_delete(void *obj, int type, int x, int y, ...)
{
- (void)x; (void)y; (void)px; (void)py;
+ (void)x; (void)y;
switch (type) {
case O_COMPOUND:
- cur_c = (F_compound *) p;
+ cur_c = (F_compound *) obj;
delete_compound(cur_c);
redisplay_compound(cur_c);
break;
case O_POLYLINE:
- cur_l = (F_line *) p;
+ cur_l = (F_line *) obj;
delete_line(cur_l);
redisplay_line(cur_l);
break;
case O_TXT:
- cur_t = (F_text *) p;
+ cur_t = (F_text *) obj;
delete_text(cur_t);
redisplay_text(cur_t);
break;
case O_ELLIPSE:
- cur_e = (F_ellipse *) p;
+ cur_e = (F_ellipse *) obj;
delete_ellipse(cur_e);
redisplay_ellipse(cur_e);
break;
case O_ARC:
- cur_a = (F_arc *) p;
+ cur_a = (F_arc *) obj;
delete_arc(cur_a);
redisplay_arc(cur_a);
break;
case O_SPLINE:
- cur_s = (F_spline *) p;
+ cur_s = (F_spline *) obj;
delete_spline(cur_s);
redisplay_spline(cur_s);
break;
@@ -184,9 +184,9 @@ delete_region(int x, int y, unsigned int
}
static void
-init_delete_to_scrap(F_line *p, int type, int x, int y, int px, int py)
+init_delete_to_scrap(void *obj, int type, int x, int y, ...)
{
- (void)x; (void)y; (void)px; (void)py;
+ (void)x; (void)y;
FILE *fp;
FILE *open_cut_file(void);
@@ -198,37 +198,37 @@ init_delete_to_scrap(F_line *p, int type
switch (type) {
case O_COMPOUND:
- cur_c = (F_compound *) p;
+ cur_c = (F_compound *)obj;
write_compound(fp, cur_c);
delete_compound(cur_c);
redisplay_compound(cur_c);
break;
case O_POLYLINE:
- cur_l = (F_line *) p;
+ cur_l = (F_line *)obj;
write_line(fp, cur_l);
delete_line(cur_l);
redisplay_line(cur_l);
break;
case O_TXT:
- cur_t = (F_text *) p;
+ cur_t = (F_text *)obj;
write_text(fp, cur_t);
delete_text(cur_t);
redisplay_text(cur_t);
break;
case O_ELLIPSE:
- cur_e = (F_ellipse *) p;
+ cur_e = (F_ellipse *)obj;
write_ellipse(fp, cur_e);
delete_ellipse(cur_e);
redisplay_ellipse(cur_e);
break;
case O_ARC:
- cur_a = (F_arc *) p;
+ cur_a = (F_arc *)obj;
write_arc(fp, cur_a);
delete_arc(cur_a);
redisplay_arc(cur_a);
break;
case O_SPLINE:
- cur_s = (F_spline *) p;
+ cur_s = (F_spline *)obj;
write_spline(fp, cur_s);
delete_spline(cur_s);
redisplay_spline(cur_s);
--- a/src/e_deletept.c
+++ b/src/e_deletept.c
@@ -18,6 +18,7 @@
#include "e_deletept.h"
+#include <stdarg.h>
#include <stddef.h>
#include "resources.h"
@@ -37,8 +38,7 @@
#include "w_msgpanel.h"
-static void init_delete_point(F_line *obj, int type, int x, int y,
- F_point *p, F_point *q);
+static void init_delete_point(void *obj, int type, int x, int y, ...);
void
@@ -57,12 +57,21 @@ delete_point_selected(void)
}
static void
-init_delete_point(F_line *obj, int type, int x, int y, F_point *p, F_point *q)
+init_delete_point(void *obj, int type, int x, int y, ...)
{
(void)x;
(void)y;
+
+ va_list args;
+ F_point *p;
+ F_point *q;
int n;
+ va_start(args, y);
+ p = va_arg(args, F_point*);
+ q = va_arg(args, F_point*);
+ va_end(args);
+
switch (type) {
case O_POLYLINE:
cur_l = (F_line *) obj;
--- a/src/e_edit.c
+++ b/src/e_edit.c
@@ -27,6 +27,7 @@
#include <errno.h>
#include <math.h>
+#include <stdarg.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@@ -678,8 +679,7 @@ void get_generic_arrows(F_line *x)
}
}
-static void edit_spline_point(F_spline *spline, int type, int x, int y,
- F_point *previous_point, F_point *the_point);
+static void edit_spline_point(void *obj, int type, int x, int y, ...);
static void edit_figure_comments(int x, int y, unsigned int shift);
void edit_item_selected(void)
@@ -703,7 +703,7 @@ void edit_item_selected(void)
editing of the whole figure comments (shift=0)
*/
-static void popup_show_comments(F_line *p, int type, int x, int y);
+static void popup_show_comments(void *obj, int type, int x, int y, ...);
static void /* Shift Key Status from XEvent */
edit_figure_comments(int x, int y, unsigned int shift)
@@ -721,7 +721,7 @@ edit_figure_comments(int x, int y, unsig
}
static void
-popup_show_comments(F_line *p, int type, int x, int y)
+popup_show_comments(void *obj, int type, int x, int y, ...)
{
Widget form;
static Boolean actions_added = False;
@@ -735,27 +735,27 @@ popup_show_comments(F_line *p, int type,
switch (type) {
case O_ARC:
- a = (F_arc *)p;
+ a = (F_arc *)obj;
comments = a->comments;
break;
case O_COMPOUND:
- c = (F_compound *)p;
+ c = (F_compound *)obj;
comments = c->comments;
break;
case O_ELLIPSE:
- e = (F_ellipse *)p;
+ e = (F_ellipse *)obj;
comments = e->comments;
break;
case O_POLYLINE:
- l = (F_line *)p;
+ l = (F_line *)obj;
comments = l->comments;
break;
case O_SPLINE:
- s = (F_spline *)p;
+ s = (F_spline *)obj;
comments = s->comments;
break;
case O_TXT:
- t = (F_text *)p;
+ t = (F_text *)obj;
comments = t->comments;
break;
} /* switch */
@@ -818,7 +818,7 @@ popdown_comments(void)
}
void
-edit_item(void *p, int type, int x, int y)
+edit_item(void *obj, int type, int x, int y, ...)
{
XtWidgetGeometry xtgeom,comp;
int llx, lly, urx, ury;
@@ -855,37 +855,37 @@ edit_item(void *p, int type, int x, int
/* get the bounds of the object to position the popup away from it */
switch (type) {
case O_POLYLINE:
- line_bound((F_line *)p, &llx, &lly, &urx, &ury);
- make_window_line((F_line *)p);
+ line_bound((F_line *)obj, &llx, &lly, &urx, &ury);
+ make_window_line((F_line *)obj);
break;
case O_TXT:
- text_bound((F_text *)p, &llx, &lly, &urx, &ury);
- make_window_text((F_text *)p);
+ text_bound((F_text *)obj, &llx, &lly, &urx, &ury);
+ make_window_text((F_text *)obj);
break;
case O_ELLIPSE:
- ellipse_bound((F_ellipse *)p, &llx, &lly, &urx, &ury);
- make_window_ellipse((F_ellipse *)p);
+ ellipse_bound((F_ellipse *)obj, &llx, &lly, &urx, &ury);
+ make_window_ellipse((F_ellipse *)obj);
break;
case O_ARC:
- arc_bound((F_arc *)p, &llx, &lly, &urx, &ury);
- make_window_arc((F_arc *)p);
+ arc_bound((F_arc *)obj, &llx, &lly, &urx, &ury);
+ make_window_arc((F_arc *)obj);
break;
case O_SPLINE:
- spline_bound((F_spline *)p, &llx, &lly, &urx, &ury);
- make_window_spline((F_spline *)p);
+ spline_bound((F_spline *)obj, &llx, &lly, &urx, &ury);
+ make_window_spline((F_spline *)obj);
break;
case O_COMPOUND:
/* make compound_bound() get boundaries in the current point
positioning mode, do not create a tight bounding box */
anypointposn = 0;
- compound_bound((F_compound *) p, &llx, &lly, &urx, &ury);
+ compound_bound((F_compound *) obj, &llx, &lly, &urx, &ury);
/* turn on the point positioning indicator since it is used
for editing compound */
update_indpanel(I_MIN2);
- make_window_compound((F_compound *)p);
+ make_window_compound((F_compound *)obj);
break;
case O_FIGURE:
- compound_bound((F_compound *)p, &llx, &lly, &urx, &ury);
+ compound_bound((F_compound *)obj, &llx, &lly, &urx, &ury);
make_window_figure();
break;
}
@@ -968,12 +968,21 @@ reread_picfile(Widget panel_local, XtPoi
static void
-edit_spline_point(F_spline *spline, int type, int x, int y,
- F_point *previous_point, F_point *the_point)
+edit_spline_point(void *obj, int type, int x, int y, ...)
{
(void)x;
(void)y;
+ va_list args;
+ F_point *previous_point;
+ F_point *the_point;
+ F_spline *spline = obj;
+
+ va_start(args, y);
+ previous_point = va_arg(args, F_point*);
+ the_point = va_arg(args, F_point*);
+ va_end(args);
+
if (type!=O_SPLINE) {
put_msg("Only spline points can be edited");
return;
--- a/src/e_edit.h
+++ b/src/e_edit.h
@@ -34,7 +34,7 @@ extern Widget color_selection_panel(char
Widget *button, Widget *popup,
int color, XtCallbackProc callback);
extern void color_select(Widget w, Color color);
-extern void edit_item (void *p, int type, int x, int y);
+extern void edit_item (void *p, int type, int x, int y, ...);
extern void edit_item_selected (void);
extern void push_apply_button (void);
--- a/src/e_flip.c
+++ b/src/e_flip.c
@@ -19,6 +19,7 @@
#include "e_flip.h"
#include <math.h>
+#include <stdarg.h>
#include <stddef.h>
#include "resources.h"
@@ -49,8 +50,8 @@ int setanchor_y;
static int flip_axis;
static int copy;
-static void init_flip(F_line *p, int type, int x, int y, int px, int py);
-static void init_copynflip(F_line *p, int type, int x,int y, int px,int py);
+static void init_flip(void *p, int type, int x, int y, ...);
+static void init_copynflip(void *p, int type, int x, int y, ...);
static void set_unset_anchor(int x, int y, unsigned int shift);
static void init_fliparc(F_arc *old_a, int px, int py);
static void init_flipcompound(F_compound *old_c, int px, int py);
@@ -58,7 +59,7 @@ static void init_flipellipse(F_ellipse *
static void init_flipline(F_line *old_l, int px, int py);
static void init_flipspline(F_spline *old_s, int px, int py);
static void flip_selected(void);
-static void flip_search(F_line *p, int type, int x, int y, int px, int py);
+static void flip_search(void *obj, int type, int x, int y, int px, int py);
static void flip_arc (F_arc *a, int x, int y, int flip_axis);
static void flip_ellipse (F_ellipse *e, int x, int y, int flip_axis);
static void flip_line (F_line *l, int x, int y, int flip_axis);
@@ -139,52 +140,70 @@ set_unset_anchor(int x, int y, unsigned
}
static void
-init_flip(F_line *p, int type, int x, int y, int px, int py)
+init_flip(void *obj, int type, int x, int y, ...)
{
+ va_list args;
+ int px;
+ int py;
+
+ va_start(args, y);
+ px = va_arg(args, int);
+ py = va_arg(args, int);
+ va_end(args);
+
copy = 0;
if (setanchor)
- flip_search(p, type, x, y,setanchor_x,setanchor_y );
+ flip_search(obj, type, x, y,setanchor_x,setanchor_y );
/* remember rotation center, e.g for multiple rotation*/
else
- flip_search(p, type, x, y, px, py);
+ flip_search(obj, type, x, y, px, py);
}
static void
-init_copynflip(F_line *p, int type, int x, int y, int px, int py)
+init_copynflip(void *obj, int type, int x, int y, ...)
{
+ va_list args;
+ int px;
+ int py;
+
+ va_start(args, y);
+ px = va_arg(args, int);
+ py = va_arg(args, int);
+ va_end(args);
+
copy = 1;
if (setanchor)
- flip_search(p, type, x, y,setanchor_x,setanchor_y );
+ flip_search(obj, type, x, y,setanchor_x,setanchor_y );
/* remember rotation center, e.g for multiple rotation*/
else
- flip_search(p, type, x, y, px, py);
+ flip_search(obj, type, x, y, px, py);
}
static void
-flip_search(F_line *p, int type, int x, int y, int px, int py)
+flip_search(void *obj, int type, int x, int y, int px, int py)
{
(void)x;
(void)y;
switch (type) {
case O_POLYLINE:
- cur_l = (F_line *) p;
+ cur_l = (F_line *) obj;
init_flipline(cur_l, px, py);
break;
case O_ARC:
- cur_a = (F_arc *) p;
+ cur_a = (F_arc *) obj;
init_fliparc(cur_a, px, py);
break;
case O_ELLIPSE:
- cur_e = (F_ellipse *) p;
+ cur_e = (F_ellipse *) obj;
init_flipellipse(cur_e, px, py);
break;
case O_SPLINE:
- cur_s = (F_spline *) p;
+ cur_s = (F_spline *) obj;
init_flipspline(cur_s, px, py);
break;
case O_COMPOUND:
- cur_c = (F_compound *) p;
+ cur_c = (F_compound *) obj;
init_flipcompound(cur_c, px, py);
break;
default:
--- a/src/e_glue.c
+++ b/src/e_glue.c
@@ -45,7 +45,7 @@ static void create_compoundobject(int x,
static void cancel_tag_region(int x, int y, unsigned int shift);
static void init_tag_region(int x, int y, unsigned int shift);
static void tag_region(int x, int y, unsigned int shift);
-static void tag_object(F_line *p, int type, int x, int y, int px, int py);
+static void tag_object(void *obj, int type, int x, int y, ...);
static void get_arc(F_arc **list);
static void sel_arc(int xmin, int ymin, int xmax, int ymax);
static void get_compound(F_compound **list);
@@ -77,38 +77,38 @@ compound_selected(void)
}
static void
-tag_object(F_line *p, int type, int x, int y, int px, int py)
+tag_object(void *obj, int type, int x, int y, ...)
{
- (void)x; (void)y; (void)px; (void)py;
+ (void)x; (void)y;
switch (type) {
case O_COMPOUND:
- cur_c = (F_compound *) p;
+ cur_c = (F_compound *) obj;
toggle_compoundhighlight(cur_c);
cur_c->tagged = 1 - cur_c->tagged;
break;
case O_POLYLINE:
- cur_l = (F_line *) p;
+ cur_l = (F_line *) obj;
toggle_linehighlight(cur_l);
cur_l->tagged = 1 - cur_l->tagged;
break;
case O_TXT:
- cur_t = (F_text *) p;
+ cur_t = (F_text *) obj;
toggle_texthighlight(cur_t);
cur_t->tagged = 1 - cur_t->tagged;
break;
case O_ELLIPSE:
- cur_e = (F_ellipse *) p;
+ cur_e = (F_ellipse *) obj;
toggle_ellipsehighlight(cur_e);
cur_e->tagged = 1 - cur_e->tagged;
break;
case O_ARC:
- cur_a = (F_arc *) p;
+ cur_a = (F_arc *) obj;
toggle_archighlight(cur_a);
cur_a->tagged = 1 - cur_a->tagged;
break;
case O_SPLINE:
- cur_s = (F_spline *) p;
+ cur_s = (F_spline *) obj;
toggle_splinehighlight(cur_s);
cur_s->tagged = 1 - cur_s->tagged;
break;
--- a/src/e_joinsplit.c
+++ b/src/e_joinsplit.c
@@ -17,6 +17,7 @@
#include "e_joinsplit.h"
+#include <stdarg.h>
#include <stdlib.h>
#include <X11/Intrinsic.h> /* includes X11/Xlib.h */
@@ -41,9 +42,8 @@
#include "w_msgpanel.h"
-static void init_join(F_line *obj, int type, int x, int y, F_point *p,
- F_point *q);
-static void init_split(F_line *obj, int type, int x, int y, int px, int py);
+static void init_join(void *obj, int type, int x, int y, ...);
+static void init_split(void *obj, int type, int x, int y, ...);
static void join_lines(F_line *line, F_point *prev_point,
F_point *selected_point);
static void join_splines(F_spline *spline, F_point *prev_point,
@@ -51,10 +51,8 @@ static void join_splines(F_spline *splin
static void split_line(int px, int py);
static void split_spline(int px, int py);
static void cancel_join(int x, int y, unsigned int shift);
-static void join_line2(F_line *obj, int type, int x, int y, F_point *p,
- F_point *q);
-static void join_spline2(F_line *obj, int type, int x, int y, F_point *p,
- F_point *q);
+static void join_line2(void *obj, int type, int x, int y, ...);
+static void join_spline2(void *obj, int type, int x, int y, ...);
static Boolean connect_line_points(F_line *line1, Boolean first1,
F_line *line2, Boolean first2, F_line *new_line);
static Boolean connect_spline_points(F_spline *spline1, Boolean first1,
@@ -90,11 +88,20 @@ join_split_selected(void)
}
static void
-init_join(F_line *obj, int type, int x, int y, F_point *p, F_point *q)
+init_join(void *obj, int type, int x, int y, ...)
{
(void)x;
(void)y;
+ va_list args;
+ F_point *p;
+ F_point *q;
+
+ va_start(args, y);
+ p = va_arg(args, F_point*);
+ q = va_arg(args, F_point*);
+ va_end(args);
+
switch (type) {
case O_POLYLINE:
cur_l = (F_line *) obj;
@@ -110,11 +117,20 @@ init_join(F_line *obj, int type, int x,
}
static void
-init_split(F_line *obj, int type, int x, int y, int px, int py)
+init_split(void *obj, int type, int x, int y, ...)
{
(void)x;
(void)y;
+ va_list args;
+ int px;
+ int py;
+
+ va_start(args, y);
+ px = va_arg(args, int);
+ py = va_arg(args, int);
+ va_end(args);
+
switch (type) {
case O_POLYLINE:
cur_l = (F_line *) obj;
@@ -227,13 +243,22 @@ cancel_join(int x, int y, unsigned int s
}
static void
-join_line2(F_line *obj, int type, int x, int y, F_point *p, F_point *q)
+join_line2(void *obj, int type, int x, int y, ...)
{
(void)x;
(void)y;
+
+ va_list args;
+ F_point *p;
+ F_point *q;
F_line *line;
F_point *lastp;
+ va_start(args, y);
+ p = va_arg(args, F_point*);
+ q = va_arg(args, F_point*);
+ va_end(args);
+
if (type != O_POLYLINE)
return;
/* only continue if the user has selected an end point */
@@ -276,19 +301,28 @@ join_line2(F_line *obj, int type, int x,
}
static void
-join_spline2(F_line *obj, int type, int x, int y, F_point *p, F_point *q)
+join_spline2(void *obj, int type, int x, int y, ...)
{
(void)x;
(void)y;
+
+ va_list args;
+ F_point *p;
+ F_point *q;
F_spline *spline;
+ va_start(args, y);
+ p = va_arg(args, F_point*);
+ q = va_arg(args, F_point*);
+ va_end(args);
+
if (type != O_SPLINE)
return;
/* only continue if the user has selected an end point */
if (p != NULL && q->next != NULL)
return;
spline = (F_spline *) obj;
- first2 = (q == obj->points);
+ first2 = (q == spline->points);
new_s = copy_spline(spline1);
/* if user clicked on both endpoints of a spline, make it a closed SPLINE */
if (spline == spline1) {
--- a/src/e_measure.c
+++ b/src/e_measure.c
@@ -40,9 +40,9 @@
/* Measuring angles, lengths and areas */
-static void init_anglemeas_object(char *p, int type, int x, int y, F_point *pp, F_point *pq);
-static void init_anglemeas_object_m(char *p, int type, int x, int y, F_point *pp, F_point *pq);
-static void init_anglemeas_object_r(char *p, int type, int x, int y, F_point *pp, F_point *pq);
+static void init_anglemeas_object(void *p, int type, F_point *pq);
+static void init_anglemeas_object_m(void *p, int type, int x, int y, ...);
+static void init_anglemeas_object_r(void *p, int type, int x, int y, ...);
static void init_anglemeas_threepoints(int px, int py, unsigned int shift);
static void anglemeas_second(int x, int y, unsigned int shift);
@@ -55,14 +55,14 @@ static void anglemeas_arc(F_arc *a);
static void angle_msg(double value, char *msgtext);
static void angle_save(double value);
-static void init_lenmeas_object(char *p, int type, int x, int y, int px, int py);
-static void init_lenmeas_object_l(char *p, int type, int x, int y, int px, int py);
-static void init_lenmeas_object_m(char *p, int type, int x, int y, int px, int py);
+static void init_lenmeas_object(void *obj, int type);
+static void init_lenmeas_object_l(void *obj, int type, int x, int y, ...);
+static void init_lenmeas_object_m(void *obj, int type, int x, int y, ...);
static void clear_lenmeas_memory(int x, int y, unsigned int shift);
-static void init_areameas_object(char *p, int type, int x, int y, int px, int py);
-static void init_areameas_object_l(char *p, int type, int x, int y, int px, int py);
-static void init_areameas_object_m(char *p, int type, int x, int y, int px, int py);
+static void init_areameas_object(void *obj, int type);
+static void init_areameas_object_l(void *obj, int type, int x, int y, ...);
+static void init_areameas_object_m(void *obj, int type, int x, int y, ...);
static void clear_areameas_memory(int x, int y, unsigned int shift);
static void freehand_line_nomsg(int x, int y);
@@ -122,33 +122,53 @@ angle_save(double value)
/* OBJECT ANGLE MEASURING */
static void
-init_anglemeas_object_m(char *p, int type, int x, int y, F_point *pp, F_point *pq)
+init_anglemeas_object_m(void *obj, int type, int x, int y, ...)
{
+ (void)x;
+ (void)y;
+
+ va_list args;
+ F_point *pp;
+ F_point *pq;
+
+ va_start(args, y);
+ pp = va_arg(args, F_point*);
+ pq = va_arg(args, F_point*);
+ va_end(args);
+
save_rotnangle = 1;
- init_anglemeas_object(p, type, x, y, pp, pq);
+ init_anglemeas_object(obj, type, pq);
}
static void
-init_anglemeas_object_r(char *p, int type, int x, int y, F_point *pp, F_point *pq)
+init_anglemeas_object_r(void *obj, int type, int x, int y, ...)
{
+ (void)x;
+ (void)y;
+
+ va_list args;
+ F_point *pp;
+ F_point *pq;
+
+ va_start(args, y);
+ pp = va_arg(args, F_point*);
+ pq = va_arg(args, F_point*);
+ va_end(args);
+
save_rotnangle = 0;
- init_anglemeas_object(p, type, x, y, pp, pq);
+ init_anglemeas_object(obj, type, pq);
}
static void
-init_anglemeas_object(char *p, int type, int x, int y, F_point *pp, F_point *pq)
+init_anglemeas_object(void *obj, int type, F_point *pq)
{
- (void)x;
- (void)y;
- (void)pp;
-
switch(type) {
case O_POLYLINE:
- cur_l = (F_line*)p;
+ cur_l = (F_line*)obj;
anglemeas_line(cur_l, pq); /* do_point_search returns `near' point in *q */
break;
case O_ARC:
- cur_a = (F_arc*)p;
+ cur_a = (F_arc*)obj;
anglemeas_arc(cur_a); /* point doesn't matter */
break;
default:
@@ -328,9 +348,8 @@ void lenmeas_selected(void)
}
static void
-init_lenmeas_object(char *p, int type, int x, int y, int px, int py)
+init_lenmeas_object(void *obj, int type)
{
- (void)x; (void)y; (void)px; (void)py;
float len;
double a,b,z;
int ok;
@@ -340,7 +359,7 @@ init_lenmeas_object(char *p, int type, i
switch (type) {
case O_POLYLINE:
- cur_l = (F_line*) p;
+ cur_l = (F_line*) obj;
(void) compute_poly_length(cur_l, &len);
if (cur_l->type == T_BOX || cur_l->type == T_PICTURE)
msgtext = "box";
@@ -356,7 +375,7 @@ init_lenmeas_object(char *p, int type, i
break;
case O_ARC:
- cur_a = (F_arc*) p;
+ cur_a = (F_arc*) obj;
if (compute_arc_length(cur_a, &len)) {
msgtext = "arc";
ok = 1;
@@ -364,7 +383,7 @@ init_lenmeas_object(char *p, int type, i
break;
case O_ELLIPSE:
- cur_e = (F_ellipse*) p;
+ cur_e = (F_ellipse*) obj;
/* ellipse or circle? */
if (cur_e->radiuses.x == cur_e->radiuses.y) {
msgtext = "circle";
@@ -395,17 +414,23 @@ init_lenmeas_object(char *p, int type, i
}
static void
-init_lenmeas_object_l(char *p, int type, int x, int y, int px, int py)
+init_lenmeas_object_l(void *obj, int type, int x, int y, ...)
{
+ (void)x;
+ (void)y;
+
save_len = 0;
- init_lenmeas_object(p, type, x, y, px, py);
+ init_lenmeas_object(obj, type);
}
static void
-init_lenmeas_object_m(char *p, int type, int x, int y, int px, int py)
+init_lenmeas_object_m(void *obj, int type, int x, int y, ...)
{
+ (void)x;
+ (void)y;
+
save_len = 1;
- init_lenmeas_object(p, type, x, y, px, py);
+ init_lenmeas_object(obj, type);
}
static void
@@ -441,9 +466,8 @@ void areameas_selected(void)
static void
-init_areameas_object(char *p, int type, int x, int y, int px, int py)
+init_areameas_object(void *obj, int type)
{
- (void)x; (void)y; (void)px; (void)py;
float area;
int ok;
char *msgtext;
@@ -452,7 +476,7 @@ init_areameas_object(char *p, int type,
switch (type) {
case O_POLYLINE:
- cur_l = (F_line*) p;
+ cur_l = (F_line*) obj;
if (1) {
compute_poly_area(cur_l, &area);
if (cur_l->type == T_BOX)
@@ -469,7 +493,7 @@ init_areameas_object(char *p, int type,
break;
case O_ARC:
- cur_a = (F_arc*) p;
+ cur_a = (F_arc*) obj;
if (compute_arc_area(cur_a, &area)) {
if (cur_a->type == T_OPEN_ARC)
msgtext = "open arc";
@@ -480,7 +504,7 @@ init_areameas_object(char *p, int type,
break;
case O_ELLIPSE:
- cur_e = (F_ellipse*) p;
+ cur_e = (F_ellipse*) obj;
if (compute_ellipse_area(cur_e, &area)) {
msgtext = "ellipse";
ok = 1;
@@ -503,17 +527,23 @@ init_areameas_object(char *p, int type,
}
static void
-init_areameas_object_l(char *p, int type, int x, int y, int px, int py)
+init_areameas_object_l(void *obj, int type, int x, int y, ...)
{
+ (void)x;
+ (void)y;
+
save_area = 0;
- init_areameas_object(p, type, x, y, px, py);
+ init_areameas_object(obj, type);
}
static void
-init_areameas_object_m(char *p, int type, int x, int y, int px, int py)
+init_areameas_object_m(void *obj, int type, int x, int y, ...)
{
+ (void)x;
+ (void)y;
+
save_area = 1;
- init_areameas_object(p, type, x, y, px, py);
+ init_areameas_object(obj, type);
}
static void
--- a/src/e_move.c
+++ b/src/e_move.c
@@ -16,6 +16,8 @@
*
*/
+#include <stdarg.h>
+
#include "e_move.h"
#include "resources.h"
@@ -32,10 +34,9 @@
#include "w_mousefun.h"
-static void init_move(F_line *p, int type, int x, int y, int px, int py);
-static void init_arb_move(F_line *p, int type, int x, int y, int px,int py);
-static void init_constrained_move(F_line *p, int type, int x, int y, int px,
- int py);
+static void init_move(void *obj, int type, int x, int y, int px, int py);
+static void init_arb_move(void *obj, int type, int x, int y, ...);
+static void init_constrained_move(void *obj, int type, int x, int y, ...);
void
@@ -55,20 +56,38 @@ move_selected(void)
}
static void
-init_arb_move(F_line *p, int type, int x, int y, int px, int py)
+init_arb_move(void *obj, int type, int x, int y, ...)
{
+ va_list args;
+ int px;
+ int py;
+
+ va_start(args, y);
+ px = va_arg(args, int);
+ py = va_arg(args, int);
+ va_end(args);
+
constrained = MOVE_ARB;
- init_move(p, type, x, y, px, py);
+ init_move(obj, type, x, y, px, py);
canvas_middlebut_proc = null_proc_button;
set_mousefun("place object", "", "cancel", LOC_OBJ, LOC_OBJ, LOC_OBJ);
draw_mousefun_canvas();
}
static void
-init_constrained_move(F_line *p, int type, int x, int y, int px, int py)
+init_constrained_move(void *obj, int type, int x, int y, ...)
{
+ va_list args;
+ int px;
+ int py;
+
+ va_start(args, y);
+ px = va_arg(args, int);
+ py = va_arg(args, int);
+ va_end(args);
+
constrained = MOVE_HORIZ_VERT;
- init_move(p, type, x, y, px, py);
+ init_move(obj, type, x, y, px, py);
canvas_middlebut_proc = canvas_leftbut_proc;
canvas_leftbut_proc = null_proc_button;
set_mousefun("", "place object", "cancel", LOC_OBJ, LOC_OBJ, LOC_OBJ);
@@ -76,14 +95,14 @@ init_constrained_move(F_line *p, int typ
}
static void
-init_move(F_line *p, int type, int x, int y, int px, int py)
+init_move(void *obj, int type, int x, int y, int px, int py)
{
/* turn off all markers */
update_markers(0);
switch (type) {
case O_COMPOUND:
set_cursor(wait_cursor);
- cur_c = (F_compound *) p;
+ cur_c = (F_compound *) obj;
list_delete_compound(&objects.compounds, cur_c);
redisplay_compound(cur_c);
set_cursor(null_cursor);
@@ -91,7 +110,7 @@ init_move(F_line *p, int type, int x, in
break;
case O_POLYLINE:
set_cursor(wait_cursor);
- cur_l = (F_line *) p;
+ cur_l = (F_line *) obj;
list_delete_line(&objects.lines, cur_l);
redisplay_line(cur_l);
set_cursor(null_cursor);
@@ -99,7 +118,7 @@ init_move(F_line *p, int type, int x, in
break;
case O_TXT:
set_cursor(wait_cursor);
- cur_t = (F_text *) p;
+ cur_t = (F_text *) obj;
list_delete_text(&objects.texts, cur_t);
redisplay_text(cur_t);
set_cursor(null_cursor);
@@ -107,7 +126,7 @@ init_move(F_line *p, int type, int x, in
break;
case O_ELLIPSE:
set_cursor(wait_cursor);
- cur_e = (F_ellipse *) p;
+ cur_e = (F_ellipse *) obj;
list_delete_ellipse(&objects.ellipses, cur_e);
redisplay_ellipse(cur_e);
set_cursor(null_cursor);
@@ -115,7 +134,7 @@ init_move(F_line *p, int type, int x, in
break;
case O_ARC:
set_cursor(wait_cursor);
- cur_a = (F_arc *) p;
+ cur_a = (F_arc *) obj;
list_delete_arc(&objects.arcs, cur_a);
redisplay_arc(cur_a);
set_cursor(null_cursor);
@@ -123,7 +142,7 @@ init_move(F_line *p, int type, int x, in
break;
case O_SPLINE:
set_cursor(wait_cursor);
- cur_s = (F_spline *) p;
+ cur_s = (F_spline *) obj;
list_delete_spline(&objects.splines, cur_s);
redisplay_spline(cur_s);
set_cursor(null_cursor);
--- a/src/e_movept.c
+++ b/src/e_movept.c
@@ -60,9 +60,9 @@ static void relocate_ellipsepoint(F_elli
static void relocate_linepoint(F_line *line, int x, int y, F_point *moved_point, F_point *left_point);
static void relocate_splinepoint(F_spline *s, int x, int y, F_point *moved_point);
-static Boolean init_move_point(F_line *obj, int type, int x, int y, F_point *p, F_point *q, int pnum);
-static void init_arb_move_point(F_line *obj, int type, int x, int y, F_point *p, F_point *q, int pnum);
-static void init_stretch_move_point(F_line *obj, int type, int x, int y, F_point *p, F_point *q, int pnum);
+static Boolean init_move_point(F_line *obj, int type, F_point *p, F_point *q, int pnum);
+static void init_arb_move_point(void *obj, int type, int x, int y, ...);
+static void init_stretch_move_point(void *obj, int type, int x, int y, ...);
static void fix_movedarcpoint(int x, int y, unsigned int shift);
static void fix_movedellipsepoint(int x, int y, unsigned int shift);
@@ -94,10 +94,24 @@ void move_point_selected(void)
}
static void
-init_arb_move_point(F_line *obj, int type, int x, int y, F_point *p, F_point *q, int pnum)
+init_arb_move_point(void *obj, int type, int x, int y, ...)
{
+ (void)x;
+ (void)y;
+
+ va_list args;
+ F_point *p;
+ F_point *q;
+ int pnum;
+
+ va_start(args, y);
+ p = va_arg(args, F_point*);
+ q = va_arg(args, F_point*);
+ pnum = va_arg(args, int);
+ va_end(args);
+
constrained = MOVE_ARB;
- if (!init_move_point(obj, type, x, y, p, q, pnum))
+ if (!init_move_point(obj, type, p, q, pnum))
return;
set_mousefun("new posn", "", "cancel", LOC_OBJ, LOC_OBJ, LOC_OBJ);
draw_mousefun_canvas();
@@ -105,10 +119,24 @@ init_arb_move_point(F_line *obj, int typ
}
static void
-init_stretch_move_point(F_line *obj, int type, int x, int y, F_point *p, F_point *q, int pnum)
+init_stretch_move_point(void *obj, int type, int x, int y, ...)
{
+ (void)x;
+ (void)y;
+
+ va_list args;
+ F_point *p;
+ F_point *q;
+ int pnum;
+
+ va_start(args, y);
+ p = va_arg(args, F_point*);
+ q = va_arg(args, F_point*);
+ pnum = va_arg(args, int);
+ va_end(args);
+
constrained = MOVE_HORIZ_VERT;
- if (!init_move_point(obj, type, x, y, p, q, pnum))
+ if (!init_move_point(obj, type, p, q, pnum))
return;
set_mousefun("", "new posn", "cancel", LOC_OBJ, LOC_OBJ, LOC_OBJ);
draw_mousefun_canvas();
@@ -117,12 +145,8 @@ init_stretch_move_point(F_line *obj, int
}
static Boolean
-init_move_point(F_line *obj, int type, int x, int y, F_point *p, F_point *q,
- int pnum)
+init_move_point(F_line *obj, int type, F_point *p, F_point *q, int pnum)
{
- (void)x;
- (void)y;
-
left_point = p;
moved_point = q;
switch (type) {
--- a/src/e_rotate.c
+++ b/src/e_rotate.c
@@ -18,6 +18,7 @@
#include "e_rotate.h"
+#include <stdarg.h>
#include <stddef.h>
#include <math.h>
@@ -54,11 +55,11 @@ float act_rotnangle;
static int copy;
-static void init_rotate(F_line *p, int type, int x, int y, int px, int py);
+static void init_rotate(void *obj, int type, int x, int y, ...);
static void set_unset_center(int x, int y, unsigned int shift);
-static void init_copynrotate(F_line *p, int type, int x,int y,int px,int py);
+static void init_copynrotate(void *obj, int type, int x, int y, ...);
static void rotate_selected(void);
-static void rotate_search(F_line *p, int type, int x, int y, int px, int py);
+static void rotate_search(F_line *p, int type, int px, int py);
static void init_rotateline(F_line *l, int px, int py);
static void init_rotatetext(F_text *t, int px, int py);
static void init_rotatearc (F_arc *a, int px, int py);
@@ -147,39 +148,59 @@ set_unset_center(int x, int y, unsigned
}
static void
-init_rotate(F_line *p, int type, int x, int y, int px, int py)
+init_rotate(void *obj, int type, int x, int y, ...)
{
+ (void)x;
+ (void)y;
+
+ va_list args;
+ int px;
+ int py;
+
+ va_start(args, y);
+ px = va_arg(args, int);
+ py = va_arg(args, int);
+ va_end(args);
+
copy = 0;
act_rotnangle = cur_rotnangle;
if (setcenter)
- rotate_search(p, type, x, y,setcenter_x,setcenter_y );
+ rotate_search(obj, type, setcenter_x,setcenter_y );
/* remember rotation center, e.g for multiple rotation*/
else
- rotate_search(p, type, x, y, px, py);
+ rotate_search(obj, type, px, py);
}
static void
-init_copynrotate(F_line *p, int type, int x, int y, int px, int py)
+init_copynrotate(void *obj, int type, int x, int y, ...)
{
+ (void)x;
+ (void)y;
+
+ va_list args;
+ int px;
+ int py;
int i;
+ va_start(args, y);
+ px = va_arg(args, int);
+ py = va_arg(args, int);
+ va_end(args);
+
copy = 1;
act_rotnangle = cur_rotnangle;
for ( i = 1; i <= cur_numcopies; act_rotnangle += cur_rotnangle, i++) {
if (setcenter)
- rotate_search(p, type, x, y,setcenter_x,setcenter_y );
+ rotate_search(obj, type, setcenter_x,setcenter_y );
/* remember rotation center */
else
- rotate_search(p, type, x, y, px, py);
+ rotate_search(obj, type, px, py);
}
}
static void
-rotate_search(F_line *p, int type, int x, int y, int px, int py)
+rotate_search(F_line *p, int type, int px, int py)
{
- (void)x;
- (void)y;
-
switch (type) {
case O_POLYLINE:
cur_l = (F_line *) p;
--- a/src/e_scale.c
+++ b/src/e_scale.c
@@ -22,6 +22,7 @@
#include "e_scale.h"
#include <math.h>
+#include <stdarg.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@@ -71,10 +72,9 @@ static void scale_text(F_text *t, float
static void scale_arrows(F_line *obj, float sx, float sy);
static void scale_arrow(F_arrow *arrow, float sx, float sy);
-static void init_box_scale(F_line *obj, int type, int x,int y,int px,int py);
+static void init_box_scale(void *obj, int type, int x, int y, ...);
static void boxrelocate_ellipsepoint(F_ellipse *ellipse, int x, int y);
-static void init_center_scale(F_line *obj, int type, int x, int y,
- int px, int py);
+static void init_center_scale(void *obj, int type, int x, int y, ...);
static void init_scale_compound(void);
static void rescale_points(F_line *obj, int x, int y);
static void relocate_ellipsepoint(F_ellipse *ellipse, int x, int y);
@@ -121,11 +121,20 @@ char *BOX_SCL_MSG = "Can't use box scale
char *BOX_SCL2_MSG = "Can't use box scale on selected object; try putting it into a compound";
static void
-init_box_scale(F_line *obj, int type, int x, int y, int px, int py)
+init_box_scale(void *obj, int type, int x, int y, ...)
{
(void)x;
(void)y;
+ va_list args;
+ int px;
+ int py;
+
+ va_start(args, y);
+ px = va_arg(args, int);
+ py = va_arg(args, int);
+ va_end(args);
+
switch (type) {
case O_POLYLINE:
cur_l = (F_line *) obj;
@@ -153,12 +162,21 @@ init_box_scale(F_line *obj, int type, in
}
static void
-init_center_scale(F_line *obj, int type, int x, int y, int px, int py)
+init_center_scale(void *obj, int type, int x, int y, ...)
{
(void)x;
(void)y;
+
+ va_list args;
+ int px;
+ int py;
double dx, dy, l;
+ va_start(args, y);
+ px = va_arg(args, int);
+ py = va_arg(args, int);
+ va_end(args);
+
cur_x = from_x = px;
cur_y = from_y = py;
constrained = BOX_SCALE;
--- a/src/e_tangent.c
+++ b/src/e_tangent.c
@@ -16,6 +16,7 @@
#include "e_tangent.h"
#include <math.h>
+#include <stdarg.h>
#include <stddef.h>
#include "resources.h"
@@ -37,10 +38,8 @@
#define ZERO_TOLERANCE 2.0
-static void init_tangent_adding(char *p, int type, int x, int y,
- int px, int py);
-static void init_normal_adding(char *p, int type, int x, int y,
- int px, int py);
+static void init_tangent_adding(void *obj, int type, int x, int y, ...);
+static void init_normal_adding(void *obj, int type, int x, int y, ...);
static void tangent_or_normal(int x, int y, int flag);
static void tangent_normal_line(int x, int y, float vx, float vy);
@@ -65,17 +64,35 @@ tangent_selected(void)
/* smart_point1, smart_point2 are two points of the tangent */
static void
-init_tangent_adding(char *p, int type, int x, int y, int px, int py)
+init_tangent_adding(void *obj, int type, int x, int y, ...)
{
- (void)p; (void)type; (void)x; (void)y;
+ (void)obj; (void)type; (void)x; (void)y;
+
+ va_list args;
+ int px;
+ int py;
+
+ va_start(args, y);
+ px = va_arg(args, int);
+ py = va_arg(args, int);
+ va_end(args);
tangent_or_normal(px, py, 0);
}
static void
-init_normal_adding(char *p, int type, int x, int y, int px, int py)
+init_normal_adding(void *obj, int type, int x, int y, ...)
{
- (void)p; (void)type; (void)x; (void)y;
+ (void)obj; (void)type; (void)x; (void)y;
+
+ va_list args;
+ int px;
+ int py;
+
+ va_start(args, y);
+ px = va_arg(args, int);
+ py = va_arg(args, int);
+ va_end(args);
tangent_or_normal(px, py, 1);
}
--- a/src/e_update.c
+++ b/src/e_update.c
@@ -55,10 +55,8 @@
static Boolean keep_depth = False;
static int delta_depth;
-static void init_update_object(F_line *p, int type, int x, int y,
- int px, int py);
-static void init_update_settings(F_line *p, int type, int x, int y,
- int px, int py);
+static void init_update_object(void *obj, int type, int x, int y, ...);
+static void init_update_settings(void *obj, int type, int x, int y, ...);
#define min(a,b) ((a)<(b)) ? (a) : (b)
@@ -140,16 +138,16 @@ get_arrow_type(F_line *object)
/* update the indicator buttons FROM the selected object */
static void
-init_update_settings(F_line *p, int type, int x, int y, int px, int py)
+init_update_settings(void *obj, int type, int x, int y, ...)
{
- (void)x; (void)y; (void)px; (void)py;
+ (void)x; (void)y;
int old_psfont_flag, new_psfont_flag;
F_line *dline, *dtick1, *dtick2, *dbox;
F_text *dtext;
switch (type) {
case O_COMPOUND:
- cur_c = (F_compound *) p;
+ cur_c = (F_compound *) obj;
/* if this is a dimension line, update the dimline settings from it */
if (dimline_components(cur_c, &dline, &dtick1, &dtick2, &dbox)) {
@@ -199,7 +197,7 @@ init_update_settings(F_line *p, int type
}
break;
case O_POLYLINE:
- cur_l = (F_line *) p;
+ cur_l = (F_line *) obj;
if (cur_l->type != T_PICTURE) {
up_part(cur_linewidth, cur_l->thickness, I_LINEWIDTH);
up_part(cur_fillstyle, cur_l->fill_style, I_FILLSTYLE);
@@ -226,7 +224,7 @@ init_update_settings(F_line *p, int type
up_part(cur_boxradius, cur_l->radius, I_BOXRADIUS);
break;
case O_TXT:
- cur_t = (F_text *) p;
+ cur_t = (F_text *) obj;
up_part(cur_textjust, cur_t->type, I_TEXTJUST);
up_part(cur_pencolor, cur_t->color, I_PEN_COLOR);
up_depth_part(cur_depth, cur_t->depth);
@@ -248,7 +246,7 @@ init_update_settings(F_line *p, int type
up_part(cur_fontsize, cur_t->size, I_FONTSIZE);
break;
case O_ELLIPSE:
- cur_e = (F_ellipse *) p;
+ cur_e = (F_ellipse *) obj;
up_part(cur_linewidth, cur_e->thickness, I_LINEWIDTH);
up_part(cur_elltextangle, cur_e->angle/M_PI*180.0, I_ELLTEXTANGLE);
up_part(cur_fillstyle, cur_e->fill_style, I_FILLSTYLE);
@@ -261,7 +259,7 @@ init_update_settings(F_line *p, int type
up_depth_part(cur_depth, cur_e->depth);
break;
case O_ARC:
- cur_a = (F_arc *) p;
+ cur_a = (F_arc *) obj;
up_part(cur_linewidth, cur_a->thickness, I_LINEWIDTH);
up_part(cur_fillstyle, cur_a->fill_style, I_FILLSTYLE);
up_part(cur_pencolor, cur_a->pen_color, I_PEN_COLOR);
@@ -281,7 +279,7 @@ init_update_settings(F_line *p, int type
up_from_arrow(cur_a->for_arrow,cur_a->thickness);
break;
case O_SPLINE:
- cur_s = (F_spline *) p;
+ cur_s = (F_spline *) obj;
up_part(cur_linewidth, cur_s->thickness, I_LINEWIDTH);
up_part(cur_fillstyle, cur_s->fill_style, I_FILLSTYLE);
up_part(cur_pencolor, cur_s->pen_color, I_PEN_COLOR);
@@ -331,9 +329,9 @@ void up_from_arrow(F_arrow *arrow, int t
/* update the selected object FROM the indicator buttons */
static void
-init_update_object(F_line *p, int type, int x, int y, int px, int py)
+init_update_object(void *obj, int type, int x, int y, ...)
{
- (void)x; (void)y; (void)px; (void)py;
+ (void)x; (void)y;
int largest;
Boolean dontupdate;
@@ -342,7 +340,7 @@ init_update_object(F_line *p, int type,
switch (type) {
case O_COMPOUND:
set_temp_cursor(wait_cursor);
- cur_c = (F_compound *) p;
+ cur_c = (F_compound *) obj;
new_c = copy_compound(cur_c);
/* keep the depths of the objects inside the compound the same
@@ -371,7 +369,7 @@ init_update_object(F_line *p, int type,
break;
case O_POLYLINE:
set_temp_cursor(wait_cursor);
- cur_l = (F_line *) p;
+ cur_l = (F_line *) obj;
new_l = copy_line(cur_l);
update_line(new_l);
change_line(cur_l, new_l);
@@ -382,7 +380,7 @@ init_update_object(F_line *p, int type,
break;
case O_TXT:
set_temp_cursor(wait_cursor);
- cur_t = (F_text *) p;
+ cur_t = (F_text *) obj;
new_t = copy_text(cur_t);
update_text(new_t);
change_text(cur_t, new_t);
@@ -391,7 +389,7 @@ init_update_object(F_line *p, int type,
break;
case O_ELLIPSE:
set_temp_cursor(wait_cursor);
- cur_e = (F_ellipse *) p;
+ cur_e = (F_ellipse *) obj;
new_e = copy_ellipse(cur_e);
update_ellipse(new_e);
change_ellipse(cur_e, new_e);
@@ -402,7 +400,7 @@ init_update_object(F_line *p, int type,
break;
case O_ARC:
set_temp_cursor(wait_cursor);
- cur_a = (F_arc *) p;
+ cur_a = (F_arc *) obj;
new_a = copy_arc(cur_a);
update_arc(new_a);
change_arc(cur_a, new_a);
@@ -413,7 +411,7 @@ init_update_object(F_line *p, int type,
break;
case O_SPLINE:
set_temp_cursor(wait_cursor);
- cur_s = (F_spline *) p;
+ cur_s = (F_spline *) obj;
new_s = copy_spline(cur_s);
update_spline(new_s);
change_spline(cur_s, new_s);
--- a/src/u_search.c
+++ b/src/u_search.c
@@ -43,10 +43,10 @@
#define TOLERANCE ((int)((display_zoomscale < 20.0? 10: 14) * \
PIX_PER_INCH/DISPLAY_PIX_PER_INCH/display_zoomscale))
-static void (*manipulate) ();
-static void (*handlerproc_left) ();
-static void (*handlerproc_middle) ();
-static void (*handlerproc_right) ();
+static void (*manipulate) (void *obj, int type, int x, int y, ...);
+static void (*handlerproc_left) (void *obj, int type, int x, int y, ...);
+static void (*handlerproc_middle) (void *obj, int type, int x, int y, ...);
+static void (*handlerproc_right) (void *obj, int type, int x, int y, ...);
static int type;
static long objectcount;
static long n;
@@ -743,19 +743,19 @@ next_compound_point_found(int x, int y,
}
void
-init_searchproc_left(void (*handlerproc) (/* ??? */))
+init_searchproc_left(void (*handlerproc) (void *obj, int type, int x, int y, ...))
{
handlerproc_left = handlerproc;
}
void
-init_searchproc_middle(void (*handlerproc) (/* ??? */))
+init_searchproc_middle(void (*handlerproc) (void *obj, int type, int x, int y, ...))
{
handlerproc_middle = handlerproc;
}
void
-init_searchproc_right(void (*handlerproc) (/* ??? */))
+init_searchproc_right(void (*handlerproc) (void *obj, int type, int x, int y, ...))
{
handlerproc_right = handlerproc;
}
--- a/src/u_search.h
+++ b/src/u_search.h
@@ -24,9 +24,9 @@
Boolean in_text_bound(F_text *t, int x, int y);
-void init_searchproc_left(void (*handlerproc) (/* ??? */));
-void init_searchproc_middle(void (*handlerproc) (/* ??? */));
-void init_searchproc_right(void (*handlerproc) (/* ??? */));
+void init_searchproc_left(void (*handlerproc) (void *obj, int type, int x, int y, ...));
+void init_searchproc_middle(void (*handlerproc) (void *obj, int type, int x, int y, ...));
+void init_searchproc_right(void (*handlerproc) (void *obj, int type, int x, int y, ...));
void point_search_left(int x, int y, unsigned int shift);
void point_search_middle(int x, int y, unsigned int shift);
--- a/src/u_smartsearch.c
+++ b/src/u_smartsearch.c
@@ -59,10 +59,10 @@ void smart_toggle_objecthighlight(void);
F_point smart_point1, smart_point2;
/* locals: */
-static void (*manipulate) ();
-static void (*handlerproc_left) ();
-static void (*handlerproc_middle) ();
-static void (*handlerproc_right) ();
+static void (*manipulate) (void *, int type, int x, int y, ...);
+static void (*handlerproc_left) (void *, int type, int x, int y, ...);
+static void (*handlerproc_middle) (void *, int type, int x, int y, ...);
+static void (*handlerproc_right) (void *, int type, int x, int y, ...);
static int type;
static long objectcount;
static long n;
@@ -82,19 +82,19 @@ static F_compound *c;
void
-init_smart_searchproc_left(void (*handlerproc) (/* ??? */))
+init_smart_searchproc_left(void (*handlerproc) (void *, int type, int x, int y, ...))
{
handlerproc_left = handlerproc;
}
void
-init_smart_searchproc_middle(void (*handlerproc) (/* ??? */))
+init_smart_searchproc_middle(void (*handlerproc) (void *, int type, int x, int y, ...))
{
handlerproc_middle = handlerproc;
}
void
-init_smart_searchproc_right(void (*handlerproc) (/* ??? */))
+init_smart_searchproc_right(void (*handlerproc) (void *, int type, int x, int y, ...))
{
handlerproc_right = handlerproc;
}
--- a/src/u_smartsearch.h
+++ b/src/u_smartsearch.h
@@ -23,9 +23,9 @@
#include "object.h"
-void init_smart_searchproc_left(void (*handlerproc) (/* ??? */));
-void init_smart_searchproc_middle(void (*handlerproc) (/* ??? */));
-void init_smart_searchproc_right(void (*handlerproc) (/* ??? */));
+void init_smart_searchproc_left(void (*handlerproc) (void *obj, int type, int x, int y, ...));
+void init_smart_searchproc_middle(void (*handlerproc) (void *obj, int type, int x, int y, ...));
+void init_smart_searchproc_right(void (*handlerproc) (void *obj, int type, int x, int y, ...));
void smart_object_search_left(int x, int y, unsigned int shift);
void smart_object_search_middle(int x, int y, unsigned int shift);
--- a/src/w_snap.c
+++ b/src/w_snap.c
@@ -1036,16 +1036,15 @@ snap_ellipse_handler(F_ellipse *e, int x
}
static void
-snap_handler(void *p, int type, int x, int y, int px, int py)
+snap_handler(void *obj, int type, int x, int y, ...)
{
- (void)px; (void)py;
static void * intersect_object_1;
static int intersect_type_1;
if (snap_mode == SNAP_MODE_INTERSECT) {
switch(intersect_state) {
case INTERSECT_INITIAL:
- intersect_object_1 = p;
+ intersect_object_1 = obj;
intersect_type_1 = type;
intersect_state = INTERSECT_FIRST_FOUND;
XtVaSetValues(snap_indicator_label, XtNlabel, "I'sect 2 " , NULL);
@@ -1053,7 +1052,7 @@ snap_handler(void *p, int type, int x, i
snap_msg_set = True;
break;
case INTERSECT_FIRST_FOUND:
- snap_intersect_handler(intersect_object_1, intersect_type_1, p, type, x, y);
+ snap_intersect_handler(intersect_object_1, intersect_type_1, obj, type, x, y);
intersect_state = INTERSECT_INITIAL;
XtVaSetValues(snap_indicator_label, XtNlabel, "Intersect" , NULL);
break;
@@ -1062,19 +1061,19 @@ snap_handler(void *p, int type, int x, i
else {
switch (type) {
case O_ELLIPSE:
- snap_ellipse_handler(p, x, y);
+ snap_ellipse_handler(obj, x, y);
break;
case O_POLYLINE:
- snap_polyline_handler(p, x, y);
+ snap_polyline_handler(obj, x, y);
break;
case O_SPLINE:
- snap_spline_handler(p, x, y);
+ snap_spline_handler(obj, x, y);
break;
case O_TXT:
- snap_text_handler(p, x, y);
+ snap_text_handler(obj, x, y);
break;
case O_ARC:
- snap_arc_handler(p, x, y);
+ snap_arc_handler(obj, x, y);
break;
}
}
|