summaryrefslogtreecommitdiffstats
path: root/windows_vnet/tools/testfiles
ModeNameSize
d---------binread42logstatsplain
d---------h5difftst44logstatsplain
d---------h5dumptst44logstatsplain
d---------h5importtst46logstatsplain
d---------h5jamtst43logstatsplain
d---------h5repacktst46logstatsplain
d---------h5repart_gentest51logstatsplain
d---------h5reparttst46logstatsplain
d---------testh5repack_detect_szip59logstatsplain
d---------testh5repack_detect_szipdll62logstatsplain
' href='#n378'>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

/* =========================== Module App =========================== */

#include "Python.h"



#include "macglue.h"
#include "pymactoolbox.h"

#ifdef WITHOUT_FRAMEWORKS
#include <Appearance.h>
#else
#include <Carbon/Carbon.h>
#endif


static PyObject *App_Error;

static PyObject *App_RegisterAppearanceClient(PyObject *_self, PyObject *_args)
{
	PyObject *_res = NULL;
	OSStatus _err;
	if (!PyArg_ParseTuple(_args, ""))
		return NULL;
	_err = RegisterAppearanceClient();
	if (_err != noErr) return PyMac_Error(_err);
	Py_INCREF(Py_None);
	_res = Py_None;
	return _res;
}

static PyObject *App_UnregisterAppearanceClient(PyObject *_self, PyObject *_args)
{
	PyObject *_res = NULL;
	OSStatus _err;
	if (!PyArg_ParseTuple(_args, ""))
		return NULL;
	_err = UnregisterAppearanceClient();
	if (_err != noErr) return PyMac_Error(_err);
	Py_INCREF(Py_None);
	_res = Py_None;
	return _res;
}

static PyObject *App_SetThemePen(PyObject *_self, PyObject *_args)
{
	PyObject *_res = NULL;
	OSStatus _err;
	ThemeBrush inBrush;
	SInt16 inDepth;
	Boolean inIsColorDevice;
	if (!PyArg_ParseTuple(_args, "hhb",
	                      &inBrush,
	                      &inDepth,
	                      &inIsColorDevice))
		return NULL;
	_err = SetThemePen(inBrush,
	                   inDepth,
	                   inIsColorDevice);
	if (_err != noErr) return PyMac_Error(_err);
	Py_INCREF(Py_None);
	_res = Py_None;
	return _res;
}

static PyObject *App_SetThemeBackground(PyObject *_self, PyObject *_args)
{
	PyObject *_res = NULL;
	OSStatus _err;
	ThemeBrush inBrush;
	SInt16 inDepth;
	Boolean inIsColorDevice;
	if (!PyArg_ParseTuple(_args, "hhb",
	                      &inBrush,
	                      &inDepth,
	                      &inIsColorDevice))
		return NULL;
	_err = SetThemeBackground(inBrush,
	                          inDepth,
	                          inIsColorDevice);
	if (_err != noErr) return PyMac_Error(_err);
	Py_INCREF(Py_None);
	_res = Py_None;
	return _res;
}

static PyObject *App_SetThemeTextColor(PyObject *_self, PyObject *_args)
{
	PyObject *_res = NULL;
	OSStatus _err;
	ThemeTextColor inColor;
	SInt16 inDepth;
	Boolean inIsColorDevice;
	if (!PyArg_ParseTuple(_args, "hhb",
	                      &inColor,
	                      &inDepth,
	                      &inIsColorDevice))
		return NULL;
	_err = SetThemeTextColor(inColor,
	                         inDepth,
	                         inIsColorDevice);
	if (_err != noErr) return PyMac_Error(_err);
	Py_INCREF(Py_None);
	_res = Py_None;
	return _res;
}

static PyObject *App_SetThemeWindowBackground(PyObject *_self, PyObject *_args)
{
	PyObject *_res = NULL;
	OSStatus _err;
	WindowPtr inWindow;
	ThemeBrush inBrush;
	Boolean inUpdate;
	if (!PyArg_ParseTuple(_args, "O&hb",
	                      WinObj_Convert, &inWindow,
	                      &inBrush,
	                      &inUpdate))
		return NULL;
	_err = SetThemeWindowBackground(inWindow,
	                                inBrush,
	                                inUpdate);
	if (_err != noErr) return PyMac_Error(_err);
	Py_INCREF(Py_None);
	_res = Py_None;
	return _res;
}

static PyObject *App_DrawThemeWindowHeader(PyObject *_self, PyObject *_args)
{
	PyObject *_res = NULL;
	OSStatus _err;
	Rect inRect;
	ThemeDrawState inState;
	if (!PyArg_ParseTuple(_args, "O&l",
	                      PyMac_GetRect, &inRect,
	                      &inState))
		return NULL;
	_err = DrawThemeWindowHeader(&inRect,
	                             inState);
	if (_err != noErr) return PyMac_Error(_err);
	Py_INCREF(Py_None);
	_res = Py_None;
	return _res;
}

static PyObject *App_DrawThemeWindowListViewHeader(PyObject *_self, PyObject *_args)
{
	PyObject *_res = NULL;
	OSStatus _err;
	Rect inRect;
	ThemeDrawState inState;
	if (!PyArg_ParseTuple(_args, "O&l",
	                      PyMac_GetRect, &inRect,
	                      &inState))
		return NULL;
	_err = DrawThemeWindowListViewHeader(&inRect,
	                                     inState);
	if (_err != noErr) return PyMac_Error(_err);
	Py_INCREF(Py_None);
	_res = Py_None;
	return _res;
}

static PyObject *App_DrawThemePlacard(PyObject *_self, PyObject *_args)
{
	PyObject *_res = NULL;
	OSStatus _err;
	Rect inRect;
	ThemeDrawState inState;
	if (!PyArg_ParseTuple(_args, "O&l",
	                      PyMac_GetRect, &inRect,
	                      &inState))
		return NULL;
	_err = DrawThemePlacard(&inRect,
	                        inState);
	if (_err != noErr) return PyMac_Error(_err);
	Py_INCREF(Py_None);
	_res = Py_None;
	return _res;
}

static PyObject *App_DrawThemeEditTextFrame(PyObject *_self, PyObject *_args)
{
	PyObject *_res = NULL;
	OSStatus _err;
	Rect inRect;
	ThemeDrawState inState;
	if (!PyArg_ParseTuple(_args, "O&l",
	                      PyMac_GetRect, &inRect,
	                      &inState))
		return NULL;
	_err = DrawThemeEditTextFrame(&inRect,
	                              inState);
	if (_err != noErr) return PyMac_Error(_err);
	Py_INCREF(Py_None);
	_res = Py_None;
	return _res;
}

static PyObject *App_DrawThemeListBoxFrame(PyObject *_self, PyObject *_args)
{
	PyObject *_res = NULL;
	OSStatus _err;
	Rect inRect;
	ThemeDrawState inState;
	if (!PyArg_ParseTuple(_args, "O&l",
	                      PyMac_GetRect, &inRect,
	                      &inState))
		return NULL;
	_err = DrawThemeListBoxFrame(&inRect,
	                             inState);
	if (_err != noErr) return PyMac_Error(_err);
	Py_INCREF(Py_None);
	_res = Py_None;
	return _res;
}

static PyObject *App_DrawThemeFocusRect(PyObject *_self, PyObject *_args)
{
	PyObject *_res = NULL;
	OSStatus _err;
	Rect inRect;
	Boolean inHasFocus;
	if (!PyArg_ParseTuple(_args, "O&b",
	                      PyMac_GetRect, &inRect,
	                      &inHasFocus))
		return NULL;
	_err = DrawThemeFocusRect(&inRect,
	                          inHasFocus);
	if (_err != noErr) return PyMac_Error(_err);
	Py_INCREF(Py_None);
	_res = Py_None;
	return _res;
}

static PyObject *App_DrawThemePrimaryGroup(PyObject *_self, PyObject *_args)
{
	PyObject *_res = NULL;
	OSStatus _err;
	Rect inRect;
	ThemeDrawState inState;
	if (!PyArg_ParseTuple(_args, "O&l",
	                      PyMac_GetRect, &inRect,
	                      &inState))
		return NULL;
	_err = DrawThemePrimaryGroup(&inRect,
	                             inState);
	if (_err != noErr) return PyMac_Error(_err);
	Py_INCREF(Py_None);
	_res = Py_None;
	return _res;
}

static PyObject *App_DrawThemeSecondaryGroup(PyObject *_self, PyObject *_args)
{
	PyObject *_res = NULL;
	OSStatus _err;
	Rect inRect;
	ThemeDrawState inState;
	if (!PyArg_ParseTuple(_args, "O&l",
	                      PyMac_GetRect, &inRect,
	                      &inState))
		return NULL;
	_err = DrawThemeSecondaryGroup(&inRect,
	                               inState);
	if (_err != noErr) return PyMac_Error(_err);
	Py_INCREF(Py_None);
	_res = Py_None;
	return _res;
}

static PyObject *App_DrawThemeSeparator(PyObject *_self, PyObject *_args)
{
	PyObject *_res = NULL;
	OSStatus _err;
	Rect inRect;
	ThemeDrawState inState;
	if (!PyArg_ParseTuple(_args, "O&l",
	                      PyMac_GetRect, &inRect,
	                      &inState))
		return NULL;
	_err = DrawThemeSeparator(&inRect,
	                          inState);
	if (_err != noErr) return PyMac_Error(_err);
	Py_INCREF(Py_None);
	_res = Py_None;
	return _res;
}

static PyObject *App_DrawThemeModelessDialogFrame(PyObject *_self, PyObject *_args)
{
	PyObject *_res = NULL;
	OSStatus _err;
	Rect inRect;
	ThemeDrawState inState;
	if (!PyArg_ParseTuple(_args, "O&l",
	                      PyMac_GetRect, &inRect,
	                      &inState))
		return NULL;
	_err = DrawThemeModelessDialogFrame(&inRect,
	                                    inState);
	if (_err != noErr) return PyMac_Error(_err);
	Py_INCREF(Py_None);
	_res = Py_None;
	return _res;
}

static PyObject *App_DrawThemeGenericWell(PyObject *_self, PyObject *_args)
{
	PyObject *_res = NULL;
	OSStatus _err;
	Rect inRect;
	ThemeDrawState inState;
	Boolean inFillCenter;
	if (!PyArg_ParseTuple(_args, "O&lb",
	                      PyMac_GetRect, &inRect,
	                      &inState,
	                      &inFillCenter))
		return NULL;
	_err = DrawThemeGenericWell(&inRect,
	                            inState,
	                            inFillCenter);
	if (_err != noErr) return PyMac_Error(_err);
	Py_INCREF(Py_None);
	_res = Py_None;
	return _res;
}

static PyObject *App_DrawThemeFocusRegion(PyObject *_self, PyObject *_args)
{
	PyObject *_res = NULL;
	OSStatus _err;
	Boolean inHasFocus;
	if (!PyArg_ParseTuple(_args, "b",
	                      &inHasFocus))
		return NULL;
	_err = DrawThemeFocusRegion((RgnHandle)0,
	                            inHasFocus);
	if (_err != noErr) return PyMac_Error(_err);
	Py_INCREF(Py_None);
	_res = Py_None;
	return _res;
}

static PyObject *App_IsThemeInColor(PyObject *_self, PyObject *_args)
{
	PyObject *_res = NULL;
	Boolean _rv;
	SInt16 inDepth;
	Boolean inIsColorDevice;
	if (!PyArg_ParseTuple(_args, "hb",
	                      &inDepth,
	                      &inIsColorDevice))
		return NULL;
	_rv = IsThemeInColor(inDepth,
	                     inIsColorDevice);
	_res = Py_BuildValue("b",
	                     _rv);
	return _res;
}

static PyObject *App_GetThemeAccentColors(PyObject *_self, PyObject *_args)
{
	PyObject *_res = NULL;
	OSStatus _err;
	CTabHandle outColors;
	if (!PyArg_ParseTuple(_args, ""))
		return NULL;
	_err = GetThemeAccentColors(&outColors);
	if (_err != noErr) return PyMac_Error(_err);
	_res = Py_BuildValue("O&",
	                     ResObj_New, outColors);
	return _res;
}

static PyObject *App_DrawThemeMenuBarBackground(PyObject *_self, PyObject *_args)
{
	PyObject *_res = NULL;
	OSStatus _err;
	Rect inBounds;
	ThemeMenuBarState inState;
	UInt32 inAttributes;
	if (!PyArg_ParseTuple(_args, "O&Hl",
	                      PyMac_GetRect, &inBounds,
	                      &inState,
	                      &inAttributes))
		return NULL;
	_err = DrawThemeMenuBarBackground(&inBounds,
	                                  inState,
	                                  inAttributes);
	if (_err != noErr) return PyMac_Error(_err);
	Py_INCREF(Py_None);
	_res = Py_None;
	return _res;
}

static PyObject *App_GetThemeMenuBarHeight(PyObject *_self, PyObject *_args)
{
	PyObject *_res = NULL;
	OSStatus _err;
	SInt16 outHeight;
	if (!PyArg_ParseTuple(_args, ""))
		return NULL;
	_err = GetThemeMenuBarHeight(&outHeight);
	if (_err != noErr) return PyMac_Error(_err);
	_res = Py_BuildValue("h",
	                     outHeight);
	return _res;
}

static PyObject *App_DrawThemeMenuBackground(PyObject *_self, PyObject *_args)
{
	PyObject *_res = NULL;
	OSStatus _err;
	Rect inMenuRect;
	ThemeMenuType inMenuType;
	if (!PyArg_ParseTuple(_args, "O&H",
	                      PyMac_GetRect, &inMenuRect,
	                      &inMenuType))
		return NULL;
	_err = DrawThemeMenuBackground(&inMenuRect,
	                               inMenuType);
	if (_err != noErr) return PyMac_Error(_err);
	Py_INCREF(Py_None);
	_res = Py_None;
	return _res;
}

static PyObject *App_GetThemeMenuBackgroundRegion(PyObject *_self, PyObject *_args)
{
	PyObject *_res = NULL;
	OSStatus _err;
	Rect inMenuRect;
	ThemeMenuType menuType;
	if (!PyArg_ParseTuple(_args, "O&H",
	                      PyMac_GetRect, &inMenuRect,
	                      &menuType))
		return NULL;
	_err = GetThemeMenuBackgroundRegion(&inMenuRect,
	                                    menuType,
	                                    (RgnHandle)0);
	if (_err != noErr) return PyMac_Error(_err);
	Py_INCREF(Py_None);
	_res = Py_None;
	return _res;
}

static PyObject *App_DrawThemeMenuSeparator(PyObject *_self, PyObject *_args)
{
	PyObject *_res = NULL;
	OSStatus _err;
	Rect inItemRect;
	if (!PyArg_ParseTuple(_args, "O&",
	                      PyMac_GetRect, &inItemRect))
		return NULL;
	_err = DrawThemeMenuSeparator(&inItemRect);
	if (_err != noErr) return PyMac_Error(_err);
	Py_INCREF(Py_None);
	_res = Py_None;
	return _res;
}

static PyObject *App_GetThemeMenuSeparatorHeight(PyObject *_self, PyObject *_args)
{
	PyObject *_res = NULL;
	OSStatus _err;
	SInt16 outHeight;
	if (!PyArg_ParseTuple(_args, ""))
		return NULL;
	_err = GetThemeMenuSeparatorHeight(&outHeight);
	if (_err != noErr) return PyMac_Error(_err);
	_res = Py_BuildValue("h",
	                     outHeight);
	return _res;
}

static PyObject *App_GetThemeMenuItemExtra(PyObject *_self, PyObject *_args)
{
	PyObject *_res = NULL;
	OSStatus _err;
	ThemeMenuItemType inItemType;
	SInt16 outHeight;
	SInt16 outWidth;
	if (!PyArg_ParseTuple(_args, "H",
	                      &inItemType))
		return NULL;
	_err = GetThemeMenuItemExtra(inItemType,
	                             &outHeight,
	                             &outWidth);
	if (_err != noErr) return PyMac_Error(_err);
	_res = Py_BuildValue("hh",
	                     outHeight,
	                     outWidth);
	return _res;
}

static PyObject *App_GetThemeMenuTitleExtra(PyObject *_self, PyObject *_args)
{
	PyObject *_res = NULL;
	OSStatus _err;
	SInt16 outWidth;
	Boolean inIsSquished;
	if (!PyArg_ParseTuple(_args, "b",
	                      &inIsSquished))
		return NULL;
	_err = GetThemeMenuTitleExtra(&outWidth,
	                              inIsSquished);
	if (_err != noErr) return PyMac_Error(_err);
	_res = Py_BuildValue("h",
	                     outWidth);
	return _res;
}

static PyObject *App_DrawThemeTabPane(PyObject *_self, PyObject *_args)
{
	PyObject *_res = NULL;
	OSStatus _err;
	Rect inRect;
	ThemeDrawState inState;
	if (!PyArg_ParseTuple(_args, "O&l",
	                      PyMac_GetRect, &inRect,
	                      &inState))
		return NULL;
	_err = DrawThemeTabPane(&inRect,
	                        inState);
	if (_err != noErr) return PyMac_Error(_err);
	Py_INCREF(Py_None);
	_res = Py_None;
	return _res;
}

static PyObject *App_GetThemeTabRegion(PyObject *_self, PyObject *_args)
{
	PyObject *_res = NULL;
	OSStatus _err;
	Rect inRect;
	ThemeTabStyle inStyle;
	ThemeTabDirection inDirection;
	if (!PyArg_ParseTuple(_args, "O&HH",
	                      PyMac_GetRect, &inRect,
	                      &inStyle,
	                      &inDirection))
		return NULL;
	_err = GetThemeTabRegion(&inRect,
	                         inStyle,
	                         inDirection,
	                         (RgnHandle)0);
	if (_err != noErr) return PyMac_Error(_err);
	Py_INCREF(Py_None);
	_res = Py_None;
	return _res;
}

static PyObject *App_SetThemeCursor(PyObject *_self, PyObject *_args)
{
	PyObject *_res = NULL;
	OSStatus _err;
	ThemeCursor inCursor;
	if (!PyArg_ParseTuple(_args, "l",
	                      &inCursor))
		return NULL;
	_err = SetThemeCursor(inCursor);
	if (_err != noErr) return PyMac_Error(_err);
	Py_INCREF(Py_None);
	_res = Py_None;
	return _res;
}

static PyObject *App_SetAnimatedThemeCursor(PyObject *_self, PyObject *_args)
{
	PyObject *_res = NULL;
	OSStatus _err;
	ThemeCursor inCursor;
	UInt32 inAnimationStep;
	if (!PyArg_ParseTuple(_args, "ll",
	                      &inCursor,
	                      &inAnimationStep))
		return NULL;
	_err = SetAnimatedThemeCursor(inCursor,
	                              inAnimationStep);
	if (_err != noErr) return PyMac_Error(_err);
	Py_INCREF(Py_None);
	_res = Py_None;
	return _res;
}

static PyObject *App_GetThemeScrollBarThumbStyle(PyObject *_self, PyObject *_args)
{
	PyObject *_res = NULL;
	OSStatus _err;
	ThemeScrollBarThumbStyle outStyle;
	if (!PyArg_ParseTuple(_args, ""))
		return NULL;
	_err = GetThemeScrollBarThumbStyle(&outStyle);
	if (_err != noErr) return PyMac_Error(_err);
	_res = Py_BuildValue("H",
	                     outStyle);
	return _res;
}

static PyObject *App_GetThemeScrollBarArrowStyle(PyObject *_self, PyObject *_args)
{
	PyObject *_res = NULL;
	OSStatus _err;
	ThemeScrollBarArrowStyle outStyle;
	if (!PyArg_ParseTuple(_args, ""))
		return NULL;
	_err = GetThemeScrollBarArrowStyle(&outStyle);
	if (_err != noErr) return PyMac_Error(_err);
	_res = Py_BuildValue("H",
	                     outStyle);
	return _res;
}

static PyObject *App_GetThemeCheckBoxStyle(PyObject *_self, PyObject *_args)
{
	PyObject *_res = NULL;
	OSStatus _err;
	ThemeCheckBoxStyle outStyle;
	if (!PyArg_ParseTuple(_args, ""))
		return NULL;
	_err = GetThemeCheckBoxStyle(&outStyle);
	if (_err != noErr) return PyMac_Error(_err);
	_res = Py_BuildValue("H",
	                     outStyle);
	return _res;
}

static PyObject *App_UseThemeFont(PyObject *_self, PyObject *_args)
{
	PyObject *_res = NULL;
	OSStatus _err;
	ThemeFontID inFontID;
	ScriptCode inScript;
	if (!PyArg_ParseTuple(_args, "Hh",
	                      &inFontID,
	                      &inScript))
		return NULL;
	_err = UseThemeFont(inFontID,
	                    inScript);
	if (_err != noErr) return PyMac_Error(_err);
	Py_INCREF(Py_None);
	_res = Py_None;
	return _res;
}

static PyObject *App_DrawThemeScrollBarArrows(PyObject *_self, PyObject *_args)
{
	PyObject *_res = NULL;
	OSStatus _err;
	Rect bounds;
	ThemeTrackEnableState enableState;
	ThemeTrackPressState pressState;
	Boolean isHoriz;
	Rect trackBounds;
	if (!PyArg_ParseTuple(_args, "O&bbb",
	                      PyMac_GetRect, &bounds,
	                      &enableState,
	                      &pressState,
	                      &isHoriz))
		return NULL;
	_err = DrawThemeScrollBarArrows(&bounds,
	                                enableState,
	                                pressState,
	                                isHoriz,
	                                &trackBounds);
	if (_err != noErr) return PyMac_Error(_err);
	_res = Py_BuildValue("O&",
	                     PyMac_BuildRect, &trackBounds);
	return _res;
}

static PyObject *App_GetThemeScrollBarTrackRect(PyObject *_self, PyObject *_args)
{
	PyObject *_res = NULL;
	OSStatus _err;
	Rect bounds;
	ThemeTrackEnableState enableState;
	ThemeTrackPressState pressState;
	Boolean isHoriz;
	Rect trackBounds;
	if (!PyArg_ParseTuple(_args, "O&bbb",
	                      PyMac_GetRect, &bounds,
	                      &enableState,
	                      &pressState,
	                      &isHoriz))
		return NULL;
	_err = GetThemeScrollBarTrackRect(&bounds,
	                                  enableState,
	                                  pressState,
	                                  isHoriz,
	                                  &trackBounds);
	if (_err != noErr) return PyMac_Error(_err);
	_res = Py_BuildValue("O&",
	                     PyMac_BuildRect, &trackBounds);
	return _res;
}

static PyObject *App_HitTestThemeScrollBarArrows(PyObject *_self, PyObject *_args)
{
	PyObject *_res = NULL;
	Boolean _rv;
	Rect scrollBarBounds;
	ThemeTrackEnableState enableState;
	ThemeTrackPressState pressState;
	Boolean isHoriz;
	Point ptHit;
	Rect trackBounds;
	ControlPartCode partcode;
	if (!PyArg_ParseTuple(_args, "O&bbbO&",
	                      PyMac_GetRect, &scrollBarBounds,
	                      &enableState,
	                      &pressState,
	                      &isHoriz,
	                      PyMac_GetPoint, &ptHit))
		return NULL;
	_rv = HitTestThemeScrollBarArrows(&scrollBarBounds,
	                                  enableState,
	                                  pressState,
	                                  isHoriz,
	                                  ptHit,
	                                  &trackBounds,
	                                  &partcode);
	_res = Py_BuildValue("bO&h",
	                     _rv,
	                     PyMac_BuildRect, &trackBounds,
	                     partcode);
	return _res;
}

static PyObject *App_DrawThemeScrollBarDelimiters(PyObject *_self, PyObject *_args)
{
	PyObject *_res = NULL;
	OSStatus _err;
	ThemeWindowType flavor;
	Rect inContRect;
	ThemeDrawState state;
	ThemeWindowAttributes attributes;
	if (!PyArg_ParseTuple(_args, "HO&ll",
	                      &flavor,
	                      PyMac_GetRect, &inContRect,
	                      &state,
	                      &attributes))
		return NULL;
	_err = DrawThemeScrollBarDelimiters(flavor,
	                                    &inContRect,
	                                    state,
	                                    attributes);
	if (_err != noErr) return PyMac_Error(_err);
	Py_INCREF(Py_None);
	_res = Py_None;
	return _res;
}

static PyObject *App_PlayThemeSound(PyObject *_self, PyObject *_args)
{
	PyObject *_res = NULL;
	OSStatus _err;
	ThemeSoundKind kind;
	if (!PyArg_ParseTuple(_args, "O&",
	                      PyMac_GetOSType, &kind))
		return NULL;
	_err = PlayThemeSound(kind);
	if (_err != noErr) return PyMac_Error(_err);
	Py_INCREF(Py_None);
	_res = Py_None;
	return _res;
}

static PyObject *App_BeginThemeDragSound(PyObject *_self, PyObject *_args)
{
	PyObject *_res = NULL;
	OSStatus _err;
	ThemeDragSoundKind kind;
	if (!PyArg_ParseTuple(_args, "O&",
	                      PyMac_GetOSType, &kind))
		return NULL;
	_err = BeginThemeDragSound(kind);
	if (_err != noErr) return PyMac_Error(_err);
	Py_INCREF(Py_None);
	_res = Py_None;
	return _res;
}

static PyObject *App_EndThemeDragSound(PyObject *_self, PyObject *_args)
{
	PyObject *_res = NULL;
	OSStatus _err;
	if (!PyArg_ParseTuple(_args, ""))
		return NULL;
	_err = EndThemeDragSound();
	if (_err != noErr) return PyMac_Error(_err);
	Py_INCREF(Py_None);
	_res = Py_None;
	return _res;
}

static PyObject *App_DrawThemeTickMark(PyObject *_self, PyObject *_args)
{
	PyObject *_res = NULL;
	OSStatus _err;
	Rect bounds;
	ThemeDrawState state;
	if (!PyArg_ParseTuple(_args, "O&l",
	                      PyMac_GetRect, &bounds,
	                      &state))
		return NULL;
	_err = DrawThemeTickMark(&bounds,
	                         state);
	if (_err != noErr) return PyMac_Error(_err);
	Py_INCREF(Py_None);
	_res = Py_None;
	return _res;
}

static PyObject *App_DrawThemeStandaloneGrowBox(PyObject *_self, PyObject *_args)
{
	PyObject *_res = NULL;
	OSStatus _err;
	Point origin;
	ThemeGrowDirection growDirection;
	Boolean isSmall;
	ThemeDrawState state;
	if (!PyArg_ParseTuple(_args, "O&Hbl",
	                      PyMac_GetPoint, &origin,
	                      &growDirection,
	                      &isSmall,
	                      &state))
		return NULL;
	_err = DrawThemeStandaloneGrowBox(origin,
	                                  growDirection,
	                                  isSmall,
	                                  state);
	if (_err != noErr) return PyMac_Error(_err);
	Py_INCREF(Py_None);
	_res = Py_None;
	return _res;
}

static PyObject *App_DrawThemeStandaloneNoGrowBox(PyObject *_self, PyObject *_args)
{
	PyObject *_res = NULL;
	OSStatus _err;
	Point origin;
	ThemeGrowDirection growDirection;
	Boolean isSmall;
	ThemeDrawState state;
	if (!PyArg_ParseTuple(_args, "O&Hbl",
	                      PyMac_GetPoint, &origin,
	                      &growDirection,
	                      &isSmall,
	                      &state))
		return NULL;
	_err = DrawThemeStandaloneNoGrowBox(origin,
	                                    growDirection,
	                                    isSmall,
	                                    state);
	if (_err != noErr) return PyMac_Error(_err);
	Py_INCREF(Py_None);
	_res = Py_None;
	return _res;
}

static PyObject *App_GetThemeStandaloneGrowBoxBounds(PyObject *_self, PyObject *_args)
{
	PyObject *_res = NULL;
	OSStatus _err;
	Point origin;
	ThemeGrowDirection growDirection;
	Boolean isSmall;
	Rect bounds;
	if (!PyArg_ParseTuple(_args, "O&Hb",
	                      PyMac_GetPoint, &origin,
	                      &growDirection,
	                      &isSmall))
		return NULL;
	_err = GetThemeStandaloneGrowBoxBounds(origin,
	                                       growDirection,
	                                       isSmall,
	                                       &bounds);
	if (_err != noErr) return PyMac_Error(_err);
	_res = Py_BuildValue("O&",
	                     PyMac_BuildRect, &bounds);
	return _res;
}

static PyObject *App_NormalizeThemeDrawingState(PyObject *_self, PyObject *_args)
{
	PyObject *_res = NULL;
	OSStatus _err;
	if (!PyArg_ParseTuple(_args, ""))
		return NULL;
	_err = NormalizeThemeDrawingState();
	if (_err != noErr) return PyMac_Error(_err);
	Py_INCREF(Py_None);
	_res = Py_None;
	return _res;
}

static PyObject *App_ApplyThemeBackground(PyObject *_self, PyObject *_args)
{
	PyObject *_res = NULL;
	OSStatus _err;
	ThemeBackgroundKind inKind;
	Rect bounds;
	ThemeDrawState inState;
	SInt16 inDepth;
	Boolean inColorDev;
	if (!PyArg_ParseTuple(_args, "lO&lhb",
	                      &inKind,
	                      PyMac_GetRect, &bounds,
	                      &inState,
	                      &inDepth,
	                      &inColorDev))
		return NULL;
	_err = ApplyThemeBackground(inKind,
	                            &bounds,
	                            inState,
	                            inDepth,
	                            inColorDev);
	if (_err != noErr) return PyMac_Error(_err);
	Py_INCREF(Py_None);
	_res = Py_None;
	return _res;
}

static PyObject *App_SetThemeTextColorForWindow(PyObject *_self, PyObject *_args)
{
	PyObject *_res = NULL;
	OSStatus _err;
	WindowPtr window;
	Boolean isActive;
	SInt16 depth;
	Boolean isColorDev;
	if (!PyArg_ParseTuple(_args, "O&bhb",
	                      WinObj_Convert, &window,
	                      &isActive,
	                      &depth,
	                      &isColorDev))
		return NULL;
	_err = SetThemeTextColorForWindow(window,
	                                  isActive,
	                                  depth,
	                                  isColorDev);
	if (_err != noErr) return PyMac_Error(_err);
	Py_INCREF(Py_None);
	_res = Py_None;
	return _res;
}

static PyObject *App_IsValidAppearanceFileType(PyObject *_self, PyObject *_args)
{
	PyObject *_res = NULL;
	Boolean _rv;
	OSType fileType;
	if (!PyArg_ParseTuple(_args, "O&",
	                      PyMac_GetOSType, &fileType))
		return NULL;
	_rv = IsValidAppearanceFileType(fileType);
	_res = Py_BuildValue("b",
	                     _rv);
	return _res;
}

static PyObject *App_GetThemeBrushAsColor(PyObject *_self, PyObject *_args)
{
	PyObject *_res = NULL;
	OSStatus _err;
	ThemeBrush inBrush;
	SInt16 inDepth;
	Boolean inColorDev;
	RGBColor outColor;
	if (!PyArg_ParseTuple(_args, "hhb",
	                      &inBrush,
	                      &inDepth,
	                      &inColorDev))
		return NULL;
	_err = GetThemeBrushAsColor(inBrush,
	                            inDepth,
	                            inColorDev,
	                            &outColor);
	if (_err != noErr) return PyMac_Error(_err);
	_res = Py_BuildValue("O&",
	                     QdRGB_New, &outColor);
	return _res;
}

static PyObject *App_GetThemeTextColor(PyObject *_self, PyObject *_args)
{
	PyObject *_res = NULL;
	OSStatus _err;
	ThemeTextColor inColor;
	SInt16 inDepth;
	Boolean inColorDev;
	RGBColor outColor;
	if (!PyArg_ParseTuple(_args, "hhb",
	                      &inColor,
	                      &inDepth,
	                      &inColorDev))
		return NULL;
	_err = GetThemeTextColor(inColor,
	                         inDepth,
	                         inColorDev,
	                         &outColor);
	if (_err != noErr) return PyMac_Error(_err);
	_res = Py_BuildValue("O&",
	                     QdRGB_New, &outColor);
	return _res;
}

#if TARGET_API_MAC_CARBON

static PyObject *App_GetThemeMetric(PyObject *_self, PyObject *_args)
{
	PyObject *_res = NULL;
	OSStatus _err;
	ThemeMetric inMetric;
	SInt32 outMetric;
	if (!PyArg_ParseTuple(_args, "l",
	                      &inMetric))
		return NULL;
	_err = GetThemeMetric(inMetric,
	                      &outMetric);
	if (_err != noErr) return PyMac_Error(_err);
	_res = Py_BuildValue("l",
	                     outMetric);
	return _res;
}
#endif

static PyMethodDef App_methods[] = {
	{"RegisterAppearanceClient", (PyCFunction)App_RegisterAppearanceClient, 1,
	 "() -> None"},
	{"UnregisterAppearanceClient", (PyCFunction)App_UnregisterAppearanceClient, 1,
	 "() -> None"},
	{"SetThemePen", (PyCFunction)App_SetThemePen, 1,
	 "(ThemeBrush inBrush, SInt16 inDepth, Boolean inIsColorDevice) -> None"},
	{"SetThemeBackground", (PyCFunction)App_SetThemeBackground, 1,
	 "(ThemeBrush inBrush, SInt16 inDepth, Boolean inIsColorDevice) -> None"},
	{"SetThemeTextColor", (PyCFunction)App_SetThemeTextColor, 1,
	 "(ThemeTextColor inColor, SInt16 inDepth, Boolean inIsColorDevice) -> None"},
	{"SetThemeWindowBackground", (PyCFunction)App_SetThemeWindowBackground, 1,
	 "(WindowPtr inWindow, ThemeBrush inBrush, Boolean inUpdate) -> None"},
	{"DrawThemeWindowHeader", (PyCFunction)App_DrawThemeWindowHeader, 1,
	 "(Rect inRect, ThemeDrawState inState) -> None"},
	{"DrawThemeWindowListViewHeader", (PyCFunction)App_DrawThemeWindowListViewHeader, 1,
	 "(Rect inRect, ThemeDrawState inState) -> None"},
	{"DrawThemePlacard", (PyCFunction)App_DrawThemePlacard, 1,
	 "(Rect inRect, ThemeDrawState inState) -> None"},
	{"DrawThemeEditTextFrame", (PyCFunction)App_DrawThemeEditTextFrame, 1,
	 "(Rect inRect, ThemeDrawState inState) -> None"},
	{"DrawThemeListBoxFrame", (PyCFunction)App_DrawThemeListBoxFrame, 1,
	 "(Rect inRect, ThemeDrawState inState) -> None"},
	{"DrawThemeFocusRect", (PyCFunction)App_DrawThemeFocusRect, 1,
	 "(Rect inRect, Boolean inHasFocus) -> None"},
	{"DrawThemePrimaryGroup", (PyCFunction)App_DrawThemePrimaryGroup, 1,
	 "(Rect inRect, ThemeDrawState inState) -> None"},
	{"DrawThemeSecondaryGroup", (PyCFunction)App_DrawThemeSecondaryGroup, 1,
	 "(Rect inRect, ThemeDrawState inState) -> None"},
	{"DrawThemeSeparator", (PyCFunction)App_DrawThemeSeparator, 1,
	 "(Rect inRect, ThemeDrawState inState) -> None"},
	{"DrawThemeModelessDialogFrame", (PyCFunction)App_DrawThemeModelessDialogFrame, 1,
	 "(Rect inRect, ThemeDrawState inState) -> None"},
	{"DrawThemeGenericWell", (PyCFunction)App_DrawThemeGenericWell, 1,
	 "(Rect inRect, ThemeDrawState inState, Boolean inFillCenter) -> None"},
	{"DrawThemeFocusRegion", (PyCFunction)App_DrawThemeFocusRegion, 1,
	 "(Boolean inHasFocus) -> None"},
	{"IsThemeInColor", (PyCFunction)App_IsThemeInColor, 1,
	 "(SInt16 inDepth, Boolean inIsColorDevice) -> (Boolean _rv)"},
	{"GetThemeAccentColors", (PyCFunction)App_GetThemeAccentColors, 1,
	 "() -> (CTabHandle outColors)"},
	{"DrawThemeMenuBarBackground", (PyCFunction)App_DrawThemeMenuBarBackground, 1,
	 "(Rect inBounds, ThemeMenuBarState inState, UInt32 inAttributes) -> None"},
	{"GetThemeMenuBarHeight", (PyCFunction)App_GetThemeMenuBarHeight, 1,
	 "() -> (SInt16 outHeight)"},
	{"DrawThemeMenuBackground", (PyCFunction)App_DrawThemeMenuBackground, 1,
	 "(Rect inMenuRect, ThemeMenuType inMenuType) -> None"},
	{"GetThemeMenuBackgroundRegion", (PyCFunction)App_GetThemeMenuBackgroundRegion, 1,
	 "(Rect inMenuRect, ThemeMenuType menuType) -> None"},
	{"DrawThemeMenuSeparator", (PyCFunction)App_DrawThemeMenuSeparator, 1,
	 "(Rect inItemRect) -> None"},
	{"GetThemeMenuSeparatorHeight", (PyCFunction)App_GetThemeMenuSeparatorHeight, 1,
	 "() -> (SInt16 outHeight)"},
	{"GetThemeMenuItemExtra", (PyCFunction)App_GetThemeMenuItemExtra, 1,
	 "(ThemeMenuItemType inItemType) -> (SInt16 outHeight, SInt16 outWidth)"},
	{"GetThemeMenuTitleExtra", (PyCFunction)App_GetThemeMenuTitleExtra, 1,
	 "(Boolean inIsSquished) -> (SInt16 outWidth)"},
	{"DrawThemeTabPane", (PyCFunction)App_DrawThemeTabPane, 1,
	 "(Rect inRect, ThemeDrawState inState) -> None"},
	{"GetThemeTabRegion", (PyCFunction)App_GetThemeTabRegion, 1,
	 "(Rect inRect, ThemeTabStyle inStyle, ThemeTabDirection inDirection) -> None"},
	{"SetThemeCursor", (PyCFunction)App_SetThemeCursor, 1,
	 "(ThemeCursor inCursor) -> None"},
	{"SetAnimatedThemeCursor", (PyCFunction)App_SetAnimatedThemeCursor, 1,
	 "(ThemeCursor inCursor, UInt32 inAnimationStep) -> None"},
	{"GetThemeScrollBarThumbStyle", (PyCFunction)App_GetThemeScrollBarThumbStyle, 1,
	 "() -> (ThemeScrollBarThumbStyle outStyle)"},
	{"GetThemeScrollBarArrowStyle", (PyCFunction)App_GetThemeScrollBarArrowStyle, 1,
	 "() -> (ThemeScrollBarArrowStyle outStyle)"},
	{"GetThemeCheckBoxStyle", (PyCFunction)App_GetThemeCheckBoxStyle, 1,
	 "() -> (ThemeCheckBoxStyle outStyle)"},
	{"UseThemeFont", (PyCFunction)App_UseThemeFont, 1,
	 "(ThemeFontID inFontID, ScriptCode inScript) -> None"},
	{"DrawThemeScrollBarArrows", (PyCFunction)App_DrawThemeScrollBarArrows, 1,
	 "(Rect bounds, ThemeTrackEnableState enableState, ThemeTrackPressState pressState, Boolean isHoriz) -> (Rect trackBounds)"},
	{"GetThemeScrollBarTrackRect", (PyCFunction)App_GetThemeScrollBarTrackRect, 1,
	 "(Rect bounds, ThemeTrackEnableState enableState, ThemeTrackPressState pressState, Boolean isHoriz) -> (Rect trackBounds)"},
	{"HitTestThemeScrollBarArrows", (PyCFunction)App_HitTestThemeScrollBarArrows, 1,
	 "(Rect scrollBarBounds, ThemeTrackEnableState enableState, ThemeTrackPressState pressState, Boolean isHoriz, Point ptHit) -> (Boolean _rv, Rect trackBounds, ControlPartCode partcode)"},
	{"DrawThemeScrollBarDelimiters", (PyCFunction)App_DrawThemeScrollBarDelimiters, 1,
	 "(ThemeWindowType flavor, Rect inContRect, ThemeDrawState state, ThemeWindowAttributes attributes) -> None"},
	{"PlayThemeSound", (PyCFunction)App_PlayThemeSound, 1,
	 "(ThemeSoundKind kind) -> None"},
	{"BeginThemeDragSound", (PyCFunction)App_BeginThemeDragSound, 1,
	 "(ThemeDragSoundKind kind) -> None"},
	{"EndThemeDragSound", (PyCFunction)App_EndThemeDragSound, 1,
	 "() -> None"},
	{"DrawThemeTickMark", (PyCFunction)App_DrawThemeTickMark, 1,
	 "(Rect bounds, ThemeDrawState state) -> None"},
	{"DrawThemeStandaloneGrowBox", (PyCFunction)App_DrawThemeStandaloneGrowBox, 1,
	 "(Point origin, ThemeGrowDirection growDirection, Boolean isSmall, ThemeDrawState state) -> None"},
	{"DrawThemeStandaloneNoGrowBox", (PyCFunction)App_DrawThemeStandaloneNoGrowBox, 1,
	 "(Point origin, ThemeGrowDirection growDirection, Boolean isSmall, ThemeDrawState state) -> None"},
	{"GetThemeStandaloneGrowBoxBounds", (PyCFunction)App_GetThemeStandaloneGrowBoxBounds, 1,
	 "(Point origin, ThemeGrowDirection growDirection, Boolean isSmall) -> (Rect bounds)"},
	{"NormalizeThemeDrawingState", (PyCFunction)App_NormalizeThemeDrawingState, 1,
	 "() -> None"},
	{"ApplyThemeBackground", (PyCFunction)App_ApplyThemeBackground, 1,
	 "(ThemeBackgroundKind inKind, Rect bounds, ThemeDrawState inState, SInt16 inDepth, Boolean inColorDev) -> None"},
	{"SetThemeTextColorForWindow", (PyCFunction)App_SetThemeTextColorForWindow, 1,
	 "(WindowPtr window, Boolean isActive, SInt16 depth, Boolean isColorDev) -> None"},
	{"IsValidAppearanceFileType", (PyCFunction)App_IsValidAppearanceFileType, 1,
	 "(OSType fileType) -> (Boolean _rv)"},
	{"GetThemeBrushAsColor", (PyCFunction)App_GetThemeBrushAsColor, 1,
	 "(ThemeBrush inBrush, SInt16 inDepth, Boolean inColorDev) -> (RGBColor outColor)"},
	{"GetThemeTextColor", (PyCFunction)App_GetThemeTextColor, 1,
	 "(ThemeTextColor inColor, SInt16 inDepth, Boolean inColorDev) -> (RGBColor outColor)"},

#if TARGET_API_MAC_CARBON
	{"GetThemeMetric", (PyCFunction)App_GetThemeMetric, 1,
	 "(ThemeMetric inMetric) -> (SInt32 outMetric)"},
#endif
	{NULL, NULL, 0}
};




void initApp(void)
{
	PyObject *m;
	PyObject *d;




	m = Py_InitModule("App", App_methods);
	d = PyModule_GetDict(m);
	App_Error = PyMac_GetOSErrException();
	if (App_Error == NULL ||
	    PyDict_SetItemString(d, "Error", App_Error) != 0)
		return;
}

/* ========================= End module App ========================= */