summaryrefslogtreecommitdiff
path: root/packages/cocoaint/src/appkit/NSColorPanel.inc
blob: 0cea5724525392a30b0b8166ef64c7475f92495f (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
{ Parsed from AppKit.framework NSColorPanel.h }


{$ifdef TYPES}
type
  NSColorPanelPtr = ^NSColorPanel;
{$endif}

{$ifdef TYPES}
type
  NSColorPanelMode = NSInteger;
  NSColorPanelModePtr = ^NSColorPanelMode;

const
  NSNoModeColorPanel = -1 { available in 10_5 };
  NSGrayModeColorPanel = 0;
  NSRGBModeColorPanel = 1;
  NSCMYKModeColorPanel = 2;
  NSHSBModeColorPanel = 3;
  NSCustomPaletteModeColorPanel = 4;
  NSColorListModeColorPanel = 5;
  NSWheelModeColorPanel = 6;
  NSCrayonModeColorPanel = 7;

type
  NSColorPanelOptions = NSUInteger;
  NSColorPanelOptionsPtr = ^NSColorPanelOptions;

const
  NSColorPanelGrayModeMask = $00000001;
  NSColorPanelRGBModeMask = $00000002;
  NSColorPanelCMYKModeMask = $00000004;
  NSColorPanelHSBModeMask = $00000008;
  NSColorPanelCustomPaletteModeMask = $00000010;
  NSColorPanelColorListModeMask = $00000020;
  NSColorPanelWheelModeMask = $00000040;
  NSColorPanelCrayonModeMask = $00000080;
  NSColorPanelAllModesMask = $0000ffff;
{$endif}

{$ifdef CLASSES}

type
  NSColorPanel = objcclass external (NSPanel)
  private
    _colorSwatch: id;
    _accessoryContainerView: id;
    _colorWell: id;
    _pickersWithLoadedViews: NSMutableArray;
    _magnifyButton: id;
    _middleView: id;
    _opacitySlider: id;
    _opacityText: id;
    _opacityView: id;
    _modalButtons: id;
    _pickerView: id;
    _customViewsList: id;
    _customPickerList: id;
    _currViewObject: id;
    _bottomConstraint: id;
    _target: id;
    _accessoryView: id;
    _action: SEL;
    _minColorPanelSize: NSSize;
    _maxColorPanelSize: NSSize;
    _accessoryContainerViewHeight: id;
    _opacityViewHeight: id;
    _reserved1: id;
    _reserved2: id;
    _resizeDimple: id;
    _reserved3: ObjCBOOL;
    _reserved4: ObjCBOOL;
    _handlingOpacityMoveAction: ObjCBOOL;
    _ignoreConstraints: ObjCBOOL;
    _continuous: ObjCBOOL;
    _allowColorSetting: ObjCBOOL;
    _stillInitializing: ObjCBOOL;
    _reserved5: ObjCBOOL;
    _opacityTextController: id;
  public
    class function sharedColorPanel: NSColorPanel; message 'sharedColorPanel';
    class function sharedColorPanelExists: ObjCBOOL; message 'sharedColorPanelExists';
    class function dragColor_withEvent_fromView (color: NSColor; theEvent: NSEvent; sourceView: NSView): ObjCBOOL; message 'dragColor:withEvent:fromView:';
    class procedure setPickerMask (mask: NSColorPanelOptions); message 'setPickerMask:';
    class procedure setPickerMode (mode: NSColorPanelMode); message 'setPickerMode:';
    procedure setAccessoryView(newValue: NSView); message 'setAccessoryView:';
    function accessoryView: NSView; message 'accessoryView';
    procedure setContinuous(newValue: ObjCBOOL); message 'setContinuous:';
    function isContinuous: ObjCBOOL; message 'isContinuous';
    procedure setShowsAlpha(newValue: ObjCBOOL); message 'setShowsAlpha:';
    function showsAlpha: ObjCBOOL; message 'showsAlpha';
    procedure setMode(newValue: NSColorPanelMode); message 'setMode:';
    function mode: NSColorPanelMode; message 'mode';
    procedure setColor(newValue: NSColor); message 'setColor:';
    function color: NSColor; message 'color';
    function alpha: CGFloat; message 'alpha';
    procedure setAction (aSelector: SEL); message 'setAction:';
    procedure setTarget (anObject: id); message 'setTarget:';
    procedure attachColorList (colorList: NSColorList); message 'attachColorList:';
    procedure detachColorList (colorList: NSColorList); message 'detachColorList:';
  end;


type
  NSApplication_NSColorPanel = objccategory external name 'NSColorPanel' (NSApplication)
    procedure orderFrontColorPanel (sender: id); message 'orderFrontColorPanel:';
  end;

type
  NSColorPanelResponderMethod = objccategory external (NSObject)
    procedure changeColor (sender: id); message 'changeColor:';
  end;
{$endif}

{$ifdef EXTERNAL_SYMBOLS}
var
  NSColorPanelColorDidChangeNotification: NSString; cvar; external;
{$endif}