File: user_objc.h

package info (click to toggle)
swiftlang 6.1.3-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 2,791,532 kB
  • sloc: cpp: 9,901,743; ansic: 2,201,431; asm: 1,091,827; python: 308,252; objc: 82,166; f90: 80,126; lisp: 38,358; pascal: 25,559; sh: 20,429; ml: 5,058; perl: 4,745; makefile: 4,484; awk: 3,535; javascript: 3,018; xml: 918; fortran: 664; cs: 573; ruby: 396
file content (82 lines) | stat: -rw-r--r-- 2,390 bytes parent folder | download | duplicates (2)
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
@import Foundation;
#include <MacTypes.h>

#define MAKE_ENUM(name) \
  typedef NS_ENUM(NSInteger, name) { \
    name##WaterMelon,                \
    name##Orange                     \
  }                                  \

MAKE_ENUM(MyCoolEnum);


typedef NS_ENUM(NSInteger, ALL_CAPS_ENUM) {
  ENUM_CASE_ONE,
  ENUM_CASE_TWO
};
typedef NS_ENUM(NSInteger, ALL_CAPS_ENUM2) {
  ALL_CAPS_CASE_ONE,
  ALL_CAPS_CASE_TWO
};

typedef NS_ENUM(NSInteger, SomeRandomEnum) {
  SomeRandomA,
  SomeRandomB
};

typedef NS_ENUM(NSInteger, EnumWithAwkwardDeprecations) {
  EnumWithAwkwardNormalCase1,
  EnumWithAwkwardNormalCase2,
  EnumWithAwkward2BitProblems __attribute__((deprecated)) = EnumWithAwkwardNormalCase1,
};

enum __attribute__((enum_extensibility(open))) EnumViaAttribute {
  EnumViaAttributeFirst = 1,
  EnumViaAttributeSecond = 2
};


// From <AudioUnit/AudioComponent.h>
// The interesting feature of this enum is that the common prefix before
// taking the enum name itself into account extends past the underscore.
typedef CF_OPTIONS(UInt32, AudioComponentInstantiationOptions) {
  kAudioComponentInstantiation_LoadOutOfProcess = 1,
  kAudioComponentInstantiation_LoadInProcess = 2
};

// ...whereas this one has a pluralized name before the underscore prefix.
typedef CF_OPTIONS(UInt32, AudioComponentFlags) {
  kAudioComponentFlag_Unsearchable    = 1,
  kAudioComponentFlag_SandboxSafe     = 2,
  kAudioComponentFlag_IsV3AudioUnit   = 4
};

// ...and this one has both complications.
typedef CF_OPTIONS(UInt32, FakeAudioComponentFlags) {
  kFakeAudioComponentFlag_LoadOutOfProcess  = 1,
  kFakeAudioComponentFlag_LoadInProcess     = 2,
};

// From <AudioUnit/AudioUnitProperties.h>
// This enum has a digit immediately after the leading 'k'.
typedef CF_ENUM(UInt32, AU3DMixerAttenuationCurve) {
  k3DMixerAttenuationCurve_Power = 0,
  k3DMixerAttenuationCurve_Exponential = 1,
  k3DMixerAttenuationCurve_Inverse = 2,
  k3DMixerAttenuationCurve_Linear = 3
};

typedef CF_OPTIONS(UInt32, EmptySet1) {
  kEmptySet1DefaultOptions __attribute__((swift_name("default")))
};
typedef CF_OPTIONS(UInt32, EmptySet2) {
  kEmptySet2None __attribute__((swift_name("none")))
};
typedef CF_OPTIONS(UInt32, EmptySet3) {
  kEmptySet3None __attribute__((swift_name("None")))
};

enum __attribute__((flag_enum)) OptionsViaAttribute {
  OptionsViaAttributeFirst = 1,
  OptionsViaAttributeSecond = 2
};