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.

385 lines
7.5 KiB

  1. /*
  2. File: HIMovieView.h
  3. Contains: HIView-based movie playback
  4. Version: QuickTime 7.3
  5. Copyright: (c) 2007 (c) 2004-2007 by Apple 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 __HIMOVIEVIEW__
  11. #define __HIMOVIEVIEW__
  12. #ifndef __HIVIEW__
  13. #include <HIView.h>
  14. #endif
  15. #ifndef __MOVIES__
  16. #include <Movies.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. /* QuickTime is not available to 64-bit clients */
  35. #if !__LP64__
  36. #if TARGET_OS_MAC
  37. /*
  38. * kHIMovieViewClassID
  39. *
  40. * Summary:
  41. * Class ID for HIMovieView
  42. */
  43. #define kHIMovieViewClassID CFSTR("com.apple.quicktime.HIMovieView")
  44. /*
  45. * Summary:
  46. * HIMovieView Event class
  47. */
  48. enum {
  49. /*
  50. * Events related to movie views.
  51. */
  52. kEventClassMovieView = FOUR_CHAR_CODE('moov')
  53. };
  54. /*
  55. * kEventClassMovieView / kEventMovieViewOptimalBoundsChanged
  56. *
  57. * Summary:
  58. * Sent when the movie size changes.
  59. *
  60. * Parameters:
  61. *
  62. * --> kEventParamDirectObject (in, typeControlRef)
  63. * The movie view whose size is changing.
  64. *
  65. * --> kEventParamControlOptimalBounds (in, typeHIRect)
  66. * The new optimal bounds.
  67. *
  68. * Availability:
  69. * Non-Carbon CFM: not available
  70. * CarbonLib: not available
  71. */
  72. enum {
  73. kEventMovieViewOptimalBoundsChanged = 1
  74. };
  75. /*
  76. * Summary:
  77. * HIMovieView attributes
  78. */
  79. enum {
  80. /*
  81. * No attributes
  82. */
  83. kHIMovieViewNoAttributes = 0L,
  84. /*
  85. * Movie controller bar is visible below visual content
  86. */
  87. kHIMovieViewControllerVisibleAttribute = (1L << 0),
  88. /*
  89. * Automatically call MCIdle() at appropriate times
  90. */
  91. kHIMovieViewAutoIdlingAttribute = (1L << 1),
  92. /*
  93. * Accepts keyboard focus
  94. */
  95. kHIMovieViewAcceptsFocusAttribute = (1L << 2),
  96. /*
  97. * Movie editing enabled
  98. */
  99. kHIMovieViewEditableAttribute = (1L << 3),
  100. /*
  101. * Handles editing HI commands such as cut, copy and paste
  102. */
  103. kHIMovieViewHandleEditingHIAttribute = (1L << 4),
  104. /*
  105. * Combination of kHIMovieViewControllerVisibleAttribute,
  106. * kHIMovieViewAutoIdlingAttribute, and
  107. * kHIMovieViewAcceptsFocusAttribute
  108. */
  109. kHIMovieViewStandardAttributes = (kHIMovieViewControllerVisibleAttribute | kHIMovieViewAutoIdlingAttribute | kHIMovieViewAcceptsFocusAttribute)
  110. };
  111. /*
  112. * HIMovieViewCreate()
  113. *
  114. * Summary:
  115. * Creates an HIMovieView object
  116. *
  117. * Discussion:
  118. * If successful, the created view will have a single retain count.
  119. *
  120. * Parameters:
  121. *
  122. * inMovie:
  123. * [in] Initial movie to view, may be NULL
  124. *
  125. * inAttributes:
  126. * [in] Initial HIMovieView attributes
  127. *
  128. * outMovieView:
  129. * [out] Points to variable to receive new HIMovieView
  130. *
  131. * Availability:
  132. * Non-Carbon CFM: not available
  133. * CarbonLib: not available
  134. * Mac OS X: in version 10.4 (or QuickTime 7.0) and later
  135. */
  136. EXTERN_API_C( OSStatus )
  137. HIMovieViewCreate(
  138. Movie inMovie,
  139. OptionBits inAttributes,
  140. HIViewRef * outMovieView);
  141. /*
  142. * HIMovieViewGetMovie()
  143. *
  144. * Summary:
  145. * Returns the view's current movie.
  146. *
  147. * Parameters:
  148. *
  149. * inView:
  150. * [in] The HIMovieView
  151. *
  152. * Availability:
  153. * Non-Carbon CFM: not available
  154. * CarbonLib: not available
  155. * Mac OS X: in version 10.4 (or QuickTime 7.0) and later
  156. */
  157. EXTERN_API_C( Movie )
  158. HIMovieViewGetMovie(HIViewRef inView);
  159. /*
  160. * HIMovieViewSetMovie()
  161. *
  162. * Summary:
  163. * Sets the view's current movie.
  164. *
  165. * Parameters:
  166. *
  167. * inView:
  168. * [in] The HIMovieView
  169. *
  170. * inMovie:
  171. * [in] The new movie to display
  172. *
  173. * Availability:
  174. * Non-Carbon CFM: not available
  175. * CarbonLib: not available
  176. * Mac OS X: in version 10.4 (or QuickTime 7.0) and later
  177. */
  178. EXTERN_API_C( OSStatus )
  179. HIMovieViewSetMovie(
  180. HIViewRef inView,
  181. Movie inMovie);
  182. /*
  183. * HIMovieViewGetAttributes()
  184. *
  185. * Summary:
  186. * Returns the view's current attributes.
  187. *
  188. * Parameters:
  189. *
  190. * inView:
  191. * [in] The HIMovieView
  192. *
  193. * Availability:
  194. * Non-Carbon CFM: not available
  195. * CarbonLib: not available
  196. * Mac OS X: in version 10.4 (or QuickTime 7.0) and later
  197. */
  198. EXTERN_API_C( OptionBits )
  199. HIMovieViewGetAttributes(HIViewRef inView);
  200. /*
  201. * HIMovieViewChangeAttributes()
  202. *
  203. * Summary:
  204. * Changes the views attributes.
  205. *
  206. * Discussion:
  207. * Setting an attribute takes precedence over clearing the attribute.
  208. *
  209. * Parameters:
  210. *
  211. * inView:
  212. * [in] The HIMovieView
  213. *
  214. * inAttributesToSet:
  215. * [in] Attributes to set
  216. *
  217. * inAttributesToClear:
  218. * [in] Attributes to clear
  219. *
  220. * Availability:
  221. * Non-Carbon CFM: not available
  222. * CarbonLib: not available
  223. * Mac OS X: in version 10.4 (or QuickTime 7.0) and later
  224. */
  225. EXTERN_API_C( OSStatus )
  226. HIMovieViewChangeAttributes(
  227. HIViewRef inView,
  228. OptionBits inAttributesToSet,
  229. OptionBits inAttributesToClear);
  230. /*
  231. * HIMovieViewGetMovieController()
  232. *
  233. * Summary:
  234. * Returns the view's current movie controller.
  235. *
  236. * Parameters:
  237. *
  238. * inView:
  239. * [in] The HIMovieView
  240. *
  241. * Availability:
  242. * Non-Carbon CFM: not available
  243. * CarbonLib: not available
  244. * Mac OS X: in version 10.4 (or QuickTime 7.0) and later
  245. */
  246. EXTERN_API_C( MovieController )
  247. HIMovieViewGetMovieController(HIViewRef inView);
  248. /*
  249. * HIMovieViewGetControllerBarSize()
  250. *
  251. * Summary:
  252. * Returns the size of the visible movie controller bar.
  253. *
  254. * Parameters:
  255. *
  256. * inView:
  257. * [in] The HIMovieView
  258. *
  259. * Availability:
  260. * Non-Carbon CFM: not available
  261. * CarbonLib: not available
  262. * Mac OS X: in version 10.4 (or QuickTime 7.0) and later
  263. */
  264. EXTERN_API_C( HISize )
  265. HIMovieViewGetControllerBarSize(HIViewRef inView);
  266. /*
  267. * HIMovieViewPlay()
  268. *
  269. * Summary:
  270. * Convenience routine to play the view's current movie.
  271. *
  272. * Discussion:
  273. * If the movie is already playing, this function does nothing.
  274. *
  275. * Parameters:
  276. *
  277. * movieView:
  278. * [in] The movie view.
  279. *
  280. * Availability:
  281. * Non-Carbon CFM: not available
  282. * CarbonLib: not available
  283. * Mac OS X: in version 10.4 (or QuickTime 7.0) and later
  284. */
  285. EXTERN_API_C( OSStatus )
  286. HIMovieViewPlay(HIViewRef movieView);
  287. /*
  288. * HIMovieViewPause()
  289. *
  290. * Summary:
  291. * Convenience routine to pause the view's current movie.
  292. *
  293. * Discussion:
  294. * If the movie is already paused, this function does nothing.
  295. *
  296. * Parameters:
  297. *
  298. * movieView:
  299. * [in] The movie view.
  300. *
  301. * Availability:
  302. * Non-Carbon CFM: not available
  303. * CarbonLib: not available
  304. * Mac OS X: in version 10.4 (or QuickTime 7.0) and later
  305. */
  306. EXTERN_API_C( OSStatus )
  307. HIMovieViewPause(HIViewRef movieView);
  308. #endif /* TARGET_OS_MAC */
  309. #endif // !__LP64__
  310. #if PRAGMA_STRUCT_ALIGN
  311. #pragma options align=reset
  312. #elif PRAGMA_STRUCT_PACKPUSH
  313. #pragma pack(pop)
  314. #elif PRAGMA_STRUCT_PACK
  315. #pragma pack()
  316. #endif
  317. #ifdef PRAGMA_IMPORT_OFF
  318. #pragma import off
  319. #elif PRAGMA_IMPORT
  320. #pragma import reset
  321. #endif
  322. #ifdef __cplusplus
  323. }
  324. #endif
  325. #endif /* __HIMOVIEVIEW__ */