1 11 package org.eclipse.swt; 12 13 14 import org.eclipse.swt.internal.*; 15 16 35 36 44 public class SWT { 45 46 47 48 53 public static final int None = 0; 54 55 67 public static final int KeyDown = 1; 68 69 81 public static final int KeyUp = 2; 82 83 94 public static final int MouseDown = 3; 95 96 107 public static final int MouseUp = 4; 108 109 120 public static final int MouseMove = 5; 121 122 133 public static final int MouseEnter = 6; 134 135 146 public static final int MouseExit = 7; 147 148 159 public static final int MouseDoubleClick = 8; 160 161 172 public static final int Paint = 9; 173 174 188 public static final int Move = 10; 189 190 204 public static final int Resize = 11; 205 206 218 public static final int Dispose = 12; 219 220 247 public static final int Selection = 13; 248 249 266 public static final int DefaultSelection = 14; 267 268 279 public static final int FocusIn = 15; 280 281 292 public static final int FocusOut = 16; 293 294 305 public static final int Expand = 17; 306 307 318 public static final int Collapse = 18; 319 320 331 public static final int Iconify = 19; 332 333 344 public static final int Deiconify = 20; 345 346 358 public static final int Close = 21; 359 360 371 public static final int Show = 22; 372 373 384 public static final int Hide = 23; 385 386 399 public static final int Modify = 24; 400 401 413 public static final int Verify = 25; 414 415 426 public static final int Activate = 26; 427 428 439 public static final int Deactivate = 27; 440 441 454 public static final int Help = 28; 455 456 465 public static final int DragDetect = 29; 466 467 478 public static final int Arm = 30; 479 480 491 public static final int Traverse = 31; 492 493 504 public static final int MouseHover = 32; 505 506 513 public static final int HardKeyDown = 33; 514 515 522 public static final int HardKeyUp = 34; 523 524 533 public static final int MenuDetect = 35; 534 535 547 public static final int SetData = 36; 548 549 558 public static final int MouseWheel = 37; 559 560 579 public static final int Settings = 39; 580 581 590 public static final int EraseItem = 40; 591 592 601 public static final int MeasureItem = 41; 602 603 612 public static final int PaintItem = 42; 613 614 615 616 620 public static final int DRAG = 1; 621 622 628 public static final int SELECTED = 1 << 1; 629 630 636 public static final int FOCUSED = 1 << 2; 637 638 644 public static final int BACKGROUND = 1 << 3; 645 646 652 public static final int FOREGROUND = 1 << 4; 653 654 660 public static final int HOT = 1 << 5; 661 662 663 669 674 public static final int TRAVERSE_NONE = 0; 675 676 682 public static final int TRAVERSE_ESCAPE = 1 << 1; 683 684 690 public static final int TRAVERSE_RETURN = 1 << 2; 691 692 699 public static final int TRAVERSE_TAB_PREVIOUS = 1 << 3; 700 701 708 public static final int TRAVERSE_TAB_NEXT = 1 << 4; 709 710 717 public static final int TRAVERSE_ARROW_PREVIOUS = 1 << 5; 718 719 726 public static final int TRAVERSE_ARROW_NEXT = 1 << 6; 727 728 733 public static final int TRAVERSE_MNEMONIC = 1 << 7; 734 735 742 public static final int TRAVERSE_PAGE_PREVIOUS = 1 << 8; 743 744 751 public static final int TRAVERSE_PAGE_NEXT = 1 << 9; 752 753 757 public static final int NONE = 0; 758 759 763 public static final int NULL = 0; 764 765 768 public static final int DEFAULT = -1; 769 770 775 public static final int OFF = 0; 776 777 782 public static final int ON = 1; 783 784 789 public static final int LOW = 1; 790 791 796 public static final int HIGH = 2; 797 798 804 public static final int BAR = 1 << 1; 805 806 815 public static final int DROP_DOWN = 1 << 2; 816 817 823 public static final int POP_UP = 1 << 3; 824 825 833 public static final int SEPARATOR = 1 << 1; 834 835 841 public static final int TOGGLE = 1 << 1; 842 843 849 public static final int ARROW = 1 << 2; 850 851 859 public static final int PUSH = 1 << 3; 860 861 869 public static final int RADIO = 1 << 4; 870 871 881 public static final int CHECK = 1 << 5; 882 883 889 public static final int CASCADE = 1 << 6; 890 891 900 public static final int MULTI = 1 << 1; 901 902 912 public static final int SINGLE = 1 << 2; 913 914 921 public static final int READ_ONLY = 1 << 3; 922 923 932 public static final int WRAP = 1 << 6; 933 934 942 public static final int SEARCH = 1 << 7; 943 944 950 public static final int SIMPLE = 1 << 6; 951 952 960 public static final int PASSWORD = 1 << 22; 961 962 970 public static final int SHADOW_IN = 1 << 2; 971 972 981 public static final int SHADOW_OUT = 1 << 3; 982 983 990 public static final int SHADOW_ETCHED_IN = 1 << 4; 991 992 999 public static final int SHADOW_ETCHED_OUT = 1 << 6; 1000 1001 1009 public static final int SHADOW_NONE = 1 << 5; 1010 1011 1017 public static final int INDETERMINATE = 1 << 1; 1018 1019 1030 public static final int TOOL = 1 << 2; 1031 1032 1039 public static final int NO_TRIM = 1 << 3; 1040 1041 1048 public static final int RESIZE = 1 << 4; 1049 1050 1056 public static final int TITLE = 1 << 5; 1057 1058 1065 public static final int CLOSE = 1 << 6; 1066 1067 1074 public static final int MENU = CLOSE; 1075 1076 1082 public static final int MIN = 1 << 7; 1083 1084 1090 public static final int MAX = 1 << 10; 1091 1092 1098 public static final int H_SCROLL = 1 << 8; 1099 1100 1106 public static final int V_SCROLL = 1 << 9; 1107 1108 1115 public static final int BORDER = 1 << 11; 1116 1117 1125 public static final int CLIP_CHILDREN = 1 << 12; 1126 1127 1135 public static final int CLIP_SIBLINGS = 1 << 13; 1136 1137 1144 public static final int ON_TOP = 1 << 14; 1145 1146 1153 public static final int SHELL_TRIM = CLOSE | TITLE | MIN | MAX | RESIZE; 1154 1155 1162 public static final int DIALOG_TRIM = TITLE | CLOSE | BORDER; 1163 1164 1172 public static final int MODELESS = 0; 1173 1174 1182 public static final int PRIMARY_MODAL = 1 << 15; 1183 1184 1192 public static final int APPLICATION_MODAL = 1 << 16; 1193 1194 1202 public static final int SYSTEM_MODAL = 1 << 17; 1203 1204 1211 public static final int HIDE_SELECTION = 1 << 15; 1212 1213 1225 public static final int FULL_SELECTION = 1 << 16; 1226 1227 1235 public static final int FLAT = 1 << 23; 1236 1237 1245 public static final int SMOOTH = 1 << 16; 1246 1247 1259 public static final int NO_BACKGROUND = 1 << 18; 1260 1261 1268 public static final int NO_FOCUS = 1 << 19; 1269 1270 1282 public static final int NO_REDRAW_RESIZE = 1 << 20; 1283 1284 1290 public static final int NO_MERGE_PAINTS = 1 << 21; 1291 1292 1298 public static final int NO_RADIO_GROUP = 1 << 22; 1299 1300 1318 public static final int LEFT_TO_RIGHT = 1 << 25; 1319 1320 1338 public static final int RIGHT_TO_LEFT = 1 << 26; 1339 1340 1349 public static final int MIRRORED = 1 << 27; 1350 1351 1359 public static final int EMBEDDED = 1 << 24; 1360 1361 1370 public static final int VIRTUAL = 1 << 28; 1371 1372 1380 public static final int DOUBLE_BUFFERED = 1 << 29; 1381 1382 1390 public static final int UP = 1 << 7; 1391 1392 1399 public static final int TOP = UP; 1400 1401 1409 public static final int DOWN = 1 << 10; 1410 1411 1418 public static final int BOTTOM = DOWN; 1419 1420 1432 public static final int LEAD = 1 << 14; 1433 1434 1440 public static final int LEFT = LEAD; 1441 1442 1454 public static final int TRAIL = 1 << 17; 1455 1456 1462 public static final int RIGHT = TRAIL; 1463 1464 1473 public static final int CENTER = 1 << 24; 1474 1475 1489 public static final int HORIZONTAL = 1 << 8; 1490 1491 1506 public static final int VERTICAL = 1 << 9; 1507 1508 1516 public static final int DATE = 1 << 5; 1517 1518 1526 public static final int TIME = 1 << 7; 1527 1528 1536 public static final int CALENDAR = 1 << 10; 1537 1538 1551 public static final int SHORT = 1 << 15; 1552 1553 1566 public static final int MEDIUM = 1 << 16; 1567 1568 1582 public static final int LONG = 1 << 28; 1583 1584 1594 public static final int MOZILLA = 1 << 15; 1595 1596 1604 public static final int BALLOON = 1 << 12; 1605 1606 1612 public static final int BEGINNING = 1; 1613 1614 1620 public static final int FILL = 4; 1621 1622 1626 public static final int DBCS = 1 << 1; 1627 1628 1632 public static final int ALPHA = 1 << 2; 1633 1634 1638 public static final int NATIVE = 1 << 3; 1639 1640 1644 public static final int PHONETIC = 1 << 4; 1645 1646 1650 public static final int ROMAN = 1 << 5; 1651 1652 1656 public static final char BS = '\b'; 1657 1658 1662 public static final char CR = '\r'; 1663 1664 1668 public static final char DEL = 0x7F; 1669 1670 1674 public static final char ESC = 0x1B; 1675 1676 1680 public static final char LF = '\n'; 1681 1682 1688 public static final char TAB = '\t'; 1689 1690 1695 public static final int ALT = 1 << 16; 1696 1697 1702 public static final int SHIFT = 1 << 17; 1703 1704 1709 public static final int CTRL = 1 << 18; 1710 1711 1716 public static final int CONTROL = CTRL; 1717 1718 1725 public static final int COMMAND = 1 << 22; 1726 1727 1741 public static final int MODIFIER_MASK; 1742 1743 1747 public static final int BUTTON1 = 1 << 19; 1748 1749 1753 public static final int BUTTON2 = 1 << 20; 1754 1755 1759 public static final int BUTTON3 = 1 << 21; 1760 1761 1767 public static final int BUTTON4 = 1 << 23; 1768 1769 1775 public static final int BUTTON5 = 1 << 25; 1776 1777 1791 public static final int BUTTON_MASK; 1792 1793 1801 public static final int MOD1; 1802 1803 1811 public static final int MOD2; 1812 1813 1819 public static final int MOD3; 1820 1821 1827 public static final int MOD4; 1828 1829 1837 public static final int SCROLL_LINE = 1; 1838 1839 1847 public static final int SCROLL_PAGE = 2; 1848 1849 1870 public static final int KEYCODE_BIT = (1 << 24); 1871 1872 1882 public static final int KEY_MASK = KEYCODE_BIT + 0xFFFF; 1883 1884 1888 public static final int ARROW_UP = KEYCODE_BIT + 1; 1889 1890 1894 public static final int ARROW_DOWN = KEYCODE_BIT + 2; 1895 1896 1900 public static final int ARROW_LEFT = KEYCODE_BIT + 3; 1901 1902 1906 public static final int ARROW_RIGHT = KEYCODE_BIT + 4; 1907 1908 1912 public static final int PAGE_UP = KEYCODE_BIT + 5; 1913 1914 1918 public static final int PAGE_DOWN = KEYCODE_BIT + 6; 1919 1920 1924 public static final int HOME = KEYCODE_BIT + 7; 1925 1926 1930 public static final int END = KEYCODE_BIT + 8; 1931 1932 1936 public static final int INSERT = KEYCODE_BIT + 9; 1937 1938 1942 public static final int F1 = KEYCODE_BIT + 10; 1943 1944 1948 public static final int F2 = KEYCODE_BIT + 11; 1949 1950 1954 public static final int F3 = KEYCODE_BIT + 12; 1955 1956 1960 public static final int F4 = KEYCODE_BIT + 13; 1961 1962 1966 public static final int F5 = KEYCODE_BIT + 14; 1967 1968 1972 public static final int F6 = KEYCODE_BIT + 15; 1973 1974 1978 public static final int F7 = KEYCODE_BIT + 16; 1979 1980 1984 public static final int F8 = KEYCODE_BIT + 17; 1985 1986 1990 public static final int F9 = KEYCODE_BIT + 18; 1991 1992 1996 public static final int F10 = KEYCODE_BIT + 19; 1997 1998 2002 public static final int F11 = KEYCODE_BIT + 20; 2003 2004 2008 public static final int F12 = KEYCODE_BIT + 21; 2009 2010 2016 public static final int F13 = KEYCODE_BIT + 22; 2017 2018 2024 public static final int F14 = KEYCODE_BIT + 23; 2025 2026 2032 public static final int F15 = KEYCODE_BIT + 24; 2033 2034 2040 public static final int KEYPAD_MULTIPLY = KEYCODE_BIT + 42; 2041 2042 2048 public static final int KEYPAD_ADD = KEYCODE_BIT + 43; 2049 2050 2056 public static final int KEYPAD_SUBTRACT = KEYCODE_BIT + 45; 2057 2058 2064 public static final int KEYPAD_DECIMAL = KEYCODE_BIT + 46; 2065 2066 2072 public static final int KEYPAD_DIVIDE = KEYCODE_BIT + 47; 2073 2074 2080 public static final int KEYPAD_0 = KEYCODE_BIT + 48; 2081 2082 2088 public static final int KEYPAD_1 = KEYCODE_BIT + 49; 2089 2090 2096 public static final int KEYPAD_2 = KEYCODE_BIT + 50; 2097 2098 2104 public static final int KEYPAD_3 = KEYCODE_BIT + 51; 2105 2106 2112 public static final int KEYPAD_4 = KEYCODE_BIT + 52; 2113 2114 2120 public static final int KEYPAD_5 = KEYCODE_BIT + 53; 2121 2122 2128 public static final int KEYPAD_6 = KEYCODE_BIT + 54; 2129 2130 2136 public static final int KEYPAD_7 = KEYCODE_BIT + 55; 2137 2138 2144 public static final int KEYPAD_8 = KEYCODE_BIT + 56; 2145 2146 2152 public static final int KEYPAD_9 = KEYCODE_BIT + 57; 2153 2154 2160 public static final int KEYPAD_EQUAL = KEYCODE_BIT + 61; 2161 2162 2168 public static final int KEYPAD_CR = KEYCODE_BIT + 80; 2169 2170 2183 public static final int HELP = KEYCODE_BIT + 81; 2184 2185 2191 public static final int CAPS_LOCK = KEYCODE_BIT + 82; 2192 2193 2199 public static final int NUM_LOCK = KEYCODE_BIT + 83; 2200 2201 2207 public static final int SCROLL_LOCK = KEYCODE_BIT + 84; 2208 2209 2215 public static final int PAUSE = KEYCODE_BIT + 85; 2216 2217 2223 public static final int BREAK = KEYCODE_BIT + 86; 2224 2225 2231 public static final int PRINT_SCREEN = KEYCODE_BIT + 87; 2232 2233 2237 public static final int ICON_ERROR = 1; 2238 2239 2243 public static final int ICON_INFORMATION = 1 << 1; 2244 2245 2249 public static final int ICON_QUESTION = 1 << 2; 2250 2251 2255 public static final int ICON_WARNING = 1 << 3; 2256 2257 2261 public static final int ICON_WORKING = 1 << 4; 2262 2263 2268 public static final int OK = 1 << 5; 2269 2270 2275 public static final int YES = 1 << 6; 2276 2277 2282 public static final int NO = 1 << 7; 2283 2284 2295 public static final int CANCEL = 1 << 8; 2296 2297 2302 public static final int ABORT = 1 << 9; 2303 2304 2309 public static final int RETRY = 1 << 10; 2310 2311 2316 public static final int IGNORE = 1 << 11; 2317 2318 2322 public static final int OPEN = 1 << 12; 2323 2324 2328 public static final int SAVE = 1 << 13; 2329 2330 2337 public static final int INHERIT_NONE = 0; 2338 2339 2349 public static final int INHERIT_DEFAULT = 1; 2350 2351 2358 public static final int INHERIT_FORCE = 2; 2359 2360 2363 public static final int COLOR_WHITE = 1; 2364 2365 2368 public static final int COLOR_BLACK = 2; 2369 2370 2373 public static final int COLOR_RED = 3; 2374 2375 2378 public static final int COLOR_DARK_RED = 4; 2379 2380 2383 public static final int COLOR_GREEN = 5; 2384 2385 2388 public static final int COLOR_DARK_GREEN = 6; 2389 2390 2393 public static final int COLOR_YELLOW = 7; 2394 2395 2398 public static final int COLOR_DARK_YELLOW = 8; 2399 2400 2403 public static final int COLOR_BLUE = 9; 2404 2405 2408 public static final int COLOR_DARK_BLUE = 10; 2409 2410 2413 public static final int COLOR_MAGENTA = 11; 2414 2415 2418 public static final int COLOR_DARK_MAGENTA = 12; 2419 2420 2423 public static final int COLOR_CYAN = 13; 2424 2425 2428 public static final int COLOR_DARK_CYAN = 14; 2429 2430 2433 public static final int COLOR_GRAY = 15; 2434 2435 2438 public static final int COLOR_DARK_GRAY = 16; 2439 2440 2455 2456 2459 public static final int COLOR_WIDGET_DARK_SHADOW = 17; 2460 2461 2464 public static final int COLOR_WIDGET_NORMAL_SHADOW = 18; 2465 2466 2469 public static final int COLOR_WIDGET_LIGHT_SHADOW = 19; 2470 2471 2474 public static final int COLOR_WIDGET_HIGHLIGHT_SHADOW = 20; 2475 2476 2479 public static final int COLOR_WIDGET_FOREGROUND = 21; 2480 2481 2484 public static final int COLOR_WIDGET_BACKGROUND = 22; 2485 2486 2489 public static final int COLOR_WIDGET_BORDER = 23; 2490 2491 2494 public static final int COLOR_LIST_FOREGROUND = 24; 2495 2496 2499 public static final int COLOR_LIST_BACKGROUND = 25; 2500 2501 2504 public static final int COLOR_LIST_SELECTION = 26; 2505 2506 2509 public static final int COLOR_LIST_SELECTION_TEXT = 27; 2510 2511 2514 public static final int COLOR_INFO_FOREGROUND = 28; 2515 2516 2519 public static final int COLOR_INFO_BACKGROUND = 29; 2520 2521 2524 public static final int COLOR_TITLE_FOREGROUND = 30; 2525 2526 2529 public static final int COLOR_TITLE_BACKGROUND = 31; 2530 2531 2534 public static final int COLOR_TITLE_BACKGROUND_GRADIENT = 32; 2535 2536 2539 public static final int COLOR_TITLE_INACTIVE_FOREGROUND = 33; 2540 2541 2544 public static final int COLOR_TITLE_INACTIVE_BACKGROUND = 34; 2545 2546 2549 public static final int COLOR_TITLE_INACTIVE_BACKGROUND_GRADIENT = 35; 2550 2551 2555 public static final int DRAW_TRANSPARENT = 1 << 0; 2556 2557 2561 public static final int DRAW_DELIMITER = 1 << 1; 2562 2563 2567 public static final int DRAW_TAB = 1 << 2; 2568 2569 2573 public static final int DRAW_MNEMONIC = 1 << 3; 2574 2575 2576 2589 public static final int DELIMITER_SELECTION = 1 << 17; 2590 2591 2605 public static final int LAST_LINE_SELECTION = 1 << 20; 2606 2607 2611 public static final int ERROR_UNSPECIFIED = 1; 2612 2613 2618 public static final int ERROR_NO_HANDLES = 2; 2619 2620 2624 public static final int ERROR_NO_MORE_CALLBACKS = 3; 2625 2626 2630 public static final int ERROR_NULL_ARGUMENT = 4; 2631 2632 2636 public static final int ERROR_INVALID_ARGUMENT = 5; 2637 2638 2643 public static final int ERROR_INVALID_RANGE = 6; 2644 2645 2650 public static final int ERROR_CANNOT_BE_ZERO = 7; 2651 2652 2657 public static final int ERROR_CANNOT_GET_ITEM = 8; 2658 2659 2664 public static final int ERROR_CANNOT_GET_SELECTION = 9; 2665 2666 2672 public static final int ERROR_CANNOT_INVERT_MATRIX = 10; 2673 2674 2679 public static final int ERROR_CANNOT_GET_ITEM_HEIGHT = 11; 2680 2681 2686 public static final int ERROR_CANNOT_GET_TEXT = 12; 2687 2688 2693 public static final int ERROR_CANNOT_SET_TEXT = 13; 2694 2695 2700 public static final int ERROR_ITEM_NOT_ADDED = 14; 2701 2702 2707 public static final int ERROR_ITEM_NOT_REMOVED = 15; 2708 2709 2714 public static final int ERROR_NO_GRAPHICS_LIBRARY = 16; 2715 2716 2721 public static final int ERROR_NOT_IMPLEMENTED = 20; 2722 2723 2728 public static final int ERROR_MENU_NOT_DROP_DOWN = 21; 2729 2730 2736 public static final int ERROR_THREAD_INVALID_ACCESS = 22; 2737 2738 2744 public static final int ERROR_WIDGET_DISPOSED = 24; 2745 2746 2751 public static final int ERROR_MENUITEM_NOT_CASCADE = 27; 2752 2753 2758 public static final int ERROR_CANNOT_SET_SELECTION = 28; 2759 2760 2765 public static final int ERROR_CANNOT_SET_MENU = 29; 2766 2767 2772 public static final int ERROR_CANNOT_SET_ENABLED = 30; 2773 2774 2779 public static final int ERROR_CANNOT_GET_ENABLED = 31; 2780 2781 2786 public static final int ERROR_INVALID_PARENT = 32; 2787 2788 2793 public static final int ERROR_MENU_NOT_BAR = 33; 2794 2795 2800 public static final int ERROR_CANNOT_GET_COUNT = 36; 2801 2802 2807 public static final int ERROR_MENU_NOT_POP_UP = 37; 2808 2809 2814 public static final int ERROR_UNSUPPORTED_DEPTH = 38; 2815 2816 2821 public static final int ERROR_IO = 39; 2822 2823 2828 public static final int ERROR_INVALID_IMAGE = 40; 2829 2830 2836 public static final int ERROR_UNSUPPORTED_FORMAT = 42; 2837 2838 2849 public static final int ERROR_INVALID_SUBCLASS = 43; 2850 2851 2857 public static final int ERROR_GRAPHIC_DISPOSED = 44; 2858 2859 2865 public static final int ERROR_DEVICE_DISPOSED = 45; 2866 2867 2872 public static final int ERROR_FAILED_EXEC = 46; 2873 2874 2881 public static final int ERROR_FAILED_LOAD_LIBRARY = 47; 2882 2883 2889 public static final int ERROR_INVALID_FONT = 48; 2890 2891 2894 public static final int BITMAP = 0; 2895 2896 2899 public static final int ICON = 1; 2900 2901 2906 public static final int IMAGE_COPY = 0; 2907 2908 2914 public static final int IMAGE_DISABLE = 1; 2915 2916 2921 public static final int IMAGE_GRAY = 2; 2922 2923 2927 public static final int NORMAL = 0; 2928 2929 2933 public static final int BOLD = 1 << 0; 2934 2935 2939 public static final int ITALIC = 1 << 1; 2940 2941 2944 public static final int CURSOR_ARROW = 0; 2945 2946 2949 public static final int CURSOR_WAIT = 1; 2950 2951 2954 public static final int CURSOR_CROSS = 2; 2955 2956 2959 public static final int CURSOR_APPSTARTING = 3; 2960 2961 2964 public static final int CURSOR_HELP = 4; 2965 2966 2969 public static final int CURSOR_SIZEALL = 5; 2970 2971 2974 public static final int CURSOR_SIZENESW = 6; 2975 2976 2979 public static final int CURSOR_SIZENS = 7; 2980 2981 2984 public static final int CURSOR_SIZENWSE = 8; 2985 2986 2989 public static final int CURSOR_SIZEWE = 9; 2990 2991 2994 public static final int CURSOR_SIZEN = 10; 2995 2996 2999 public static final int CURSOR_SIZES = 11; 3000 3001 3004 public static final int CURSOR_SIZEE = 12; 3005 3006 3009 public static final int CURSOR_SIZEW = 13; 3010 3011 3014 public static final int CURSOR_SIZENE = 14; 3015 3016 3019 public static final int CURSOR_SIZESE = 15; 3020 3021 3024 public static final int CURSOR_SIZESW = 16; 3025 3026 3029 public static final int CURSOR_SIZENW = 17; 3030 3031 3034 public static final int CURSOR_UPARROW = 18; 3035 3036 3039 public static final int CURSOR_IBEAM = 19; 3040 3041 3044 public static final int CURSOR_NO = 20; 3045 3046 3049 public static final int CURSOR_HAND = 21; 3050 3051 3059 public static final int CAP_FLAT = 1; 3060 3061 3069 public static final int CAP_ROUND = 2; 3070 3071 3079 public static final int CAP_SQUARE = 3; 3080 3081 3089 public static final int JOIN_MITER = 1; 3090 3091 3099 public static final int JOIN_ROUND = 2; 3100 3101 3109 public static final int JOIN_BEVEL = 3; 3110 3111 3114 public static final int LINE_SOLID = 1; 3115 3116 3119 public static final int LINE_DASH = 2; 3120 3121 3124 public static final int LINE_DOT = 3; 3125 3126 3129 public static final int LINE_DASHDOT = 4; 3130 3131 3134 public static final int LINE_DASHDOTDOT = 5; 3135 3136 3144 public static final int LINE_CUSTOM = 6; 3145 3146 3151 public static final int PATH_MOVE_TO = 1; 3152 3153 3158 public static final int PATH_LINE_TO = 2; 3159 3160 3165 public static final int PATH_QUAD_TO = 3; 3166 3167 3172 public static final int PATH_CUBIC_TO = 4; 3173 3174 3179 public static final int PATH_CLOSE = 5; 3180 3181 3186 public static final int FILL_EVEN_ODD = 1; 3187 3188 3193 public static final int FILL_WINDING = 2; 3194 3195 3198 public static final int IMAGE_UNDEFINED = -1; 3199 3200 3203 public static final int IMAGE_BMP = 0; 3204 3205 3209 public static final int IMAGE_BMP_RLE = 1; 3210 3211 3214 public static final int IMAGE_GIF = 2; 3215 3216 3219 public static final int IMAGE_ICO = 3; 3220 3221 3224 public static final int IMAGE_JPEG = 4; 3225 3226 3229 public static final int IMAGE_PNG = 5; 3230 3231 3234 public static final int IMAGE_TIFF = 6; 3235 3236 3239 public static final int IMAGE_OS2_BMP = 7; 3240 3241 3245 public static final int DM_UNSPECIFIED = 0x0; 3246 3247 3252 public static final int DM_FILL_NONE = 0x1; 3253 3254 3259 public static final int DM_FILL_BACKGROUND = 0x2; 3260 3261 3266 public static final int DM_FILL_PREVIOUS = 0x3; 3267 3268 3272 public static final int TRANSPARENCY_NONE = 0x0; 3273 3274 3278 public static final int TRANSPARENCY_ALPHA = 1 << 0; 3279 3280 3284 public static final int TRANSPARENCY_MASK = 1 << 1; 3285 3286 3290 public static final int TRANSPARENCY_PIXEL = 1 << 2; 3291 3292 3301 public static final int MOVEMENT_CHAR = 1 << 0; 3302 3303 3315 public static final int MOVEMENT_CLUSTER = 1 << 1; 3316 3317 3331 public static final int MOVEMENT_WORD = 1 << 2; 3332 3333 3344 public static final int MOVEMENT_WORD_END = 1 << 3; 3345 3346 3356 public static final int MOVEMENT_WORD_START = 1 << 4; 3357 3358 3359 3367static String findErrorText (int code) { 3368 switch (code) { 3369 case ERROR_UNSPECIFIED: return "Unspecified error"; case ERROR_NO_HANDLES: return "No more handles"; case ERROR_NO_MORE_CALLBACKS: return "No more callbacks"; case ERROR_NULL_ARGUMENT: return "Argument cannot be null"; case ERROR_INVALID_ARGUMENT: return "Argument not valid"; case ERROR_INVALID_RANGE: return "Index out of bounds"; case ERROR_CANNOT_BE_ZERO: return "Argument cannot be zero"; case ERROR_CANNOT_GET_ITEM: return "Cannot get item"; case ERROR_CANNOT_GET_SELECTION: return "Cannot get selection"; case ERROR_CANNOT_GET_ITEM_HEIGHT: return "Cannot get item height"; case ERROR_CANNOT_GET_TEXT: return "Cannot get text"; case ERROR_CANNOT_SET_TEXT: return "Cannot set text"; case ERROR_ITEM_NOT_ADDED: return "Item not added"; case ERROR_ITEM_NOT_REMOVED: return "Item not removed"; case ERROR_NOT_IMPLEMENTED: return "Not implemented"; case ERROR_MENU_NOT_DROP_DOWN: return "Menu must be a drop down"; case ERROR_THREAD_INVALID_ACCESS: return "Invalid thread access"; case ERROR_WIDGET_DISPOSED: return "Widget is disposed"; case ERROR_MENUITEM_NOT_CASCADE: return "Menu item is not a CASCADE"; case ERROR_CANNOT_SET_SELECTION: return "Cannot set selection"; case ERROR_CANNOT_SET_MENU: return "Cannot set menu"; case ERROR_CANNOT_SET_ENABLED: return "Cannot set the enabled state"; case ERROR_CANNOT_GET_ENABLED: return "Cannot get the enabled state"; case ERROR_INVALID_PARENT: return "Widget has the wrong parent"; case ERROR_MENU_NOT_BAR: return "Menu is not a BAR"; case ERROR_CANNOT_GET_COUNT: return "Cannot get count"; case ERROR_MENU_NOT_POP_UP: return "Menu is not a POP_UP"; case ERROR_UNSUPPORTED_DEPTH: return "Unsupported color depth"; case ERROR_IO: return "i/o error"; case ERROR_INVALID_IMAGE: return "Invalid image"; case ERROR_UNSUPPORTED_FORMAT: return "Unsupported or unrecognized format"; case ERROR_INVALID_SUBCLASS: return "Subclassing not allowed"; case ERROR_GRAPHIC_DISPOSED: return "Graphic is disposed"; case ERROR_DEVICE_DISPOSED: return "Device is disposed"; case ERROR_FAILED_EXEC: return "Failed to execute runnable"; case ERROR_FAILED_LOAD_LIBRARY: return "Unable to load library"; case ERROR_CANNOT_INVERT_MATRIX: return "Cannot invert matrix"; case ERROR_NO_GRAPHICS_LIBRARY: return "Unable to load graphics library"; case ERROR_INVALID_FONT: return "Font not valid"; } 3409 return "Unknown error"; } 3411 3412 3422public static String getMessage(String key) { 3423 return Compatibility.getMessage(key); 3424} 3425 3426 3432public static String getPlatform () { 3433 return Platform.PLATFORM; 3434} 3435 3436 3442public static int getVersion () { 3443 return Library.SWT_VERSION; 3444} 3445 3446 3451public static void error (int code) { 3452 error (code, null); 3453} 3454 3455 3480public static void error (int code, Throwable throwable) { 3481 error (code, throwable, null); 3482} 3483 3484 3512public static void error (int code, Throwable throwable, String detail) { 3513 3514 3528 if (code != SWT.ERROR_FAILED_EXEC) { 3529 if (throwable instanceof SWTError) throw (SWTError) throwable; 3530 if (throwable instanceof SWTException) throw (SWTException) throwable; 3531 } 3532 3533 String message = findErrorText (code); 3534 if (detail != null) message += detail; 3535 switch (code) { 3536 3537 3538 case ERROR_NULL_ARGUMENT: 3539 case ERROR_CANNOT_BE_ZERO: 3540 case ERROR_INVALID_ARGUMENT: 3541 case ERROR_MENU_NOT_BAR: 3542 case ERROR_MENU_NOT_DROP_DOWN: 3543 case ERROR_MENU_NOT_POP_UP: 3544 case ERROR_MENUITEM_NOT_CASCADE: 3545 case ERROR_INVALID_PARENT: 3546 case ERROR_INVALID_RANGE: { 3547 throw new IllegalArgumentException (message); 3548 } 3549 3550 3551 case ERROR_INVALID_SUBCLASS: 3552 case ERROR_THREAD_INVALID_ACCESS: 3553 case ERROR_WIDGET_DISPOSED: 3554 case ERROR_GRAPHIC_DISPOSED: 3555 case ERROR_DEVICE_DISPOSED: 3556 case ERROR_INVALID_IMAGE: 3557 case ERROR_UNSUPPORTED_DEPTH: 3558 case ERROR_UNSUPPORTED_FORMAT: 3559 case ERROR_FAILED_EXEC: 3560 case ERROR_CANNOT_INVERT_MATRIX: 3561 case ERROR_NO_GRAPHICS_LIBRARY: 3562 case ERROR_IO: { 3563 SWTException exception = new SWTException (code, message); 3564 exception.throwable = throwable; 3565 throw exception; 3566 } 3567 3568 3569 case ERROR_CANNOT_GET_COUNT: 3570 case ERROR_CANNOT_GET_ENABLED: 3571 case ERROR_CANNOT_GET_ITEM: 3572 case ERROR_CANNOT_GET_ITEM_HEIGHT: 3573 case ERROR_CANNOT_GET_SELECTION: 3574 case ERROR_CANNOT_GET_TEXT: 3575 case ERROR_CANNOT_SET_ENABLED: 3576 case ERROR_CANNOT_SET_MENU: 3577 case ERROR_CANNOT_SET_SELECTION: 3578 case ERROR_CANNOT_SET_TEXT: 3579 case ERROR_ITEM_NOT_ADDED: 3580 case ERROR_ITEM_NOT_REMOVED: 3581 case ERROR_NO_HANDLES: 3582 3584 3585 case ERROR_FAILED_LOAD_LIBRARY: 3586 case ERROR_NO_MORE_CALLBACKS: 3587 case ERROR_NOT_IMPLEMENTED: 3588 case ERROR_UNSPECIFIED: { 3589 SWTError error = new SWTError (code, message); 3590 error.throwable = throwable; 3591 throw error; 3592 } 3593 } 3594 3595 3596 SWTError error = new SWTError (code, message); 3597 error.throwable = throwable; 3598 throw error; 3599} 3600 3601static { 3602 3607 BUTTON_MASK = BUTTON1 | BUTTON2 | BUTTON3 | BUTTON4 | BUTTON5; 3608 MODIFIER_MASK = ALT | SHIFT | CTRL | COMMAND; 3609 3610 3615 String platform = getPlatform (); 3616 if ("carbon".equals (platform)) { MOD1 = COMMAND; 3618 MOD2 = SHIFT; 3619 MOD3 = ALT; 3620 MOD4 = CONTROL; 3621 } else { 3622 MOD1 = CONTROL; 3623 MOD2 = SHIFT; 3624 MOD3 = ALT; 3625 MOD4 = 0; 3626 } 3627} 3628} 3629 | Popular Tags |