summaryrefslogtreecommitdiff
path: root/fpcsrc/packages/cocoaint/src/appkit/NSBox.inc
blob: 8e94ded79f77c88938769cb04ddd802b93ec359a (plain)
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
{ Parsed from Appkit.framework NSBox.h }

{$ifdef TYPES}
{$ifndef NSBOX_PAS_T}
{$define NSBOX_PAS_T}

{ Constants }

const
  NSNoTitle = 0;
  NSAboveTop = 1;
  NSAtTop = 2;
  NSBelowTop = 3;
  NSAboveBottom = 4;
  NSAtBottom = 5;
  NSBelowBottom = 6;

const
  NSBoxPrimary = 0;
  NSBoxSecondary = 1;
  NSBoxSeparator = 2;
  NSBoxOldStyle = 3;
  NSBoxCustom = 4;

{ Types }
type
  NSTitlePosition = NSUInteger;
  NSTitlePositionPtr = ^NSTitlePosition;
  NSBoxType = NSUInteger;
  NSBoxTypePtr = ^NSBoxType;

{$endif}
{$endif}

{$ifdef RECORDS}
{$ifndef NSBOX_PAS_R}
{$define NSBOX_PAS_R}

{$endif}
{$endif}

{$ifdef FUNCTIONS}
{$ifndef NSBOX_PAS_F}
{$define NSBOX_PAS_F}

{$endif}
{$endif}

{$ifdef EXTERNAL_SYMBOLS}
{$ifndef NSBOX_PAS_S}
{$define NSBOX_PAS_S}

{$endif}
{$endif}

{$ifdef FORWARD}
  NSBox = objcclass;
  NSBoxPointer = ^NSBox;
  NSBoxPtr = NSBoxPointer;

{$endif}

{$ifdef CLASSES}
{$ifndef NSBOX_PAS_C}
{$define NSBOX_PAS_C}

{ NSBox }
  NSBox = objcclass external (NSView)
  private
    _titleCell: id;
    _contentView: id;
    _offsets: NSSize;
    _borderRect: NSRect;
    _titleRect: NSRect;
    __bFlags: record
      case byte of
       0: (_anonbitfield_NSBox0: NSBorderType);
       1: (data: bitpacked record
        _borderType: 0..((1 shl 2)-1);
        _titlePosition: 0..((1 shl 3)-1);
        backgroundTransparent: 0..1;
        reserved: 0..((1 shl 2)-1);
        needsTile: 0..1;
        transparent: 0..1;
        colorAltInterpretation: 0..1;
        _boxType: 0..((1 shl 3)-1);
        _RESERVED: 0..((1 shl 18)-1);
       end;
      );
      end;
    _unused: id;
    
  public
    function borderType: NSBorderType; message 'borderType';
    function titlePosition: NSTitlePosition; message 'titlePosition';
    procedure setBorderType(aType: NSBorderType); message 'setBorderType:';
    procedure setBoxType(boxType_: NSBoxType); message 'setBoxType:';
    function boxType: NSBoxType; message 'boxType';
    procedure setTitlePosition(aPosition: NSTitlePosition); message 'setTitlePosition:';
    function title: NSString; message 'title';
    procedure setTitle(aString: NSString); message 'setTitle:';
    function titleFont: NSFont; message 'titleFont';
    procedure setTitleFont(fontObj: NSFont); message 'setTitleFont:';
    function borderRect: NSRect; message 'borderRect';
    function titleRect: NSRect; message 'titleRect';
    function titleCell: id; message 'titleCell';
    procedure sizeToFit; message 'sizeToFit';
    function contentViewMargins: NSSize; message 'contentViewMargins';
    procedure setContentViewMargins(offsetSize: NSSize); message 'setContentViewMargins:';
    procedure setFrameFromContentFrame(contentFrame: NSRect); message 'setFrameFromContentFrame:';
    function contentView: id; message 'contentView';
    procedure setContentView(aView: NSView); message 'setContentView:';
    function isTransparent: Boolean; message 'isTransparent';
    procedure setTransparent(flag: Boolean); message 'setTransparent:';
  end;

{ NSKeyboardUI_NSBoxCategory }
  NSKeyboardUI_NSBoxCategory = objccategory external name 'NSKeyboardUI' (NSBox)
    procedure setTitleWithMnemonic(stringWithAmpersand: NSString); message 'setTitleWithMnemonic:';
  end;

{ NSCustomBoxTypePropertiesCategory }
  NSCustomBoxTypePropertiesCategory = objccategory external (NSBox)
    function borderWidth: CGFloat; message 'borderWidth';
    procedure setBorderWidth(borderWidth_: CGFloat); message 'setBorderWidth:';
    function cornerRadius: CGFloat; message 'cornerRadius';
    procedure setCornerRadius(cornerRadius_: CGFloat); message 'setCornerRadius:';
    function borderColor: NSColor; message 'borderColor';
    procedure setBorderColor(borderColor_: NSColor); message 'setBorderColor:';
    function fillColor: NSColor; message 'fillColor';
    procedure setFillColor(fillColor_: NSColor); message 'setFillColor:';
  end;

{$endif}
{$endif}