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
|
/*
* Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package apple.laf;
import java.nio.ByteBuffer;
import java.lang.annotation.Native;
public final class JRSUIConstants {
/**
* There is no way to get width of focus border, so it is hardcoded here.
* All components, which can be focused should take care about it.
*/
public static final int FOCUS_SIZE = 4;
private static native long getPtrForConstant(final int constant);
static class Key {
@Native protected static final int _value = 20;
public static final Key VALUE = new Key(_value);
@Native protected static final int _thumbProportion = 24;
public static final Key THUMB_PROPORTION = new Key(_thumbProportion);
@Native protected static final int _thumbStart = 25;
public static final Key THUMB_START = new Key(_thumbStart);
@Native protected static final int _windowTitleBarHeight = 28;
public static final Key WINDOW_TITLE_BAR_HEIGHT = new Key(_windowTitleBarHeight);
@Native protected static final int _animationFrame = 23;
public static final Key ANIMATION_FRAME = new Key(_animationFrame);
final int constant;
private long ptr;
private Key(final int constant) {
this.constant = constant;
}
long getConstantPtr() {
if (ptr != 0) return ptr;
ptr = getPtrForConstant(constant);
if (ptr != 0) return ptr;
throw new RuntimeException("Constant not implemented in native: " + this);
}
private String getConstantName(Key hit) {
if (hit == VALUE) {
return "VALUE";
} else if (hit == THUMB_PROPORTION) {
return "THUMB_PROPORTION";
} else if (hit == THUMB_START) {
return "THUMB_START";
} else if (hit == WINDOW_TITLE_BAR_HEIGHT) {
return "WINDOW_TITLE_BAR_HEIGHT";
} else if (hit == ANIMATION_FRAME) {
return "ANIMATION_FRAME";
}
return getClass().getSimpleName();
}
public String toString() {
return getConstantName(this) + (ptr == 0 ? "(unlinked)" : "");
}
}
static class DoubleValue {
@Native protected static final byte TYPE_CODE = 1;
final double doubleValue;
DoubleValue(final double doubleValue) {
this.doubleValue = doubleValue;
}
public byte getTypeCode() {
return TYPE_CODE;
}
public void putValueInBuffer(final ByteBuffer buffer) {
buffer.putDouble(doubleValue);
}
public boolean equals(final Object obj) {
return (obj instanceof DoubleValue) && (((DoubleValue)obj).doubleValue == doubleValue);
}
public int hashCode() {
final long bits = Double.doubleToLongBits(doubleValue);
return (int)(bits ^ (bits >>> 32));
}
public String toString() {
return Double.toString(doubleValue);
}
}
static class PropertyEncoding {
final long mask;
final byte shift;
PropertyEncoding(final long mask, final byte shift) {
this.mask = mask;
this.shift = shift;
}
}
static class Property {
final PropertyEncoding encoding;
final long value;
final byte ordinal;
Property(final PropertyEncoding encoding, final byte ordinal) {
this.encoding = encoding;
this.value = ((long)ordinal) << encoding.shift;
this.ordinal = ordinal;
}
/**
* Applies this property value to the provided state
* @param encodedState the incoming JRSUI encoded state
* @return the composite of the provided JRSUI encoded state and this value
*/
public long apply(final long encodedState) {
return (encodedState & ~encoding.mask) | value;
}
public String toString() {
return getClass().getSimpleName();
}
}
public static class Size extends Property {
@Native private static final byte SHIFT = 0;
@Native private static final byte SIZE = 3;
@Native private static final long MASK = (long)0x7 << SHIFT;
private static final PropertyEncoding size = new PropertyEncoding(MASK, SHIFT);
Size(final byte value) {
super(size, value);
}
@Native private static final byte _mini = 1;
public static final Size MINI = new Size(_mini);
@Native private static final byte _small = 2;
public static final Size SMALL = new Size(_small);
@Native private static final byte _regular = 3;
public static final Size REGULAR = new Size(_regular);
@Native private static final byte _large = 4;
public static final Size LARGE = new Size(_large);
}
public static class State extends Property {
@Native private static final byte SHIFT = Size.SHIFT + Size.SIZE;
@Native private static final byte SIZE = 4;
@Native private static final long MASK = (long)0xF << SHIFT;
private static final PropertyEncoding state = new PropertyEncoding(MASK, SHIFT);
State(final byte value) {
super(state, value);
}
@Native private static final byte _active = 1;
public static final State ACTIVE = new State(_active);
@Native private static final byte _inactive = 2;
public static final State INACTIVE = new State(_inactive);
@Native private static final byte _disabled = 3;
public static final State DISABLED = new State(_disabled);
@Native private static final byte _pressed = 4;
public static final State PRESSED = new State(_pressed);
@Native private static final byte _pulsed = 5;
public static final State PULSED = new State(_pulsed);
@Native private static final byte _rollover = 6;
public static final State ROLLOVER = new State(_rollover);
@Native private static final byte _drag = 7;
public static final State DRAG = new State(_drag);
}
public static class Direction extends Property {
@Native private static final byte SHIFT = State.SHIFT + State.SIZE;
@Native private static final byte SIZE = 4;
@Native private static final long MASK = (long)0xF << SHIFT;
private static final PropertyEncoding direction = new PropertyEncoding(MASK, SHIFT);
Direction(final byte value) {
super(direction, value);
}
@Native private static final byte _none = 1;
public static final Direction NONE = new Direction(_none);
@Native private static final byte _up = 2;
public static final Direction UP = new Direction(_up);
@Native private static final byte _down = 3;
public static final Direction DOWN = new Direction(_down);
@Native private static final byte _left = 4;
public static final Direction LEFT = new Direction(_left);
@Native private static final byte _right = 5;
public static final Direction RIGHT = new Direction(_right);
@Native private static final byte _north = 6;
public static final Direction NORTH = new Direction(_north);
@Native private static final byte _south = 7;
public static final Direction SOUTH = new Direction(_south);
@Native private static final byte _east = 8;
public static final Direction EAST = new Direction(_east);
@Native private static final byte _west = 9;
public static final Direction WEST = new Direction(_west);
}
public static class Orientation extends Property {
@Native private static final byte SHIFT = Direction.SHIFT + Direction.SIZE;
@Native private static final byte SIZE = 2;
@Native private static final long MASK = (long)0x3 << SHIFT;
private static final PropertyEncoding orientation = new PropertyEncoding(MASK, SHIFT);
Orientation(final byte value) {
super(orientation, value);
}
@Native private static final byte _horizontal = 1;
public static final Orientation HORIZONTAL = new Orientation(_horizontal);
@Native private static final byte _vertical = 2;
public static final Orientation VERTICAL = new Orientation(_vertical);
}
public static class AlignmentVertical extends Property {
@Native private static final byte SHIFT = Orientation.SHIFT + Orientation.SIZE;
@Native private static final byte SIZE = 2;
@Native private static final long MASK = (long)0x3 << SHIFT;
private static final PropertyEncoding alignmentVertical = new PropertyEncoding(MASK, SHIFT);
AlignmentVertical(final byte value){
super(alignmentVertical, value);
}
@Native private static final byte _top = 1;
public static final AlignmentVertical TOP = new AlignmentVertical(_top);
@Native private static final byte _center = 2;
public static final AlignmentVertical CENTER = new AlignmentVertical(_center);
@Native private static final byte _bottom = 3;
public static final AlignmentVertical BOTTOM = new AlignmentVertical(_bottom);
}
public static class AlignmentHorizontal extends Property {
@Native private static final byte SHIFT = AlignmentVertical.SHIFT + AlignmentVertical.SIZE;
@Native private static final byte SIZE = 2;
@Native private static final long MASK = (long)0x3 << SHIFT;
private static final PropertyEncoding alignmentHorizontal = new PropertyEncoding(MASK, SHIFT);
AlignmentHorizontal(final byte value){
super(alignmentHorizontal, value);
}
@Native private static final byte _left = 1;
public static final AlignmentHorizontal LEFT = new AlignmentHorizontal(_left);
@Native private static final byte _center = 2;
public static final AlignmentHorizontal CENTER = new AlignmentHorizontal(_center);
@Native private static final byte _right = 3;
public static final AlignmentHorizontal RIGHT = new AlignmentHorizontal(_right);
}
public static class SegmentPosition extends Property {
@Native private static final byte SHIFT = AlignmentHorizontal.SHIFT + AlignmentHorizontal.SIZE;
@Native private static final byte SIZE = 3;
@Native private static final long MASK = (long)0x7 << SHIFT;
private static final PropertyEncoding segmentPosition = new PropertyEncoding(MASK, SHIFT);
SegmentPosition(final byte value) {
super(segmentPosition, value);
}
@Native private static final byte _first = 1;
public static final SegmentPosition FIRST = new SegmentPosition(_first);
@Native private static final byte _middle = 2;
public static final SegmentPosition MIDDLE = new SegmentPosition(_middle);
@Native private static final byte _last = 3;
public static final SegmentPosition LAST = new SegmentPosition(_last);
@Native private static final byte _only = 4;
public static final SegmentPosition ONLY = new SegmentPosition(_only);
}
public static class ScrollBarPart extends Property {
@Native private static final byte SHIFT = SegmentPosition.SHIFT + SegmentPosition.SIZE;
@Native private static final byte SIZE = 4;
@Native private static final long MASK = (long)0xF << SHIFT;
private static final PropertyEncoding scrollBarPart = new PropertyEncoding(MASK, SHIFT);
ScrollBarPart(final byte value) {
super(scrollBarPart, value);
}
@Native private static final byte _none = 1;
public static final ScrollBarPart NONE = new ScrollBarPart(_none);
@Native private static final byte _thumb = 2;
public static final ScrollBarPart THUMB = new ScrollBarPart(_thumb);
@Native private static final byte _arrowMin = 3;
public static final ScrollBarPart ARROW_MIN = new ScrollBarPart(_arrowMin);
@Native private static final byte _arrowMax = 4;
public static final ScrollBarPart ARROW_MAX = new ScrollBarPart(_arrowMax);
@Native private static final byte _arrowMaxInside = 5;
public static final ScrollBarPart ARROW_MAX_INSIDE = new ScrollBarPart(_arrowMaxInside);
@Native private static final byte _arrowMinInside = 6;
public static final ScrollBarPart ARROW_MIN_INSIDE = new ScrollBarPart(_arrowMinInside);
@Native private static final byte _trackMin = 7;
public static final ScrollBarPart TRACK_MIN = new ScrollBarPart(_trackMin);
@Native private static final byte _trackMax = 8;
public static final ScrollBarPart TRACK_MAX = new ScrollBarPart(_trackMax);
}
public static class Variant extends Property {
@Native private static final byte SHIFT = ScrollBarPart.SHIFT + ScrollBarPart.SIZE;
@Native private static final byte SIZE = 4;
@Native private static final long MASK = (long)0xF << SHIFT;
private static final PropertyEncoding variant = new PropertyEncoding(MASK, SHIFT);
Variant(final byte value) {
super(variant, value);
}
@Native private static final byte _menuGlyph = 1;
public static final Variant MENU_GLYPH = new Variant(_menuGlyph);
@Native private static final byte _menuPopup = Variant._menuGlyph + 1;
public static final Variant MENU_POPUP = new Variant(_menuPopup);
@Native private static final byte _menuPulldown = Variant._menuPopup + 1;
public static final Variant MENU_PULLDOWN = new Variant(_menuPulldown);
@Native private static final byte _menuHierarchical = Variant._menuPulldown + 1;
public static final Variant MENU_HIERARCHICAL = new Variant(_menuHierarchical);
@Native private static final byte _gradientListBackgroundEven = Variant._menuHierarchical + 1;
public static final Variant GRADIENT_LIST_BACKGROUND_EVEN = new Variant(_gradientListBackgroundEven);
@Native private static final byte _gradientListBackgroundOdd = Variant._gradientListBackgroundEven + 1;
public static final Variant GRADIENT_LIST_BACKGROUND_ODD = new Variant(_gradientListBackgroundOdd);
@Native private static final byte _gradientSideBar = Variant._gradientListBackgroundOdd + 1;
public static final Variant GRADIENT_SIDE_BAR = new Variant(_gradientSideBar);
@Native private static final byte _gradientSideBarSelection = Variant._gradientSideBar + 1;
public static final Variant GRADIENT_SIDE_BAR_SELECTION = new Variant(_gradientSideBarSelection);
@Native private static final byte _gradientSideBarFocusedSelection = Variant._gradientSideBarSelection + 1;
public static final Variant GRADIENT_SIDE_BAR_FOCUSED_SELECTION = new Variant(_gradientSideBarFocusedSelection);
}
public static class WindowType extends Property {
@Native private static final byte SHIFT = Variant.SHIFT + Variant.SIZE;
@Native private static final byte SIZE = 2;
@Native private static final long MASK = (long)0x3 << SHIFT;
private static final PropertyEncoding windowType = new PropertyEncoding(MASK, SHIFT);
WindowType(final byte value){
super(windowType, value);
}
@Native private static final byte _document = 1;
public static final WindowType DOCUMENT = new WindowType(_document);
@Native private static final byte _utility = 2;
public static final WindowType UTILITY = new WindowType(_utility);
@Native private static final byte _titlelessUtility = 3;
public static final WindowType TITLELESS_UTILITY = new WindowType(_titlelessUtility);
}
public static class Focused extends Property {
@Native private static final byte SHIFT = WindowType.SHIFT + WindowType.SIZE;
@Native private static final byte SIZE = 1;
@Native private static final long MASK = (long)0x1 << SHIFT;
private static final PropertyEncoding focused = new PropertyEncoding(MASK, SHIFT);
Focused(final byte value) {
super(focused, value);
}
@Native private static final byte _no = 0;
public static final Focused NO = new Focused(_no);
@Native private static final byte _yes = 1;
public static final Focused YES = new Focused(_yes);
}
public static class IndicatorOnly extends Property {
@Native private static final byte SHIFT = Focused.SHIFT + Focused.SIZE;
@Native private static final byte SIZE = 1;
@Native private static final long MASK = (long)0x1 << SHIFT;
private static final PropertyEncoding indicatorOnly = new PropertyEncoding(MASK, SHIFT);
IndicatorOnly(final byte value) {
super(indicatorOnly, value);
}
@Native private static final byte _no = 0;
public static final IndicatorOnly NO = new IndicatorOnly(_no);
@Native private static final byte _yes = 1;
public static final IndicatorOnly YES = new IndicatorOnly(_yes);
}
public static class NoIndicator extends Property {
@Native private static final byte SHIFT = IndicatorOnly.SHIFT + IndicatorOnly.SIZE;
@Native private static final byte SIZE = 1;
@Native private static final long MASK = (long)0x1 << SHIFT;
private static final PropertyEncoding noIndicator = new PropertyEncoding(MASK, SHIFT);
NoIndicator(final byte value) {
super(noIndicator, value);
}
@Native private static final byte _no = 0;
public static final NoIndicator NO = new NoIndicator(_no);
@Native private static final byte _yes = 1;
public static final NoIndicator YES = new NoIndicator(_yes);
}
public static class ArrowsOnly extends Property {
@Native private static final byte SHIFT = NoIndicator.SHIFT + NoIndicator.SIZE;
@Native private static final byte SIZE = 1;
@Native private static final long MASK = (long)0x1 << SHIFT;
private static final PropertyEncoding focused = new PropertyEncoding(MASK, SHIFT);
ArrowsOnly(final byte value) {
super(focused, value);
}
@Native private static final byte _no = 0;
public static final ArrowsOnly NO = new ArrowsOnly(_no);
@Native private static final byte _yes = 1;
public static final ArrowsOnly YES = new ArrowsOnly(_yes);
}
public static class FrameOnly extends Property {
@Native private static final byte SHIFT = ArrowsOnly.SHIFT + ArrowsOnly.SIZE;
@Native private static final byte SIZE = 1;
@Native private static final long MASK = (long)0x1 << SHIFT;
private static final PropertyEncoding focused = new PropertyEncoding(MASK, SHIFT);
FrameOnly(final byte value) {
super(focused, value);
}
@Native private static final byte _no = 0;
public static final FrameOnly NO = new FrameOnly(_no);
@Native private static final byte _yes = 1;
public static final FrameOnly YES = new FrameOnly(_yes);
}
public static class SegmentTrailingSeparator extends Property {
@Native private static final byte SHIFT = FrameOnly.SHIFT + FrameOnly.SIZE;
@Native private static final byte SIZE = 1;
@Native private static final long MASK = (long)0x1 << SHIFT;
private static final PropertyEncoding focused = new PropertyEncoding(MASK, SHIFT);
SegmentTrailingSeparator(final byte value) {
super(focused, value);
}
@Native private static final byte _no = 0;
public static final SegmentTrailingSeparator NO = new SegmentTrailingSeparator(_no);
@Native private static final byte _yes = 1;
public static final SegmentTrailingSeparator YES = new SegmentTrailingSeparator(_yes);
}
public static class SegmentLeadingSeparator extends Property {
@Native private static final byte SHIFT = SegmentTrailingSeparator.SHIFT + SegmentTrailingSeparator.SIZE;
@Native private static final byte SIZE = 1;
@Native private static final long MASK = (long)0x1 << SHIFT;
private static final PropertyEncoding leadingSeparator = new PropertyEncoding(MASK, SHIFT);
SegmentLeadingSeparator(final byte value) {
super(leadingSeparator, value);
}
@Native private static final byte _no = 0;
public static final SegmentLeadingSeparator NO = new SegmentLeadingSeparator(_no);
@Native private static final byte _yes = 1;
public static final SegmentLeadingSeparator YES = new SegmentLeadingSeparator(_yes);
}
public static class NothingToScroll extends Property {
@Native private static final byte SHIFT = SegmentLeadingSeparator.SHIFT + SegmentLeadingSeparator.SIZE;
@Native private static final byte SIZE = 1;
@Native private static final long MASK = (long)0x1 << SHIFT;
private static final PropertyEncoding focused = new PropertyEncoding(MASK, SHIFT);
NothingToScroll(final byte value) {
super(focused, value);
}
@Native private static final byte _no = 0;
public static final NothingToScroll NO = new NothingToScroll(_no);
@Native private static final byte _yes = 1;
public static final NothingToScroll YES = new NothingToScroll(_yes);
}
public static class WindowTitleBarSeparator extends Property {
@Native private static final byte SHIFT = NothingToScroll.SHIFT + NothingToScroll.SIZE;
@Native private static final byte SIZE = 1;
@Native private static final long MASK = (long)0x1 << SHIFT;
private static final PropertyEncoding focused = new PropertyEncoding(MASK, SHIFT);
WindowTitleBarSeparator(final byte value) {
super(focused, value);
}
@Native private static final byte _no = 0;
public static final WindowTitleBarSeparator NO = new WindowTitleBarSeparator(_no);
@Native private static final byte _yes = 1;
public static final WindowTitleBarSeparator YES = new WindowTitleBarSeparator(_yes);
}
public static class WindowClipCorners extends Property {
@Native private static final byte SHIFT = WindowTitleBarSeparator.SHIFT + WindowTitleBarSeparator.SIZE;
@Native private static final byte SIZE = 1;
@Native private static final long MASK = (long)0x1 << SHIFT;
private static final PropertyEncoding focused = new PropertyEncoding(MASK, SHIFT);
WindowClipCorners(final byte value) {
super(focused, value);
}
@Native private static final byte _no = 0;
public static final WindowClipCorners NO = new WindowClipCorners(_no);
@Native private static final byte _yes = 1;
public static final WindowClipCorners YES = new WindowClipCorners(_yes);
}
public static class ShowArrows extends Property {
@Native private static final byte SHIFT = WindowClipCorners.SHIFT + WindowClipCorners.SIZE;
@Native private static final byte SIZE = 1;
@Native private static final long MASK = (long)0x1 << SHIFT;
private static final PropertyEncoding showArrows = new PropertyEncoding(MASK, SHIFT);
ShowArrows(final byte value) {
super(showArrows, value);
}
@Native private static final byte _no = 0;
public static final ShowArrows NO = new ShowArrows(_no);
@Native private static final byte _yes = 1;
public static final ShowArrows YES = new ShowArrows(_yes);
}
public static class BooleanValue extends Property {
@Native private static final byte SHIFT = ShowArrows.SHIFT + ShowArrows.SIZE;
@Native private static final byte SIZE = 1;
@Native private static final long MASK = (long)0x1 << SHIFT;
private static final PropertyEncoding booleanValue = new PropertyEncoding(MASK, SHIFT);
BooleanValue(final byte value) {
super(booleanValue, value);
}
@Native private static final byte _no = 0;
public static final BooleanValue NO = new BooleanValue(_no);
@Native private static final byte _yes = 1;
public static final BooleanValue YES = new BooleanValue(_yes);
}
public static class Animating extends Property {
@Native private static final byte SHIFT = BooleanValue.SHIFT + BooleanValue.SIZE;
@Native private static final byte SIZE = 1;
@Native private static final long MASK = (long)0x1 << SHIFT;
private static final PropertyEncoding animating = new PropertyEncoding(MASK, SHIFT);
Animating(final byte value) {
super(animating, value);
}
@Native private static final byte _no = 0;
public static final Animating NO = new Animating(_no);
@Native private static final byte _yes = 1;
public static final Animating YES = new Animating(_yes);
}
public static class Widget extends Property {
@Native private static final byte SHIFT = Animating.SHIFT + Animating.SIZE;
@Native private static final byte SIZE = 7;
@Native private static final long MASK = (long)0x7F << SHIFT;
private static final PropertyEncoding widget = new PropertyEncoding(MASK, SHIFT);
Widget(final byte constant) {
super(widget, constant);
}
@Native private static final byte _background = 1;
public static final Widget BACKGROUND = new Widget(_background);
@Native private static final byte _buttonBevel = _background + 1;
public static final Widget BUTTON_BEVEL = new Widget(_buttonBevel);
@Native private static final byte _buttonBevelInset = _buttonBevel + 1;
public static final Widget BUTTON_BEVEL_INSET = new Widget(_buttonBevelInset);
@Native private static final byte _buttonBevelRound = _buttonBevelInset + 1;
public static final Widget BUTTON_BEVEL_ROUND = new Widget(_buttonBevelRound);
@Native private static final byte _buttonCheckBox = _buttonBevelRound + 1;
public static final Widget BUTTON_CHECK_BOX = new Widget(_buttonCheckBox);
@Native private static final byte _buttonComboBox = _buttonCheckBox + 1;
public static final Widget BUTTON_COMBO_BOX = new Widget(_buttonComboBox);
@Native private static final byte _buttonComboBoxInset = _buttonComboBox + 1;
public static final Widget BUTTON_COMBO_BOX_INSET = new Widget(_buttonComboBoxInset); // not hooked up in JRSUIConstants.m
@Native private static final byte _buttonDisclosure = _buttonComboBoxInset + 1;
public static final Widget BUTTON_DISCLOSURE = new Widget(_buttonDisclosure);
@Native private static final byte _buttonListHeader = _buttonDisclosure + 1;
public static final Widget BUTTON_LIST_HEADER = new Widget(_buttonListHeader);
@Native private static final byte _buttonLittleArrows = _buttonListHeader + 1;
public static final Widget BUTTON_LITTLE_ARROWS = new Widget(_buttonLittleArrows);
@Native private static final byte _buttonPopDown = _buttonLittleArrows + 1;
public static final Widget BUTTON_POP_DOWN = new Widget(_buttonPopDown);
@Native private static final byte _buttonPopDownInset = _buttonPopDown + 1;
public static final Widget BUTTON_POP_DOWN_INSET = new Widget(_buttonPopDownInset);
@Native private static final byte _buttonPopDownSquare = _buttonPopDownInset + 1;
public static final Widget BUTTON_POP_DOWN_SQUARE = new Widget(_buttonPopDownSquare);
@Native private static final byte _buttonPopUp = _buttonPopDownSquare + 1;
public static final Widget BUTTON_POP_UP = new Widget(_buttonPopUp);
@Native private static final byte _buttonPopUpInset = _buttonPopUp + 1;
public static final Widget BUTTON_POP_UP_INSET = new Widget(_buttonPopUpInset);
@Native private static final byte _buttonPopUpSquare = _buttonPopUpInset + 1;
public static final Widget BUTTON_POP_UP_SQUARE = new Widget(_buttonPopUpSquare);
@Native private static final byte _buttonPush = _buttonPopUpSquare + 1;
public static final Widget BUTTON_PUSH = new Widget(_buttonPush);
@Native private static final byte _buttonPushScope = _buttonPush + 1;
public static final Widget BUTTON_PUSH_SCOPE = new Widget(_buttonPushScope);
@Native private static final byte _buttonPushScope2 = _buttonPushScope + 1;
public static final Widget BUTTON_PUSH_SCOPE2 = new Widget(_buttonPushScope2);
@Native private static final byte _buttonPushTextured = _buttonPushScope2 + 1;
public static final Widget BUTTON_PUSH_TEXTURED = new Widget(_buttonPushTextured);
@Native private static final byte _buttonPushInset = _buttonPushTextured + 1;
public static final Widget BUTTON_PUSH_INSET = new Widget(_buttonPushInset);
@Native private static final byte _buttonPushInset2 = _buttonPushInset + 1;
public static final Widget BUTTON_PUSH_INSET2 = new Widget(_buttonPushInset2);
@Native private static final byte _buttonRadio = _buttonPushInset2 + 1;
public static final Widget BUTTON_RADIO = new Widget(_buttonRadio);
@Native private static final byte _buttonRound = _buttonRadio + 1;
public static final Widget BUTTON_ROUND = new Widget(_buttonRound);
@Native private static final byte _buttonRoundHelp = _buttonRound + 1;
public static final Widget BUTTON_ROUND_HELP = new Widget(_buttonRoundHelp);
@Native private static final byte _buttonRoundInset = _buttonRoundHelp + 1;
public static final Widget BUTTON_ROUND_INSET = new Widget(_buttonRoundInset);
@Native private static final byte _buttonRoundInset2 =_buttonRoundInset + 1;
public static final Widget BUTTON_ROUND_INSET2 = new Widget(_buttonRoundInset2);
@Native private static final byte _buttonSearchFieldCancel = _buttonRoundInset2 + 1;
public static final Widget BUTTON_SEARCH_FIELD_CANCEL = new Widget(_buttonSearchFieldCancel);
@Native private static final byte _buttonSearchFieldFind = _buttonSearchFieldCancel + 1;
public static final Widget BUTTON_SEARCH_FIELD_FIND = new Widget(_buttonSearchFieldFind);
@Native private static final byte _buttonSegmented = _buttonSearchFieldFind + 1;
public static final Widget BUTTON_SEGMENTED = new Widget(_buttonSegmented);
@Native private static final byte _buttonSegmentedInset = _buttonSegmented + 1;
public static final Widget BUTTON_SEGMENTED_INSET = new Widget(_buttonSegmentedInset);
@Native private static final byte _buttonSegmentedInset2 = _buttonSegmentedInset + 1;
public static final Widget BUTTON_SEGMENTED_INSET2 = new Widget(_buttonSegmentedInset2);
@Native private static final byte _buttonSegmentedSCurve = _buttonSegmentedInset2 + 1;
public static final Widget BUTTON_SEGMENTED_SCURVE = new Widget(_buttonSegmentedSCurve);
@Native private static final byte _buttonSegmentedTextured = _buttonSegmentedSCurve + 1;
public static final Widget BUTTON_SEGMENTED_TEXTURED = new Widget(_buttonSegmentedTextured);
@Native private static final byte _buttonSegmentedToolbar = _buttonSegmentedTextured + 1;
public static final Widget BUTTON_SEGMENTED_TOOLBAR = new Widget(_buttonSegmentedToolbar);
@Native private static final byte _dial = _buttonSegmentedToolbar + 1;
public static final Widget DIAL = new Widget(_dial);
@Native private static final byte _disclosureTriangle = _dial + 1;
public static final Widget DISCLOSURE_TRIANGLE = new Widget(_disclosureTriangle);
@Native private static final byte _dividerGrabber = _disclosureTriangle + 1;
public static final Widget DIVIDER_GRABBER = new Widget(_dividerGrabber);
@Native private static final byte _dividerSeparatorBar = _dividerGrabber + 1;
public static final Widget DIVIDER_SEPARATOR_BAR = new Widget(_dividerSeparatorBar);
@Native private static final byte _dividerSplitter = _dividerSeparatorBar + 1;
public static final Widget DIVIDER_SPLITTER = new Widget(_dividerSplitter);
@Native private static final byte _focus = _dividerSplitter + 1;
public static final Widget FOCUS = new Widget(_focus);
@Native private static final byte _frameGroupBox = _focus + 1;
public static final Widget FRAME_GROUP_BOX = new Widget(_frameGroupBox);
@Native private static final byte _frameGroupBoxSecondary = _frameGroupBox + 1;
public static final Widget FRAME_GROUP_BOX_SECONDARY = new Widget(_frameGroupBoxSecondary);
@Native private static final byte _frameListBox = _frameGroupBoxSecondary + 1;
public static final Widget FRAME_LIST_BOX = new Widget(_frameListBox);
@Native private static final byte _framePlacard = _frameListBox + 1;
public static final Widget FRAME_PLACARD = new Widget(_framePlacard);
@Native private static final byte _frameTextField = _framePlacard + 1;
public static final Widget FRAME_TEXT_FIELD = new Widget(_frameTextField);
@Native private static final byte _frameTextFieldRound = _frameTextField + 1;
public static final Widget FRAME_TEXT_FIELD_ROUND = new Widget(_frameTextFieldRound);
@Native private static final byte _frameWell = _frameTextFieldRound + 1;
public static final Widget FRAME_WELL = new Widget(_frameWell);
@Native private static final byte _growBox = _frameWell + 1;
public static final Widget GROW_BOX = new Widget(_growBox);
@Native private static final byte _growBoxTextured = _growBox + 1;
public static final Widget GROW_BOX_TEXTURED = new Widget(_growBoxTextured);
@Native private static final byte _gradient = _growBoxTextured + 1;
public static final Widget GRADIENT = new Widget(_gradient);
@Native private static final byte _menu = _gradient + 1;
public static final Widget MENU = new Widget(_menu);
@Native private static final byte _menuItem = _menu + 1;
public static final Widget MENU_ITEM = new Widget(_menuItem);
@Native private static final byte _menuBar = _menuItem + 1;
public static final Widget MENU_BAR = new Widget(_menuBar);
@Native private static final byte _menuTitle = _menuBar + 1;
public static final Widget MENU_TITLE = new Widget(_menuTitle);
@Native private static final byte _progressBar = _menuTitle + 1;
public static final Widget PROGRESS_BAR = new Widget(_progressBar);
@Native private static final byte _progressIndeterminateBar = _progressBar + 1;
public static final Widget PROGRESS_INDETERMINATE_BAR = new Widget(_progressIndeterminateBar);
@Native private static final byte _progressRelevance = _progressIndeterminateBar + 1;
public static final Widget PROGRESS_RELEVANCE = new Widget(_progressRelevance);
@Native private static final byte _progressSpinner = _progressRelevance + 1;
public static final Widget PROGRESS_SPINNER = new Widget(_progressSpinner);
@Native private static final byte _scrollBar = _progressSpinner + 1;
public static final Widget SCROLL_BAR = new Widget(_scrollBar);
@Native private static final byte _scrollColumnSizer = _scrollBar + 1;
public static final Widget SCROLL_COLUMN_SIZER = new Widget(_scrollColumnSizer);
@Native private static final byte _slider = _scrollColumnSizer + 1;
public static final Widget SLIDER = new Widget(_slider);
@Native private static final byte _sliderThumb = _slider + 1;
public static final Widget SLIDER_THUMB = new Widget(_sliderThumb);
@Native private static final byte _synchronization = _sliderThumb + 1;
public static final Widget SYNCHRONIZATION = new Widget(_synchronization);
@Native private static final byte _tab = _synchronization + 1;
public static final Widget TAB = new Widget(_tab);
@Native private static final byte _titleBarCloseBox = _tab + 1;
public static final Widget TITLE_BAR_CLOSE_BOX = new Widget(_titleBarCloseBox);
@Native private static final byte _titleBarCollapseBox = _titleBarCloseBox + 1;
public static final Widget TITLE_BAR_COLLAPSE_BOX = new Widget(_titleBarCollapseBox);
@Native private static final byte _titleBarZoomBox = _titleBarCollapseBox + 1;
public static final Widget TITLE_BAR_ZOOM_BOX = new Widget(_titleBarZoomBox);
@Native private static final byte _titleBarToolbarButton = _titleBarZoomBox + 1;
public static final Widget TITLE_BAR_TOOLBAR_BUTTON = new Widget(_titleBarToolbarButton);
@Native private static final byte _toolbarItemWell = _titleBarToolbarButton + 1;
public static final Widget TOOLBAR_ITEM_WELL = new Widget(_toolbarItemWell);
@Native private static final byte _windowFrame = _toolbarItemWell + 1;
public static final Widget WINDOW_FRAME = new Widget(_windowFrame);
}
public static class Hit {
@Native private static final int _unknown = -1;
public static final Hit UNKNOWN = new Hit(_unknown);
@Native private static final int _none = 0;
public static final Hit NONE = new Hit(_none);
@Native private static final int _hit = 1;
public static final Hit HIT = new Hit(_hit);
final int hit;
Hit(final int hit) { this.hit = hit; }
public boolean isHit() {
return hit > 0;
}
private String getConstantName(Hit hit) {
if (hit == UNKNOWN) {
return "UNKNOWN";
} else if (hit == NONE) {
return "NONE";
} else if (hit == HIT) {
return "HIT";
}
return getClass().getSimpleName();
}
public String toString() {
return getConstantName(this);
}
}
public static class ScrollBarHit extends Hit {
@Native private static final int _thumb = 2;
public static final ScrollBarHit THUMB = new ScrollBarHit(_thumb);
@Native private static final int _trackMin = 3;
public static final ScrollBarHit TRACK_MIN = new ScrollBarHit(_trackMin);
@Native private static final int _trackMax = 4;
public static final ScrollBarHit TRACK_MAX = new ScrollBarHit(_trackMax);
@Native private static final int _arrowMin = 5;
public static final ScrollBarHit ARROW_MIN = new ScrollBarHit(_arrowMin);
@Native private static final int _arrowMax = 6;
public static final ScrollBarHit ARROW_MAX = new ScrollBarHit(_arrowMax);
@Native private static final int _arrowMaxInside = 7;
public static final ScrollBarHit ARROW_MAX_INSIDE = new ScrollBarHit(_arrowMaxInside);
@Native private static final int _arrowMinInside = 8;
public static final ScrollBarHit ARROW_MIN_INSIDE = new ScrollBarHit(_arrowMinInside);
ScrollBarHit(final int hit) { super(hit); }
}
static Hit getHit(final int hit) {
switch (hit) {
case Hit._none:
return Hit.NONE;
case Hit._hit:
return Hit.HIT;
case ScrollBarHit._thumb:
return ScrollBarHit.THUMB;
case ScrollBarHit._trackMin:
return ScrollBarHit.TRACK_MIN;
case ScrollBarHit._trackMax:
return ScrollBarHit.TRACK_MAX;
case ScrollBarHit._arrowMin:
return ScrollBarHit.ARROW_MIN;
case ScrollBarHit._arrowMax:
return ScrollBarHit.ARROW_MAX;
case ScrollBarHit._arrowMaxInside:
return ScrollBarHit.ARROW_MAX_INSIDE;
case ScrollBarHit._arrowMinInside:
return ScrollBarHit.ARROW_MIN_INSIDE;
}
return Hit.UNKNOWN;
}
}
|