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.

795 lines
22 KiB

  1. /*
  2. File: QuickdrawText.h
  3. Contains: Quickdraw Text Interfaces.
  4. Version: QuickTime 7.3
  5. Copyright: (c) 2007 (c) 1983-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 __QUICKDRAWTEXT__
  11. #define __QUICKDRAWTEXT__
  12. #ifndef __MACTYPES__
  13. #include <MacTypes.h>
  14. #endif
  15. #ifndef __MIXEDMODE__
  16. #include <MixedMode.h>
  17. #endif
  18. #ifndef __INTLRESOURCES__
  19. #include <IntlResources.h>
  20. #endif
  21. #if PRAGMA_ONCE
  22. #pragma once
  23. #endif
  24. #ifdef __cplusplus
  25. extern "C" {
  26. #endif
  27. #if PRAGMA_IMPORT
  28. #pragma import on
  29. #endif
  30. #if PRAGMA_STRUCT_ALIGN
  31. #pragma options align=mac68k
  32. #elif PRAGMA_STRUCT_PACKPUSH
  33. #pragma pack(push, 2)
  34. #elif PRAGMA_STRUCT_PACK
  35. #pragma pack(2)
  36. #endif
  37. /* new CGrafPort bottleneck ("newProc2") function, used in Unicode Text drawing */
  38. /*
  39. * StandardGlyphs()
  40. *
  41. * Availability:
  42. * Non-Carbon CFM: in QuickDrawText 8.5 and later
  43. * CarbonLib: in CarbonLib 1.0 and later
  44. * Mac OS X: in version 10.0 and later
  45. */
  46. EXTERN_API_C( OSStatus )
  47. StandardGlyphs(
  48. void * dataStream,
  49. ByteCount size);
  50. enum {
  51. /* CharToPixel directions */
  52. leftCaret = 0, /*Place caret for left block*/
  53. rightCaret = -1, /*Place caret for right block*/
  54. kHilite = 1 /*Direction is SysDirection*/
  55. };
  56. enum {
  57. smLeftCaret = 0, /*Place caret for left block - obsolete */
  58. smRightCaret = -1, /*Place caret for right block - obsolete */
  59. smHilite = 1 /*Direction is TESysJust - obsolete */
  60. };
  61. enum {
  62. /*Constants for styleRunPosition argument in PortionLine, DrawJustified, MeasureJustified, CharToPixel, and PixelToChar.*/
  63. onlyStyleRun = 0, /* This is the only style run on the line */
  64. leftStyleRun = 1, /* This is leftmost of multiple style runs on the line */
  65. rightStyleRun = 2, /* This is rightmost of multiple style runs on the line */
  66. middleStyleRun = 3, /* There are multiple style runs on the line and this is neither the leftmost nor the rightmost. */
  67. smOnlyStyleRun = 0, /* obsolete */
  68. smLeftStyleRun = 1, /* obsolete */
  69. smRightStyleRun = 2, /* obsolete */
  70. smMiddleStyleRun = 3 /* obsolete */
  71. };
  72. /* type for styleRunPosition parameter in PixelToChar etc. */
  73. typedef short JustStyleCode;
  74. /* Type for truncWhere parameter in TruncString, TruncText */
  75. typedef short TruncCode;
  76. enum {
  77. /* Constants for truncWhere argument in TruncString and TruncText */
  78. truncEnd = 0, /* Truncate at end */
  79. truncMiddle = 0x4000, /* Truncate in middle */
  80. smTruncEnd = 0, /* Truncate at end - obsolete */
  81. smTruncMiddle = 0x4000 /* Truncate in middle - obsolete */
  82. };
  83. enum {
  84. /* Constants for TruncString and TruncText results */
  85. notTruncated = 0, /* No truncation was necessary */
  86. truncated = 1, /* Truncation performed */
  87. truncErr = -1, /* General error */
  88. smNotTruncated = 0, /* No truncation was necessary - obsolete */
  89. smTruncated = 1, /* Truncation performed - obsolete */
  90. smTruncErr = -1 /* General error - obsolete */
  91. };
  92. typedef SInt8 StyledLineBreakCode;
  93. enum {
  94. smBreakWord = 0,
  95. smBreakChar = 1,
  96. smBreakOverflow = 2
  97. };
  98. /*QuickTime3.0*/
  99. enum {
  100. /* Constants for txFlags (which used to be the pad field after txFace) */
  101. tfAntiAlias = 1 << 0,
  102. tfUnicode = 1 << 1
  103. };
  104. struct FontInfo {
  105. short ascent;
  106. short descent;
  107. short widMax;
  108. short leading;
  109. };
  110. typedef struct FontInfo FontInfo;
  111. typedef short FormatOrder[1];
  112. typedef FormatOrder * FormatOrderPtr;
  113. /* FormatStatus was moved to TextUtils.i */
  114. /* OffsetTable moved to IntlResources.i */
  115. typedef CALLBACK_API( Boolean , StyleRunDirectionProcPtr )(short styleRunIndex, void *dirParam);
  116. typedef STACK_UPP_TYPE(StyleRunDirectionProcPtr) StyleRunDirectionUPP;
  117. /*
  118. * NewStyleRunDirectionUPP()
  119. *
  120. * Availability:
  121. * Non-Carbon CFM: available as macro/inline
  122. * CarbonLib: in CarbonLib 1.0 and later
  123. * Mac OS X: in version 10.0 and later
  124. */
  125. EXTERN_API_C( StyleRunDirectionUPP )
  126. NewStyleRunDirectionUPP(StyleRunDirectionProcPtr userRoutine);
  127. #if !OPAQUE_UPP_TYPES
  128. enum { uppStyleRunDirectionProcInfo = 0x00000390 }; /* pascal 1_byte Func(2_bytes, 4_bytes) */
  129. #ifdef __cplusplus
  130. inline DEFINE_API_C(StyleRunDirectionUPP) NewStyleRunDirectionUPP(StyleRunDirectionProcPtr userRoutine) { return (StyleRunDirectionUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppStyleRunDirectionProcInfo, GetCurrentArchitecture()); }
  131. #else
  132. #define NewStyleRunDirectionUPP(userRoutine) (StyleRunDirectionUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppStyleRunDirectionProcInfo, GetCurrentArchitecture())
  133. #endif
  134. #endif
  135. /*
  136. * DisposeStyleRunDirectionUPP()
  137. *
  138. * Availability:
  139. * Non-Carbon CFM: available as macro/inline
  140. * CarbonLib: in CarbonLib 1.0 and later
  141. * Mac OS X: in version 10.0 and later
  142. */
  143. EXTERN_API_C( void )
  144. DisposeStyleRunDirectionUPP(StyleRunDirectionUPP userUPP);
  145. #if !OPAQUE_UPP_TYPES
  146. #ifdef __cplusplus
  147. inline DEFINE_API_C(void) DisposeStyleRunDirectionUPP(StyleRunDirectionUPP userUPP) { DisposeRoutineDescriptor((UniversalProcPtr)userUPP); }
  148. #else
  149. #define DisposeStyleRunDirectionUPP(userUPP) DisposeRoutineDescriptor(userUPP)
  150. #endif
  151. #endif
  152. /*
  153. * InvokeStyleRunDirectionUPP()
  154. *
  155. * Availability:
  156. * Non-Carbon CFM: available as macro/inline
  157. * CarbonLib: in CarbonLib 1.0 and later
  158. * Mac OS X: in version 10.0 and later
  159. */
  160. EXTERN_API_C( Boolean )
  161. InvokeStyleRunDirectionUPP(
  162. short styleRunIndex,
  163. void * dirParam,
  164. StyleRunDirectionUPP userUPP);
  165. #if !OPAQUE_UPP_TYPES
  166. #ifdef __cplusplus
  167. inline DEFINE_API_C(Boolean) InvokeStyleRunDirectionUPP(short styleRunIndex, void * dirParam, StyleRunDirectionUPP userUPP) { return (Boolean)CALL_TWO_PARAMETER_UPP(userUPP, uppStyleRunDirectionProcInfo, styleRunIndex, dirParam); }
  168. #else
  169. #define InvokeStyleRunDirectionUPP(styleRunIndex, dirParam, userUPP) (Boolean)CALL_TWO_PARAMETER_UPP((userUPP), uppStyleRunDirectionProcInfo, (styleRunIndex), (dirParam))
  170. #endif
  171. #endif
  172. #if CALL_NOT_IN_CARBON || OLDROUTINENAMES
  173. /* support for pre-Carbon UPP routines: New...Proc and Call...Proc */
  174. #define NewStyleRunDirectionProc(userRoutine) NewStyleRunDirectionUPP(userRoutine)
  175. #define CallStyleRunDirectionProc(userRoutine, styleRunIndex, dirParam) InvokeStyleRunDirectionUPP(styleRunIndex, dirParam, userRoutine)
  176. #endif /* CALL_NOT_IN_CARBON */
  177. #if CALL_NOT_IN_CARBON
  178. /*
  179. * Pixel2Char()
  180. *
  181. * Availability:
  182. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  183. * CarbonLib: not available
  184. * Mac OS X: not available
  185. */
  186. EXTERN_API( short )
  187. Pixel2Char(
  188. Ptr textBuf,
  189. short textLen,
  190. short slop,
  191. short pixelWidth,
  192. Boolean * leadingEdge) FOURWORDINLINE(0x2F3C, 0x820E, 0x0014, 0xA8B5);
  193. /*
  194. * Char2Pixel()
  195. *
  196. * Availability:
  197. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  198. * CarbonLib: not available
  199. * Mac OS X: not available
  200. */
  201. EXTERN_API( short )
  202. Char2Pixel(
  203. Ptr textBuf,
  204. short textLen,
  205. short slop,
  206. short offset,
  207. short direction) FOURWORDINLINE(0x2F3C, 0x820C, 0x0016, 0xA8B5);
  208. #endif /* CALL_NOT_IN_CARBON */
  209. /*
  210. * PixelToChar()
  211. *
  212. * Availability:
  213. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  214. * CarbonLib: in CarbonLib 1.0 and later
  215. * Mac OS X: in version 10.0 and later
  216. */
  217. EXTERN_API( short )
  218. PixelToChar(
  219. Ptr textBuf,
  220. long textLength,
  221. Fixed slop,
  222. Fixed pixelWidth,
  223. Boolean * leadingEdge,
  224. Fixed * widthRemaining,
  225. JustStyleCode styleRunPosition,
  226. Point numer,
  227. Point denom) FOURWORDINLINE(0x2F3C, 0x8222, 0x002E, 0xA8B5);
  228. /*
  229. * CharToPixel()
  230. *
  231. * Availability:
  232. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  233. * CarbonLib: in CarbonLib 1.0 and later
  234. * Mac OS X: in version 10.0 and later
  235. */
  236. EXTERN_API( short )
  237. CharToPixel(
  238. Ptr textBuf,
  239. long textLength,
  240. Fixed slop,
  241. long offset,
  242. short direction,
  243. JustStyleCode styleRunPosition,
  244. Point numer,
  245. Point denom) FOURWORDINLINE(0x2F3C, 0x821C, 0x0030, 0xA8B5);
  246. /*
  247. * DrawJustified()
  248. *
  249. * Availability:
  250. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  251. * CarbonLib: in CarbonLib 1.0 and later
  252. * Mac OS X: in version 10.0 and later
  253. */
  254. EXTERN_API( void )
  255. DrawJustified(
  256. Ptr textPtr,
  257. long textLength,
  258. Fixed slop,
  259. JustStyleCode styleRunPosition,
  260. Point numer,
  261. Point denom) FOURWORDINLINE(0x2F3C, 0x8016, 0x0032, 0xA8B5);
  262. /*
  263. * MeasureJustified()
  264. *
  265. * Availability:
  266. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  267. * CarbonLib: in CarbonLib 1.0 and later
  268. * Mac OS X: in version 10.0 and later
  269. */
  270. EXTERN_API( void )
  271. MeasureJustified(
  272. Ptr textPtr,
  273. long textLength,
  274. Fixed slop,
  275. Ptr charLocs,
  276. JustStyleCode styleRunPosition,
  277. Point numer,
  278. Point denom) FOURWORDINLINE(0x2F3C, 0x801A, 0x0034, 0xA8B5);
  279. /*
  280. * PortionLine()
  281. *
  282. * Availability:
  283. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  284. * CarbonLib: in CarbonLib 1.0 and later
  285. * Mac OS X: in version 10.0 and later
  286. */
  287. EXTERN_API( Fixed )
  288. PortionLine(
  289. Ptr textPtr,
  290. long textLen,
  291. JustStyleCode styleRunPosition,
  292. Point numer,
  293. Point denom) FOURWORDINLINE(0x2F3C, 0x8412, 0x0036, 0xA8B5);
  294. /*
  295. * HiliteText()
  296. *
  297. * Availability:
  298. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  299. * CarbonLib: in CarbonLib 1.0 and later
  300. * Mac OS X: in version 10.0 and later
  301. */
  302. EXTERN_API( void )
  303. HiliteText(
  304. Ptr textPtr,
  305. short textLength,
  306. short firstOffset,
  307. short secondOffset,
  308. OffsetTable offsets) FOURWORDINLINE(0x2F3C, 0x800E, 0x001C, 0xA8B5);
  309. #if CALL_NOT_IN_CARBON
  310. /*
  311. * DrawJust()
  312. *
  313. * Availability:
  314. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  315. * CarbonLib: not available
  316. * Mac OS X: not available
  317. */
  318. EXTERN_API( void )
  319. DrawJust(
  320. Ptr textPtr,
  321. short textLength,
  322. short slop) FOURWORDINLINE(0x2F3C, 0x8008, 0x001E, 0xA8B5);
  323. /*
  324. * MeasureJust()
  325. *
  326. * Availability:
  327. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  328. * CarbonLib: not available
  329. * Mac OS X: not available
  330. */
  331. EXTERN_API( void )
  332. MeasureJust(
  333. Ptr textPtr,
  334. short textLength,
  335. short slop,
  336. Ptr charLocs) FOURWORDINLINE(0x2F3C, 0x800C, 0x0020, 0xA8B5);
  337. /*
  338. * PortionText()
  339. *
  340. * Availability:
  341. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  342. * CarbonLib: not available
  343. * Mac OS X: not available
  344. */
  345. EXTERN_API( Fixed )
  346. PortionText(
  347. Ptr textPtr,
  348. long textLength) FOURWORDINLINE(0x2F3C, 0x8408, 0x0024, 0xA8B5);
  349. #endif /* CALL_NOT_IN_CARBON */
  350. /*
  351. * VisibleLength()
  352. *
  353. * Availability:
  354. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  355. * CarbonLib: in CarbonLib 1.0 and later
  356. * Mac OS X: in version 10.0 and later
  357. */
  358. EXTERN_API( long )
  359. VisibleLength(
  360. Ptr textPtr,
  361. long textLength) FOURWORDINLINE(0x2F3C, 0x8408, 0x0028, 0xA8B5);
  362. /*
  363. * GetFormatOrder()
  364. *
  365. * Availability:
  366. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  367. * CarbonLib: in CarbonLib 1.0 and later
  368. * Mac OS X: in version 10.0 and later
  369. */
  370. EXTERN_API( void )
  371. GetFormatOrder(
  372. FormatOrderPtr ordering,
  373. short firstFormat,
  374. short lastFormat,
  375. Boolean lineRight,
  376. StyleRunDirectionUPP rlDirProc,
  377. Ptr dirParam) FOURWORDINLINE(0x2F3C, 0x8012, 0xFFFC, 0xA8B5);
  378. /*
  379. * TextFont()
  380. *
  381. * Availability:
  382. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  383. * CarbonLib: in CarbonLib 1.0 and later
  384. * Mac OS X: in version 10.0 and later
  385. */
  386. EXTERN_API( void )
  387. TextFont(short font) ONEWORDINLINE(0xA887);
  388. /*
  389. * TextFace()
  390. *
  391. * Availability:
  392. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  393. * CarbonLib: in CarbonLib 1.0 and later
  394. * Mac OS X: in version 10.0 and later
  395. */
  396. EXTERN_API( void )
  397. TextFace(StyleParameter face) ONEWORDINLINE(0xA888);
  398. /*
  399. * TextMode()
  400. *
  401. * Availability:
  402. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  403. * CarbonLib: in CarbonLib 1.0 and later
  404. * Mac OS X: in version 10.0 and later
  405. */
  406. EXTERN_API( void )
  407. TextMode(short mode) ONEWORDINLINE(0xA889);
  408. /*
  409. * TextSize()
  410. *
  411. * Availability:
  412. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  413. * CarbonLib: in CarbonLib 1.0 and later
  414. * Mac OS X: in version 10.0 and later
  415. */
  416. EXTERN_API( void )
  417. TextSize(short size) ONEWORDINLINE(0xA88A);
  418. /*
  419. * SpaceExtra()
  420. *
  421. * Availability:
  422. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  423. * CarbonLib: in CarbonLib 1.0 and later
  424. * Mac OS X: in version 10.0 and later
  425. */
  426. EXTERN_API( void )
  427. SpaceExtra(Fixed extra) ONEWORDINLINE(0xA88E);
  428. /*
  429. * DrawChar()
  430. *
  431. * Availability:
  432. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  433. * CarbonLib: in CarbonLib 1.0 and later
  434. * Mac OS X: in version 10.0 and later
  435. */
  436. EXTERN_API( void )
  437. DrawChar(CharParameter ch) ONEWORDINLINE(0xA883);
  438. /*
  439. * DrawString()
  440. *
  441. * Availability:
  442. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  443. * CarbonLib: in CarbonLib 1.0 and later
  444. * Mac OS X: in version 10.0 and later
  445. */
  446. EXTERN_API( void )
  447. DrawString(ConstStr255Param s) ONEWORDINLINE(0xA884);
  448. /*
  449. * [Mac]DrawText()
  450. *
  451. * Availability:
  452. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  453. * CarbonLib: in CarbonLib 1.0 and later
  454. * Mac OS X: in version 10.0 and later
  455. */
  456. #if TARGET_OS_MAC
  457. #define MacDrawText DrawText
  458. #endif
  459. EXTERN_API( void )
  460. MacDrawText(
  461. const void * textBuf,
  462. short firstByte,
  463. short byteCount) ONEWORDINLINE(0xA885);
  464. /*
  465. * CharWidth()
  466. *
  467. * Availability:
  468. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  469. * CarbonLib: in CarbonLib 1.0 and later
  470. * Mac OS X: in version 10.0 and later
  471. */
  472. EXTERN_API( short )
  473. CharWidth(CharParameter ch) ONEWORDINLINE(0xA88D);
  474. /*
  475. * StringWidth()
  476. *
  477. * Availability:
  478. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  479. * CarbonLib: in CarbonLib 1.0 and later
  480. * Mac OS X: in version 10.0 and later
  481. */
  482. EXTERN_API( short )
  483. StringWidth(ConstStr255Param s) ONEWORDINLINE(0xA88C);
  484. /*
  485. * TextWidth()
  486. *
  487. * Availability:
  488. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  489. * CarbonLib: in CarbonLib 1.0 and later
  490. * Mac OS X: in version 10.0 and later
  491. */
  492. EXTERN_API( short )
  493. TextWidth(
  494. const void * textBuf,
  495. short firstByte,
  496. short byteCount) ONEWORDINLINE(0xA886);
  497. /*
  498. * MeasureText()
  499. *
  500. * Availability:
  501. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  502. * CarbonLib: in CarbonLib 1.0 and later
  503. * Mac OS X: in version 10.0 and later
  504. */
  505. EXTERN_API( void )
  506. MeasureText(
  507. short count,
  508. const void * textAddr,
  509. void * charLocs) ONEWORDINLINE(0xA837);
  510. /*
  511. * GetFontInfo()
  512. *
  513. * Availability:
  514. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  515. * CarbonLib: in CarbonLib 1.0 and later
  516. * Mac OS X: in version 10.0 and later
  517. */
  518. EXTERN_API( void )
  519. GetFontInfo(FontInfo * info) ONEWORDINLINE(0xA88B);
  520. /*
  521. * CharExtra()
  522. *
  523. * Availability:
  524. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  525. * CarbonLib: in CarbonLib 1.0 and later
  526. * Mac OS X: in version 10.0 and later
  527. */
  528. EXTERN_API( void )
  529. CharExtra(Fixed extra) ONEWORDINLINE(0xAA23);
  530. /*
  531. * StdText()
  532. *
  533. * Availability:
  534. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  535. * CarbonLib: in CarbonLib 1.0 and later
  536. * Mac OS X: in version 10.0 and later
  537. */
  538. EXTERN_API( void )
  539. StdText(
  540. short count,
  541. const void * textAddr,
  542. Point numer,
  543. Point denom) ONEWORDINLINE(0xA882);
  544. /*
  545. * StdTxMeas()
  546. *
  547. * Availability:
  548. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  549. * CarbonLib: in CarbonLib 1.0 and later
  550. * Mac OS X: in version 10.0 and later
  551. */
  552. EXTERN_API( short )
  553. StdTxMeas(
  554. short byteCount,
  555. const void * textAddr,
  556. Point * numer,
  557. Point * denom,
  558. FontInfo * info) ONEWORDINLINE(0xA8ED);
  559. /*
  560. * StyledLineBreak()
  561. *
  562. * Availability:
  563. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  564. * CarbonLib: in CarbonLib 1.0 and later
  565. * Mac OS X: in version 10.0 and later
  566. */
  567. EXTERN_API( StyledLineBreakCode )
  568. StyledLineBreak(
  569. Ptr textPtr,
  570. long textLen,
  571. long textStart,
  572. long textEnd,
  573. long flags,
  574. Fixed * textWidth,
  575. long * textOffset) FOURWORDINLINE(0x2F3C, 0x821C, 0xFFFE, 0xA8B5);
  576. /*
  577. * TruncString()
  578. *
  579. * Availability:
  580. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  581. * CarbonLib: in CarbonLib 1.0 and later
  582. * Mac OS X: in version 10.0 and later
  583. */
  584. EXTERN_API( short )
  585. TruncString(
  586. short width,
  587. Str255 theString,
  588. TruncCode truncWhere) FOURWORDINLINE(0x2F3C, 0x8208, 0xFFE0, 0xA8B5);
  589. /*
  590. * TruncText()
  591. *
  592. * Availability:
  593. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  594. * CarbonLib: in CarbonLib 1.0 and later
  595. * Mac OS X: in version 10.0 and later
  596. */
  597. EXTERN_API( short )
  598. TruncText(
  599. short width,
  600. Ptr textPtr,
  601. short * length,
  602. TruncCode truncWhere) FOURWORDINLINE(0x2F3C, 0x820C, 0xFFDE, 0xA8B5);
  603. #if CALL_NOT_IN_CARBON
  604. /*
  605. * drawstring()
  606. *
  607. * Availability:
  608. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  609. * CarbonLib: not available
  610. * Mac OS X: not available
  611. */
  612. EXTERN_API_C( void )
  613. drawstring(const char * s);
  614. /*
  615. * stringwidth()
  616. *
  617. * Availability:
  618. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  619. * CarbonLib: not available
  620. * Mac OS X: not available
  621. */
  622. EXTERN_API_C( short )
  623. stringwidth(const char * s);
  624. #endif /* CALL_NOT_IN_CARBON */
  625. /*
  626. * stdtext()
  627. *
  628. * Availability:
  629. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  630. * CarbonLib: in CarbonLib 1.0 and later
  631. * Mac OS X: in version 10.0 and later
  632. */
  633. EXTERN_API_C( void )
  634. stdtext(
  635. short count,
  636. const void * textAddr,
  637. const Point * numer,
  638. const Point * denom);
  639. /*
  640. * SwapQDTextFlags()
  641. *
  642. * Discussion:
  643. * Obsolete. Use QDSwapTextFlags instead (in Quickdraw.h).
  644. *
  645. * Availability:
  646. * Non-Carbon CFM: not available
  647. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.2 and later
  648. * Mac OS X: in version 10.2 and later
  649. */
  650. EXTERN_API_C( UInt32 )
  651. SwapQDTextFlags(UInt32 newFlags);
  652. #if OLDROUTINENAMES
  653. #define NPixel2Char(textBuf, textLen, slop, pixelWidth, leadingEdge, widthRemaining, styleRunPosition, numer, denom) \
  654. PixelToChar(textBuf, textLen, slop, pixelWidth, leadingEdge, widthRemaining, styleRunPosition, numer, denom)
  655. #define NChar2Pixel(textBuf, textLen, slop, offset, direction, styleRunPosition, numer, denom) \
  656. CharToPixel(textBuf, textLen, slop, offset, direction, styleRunPosition, numer, denom)
  657. #define NDrawJust(textPtr, textLength, slop, styleRunPosition, numer, denom) \
  658. DrawJustified(textPtr, textLength, slop, styleRunPosition, numer, denom)
  659. #define NMeasureJust(textPtr, textLength, slop, charLocs, styleRunPosition, numer, denom) \
  660. MeasureJustified(textPtr, textLength, slop, charLocs, styleRunPosition, numer, denom)
  661. #define NPortionText(textPtr, textLen, styleRunPosition, numer, denom)\
  662. PortionLine(textPtr, textLen, styleRunPosition, numer, denom)
  663. #endif /* OLDROUTINENAMES */
  664. #if PRAGMA_STRUCT_ALIGN
  665. #pragma options align=reset
  666. #elif PRAGMA_STRUCT_PACKPUSH
  667. #pragma pack(pop)
  668. #elif PRAGMA_STRUCT_PACK
  669. #pragma pack()
  670. #endif
  671. #ifdef PRAGMA_IMPORT_OFF
  672. #pragma import off
  673. #elif PRAGMA_IMPORT
  674. #pragma import reset
  675. #endif
  676. #ifdef __cplusplus
  677. }
  678. #endif
  679. #endif /* __QUICKDRAWTEXT__ */