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.

180 lines
4.7 KiB

  1. /*
  2. File: QDPictToCGContext.h
  3. Contains: API to draw Quickdraw PICTs into CoreGraphics context
  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 __QDPICTTOCGCONTEXT__
  11. #define __QDPICTTOCGCONTEXT__
  12. #ifndef __CGCONTEXT__
  13. #include <CGContext.h>
  14. #endif
  15. #if PRAGMA_ONCE
  16. #pragma once
  17. #endif
  18. #ifdef __cplusplus
  19. extern "C" {
  20. #endif
  21. #if PRAGMA_IMPORT
  22. #pragma import on
  23. #endif
  24. typedef struct QDPict* QDPictRef;
  25. /*
  26. Note: QuickDraw picture data typically comes in two forms: a PICT resource
  27. that begins the picture header data at the beginning of the resource and PICT
  28. files that begin with 512 bytes of arbitrary data, followed by
  29. the picture header data. For this reason, the routines that create a QDPictRef
  30. attempt to find the picture header data beginning at either the first byte
  31. of the data provided or at byte 513 of the data provided.
  32. Additionally the Picture Bounds must not be an empty rect.
  33. */
  34. /* Create a QDPict reference, using `provider' to obtain the QDPict's data.
  35. * It is assumed that either the first byte or the 513th byte of data
  36. * in the file referenced by the URL is the first byte of the
  37. * picture header. If the URL does not begin PICT data at one
  38. * of these places in the data fork then the QDPictRef returned will be NULL.
  39. */
  40. /*
  41. * QDPictCreateWithProvider()
  42. *
  43. * Availability:
  44. * Non-Carbon CFM: not available
  45. * CarbonLib: not available
  46. * Mac OS X: in version 10.1 and later
  47. */
  48. EXTERN_API_C( QDPictRef )
  49. QDPictCreateWithProvider(CGDataProviderRef provider);
  50. /* Create a QDPict reference from `url'.
  51. * It is assumed that either the first byte or the 513th byte of data
  52. * in the file referenced by the URL is the first byte of the
  53. * picture header. If the URL does not begin PICT data at one
  54. * of these places in the data fork then the QDPictRef returned will be NULL.
  55. */
  56. /*
  57. * QDPictCreateWithURL()
  58. *
  59. * Availability:
  60. * Non-Carbon CFM: not available
  61. * CarbonLib: not available
  62. * Mac OS X: in version 10.1 and later
  63. */
  64. EXTERN_API_C( QDPictRef )
  65. QDPictCreateWithURL(CFURLRef url);
  66. /* Increment the retain count of `pictRef' and return it. All
  67. * pictRefs are created with an initial retain count of 1. */
  68. /*
  69. * QDPictRetain()
  70. *
  71. * Availability:
  72. * Non-Carbon CFM: not available
  73. * CarbonLib: not available
  74. * Mac OS X: in version 10.1 and later
  75. */
  76. EXTERN_API_C( QDPictRef )
  77. QDPictRetain(QDPictRef pictRef);
  78. /* Decrement the retain count of `pictRef'. If the retain count reaches 0,
  79. * then free it and any associated resources. */
  80. /*
  81. * QDPictRelease()
  82. *
  83. * Availability:
  84. * Non-Carbon CFM: not available
  85. * CarbonLib: not available
  86. * Mac OS X: in version 10.1 and later
  87. */
  88. EXTERN_API_C( void )
  89. QDPictRelease(QDPictRef pictRef);
  90. /* Return the Picture Bounds of the QuickDraw picture represented by `pictRef'. This
  91. rectangle is in the default user space with one unit = 1/72 inch.
  92. */
  93. /*
  94. * QDPictGetBounds()
  95. *
  96. * Availability:
  97. * Non-Carbon CFM: not available
  98. * CarbonLib: not available
  99. * Mac OS X: in version 10.1 and later
  100. */
  101. EXTERN_API_C( CGRect )
  102. QDPictGetBounds(QDPictRef pictRef);
  103. /* Return the resolution of the QuickDraw picture represented by `pictRef'.
  104. This data, together with the CGRect returned by QDPictGetBounds, can be
  105. used to compute the size of the picture in pixels, which is what QuickDraw
  106. really records into pictures.
  107. */
  108. /*
  109. * QDPictGetResolution()
  110. *
  111. * Availability:
  112. * Non-Carbon CFM: not available
  113. * CarbonLib: not available
  114. * Mac OS X: in version 10.1 and later
  115. */
  116. EXTERN_API_C( void )
  117. QDPictGetResolution(
  118. QDPictRef pictRef,
  119. float * xRes,
  120. float * yRes);
  121. /* Draw `pictRef' in the rectangular area specified by `rect'.
  122. * The PICT bounds of the page is scaled, if necessary, to fit into
  123. * `rect'. To get unscaled results, supply a rect the size of the rect
  124. * returned by QDPictGetBounds.
  125. */
  126. /*
  127. * QDPictDrawToCGContext()
  128. *
  129. * Availability:
  130. * Non-Carbon CFM: not available
  131. * CarbonLib: not available
  132. * Mac OS X: in version 10.1 and later
  133. */
  134. EXTERN_API_C( OSStatus )
  135. QDPictDrawToCGContext(
  136. CGContextRef ctx,
  137. CGRect rect,
  138. QDPictRef pictRef);
  139. #ifdef PRAGMA_IMPORT_OFF
  140. #pragma import off
  141. #elif PRAGMA_IMPORT
  142. #pragma import reset
  143. #endif
  144. #ifdef __cplusplus
  145. }
  146. #endif
  147. #endif /* __QDPICTTOCGCONTEXT__ */