home *** CD-ROM | disk | FTP | other *** search
/ ftp.mactech.com 2010 / ftp.mactech.com.tar / ftp.mactech.com / csmpdigest / csmp-digest-v3-040 < prev    next >
Text File  |  2010-09-21  |  136KB  |  3,570 lines

  1. Received-Date: Tue, 28 Jun 1994 15:44:39 +0200
  2. From: pottier@clipper.ens.fr (Francois Pottier)
  3. Subject: csmp-digest-v3-040
  4. To: csmp-digest@ens.fr
  5. Date: Tue, 28 Jun 1994 15:44:22 +0200 (MET DST)
  6. X-Mailer: ELM [version 2.4 PL23]
  7. Mime-Version: 1.0
  8. Content-Type: text/plain; charset=ISO-8859-1
  9. Content-Transfer-Encoding: 8bit
  10. Errors-To: listman@ens.fr
  11. Reply-To: pottier@clipper.ens.fr
  12. X-Sequence: 43
  13.  
  14. C.S.M.P. Digest             Tue, 28 Jun 94       Volume 3 : Issue 40
  15.  
  16. Today's Topics:
  17.  
  18.         AppleScript Programmer's Dialect
  19.         BlockCompare?
  20.         GX Printing callbacks are C?
  21.         Handling Events during AE OpenDoc Processing
  22.         How to determine which Finder windows are open?
  23.         Metrowerks code generation wierdness
  24.         PPC and 64-bit video (was Re: Fast full screen scrolling: impossible?)
  25.         Playing QuickTime movies
  26.         Quickdraw GX - Why?
  27.         [Q] Programming the AT&T 3210?
  28.  
  29.  
  30.  
  31. The Comp.Sys.Mac.Programmer Digest is moderated by Francois Pottier
  32. (pottier@clipper.ens.fr).
  33.  
  34. The digest is a collection of article threads from the internet newsgroup
  35. comp.sys.mac.programmer.  It is designed for people who read c.s.m.p. semi-
  36. regularly and want an archive of the discussions.  If you don't know what a
  37. newsgroup is, you probably don't have access to it.  Ask your systems
  38. administrator(s) for details.  If you don't have access to news, you may
  39. still be able to post messages to the group by using a mail server like
  40. anon.penet.fi (mail help@anon.penet.fi for more information).
  41.  
  42. Each issue of the digest contains one or more sets of articles (called
  43. threads), with each set corresponding to a 'discussion' of a particular
  44. subject.  The articles are not edited; all articles included in this digest
  45. are in their original posted form (as received by our news server at
  46. nef.ens.fr).  Article threads are not added to the digest until the last
  47. article added to the thread is at least two weeks old (this is to ensure that
  48. the thread is dead before adding it to the digest).  Article threads that
  49. consist of only one message are generally not included in the digest.
  50.  
  51. The digest is officially distributed by two means, by email and ftp.
  52.  
  53. If you want to receive the digest by mail, send email to listserv@ens.fr
  54. with no subject and one of the following commands as body:
  55.     help                        Sends you a summary of commands
  56.     subscribe csmp-digest Your Name    Adds you to the mailing list
  57.     signoff csmp-digest            Removes you from the list
  58. Once you have subscribed, you will automatically receive each new
  59. issue as it is created.
  60.  
  61. The official ftp info is //ftp.dartmouth.edu/pub/csmp-digest.
  62. Questions related to the ftp site should be directed to
  63. scott.silver@dartmouth.edu. Currently no previous volumes of the CSMP
  64. digest are available there.
  65.  
  66. Also, the digests are available to WAIS users.  To search back issues
  67. with WAIS, use comp.sys.mac.programmer.src. With Mosaic, use
  68. http://www.wais.com/wais-dbs/comp.sys.mac.programmer.html.
  69.  
  70.  
  71. -------------------------------------------------------
  72.  
  73. >From hall_j@sat.mot.com (Joseph Hall)
  74. Subject: AppleScript Programmer's Dialect
  75. Date: Fri, 3 Jun 1994 22:28:40 GMT
  76. Organization: Motorola Inc., Satellite Communications
  77.  
  78. Is the programmer's dialect real, or just a figment of the Language Guide's
  79. imagination?
  80.  
  81. -- 
  82. Joseph Nathan Hall | Joseph's Law of Interface Design: Never give your users
  83. Software Architect | a choice between the easy way and the right way.
  84. Gorca Systems Inc. |                 joseph@joebloe.maple-shade.nj.us (home)
  85. (on assignment)    | (602) 732-2549 (work)  Joseph_Hall-SC052C@email.mot.com
  86.  
  87. +++++++++++++++++++++++++++
  88.  
  89. >From mwalker@netcom.com (Mel Walker)
  90. Date: Mon, 6 Jun 1994 16:02:46 GMT
  91. Organization: Committee to Elect Dan Quayle Lord of the Cosmos
  92.  
  93. Joseph Hall (hall_j@sat.mot.com) wrote:
  94. : Is the programmer's dialect real, or just a figment of the Language Guide's
  95. : imagination?
  96.  
  97. Also, are instructions for making dialects published anywhere? Probably 
  98. not, right?
  99. -- 
  100. Mel Walker                                     mwalker@netcom.com
  101. "That is one of the unwritten rules of government bureaucracy:
  102. Doing something idiotic is not advisable; getting caught doing
  103. something idiotic is a disaster." - Mike Royko
  104.  
  105. +++++++++++++++++++++++++++
  106.  
  107. >From minshull.m@applelink.apple.com (Mark Minshull)
  108. Date: Mon, 6 Jun 1994 17:55:42 GMT
  109. Organization: Apple Computer, Inc.
  110.  
  111. In article <1994Jun3.222840.606@sat.mot.com>, hall_j@sat.mot.com (Joseph
  112. Hall) wrote:
  113.  
  114. > Is the programmer's dialect real, or just a figment of the Language Guide's
  115. > imagination?
  116. At this point, it's a still-born project...
  117.  
  118.   Mark
  119. -- 
  120. Mark Minshull                       :       minshull.m@applelink.apple.com
  121. OpenDoc Engineering Manager         :          
  122. Apple Computer, Inc.                :       Apple usually doesn't care 
  123. 1 Infinite Loop, MS 303-3A          :       what I say... When they do
  124. Cupertino, CA  95014                :       my opinions are my own.
  125.  
  126. +++++++++++++++++++++++++++
  127.  
  128. >From minshull.m@applelink.apple.com (Mark Minshull)
  129. Date: Mon, 6 Jun 1994 17:58:00 GMT
  130. Organization: Apple Computer, Inc.
  131.  
  132. In article <mwalkerCqzGKn.B82@netcom.com>, mwalker@netcom.com (Mel Walker)
  133. wrote:
  134.  
  135. > Also, are instructions for making dialects published anywhere? Probably 
  136. > not, right?
  137.  
  138. Right.  The interface is private...
  139.  
  140. -- 
  141. Mark Minshull                       :       minshull.m@applelink.apple.com
  142. OpenDoc Engineering Manager         :          
  143. Apple Computer, Inc.                :       Apple usually doesn't care 
  144. 1 Infinite Loop, MS 303-3A          :       what I say... When they do
  145. Cupertino, CA  95014                :       my opinions are my own.
  146.  
  147. +++++++++++++++++++++++++++
  148.  
  149. >From Jens Alfke <jens_alfke@powertalk.apple.com>
  150. Date: Mon, 6 Jun 1994 20:05:00 GMT
  151. Organization: Apple Computer
  152.  
  153. Joseph Hall, hall_j@sat.mot.com writes:
  154. > Is the programmer's dialect real, or just a figment of the Language Guide's
  155. > imagination?
  156.  
  157. Sue Dumont of the AppleScript team wrote one, but there aren't any plans I
  158. know of to ship it. It's pretty cool, but it needs some work before it's
  159. ready for prime time.
  160.  
  161. --Jens Alfke
  162.   jens_alfke@powertalk              Rebel girl, rebel girl,
  163.             .apple.com              Rebel girl you are the queen of my world
  164.  
  165. +++++++++++++++++++++++++++
  166.  
  167. >From Jens Alfke <jens_alfke@powertalk.apple.com>
  168. Date: Mon, 6 Jun 1994 22:52:01 GMT
  169. Organization: Apple Computer
  170.  
  171. Mel Walker, mwalker@netcom.com writes:
  172. > Also, are instructions for making dialects published anywhere? Probably 
  173. > not, right?
  174.  
  175. Making dialects (a) is pretty complicated and (b) requires more access to the
  176. internals of the AppleScript engine than Apple wants to give 3rd parties. A
  177. large part of it involves writing yacc syntax descriptions whose tables then
  178. get dumped into the dialect file.
  179.  
  180. --Jens Alfke
  181.   jens_alfke@powertalk              Rebel girl, rebel girl,
  182.             .apple.com              Rebel girl you are the queen of my world
  183.  
  184. +++++++++++++++++++++++++++
  185.  
  186. >From mwalker@netcom.com (Mel Walker)
  187. Date: Tue, 7 Jun 1994 17:07:02 GMT
  188. Organization: Committee to Elect Dan Quayle Lord of the Cosmos
  189.  
  190. Jens Alfke (jens_alfke@powertalk.apple.com) wrote:
  191. : Mel Walker, mwalker@netcom.com writes:
  192. : > Also, are instructions for making dialects published anywhere? Probably 
  193. : > not, right?
  194.  
  195. : Making dialects (a) is pretty complicated and (b) requires more access to the
  196. : internals of the AppleScript engine than Apple wants to give 3rd parties. A
  197. : large part of it involves writing yacc syntax descriptions whose tables then
  198. : get dumped into the dialect file.
  199.  
  200. I assume that I could write a scripting component that opened up the
  201. AppleScript component, and translate my "dialect" into AppleScript that
  202. way. Is there anything that would prevent that?
  203.  
  204. -- 
  205. Mel Walker                                     mwalker@netcom.com
  206. "That is one of the unwritten rules of government bureaucracy:
  207. Doing something idiotic is not advisable; getting caught doing
  208. something idiotic is a disaster." - Mike Royko
  209.  
  210. +++++++++++++++++++++++++++
  211.  
  212. >From Jens Alfke <jens_alfke@powertalk.apple.com>
  213. Date: Tue, 7 Jun 1994 22:04:44 GMT
  214. Organization: Apple Computer
  215.  
  216. Mel Walker, mwalker@netcom.com writes:
  217. > I assume that I could write a scripting component that opened up the
  218. > AppleScript component, and translate my "dialect" into AppleScript that
  219. > way. Is there anything that would prevent that?
  220.  
  221. That'd work; your component would just forward all of its calls to
  222. AppleScript. The compile and getsource calls would have to do some
  223. transformation on the source text to change it from/to your syntax to/from
  224. AppleScript. (Don't forget the getsource call or people won't be able to
  225. re-edit compiled scripts!) And also don't forget to fix up the source
  226. positions in the error descriptor when the client wants to know the source
  227. range of the error.
  228.  
  229.  Of course this would only work with one dialect of AppleScript.
  230.  
  231. --Jens Alfke
  232.   jens_alfke@powertalk              Rebel girl, rebel girl,
  233.             .apple.com              Rebel girl you are the queen of my world
  234.  
  235. +++++++++++++++++++++++++++
  236.  
  237. >From d88-jwa@dront.nada.kth.se (Jon Wdtte)
  238. Date: 9 Jun 1994 08:55:24 GMT
  239. Organization: The Royal Institute of Technology
  240.  
  241. In <minshull.m-060694105800@minshullmac.apple.com> minshull.m@applelink.apple.com (Mark Minshull) writes:
  242.  
  243. >In article <mwalkerCqzGKn.B82@netcom.com>, mwalker@netcom.com (Mel Walker)
  244. >wrote:
  245.  
  246. >> Also, are instructions for making dialects published anywhere? Probably 
  247. >> not, right?
  248.  
  249. >Right.  The interface is private...
  250.  
  251. How come there's a tickle dialect of the OSA then?
  252.  
  253. Cheers,
  254.  
  255.     
  256.                     / h+
  257. -- 
  258.  -- Jon W{tte, h+@nada.kth.se, Mac Software Engineer Deluxe --
  259.  
  260.  -- I don't fear death, it's dying that scares me.
  261.  
  262. +++++++++++++++++++++++++++
  263.  
  264. >From Jens Alfke <jens_alfke@powertalk.apple.com>
  265. Date: Thu, 9 Jun 1994 18:29:45 GMT
  266. Organization: Apple Computer
  267.  
  268. Jon W!tte, d88-jwa@dront.nada.kth.se writes:
  269. > How come there's a tickle dialect of the OSA then?
  270.  
  271. That's not an AppleScript dialect, it's an entirely separate OSA component,
  272. like Frontier or QuicKeyScript. The difference is that a dialect is just a
  273. plug-in parser (and unparser) for the AppleScript compiler, whereas a
  274. scripting component is entirely independent of AppleScript. To write a new
  275. scripting component you just have to follow the OSA API, whereas dialects are
  276. pretty tightly coupled to AppleScript's internal parsing engine and build
  277. system.
  278.  
  279. --Jens Alfke
  280.   jens_alfke@powertalk              Rebel girl, rebel girl,
  281.             .apple.com              Rebel girl you are the queen of my world
  282.  
  283. +++++++++++++++++++++++++++
  284.  
  285. >From mwalker@netcom.com (Mel Walker)
  286. Date: Thu, 9 Jun 1994 21:57:58 GMT
  287. Organization: Committee to Elect Dan Quayle Lord of the Cosmos
  288.  
  289. Jon Wdtte (d88-jwa@dront.nada.kth.se) wrote:
  290. : In <minshull.m-060694105800@minshullmac.apple.com> minshull.m@applelink.apple.com (Mark Minshull) writes:
  291.  
  292. : >In article <mwalkerCqzGKn.B82@netcom.com>, mwalker@netcom.com (Mel Walker)
  293. : >wrote:
  294.  
  295. : >> Also, are instructions for making dialects published anywhere? Probably 
  296. : >> not, right?
  297.  
  298. : >Right.  The interface is private...
  299.  
  300. : How come there's a tickle dialect of the OSA then?
  301.  
  302. There's not. AppleScript is one OSA _language_ with several _dialects_.
  303.  
  304. Quickeys, tickle, etc. store their internal scripts in a different form
  305. than AppleScript does, so their scripts are not compatible. If you
  306. program AppleScript in the English dialect, and select the French
  307. dialect, the script will change to reflect that without changing
  308. the underlying tokenized form.
  309.  
  310. Did I get that right, O Great Gurus from Apple?
  311. -- 
  312. Mel Walker                                     mwalker@netcom.com
  313. "That is one of the unwritten rules of government bureaucracy:
  314. Doing something idiotic is not advisable; getting caught doing
  315. something idiotic is a disaster." - Mike Royko
  316.  
  317. +++++++++++++++++++++++++++
  318.  
  319. >From quinn@cs.uwa.edu.au (Quinn "The Eskimo!")
  320. Date: Fri, 10 Jun 1994 10:03:12 +0800
  321. Organization: Department of Computer Science, The University of Western Australia
  322.  
  323. In article <2t6lds$o2k@news.kth.se>, d88-jwa@dront.nada.kth.se (Jon Wdtte)
  324. wrote:
  325.  
  326. >In <minshull.m-060694105800@minshullmac.apple.com>
  327. minshull.m@applelink.apple.com (Mark Minshull) writes:
  328. >
  329. >>In article <mwalkerCqzGKn.B82@netcom.com>, mwalker@netcom.com (Mel Walker)
  330. >>wrote:
  331. >
  332. >>> Also, are instructions for making dialects published anywhere? Probably 
  333. >>> not, right?
  334. >
  335. >>Right.  The interface is private...
  336. >
  337. >How come there's a tickle dialect of the OSA then?
  338.  
  339. You're confusing your dialects with your OSA scripting components.  A
  340. dialect is a different natural language (or syntax in the case of the
  341. Programmer's Dialect) for *AppleScript*.  An OSA scripting component lets
  342. you implement an entirely different programming language within the
  343. framework of the OSA.
  344.  
  345. So AppleScript currently has 3 dialects (English, French, Japanese) which
  346. all compile to the same language (AppleScript).  There are also buckets of
  347. other OSA scripting components (QuickKeys, TCL, etc).
  348. -- 
  349. Quinn "The Eskimo!"      <quinn@cs.uwa.edu.au>     "Support HAVOC!"
  350. Department of Computer Science, The University of Western Australia
  351.   The cute thing is that you can compile a script in one dialect and
  352.   then decompile it in another.  If only it translated the identifiers.
  353.   Such a shame the Translation Manager doesn't live up to its name (:
  354.  
  355. +++++++++++++++++++++++++++
  356.  
  357. >From msouth@BIX.com (msouth on BIX)
  358. Date: 14 Jun 94 05:31:10 GMT
  359. Organization: Delphi Internet Services Corporation
  360.  
  361. mwalker@netcom.com (Mel Walker) writes:
  362.  
  363. >Quickeys, tickle, etc. store their internal scripts in a different form
  364. >than AppleScript does, so their scripts are not compatible. If you
  365. >program AppleScript in the English dialect, and select the French
  366. >dialect, the script will change to reflect that without changing
  367. >the underlying tokenized form.
  368.  
  369. You know, this is a _perfect_ example of how the Mac is head
  370. and shoulders above anything else. But do you think that anyone
  371. other than a already-dedicated Mac programmer knows about it?
  372. Why on earth doesn't Apple _advertise_ some of this stuff?
  373.  
  374. +++++++++++++++++++++++++++
  375.  
  376. >From 103t_english@west.cscwc.pima.edu
  377. Date: 14 Jun 94 12:45:21 MST
  378. Organization: (none)
  379.  
  380. In article <msouth.771571870@BIX.com>, msouth@BIX.com (msouth on BIX) writes:
  381. > mwalker@netcom.com (Mel Walker) writes:
  382. >>Quickeys, tickle, etc. store their internal scripts in a different form
  383. >>than AppleScript does, so their scripts are not compatible. If you
  384. >>program AppleScript in the English dialect, and select the French
  385. >>dialect, the script will change to reflect that without changing
  386. >>the underlying tokenized form.
  387. > You know, this is a _perfect_ example of how the Mac is head
  388. > and shoulders above anything else. But do you think that anyone
  389. > other than a already-dedicated Mac programmer knows about it?
  390. > Why on earth doesn't Apple _advertise_ some of this stuff?
  391.  
  392. I tell DOS-bigots all the time and their response is: "whoopee! Who would ever
  393. need to do something like that...
  394.  
  395. Oh well.
  396.  
  397.  
  398. Lawson
  399.  
  400. ---------------------------
  401.  
  402. >From spencerl@crl.com (Spencer Low)
  403. Subject: BlockCompare?
  404. Date: 12 Jun 1994 14:44:31 -0700
  405. Organization: LowTek Creations
  406.  
  407. I'm looking for some sample code (preferably in C) that will compare to 
  408. blocks of memory. In other words:
  409.  
  410.    Boolean BlockCompare(Ptr block1, Ptr block2, Size byteCount);
  411.  
  412. The C libraries that come with THINK C include memcmp, but it's 
  413. hand-coded in 68K assembly. I'd prefer something less platform dependent, 
  414. yet still quick.
  415.  
  416. Thanks,
  417. Spencer (btw, I didn't see anything like this at the alt.sources.mac 
  418. archives)
  419. -- 
  420.   Spencer Low       | MaxRAM: Compatible with RD 1.0.1 and 1.0.2,
  421.   LowTek Creations  |         but not yet with RD 1.0.3A.
  422.   spencerl@crl.com  | ftp://crl.com/users/ro/spencerl/
  423.  
  424. +++++++++++++++++++++++++++
  425.  
  426. >From rang@winternet.com (Anton Rang)
  427. Date: 13 Jun 1994 01:32:50 GMT
  428. Organization: Minnesota Angsters
  429.  
  430. In article <2tfvjv$8se@crl2.crl.com> spencerl@crl.com (Spencer Low) writes:
  431. >I'm looking for some sample code (preferably in C) that will compare to 
  432. >blocks of memory. In other words:
  433. >
  434. >   Boolean BlockCompare(Ptr block1, Ptr block2, Size byteCount);
  435. >
  436. >The C libraries that come with THINK C include memcmp, but it's 
  437. >hand-coded in 68K assembly. I'd prefer something less platform dependent, 
  438. >yet still quick.
  439.  
  440.   Just to see if they're equal?
  441.  
  442.   You probably can't beat a loop like this, in C, without adding
  443. various platform dependent tricks:
  444.  
  445.     while (byteCount--)
  446.       if (*block1++ != *block2++)
  447.         return (false);
  448.  
  449.     return (true);
  450.  
  451. If you're using 68K assembly, you can do very well using 'cmpm' and a
  452. 'dbra' variant, if your loop counts will fit in a two-byte variable.
  453. Something along the lines of
  454.  
  455.     @0:    cmpm.l    (a0)+, (a1)+        ; or .b if you really need byte-by-byte
  456.     dbne    @0            ; branch until not-equal
  457.     seq    d0            ; set d0 to be non-zero if they match
  458.     rts                ; return
  459.  
  460. Using memcmp() is your best bet for a platform-independent quick way,
  461. since it's part of the ANSI standard and probably coded in assembly.
  462. --
  463. Anton Rang (rang@winternet.com)
  464.  
  465. +++++++++++++++++++++++++++
  466.  
  467. >From bwade@graphics.cornell.edu (Bretton Wade)
  468. Date: 13 Jun 1994 04:14:26 GMT
  469. Organization: Program of Computer Graphics -- Cornell University
  470.  
  471. probably your best bet if you want to do it in a high level language is to
  472. make a nice unrolled loop. you'd have to know in general that the size of the
  473. block you want to compare is divisible by some factor (say 16)..
  474.  
  475. Boolean    compare (long *a, long *b, long blocksize)
  476. {
  477.     for (short i = 0; i < blocksize; i += 16)
  478.     {
  479.         if (*a++ != *b++) return FALSE;
  480.         if (*a++ != *b++) return FALSE;
  481.         if (*a++ != *b++) return FALSE;
  482.         if (*a++ != *b++) return FALSE;
  483.     }
  484.     return TRUE;
  485. }
  486.  
  487. the more compares you can do inside the loop, the better off you'll be (up to a
  488. point). You may also need a little code that will check any leftover that you
  489. couldn't cover with the big blocks. say you've got 64001 bytes to compare. You
  490. would check the first 64000 with a big block checker, then test the last byte
  491. separately.
  492.  
  493. THINK's memcmp function checks one byte at a time. you should be able to blast
  494. that with C code quite easily...
  495. -- 
  496. _______________________________________________________________________________
  497.  
  498.    Bretton Wade (bw16@cornell.edu)
  499.  
  500.    Program of Computer Graphics
  501.    580 Engineering and Theory Center
  502.    Cornell University
  503.    Ithaca, NY 14853
  504.    Voice: (607) 255-6704
  505.    Fax:   (607) 255-0806
  506. _______________________________________________________________________________
  507.  
  508. +++++++++++++++++++++++++++
  509.  
  510. >From Jens Alfke <jens_alfke@powertalk.apple.com>
  511. Date: Mon, 13 Jun 1994 20:11:26 GMT
  512. Organization: Apple Computer
  513.  
  514. Spencer Low, spencerl@crl.com writes:
  515. > The C libraries that come with THINK C include memcmp, but it's 
  516. > hand-coded in 68K assembly. I'd prefer something less platform dependent, 
  517. > yet still quick.
  518.  
  519. If you want portability, use memcmp. You can't get much more portable than
  520. the ANSI library -- any C implementation you use, anywhere, is guaranteed to
  521. have one.
  522.  
  523. --Jens Alfke
  524.   jens_alfke@powertalk              Rebel girl, rebel girl,
  525.             .apple.com              Rebel girl you are the queen of my world
  526.  
  527. ---------------------------
  528.  
  529. >From Jens Alfke <jens_alfke@powertalk.apple.com>
  530. Subject: GX Printing callbacks are C?
  531. Date: Thu, 9 Jun 1994 18:02:49 GMT
  532. Organization: Apple Computer
  533.  
  534. Looks like the entire GX team is on vacation this week, unless they're just
  535. refusing to return my calls, so I'll have to make like a layperson and ask
  536. the net...  ;-)
  537.  
  538. I'm adding GX print manager support to a QD-based app of mine (well, Sticky
  539. Memos, but this feature won't be in 1.0.) I'm following the prerelease
  540. 'develop' article.
  541.  
  542. I note that the various callbacks you need to install (event filtering and
  543. shape spooling) are not declared as 'pascal' functions. This strikes me as
  544. odd since (as has been discussed recently) there are no standard C calling
  545. conventions on the Mac and the three major C compilers all do things
  546. differently.
  547.  
  548. Is this going to be a problem for me? My app's written in CodeWarrior. The
  549. major thing I remember is that MPW passes all parameters of any size as
  550. longs, so I may have to make sure that any short or Boolean params are
  551. declared in my callback functions as longs. Is there anything else I need to
  552. do (besides declaring the functions as extern "C", of course)?
  553.  
  554. And what do Pascal users do about this? I've heard that MPW Pascal can use C
  555. calling conventions, but what about THINK Pascal? At the risk of not sounding
  556. like a team player, I have to say that this C-callbacks thing in GX may not
  557. have been the most well thought out idea in the world.
  558.  
  559. --Jens Alfke
  560.   jens_alfke@powertalk              Rebel girl, rebel girl,
  561.             .apple.com              Rebel girl you are the queen of my world
  562.  
  563. +++++++++++++++++++++++++++
  564.  
  565. >From quinn@cs.uwa.edu.au (Quinn "The Eskimo!")
  566. Date: Fri, 10 Jun 1994 10:30:53 +0800
  567. Organization: Department of Computer Science, The University of Western Australia
  568.  
  569. In article <1994Jun9.180249.25884@gallant.apple.com>, Jens Alfke
  570. <jens_alfke@powertalk.apple.com> wrote:
  571.  
  572. >I note that the various callbacks you need to install (event filtering and
  573. >shape spooling) are not declared as 'pascal' functions. This strikes me as
  574. >odd since (as has been discussed recently) there are no standard C calling
  575. >conventions on the Mac and the three major C compilers all do things
  576. >differently.
  577. >
  578. >Is this going to be a problem for me? My app's written in CodeWarrior. The
  579. >major thing I remember is that MPW passes all parameters of any size as
  580. >longs, so I may have to make sure that any short or Boolean params are
  581. >declared in my callback functions as longs. Is there anything else I need to
  582. >do (besides declaring the functions as extern "C", of course)?
  583.  
  584. The situation is like this...
  585.  
  586. MPW and CodeWarrior Pascal can both call external functions written in C. 
  587. You simply declare the function header and take a "C;" after it, with an
  588. optional "EXTERNAL;" after that.  Think cannot do this and it sucks big
  589. time.
  590.  
  591. *None* of the Pascal compilers can compile a function written in Pascal
  592. that uses C calling conventions.  So if you want to do C calling
  593. convention callbacks you are basically stuffed.
  594.  
  595. My workaround to this is to write the necessary glue in C, where all the
  596. compilers support all the calling conventions.  Peter Lewis (who uses
  597. Think Pascal exclusively) works around this by declaring the functions
  598. with no parameters, getting the value of the A6 register and then walking
  599. up the stack manually.  It's yucky, it's non-portable, it works.
  600.  
  601. btw It's not just a question of making the parameters match in size.  The
  602. problem is that C requires the callee to remove the parameters and Pascal
  603. (normally) has the caller removing them.  So you have to declare the
  604. function with *no* parameters to avoid big dramas with the stack.  Oh yeah
  605. and returning stuff in D0 is kinda hard too.
  606.  
  607. I haven't actually looked through GX yet but if it's full of C callbacks
  608. then I'm gonna be *extremely* depressed.
  609.  
  610. >And what do Pascal users do about this? I've heard that MPW Pascal can use C
  611. >calling conventions, but what about THINK Pascal? At the risk of not sounding
  612. >like a team player, I have to say that this C-callbacks thing in GX may not
  613. >have been the most well thought out idea in the world.
  614.  
  615. Well we get bitter and twisted and wear "C, Stop It or You'll Go Blind!"
  616. T-shirts around WWDC and harrass the guys doing the interfaces about using
  617. a decent IDL so that we can generate Pascal interfaces (and, if necessary,
  618. glue code) automatically.  The depressing thing is that (I think) we've
  619. got a lot of sympathy but there's this little thing called "economic
  620. imperative" that ensures that no one does anything to help.  *sigh*
  621.  
  622. One nice thing is that the PPC has One True Calling Convention (tm). 
  623. Hopefully this will improve matters.
  624.  
  625. Share and Enjoy.
  626. -- 
  627. Quinn "The Eskimo!"      <quinn@cs.uwa.edu.au>     "Support HAVOC!"
  628. Department of Computer Science, The University of Western Australia
  629.   Maintain the Rage!!!
  630.  
  631. +++++++++++++++++++++++++++
  632.  
  633. >From resnick@uiuc.edu (Pete Resnick)
  634. Date: Thu, 09 Jun 1994 22:09:47 -0500
  635. Organization: University of Illinois at Urbana-Champaign
  636.  
  637. In article <quinn-1006941030530001@eriodon.cs.uwa.oz.au>,
  638. quinn@cs.uwa.edu.au (Quinn "The Eskimo!") wrote:
  639.  
  640. >btw It's not just a question of making the parameters match in size.  The
  641. >problem is that C requires the callee to remove the parameters and Pascal
  642. >(normally) has the caller removing them.
  643.  
  644. You got that backwards. The caller resets the stack in *C* and the callee
  645. removes them in Pascal.
  646.  
  647. pr
  648. -- 
  649. Pete Resnick        (...so what is a mojo, and why would one be rising?)
  650. Doctoral Student - Philosophy Department, Gregory Hall, UIUC
  651. System manager - Cognitive Science Group, Beckman Institute, UIUC
  652. Internet: resnick@uiuc.edu
  653.  
  654. +++++++++++++++++++++++++++
  655.  
  656. >From Jens Alfke <jens_alfke@powertalk.apple.com>
  657. Date: Fri, 10 Jun 1994 21:11:41 GMT
  658. Organization: Apple Computer
  659.  
  660. In article <quinn-1006941030530001@eriodon.cs.uwa.oz.au> Quinn,
  661. quinn@cs.uwa.edu.au writes:
  662. > MPW and CodeWarrior Pascal can both call external functions written in C. 
  663.  
  664. Pascal access is certainly an issue, but not the one that immediately
  665. concerns me since I'm writing in C++. The problem is that GX presumably calls
  666. my callbacks with MPW calling conventions*, whereas my functions are
  667. implemented using CodeWarrior conventions. As has been discussed in the
  668. context of linking with .o files, the two are different and you have to be
  669. careful about what size the params are and what register the results get
  670. returned in.
  671.  
  672. *Actually that's not even certain since I know that at least the graphics
  673. engine of GX was developed in THINK C. I'm guessing that for the real builds
  674. they compiled it with MPW, given the MPW-bigotry inside Apple... ;-)
  675.  
  676. --Jens Alfke
  677.   jens_alfke@powertalk              Rebel girl, rebel girl,
  678.             .apple.com              Rebel girl you are the queen of my world
  679.  
  680. +++++++++++++++++++++++++++
  681.  
  682. >From mclow@coyote.csusm.edu (Marshall Clow)
  683. Date: 10 Jun 1994 21:48:39 -0700
  684. Organization: California State University San Marcos
  685.  
  686. Jens Alfke (jens_alfke@powertalk.apple.com) wrote:
  687. >In article <quinn-1006941030530001@eriodon.cs.uwa.oz.au> Quinn,
  688. >quinn@cs.uwa.edu.au writes:
  689. >> MPW and CodeWarrior Pascal can both call external functions written in C. 
  690.  
  691. >Pascal access is certainly an issue, but not the one that immediately
  692. >concerns me since I'm writing in C++. The problem is that GX presumably calls
  693. >my callbacks with MPW calling conventions*, whereas my functions are
  694. >implemented using CodeWarrior conventions. As has been discussed in the
  695. >context of linking with .o files, the two are different and you have to be
  696. >careful about what size the params are and what register the results get
  697. >returned in.
  698.  
  699.     Starting with GM (dontcha just love it? ;-) the GX header files
  700. contain a "#ifdef applec" section that defines the calls for the MPW C
  701. compiler, and an '#else' section that works for MetroWerks and Think C.
  702. The files affected are PrintingDrivers.h and PrintingMessages.h (I think).
  703.  
  704.     Several of the GX libraries contain "non pascal" routines with
  705. short parameters, but since source to the libs is provided, these interfaces
  706. were not changed.
  707.  
  708. Marshall Clow
  709. Amateur GX Weenie
  710. Aladdin Systems
  711. mclow@san_marcos.csusm.edu
  712. [ Apparently the first person to write a GX printer driver in Think C.]
  713.  
  714.  
  715. +++++++++++++++++++++++++++
  716.  
  717. >From ldo@waikato.ac.nz (Lawrence D'Oliveiro, Waikato University)
  718. Date: 13 Jun 94 18:03:18 +1200
  719. Organization: University of Waikato, Hamilton, New Zealand
  720.  
  721. In article <quinn-1006941030530001@eriodon.cs.uwa.oz.au>, quinn@cs.uwa.edu.au (Quinn "The Eskimo!") writes:
  722. > In article <1994Jun9.180249.25884@gallant.apple.com>, Jens Alfke
  723. > <jens_alfke@powertalk.apple.com> wrote:
  724. >
  725. >>I note that the various callbacks you need to install (event filtering and
  726. >>shape spooling) are not declared as 'pascal' functions.
  727. >>
  728. >>Is this going to be a problem for me? My app's written in CodeWarrior. The
  729. >>major thing I remember is that MPW passes all parameters of any size as
  730. >>longs, so I may have to make sure that any short or Boolean params are
  731. >>declared in my callback functions as longs. Is there anything else I need to
  732. >>do (besides declaring the functions as extern "C", of course)?
  733. >
  734. > *None* of the Pascal compilers can compile a function written in Pascal
  735. > that uses C calling conventions.  So if you want to do C calling
  736. > convention callbacks you are basically stuffed.
  737. >
  738. > My workaround to this is to write the necessary glue in C, where all the
  739. > compilers support all the calling conventions.  Peter Lewis (who uses
  740. > Think Pascal exclusively) works around this by declaring the functions
  741. > with no parameters, getting the value of the A6 register and then walking
  742. > up the stack manually.  It's yucky, it's non-portable, it works.
  743.  
  744. My workaround is a generic piece of assembly-language glue which looks
  745. something like this:
  746.  
  747.     clr.w    -(sp)    ; room for Pascal function result
  748.     pea    6(sp)    ; pointer to C-format argument list
  749.     jsr    PascalRoutine ; call my Pascal-conforming routine
  750.     move.w    (sp)+, d0 ; return Pascal result to C
  751.     rts
  752.  
  753. The Pascal-conforming routine (in Modula-2, in my case) is declared like this:
  754.  
  755.     PROCEDURE MyHandler
  756.       (
  757.         VAR Args : ArgsForThisRoutine
  758.       ) : OSErr;
  759.  
  760. where "ArgsForThisRoutine" is a record type that mimics the format of the
  761. C argument list. So I refer to the arguments as "Args.whatever". Not too
  762. painful at all.
  763.  
  764. One common case is printing extensions and drivers. This introduces its own
  765. fiddly bits, in that the offsets in the 'over' resources must match the entry
  766. points in your 'pext' code resources. To solve all this, I wrote a custom MPW
  767. tool which takes a file of entry point definitions, and generates .o files for
  768. the segment headers (including the C-to-Pascal glue, above), and the 'over'
  769. resources, all in one fell swoop, so you never have to worry about keeping
  770. them consistent again. Nifty, huh?
  771.  
  772. Lawrence "Just call me the 'Speedbump, the Roadkill Hedgehog' of the
  773. Information Superhighway" D'Oliveiro
  774.  
  775. +++++++++++++++++++++++++++
  776.  
  777. >From quinn@cs.uwa.edu.au (Quinn "The Eskimo!")
  778. Date: Tue, 14 Jun 1994 09:44:37 +0800
  779. Organization: Department of Computer Science, The University of Western Australia
  780.  
  781. In article <1994Jun13.180319.29615@waikato.ac.nz>, ldo@waikato.ac.nz
  782. (Lawrence D'Oliveiro, Waikato University) wrote:
  783.  
  784. >My workaround is a generic piece of assembly-language glue which looks
  785. >something like this:
  786. >
  787. >[...]
  788.  
  789. Neat hack!
  790.  
  791. Unfortunately the problem still stands, no matter how neat a hack you use
  792. to work around it ):
  793.  
  794. >Lawrence "Just call me the 'Speedbump, the Roadkill Hedgehog' of the
  795. >Information Superhighway" D'Oliveiro
  796.  
  797. *laugh*
  798. -- 
  799. Quinn "The Eskimo!"      <quinn@cs.uwa.edu.au>     "Support HAVOC!"
  800. Department of Computer Science, The University of Western Australia
  801.  
  802. ---------------------------
  803.  
  804. >From cvafy002@csupomona.edu
  805. Subject: Handling Events during AE OpenDoc Processing
  806. Date: 13 Jun 94 00:52:37 PST
  807. Organization: California State Polytechnic University, Pomona
  808.  
  809. What's the best way to handle event processing during an AppleEvent
  810. OpenDocument event?
  811.  
  812. In my application I step thru the docList retrieved from the AppleEvent and
  813. call my OpenDocument routine on each document as it is pulled out of the list.
  814. I'd like to put up a MovableModal or Modeless dialog to show progress and also
  815. allow the user to switch to other applications and even drop more documents on
  816. my application while it is running (I'm using a suspend/resume appleevent
  817. routine similar to the ones used in DragonSmith). Should I setup another event
  818. loop that I call during the Opening of the documents? All my application does
  819. is rename files based on settings the user specifies beforhand so the actual
  820. operations on each file are small but, I'd like get a good strategy for
  821. handling events when the processing time for each document increases.
  822.  
  823. Any comments are appreciated.
  824.  
  825.  
  826. +++++++++++++++++++++++++++
  827.  
  828. >From decartwr@gamera.syr.edu (Dana Cartwright 3rd)
  829. Date: Mon, 13 Jun 1994 11:45:06 GMT
  830. Organization: Syracuse University, Syracuse, New York
  831.  
  832. cvafy002@csupomona.edu wrote:
  833. : ..... I'd like get a good strategy for
  834. : handling events when the processing time for each document increases.
  835.  
  836. A strategy I use (and others in this group have mentioned similar
  837. strategies) is to divide my app into two parts, call them "hot" and
  838. "cool".  The "hot" part is responsible for being highly responsive to
  839. user requests (keystrokes and menu actions).  The "cool" part handles
  840. things which take a longer time.
  841.  
  842. In the "hot" sections, anything which would take a long time to execute
  843. is avoided...instead, a request is enqueued for the "cool" code to do
  844. the long-running work (the details of how this is done probably depend
  845. on your app, see my strategy below).       
  846.  
  847. When I call WNE and find I have no events queued up for me, I then
  848. dispatch the "cool" code.  It looks in its work-to-be-done queue and
  849. starts grinding away.  Since these are long-running tasks, there's a lot
  850. of the style of coding where tasks are interrupted with calls to WNE.
  851.  
  852. When the "cool" code is running, it will happen (frequently) that the
  853. user does something which causes the "hot" code to run.  So the "cool"
  854. and the "hot" code have to understand that they may run interleaved.
  855.  
  856. Note: this description is basically a description of cooperative multi-
  857. tasking, but carried out within one app rather than among apps.  The
  858. point is that it works beautifully.....my apps are highly responsive
  859. to mouse clicks, and you can "stack" a whole series of them with the
  860. app giving very quick visual feedback...also, you can issue a bunch of
  861. mouse clicks and then switch my app into the background.....all the
  862. "cool" code expects that it may run while the app is in the background.
  863.  
  864. Now, for my enqueue strategy: it's extremely simple!  I just have a 
  865. global 32-bit word in which each bit corresponds to some "cool" task.
  866. When the "hot" code sees that it needs to ask the "cool" routines to
  867. take on some work, it just flips on whichever of the 32 bits corresponds
  868. to that particular task.  In the "cool" code, there are up to 32
  869. tasks which can be dispatched, keyed off the 32 bits of the dispatch
  870. word.  By the way, since I dispatch starting with the left-most bit,
  871. I also achieve a strict prioritization: higher priority "cool" tasks
  872. are given bits near the high-order end of the 32-bit word.  Since
  873. enqueue/dequeue of tasks is no harder than flipping a bit, I've not
  874. got much overhead.
  875.  
  876. Anyway, I've used this strategy in several commercial apps, and users
  877. have commented on how responsive the software seems to be....so I
  878. claim some success!
  879.  
  880.  
  881. +++++++++++++++++++++++++++
  882.  
  883. >From partingt@fwi.uva.nl (Vincent Partington)
  884. Date: 14 Jun 1994 10:30:17 +0200
  885. Organization: FWI, University of Amsterdam
  886.  
  887. cvafy002@csupomona.edu writes:
  888.  
  889. >What's the best way to handle event processing during an AppleEvent
  890. >OpenDocument event?
  891.  
  892. The other replier mentioned partitioning his application into a "hot" and
  893. "cold" part. I do something similar but the implementation is
  894. different. I divide my programs into an interface part and a grunt-work part.
  895.  
  896. The interface part handles the interface stuff and has to be quick in giving
  897. time to other apps and is centered around the event loop. When the interface
  898. part wants the grunt-work part to do something it sends an Apple Event with
  899. all necessary information to itself.
  900.  
  901. The grunt-work part gets this information from the AppleEvent and starts
  902. processing but calls the "Yield" function at regular intervals. The Yield
  903. functions is the interface part: it does a WaitNextEvent and handles events
  904. until a null event comes up. Then the grunt-work part can continue.
  905.  
  906. The advantage of this recursion is that I have one event-loop and that the
  907. grunt-work part can be structured like you would on a machine with preemptive
  908. multitasking and no event-loop. You only have to call Yield once in a while,
  909. you don't have to split up your work and do it in little chunks getting the
  910. necessary status info from flag words and such (was I doing X or Y?).
  911.  
  912. But because of the recursion care should be taken not to get into infinite
  913. recursion. I do this by calling the "Activate" method of my Application-class
  914. when ever the grunt-work part start to do stuff that could take long: that
  915. method disables the menubar and sets the event mask to exclude High Level
  916. events. It also sets a flag so the Yield function knows to give a sleep time
  917. of 0 ticks to WaitNextEvent. At the end of the grunt-work function (the Apple
  918. Event handler) the "Deactivate" method is called and the application returns
  919. to idle state.
  920.  
  921. Another advantage is that all communication goes to the grunt-work part
  922. through Apple Events: because of this my applications are recordable and
  923. scriptable.
  924.  
  925. I have developed no commercial applications with this, but I'm developing a
  926. C++ DropBox class library using this approach. The idea is to make it easy
  927. to implement an algorithm for file conversion (like Unix "filters") without
  928. having to muck about with event loops. 
  929. This class library should see the public domain when CodeWarrior supports
  930. exception handling and templates, so I can test my exception handling code.
  931.  
  932. Vincent.
  933. -- 
  934. My opinions are not my own. I copy them    | Internet : partingt@fwi.uva.nl
  935. from books, television, video, the net,    |            vincent@tnc.nl
  936. my friends, my parents, my teachers and    | FidoNet  : 2:281/202.15
  937. and numerous other contributors.           | NeST     : 90:500/202.15
  938.  
  939. ---------------------------
  940.  
  941. >From alex@metcalf.demon.co.uk (Alex Metcalf)
  942. Subject: How to determine which Finder windows are open?
  943. Date: Fri, 10 Jun 1994 23:17:19 GMT
  944. Organization: Best Before Yesterday
  945.  
  946.  
  947. Up until a few weeks ago I thought it was impossible to read information
  948. such as which Finder windows are open, the positions of icons in that
  949. window (I know that's in the DB, but I don't know how to check for the open
  950. window), etc.
  951.  
  952. However, Popup Folder lets you click on a finder folder and see some stuff
  953. about its hierarchy. So there MUST be a way! Also, that screen saver
  954. software that has stuff interacting with your finder windows.
  955.  
  956. I've posted once already with no reply, and this information would be
  957. really useful for me. Can anyone help me by telling me how my app can find
  958. out ANY of these:
  959.  
  960. o   The open windows in the Finder
  961. o   The names / folder paths of open windows in the Finder
  962. o   The names and locations of folders in an open window in the Finder
  963.  
  964. Thanks!
  965.  
  966.  
  967. Alex
  968.  
  969. --
  970. Alex Metcalf, Best Before Yesterday
  971. Mac programmer in C, C++, HyperTalk, assembler
  972. Juggler, 3-ball tricks
  973.  
  974. Internet:          alex@metcalf.demon.co.uk
  975. Fax (UK):          (0570) 45636
  976. Fax (US / Canada): 011 44 570 45636
  977.  
  978. +++++++++++++++++++++++++++
  979.  
  980. >From gurgle@netcom.com (Pete Gontier)
  981. Date: Mon, 13 Jun 1994 05:37:31 GMT
  982. Organization: cellular
  983.  
  984. alex@metcalf.demon.co.uk (Alex Metcalf) writes:
  985.  
  986. >Up until a few weeks ago I thought it was impossible to read
  987. >information such as which Finder windows are open, the positions of
  988. >icons in that window (I know that's in the DB, but I don't know how
  989. >to check for the open window), etc. However, Popup Folder lets you
  990. >click on a finder folder and see some stuff about its hierarchy. So
  991. >there MUST be a way! Also, that screen saver software that has stuff
  992. >interacting with your finder windows.
  993.  
  994. The question is not whether it can be done or how it can be done. Those
  995. are comparatively easy questions, and I will take a swipe at answering
  996. them below. The really interesting question, however, is this: do you
  997. really want to?
  998.  
  999. Finder is an application. Like many apps, it stores data in the 'refCon'
  1000. field of its window records. That data, I believe, is a handle, but
  1001. perhaps a pointer, to a C++ object which contains handles or pointers
  1002. to other C++ objects, etc. etc. Using MacsBug, you can reverse engineer
  1003. these *absitively posolutely private* data structures to determine the
  1004. information you want.
  1005.  
  1006. Of course, this assumes you somehow have access to Finder's window list.
  1007. You'll probably have to write an INIT resource to do this.
  1008.  
  1009. This is the first part of the question: do you really want to do all the
  1010. work involved in this reverse engineering? It's non-trivial, especially
  1011. if your MacsBug skills are not polished.
  1012.  
  1013. The second part of the question is more of the same. Assuming you want
  1014. to put in this kind of work, are you willing to put in this kind of work
  1015. for System 7, System 7.1, System 7 Pro, and System 7.5? How about System
  1016. 6 and for each version of the System before? And each version of the
  1017. System after 7.5? Because the information is different in all of these
  1018. cases.
  1019.  
  1020. I'm not trying to be a wet blanket, but I do feel like I ought to try to
  1021. discourage you for your own good. You can do it; I've done it. But you
  1022. had better be sure it's worth the effort.
  1023. -- 
  1024.  Pete Gontier, CTO, Integer Poet Software; gurgle@netcom.com
  1025.  
  1026.  "...where they burn books, people are next." -- XTC
  1027.  
  1028. +++++++++++++++++++++++++++
  1029.  
  1030. >From jwbaxter@olympus.net (John W. Baxter)
  1031. Date: Mon, 13 Jun 1994 00:06:49 -0700
  1032. Organization: Internet for the Olympic Peninsula
  1033.  
  1034. In article <gurgleCrBMAK.61D@netcom.com>, gurgle@netcom.com (Pete Gontier)
  1035. wrote:
  1036.  
  1037. > alex@metcalf.demon.co.uk (Alex Metcalf) writes:
  1038. > >Up until a few weeks ago I thought it was impossible to read
  1039. > >information such as which Finder windows are open, the positions of
  1040. > >icons in that window (I know that's in the DB, but I don't know how
  1041. > >to check for the open window), etc. However, Popup Folder lets you
  1042. > >click on a finder folder and see some stuff about its hierarchy. So
  1043. > >there MUST be a way! Also, that screen saver software that has stuff
  1044. > >interacting with your finder windows.
  1045. > The question is not whether it can be done or how it can be done. Those
  1046. > are comparatively easy questions, and I will take a swipe at answering
  1047. > them below. The really interesting question, however, is this: do you
  1048. > really want to?
  1049. > ... [Reverse engineering 1.01 omitted]
  1050. > The second part of the question is more of the same. Assuming you want
  1051. > to put in this kind of work, are you willing to put in this kind of work
  1052. > for System 7, System 7.1, System 7 Pro, and System 7.5? How about System
  1053. > 6 and for each version of the System before? And each version of the
  1054. > System after 7.5? Because the information is different in all of these
  1055. > cases.
  1056. > I'm not trying to be a wet blanket, but I do feel like I ought to try to
  1057. > discourage you for your own good. You can do it; I've done it. But you
  1058. > had better be sure it's worth the effort.
  1059.  
  1060. Particulary, does he want to do this for System 7.5, whose Finder is happy
  1061. to tell you:
  1062.  
  1063. tell application "Finder"
  1064.     get every window
  1065. end tell
  1066.  
  1067. will return something like this (translated to text, from its list of
  1068. objects form):
  1069.     {window of folder "HyperCard 2.2" of startup disk of application
  1070. "Finder", window of startup disk of application "Finder"}
  1071.  
  1072. And
  1073. tell application "Finder"
  1074.     get name of every window
  1075. end tell
  1076.  
  1077. will return just the names, if that's all you want:  {"HyperCard 2.2",
  1078. "Vashon"}
  1079.  
  1080. Seems a whole lot simpler to me.  [Alex's own app can send the necessary
  1081. event.]
  1082.  
  1083. -- 
  1084. John Baxter    Port Ludlow, WA, USA  [West shore, Puget Sound]
  1085.    No hablo Intel.
  1086.    jwbaxter@pt.olympus.net
  1087.  
  1088. ---------------------------
  1089.  
  1090. >From jrrk@camcon.co.uk (Jonathan Kimmitt)
  1091. Subject: Metrowerks code generation wierdness
  1092. Date: 6 Jun 94 21:10:45 GMT
  1093. Organization: Cambridge Consultants Limited
  1094.  
  1095. Has anybody noticed that Metrowerks DR/2 and DR/3 return values from
  1096. functions
  1097. in different registers depending on what the function result type is ?
  1098.  
  1099. a function such as 'char *xmalloc(long)' returns in A0
  1100. whereas a function such as 'long temps(void)' returns in D0
  1101.  
  1102. No other compiler that I have ever seen for the 68K does this. ANSI C
  1103. allows this,
  1104. but as far as I can see it is impossible to guarantee correct code unless
  1105. 'require prototypes' is checked, which makes it more difficult to port
  1106. old non ANSI (K&R) code.
  1107.  
  1108. For the above functions declared in file A (xmalloc is a function which
  1109. allocates
  1110. memory), if file B contains
  1111.  
  1112.     {
  1113.     struct junk *ptr = (struct junk *)xmalloc(sizeof(struct junk));
  1114.     .....
  1115.  
  1116.  
  1117. incorrect code will be generated if your forget to use the prototype
  1118. because xmalloc will be assumed to return int and the value to be put in
  1119. ptr
  1120. will be assumed to be in D0, whereas the actual function will put the
  1121. result in A0
  1122. before returning. The result is that ptr will end up pointing to a random
  1123. location
  1124. in memory and will most likely cause a bus error or crash your mac.
  1125.  
  1126. THINK C (with 4-byte ints on), MPW and gcc will handle this case
  1127. correctly, so if
  1128. you are porting to Metrowerks you might not notice this bug in your code
  1129. until
  1130. it is too late.
  1131.  
  1132. One might speculate that this feature was implemented to improve
  1133. efficiency, since theoretically a pointer returned in A0 can be used
  1134. immediately. In practise it means
  1135. that code resources developed with Metrowerks might not be able to be 
  1136. used with another compiler
  1137. if they return pointers, and vice versa. Since this is a compatability
  1138. issue, one would 
  1139. expect that this feature should be made optional. Your constructive
  1140. comments are invited ...
  1141.  
  1142. +++++++++++++++++++++++++++
  1143.  
  1144. >From zstern@adobe.com (Zalman Stern)
  1145. Date: Tue, 7 Jun 1994 01:26:27 GMT
  1146. Organization: Adobe Systems Incorporated
  1147.  
  1148. Jonathan Kimmitt writes
  1149. > One might speculate that this feature was implemented to improve
  1150. > efficiency, since theoretically a pointer returned in A0 can be used
  1151. > immediately. In practise it means
  1152. > that code resources developed with Metrowerks might not be able to be 
  1153. > used with another compiler
  1154. > if they return pointers, and vice versa. Since this is a compatability
  1155. > issue, one would 
  1156. > expect that this feature should be made optional. Your constructive
  1157. > comments are invited ...
  1158.  
  1159. The 68k Macintosh has no standard C calling convention. The solution for  
  1160. things like code resources is to use the Pascal calling convention for every  
  1161. cross-interface call. In a couple years, PowerPC will have totally taken  
  1162. over and such concerns (along with A5 and A4 worlds) will be but dim  
  1163. nightmares from the past.
  1164. --
  1165. Zalman Stern           zalman@adobe.com            (415) 962 3824
  1166. Adobe Systems, 1585 Charleston Rd., POB 7900, Mountain View, CA 94039-7900
  1167.    Never let a "final candidate" subscript get above the age of consent.
  1168.  
  1169. +++++++++++++++++++++++++++
  1170.  
  1171. >From johnmce@world.std.com (John McEnerney)
  1172. Date: Tue, 7 Jun 1994 15:42:08 GMT
  1173. Organization: The World Public Access UNIX, Brookline, MA
  1174.  
  1175.  
  1176. >a function such as 'char *xmalloc(long)' returns in A0
  1177. >whereas a function such as 'long temps(void)' returns in D0
  1178. >
  1179. >No other compiler that I have ever seen for the 68K does this. ANSI C
  1180. >allows this,
  1181. >but as far as I can see it is impossible to guarantee correct code unless
  1182. >'require prototypes' is checked, which makes it more difficult to port
  1183. >old non ANSI (K&R) code.
  1184.  
  1185. As far as the ANSI standard is concerned, it would never be correct to 
  1186. call a function defined as returning a pointer when there is no 
  1187. declaration in scope. You cannot assume that 'int' and 'pointer' have the 
  1188. same representation, and we are allowed to use different calling 
  1189. conventions for them.
  1190.  
  1191. You can force the compiler to return pointers in D0 (this is sometimes 
  1192. necessary for calling C code generated by the MPW compiler) by using
  1193.  
  1194. #pragma pointers_in_D0
  1195.  
  1196. -- John McEnerney, Metrowerks PowerPC Product Architect
  1197.  
  1198.  
  1199. +++++++++++++++++++++++++++
  1200.  
  1201. >From astalker@nickel.ucs.indiana.edu (Altan J. Stalker)
  1202. Date: Tue, 7 Jun 1994 15:23:57 GMT
  1203. Organization: Indiana University, Bloomington IN
  1204.  
  1205. In article <46180@io.camcon.co.uk>, Jonathan Kimmitt <jrrk@camcon.co.uk> wrote:
  1206. >Has anybody noticed that Metrowerks DR/2 and DR/3 return values from
  1207. >functions
  1208. >in different registers depending on what the function result type is ?
  1209. >
  1210. > [stuff deleted]
  1211. >
  1212. > ... Since this is a compatability
  1213. > issue, one would 
  1214. > expect that this feature should be made optional. Your constructive
  1215. > comments are invited ...
  1216.  
  1217. Although I have never used it, a pragma exists to turn this feature
  1218. on and off.
  1219.  
  1220. pointers_in_A0   Make functions return pointers in the 68000 register A0
  1221.          [default]
  1222.  
  1223. pointers_in_d0   Make functions return pointers in the 68000 D0 register
  1224.                  [what you wanted]
  1225.  
  1226. (this is from the _Metrowerks C Language Reference DR/2_ page 13)
  1227.  
  1228. --
  1229. Altan J. Stalker, Indiana University, Bloomington IN
  1230. astalker@nickel.ucs.indiana.edu
  1231.  
  1232.  
  1233.  
  1234.  
  1235.  
  1236.  
  1237. +++++++++++++++++++++++++++
  1238.  
  1239. >From Bruce@hoult.actrix.gen.nz (Bruce Hoult)
  1240. Date: Wed, 8 Jun 1994 16:13:53 +1200 (NZST)
  1241. Organization: (none)
  1242.  
  1243. zstern@adobe.com (Zalman Stern) writes:
  1244. > The 68k Macintosh has no standard C calling convention. The solution for  
  1245. > things like code resources is to use the Pascal calling convention for every  
  1246. > cross-interface call. In a couple years, PowerPC will have totally taken  
  1247. > over and such concerns (along with A5 and A4 worlds) will be but dim  
  1248. > nightmares from the past.
  1249.  
  1250. ... to be replaced by new nightmares such as having to remember to put all
  1251. floating point paramaters after all integer parameters, if you want them
  1252. to fit into registers :-(
  1253.  
  1254. -- Bruce "anyone who designs a calling convention around k&r should be shot" Hoult
  1255.  
  1256. +++++++++++++++++++++++++++
  1257.  
  1258. >From jwbaxter@olympus.net (John W. Baxter)
  1259. Date: Wed, 08 Jun 1994 00:36:39 -0700
  1260. Organization: Internet for the Olympic Peninsula
  1261.  
  1262. In article <2853936833@hoult.actrix.gen.nz>, Bruce@hoult.actrix.gen.nz
  1263. (Bruce Hoult) wrote:
  1264.  
  1265. > ... to be replaced by new nightmares such as having to remember to put all
  1266. > floating point paramaters after all integer parameters, if you want them
  1267. > to fit into registers :-(
  1268.  
  1269. Wouldn't have been necessary if the ANSI folks had required prototypes
  1270. instead of offering them as a no-cost extra.  [That would have probably
  1271. exceeded the subcommittee's charter, since it would not have codified
  1272. existing practice, but broken new ground.  It WOULD have produced a better
  1273. language, though.]
  1274.  
  1275. -- 
  1276. John Baxter    Port Ludlow, WA, USA  [West shore, Puget Sound]
  1277.    No hablo Intel.
  1278.    jwbaxter@pt.olympus.net
  1279.  
  1280. +++++++++++++++++++++++++++
  1281.  
  1282. >From d88-jwa@dront.nada.kth.se (Jon Wdtte)
  1283. Date: 9 Jun 1994 09:15:16 GMT
  1284. Organization: The Royal Institute of Technology
  1285.  
  1286. In <46180@io.camcon.co.uk> jrrk@camcon.co.uk (Jonathan Kimmitt) writes:
  1287.  
  1288. >a function such as 'char *xmalloc(long)' returns in A0
  1289. >whereas a function such as 'long temps(void)' returns in D0
  1290.  
  1291. >No other compiler that I have ever seen for the 68K does this. ANSI C
  1292.  
  1293. Most non-mac compilers for the 68K I've seen does this.
  1294.  
  1295. You can turn it off with #pragma pointers_in_D0
  1296.  
  1297. cheers,
  1298.  
  1299.                     / h+
  1300. -- 
  1301.  -- Jon W{tte, h+@nada.kth.se, Mac Software Engineer Deluxe --
  1302.  
  1303.  -- I don't fear death, it's dying that scares me.
  1304.  
  1305. +++++++++++++++++++++++++++
  1306.  
  1307. >From platypus@cirrus.som.cwru.edu (Gary Kacmarcik)
  1308. Date: 09 Jun 1994 14:30:42 GMT
  1309. Organization: Case Western Reserve University, Cleveland, Ohio (USA)
  1310.  
  1311.  
  1312. In article <2853936833@hoult.actrix.gen.nz> Bruce@hoult.actrix.gen.nz (Bruce Hoult) writes:
  1313. >
  1314. > zstern@adobe.com (Zalman Stern) writes:
  1315. > > [...]   In a couple years, PowerPC will have totally taken  
  1316. > > over and such concerns (along with A5 and A4 worlds) will be but dim  
  1317. > > nightmares from the past.
  1318. >
  1319. >  ... to be replaced by new nightmares such as having to remember to put all
  1320. > floating point paramaters after all integer parameters, if you want them
  1321. > to fit into registers :-(
  1322.  
  1323. i don't know what you mean by this.  the PowerPC calling conventions that
  1324. i'm familiar with do not require this.
  1325.  
  1326. for the PowerPC, standard function calling conventions state that fixed-
  1327. point arguments go in r3-r10, floating-point arguments go in fr1-fr13.
  1328.  
  1329. if you define something like:
  1330.  
  1331.    int foo(int a,float b,int c,double d)
  1332.  
  1333. the parameters will be mapped to registers as follows:
  1334.   a:  r3
  1335.   b:  fr1
  1336.   c:  r4
  1337.   d:  fr2
  1338.  
  1339. according to this ABI, it is explicitly stated that parameters can be
  1340. declared in any order, and the fixed- and floating-point registers will
  1341. be used as efficiently as possible.
  1342.  
  1343. -gary j kacmarcik
  1344. platypus@cirrus.som.cwru.edu
  1345.  
  1346. +++++++++++++++++++++++++++
  1347.  
  1348. >From johnmce@world.std.com (John McEnerney)
  1349. Date: Thu, 9 Jun 1994 15:09:56 GMT
  1350. Organization: The World Public Access UNIX, Brookline, MA
  1351.  
  1352. platypus@cirrus.som.cwru.edu (Gary Kacmarcik) writes:
  1353.  
  1354. >if you define something like:
  1355. >   int foo(int a,float b,int c,double d)
  1356. >the parameters will be mapped to registers as follows:
  1357. >  a:  r3
  1358. >  b:  fr1
  1359. >  c:  r4
  1360. >  d:  fr2
  1361.  
  1362. WRONG! (You would think this would be the case, but it is not)
  1363.  
  1364. a: r3
  1365. b: fr1 (r4 is reserved)
  1366. c: r5
  1367. d: fr2 (r6 and r7 are reserved)
  1368.  
  1369. additional integer arguments go in r8, etc. This is a strange nuance to 
  1370. the IBM PowerPC ABI. I believe that it is used for calling functions 
  1371. which have no prototype in scope, e.g. if I call printf() without 
  1372. including <stdio.h> (which is illegal in ANSI) the compiler will pass the 
  1373. floating-point arguments in -both- the integer and floating-point 
  1374. registers, so the callee can work correctly no matter if it takes a 
  1375. variable number of arguments or has arguments declared as floating-point 
  1376. types. Note that as the original poster pointed out, you get best results 
  1377. by declaring your integer arguments first and then your floating-point 
  1378. arguments.
  1379.  
  1380. The CodeWarrior compiler does not implement this feature, since the ANSI 
  1381. standard us strict on this issue (it is illegal to call a function taking 
  1382. a variable number of arguments without a prototype) However, for 
  1383. compatibility with the Apple Toolbox and such, we incur the same penalty 
  1384. in register usage.
  1385.  
  1386. -- John McEnerney, Metrowerks PowerPC Product Architect
  1387.  
  1388.  
  1389. +++++++++++++++++++++++++++
  1390.  
  1391. >From Bruce@hoult.actrix.gen.nz (Bruce Hoult)
  1392. Date: Fri, 10 Jun 1994 16:45:43 +1200 (NZST)
  1393. Organization: (none)
  1394.  
  1395. platypus@cirrus.som.cwru.edu (Gary Kacmarcik) writes:
  1396. > >  ... to be replaced by new nightmares such as having to remember to put all
  1397. > > floating point paramaters after all integer parameters, if you want them
  1398. > > to fit into registers :-(
  1399. > i don't know what you mean by this.  the PowerPC calling conventions that
  1400. > i'm familiar with do not require this.
  1401. > for the PowerPC, standard function calling conventions state that fixed-
  1402. > point arguments go in r3-r10, floating-point arguments go in fr1-fr13.
  1403. > if you define something like:
  1404. >    int foo(int a,float b,int c,double d)
  1405. > the parameters will be mapped to registers as follows:
  1406. >   a:  r3
  1407. >   b:  fr1
  1408. >   c:  r4
  1409. >   d:  fr2
  1410. > according to this ABI, it is explicitly stated that parameters can be
  1411. > declared in any order, and the fixed- and floating-point registers will
  1412. > be used as efficiently as possible.
  1413.  
  1414. Would that it were so!
  1415.  
  1416. Unfortunately, this directly contradicts Apple's _Inside Macintosh: PowerPC
  1417. System Software_, page 1-50:
  1418.  
  1419. "Placing a floating point parameter into a floating point register also
  1420. reserves one or two genrral-purpose registers, depending on whether the
  1421. paramater is 32 or 64 bits long.  This behavious is dictated in order to
  1422. support the ability of a C function to call another function without
  1423. knowing the number or types of the callee's parameters. [...]  The only
  1424. difference betwen cases in which the prototype is available and cases
  1425. in which the prototype isn't available is that the floating point
  1426. parameters are copied into the general-purpose register(s) in the latter
  1427. case but not in the former."
  1428.  
  1429. [there follows an example of register mapping]
  1430.  
  1431. "NOTE.  It would have been possible to pas all the fixed point values in
  1432. registers if the floating-point parameters had been grouped at the end of
  1433. the parameter list".
  1434.  
  1435.  
  1436. I would *love* to learn that this is wrong.
  1437.  
  1438. -- Bruce
  1439.  
  1440. +++++++++++++++++++++++++++
  1441.  
  1442. >From platypus@cirrus.som.cwru.edu (Gary Kacmarcik)
  1443. Date: 10 Jun 1994 20:22:51 GMT
  1444. Organization: Case Western Reserve University, Cleveland, Ohio (USA)
  1445.  
  1446. In article <Cr4y4K.K57@world.std.com> johnmce@world.std.com (John McEnerney) writes:
  1447. >
  1448. > platypus@cirrus.som.cwru.edu (Gary Kacmarcik) writes:
  1449. >
  1450. > >if you define something like:
  1451. > >   int foo(int a,float b,int c,double d)
  1452. > >the parameters will be mapped to registers as follows:
  1453. > >  a:  r3
  1454. > >  b:  fr1
  1455. > >  c:  r4
  1456. > >  d:  fr2
  1457. >
  1458. > WRONG! (You would think this would be the case, but it is not)
  1459.  
  1460. i looked this up when i got home and discovered that what i was describing
  1461. was the *Embedded* ABI, which apparently has a more intelligent way
  1462. of allocating registers.  it also has things like not always generating
  1463. the (typically unused) 'param area' to shadow the GPR's on the stack - 
  1464. it only generates a param area if it's needed.
  1465.  
  1466. apparently the embedded people care more about having proper register and
  1467. stack allocation and are willing to forsake screwy calling conventions
  1468. to get it.  ;-)
  1469.  
  1470. it's funny that i never came across an example that exposed this - i guess
  1471. i don't do as much floating-point code as i thought.
  1472.  
  1473.  
  1474. -gary j kacmarcik
  1475. platypus@cirrus.som.cwru.edu
  1476.  
  1477. +++++++++++++++++++++++++++
  1478.  
  1479. >From zstern@adobe.com (Zalman Stern)
  1480. Date: Sat, 11 Jun 1994 01:30:31 GMT
  1481. Organization: Adobe Systems Incorporated
  1482.  
  1483. Gary Kacmarcik writes
  1484. > apparently the embedded people care more about having proper register and
  1485. > stack allocation and are willing to forsake screwy calling conventions
  1486. > to get it.  ;-)
  1487.  
  1488. The embedded people have the advantage of defining their calling convention  
  1489. four years later when it is obvious what you can and cannot realistically  
  1490. depend on in ANSI-C code. They are also willing to sacrifice a little more  
  1491. for performance. (I.e. portability is less of a concern in embedded code.)
  1492. --
  1493. Zalman Stern           zalman@adobe.com            (415) 962 3824
  1494. Adobe Systems, 1585 Charleston Rd., POB 7900, Mountain View, CA 94039-7900
  1495.    Never let a "final candidate" subscript get above the age of consent.
  1496.  
  1497. +++++++++++++++++++++++++++
  1498.  
  1499. >From Bruce@hoult.actrix.gen.nz (Bruce Hoult)
  1500. Date: Sun, 12 Jun 1994 21:03:48 +1200 (NZST)
  1501. Organization: (none)
  1502.  
  1503. platypus@cirrus.som.cwru.edu (Gary Kacmarcik) writes:
  1504. > i looked this up when i got home and discovered that what i was describing
  1505. > was the *Embedded* ABI, which apparently has a more intelligent way
  1506. > of allocating registers.  it also has things like not always generating
  1507. > the (typically unused) 'param area' to shadow the GPR's on the stack - 
  1508. > it only generates a param area if it's needed.
  1509. > apparently the embedded people care more about having proper register and
  1510. > stack allocation and are willing to forsake screwy calling conventions
  1511. > to get it.  ;-)
  1512. > it's funny that i never came across an example that exposed this - i guess
  1513. > i don't do as much floating-point code as i thought.
  1514.  
  1515. Agreed that it's screwy (I have to -- I'm the one that started this :-),
  1516. but there are some nice things in the PPC calling conventions as well, most
  1517. of them designed to make tiny functions extremely efficient.
  1518.  
  1519. For example, it's really nice that you can quite legally push a few things
  1520. on the stack without adjusting the stack pointer, because you can depend
  1521. on interrupt routines always skipping over the first couple of hundred
  1522. bytes of stack, in case you're using it.
  1523.  
  1524. It's also neat that a function like...
  1525.  
  1526.   long myAdd(long a, long b){return a+b;}
  1527.  
  1528. ...can be compiled into just...
  1529.  
  1530.   add r3,r3,r4
  1531.   blr
  1532.  
  1533. ...which results in no memory access at all (other than instruction
  1534. fetch).  Most 68k compilers will give even this function the full
  1535. treatment...
  1536.  
  1537.   link a6,#0
  1538.   move.l 8(a6),d0
  1539.   add.l 12(a6),d0
  1540.   unlk a6
  1541.   rts
  1542.  
  1543. ... not to mention the caller setting up the stack beforehand, and
  1544. cleaning off the parameters afterwards, causing eight memory references
  1545. in using this little function (ten for Pascal calling conventions)
  1546.  
  1547. In fact, on many code examples I've looked at, the PPC code is actually
  1548. *smaller* than the equivalent 68K code generated by the MPW or Symantec
  1549. compilers.
  1550.  
  1551. -- Bruce
  1552.  
  1553. +++++++++++++++++++++++++++
  1554.  
  1555. >From platypus@cirrus.som.cwru.edu (Gary Kacmarcik)
  1556. Date: 12 Jun 1994 18:18:31 GMT
  1557. Organization: Case Western Reserve University, Cleveland, Ohio (USA)
  1558.  
  1559. In article <2854299828@hoult.actrix.gen.nz> Bruce@hoult.actrix.gen.nz (Bruce Hoult) writes:
  1560. >
  1561. > Agreed that it's screwy (I have to -- I'm the one that started this :-),
  1562. > but there are some nice things in the PPC calling conventions as well, most
  1563. > of them designed to make tiny functions extremely efficient.
  1564. >
  1565. > For example, it's really nice that you can quite legally push a few things
  1566. > on the stack without adjusting the stack pointer, because you can depend
  1567. > on interrupt routines always skipping over the first couple of hundred
  1568. > bytes of stack, in case you're using it.
  1569.  
  1570. hmmm... i don't think that i would have chosen this particular example to
  1571. try to demonstrate why the calling conventions _weren't_ screwy.  ;-)
  1572. when i first saw IBM's compiler generating code that placed values above
  1573. the stack ptr, my first response was <ick>.
  1574.  
  1575. i can deal with it now that i understand that the compiler's trying to insure
  1576. that r1 is always pointing to a value stack frame.  one thing i wonder about
  1577. (but have yet to try) is how alloca() is handled.
  1578.  
  1579. overall, the calling conventions aren't bad and there are many advantages.
  1580. but there certainly are wierdnesses.
  1581.  
  1582.  
  1583. gary j kacmarcik
  1584. platypus@cirrus.som.cwru.edu
  1585.  
  1586. +++++++++++++++++++++++++++
  1587.  
  1588. >From Bruce@hoult.actrix.gen.nz (Bruce Hoult)
  1589. Date: Mon, 13 Jun 1994 19:41:53 +1200 (NZST)
  1590. Organization: (none)
  1591.  
  1592. platypus@cirrus.som.cwru.edu (Gary Kacmarcik) writes:
  1593. > > For example, it's really nice that you can quite legally push a few things
  1594. > > on the stack without adjusting the stack pointer, because you can depend
  1595. > > on interrupt routines always skipping over the first couple of hundred
  1596. > > bytes of stack, in case you're using it.
  1597. > hmmm... i don't think that i would have chosen this particular example to
  1598. > try to demonstrate why the calling conventions _weren't_ screwy.  ;-)
  1599. > when i first saw IBM's compiler generating code that placed values above
  1600. > the stack ptr, my first response was <ick>.
  1601. > i can deal with it now that i understand that the compiler's trying to insure
  1602. > that r1 is always pointing to a value stack frame.  one thing i wonder about
  1603. > (but have yet to try) is how alloca() is handled.
  1604. > overall, the calling conventions aren't bad and there are many advantages.
  1605. > but there certainly are wierdnesses.
  1606.  
  1607. The way I look at it is that most of this stuff has been designed to be
  1608. fast running, even if it make life hell for the asm programmer trying to
  1609. keep track of things manually.  That, after all, being what compilers
  1610. are for.
  1611.  
  1612. -- Bruce
  1613.  
  1614. ---------------------------
  1615.  
  1616. >From rang@winternet.com (Anton Rang)
  1617. Subject: PPC and 64-bit video (was Re: Fast full screen scrolling: impossible?)
  1618. Date: 13 Jun 1994 02:33:06 GMT
  1619. Organization: Minnesota Angsters
  1620.  
  1621. In article <1994Jun12.182803.1@west.cscwc.pima.edu> 103t_english@west.cscwc.pima.edu writes:
  1622. >d e v e l o p 18 claims that the PPC blitter that they used was slower than
  1623. >CopyBits because it didn't (presumably, for some unknown reason, *couldn't*)
  1624. >take advantage of the 64-bit path of video.
  1625.  
  1626.   Unless you're using the floating-point registers, you can't use the
  1627. full 64-bit path efficiently, because there's no 64-bit integer load.
  1628. I haven't looked at NQDCopyBits to see if it uses the FP registers; I
  1629. suppose that it *could*, in cases where there is no scaling, shifting,
  1630. etc. but it seems unlikely that it would.
  1631.  
  1632. >For this same reason, *BlockMove* was also slower.
  1633.  
  1634.   Well, BlockMove is going to be slower on the PPC because the video
  1635. memory is noncachable and BlockMove will pre-zero it using the dcbz
  1636. instruction ('zero-cache-block').  Using dcbz is a big win when doing
  1637. copies between cachable blocks, because it eliminates the pre-read
  1638. that the processor will otherwise do when storing data.
  1639.  
  1640.   The Power Macintosh NuBus technical note addresses this, and
  1641. includes a new interface, PBBlockMove, which is supposed to take into
  1642. account the cachability of source and destination memory ranges.  (No
  1643. word on when this will be shipping or whether it will be licensable as
  1644. a system extension.)
  1645.  
  1646. >What is going on with the memory subsystem in the PowerMacs? Is it or isn't it
  1647. >64-bit? Is the DRAM video 64-bit? Is the AV video? Is the non-AV PDS video?
  1648.  
  1649.   The non-AV PDS VRAM is 64-bit, the DRAM is 64-bit (all of memory
  1650. is).  The AV bus internally is 32-bits (it's the same chips as on the
  1651. 680x0 AVs), but might have a 64-bit interface to the processor bus; I
  1652. haven't looked.
  1653.  
  1654. > [ questions about video bandwidth deleted, i have no answers ]
  1655. >For that matter, why can't BlockMove move data in 64-bit chunks when
  1656. >it is most optimal to do so?
  1657.  
  1658.   It can.  The problem is the dcbz, which when used with video memory
  1659. will result in every word being written twice.  That's why you should
  1660. use CopyBits instead.  :-)
  1661.  
  1662. >And finally, what happened to the load/store multiple instructions
  1663. >that are (I assume?) faster on the 601, but will probably be slower
  1664. >"in future implementations?"
  1665.  
  1666.   They're actually not faster on the 601, they simply take less code
  1667. space.  They still take one cycle per register to process.  I haven't
  1668. checked to see whether they're slower on the 603/604, but would guess
  1669. that they may cause synchronization on the 603, which would certainly
  1670. slow things down relative to just using plain load/store.
  1671.  
  1672.   The fastest way to move memory on the 601 is to use floating-point
  1673. registers (load/store double), coupled with 'dcbz' if you're going to
  1674. cachable memory, but *not* when you're going to non-cachable memory.
  1675. (All of this presumes aligned memory, incidentally; if you're not
  1676. aligned, you're out of luck and probably need to use the string
  1677. instructions instead.)
  1678. --
  1679. Anton Rang (rang@winternet.com)
  1680.  
  1681. ---------------------------
  1682.  
  1683. >From Frank Manshande <frankm@and.nl>
  1684. Subject: Playing QuickTime movies
  1685. Date: Mon, 6 Jun 1994 11:41:21 GMT
  1686. Organization: AND Software BV
  1687.  
  1688. Hi,
  1689.  
  1690. I have a question concerning playing QuickTime movies.
  1691.  
  1692. What I want is to store the movie (data) into the datafork at
  1693. a specific offset (for example at offset 3000), and later play
  1694. that movie from that offset. This way I can put more than one
  1695. QuickTime movie into one file and play a movie at a specific
  1696. offset.
  1697.  
  1698. The call "PutMovieIntoDataFork" only seems to store the movie
  1699. structure, and not the movie data, into a file at the specified
  1700. offset. This way the PutMovieIntoDataFork call creates a file
  1701. of about 1,5 KB which only contains a reference to the original
  1702. movie data file.
  1703.  
  1704. Does anybody have suggestions? I would be very grateful!
  1705.  
  1706. Frank Manshande
  1707. frankm@and.nl
  1708.  
  1709. +++++++++++++++++++++++++++
  1710.  
  1711. >From breger@netcom.com (Ron Breger)
  1712. Date: Mon, 6 Jun 1994 17:49:45 GMT
  1713. Organization: Netcom
  1714.  
  1715. Frank Manshande (frankm@and.nl) wrote:
  1716. : Hi,
  1717.  
  1718. : I have a question concerning playing QuickTime movies.
  1719.  
  1720. : What I want is to store the movie (data) into the datafork at
  1721. : a specific offset (for example at offset 3000), and later play
  1722. : that movie from that offset. This way I can put more than one
  1723. : QuickTime movie into one file and play a movie at a specific
  1724. : offset.
  1725.  
  1726. : The call "PutMovieIntoDataFork" only seems to store the movie
  1727. : structure, and not the movie data, into a file at the specified
  1728. : offset. This way the PutMovieIntoDataFork call creates a file
  1729. : of about 1,5 KB which only contains a reference to the original
  1730. : movie data file.
  1731.  
  1732. I am having the same problem, but I am using handles.
  1733. This is something that I'm trying to do:
  1734.  
  1735.  
  1736. // save the moive
  1737. PutMoiveIntoHandle()
  1738. AddResource(publicMoive, 'MRES', 1000, "");
  1739. ReleaseResource(publicMovie);
  1740.  
  1741. then
  1742.  
  1743. // play the movie
  1744. publicMovie = GetResource('MRES',1000);
  1745. DetachResource(publicMoive);
  1746. StartMoive(publicMoive);
  1747.  
  1748.  
  1749. I would like to have one (resource) file to contain many movies.
  1750. I don't want to use MovieFiles.  I would like the data
  1751. to be in a resource and not contain any references to
  1752. the original files.  Is this possible?
  1753.  
  1754. Please help.  (email or post).
  1755.  
  1756. Thanks.
  1757. Ron Breger
  1758.  
  1759. -- 
  1760. =====================================================================
  1761. Ron Breger         
  1762. breger@netcom.com                              AppleLink: RON.BREGER
  1763. =====================================================================
  1764.  
  1765. +++++++++++++++++++++++++++
  1766.  
  1767. >From ivanski@world.std.com (Ivan M CaveroBelaunde)
  1768. Date: Mon, 6 Jun 1994 20:27:32 GMT
  1769. Organization: The World Public Access UNIX, Brookline, MA
  1770.  
  1771. breger@netcom.com (Ron Breger) writes:
  1772. >Frank Manshande (frankm@and.nl) wrote:
  1773. >: Hi,
  1774. >: I have a question concerning playing QuickTime movies.
  1775. >: What I want is to store the movie (data) into the datafork at
  1776. >: a specific offset (for example at offset 3000), and later play
  1777. >: that movie from that offset. This way I can put more than one
  1778. >: QuickTime movie into one file and play a movie at a specific
  1779. >: offset.
  1780.  
  1781. FlattenMovieData to a temp file, then copy the data over, using
  1782. SetMediaDataRef to repoint all the medias in the movie to the new file.
  1783.  
  1784. >I am having the same problem, but I am using handles.
  1785. >This is something that I'm trying to do:
  1786.  
  1787. >// save the moive
  1788. >PutMoiveIntoHandle()
  1789. >AddResource(publicMoive, 'MRES', 1000, "");
  1790. >ReleaseResource(publicMovie);
  1791.  
  1792. This would work in theory; however, you should do a WriteResource
  1793. before you do a ReleaseResource. Is there a reason why you're not using
  1794. Add/UpdateMovieResource, however?
  1795.  
  1796. >then
  1797.  
  1798. >// play the movie
  1799. >publicMovie = GetResource('MRES',1000);
  1800. >DetachResource(publicMoive);
  1801. >StartMoive(publicMoive);
  1802.  
  1803. This will *not* work. You'd have to do:
  1804.     myMovie = NewMovieFromHandle(publicMovie);
  1805.  
  1806. >I would like to have one (resource) file to contain many movies.
  1807.  
  1808. Perfectly feasible with Add/UpdateMovieResource, since you can specify
  1809. the resID, as well as scan the movie res file for 'moov' resources.
  1810.  
  1811. >I don't want to use MovieFiles.
  1812.  
  1813. Why? Are there limitations you see in using them?
  1814.  
  1815. >  I would like the data
  1816. >to be in a resource and not contain any references to
  1817. >the original files.  Is this possible?
  1818.  
  1819. Nope. The movie *data* must be in a data fork. It *is* possible for the
  1820. file to be completely self-contained (ie all the movie data would be in
  1821. the data fork of the file that contains the movie resources), however.
  1822.  
  1823. -Ivan
  1824. - -
  1825. Ivan Cavero Belaunde (ivanski@world.std.com)
  1826. Avid VideoShop Project Lead
  1827. Avid Technology, Inc.
  1828.  
  1829. +++++++++++++++++++++++++++
  1830.  
  1831. >From Frank Manshande <frankm@and.nl>
  1832. Date: Tue, 7 Jun 1994 07:29:44 GMT
  1833. Organization: AND Software BV
  1834.  
  1835. In article <Cqzstw.BqE@world.std.com> Ivan M CaveroBelaunde,
  1836. ivanski@world.std.com writes:
  1837. >FlattenMovieData to a temp file, then copy the data over, using
  1838. >SetMediaDataRef to repoint all the medias in the movie to the new file.
  1839. >
  1840.  
  1841. I'm reading IM-QuickTime right now, but I can't seem to find how I can
  1842. play a movie from a specific offset. If I succeed in saving the movie
  1843. the way you describe, using SetMediaDataRef for all the tracks, how can
  1844. I then play that movie. And would that also work under QuickTime for
  1845. Windows?
  1846.  
  1847. Thanks for your time!
  1848.  
  1849. Frank Manshande
  1850. frankm@and.nl
  1851.  
  1852. +++++++++++++++++++++++++++
  1853.  
  1854. >From ivanski@world.std.com (Ivan M CaveroBelaunde)
  1855. Date: Tue, 7 Jun 1994 13:50:44 GMT
  1856. Organization: The World Public Access UNIX, Brookline, MA
  1857.  
  1858. Frank Manshande <frankm@and.nl> writes:
  1859.  
  1860. >In article <Cqzstw.BqE@world.std.com> Ivan M CaveroBelaunde,
  1861. >ivanski@world.std.com writes:
  1862. >>FlattenMovieData to a temp file, then copy the data over, using
  1863. >>SetMediaDataRef to repoint all the medias in the movie to the new file.
  1864. >>
  1865.  
  1866. >I'm reading IM-QuickTime right now, but I can't seem to find how I can
  1867. >play a movie from a specific offset. If I succeed in saving the movie
  1868. >the way you describe, using SetMediaDataRef for all the tracks, how can
  1869. >I then play that movie. And would that also work under QuickTime for
  1870. >Windows?
  1871.  
  1872. The way you would play that movie is that you would, in that same file,
  1873. store multiple movie resources for each of the movies stored at different
  1874. offsets using Add/UpdateMovieResource. Then you can just do
  1875. NewMovieFromFile/FromHandle and play whichever one you want.
  1876.  
  1877. This does *not* work at all under QuickTime for Windows, since QTW
  1878. uses data-fork only movies. Since df movies are defined to contain
  1879. its "movie resource" at the end of the data stream, you can only
  1880. have *one* movie per file, unlike the flexibility you have when you
  1881. use moov resources.
  1882.  
  1883. QTW has a number of other limitations you might want to read up on. I don't
  1884. remember them off the top of my head, but, for exmaple, I don't believe
  1885. multitrack or multifile (dependent file) support is in there yet - you're
  1886. limited to comlletely self-contained movies with at most 1 video track and
  1887. 1 audio track.
  1888.  
  1889. -Ivan
  1890. - -
  1891. Ivan Cavero Belaunde (ivanski@world.std.com)
  1892. Avid VideoShop Project Lead
  1893. Avid Technology, Inc.
  1894.  
  1895. +++++++++++++++++++++++++++
  1896.  
  1897. >From breger@netcom.com (Ron Breger)
  1898. Date: Wed, 8 Jun 1994 15:39:47 GMT
  1899. Organization: Netcom
  1900.  
  1901. : >I am having the same problem, but I am using handles.
  1902. : >This is something that I'm trying to do:
  1903.  
  1904. : >// save the moive
  1905. : >PutMoiveIntoHandle()
  1906. : >AddResource(publicMoive, 'MRES', 1000, "");
  1907. : >ReleaseResource(publicMovie);
  1908.  I did the WriteResource.
  1909.  
  1910.  
  1911. : This would work in theory; however, you should do a WriteResource
  1912. : before you do a ReleaseResource. Is there a reason why you're not using
  1913. : Add/UpdateMovieResource, however?
  1914.  
  1915. : >then
  1916.  
  1917. : >// play the movie
  1918. : >publicMovie = GetResource('MRES',1000);
  1919. : >DetachResource(publicMoive);
  1920. : >StartMoive(publicMoive);
  1921.  
  1922. : This will *not* work. You'd have to do:
  1923. :     myMovie = NewMovieFromHandle(publicMovie);
  1924.  
  1925. Yes, I am doing the NewMovieFromHandle.
  1926.  
  1927. : Perfectly feasible with Add/UpdateMovieResource, since you can specify
  1928. : the resID, as well as scan the movie res file for 'moov' resources.
  1929.  
  1930. : >I don't want to use MovieFiles.
  1931.  
  1932. : Why? Are there limitations you see in using them?
  1933.  
  1934. I want to use my own resources instead of MovieFiles, so that I can
  1935. put all the movies in regular resource files and use ResEdit to copy
  1936. and paste the movies I need.  Also, I would like to have my application
  1937. contain all the resources it needs and not have it depend on any
  1938. other files.  
  1939.  
  1940. I am planning of using QuickTime 2.0 that supports Music (MIDI) and
  1941. would like to have all of the Movies be in the resource fork of the 
  1942. application.  I find it very convienient to be able to use ResEdit
  1943. to copy/paste resources around.  So, I was trying to have a movie
  1944. be self-contained, storing the movie as a resource, and reading it
  1945. back in using GetResource() and NewMoiveFromHandle(), but have been
  1946. unsuccessful.  I still am a little confused why this doesn't work:
  1947.  
  1948. AddResource(publicMoive, 'MRES', 1000, "");
  1949. WriteResource(publicMovie);
  1950. ReleaseResource(publicMovie);
  1951.  
  1952. [I don't want to use AddMoiveResource(), as I don't want to use
  1953. MoiveFiles().  I want all the data to be in one resource and not use
  1954. the data fork.  That way, I can use ResEdit to eaisly copy/paste 
  1955. movies around.  This is what I do with my 'snd ' resources!] 
  1956.  
  1957. then
  1958.  
  1959. // play the movie
  1960. publicMovie = GetResource('MRES',1000);
  1961. DetachResource(publicMoive);
  1962. NewMovieFromHandle(&theMovie, publicMovie);
  1963. StartMoive(theMoive);
  1964.  
  1965. Thanks for all your help.
  1966. -- 
  1967. =====================================================================
  1968. Ron Breger         
  1969. breger@netcom.com                              AppleLink: RON.BREGER
  1970. =====================================================================
  1971.  
  1972. +++++++++++++++++++++++++++
  1973.  
  1974. >From jywang@apple.com (John Wang)
  1975. Date: 9 Jun 1994 21:37:17 GMT
  1976. Organization: Apple Computer, Inc.
  1977.  
  1978. There are two parts to a movie.  1) the movie data atom.  2) the movie
  1979. resource atom.  The movie data atom is always in the data fork.   However,
  1980. the movie resource atom can be stored in either the resource fork or the
  1981. data fork.  If the movie resource atom is stored in the resource fork, it
  1982. is very easy to randomly access the many atoms that you might have stored
  1983. in individual resources.  But, if you want your movies to be cross-platform
  1984. compatible, then you'll want to stored the movie resource atoms in the data
  1985. fork.
  1986.  
  1987. To store the movie data atom into a file, you must call either FlattenMovie
  1988. or FlattenMovieData.  The difference between FlattenMovie and FlattenMovie
  1989. is that FlattenMovie also adds the movie resource atom to the resource
  1990. fork.  Therefore, you'll want to call FlattenMovieData if you don't want to
  1991. add a movie resource atom to the resource fork.  Instead, in either call,
  1992. you can use the flag, flattenAddMovieToDataFork.  This will add the movie
  1993. resource atom to the data fork.
  1994.  
  1995. For a more complete discussion of this topic, please read my column on
  1996. "Movie Files" in issue #16 of develop magazine (an Apple publication).
  1997.  
  1998. John Wang
  1999.  
  2000. In article <bregerCqzLIx.GEp@netcom.com>, breger@netcom.com (Ron Breger)
  2001. wrote:
  2002.  
  2003. > Frank Manshande (frankm@and.nl) wrote:
  2004. > : Hi,
  2005. > : I have a question concerning playing QuickTime movies.
  2006. > : What I want is to store the movie (data) into the datafork at
  2007. > : a specific offset (for example at offset 3000), and later play
  2008. > : that movie from that offset. This way I can put more than one
  2009. > : QuickTime movie into one file and play a movie at a specific
  2010. > : offset.
  2011. > : The call "PutMovieIntoDataFork" only seems to store the movie
  2012. > : structure, and not the movie data, into a file at the specified
  2013. > : offset. This way the PutMovieIntoDataFork call creates a file
  2014. > : of about 1,5 KB which only contains a reference to the original
  2015. > : movie data file.
  2016. > I am having the same problem, but I am using handles.
  2017. > This is something that I'm trying to do:
  2018. > // save the moive
  2019. > PutMoiveIntoHandle()
  2020. > AddResource(publicMoive, 'MRES', 1000, "");
  2021. > ReleaseResource(publicMovie);
  2022. > then
  2023. > // play the movie
  2024. > publicMovie = GetResource('MRES',1000);
  2025. > DetachResource(publicMoive);
  2026. > StartMoive(publicMoive);
  2027. > I would like to have one (resource) file to contain many movies.
  2028. > I don't want to use MovieFiles.  I would like the data
  2029. > to be in a resource and not contain any references to
  2030. > the original files.  Is this possible?
  2031. > Please help.  (email or post).
  2032. > Thanks.
  2033. > Ron Breger
  2034. > -- 
  2035. > =====================================================================
  2036. > Ron Breger         
  2037. > breger@netcom.com                              AppleLink: RON.BREGER
  2038. > =====================================================================
  2039.  
  2040. +++++++++++++++++++++++++++
  2041.  
  2042. >From ivanski@world.std.com (Ivan M CaveroBelaunde)
  2043. Date: Mon, 13 Jun 1994 21:56:13 GMT
  2044. Organization: The World Public Access UNIX, Brookline, MA
  2045.  
  2046. breger@netcom.com (Ron Breger) writes:
  2047. >I want to use my own resources instead of MovieFiles, so that I can
  2048. >put all the movies in regular resource files and use ResEdit to copy
  2049. >and paste the movies I need.  Also, I would like to have my application
  2050. >contain all the resources it needs and not have it depend on any
  2051. >other files.  
  2052.  
  2053. QT usually *needs* to store movie data in the data fork of files. QT2
  2054. introduces a "handle data handler," which allows you to create movies
  2055. that are held entirely in memory. (Maynard Handley will like this...)
  2056. The twist is, of course, that you have to save them yourself somehow
  2057. (the movie user data could be the place for it).
  2058.  
  2059. So the movie creation process goes as follows:
  2060.   - Create the movie the usual way, putting the data in the data fork.
  2061.   - After you're done, make a copy of the movie by copying each
  2062.      track by hand (using InsertTrackSegment). However, on the
  2063.      copied movie, when you create the media, specify that you're
  2064.      using the handle data handler instead of the alias data
  2065.      handler. This will create an in-memory copy of the
  2066.      movie data.
  2067.   - Save the handles where the data is sitting in the movie's user
  2068.      data using AddUserData.
  2069.   - Do the PutMovieIntoHandle, etc, stuff and save the movie as a
  2070.      resource.
  2071.  
  2072. Once you've done that once, you can load the movie by doing the following:
  2073.   - GetResource()
  2074.   - NewMovieFromHandle()
  2075.   - GetMovieUserData()
  2076.   - For every track in this movie, if the media type is 'hndl',
  2077.          use the SetMediaDataRef call to "repoint" the media
  2078.          to the handle from GetMovieUserData.
  2079.  
  2080. Although I haven't tried this specifically, I've used all of these calls
  2081. at one time or another, so it should work.
  2082.  
  2083. The downside to this trick is that you end up with two copies of the
  2084. data in memory, which for large movies would be a serious issue.
  2085. That can be addressed by putting the data handle in a separate resource
  2086. instead of the user data, but the drawback there is that you must
  2087. copy two resources around, which might or might not be a big deal.
  2088. You could still use the movie user data to specify the res type and id
  2089. where the data is stored.
  2090.  
  2091. Hope this helps,
  2092.  
  2093. -Ivan
  2094. - -
  2095. Ivan Cavero Belaunde (ivanski@world.std.com)
  2096. Avid VideoShop Project Lead
  2097. Avid Technology, Inc.
  2098. #include <std.disclaimer.h>
  2099.  
  2100. ---------------------------
  2101.  
  2102. >From nagle@netcom.com (John Nagle)
  2103. Subject: Quickdraw GX - Why?
  2104. Date: Mon, 30 May 1994 03:46:07 GMT
  2105. Organization: NETCOM On-line Communication Services (408 261-4700 guest)
  2106.  
  2107.       Well, we now have Quickdraw GX, which is a 2D object-oriented
  2108. graphics system.  This is nice, but does it solve a real problem?
  2109. It's not a full 3D system, so you can't use it for 3D graphics.
  2110. It's not compatible with existing object-oriented graphics standards, 
  2111. like X or PHIGS.  It's complicated; several volume of manuals are required.
  2112. Rescalable icons are nice, but Quickdraw GX seems overkill just to
  2113. achieve that.  What kind of application would be simpler if written to use
  2114. Quickdraw GX?  
  2115.  
  2116.                     John Nagle
  2117.  
  2118. +++++++++++++++++++++++++++
  2119.  
  2120. >From opstad@apple.com (David Opstad)
  2121. Date: 29 May 1994 22:01:29 -0700
  2122. Organization: Apple Computer Inc, Cupertino, CA
  2123.  
  2124. In article <nagleCqLJsw.MvI@netcom.com>, John Nagle <nagle@netcom.com> wrote:
  2125. >      Well, we now have Quickdraw GX, which is a 2D object-oriented
  2126. >graphics system.  This is nice, but does it solve a real problem?
  2127. >It's not a full 3D system, so you can't use it for 3D graphics.
  2128. >It's not compatible with existing object-oriented graphics standards, 
  2129. >like X or PHIGS.  It's complicated; several volume of manuals are required.
  2130. >Rescalable icons are nice, but Quickdraw GX seems overkill just to
  2131. >achieve that.  What kind of application would be simpler if written to use
  2132. >Quickdraw GX?  
  2133.  
  2134. A word processing or page layout app would be much simpler using GX, since the
  2135. typographic expressiveness built into GX is very great. An application that
  2136. wishes to print to multiple kinds of paper in the same job (portrait and
  2137. landscape, say, or throw in an envelope too) has an easy road using GX printing.
  2138. Printing transfer modes (including to PostScript (TM) printers) that you
  2139. couldn't used to print is now possible with GX. Having pictures that are both
  2140. parsable and able to themselves contain pictures makes for much easier handling
  2141. of whole trees of image data to be rendered. And so on...
  2142.  
  2143. GX definitely isn't just for 2D graphics. Of course, your points about 3D are
  2144. well-taken, but that wasn't the problem that GX was intended to solve. For
  2145. years, developers for apps on the Mac have had to put up with a lot of quirks
  2146. in the way that QuickDraw forced them to deal with device-dependent graphics,
  2147. and with printing that also had its share of strange hackishness. GX finally
  2148. fixes many of these problems.
  2149.  
  2150. Dave Opstad
  2151. GX Line Layout Weenie
  2152.  
  2153. +++++++++++++++++++++++++++
  2154.  
  2155. >From d88-jwa@dront.nada.kth.se (Jon Wdtte)
  2156. Date: 30 May 1994 07:43:14 GMT
  2157. Organization: The Royal Institute of Technology
  2158.  
  2159. In <nagleCqLJsw.MvI@netcom.com> nagle@netcom.com (John Nagle) writes:
  2160.  
  2161. >      Well, we now have Quickdraw GX, which is a 2D object-oriented
  2162. >graphics system.  This is nice, but does it solve a real problem?
  2163.  
  2164. Yes.
  2165.  
  2166. >It's not compatible with existing object-oriented graphics standards, 
  2167. >like X or PHIGS.
  2168.  
  2169. 1) X is not object oriented; it's QuickDraw where the bottlenecks
  2170.    go through a network driver.
  2171. 2) PHIGS is a 3D library.
  2172.  
  2173. >It's complicated; several volume of manuals are required.
  2174.  
  2175. Would you rahter it was less capable? The documentation for QDGX is
  2176. quite good to my meaning, what's missing is a lot of sample code (there
  2177. is some at least) and support in our frameworks of choise.
  2178.  
  2179. >Rescalable icons are nice, but Quickdraw GX seems overkill just to
  2180. >achieve that.  What kind of application would be simpler if written to use
  2181. >Quickdraw GX?  
  2182.  
  2183. QuickDraw GX printing is not a, but SEVERAL steps up, and re-defines
  2184. desktop printing. It shoots Apple ahead of the competition.
  2185.  
  2186. The GX imaging model has several things going for it, both in simplicity
  2187. and capability. You can write a capable draw program with much less effort
  2188. than before. You can expect to see shareware programs going after the
  2189. Illustrator and FreeHand crowd!
  2190.  
  2191. It's also _much_more_capable_ with ligatures, special forms and kerning
  2192. handled automatically, as well as providing very good typographic control
  2193. ("Gunk" and "Funk" axes, anyone? :-)
  2194.  
  2195. If you can't see the use of this to create more beautiful documents,
  2196. you're positioned where one-font-only people were in the middle of
  2197. the 80s.
  2198.  
  2199. Cheers,
  2200.  
  2201.                     / h+
  2202. -- 
  2203.  -- Jon W{tte, h+@nada.kth.se, Mac Software Engineer Deluxe --
  2204.  Engineering: "How will this work?" Science: "Why will this work?" Management:
  2205.  "When will this work?"  Liberal Arts: "Do you want fries with that?"
  2206.                      -- Jesse N. Schell
  2207.  
  2208. +++++++++++++++++++++++++++
  2209.  
  2210. >From dank@alumni.caltech.edu (Daniel R. Kegel)
  2211. Date: 30 May 1994 07:55:28 GMT
  2212. Organization: California Institute of Technology, Pasadena
  2213.  
  2214. In article <nagleCqLJsw.MvI@netcom.com>, John Nagle <nagle@netcom.com> wrote:
  2215. >      Well, we now have Quickdraw GX, which is a 2D object-oriented
  2216. >graphics system.  This is nice, but does it solve a real problem?
  2217.  
  2218. Quickdraw GX supports Unicode, which means that software
  2219. will be easier to internationalize.  Although the application developer
  2220. still needs to worry about different character sets when talking to
  2221. the outside world, inside everything can be Unicode.  This makes document
  2222. exchange and maintenance easier in a multilingual environment.
  2223. - Dan
  2224.  
  2225. +++++++++++++++++++++++++++
  2226.  
  2227. >From peirce@outpost.SF-Bay.org (Michael Peirce)
  2228. Date: Mon, 30 May 94 09:58:47 PST
  2229. Organization: Peirce Software, Inc.
  2230.  
  2231.  
  2232. In article <nagleCqLJsw.MvI@netcom.com> (comp.sys.mac.programmer), nagle@netcom.com (John Nagle) writes:
  2233. >       Well, we now have Quickdraw GX, which is a 2D object-oriented
  2234. > graphics system.  This is nice, but does it solve a real problem?
  2235. > It's not a full 3D system, so you can't use it for 3D graphics.
  2236. > It's not compatible with existing object-oriented graphics standards, 
  2237. > like X or PHIGS.  It's complicated; several volume of manuals are required.
  2238. > Rescalable icons are nice, but Quickdraw GX seems overkill just to
  2239. > achieve that.  What kind of application would be simpler if written to use
  2240. > Quickdraw GX?  
  2241.  
  2242. For me the two most important parts of QuickDraw GX aren't specific
  2243. to it's graphics engine: Typography and Printing.
  2244.  
  2245. QuickDraw GX typography brings truly great type handling to "normal"
  2246. programs with the line layout manager.  No longer will this be limited
  2247. to page layout programs.  Related is the new font technology: support
  2248. for TrueType GX and Type 1 multi master fonts.  These fonts allow
  2249. for smarts to be put directly into the font to do things that wasn't
  2250. possible before.
  2251.  
  2252. QuickDraw GX printing finally remakes the printing user interface.
  2253. Switching printers at print dialog time, desktop printers that allow
  2254. users to move a print job from one printer to another, and much better
  2255. support for paper types are just three examples of making the printing
  2256. experience for the user much simplier, yet more powerful.
  2257.  
  2258. Another key benefit for users is that GX pictures don't have any of
  2259. the horrible 72-dpi problems that you run into with PICTs.  And Portable
  2260. Digital Documents extend this idea so that a user can create a PPD
  2261. and not wworry about not having the right font if they try to print
  2262. or view it on another system.
  2263.  
  2264. I could go on, but you get my drift.
  2265.  
  2266. __ Michael Peirce        __ peirce@outpost.sf-bay.org
  2267. __ Peirce Software, Inc. __ 719 Hibiscus Place, Suite 301
  2268. __                       __ San Jose, California USA 95117-1844
  2269. __ Makers of: Smoothie & __ voice: +1.408.244.6554 fax: +1.408.244.6882
  2270. __    Peirce Print Tools __ AppleLink: peirce & AOL: AFC Peirce
  2271.  
  2272. +++++++++++++++++++++++++++
  2273.  
  2274. >From usenet@lowry.eche.ualberta.ca (Brian Lowry)
  2275. Date: 30 May 1994 21:05:13 GMT
  2276. Organization: Dept. of Chemical Eng., University of Alberta
  2277.  
  2278. In article <nagleCqLJsw.MvI@netcom.com>, nagle@netcom.com (John Nagle)
  2279. wrote:
  2280.  
  2281. >       Well, we now have Quickdraw GX, which is a 2D object-oriented
  2282. > graphics system.  This is nice, but does it solve a real problem?
  2283.  
  2284.   Yes, by expressing coordinates as fixed point numbers instead of
  2285. integers.  That alone is enough to recommend it.
  2286.  
  2287. -- 
  2288.  
  2289. Brian Lowry
  2290.  
  2291. +++++++++++++++++++++++++++
  2292.  
  2293. >From AppleGG@lamg.com (Gordon Apple)
  2294. Date: 30 May 1994 21:54:19 -0000
  2295. Organization: Los Angeles Macintosh Group BBS
  2296.  
  2297. > Yes, by expressing coordinates as fixed point numbers instead of
  2298. >integers.  That alone is enough to recommend it.
  2299.  
  2300.  
  2301.      I think it's ironic that Quickdraw GX went to such lengths (i.e.,
  2302. "Fixed" format) to avoid floating point operations, and is being released
  2303. almost simultaneously with the switch to PowerPC processors that run blazing
  2304. fast floating point that would have been faster than using "Fixed".
  2305.  
  2306. +++++++++++++++++++++++++++
  2307.  
  2308. >From dowdy@apple.com (Tom Dowdy)
  2309. Date: Tue, 31 May 1994 17:06:52 GMT
  2310. Organization: Apple Computer, Inc.
  2311.  
  2312. In article <CNjbKKKX.0uqam3@outpost.SF-Bay.org>, peirce@outpost.SF-Bay.org
  2313. (Michael Peirce) wrote:
  2314.  
  2315. > In article <nagleCqLJsw.MvI@netcom.com> (comp.sys.mac.programmer), nagle@netcom.com (John Nagle) writes:
  2316. > >       Well, we now have Quickdraw GX, which is a 2D object-oriented
  2317. > > graphics system.  This is nice, but does it solve a real problem?
  2318. > > It's not a full 3D system, so you can't use it for 3D graphics.
  2319. > > It's not compatible with existing object-oriented graphics standards, 
  2320. > > like X or PHIGS.  It's complicated; several volume of manuals are required.
  2321. > > Rescalable icons are nice, but Quickdraw GX seems overkill just to
  2322. > > achieve that.  What kind of application would be simpler if written to use
  2323. > > Quickdraw GX?  
  2324. > For me the two most important parts of QuickDraw GX aren't specific
  2325. > to it's graphics engine: Typography and Printing.
  2326.  
  2327. Michael mentions several nice things about these two areas, and
  2328. one nice thing about graphics (the no-72 dpi picture thingie).
  2329.  
  2330. I'd like to mention several other "nice graphics thingies" just
  2331. to give that part of GX even time.
  2332.  
  2333.  - rotation of all objects (everyone asks, so I call it out)
  2334.  
  2335.  - 3X3 transformation matricies (including perspective)
  2336.  
  2337.  - area, length, and other geometric information routines
  2338.  
  2339.  - full geometry engine, letting you hit test, subdivide, and
  2340.    intersect (via any boolean operator that makes sense) any two
  2341.    shapes and get a device-independant GEOMETRY out the other side.
  2342.    No other general purpose graphics system has this, and it lets you
  2343.    do some excellent things, such as creating shapes from other
  2344.    shapes in a drawing package.  (I personally think this area
  2345.    is very exciting, as I'd love to be able to SUBTRACT from
  2346.    one shape to create masks and such).
  2347.  
  2348.  - VERY powerful transfer mode functionality (and it all prints to
  2349.    everything, including PostScript).
  2350.  
  2351.  - device and space independant color, allowing you to create
  2352.    objects in any color space you feel comfortable with, and have
  2353.    the graphics system worry about the translation
  2354.  
  2355.  - curves
  2356.  
  2357.  - shape tagging, which lets you attach information or hints
  2358.    that are of use to either you or the system to shapes and pictures.
  2359.    (and also lets us extend GX in the future without the need to
  2360.    rev existing applications)
  2361.  
  2362.  - pictures can be "walked" or edited without the need to replay them
  2363.    to do so.
  2364.  
  2365. GX is lots of books.  But the API is really well thought out, and
  2366. once you start using it, you'll find that most API calls make sense
  2367. and you can figure them out by "guessing" the name.  
  2368.  
  2369. ob funny: when the PrintShop first started working with the GX graphics
  2370. system, we liked to "make up" fake API calls by combining the logical
  2371. flow of the API into nonsense API calls that sounded useful:
  2372.  GXGetTransformViewPortMappingStyle()
  2373.  GXSetMappingInk()
  2374.  
  2375.  
  2376. -- 
  2377.  Tom Dowdy                  Internet: dowdy@apple.COM
  2378.  Apple Computer MS:302-3KS  UUCP: {sun,voder,amdahl,decwrl}!apple!dowdy
  2379.  1 Infinite Loop            AppleLink: DOWDY1
  2380.  Cupertino, CA 95014       
  2381.  "The 'Ooh-Ah' Bird is so called because it lays square eggs."
  2382.  
  2383. +++++++++++++++++++++++++++
  2384.  
  2385. >From dowdy@apple.com (Tom Dowdy)
  2386. Date: Tue, 31 May 1994 17:11:45 GMT
  2387. Organization: Apple Computer, Inc.
  2388.  
  2389. In article <2sbrv9$t5f@apple.com>, opstad@apple.com (David Opstad) wrote:
  2390.  
  2391. > In article <nagleCqLJsw.MvI@netcom.com>, John Nagle <nagle@netcom.com> wrote:
  2392. > >      Well, we now have Quickdraw GX, which is a 2D object-oriented
  2393. > >graphics system.  This is nice, but does it solve a real problem?
  2394. > >It's not a full 3D system, so you can't use it for 3D graphics.
  2395. > >It's not compatible with existing object-oriented graphics standards, 
  2396. > >like X or PHIGS.  It's complicated; several volume of manuals are required.
  2397. > >Rescalable icons are nice, but Quickdraw GX seems overkill just to
  2398. > >achieve that.  What kind of application would be simpler if written to use
  2399. > >Quickdraw GX?  
  2400. > A word processing or page layout app would be much simpler using GX, since the
  2401. > typographic expressiveness built into GX is very great. 
  2402.  
  2403. One thing Dave didn't mention is that at the WWDC during the type
  2404. demo we showed a sample application using GX and its rich text to create
  2405. page layouts.  The application does multiple collumns, wraps text
  2406. around objects (using the cool GX geometry engine), and flows across
  2407. multiple pages.  It prints (and we've used to it to create some
  2408. cool party invites here!), saves, and can handle custom page setups
  2409. (doesn't yet do multiple formats).
  2410.  
  2411. Except for all of the "app stuff" like clipboard, typing,
  2412. cut and paste, undo, etc -- it's pretty much fully functional.
  2413.  
  2414. It's 50K of compiled code.  Something I think is quite impressive --
  2415. and the savings comes from thinking in a GX world where the system
  2416. handles more of the work for you.
  2417.  
  2418. -- 
  2419.  Tom Dowdy                  Internet: dowdy@apple.COM
  2420.  Apple Computer MS:302-3KS  UUCP: {sun,voder,amdahl,decwrl}!apple!dowdy
  2421.  1 Infinite Loop            AppleLink: DOWDY1
  2422.  Cupertino, CA 95014       
  2423.  "The 'Ooh-Ah' Bird is so called because it lays square eggs."
  2424.  
  2425. +++++++++++++++++++++++++++
  2426.  
  2427. >From jwbaxter@olympus.net (John W. Baxter)
  2428. Date: Tue, 31 May 1994 13:02:27 -0700
  2429. Organization: Internet for the Olympic Peninsula
  2430.  
  2431. In article <dowdy-310594095217@17.202.68.12>, dowdy@apple.com (Tom Dowdy)
  2432. wrote:
  2433.  
  2434. > GX is lots of [Inside Macintosh} books.  But the API is really well thought
  2435. > out, and
  2436. > once you start using it, you'll find that most API calls make sense
  2437. > and you can figure them out by "guessing" the name.  
  2438.  
  2439. Tom...I fully agree.  You and friends did very well.
  2440.  
  2441. -- 
  2442. John Baxter    Port Ludlow, WA, USA  [West shore, Puget Sound]
  2443.    jwbaxter@pt.olympus.net
  2444.  
  2445. +++++++++++++++++++++++++++
  2446.  
  2447. >From Jens Alfke <jens_alfke@powertalk.apple.com>
  2448. Date: Tue, 31 May 1994 22:00:32 GMT
  2449. Organization: Apple Computer
  2450.  
  2451. John Nagle, nagle@netcom.com writes:
  2452. > What kind of application would be simpler if written to use
  2453. > Quickdraw GX?  
  2454.  
  2455. Any kind of illustration program a la Illustrator or FreeHand or Canvas. GX
  2456. makes it very easy to write such programs, since it does so much work for
  2457. you: not only does it support powerful graphics primitives like quadric
  2458. Beziers, fancy options like dashes and joins, and really sophisticated color
  2459. models, but it also makes it very easy to manipulate these objects.
  2460. Hit-testing any GX objects (including type) is mostly just a matter of one
  2461. call.
  2462.  
  2463. Whether the big guns like Aldubeus or Deneba will move over to GX is unclear;
  2464. after all, they've already got code to do most of this stuff. But remember
  2465. how after 32-bit QuickDraw appeared we started to get some good color paint
  2466. programs from smaller developers that were cheap and reasonably powerful for
  2467. mere mortals? That's because 32BQD made it so much easier to do offscreen
  2468. color graphics. I think GX will have the same effect on illustration and
  2469. typography software, since it makes it possible to do very powerful
  2470. PostScript-style (and more!) graphics without requiring you to write your own
  2471. rendering engine for display or build custom PostScript code for printing.
  2472.  
  2473. --Jens Alfke
  2474.   jens_alfke@powertalk              Rebel girl, rebel girl,
  2475.             .apple.com              Rebel girl you are the queen of my world
  2476.  
  2477. +++++++++++++++++++++++++++
  2478.  
  2479. >From 103t_english@west.cscwc.pima.edu
  2480. Date: 31 May 94 15:53:49 MST
  2481. Organization: (none)
  2482.  
  2483. In article <dowdy-310594100526@17.202.68.12>, dowdy@apple.com (Tom Dowdy) writes:
  2484. > One thing Dave didn't mention is that at the WWDC during the type
  2485. > demo we showed a sample application using GX and its rich text to create
  2486. > page layouts.  The application does multiple collumns, wraps text
  2487. > around objects (using the cool GX geometry engine), and flows across
  2488. > multiple pages.  It prints (and we've used to it to create some
  2489. > cool party invites here!), saves, and can handle custom page setups
  2490. > (doesn't yet do multiple formats).
  2491. > Except for all of the "app stuff" like clipboard, typing,
  2492. > cut and paste, undo, etc -- it's pretty much fully functional.
  2493. > It's 50K of compiled code.  Something I think is quite impressive --
  2494. > and the savings comes from thinking in a GX world where the system
  2495. > handles more of the work for you.
  2496.  
  2497. Is it available as sample source code or will it be?
  2498.  
  2499.  
  2500. Lawson
  2501.  
  2502. +++++++++++++++++++++++++++
  2503.  
  2504. >From 103t_english@west.cscwc.pima.edu
  2505. Date: 31 May 94 21:14:40 MST
  2506. Organization: (none)
  2507.  
  2508. In article <1994May31.220032.15476@gallant.apple.com>, Jens Alfke <jens_alfke@powertalk.apple.com> writes:
  2509. > John Nagle, nagle@netcom.com writes:
  2510. >> What kind of application would be simpler if written to use
  2511. >> Quickdraw GX?  
  2512. [snip]
  2513.  
  2514. > Whether the big guns like Aldubeus or Deneba will move over to GX is unclear;
  2515. > after all, they've already got code to do most of this stuff. But remember
  2516. > how after 32-bit QuickDraw appeared we started to get some good color paint
  2517. > programs from smaller developers that were cheap and reasonably powerful for
  2518. > mere mortals? That's because 32BQD made it so much easier to do offscreen
  2519. > color graphics. I think GX will have the same effect on illustration and
  2520. > typography software, since it makes it possible to do very powerful
  2521. > PostScript-style (and more!) graphics without requiring you to write your own
  2522. > rendering engine for display or build custom PostScript code for printing.
  2523. >     
  2524.  
  2525. I think that eventually even games will start making use of GX once it becomes
  2526. a standard on enough machines...
  2527.  
  2528. Will GX ship with 7.5 or later?
  2529.  
  2530.  
  2531.  
  2532. Lawson
  2533.  
  2534. +++++++++++++++++++++++++++
  2535.  
  2536. >From dank@alumni.caltech.edu (Daniel R. Kegel)
  2537. Date: 1 Jun 1994 05:45:46 GMT
  2538. Organization: California Institute of Technology, Pasadena
  2539.  
  2540. 103t_english@west.cscwc.pima.edu writes:
  2541. >I think that eventually even games will start making use of GX once it becomes
  2542. >a standard on enough machines...
  2543. Roger on that one.
  2544.  
  2545. >Will GX ship with 7.5 or later?
  2546. I hear it will ship with 7.5, but my info is a couple months old.
  2547.  
  2548. -Dan
  2549.  
  2550. +++++++++++++++++++++++++++
  2551.  
  2552. >From pd@world.std.com (Peter F Davis)
  2553. Date: Wed, 1 Jun 1994 14:24:02 GMT
  2554. Organization: The World @ Software Tool & Die
  2555.  
  2556. dowdy@apple.com (Tom Dowdy) writes:
  2557.     .
  2558.     .
  2559.     .
  2560.  
  2561. >I'd like to mention several other "nice graphics thingies" just
  2562. >to give that part of GX even time.
  2563.     .
  2564.     .
  2565.     .
  2566.  
  2567. > - curves
  2568.  
  2569. Actually, this is one of the things that really frustrates me about
  2570. GX.  Everyone else is using cubics.  Why did GX go with quadrics?
  2571.  
  2572. -pd
  2573. -- 
  2574. ===============================================================================
  2575.                 Peter Davis
  2576.  
  2577.          "Standardization is the opposite of innovation."
  2578.  
  2579. +++++++++++++++++++++++++++
  2580.  
  2581. >From Jens Alfke <jens_alfke@powertalk.apple.com>
  2582. Date: Wed, 1 Jun 1994 21:30:07 GMT
  2583. Organization: Apple Computer
  2584.  
  2585. Peter F Davis, pd@world.std.com writes:
  2586. > Actually, this is one of the things that really frustrates me about
  2587. > GX.  Everyone else is using cubics.  Why did GX go with quadrics?
  2588.  
  2589. (1) Quadrics are a lot faster to render, and to perform other operations on
  2590. (like intersection.)
  2591.  
  2592. (2) Cubics are mathematically intractable under some geometric operations.
  2593. For example, insetting or outsetting a shape made of cubics would result in
  2594. curves of degree 6; whereas insetting or outsetting quadrics just results in
  2595. new quadrics. This kind of ability is absolutely fundamental to GX's geometry
  2596. engine, where you can apply any kind of geometric operation to a shape and
  2597. end up with another shape. Note that in PostScript you cannot do this, which
  2598. makes some kinds of operations insanely difficult or impossible. (I once
  2599. worked at a font company and we wanted to apply operations like insetting or
  2600. outsetting to character outlines. What we had to do to implement this in
  2601. PostScript would curl your hair, and it didn't even work that well. With GX
  2602. it would have been trivial.)
  2603.  
  2604. (3) In practice, for drawing, quadrics are nearly as powerful as cubics. Most
  2605. of the kinds of shapes people actually draw in illustration programs can be
  2606. rendered with only a few more quadrics than you'd need cubics for. It turns
  2607. out the kind of cubics that _are_ really difficult to approximate as quadrics
  2608. are the really twisty, loopy ones that people learn very quickly not to use
  2609. in drawing.
  2610.  
  2611. Disclaimer: I don't work on GX. Most of this is based on what I've learned
  2612. over the years or have been told by people on the GX team.
  2613.  
  2614. --Jens Alfke
  2615.   jens_alfke@powertalk              Rebel girl, rebel girl,
  2616.             .apple.com              Rebel girl you are the queen of my world
  2617.  
  2618. +++++++++++++++++++++++++++
  2619.  
  2620. >From ldo@waikato.ac.nz (Lawrence D'Oliveiro, Waikato University)
  2621. Date: 2 Jun 94 17:27:53 +1200
  2622. Organization: University of Waikato, Hamilton, New Zealand
  2623.  
  2624. In article <nagleCqLJsw.MvI@netcom.com>, nagle@netcom.com (John Nagle) writes:
  2625. >       Well, we now have Quickdraw GX, which is a 2D object-oriented
  2626. > graphics system.  This is nice, but does it solve a real problem?
  2627.  
  2628. Absobloodylutely!
  2629.  
  2630. > It's not a full 3D system, so you can't use it for 3D graphics.
  2631. > It's not compatible with existing object-oriented graphics standards,
  2632. > like X or PHIGS.
  2633.  
  2634. I notice you didn't say "not compatible with existing _widespread_ object-
  2635. oriented graphics standards"...
  2636.  
  2637. >  It's complicated; several volume of manuals are required.
  2638.  
  2639. No it isn't! Add up all the volumes of QuickDraw and Printing Manager
  2640. documentation, including all the tech notes on printing hacks and the like.
  2641. Compare that to the size of the QuickDraw GX documentation. Now compare the
  2642. respective functionality you get. The GX API is a model of simplicity,
  2643. compared to all the accretions to QuickDraw that have accumulated over the
  2644. years.
  2645.  
  2646. > Rescalable icons are nice, but Quickdraw GX seems overkill just to
  2647. > achieve that.  What kind of application would be simpler if written to use
  2648. > Quickdraw GX?
  2649.  
  2650. ALL OF THEM!!! Other people have mentioned the typography and printing support.
  2651. Perhaps you aren't clear how much functionality GX gives you: In the
  2652. typography, you get much cleaner multilingual support than old QuickDraw is
  2653. capable of; contextual and alternate character forms; font variations
  2654. (what Adobe calls "multiple masters"); and automatic justification and kerning.
  2655.  
  2656. In the printing support, you get: anything you can draw, you can print! And
  2657. this applies to both PostScript and non-PostScript printers. You realize how
  2658. much of a breakthrough this is? All those times people have torn out their hair
  2659. over things coming out different on the printer compared to how they look on
  2660. the screen--all that goes away! And you get printer sharing and background
  2661. printing for *all* printers. And it is easier for third parties to develop
  2662. printer drivers. And it is easier still for other third parties to write
  2663. extensions that hook into the printing process in all kinds of useful ways
  2664. (such as Michael Peirce's "Peirce Print Tools").
  2665.  
  2666. And the graphics is pretty cool, too.
  2667.  
  2668. Look at it this way: when the original Macintosh came out in 1984, a lot of
  2669. people wondered why they would need the graphics and the text-graphics
  2670. integration, to do things that they were happily doing on typewriter-like
  2671. systems before. Nobody seriously asks that question any more. GX will similarly
  2672. raise people's expectations of what basic text and graphics handling is all
  2673. about.
  2674.  
  2675. The coming of the typewriter was a giant step backwards for the printed word,
  2676. and computers have only made things worse. The original Mac went a long way to
  2677. countering a lot of the pervasiveness of that "typewriter mentality". But with
  2678. QuickDraw GX, we can finally say that the computer is capable of enriching,
  2679. rather than retarding, the development of all that is best in typography, and
  2680. that the ghost of the typewriter has been well and truly laid to rest.
  2681. Long live type!
  2682.  
  2683. Lawrence D'Oliveiro                       fone: +64-7-856-2889
  2684. Info & Tech Services Division              fax: +64-7-838-4066
  2685. University of Waikato            electric mail: ldo@waikato.ac.nz
  2686. Hamilton, New Zealand    37^ 47' 26" S, 175^ 19' 7" E, GMT+12:00
  2687. A: OS/2 2.1, CD-i, and the Commodore Amiga.
  2688. Q: Name 3 products which have outsold Windows NT.
  2689.  
  2690. +++++++++++++++++++++++++++
  2691.  
  2692. >From ldo@waikato.ac.nz (Lawrence D'Oliveiro, Waikato University)
  2693. Date: 3 Jun 94 11:05:01 +1200
  2694. Organization: University of Waikato, Hamilton, New Zealand
  2695.  
  2696. In article <nagleCqLJsw.MvI@netcom.com>, nagle@netcom.com (John Nagle) writes:
  2697.  
  2698. > [GX is] complicated; several volume of manuals are required.
  2699.  
  2700. Just to prove that GX is not only powerful for dealing with complex things,
  2701. it's also easy to use for simple things, here's a couple of minimal, _complete_
  2702. demo programs for you to compare. (I compiled and ran both versions with
  2703. THINK C 6, so I know they work.)
  2704.  
  2705. First, the QuickDraw version:
  2706.  
  2707.     #include <QuickDraw.h>
  2708.  
  2709.     void main(void)
  2710.       {
  2711.     GrafPort MyPort;
  2712.  
  2713.     InitGraf(&qd.thePort);
  2714.     OpenPort(&MyPort);
  2715.     MoveTo(100, 100);
  2716.     DrawString("\pHello, World!");
  2717.     ClosePort(&MyPort);
  2718.       } /*main*/
  2719.  
  2720. Next, the QuickDraw GX version:
  2721.  
  2722.     #include <math types.h>
  2723.     #include <math routines.h>
  2724.     #include <graphics routines.h>
  2725.  
  2726.     void main(void)
  2727.       {
  2728.     gxPoint where = {IntToFixed(100), IntToFixed(100)};
  2729.     #define TheText "Hello, World!"
  2730.  
  2731.     GXDrawText(sizeof(TheText), (unsigned char *) TheText, &where);
  2732.       } /*main*/
  2733.  
  2734. Now, what do you think of their relative complexity?
  2735.  
  2736. Lawrence D'Oliveiro                       fone: +64-7-856-2889
  2737. Info & Tech Services Division              fax: +64-7-838-4066
  2738. University of Waikato            electric mail: ldo@waikato.ac.nz
  2739. Hamilton, New Zealand    37^ 47' 26" S, 175^ 19' 7" E, GMT+12:00
  2740. Please do not feed the vegetables.
  2741.  
  2742. +++++++++++++++++++++++++++
  2743.  
  2744. >From peirce@outpost.SF-Bay.org (Michael Peirce)
  2745. Date: Fri, 3 Jun 94 16:09:15 PST
  2746. Organization: Peirce Software, Inc.
  2747.  
  2748.  
  2749. In article <2smvne$mkg@news.kth.se> (comp.sys.mac.programmer), d88-jwa@dront.nada.kth.se (Jon Wdtte) writes:
  2750. > >3. No stupid conversions and typecasting to remember all over the place.
  2751. > Okay, I buy that.
  2752.  
  2753. Personally I blame that on C.  C just doesn't have a "native"
  2754. fixed type with associated operations.
  2755.  
  2756. Also (very minor point) I use the ff() macro rather than the
  2757. IntToFixed() - they are equivalent, but ff is more compact.
  2758.  
  2759. I do wish there was a VALIDATE mode that would yell when it
  2760. started seeing coordinates like 0x00000001 rather than
  2761. 0x00010000.  Such tiny coordinates can't be common or generally
  2762. useful.
  2763.  
  2764. I have gotten into trouble by passing integer coordinates rather
  2765. than fixed coordinates, though they aren't hard bugs to figure
  2766. out.
  2767. ____________
  2768.  
  2769. My only real grip with GX is that the interface is opague.  I
  2770. understand the rational that they might/will change things
  2771. inside at a later date.  That's well and good, but it makes it
  2772. MUCH harder to debug. With old QuickDraw I could root around in
  2773. the debugger and see exactly what my visRegion was set to and
  2774. such.  With GX there is no way to see, for example, what my Ink
  2775. happens to be or my clip shape or whatever.
  2776.  
  2777. They supply GraphicsBug, but it's basically useless for the kind
  2778. of work I do (non-applications).  And it's a pretty aweful
  2779. interface even for app use - it makes Jasik look like an UI
  2780. god. [ 1/2 :-) ]  And it crashes all the time for me.
  2781.  
  2782. What I'd like to see is a way to peer inside.  Make it 100%
  2783. clear that things will change and all that, but allow us to
  2784. debug things in a reasonable way!
  2785.  
  2786. __ Michael Peirce        __ peirce@outpost.sf-bay.org
  2787. __ Peirce Software, Inc. __ 719 Hibiscus Place, Suite 301
  2788. __                       __ San Jose, California USA 95117-1844
  2789. __ Makers of: Smoothie & __ voice: +1.408.244.6554 fax: +1.408.244.6882
  2790. __    Peirce Print Tools __ AppleLink: peirce & AOL: AFC Peirce
  2791.  
  2792. +++++++++++++++++++++++++++
  2793.  
  2794. >From Rick Wong <rick@jessica.stanford.edu>
  2795. Date: 3 Jun 1994 23:06:32 GMT
  2796. Organization: Stanford University
  2797.  
  2798. In article <1994Jun3.093501.1@west.cscwc.pima.edu> ,
  2799. 103t_english@west.cscwc.pima.edu writes:
  2800. >Perhaps the sample source code to draw the same text a dozen times,
  2801. rotated by
  2802. >30 degrees each time in a loop?
  2803. >
  2804. >Takes only a few lines more than simply drawing the text in the first
  2805. place...
  2806. >
  2807. >
  2808. >Lawson
  2809.  
  2810.  
  2811. #include <math types.h>
  2812. #include <math routines.h>
  2813. #include <graphics routines.h>
  2814. #include <string.h>
  2815.  
  2816. #define TheText "GX Rules!"
  2817.  
  2818. void main(void)
  2819. {
  2820.     gxPoint myPoint = {ff(100), ff(100)};
  2821.     gxShape myTextShape = GXNewText(strlen(TheText), TheText, &myPoint);
  2822.     gxTransform myShapeTransform = GXGetShapeTransform(myTextShape);
  2823.     int i;
  2824.     for (i = 0; i < 12; ++i) {
  2825.         GXDrawShape(myTextShape);
  2826.         GXRotateTransform(myShapeTransform, ff(30), myPoint.x, myPoint.y);
  2827.     }
  2828.     GXDisposeShape(myTextShape);
  2829. }
  2830.  
  2831.  
  2832. Any sort of rotation operation (including bitmaps) is trivial with
  2833. QuickDraw GX.  This doesn't even nick the surface of its capabilities.
  2834.  
  2835. I am just starting to read the QD GX docs, and I must say that I am
  2836. quite impressed by the job Apple's done.  Not only is QD GX loaded
  2837. with great new features, the underlying model is indeed well thought
  2838. out, and the APIs are exemplary in their cleanness and consistency.
  2839. I'm going to enjoy forgetting everything I ever learned about PixMaps,
  2840. GDevices, cluts, etc.
  2841.  
  2842.  
  2843. Rick Wong
  2844.  
  2845. +++++++++++++++++++++++++++
  2846.  
  2847. >From sho@bohr.physics.purdue.edu (Sho Kuwamoto)
  2848. Date: 3 Jun 94 17:35:05 GMT
  2849. Organization: Purdue University Physics Department
  2850.  
  2851. ldo@waikato.ac.nz (Lawrence D'Oliveiro, Waikato University) writes:
  2852. >    #include <math types.h>
  2853. >    #include <math routines.h>
  2854. >    #include <graphics routines.h>
  2855. >
  2856. >    void main(void)
  2857. >      {
  2858. >    gxPoint where = {IntToFixed(100), IntToFixed(100)};
  2859. >    #define TheText "Hello, World!"
  2860. >
  2861. >    GXDrawText(sizeof(TheText), (unsigned char *) TheText, &where);
  2862. >      } /*main*/
  2863.  
  2864. One thing I'd like to see is a way to specify fixed point
  2865. constants from within the mac C compilers.  What?  Did I
  2866. hear you cry, "nonstandard"?  Well, what about four byte
  2867. chars (e.g., 'APPL')?  How standard are they?
  2868.  
  2869. I imagine being able to type 100F to represent a fixed point
  2870. 100 in much the same way that one types 100L to represent a
  2871. long int 100.  I realize it's grossly nonstandard, but
  2872. wouldn't it make GX so much easier?
  2873.  
  2874. -Sho
  2875. --
  2876. sho@physics.purdue.edu <<-- finger this account to find out what I'm
  2877.                             having for lunch!
  2878.  
  2879. <A HREF="http://physics.purdue.edu/~sho/homepage.html">Sho Kuwamoto</A>.
  2880.  
  2881. +++++++++++++++++++++++++++
  2882.  
  2883. >From blm@coho.halcyon.com (Brian L. Matthews)
  2884. Date: 4 Jun 1994 01:06:33 GMT
  2885. Organization: A World of Information at Your Fingertips
  2886.  
  2887. In article <16887@dirac.physics.purdue.edu>,
  2888. Sho Kuwamoto <sho@bohr.physics.purdue.edu> wrote:
  2889. |>    gxPoint where = {IntToFixed(100), IntToFixed(100)};
  2890. |
  2891. |One thing I'd like to see is a way to specify fixed point
  2892. |constants from within the mac C compilers.
  2893.  
  2894. Well, if you're willing to switch to C++, it would be fairly easy to
  2895. make some classes so you could just say:
  2896.  
  2897.     gxPoint where = { 100, 100 };
  2898.  
  2899. and the compiler (with the help of some classes you write) would do the
  2900. right thing.
  2901.  
  2902. One could also be clever and make it so:
  2903.  
  2904.     gxPoint where = { 10.53, 9.47 };
  2905.  
  2906. also does (usually) the right thing.  And all without modifying the language.
  2907.  
  2908. This would also fix problems with accidentally passing an int where Fixed
  2909. was expected.  With proper declarations, such a thing wouldn't be possible
  2910. (well, wouldn't be easy.  Anything's possible in C :-)).
  2911.  
  2912. Brian
  2913.  
  2914. +++++++++++++++++++++++++++
  2915.  
  2916. >From nagle@netcom.com (John Nagle)
  2917. Date: Sat, 4 Jun 1994 06:02:23 GMT
  2918. Organization: NETCOM On-line Communication Services (408 261-4700 guest)
  2919.  
  2920. sho@bohr.physics.purdue.edu (Sho Kuwamoto) writes:
  2921. >One thing I'd like to see is a way to specify fixed point
  2922. >constants from within the mac C compilers.  What?  Did I
  2923. >hear you cry, "nonstandard"?  Well, what about four byte
  2924. >chars (e.g., 'APPL')?  How standard are they?
  2925.  
  2926.       Actually, multicharacter constants are standard C and C++, although
  2927. they are a recent addition to the language.
  2928.  
  2929. >I imagine being able to type 100F to represent a fixed point
  2930. >100 in much the same way that one types 100L to represent a
  2931. >long int 100.  I realize it's grossly nonstandard, but
  2932. >wouldn't it make GX so much easier?
  2933.  
  2934.       Why build it into the language?  Just add the new type.
  2935.  
  2936.      class QDfixed {
  2937.     long fval;
  2938.      public:
  2939.     QDfixed(int intval) { fval = intval * int_scale_factor; }
  2940.     QDfixed(QDfixed fixedval) { fval = fixedval.fval; }
  2941.     QDfixed(int intval, int fractpart) { fval = intval * int_scale_factor
  2942.                     + fractpart; }
  2943.         ....
  2944.      }
  2945.  
  2946. You get the idea.
  2947. Of course, because the Mac interface is still defined in terms of C, not
  2948. C++, the standard headers won't support this properly, but that could be
  2949. fixed with some glue routines expressed as inlines.
  2950.  
  2951.                     John Nagle
  2952.  
  2953. +++++++++++++++++++++++++++
  2954.  
  2955. >From marke@infi.net (Mark Eaton)
  2956. Date: 4 Jun 1994 18:06:09 GMT
  2957. Organization: InfiNet
  2958.  
  2959. Ralph Martin (Ralph.Martin@cm.cf.ac.uk) wrote:
  2960. : In article <1994Jun3.110501.29244@waikato.ac.nz> Lawrence D'Oliveiro,
  2961. : ldo@waikato.ac.nz writes:
  2962. : >Next, the QuickDraw GX version:
  2963. : >
  2964. : >    #include <math types.h>
  2965. : >    #include <math routines.h>
  2966. : >    #include <graphics routines.h>
  2967. : >
  2968. : >    void main(void)
  2969. : >      {
  2970. : >    gxPoint where = {IntToFixed(100), IntToFixed(100)};
  2971. : >    #define TheText "Hello, World!"
  2972. : >
  2973. : >    GXDrawText(sizeof(TheText), (unsigned char *) TheText, &where);
  2974. : >      } /*main*/
  2975. : >
  2976. : >Now, what do you think of their relative complexity?
  2977.  
  2978. : It's not obvious:
  2979.  
  2980. : Good points for Quickdraw:
  2981. : 1. Less headers.
  2982.  
  2983. I wonder if compiler providers like Symantec and MetroWerks will come up
  2984. with a unified header for GX that includes the necessary headers... Its just
  2985. a matter of time.
  2986.  
  2987. : 2. Functionality divided into smaller chunks (what to draw, where to draw
  2988. : separate).
  2989.  
  2990. Yes, but now we arent restricted to one 'pen'. We can have any number of
  2991. points without having to call move and moveto constantly. I think the new
  2992. way is better.
  2993.  
  2994. : 3. No stupid conversions and typecasting to remember all over the place.
  2995.  
  2996. : Good points for Quickdraw GX:
  2997. : 4. No rubbish concerning initialising and setting up ports.
  2998.  
  2999. : Overall - the Quickdraw is easier to read, and looks more maintainable
  3000. : and less error prone because of point 3. It is probably easier to write
  3001. : given point 2, as the programmer has to concentrate on less things at
  3002. : once.
  3003.  
  3004. Had he used unsigned char* theText = "Hello World"; he wouldnt have needed a
  3005. cast. He used a numdefine instead... It was a programmer choice...
  3006.  
  3007. : Seriously, you are probably right about QuickDraw GX having a better
  3008. : model underlying it. I'm not so sure that the realisation of that model
  3009. : into an API is a great leap forward though. Perhaps longer examples would
  3010. : be more convincing!
  3011.  
  3012. : Ralph
  3013.  
  3014. --
  3015.  
  3016. -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  3017. Mark Eaton          | MacXPerts - Custom Mac and Newton Software
  3018. marke@infi.net      | 3228L W. Cary St.
  3019.                     | Richmond, VA. 23221
  3020.             | (804) 353-7122     FAX: (804) 358-3847
  3021.  
  3022. +++++++++++++++++++++++++++
  3023.  
  3024. >From marke@infi.net (Mark Eaton)
  3025. Date: 4 Jun 1994 18:11:20 GMT
  3026. Organization: InfiNet
  3027.  
  3028. Rick Wong (rick@jessica.stanford.edu) wrote:
  3029. : #define TheText "GX Rules!"
  3030.  
  3031. : void main(void)
  3032. : {
  3033. :     gxPoint myPoint = {ff(100), ff(100)};
  3034. :     gxShape myTextShape = GXNewText(strlen(TheText), TheText, &myPoint);
  3035.  
  3036. Its interesting that GX uses shapes and converts text to shapes. This is
  3037. very much like the Newton form of QuickDraw. Did some of the engineers work
  3038. on both, or is this just coincidence?
  3039.  
  3040. :     gxTransform myShapeTransform = GXGetShapeTransform(myTextShape);
  3041. :     int i;
  3042. :     for (i = 0; i < 12; ++i) {
  3043. :         GXDrawShape(myTextShape);
  3044. :         GXRotateTransform(myShapeTransform, ff(30), myPoint.x, myPoint.y);
  3045. :     }
  3046. :     GXDisposeShape(myTextShape);
  3047. : }
  3048.  
  3049.  
  3050. : Any sort of rotation operation (including bitmaps) is trivial with
  3051. : QuickDraw GX.  This doesn't even nick the surface of its capabilities.
  3052.  
  3053. : I am just starting to read the QD GX docs, and I must say that I am
  3054. : quite impressed by the job Apple's done.  Not only is QD GX loaded
  3055. : with great new features, the underlying model is indeed well thought
  3056. : out, and the APIs are exemplary in their cleanness and consistency.
  3057. : I'm going to enjoy forgetting everything I ever learned about PixMaps,
  3058. : GDevices, cluts, etc.
  3059.  
  3060. Much agreed!
  3061.  
  3062. : Rick Wong
  3063.  
  3064. --
  3065.  
  3066. -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  3067. Mark Eaton          | MacXPerts - Custom Mac and Newton Software
  3068. marke@infi.net      | 3228L W. Cary St.
  3069.                     | Richmond, VA. 23221
  3070.             | (804) 353-7122     FAX: (804) 358-3847
  3071.  
  3072. +++++++++++++++++++++++++++
  3073.  
  3074. >From ldo@waikato.ac.nz (Lawrence D'Oliveiro, Waikato University)
  3075. Date: 7 Jun 94 11:41:28 +1200
  3076. Organization: University of Waikato, Hamilton, New Zealand
  3077.  
  3078. In article <2sqfqh$l0r@lucy.infi.net>, marke@infi.net (Mark Eaton) writes:
  3079. >
  3080. > Had he used unsigned char* theText = "Hello World"; he wouldnt have needed a
  3081. > cast. He used a numdefine instead... It was a programmer choice...
  3082.  
  3083. Actually, it was my ignorance of C showing. :-}
  3084.  
  3085. Seriously, though, if unsigned char* theText = "Hello World" compiles without
  3086. needing a cast, while I needed a cast to pass the exact same literal to an
  3087. unsigned char* argument, isn't that an inconsisten-C?
  3088.  
  3089. Lawrence D'Oliveiro                       fone: +64-7-856-2889
  3090. Info & Tech Services Division              fax: +64-7-838-4066
  3091. University of Waikato            electric mail: ldo@waikato.ac.nz
  3092. Hamilton, New Zealand    37^ 47' 26" S, 175^ 19' 7" E, GMT+12:00
  3093.  
  3094. +++++++++++++++++++++++++++
  3095.  
  3096. >From ldo@waikato.ac.nz (Lawrence D'Oliveiro, Waikato University)
  3097. Date: 7 Jun 94 11:46:51 +1200
  3098. Organization: University of Waikato, Hamilton, New Zealand
  3099.  
  3100. In article <CNjbKKKX.1a1ha8@outpost.SF-Bay.org>, peirce@outpost.SF-Bay.org (Michael Peirce) writes:
  3101. >
  3102. > Also (very minor point) I use the ff() macro rather than the
  3103. > IntToFixed() - they are equivalent, but ff is more compact.
  3104.  
  3105. I deliberately used IntToFixed to try to make it clearer what was going on.
  3106.  
  3107. > What I'd like to see is a way to peer inside.  Make it 100%
  3108. > clear that things will change and all that, but allow us to
  3109. > debug things in a reasonable way!
  3110.  
  3111. There are some GX functions that provide such an escape, eg GXGetShapeStructure.
  3112. If you have a look at the source of SlideMaster that came with the beta 1
  3113. distribution, you can see an example of this in use (it makes a big difference
  3114. to the speed of the "Particles" animation!).
  3115.  
  3116. All you need is some documentation on how to use this, or, failing that, some
  3117. time spent poking around for yourself...
  3118.  
  3119. Lawrence D'Oliveiro                       fone: +64-7-856-2889
  3120. Info & Tech Services Division              fax: +64-7-838-4066
  3121. University of Waikato            electric mail: ldo@waikato.ac.nz
  3122. Hamilton, New Zealand    37^ 47' 26" S, 175^ 19' 7" E, GMT+12:00
  3123.  
  3124. +++++++++++++++++++++++++++
  3125.  
  3126. >From ldo@waikato.ac.nz (Lawrence D'Oliveiro, Waikato University)
  3127. Date: 7 Jun 94 12:02:22 +1200
  3128. Organization: University of Waikato, Hamilton, New Zealand
  3129.  
  3130. In article <1994Jun3.094115.17117@cm.cf.ac.uk>, Ralph Martin <Ralph.Martin@cm.cf.ac.uk> writes:
  3131. > In article <1994Jun3.110501.29244@waikato.ac.nz> Lawrence D'Oliveiro,
  3132. > ldo@waikato.ac.nz writes:
  3133. >>
  3134. >>Now, what do you think of their relative complexity?
  3135. >
  3136. > Good points for Quickdraw:
  3137. > 2. Functionality divided into smaller chunks (what to draw, where to draw
  3138. > separate).
  3139.  
  3140. Actually, this statement is more true of GX in general. My sample code was for
  3141. drawing text: consider equivalent code for drawing, say, polygons. (Do you want
  3142. me to inflict some on you?)
  3143.  
  3144. > 3. No stupid conversions and typecasting to remember all over the place.
  3145.  
  3146. I was using THINK C for communication purposes. Normally I use Modula-2.
  3147. Much less typecasting. :-)
  3148.  
  3149. Lawrence D'Oliveiro                       fone: +64-7-856-2889
  3150. Info & Tech Services Division              fax: +64-7-838-4066
  3151. University of Waikato            electric mail: ldo@waikato.ac.nz
  3152. Hamilton, New Zealand    37^ 47' 26" S, 175^ 19' 7" E, GMT+12:00
  3153.  
  3154. +++++++++++++++++++++++++++
  3155.  
  3156. >From ldo@waikato.ac.nz (Lawrence D'Oliveiro, Waikato University)
  3157. Date: 7 Jun 94 12:04:03 +1200
  3158. Organization: University of Waikato, Hamilton, New Zealand
  3159.  
  3160. In article <2smvne$mkg@news.kth.se>, d88-jwa@dront.nada.kth.se (Jon Wdtte) writes:
  3161. > In <1994Jun3.094115.17117@cm.cf.ac.uk> Ralph Martin <Ralph.Martin@cm.cf.ac.uk> writes:
  3162. >
  3163. >>Good points for Quickdraw GX:
  3164. >>4. No rubbish concerning initialising and setting up ports.
  3165. >
  3166. > Actually, there is; Lawrence was cheating (or rather not using
  3167. > a relevant test case)
  3168.  
  3169. I wasn't cheating. The GX documentation says you can leave out all the client
  3170. setup if the defaults are adequate, and in this case, they were!
  3171.  
  3172. Lawrence D'Oliveiro                       fone: +64-7-856-2889
  3173. Info & Tech Services Division              fax: +64-7-838-4066
  3174. University of Waikato            electric mail: ldo@waikato.ac.nz
  3175. Hamilton, New Zealand    37^ 47' 26" S, 175^ 19' 7" E, GMT+12:00
  3176.  
  3177. +++++++++++++++++++++++++++
  3178.  
  3179. >From zstern@adobe.com (Zalman Stern)
  3180. Date: Tue, 7 Jun 1994 01:21:35 GMT
  3181. Organization: Adobe Systems Incorporated
  3182.  
  3183. Lawrence D'Oliveiro, Waikato University writes
  3184. > Seriously, though, if unsigned char* theText = "Hello World" compiles  
  3185. without
  3186. > needing a cast, while I needed a cast to pass the exact same literal to an
  3187. > unsigned char* argument, isn't that an inconsisten-C?
  3188.  
  3189. Its not an inconsistency because it doesn't compile.
  3190. --
  3191. Zalman Stern           zalman@adobe.com            (415) 962 3824
  3192. Adobe Systems, 1585 Charleston Rd., POB 7900, Mountain View, CA 94039-7900
  3193.    Never let a "final candidate" subscript get above the age of consent.
  3194.  
  3195. +++++++++++++++++++++++++++
  3196.  
  3197. >From peirce@outpost.SF-Bay.org (Michael Peirce)
  3198. Date: Mon, 6 Jun 94 20:25:05 PST
  3199. Organization: Peirce Software, Inc.
  3200.  
  3201.  
  3202. In article <1994Jun7.114651.29344@waikato.ac.nz> (comp.sys.mac.programmer), ldo@waikato.ac.nz (Lawrence D'Oliveiro, Waikato University) writes:
  3203. > In article <CNjbKKKX.1a1ha8@outpost.SF-Bay.org>, peirce@outpost.SF-Bay.org (Michael Peirce) writes:
  3204. > >
  3205. > > Also (very minor point) I use the ff() macro rather than the
  3206. > > IntToFixed() - they are equivalent, but ff is more compact.
  3207. > I deliberately used IntToFixed to try to make it clearer what was going on.
  3208. > > What I'd like to see is a way to peer inside.  Make it 100%
  3209. > > clear that things will change and all that, but allow us to
  3210. > > debug things in a reasonable way!
  3211. > There are some GX functions that provide such an escape, eg GXGetShapeStructure.
  3212.  
  3213. GXGetShapeStructure will return geometry information about a shape.
  3214. Other calls can also return infomation about other stuff like inks
  3215. and transforms.
  3216.  
  3217. With these it is possible to build some sort of debugging library
  3218. yourself, but it really doesn't help much when you are stepping through
  3219. source code and need to see what the ink of a given shape is or maybe
  3220. its transform.
  3221.  
  3222. GraphicsBug tries to address some of this, but it was clearly written
  3223. by someone that thinks Macsbug was a great model to follow for a debugger
  3224. UI :-(  It's completely unusable by folks who don't have a friendly event
  3225. loop handly.  People who write print drivers or extensions or even App
  3226. code that uses GX for just a little work, then cleans up before idle
  3227. time are left in a lurch.  I had to dust off some really old code
  3228. that spits out debugging information over the net to a log app so I can
  3229. get some idea what's going on deep in the bowels of message overrides.
  3230. This is code that I haven't had to use since symbolic debugging arrived
  3231. on the Mac many moons ago.
  3232.  
  3233. Maybe I'm carrying on at a bit too much length, but having spend the
  3234. last months debugging our printing extensions and I've wasted large
  3235. amounts of time because its hard to debug GX code.  (You also have
  3236. to jump through hoops to get source debugging to work with print drivers
  3237. and extensions, but that's yet another story!).
  3238.  
  3239. The easier it is to debug GX apps and such, the sooner they will start
  3240. showing up.
  3241.  
  3242. __ Michael Peirce        __ peirce@outpost.sf-bay.org
  3243. __ Peirce Software, Inc. __ 719 Hibiscus Place, Suite 301
  3244. __                       __ San Jose, California USA 95117-1844
  3245. __ Makers of: Smoothie & __ voice: +1.408.244.6554 fax: +1.408.244.6882
  3246. __    Peirce Print Tools __ AppleLink: peirce & AOL: AFC Peirce
  3247.  
  3248. +++++++++++++++++++++++++++
  3249.  
  3250. >From mxmora@unix.sri.com (Matt Mora)
  3251. Date: 7 Jun 1994 13:33:06 -0700
  3252. Organization: SRI International, Menlo Park, CA
  3253.  
  3254. In article <CNjbKKKX.1idl0m@outpost.SF-Bay.org> peirce@outpost.SF-Bay.org (Michael Peirce) writes:
  3255.  
  3256. >GraphicsBug tries to address some of this, but it was clearly written
  3257. >by someone that thinks Macsbug was a great model to follow for a debugger
  3258. >UI :-(  It's completely unusable by folks who don't have a friendly event
  3259. >loop handly.  People who write print drivers or extensions or even App
  3260.  
  3261.  
  3262. I thought that the GX team answered your question about that. Didn't
  3263. they mention that there is a call you can use to simulate a Event
  3264. loop?
  3265.  
  3266.  
  3267. Xavier
  3268.  
  3269.  
  3270.  
  3271.  
  3272.  
  3273. -- 
  3274. ___________________________________________________________
  3275. Matthew Xavier Mora                       Matt_Mora@sri.com
  3276. SRI International                       mxmora@unix.sri.com
  3277. 333 Ravenswood Ave                    Menlo Park, CA. 94025
  3278.  
  3279. +++++++++++++++++++++++++++
  3280.  
  3281. >From peirce@outpost.SF-Bay.org (Michael Peirce)
  3282. Date: Tue, 7 Jun 94 15:06:31 PST
  3283. Organization: Peirce Software, Inc.
  3284.  
  3285.  
  3286. In article <1994May31.211440.1@west.cscwc.pima.edu> (comp.sys.mac.programmer), 103t_english@west.cscwc.pima.edu writes:
  3287. > Will GX ship with 7.5 or later?
  3288.  
  3289. QuickDraw GX swill ship with 7.5.  Before then, GX can be licensed
  3290. by third party companies that want to include it with their products.
  3291.  
  3292. Since our Peirce Print Tools won't work without GX, we are in the
  3293. process of licensing GX and will bundle it in with our product
  3294. in a week (or two or three depending on how long it takes Apple licensing
  3295. to process the paperwork!).  It's four HDFD disks and will work with
  3296. System 7.1 or later.
  3297.  
  3298. __ Michael Peirce        __ peirce@outpost.sf-bay.org
  3299. __ Peirce Software, Inc. __ 719 Hibiscus Place, Suite 301
  3300. __                       __ San Jose, California USA 95117-1844
  3301. __ Makers of: Smoothie & __ voice: +1.408.244.6554 fax: +1.408.244.6882
  3302. __    Peirce Print Tools __ AppleLink: peirce & AOL: AFC Peirce
  3303.  
  3304. +++++++++++++++++++++++++++
  3305.  
  3306. >From ldo@waikato.ac.nz (Lawrence D'Oliveiro, Waikato University)
  3307. Date: 9 Jun 94 11:39:00 +1200
  3308. Organization: University of Waikato, Hamilton, New Zealand
  3309.  
  3310. In article <CNjbKKKX.1idl0m@outpost.SF-Bay.org>, peirce@outpost.SF-Bay.org (Michael Peirce) writes:
  3311. >
  3312. > In article <1994Jun7.114651.29344@waikato.ac.nz> (comp.sys.mac.programmer), ldo@waikato.ac.nz (Lawrence D'Oliveiro, Waikato University) writes:
  3313. >> In article <CNjbKKKX.1a1ha8@outpost.SF-Bay.org>, peirce@outpost.SF-Bay.org (Michael Peirce) writes:
  3314. >>
  3315. >> > What I'd like to see is a way to peer inside.  Make it 100%
  3316. >> > clear that things will change and all that, but allow us to
  3317. >> > debug things in a reasonable way!
  3318. >>
  3319. >> There are some GX functions that provide such an escape, eg GXGetShapeStructure.
  3320. >
  3321. > GXGetShapeStructure will return geometry information about a shape.
  3322. > Other calls can also return infomation about other stuff like inks
  3323. > and transforms.
  3324. >
  3325. > With these it is possible to build some sort of debugging library
  3326. > yourself, but it really doesn't help much when you are stepping through
  3327. > source code and need to see what the ink of a given shape is or maybe
  3328. > its transform.
  3329.  
  3330. You could write a MacsBug dcmd or two to make these calls. Since GX is
  3331. supposed to be interrupt-reentrant, they might even work quite safely.
  3332.  
  3333. > GraphicsBug [is] completely unusable by folks who don't have a friendly event
  3334. > loop handly.  People who write print drivers or extensions or even App
  3335. > code that uses GX for just a little work, then cleans up before idle
  3336. > time are left in a lurch.
  3337.  
  3338. Here's the tip that was given out at the GX in QD apps and debugging tips
  3339. session at WWDC: break into MacsBug, switch to the system heap zone, then type
  3340. "g InitEventLoop" (I think that's how it's spelt). This is supposed to get you
  3341. into a dummy event loop so you can use GraphicsBug on your driver/extension.
  3342.  
  3343. By the way, I think this only works with the debugging version of GX. MacsBug
  3344. can't seem to find a symbol resembling this in the 1.0f2c13 (non-debugging)
  3345. version I'm running.
  3346.  
  3347. Lawrence D'Oliveiro                       fone: +64-7-856-2889
  3348. Info & Tech Services Division              fax: +64-7-838-4066
  3349. University of Waikato            electric mail: ldo@waikato.ac.nz
  3350. Hamilton, New Zealand    37^ 47' 26" S, 175^ 19' 7" E, GMT+12:00
  3351.  
  3352. +++++++++++++++++++++++++++
  3353.  
  3354. >From peirce@outpost.SF-Bay.org (Michael Peirce)
  3355. Date: Wed, 8 Jun 94 21:52:09 PST
  3356. Organization: Peirce Software, Inc.
  3357.  
  3358.  
  3359. In article <1994Jun9.113900.29449@waikato.ac.nz> (comp.sys.mac.programmer), ldo@waikato.ac.nz (Lawrence D'Oliveiro, Waikato University) writes:
  3360. > Here's the tip that was given out at the GX in QD apps and debugging tips
  3361. > session at WWDC: break into MacsBug, switch to the system heap zone, then type
  3362. > "g InitEventLoop" (I think that's how it's spelt). This is supposed to get you
  3363. > into a dummy event loop so you can use GraphicsBug on your driver/extension.
  3364. > By the way, I think this only works with the debugging version of GX. MacsBug
  3365. > can't seem to find a symbol resembling this in the 1.0f2c13 (non-debugging)
  3366. > version I'm running.
  3367.  
  3368. Right, but who uses Macsbug?  Seriously. I guess the GX team does.
  3369.  
  3370. Yikes!
  3371.  
  3372. __ Michael Peirce        __ peirce@outpost.sf-bay.org
  3373. __ Peirce Software, Inc. __ 719 Hibiscus Place, Suite 301
  3374. __                       __ San Jose, California USA 95117-1844
  3375. __ Makers of: Smoothie & __ voice: +1.408.244.6554 fax: +1.408.244.6882
  3376. __    Peirce Print Tools __ AppleLink: peirce & AOL: AFC Peirce
  3377.  
  3378. +++++++++++++++++++++++++++
  3379.  
  3380. >From quinn@cs.uwa.edu.au (Quinn "The Eskimo!")
  3381. Date: Mon, 13 Jun 1994 09:56:34 +0800
  3382. Organization: Department of Computer Science, The University of Western Australia
  3383.  
  3384. In article <1994Jun3.094115.17117@cm.cf.ac.uk>, Ralph Martin
  3385. <Ralph.Martin@cm.cf.ac.uk> wrote:
  3386.  
  3387. >Seriously, you are probably right about QuickDraw GX having a better
  3388. >model underlying it. I'm not so sure that the realisation of that model
  3389. >into an API is a great leap forward though. Perhaps longer examples would
  3390. >be more convincing!
  3391.  
  3392. The important point is not whether GX is simpler, it's that you can do
  3393. more.  Colour QuickDraw is fine until you hit one of its boundaries and
  3394. then you suffer much pain and misery trying to work around it.  With GX
  3395. the boundaries are much further out, thus you're less likely to hit them. 
  3396. The classic example here is rotated text.
  3397.  
  3398. Hmm, of course when you do hit GX's boundaries...
  3399. -- 
  3400. Quinn "The Eskimo!"      <quinn@cs.uwa.edu.au>     "Support HAVOC!"
  3401. Department of Computer Science, The University of Western Australia
  3402.   Who, as a Mac user as well as a programmer, can't wait for GX drawing/DTP.
  3403.   And is glad he doesn't have to write it (:
  3404.  
  3405. ---------------------------
  3406.  
  3407. >From tboucher@teleport.com (Tyson B. Boucher)
  3408. Subject: [Q] Programming the AT&T 3210?
  3409. Date: Thu, 09 Jun 1994 03:15:16 -0800
  3410. Organization: Teleport - Portland's Public Access (503) 220-1016
  3411.  
  3412.     Does anyone know of a cheap/free way to learn how to program the 3210
  3413. (the DSP in av Macs)?  IUd like to take advantage of it, but IUm still
  3414. working on getting a full set of IM, so I donUt want to spend a lot buying
  3415. a manual from AT&T if I can help it.  Besides, this is (for now) just a
  3416. casual interest and I donUt want to toss a lot of $$$ after this if it
  3417. turns out to be not worth it.
  3418.  
  3419. -- 
  3420. |          tboucher@teleport.com           |
  3421. |                   /-Student              |
  3422. |  Tyson B. Boucher-|-Programmer           |
  3423. |                   \-lifeless.net.bum  ;) |
  3424.  
  3425. +++++++++++++++++++++++++++
  3426.  
  3427. >From Darrin Cardani <Darrin.Cardani@AtlantaGA.NCR.COM>
  3428. Date: Fri, 10 Jun 1994 13:55:13 GMT
  3429. Organization: AT&T Global Information Solutions, Atlanta
  3430.  
  3431. >In article <tboucher-090694031516@ip-ca.teleport.com> Tyson B. Boucher writes: 
  3432. >    Does anyone know of a cheap/free way to learn how to program the 3210
  3433. >(the DSP in av Macs)?  IUd like to take advantage of it, but IUm still
  3434. >working on getting a full set of IM, so I donUt want to spend a lot buying
  3435. >a manual from AT&T if I can help it.  Besides, this is (for now) just a
  3436. >casual interest and I donUt want to toss a lot of $$$ after this if it
  3437. >turns out to be not worth it.
  3438.  
  3439. First off, most readers don't recognize the funky characters you've got in
  3440. your post. You might want to use standard ascii when posting.
  3441.  
  3442. But to answer your question, The manual for the language is free from AT&T.
  3443. I don't have the address with me right now.
  3444.  
  3445. The commercially available development system is $1000. Some people on the
  3446. net are trying to write one that I assume will be ftp'able from the major mac
  3447. archive sites. There is a group called comp.dsp. You might want to check it
  3448. out and ask for the Mac DSP mini-faq. It has more info. (like the phone number
  3449. for the free manual.)
  3450.  
  3451. Darrin
  3452.  
  3453.  
  3454.  
  3455.  
  3456.  
  3457.  
  3458.  
  3459. +++++++++++++++++++++++++++
  3460.  
  3461. >From qmot@cs.mcgill.ca (Thomas PUSHPATHADAM)
  3462. Date: 11 Jun 1994 21:19:10 GMT
  3463. Organization: SOCS, McGill University, Montreal, Canada
  3464.  
  3465. (*** Note:  posting from borrowed account ***)
  3466.  
  3467. > Does anyone know of a cheap/free way to learn how to program the 3210
  3468. > (the DSP in av Macs)?  IUd like to take advantage of it, but IUm
  3469. > still
  3470. > working on getting a full set of IM, so I donUt want to spend a lot
  3471. > buying
  3472. > a manual from AT&T if I can help it.  Besides, this is (for now) just
  3473. > a casual interest and I donUt want to toss a lot of $$$ after this if
  3474. > it turns out to be not worth it.
  3475.  
  3476. Stefan Arentz (arentz@batcave.knoware.nl), Andrew Grignon
  3477. (Andrew-Grignon@uiowa.edu) and myself (Paul Lalonde,
  3478. paul@architecture.mcgill.ca) are currently writing an assembler for the
  3479. DSP3210.  Since we're doing this in our scarce spare time, it's moving
  3480. rather slowly.  We want to upload to the major ftp sites by the end of
  3481. June.
  3482.  
  3483. In the meantime, you might call AT&T and ask for the "DSP3210
  3484. information manual".  It's free, and it introduces you to the DSP's
  3485. instruction set.  Their number is 1-800-372-2447.
  3486.  
  3487. You will also need the "Centris  660AV & Quadra 840AV developer note",
  3488. available on more recent Bookmark & developer CDs.  This documents the 
  3489. interface to the DSP.
  3490.  
  3491. Hope this helps,
  3492.  
  3493. Paul Lalonde
  3494. paul@architecture.mcgill.ca
  3495.  
  3496.  
  3497. +++++++++++++++++++++++++++
  3498.  
  3499. >From amanda@intercon.com (Amanda Walker)
  3500. Date: Mon, 13 Jun 1994 14:32:50 -0500
  3501. Organization: InterCon Systems Corporation, Herndon, VA  USA
  3502.  
  3503. Darrin Cardani <Darrin.Cardani@AtlantaGA.NCR.COM> writes:
  3504. > The commercially available development system is $1000. 
  3505.  
  3506. Spectral Innovations is now selling the ARTA development for $495 without 
  3507. support ($995 includes support).  I wouldn't advise doing this unless you've
  3508. done DSP code before, though :)...
  3509.  
  3510.  
  3511. Amanda Walker
  3512. InterCon Systems Corporation
  3513.  
  3514.  
  3515.  
  3516. ---------------------------
  3517.  
  3518. End of C.S.M.P. Digest
  3519. **********************
  3520.  
  3521.  
  3522.