Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -4396,6 +4396,12 @@
<enum name="NSCompositeSourceOver" swt_gen="true"></enum>
<enum name="NSContentsCellMask" swt_gen="true"></enum>
<enum name="NSControlKeyMask" swt_gen="true"></enum>
<enum name="NSControlSizeMini" swt_gen="true"></enum>
<enum name="NSControlSizeRegular" swt_gen="true"></enum>
<enum name="NSControlSizeSmall" swt_gen="true"></enum>
<enum name="NSControlStateValueMixed" swt_gen="true"></enum>
<enum name="NSControlStateValueOff" swt_gen="true"></enum>
<enum name="NSControlStateValueOn" swt_gen="true"></enum>
<enum name="NSCriticalAlertStyle" swt_gen="true"></enum>
<enum name="NSCurveToBezierPathElement" swt_gen="true"></enum>
<enum name="NSDeleteCharacter" swt_gen="true"></enum>
Expand Down Expand Up @@ -4438,6 +4444,7 @@
<enum name="NSImageLeft" swt_gen="true"></enum>
<enum name="NSImageOnly" swt_gen="true"></enum>
<enum name="NSImageOverlaps" swt_gen="true"></enum>
<enum name="NSImageScaleNone" swt_gen="true"></enum>
<enum name="NSInformationalAlertStyle" swt_gen="true"></enum>
<enum name="NSItalicFontMask" swt_gen="true"></enum>
<enum name="NSKeyDown" swt_gen="true"></enum>
Expand All @@ -4454,9 +4461,9 @@
<enum name="NSLineBreakByTruncatingTail" swt_gen="true"></enum>
<enum name="NSLineBreakByWordWrapping" swt_gen="true"></enum>
<enum name="NSLineToBezierPathElement" swt_gen="true"></enum>
<enum name="NSMiniControlSize" swt_gen="true"></enum>

<enum name="NSMiterLineJoinStyle" swt_gen="true"></enum>
<enum name="NSMixedState" swt_gen="true"></enum>

<enum name="NSMouseEntered" swt_gen="true"></enum>
<enum name="NSMouseExited" swt_gen="true"></enum>
<enum name="NSMouseMoved" swt_gen="true"></enum>
Expand All @@ -4466,8 +4473,7 @@
<enum name="NSNoImage" swt_gen="true"></enum>
<enum name="NSNoTitle" swt_gen="true"></enum>
<enum name="NSNonZeroWindingRule" swt_gen="true"></enum>
<enum name="NSOffState" swt_gen="true"></enum>
<enum name="NSOnState" swt_gen="true"></enum>

<enum name="NSOpenGLCPSurfaceOrder" swt_gen="true"></enum>
<enum name="NSOpenGLPFAAccumSize" swt_gen="true"></enum>
<enum name="NSOpenGLPFAAlphaSize" swt_gen="true"></enum>
Expand All @@ -4488,15 +4494,15 @@
<enum name="NSPrintPanelShowsPrintSelection" swt_gen="true"></enum>
<enum name="NSProgressIndicatorPreferredThickness" swt_gen="true"></enum>
<enum name="NSRGBColorSpaceModel" swt_gen="true"></enum>
<enum name="NSRegularControlSize" swt_gen="true"></enum>

<enum name="NSRegularSquareBezelStyle" swt_gen="true"></enum>
<enum name="NSResizableWindowMask" swt_gen="true"></enum>
<enum name="NSRightMouseDown" swt_gen="true"></enum>
<enum name="NSRightMouseDragged" swt_gen="true"></enum>
<enum name="NSRightMouseUp" swt_gen="true"></enum>
<enum name="NSRoundLineCapStyle" swt_gen="true"></enum>
<enum name="NSRoundLineJoinStyle" swt_gen="true"></enum>
<enum name="NSScaleNone" swt_gen="true"></enum>

<enum name="NSScrollElasticityNone" swt_gen="true"></enum>
<enum name="NSScrollWheel" swt_gen="true"></enum>
<enum name="NSScrollerDecrementLine" swt_gen="true"></enum>
Expand All @@ -4508,7 +4514,7 @@
<enum name="NSScrollerStyleLegacy" swt_gen="true"></enum>
<enum name="NSScrollerStyleOverlay" swt_gen="true"></enum>
<enum name="NSShiftKeyMask" swt_gen="true"></enum>
<enum name="NSSmallControlSize" swt_gen="true"></enum>

<enum name="NSSquareLineCapStyle" swt_gen="true"></enum>
<enum name="NSStatusWindowLevel" swt_gen="true"></enum>
<enum name="NSStringDrawingUsesLineFragmentOrigin" swt_gen="true"></enum>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2246,10 +2246,10 @@ public static Selector getSelector (long value) {
public static final int NSLineBreakByTruncatingTail = 4;
public static final int NSLineBreakByWordWrapping = 0;
public static final int NSLineToBezierPathElement = 1;
public static final int NSMiniControlSize = 2;
public static final int NSControlSizeMini = 2;

public static final int NSMiterLineJoinStyle = 0;
public static final int NSMixedState = -1;
public static final int NSControlStateValueMixed = -1;
public static final int NSMouseEntered = 8;
public static final int NSMouseExited = 9;
public static final int NSMouseMoved = 5;
Expand All @@ -2260,8 +2260,8 @@ public static Selector getSelector (long value) {
public static final int NSNoTitle = 0;
public static final int NSNonZeroWindingRule = 0;

public static final int NSOffState = 0;
public static final int NSOnState = 1;
public static final int NSControlStateValueOff = 0;
public static final int NSControlStateValueOn = 1;
public static final int NSOpenGLCPSurfaceOrder = 235;
public static final int NSOpenGLPFAAccumSize = 14;
public static final int NSOpenGLPFAAlphaSize = 11;
Expand All @@ -2282,15 +2282,15 @@ public static Selector getSelector (long value) {
public static final int NSPrintPanelShowsPrintSelection = 32;
public static final int NSProgressIndicatorPreferredThickness = 14;
public static final int NSRGBColorSpaceModel = 1;
public static final int NSRegularControlSize = 0;
public static final int NSControlSizeRegular = 0;
public static final int NSRegularSquareBezelStyle = 2;
public static final int NSResizableWindowMask = 8;
public static final int NSRightMouseDown = 3;
public static final int NSRightMouseDragged = 7;
public static final int NSRightMouseUp = 4;
public static final int NSRoundLineCapStyle = 1;
public static final int NSRoundLineJoinStyle = 1;
public static final int NSScaleNone = 2;
public static final int NSImageScaleNone = 2;
public static final int NSScrollElasticityNone = 1;
public static final int NSScrollWheel = 22;
public static final int NSScrollerDecrementLine = 4;
Expand All @@ -2302,7 +2302,7 @@ public static Selector getSelector (long value) {
public static final int NSScrollerStyleLegacy = 0;
public static final int NSScrollerStyleOverlay = 1;
public static final int NSShiftKeyMask = 131072;
public static final int NSSmallControlSize = 1;
public static final int NSControlSizeSmall = 1;
public static final int NSSquareLineCapStyle = 2;
public static final int NSStatusWindowLevel = 25;
public static final int NSStringDrawingUsesLineFragmentOrigin = 1;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ NSSize cellSizeForBounds (long id, long sel, NSRect cellFrame) {
if (((style & (SWT.PUSH|SWT.TOGGLE)) !=0) && (style & (SWT.FLAT|SWT.WRAP)) == 0) {
if (image != null) {
NSCell cell = new NSCell(id);
if (cell.controlSize() == OS.NSSmallControlSize) size.height += EXTRA_HEIGHT;
if (cell.controlSize() == OS.NSControlSizeSmall) size.height += EXTRA_HEIGHT;
}
// TODO: Why is this necessary?
size.width += EXTRA_WIDTH;
Expand Down Expand Up @@ -339,7 +339,7 @@ void drawBezelWithFrame_inView (long id, long sel, NSRect cellFrame, long viewid
if (this.background != null) {
NSButton button = (NSButton) view;

final boolean isHighlighted = (style & SWT.TOGGLE) == 0 ? button.isHighlighted() : ((NSButton) view).state() == OS.NSOnState;
final boolean isHighlighted = (style & SWT.TOGGLE) == 0 ? button.isHighlighted() : ((NSButton) view).state() == OS.NSControlStateValueOn;

final NSWindow window = button.window();
final NSButtonCell defaultButtonCell = window == null ? null : window.defaultButtonCell();
Expand Down Expand Up @@ -640,8 +640,8 @@ String getNameText () {
public boolean getSelection () {
checkWidget ();
if ((style & (SWT.CHECK | SWT.RADIO | SWT.TOGGLE)) == 0) return false;
if ((style & SWT.CHECK) != 0 && grayed) return ((NSButton)view).state() == OS.NSMixedState;
return ((NSButton)view).state() == OS.NSOnState;
if ((style & SWT.CHECK) != 0 && grayed) return ((NSButton)view).state() == OS.NSControlStateValueMixed;
return ((NSButton)view).state() == OS.NSControlStateValueOn;
}

/**
Expand Down Expand Up @@ -674,7 +674,7 @@ boolean isDescribedByLabel () {
@Override
long nextState(long id, long sel) {
if ((style & SWT.CHECK) != 0 && grayed) {
return ((NSButton)view).state() == OS.NSMixedState ? OS.NSOffState : OS.NSMixedState;
return ((NSButton)view).state() == OS.NSControlStateValueMixed ? OS.NSControlStateValueOff : OS.NSControlStateValueMixed;
}

return super.nextState(id, sel);
Expand Down Expand Up @@ -752,11 +752,11 @@ void sendSelection () {
}
}
if ((style & SWT.CHECK) != 0) {
if (grayed && ((NSButton)view).state() == OS.NSOnState) {
((NSButton)view).setState(OS.NSOffState);
if (grayed && ((NSButton)view).state() == OS.NSControlStateValueOn) {
((NSButton)view).setState(OS.NSControlStateValueOff);
}
if (!grayed && ((NSButton)view).state() == OS.NSMixedState) {
((NSButton)view).setState(OS.NSOnState);
if (!grayed && ((NSButton)view).state() == OS.NSControlStateValueMixed) {
((NSButton)view).setState(OS.NSControlStateValueOn);
}
}
sendSelectionEvent (SWT.Selection);
Expand Down Expand Up @@ -824,7 +824,7 @@ void setBounds (int x, int y, int width, int height, boolean move, boolean resiz
int heightThreshold = REGULAR_BUTTON_HEIGHT;

NSCell cell = ((NSControl)view).cell();
if (cell != null && cell.controlSize() == OS.NSSmallControlSize) {
if (cell != null && cell.controlSize() == OS.NSControlSizeSmall) {
heightThreshold = SMALL_BUTTON_HEIGHT;
}

Expand Down Expand Up @@ -887,9 +887,9 @@ public void setGrayed(boolean grayed) {

if (checked) {
if (grayed) {
((NSButton) view).setState (OS.NSMixedState);
((NSButton) view).setState (OS.NSControlStateValueMixed);
} else {
((NSButton) view).setState (OS.NSOnState);
((NSButton) view).setState (OS.NSControlStateValueOn);
}
}
}
Expand Down Expand Up @@ -937,9 +937,9 @@ public void setImage (Image image) {
NSSize size = cell.cellSize ();
int height = (int)Math.ceil(size.height);
if (height > SMALL_BUTTON_HEIGHT) {
cell.setControlSize(OS.NSRegularControlSize);
cell.setControlSize(OS.NSControlSizeRegular);
} else if (display.smallFonts){
cell.setControlSize(OS.NSSmallControlSize);
cell.setControlSize(OS.NSControlSizeSmall);
}
setFont(getFont());
}
Expand Down Expand Up @@ -978,9 +978,9 @@ public void setSelection (boolean selected) {
checkWidget();
if ((style & (SWT.CHECK | SWT.RADIO | SWT.TOGGLE)) == 0) return;
if (grayed) {
((NSButton)view).setState (selected ? OS.NSMixedState : OS.NSOffState);
((NSButton)view).setState (selected ? OS.NSControlStateValueMixed : OS.NSControlStateValueOff);
} else {
((NSButton)view).setState (selected ? OS.NSOnState : OS.NSOffState);
((NSButton)view).setState (selected ? OS.NSControlStateValueOn : OS.NSControlStateValueOff);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4278,7 +4278,7 @@ public void setSize (Point size) {
void setSmallSize () {
if (view instanceof NSControl) {
NSCell cell = ((NSControl)view).cell();
if (cell != null) cell.setControlSize (OS.NSSmallControlSize);
if (cell != null) cell.setControlSize (OS.NSControlSizeSmall);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -320,12 +320,12 @@ void hideCalendar() {

int getBezelInset() {
//TODO: Determine this value from the system instead of using constants
return (buttonView.cell ().controlSize () == OS.NSMiniControlSize) ? 3 : 1;
return (buttonView.cell ().controlSize () == OS.NSControlSizeMini) ? 3 : 1;
}

int getBezelSize() {
//TODO: Determine this value from the system instead of using constants
return (buttonView.cell ().controlSize () == OS.NSMiniControlSize) ? 6 : 4;
return (buttonView.cell ().controlSize () == OS.NSControlSizeMini) ? 6 : 4;
}

NSCalendarDate getCalendarDate () {
Expand Down Expand Up @@ -779,7 +779,7 @@ public void setSeconds (int seconds) {

@Override
void setSmallSize () {
if (buttonView != null) buttonView.cell ().setControlSize (OS.NSMiniControlSize);
if (buttonView != null) buttonView.cell ().setControlSize (OS.NSControlSizeMini);
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3255,7 +3255,7 @@ NSFont getFont (long cls, long sel) {
if (font != 0) {
result = new NSFont (font);
} else {
result = NSFont.systemFontOfSize (NSFont.systemFontSizeForControlSize (OS.NSRegularControlSize));
result = NSFont.systemFontOfSize (NSFont.systemFontSizeForControlSize (OS.NSControlSizeRegular));
}
result.retain ();
OS.objc_msgSend (widget, OS.sel_release);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ void createHandle () {

NSImageView imageWidget = (NSImageView) new SWTImageView ().alloc ();
imageWidget.init();
imageWidget.setImageScaling (OS.NSScaleNone);
imageWidget.setImageScaling (OS.NSImageScaleNone);

NSTextField textWidget = (NSTextField)new SWTTextField().alloc();
textWidget.init();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -356,7 +356,7 @@ public Menu getParent () {
public boolean getSelection () {
checkWidget ();
if ((style & (SWT.CHECK | SWT.RADIO)) == 0) return false;
return nsItem.state() == OS.NSOnState;
return nsItem.state() == OS.NSControlStateValueOn;
}

/**
Expand Down Expand Up @@ -793,7 +793,7 @@ boolean setRadioSelection (boolean value) {
public void setSelection (boolean selected) {
checkWidget ();
if ((style & (SWT.CHECK | SWT.RADIO)) == 0) return;
nsItem.setState(selected ? OS.NSOnState : OS.NSOffState);
nsItem.setState(selected ? OS.NSControlStateValueOn : OS.NSControlStateValueOff);
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ public Rectangle computeTrim (int x, int y, int width, int height) {
size = NSScrollView.frameSizeForContentSize(size,
(style & SWT.H_SCROLL) != 0 ? OS.class_NSScroller : 0,
(style & SWT.V_SCROLL) != 0 ? OS.class_NSScroller : 0,
border, OS.NSRegularControlSize, OS.NSScrollerStyleLegacy);
border, OS.NSControlSizeRegular, OS.NSScrollerStyleLegacy);
width = (int)size.width;
height = (int)size.height;
NSRect frame = scrollView.contentView().frame();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -467,7 +467,7 @@ public void setSelection (int value) {
@Override
void setSmallSize () {
/* This code is intentionally comment */
// ((NSScroller)view).setControlSize (OS.NSSmallControlSize);
// ((NSScroller)view).setControlSize (OS.NSControlSizeSmall);
}

void updateBar (int selection, int minimum, int maximum, int thumb) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -954,8 +954,8 @@ void setSelection (int value, boolean setPos, boolean setText, boolean notify) {

@Override
void setSmallSize () {
textView.cell ().setControlSize (OS.NSSmallControlSize);
buttonView.cell ().setControlSize (OS.NSSmallControlSize);
textView.cell ().setControlSize (OS.NSControlSizeSmall);
buttonView.cell ().setControlSize (OS.NSControlSizeSmall);
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -632,7 +632,7 @@ void setSelection (int index, boolean notify, boolean force) {

@Override
void setSmallSize () {
((NSTabView)view).setControlSize (OS.NSSmallControlSize);
((NSTabView)view).setControlSize (OS.NSControlSizeSmall);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -585,7 +585,7 @@ void createHandle () {
buttonCell.init ();
checkColumn.setDataCell (buttonCell);
buttonCell.setButtonType (OS.NSButtonTypeSwitch);
buttonCell.setControlSize(OS.NSSmallControlSize);
buttonCell.setControlSize(OS.NSControlSizeSmall);
buttonCell.setImagePosition (OS.NSImageOnly);
buttonCell.setAllowsMixedState (true);
checkColumn.setWidth(getCheckColumnWidth());
Expand Down Expand Up @@ -2133,9 +2133,9 @@ long nextState (long id, long sel) {
if (index == -1) index = (int)tableView.selectedRow ();
TableItem item = items[index];
if (item.grayed) {
return item.checked ? OS.NSOffState : OS.NSMixedState;
return item.checked ? OS.NSControlStateValueOff : OS.NSControlStateValueMixed;
}
return item.checked ? OS.NSOffState : OS.NSOnState;
return item.checked ? OS.NSControlStateValueOff : OS.NSControlStateValueOn;
}

@Override
Expand Down Expand Up @@ -3475,9 +3475,9 @@ long tableView_objectValueForTableColumn_row (long id, long sel, long aTableView
if (checkColumn != null && aTableColumn == checkColumn.id) {
NSNumber value;
if (item.checked && item.grayed) {
value = NSNumber.numberWithInt (OS.NSMixedState);
value = NSNumber.numberWithInt (OS.NSControlStateValueMixed);
} else {
value = NSNumber.numberWithInt (item.checked ? OS.NSOnState : OS.NSOffState);
value = NSNumber.numberWithInt (item.checked ? OS.NSControlStateValueOn : OS.NSControlStateValueOff);
}
return value.id;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -615,7 +615,7 @@ void createHandle () {
buttonCell.init ();
checkColumn.setDataCell (buttonCell);
buttonCell.setButtonType (OS.NSButtonTypeSwitch);
buttonCell.setControlSize (OS.NSSmallControlSize);
buttonCell.setControlSize (OS.NSControlSizeSmall);
buttonCell.setImagePosition (OS.NSImageOnly);
buttonCell.setAllowsMixedState (true);
checkColumn.setWidth (getCheckColumnWidth ());
Expand Down Expand Up @@ -2191,9 +2191,9 @@ long nextState (long id, long sel) {
if (index == -1) index = (int)outlineView.selectedRow ();
TreeItem item = (TreeItem)display.getWidget (outlineView.itemAtRow (index).id);
if (item.grayed) {
return item.checked ? OS.NSOffState : OS.NSMixedState;
return item.checked ? OS.NSControlStateValueOff : OS.NSControlStateValueMixed;
}
return item.checked ? OS.NSOffState : OS.NSOnState;
return item.checked ? OS.NSControlStateValueOff : OS.NSControlStateValueOn;
}

@Override
Expand All @@ -2220,9 +2220,9 @@ long outlineView_objectValueForTableColumn_byItem (long id, long sel, long outli
if (checkColumn != null && tableColumn == checkColumn.id) {
NSNumber value;
if (item.checked && item.grayed) {
value = NSNumber.numberWithInt (OS.NSMixedState);
value = NSNumber.numberWithInt (OS.NSControlStateValueMixed);
} else {
value = NSNumber.numberWithInt (item.checked ? OS.NSOnState : OS.NSOffState);
value = NSNumber.numberWithInt (item.checked ? OS.NSControlStateValueOn : OS.NSControlStateValueOff);
}
return value.id;
}
Expand Down
Loading