summaryrefslogtreecommitdiff
path: root/fpcsrc/packages/cocoaint/src/appkit/NSFontPanel.inc
blob: 9fa1d13f80ac84110195889c228329010fdcdc8c (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
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
{ Parsed from Appkit.framework NSFontPanel.h }

{$ifdef TYPES}
{$ifndef NSFONTPANEL_PAS_T}
{$define NSFONTPANEL_PAS_T}

{ Constants }

const
  NSFPPreviewButton = 131;
  NSFPRevertButton = 130;
  NSFPSetButton = 132;
  NSFPPreviewField = 128;
  NSFPSizeField = 129;
  NSFPSizeTitle = 133;
  NSFPCurrentField = 134;

const
  NSFontPanelFaceModeMask = 1 shl 0;
  NSFontPanelSizeModeMask = 1 shl 1;
  NSFontPanelCollectionModeMask = 1 shl 2;
  NSFontPanelUnderlineEffectModeMask = 1 shl 8;
  NSFontPanelStrikethroughEffectModeMask = 1 shl 9;
  NSFontPanelTextColorEffectModeMask = 1 shl 10;
  NSFontPanelDocumentColorEffectModeMask = 1 shl 11;
  NSFontPanelShadowEffectModeMask = 1 shl 12;
  NSFontPanelAllEffectsModeMask = $FFF00;
  NSFontPanelStandardModesMask = $FFFF;
  NSFontPanelAllModesMask = $FFFFFFFF;

{$endif}
{$endif}

{$ifdef RECORDS}
{$ifndef NSFONTPANEL_PAS_R}
{$define NSFONTPANEL_PAS_R}

{$endif}
{$endif}

{$ifdef FUNCTIONS}
{$ifndef NSFONTPANEL_PAS_F}
{$define NSFONTPANEL_PAS_F}

{$endif}
{$endif}

{$ifdef EXTERNAL_SYMBOLS}
{$ifndef NSFONTPANEL_PAS_S}
{$define NSFONTPANEL_PAS_S}

{$endif}
{$endif}

{$ifdef FORWARD}
  NSFontPanel = objcclass;
  NSFontPanelPointer = ^NSFontPanel;
  NSFontPanelPtr = NSFontPanelPointer;

{$endif}

{$ifdef CLASSES}
{$ifndef NSFONTPANEL_PAS_C}
{$define NSFONTPANEL_PAS_C}

{ NSFontPanel }
  NSFontPanel = objcclass external (NSPanel)
  private
    _manager: NSFontManager;
    _collectionNames: NSArray;
    _selection: id;
    _carbonNotification: Pointer;
    _targetObject: id;
    _familyList: id;
    _faceList: id;
    _sizeList: id;
    _mainCollectionList: id;
    _sizeField: id;
    _sizeSlider: id;
    _sizeSliderBox: id;
    _preview: id;
    _previewCaption: id;
    _mainSplitView: id;
    _mmCollectionList: id;
    _mmFamilyList: id;
    _mmFaceList: id;
    _mmSizeList: id;
    _extrasPopup: id;
    _searchField: id;
    _fixedListButton: id;
    _sliderButton: id;
    _accessoryView: id;
    __fpFlags: record
      case byte of
       0: (_anonbitfield_NSFontPanel0: cuint);
       1: (data: bitpacked record
        setFontChange: 0..1;
        setFontAttributeChange: 0..1;
        _delRespFamily: 0..1;
        _delRespFace: 0..1;
        _delRespSize: 0..1;
        _delRespColl: 0..1;
        _collectionDisabled: 0..1;
        _sizeDisabled: 0..1;
        _faceDisabled: 0..1;
        showEffects: 0..1;
        _uiMode: 0..((1 shl 8)-1);
        _reserved: 0..((1 shl 14)-1);
       end;
      );
      end;
    _regularModeBox: id;
    _miniModeBox: id;
    _modeBoxSuperview: id;
    _collectionLabel: id;
    _sizeLabel: id;
    _faceLabel: id;
    _familyLabel: id;
    _sizeStyleButton: id;
    _newSizeField: id;
    _editSizeList: id;
    _editSizeListBox: id;
    _editSizeSliderBox: id;
    _editSizeSliderMaxField: id;
    _editSizeSliderMinField: id;
    _sizeEditWindow: id;
    _availableSizes: id;
    _addCollectionButton: id;
    _removeCollectionButton: id;
    _fontPanelPreviewHeight: CGFloat;
    _typographyPanel: id;
    _actionButton: id;
    _fontEffectsBox: id;
    _sizeStyle: cint;
    {$ifndef cpu64}
    _fpUnused: array[0..(72)-1] of id;
    {$endif}
    
  public
    class function sharedFontPanel: NSFontPanel; message 'sharedFontPanel';
    class function sharedFontPanelExists: Boolean; message 'sharedFontPanelExists';
    function accessoryView: NSView; message 'accessoryView';
    procedure setAccessoryView(aView: NSView); message 'setAccessoryView:';
    procedure setPanelFont_isMultiple(fontObj: NSFont; flag: Boolean); message 'setPanelFont:isMultiple:';
    function panelConvertFont(fontObj: NSFont): NSFont; message 'panelConvertFont:';
    function worksWhenModal: Boolean; message 'worksWhenModal';
    function isEnabled: Boolean; message 'isEnabled';
    procedure setEnabled(flag: Boolean); message 'setEnabled:';
    procedure reloadDefaultFontFamilies; message 'reloadDefaultFontFamilies';
  end;

{ NSFontPanelValidationAdditionsCategory }
  NSFontPanelValidationAdditionsCategory = objccategory external (NSObject)
    function validModesForFontPanel(fontPanel: NSFontPanel): NSUInteger; message 'validModesForFontPanel:';
  end;

{$endif}
{$endif}