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.

140 lines
3.3 KiB

  1. /*
  2. File: CGDataConsumer.h
  3. Contains: CoreGraphics data consumer
  4. Version: QuickTime 7.3
  5. Copyright: (c) 2007 (c) 2000-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 CGDATACONSUMER_H_
  11. #define CGDATACONSUMER_H_
  12. #ifndef __CGBASE__
  13. #include <CGBase.h>
  14. #endif
  15. #ifndef __CFURL__
  16. #include <CFURL.h>
  17. #endif
  18. #if PRAGMA_ONCE
  19. #pragma once
  20. #endif
  21. #ifdef __cplusplus
  22. extern "C" {
  23. #endif
  24. #if PRAGMA_IMPORT
  25. #pragma import on
  26. #endif
  27. #if PRAGMA_STRUCT_ALIGN
  28. #pragma options align=mac68k
  29. #elif PRAGMA_STRUCT_PACKPUSH
  30. #pragma pack(push, 2)
  31. #elif PRAGMA_STRUCT_PACK
  32. #pragma pack(2)
  33. #endif
  34. typedef struct CGDataConsumer* CGDataConsumerRef;
  35. typedef CALLBACK_API_C( size_t , CGPutBytesProcPtr )(void *info, const void *buffer, size_t count);
  36. typedef CALLBACK_API_C( void , CGReleaseConsumerProcPtr )(void * info);
  37. /* Callbacks for accessing data.
  38. * `putBytes' copies `count' bytes from `buffer' to the consumer, and
  39. * returns the number of bytes copied. It should return 0 if no more data
  40. * can be written to the consumer.
  41. * `releaseConsumer', if non-NULL, is called when the consumer is freed. */
  42. struct CGDataConsumerCallbacks {
  43. CGPutBytesProcPtr putBytes;
  44. CGReleaseConsumerProcPtr releaseConsumer;
  45. };
  46. typedef struct CGDataConsumerCallbacks CGDataConsumerCallbacks;
  47. /* Create a data consumer using `callbacks' to handle the data. `info' is
  48. * passed to each of the callback functions. */
  49. /*
  50. * CGDataConsumerCreate()
  51. *
  52. * Availability:
  53. * Non-Carbon CFM: not available
  54. * CarbonLib: not available
  55. * Mac OS X: in version 10.0 and later
  56. */
  57. EXTERN_API_C( CGDataConsumerRef )
  58. CGDataConsumerCreate(
  59. void * info,
  60. const CGDataConsumerCallbacks * callbacks);
  61. /* Create a data consumer which writes data to `url'. */
  62. /*
  63. * CGDataConsumerCreateWithURL()
  64. *
  65. * Availability:
  66. * Non-Carbon CFM: not available
  67. * CarbonLib: not available
  68. * Mac OS X: in version 10.0 and later
  69. */
  70. EXTERN_API_C( CGDataConsumerRef )
  71. CGDataConsumerCreateWithURL(CFURLRef url);
  72. /* Increment the retain count of `consumer' and return it. All data
  73. * consumers are created with an initial retain count of 1. */
  74. /*
  75. * CGDataConsumerRetain()
  76. *
  77. * Availability:
  78. * Non-Carbon CFM: not available
  79. * CarbonLib: not available
  80. * Mac OS X: in version 10.0 and later
  81. */
  82. EXTERN_API_C( CGDataConsumerRef )
  83. CGDataConsumerRetain(CGDataConsumerRef consumer);
  84. /* Decrement the retain count of `consumer'. If the retain count reaches
  85. * 0, then release it and any associated resources. */
  86. /*
  87. * CGDataConsumerRelease()
  88. *
  89. * Availability:
  90. * Non-Carbon CFM: not available
  91. * CarbonLib: not available
  92. * Mac OS X: in version 10.0 and later
  93. */
  94. EXTERN_API_C( void )
  95. CGDataConsumerRelease(CGDataConsumerRef consumer);
  96. #if PRAGMA_STRUCT_ALIGN
  97. #pragma options align=reset
  98. #elif PRAGMA_STRUCT_PACKPUSH
  99. #pragma pack(pop)
  100. #elif PRAGMA_STRUCT_PACK
  101. #pragma pack()
  102. #endif
  103. #ifdef PRAGMA_IMPORT_OFF
  104. #pragma import off
  105. #elif PRAGMA_IMPORT
  106. #pragma import reset
  107. #endif
  108. #ifdef __cplusplus
  109. }
  110. #endif
  111. #endif /* CGDATACONSUMER_H_ */