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

{$ifdef TYPES}
{$ifndef NSGRAPHICSCONTEXT_PAS_T}
{$define NSGRAPHICSCONTEXT_PAS_T}

{ Constants }

const
  NSImageInterpolationDefault = 0;
  NSImageInterpolationNone = 1;
  NSImageInterpolationLow = 2;
  NSImageInterpolationMedium = 4;
  NSImageInterpolationHigh = 3;

{ Types }
type
  NSImageInterpolation = NSUInteger;
  NSImageInterpolationPtr = ^NSImageInterpolation;

{$endif}
{$endif}

{$ifdef RECORDS}
{$ifndef NSGRAPHICSCONTEXT_PAS_R}
{$define NSGRAPHICSCONTEXT_PAS_R}

{$endif}
{$endif}

{$ifdef FUNCTIONS}
{$ifndef NSGRAPHICSCONTEXT_PAS_F}
{$define NSGRAPHICSCONTEXT_PAS_F}

{$endif}
{$endif}

{$ifdef EXTERNAL_SYMBOLS}
{$ifndef NSGRAPHICSCONTEXT_PAS_S}
{$define NSGRAPHICSCONTEXT_PAS_S}

{ External string constants }
var
  NSGraphicsContextDestinationAttributeName: NSString; cvar; external;
  NSGraphicsContextRepresentationFormatAttributeName: NSString; cvar; external;
  NSGraphicsContextPSFormat: NSString; cvar; external;
  NSGraphicsContextPDFFormat: NSString; cvar; external;

{$endif}
{$endif}

{$ifdef FORWARD}
  NSGraphicsContext = objcclass;
  NSGraphicsContextPointer = ^NSGraphicsContext;
  NSGraphicsContextPtr = NSGraphicsContextPointer;

{$endif}

{$ifdef CLASSES}
{$ifndef NSGRAPHICSCONTEXT_PAS_C}
{$define NSGRAPHICSCONTEXT_PAS_C}

{ NSGraphicsContext }
  NSGraphicsContext = objcclass external (NSObject)
    
  public
    class function graphicsContextWithAttributes(attributes_: NSDictionary): NSGraphicsContext; message 'graphicsContextWithAttributes:';
    class function graphicsContextWithWindow(window: NSWindow): NSGraphicsContext; message 'graphicsContextWithWindow:';
    class function graphicsContextWithBitmapImageRep(bitmapRep: NSBitmapImageRep): NSGraphicsContext; message 'graphicsContextWithBitmapImageRep:';
    class function graphicsContextWithGraphicsPort_flipped(graphicsPort_: Pointer; initialFlippedState: Boolean): NSGraphicsContext; message 'graphicsContextWithGraphicsPort:flipped:';
    class function currentContext: NSGraphicsContext; message 'currentContext';
    class procedure setCurrentContext(context: NSGraphicsContext); message 'setCurrentContext:';
    class function currentContextDrawingToScreen: Boolean; message 'currentContextDrawingToScreen';
    class procedure saveGraphicsState; message 'saveGraphicsState';
    class procedure restoreGraphicsState; message 'restoreGraphicsState';
    class procedure setGraphicsState(gState: NSInteger); message 'setGraphicsState:';
    function attributes: NSDictionary; message 'attributes';
    function isDrawingToScreen: Boolean; message 'isDrawingToScreen';
    procedure flushGraphics; message 'flushGraphics';
    function graphicsPort: Pointer; message 'graphicsPort';
    function isFlipped: Boolean; message 'isFlipped';
  end;

{ NSQuartzCoreAdditionsCategory }
  NSQuartzCoreAdditionsCategory = objccategory external (NSGraphicsContext)
    function CIContext: CIContext; message 'CIContext';
  end;

{ NSGraphicsContextDeprecatedCategory }
  NSGraphicsContextDeprecatedCategory = objccategory external (NSGraphicsContext)
    function focusStack: id; message 'focusStack';
    procedure setFocusStack(stack: id); message 'setFocusStack:';
  end;

{$endif}
{$endif}