Team Fortress 2 Source Code as on 22/4/2020
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

186 lines
4.7 KiB

  1. /*
  2. File: CGPattern.h
  3. Contains: CoreGraphics base types
  4. Version: QuickTime 7.3
  5. Copyright: (c) 2007 (c) 2001 by Apple Computer, Inc., all rights reserved.
  6. Bugs?: For bug reports, consult the following page on
  7. the World Wide Web:
  8. http://developer.apple.com/bugreporter/
  9. */
  10. #ifndef CGPATTERN_H_
  11. #define CGPATTERN_H_
  12. #ifndef __CGBASE__
  13. #include <CGBase.h>
  14. #endif
  15. #ifndef __CGCONTEXT__
  16. #include <CGContext.h>
  17. #endif
  18. /* kCGPatternTilingNoDistortion: The pattern cell is not distorted when
  19. * painted, however the spacing between pattern cells may vary by as much
  20. * as 1 device pixel.
  21. *
  22. * kCGPatternTilingConstantSpacingMinimalDistortion: Pattern cells are
  23. * spaced consistently, however the pattern cell may be distorted by as
  24. * much as 1 device pixel when the pattern is painted.
  25. *
  26. * kCGPatternTilingConstantSpacing: Pattern cells are spaced consistently
  27. * as with kCGPatternTilingConstantSpacingMinimalDistortion, however the
  28. * pattern cell may be distorted additionally to permit a more efficient
  29. * implementation. */
  30. #if PRAGMA_ONCE
  31. #pragma once
  32. #endif
  33. #ifdef __cplusplus
  34. extern "C" {
  35. #endif
  36. #if PRAGMA_IMPORT
  37. #pragma import on
  38. #endif
  39. #if PRAGMA_STRUCT_ALIGN
  40. #pragma options align=mac68k
  41. #elif PRAGMA_STRUCT_PACKPUSH
  42. #pragma pack(push, 2)
  43. #elif PRAGMA_STRUCT_PACK
  44. #pragma pack(2)
  45. #endif
  46. #if PRAGMA_ENUM_ALWAYSINT
  47. #if defined(__fourbyteints__) && !__fourbyteints__
  48. #define __CGPATTERN__RESTORE_TWOBYTEINTS
  49. #pragma fourbyteints on
  50. #endif
  51. #pragma enumsalwaysint on
  52. #elif PRAGMA_ENUM_OPTIONS
  53. #pragma option enum=int
  54. #elif PRAGMA_ENUM_PACK
  55. #if __option(pack_enums)
  56. #define __CGPATTERN__RESTORE_PACKED_ENUMS
  57. #pragma options(!pack_enums)
  58. #endif
  59. #endif
  60. enum CGPatternTiling {
  61. kCGPatternTilingNoDistortion = 0,
  62. kCGPatternTilingConstantSpacingMinimalDistortion = 1,
  63. kCGPatternTilingConstantSpacing = 2
  64. };
  65. typedef enum CGPatternTiling CGPatternTiling;
  66. /* The drawing of the pattern is delegated to the callbacks. The callbacks
  67. * may be called one or many times to draw the pattern.
  68. *
  69. * `version' is the version number of the structure passed in as a
  70. * parameter to the CGPattern creation functions. The structure defined
  71. * below is version 0.
  72. *
  73. * `drawPattern' should draw the pattern in the context `c'. `info' is the
  74. * parameter originally passed to the CGPattern creation functions.
  75. *
  76. * `releaseInfo' is called when the pattern is deallocated. */
  77. typedef CALLBACK_API_C( void , CGDrawPatternProcPtr )(void *info, CGContextRef c);
  78. typedef CALLBACK_API_C( void , CGReleaseInfoProcPtr )(void * info);
  79. struct CGPatternCallbacks {
  80. unsigned int version;
  81. CGDrawPatternProcPtr drawPattern;
  82. CGReleaseInfoProcPtr releaseInfo;
  83. };
  84. typedef struct CGPatternCallbacks CGPatternCallbacks;
  85. /* Create a pattern. */
  86. /*
  87. * CGPatternCreate()
  88. *
  89. * Availability:
  90. * Non-Carbon CFM: not available
  91. * CarbonLib: not available
  92. * Mac OS X: in version 10.1 and later
  93. */
  94. EXTERN_API_C( CGPatternRef )
  95. CGPatternCreate(
  96. void * info,
  97. CGRect bounds,
  98. CGAffineTransform matrix,
  99. float xStep,
  100. float yStep,
  101. CGPatternTiling tiling,
  102. int isColored,
  103. const CGPatternCallbacks * callbacks);
  104. /* Increment the retain count of `pattern' and return it. All patterns are
  105. * created with an initial retain count of 1. */
  106. /*
  107. * CGPatternRetain()
  108. *
  109. * Availability:
  110. * Non-Carbon CFM: not available
  111. * CarbonLib: not available
  112. * Mac OS X: in version 10.1 and later
  113. */
  114. EXTERN_API_C( CGPatternRef )
  115. CGPatternRetain(CGPatternRef pattern);
  116. /* Decrement the retain count of `pattern'. If the retain count reaches 0,
  117. * then free it and release any associated resources. */
  118. /*
  119. * CGPatternRelease()
  120. *
  121. * Availability:
  122. * Non-Carbon CFM: not available
  123. * CarbonLib: not available
  124. * Mac OS X: in version 10.1 and later
  125. */
  126. EXTERN_API_C( void )
  127. CGPatternRelease(CGPatternRef pattern);
  128. #if PRAGMA_ENUM_ALWAYSINT
  129. #pragma enumsalwaysint reset
  130. #ifdef __CGPATTERN__RESTORE_TWOBYTEINTS
  131. #pragma fourbyteints off
  132. #endif
  133. #elif PRAGMA_ENUM_OPTIONS
  134. #pragma option enum=reset
  135. #elif defined(__CGPATTERN__RESTORE_PACKED_ENUMS)
  136. #pragma options(pack_enums)
  137. #endif
  138. #if PRAGMA_STRUCT_ALIGN
  139. #pragma options align=reset
  140. #elif PRAGMA_STRUCT_PACKPUSH
  141. #pragma pack(pop)
  142. #elif PRAGMA_STRUCT_PACK
  143. #pragma pack()
  144. #endif
  145. #ifdef PRAGMA_IMPORT_OFF
  146. #pragma import off
  147. #elif PRAGMA_IMPORT
  148. #pragma import reset
  149. #endif
  150. #ifdef __cplusplus
  151. }
  152. #endif
  153. #endif /* CGPATTERN_H_ */