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

  1. Received-Date: Fri, 23 Dec 1994 12:22:40 +0100
  2. From: pottier@clipper.ens.fr (Francois Pottier)
  3. Subject: csmp-digest-v3-076
  4. To: csmp-digest@ens.fr
  5. Date: Fri, 23 Dec 1994 12:22:34 +0100 (MET)
  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: 82
  13.  
  14. C.S.M.P. Digest             Fri, 23 Dec 94       Volume 3 : Issue 76
  15.  
  16. Today's Topics:
  17.  
  18.         AEInstallEventHandler Problem
  19.         How do I keep my program from coming to the foregroud for drags?!?!
  20.         How do you use the mouse as a relative motion device?
  21.         How to convert a Picture to a PixPat?
  22.         Info on BlockMoveData ?
  23.         Installer advice please?
  24.         Mac FAQ now available as HTML using WWW!
  25.         PowerPlant vs. MacApp - opinions ?
  26.         QuickDraw GX Thread Safe?
  27.         [Q] Need help with SetGWorld.
  28.         static RoutineDescriptors
  29.  
  30.  
  31.  
  32. The Comp.Sys.Mac.Programmer Digest is moderated by Francois Pottier
  33. (pottier@clipper.ens.fr).
  34.  
  35. The digest is a collection of article threads from the internet newsgroup
  36. comp.sys.mac.programmer.  It is designed for people who read c.s.m.p. semi-
  37. regularly and want an archive of the discussions.  If you don't know what a
  38. newsgroup is, you probably don't have access to it.  Ask your systems
  39. administrator(s) for details.  If you don't have access to news, you may
  40. still be able to post messages to the group by using a mail server like
  41. anon.penet.fi (mail help@anon.penet.fi for more information).
  42.  
  43. Each issue of the digest contains one or more sets of articles (called
  44. threads), with each set corresponding to a 'discussion' of a particular
  45. subject.  The articles are not edited; all articles included in this digest
  46. are in their original posted form (as received by our news server at
  47. nef.ens.fr).  Article threads are not added to the digest until the last
  48. article added to the thread is at least two weeks old (this is to ensure that
  49. the thread is dead before adding it to the digest).  Article threads that
  50. consist of only one message are generally not included in the digest.
  51.  
  52. The digest is officially distributed by two means, by email and ftp.
  53.  
  54. If you want to receive the digest by mail, send email to listserv@ens.fr
  55. with no subject and one of the following commands as body:
  56.     help                        Sends you a summary of commands
  57.     subscribe csmp-digest Your Name    Adds you to the mailing list
  58.     signoff csmp-digest            Removes you from the list
  59. Once you have subscribed, you will automatically receive each new
  60. issue as it is created.
  61.  
  62. The official ftp info is //ftp.dartmouth.edu/pub/csmp-digest.
  63. Questions related to the ftp site should be directed to
  64. scott.silver@dartmouth.edu. Currently no previous volumes of the CSMP
  65. digest are available there.
  66.  
  67. Also, the digests are available to WAIS users.  To search back issues
  68. with WAIS, use comp.sys.mac.programmer.src. With Mosaic, use
  69. http://www.wais.com/wais-dbs/comp.sys.mac.programmer.html.
  70.  
  71.  
  72. -------------------------------------------------------
  73.  
  74. >From a052@amug.org (Jeff Corr)
  75. Subject: AEInstallEventHandler Problem
  76. Date: 3 Dec 1994 21:38:20 GMT
  77. Organization: Arizona Macintosh Users Group
  78.  
  79. I am unable to compile a program in part because I do not have
  80. documentation (i.e. the appropriate volume of Inside Macintosh) for the
  81. AEInstallEventHandler function although I did find the declaration for
  82. AEInstallEventHandler in the Types.h file.  I have not found a #define for
  83. the AEEventHandlerUPP type that is used in the declaration of
  84. AEInstallEventHandler in any of the header files that I included and
  85. perhaps this is contributing to this problem.  The relevant information and
  86. code follow.   
  87.  
  88.  
  89. These fragments of code are from the Macintosh C Primer by Dave Mark and
  90. Cartwright Reed.
  91.  
  92.  
  93. /*****  EventTracker  *****/
  94.  
  95. #include <AppleEvents.h>
  96. #include <GestaltEqu.h>
  97. #include <Limits.h>
  98. .
  99. . (irrelevant declarations omitted) 
  100. .
  101. /* declaration for the EventHandler function follows */
  102.  
  103. pascal  OSErr    DoOpenApp (AppleEvent theAppleEvent,  AppleEvent reply,  long
  104. refCon);
  105. .
  106. . (more irrelevant declarations and code omitted)
  107. .
  108.  
  109. /*****  EventInit  *****/
  110.  
  111. void EventInit (void)
  112. {
  113.    OSErr    err;    /* Straight from the book... I tried putting the pascal
  114. identifier before OSErr but this did not help */
  115. .
  116. .
  117. .
  118.    err = AEInstallEventHandler (kCoreEventClass, kAEOpenApplication,
  119. DoOpenApp, 0L, false);
  120.    if (err != noErr)  DrawEventString ("\pkAEOpenApplication Apple Event
  121. not available!");
  122. .
  123. . (no more relevant code)
  124. .
  125.  
  126. >From the codeWarrior message window:
  127.  
  128.  
  129. •• Error   : declaration syntax error
  130.    EventTracker.c line 110   err =
  131. AEInstallEventHandler(kCoreEventClass,kAEOpenApplication, DoOpenApp, 0L,
  132. false);
  133.  
  134. note: I included MacOS.Lib in the project file.
  135.  
  136.  
  137. The declaration that I found in Types.h:
  138.  
  139. extern pascal OSErr AEInstallEventHandler(AEEventClass theEventClass,
  140. AEEventID theEventID, AEEventHandlerUPP handler, long handlerRefcon,
  141. Boolean isSysHandler)
  142.  THREEWORDINLINE(0x303C, 0x091F, 0xA816)
  143.  
  144. I have not found the declaration for AEEventHandlerUPP (the third parameter
  145. that is passed in the above declaration) in any of the header files.
  146.  
  147. Apologies if this is too trivial a matter for this group.  I am very much a
  148. beginner at this but I can assure you that I have spent alot of time trying
  149. to figure this out. I plan on getting the CD version of Inside Macintosh as
  150. soon as santa brings me a CD-ROM.
  151.  
  152. Regards,
  153.  
  154. Jeff
  155.  
  156.  
  157.  
  158.  
  159.  
  160. -- 
  161. This (code) warrior is still in boot camp.
  162.  
  163. Jeff Corr
  164. a052@amug.org   Arizona Macintosh Users Group
  165.  
  166. +++++++++++++++++++++++++++
  167.  
  168. >From piz@magnet.at (Andreas Pizsa)
  169. Date: 06 Dec 1994 00:55:10 GMT
  170. Organization: The Personal Online Source
  171.  
  172. > I have not found a #define for
  173. >the AEEventHandlerUPP type that is used in the declaration of
  174. >AEInstallEventHandler in any of the header files that I included and
  175. >perhaps this is contributing to this problem.  The relevant information and
  176. >code follow.   
  177.  
  178. Here is some code that does what you need; note the NewAEEventHandlerProc
  179. function, which actually is a macro on 68k-Macs.
  180.  
  181. static EventListEntry theEventList[]={
  182.     { kAEDBSuite,kAEGetData,(ProcPtr)GetDataEvent },
  183.     { kCoreEventClass,kAEQuitApplication,(ProcPtr)QuitApplication},
  184.     { kFirstAccessSuite,kGetStatusEvent,(ProcPtr)GetStatusEvent},
  185.     { kFirstAccessSuite,kAEFindFormEvent,(ProcPtr)AEGetFormHandler}
  186. };
  187.  
  188.     /*
  189.     ** Install the AppleEvent handlers
  190.     **
  191.     ** We*re using the Universal Headers, so NewAEEventHandlerProc is called
  192.     ** It*s not necessary to call DisposeRoutineDescriptor, since this is done
  193.     ** automatically when the application exits & the heap is cleared
  194.     */
  195.  
  196.     for(i=0;i<sizeof(theEventList)/sizeof(theEventList[0]);++i){
  197.         myErr=AEInstallEventHandler(
  198.             theEventList[i].theClass,
  199.             theEventList[i].theID,
  200.             NewAEEventHandlerProc(theEventList[i].theProc),
  201.             (long)myGlobalsH,false
  202.             );
  203.         if(myErr){
  204.             #ifdef DEBUG
  205.                 DebugStr("\pError installing AppleEvent Handler");
  206.             #endif
  207.             SysBeep(0);
  208.             goto err;
  209.         }
  210.     }
  211.  
  212.  
  213. Hope this helps!
  214.  
  215. Andreas
  216. FirstAccess Developer
  217. Networx GmbH
  218.  
  219.  --------------------------------------------------------
  220.  sent via  m a g n e t / +43-1-522-7-225 / info@magnet.at
  221.  --------------------------------------------------------
  222.  
  223.  
  224. +++++++++++++++++++++++++++
  225.  
  226. >From Jens Alfke <jens_alfke@powertalk.apple.com>
  227. Date: Thu, 8 Dec 1994 20:40:42 GMT
  228. Organization: Apple Computer
  229.  
  230. Jeff Corr, a052@amug.org writes:
  231. > I am unable to compile a program in part because I do not have
  232. > documentation (i.e. the appropriate volume of Inside Macintosh) for the
  233. > AEInstallEventHandler function although I did find the declaration for
  234. > AEInstallEventHandler in the Types.h file.
  235.  
  236. That's funny, the declaration should be in AppleEvents.h along with all the
  237. other AE stuff.
  238. Assuming you are compiling for 68k, just cast the address of the function to
  239. an AEEventHandlerUPP:
  240.  
  241. AEInstallEventHandler(kCoreEventClass,kAEOpenApplication,
  242.     (AEEventHandlerUPP)&DoOpenApp, 0L,false);
  243.  
  244. If you're compiling for PPC you need to make up a routine descriptor; better
  245. wait for Santa to bring your Inside Mac, as this stuff gets a bit trickier.
  246.  
  247. --Jens Alfke                           jens_alfke@powertalk.apple.com
  248.                    "A man, a plan, a yam, a can of Spam ... Bananama!"
  249.  
  250. ---------------------------
  251.  
  252. >From rhagopia@terminator.rs.itd.umich.edu
  253. Subject: How do I keep my program from coming to the foregroud for drags?!?!
  254. Date: 18 Nov 1994 14:43:59 -0500
  255. Organization: University of Michigan Archives
  256.  
  257. OK, I'm implementing the dragmanager into my program. Everything's great.
  258. Other programs get my data, yea. (I don't accept drags because it's a
  259. read-only document) HOWEVER, I seem to have a problem when my app is
  260. in the background and someone tries to drag hilited text out into the
  261. foreground. According to the HIG, and the way the Finder and Scrapbook
  262. behave, my app should NOT come to the foreground, the drag should just
  263. move from the background to the foreground. Now note that the Finder and
  264. the Scrapbook are the only two apps that I've found that do this properly;
  265. SimpleText, Zterm, and even StickyNotes (and I think the Notepad too) all
  266. botch it up and come to the front.
  267.  
  268. So the question is, how to keep my app from rising to the front when I
  269. don't want it to. I checked the SIZE resources, and both had on front
  270. clicks. So I turned them on in my app, and nothing new happens. <sigh>
  271. I start going through and checking on the events I'm getting.
  272.  
  273. Unfortunatly, I seem to be brought to the front before a resume evt (my
  274. window comes to the front that is), then I get my resume evt, then I get
  275. my mousedown. This annoys me to no end, as I'd like to make it right,
  276. even though most apps that I've seen don't bother (oh, the DragText
  277. example doesn't do it right either...). The only thing I could think of
  278. was my SIZE resource, but the three that I could see making a difference
  279. seem to be the same as the Finder/Scrapbook... (acceptSuspendResume,
  280. doesActivateOnSuspendResume, and getFrontClicks... all true)
  281.  
  282. Please help! Thx!
  283. -- 
  284. | Rob Hagopian.           | FINGER me! (01/18) | Moon Over Miami |   Four   |
  285. | rhagopia@nyx.cs.du.edu  +--------------------+-----------------+ lines? I |
  286. | rhagopia@terminator.rs. |GC 1.0.1: GU d -p+(-) c++++ !l u++ e/+| only get |
  287. |          itd.umich.edu  |       m/- s/- !n h f? g+ w+ t-- r- y?|   four   |
  288.  
  289. +++++++++++++++++++++++++++
  290.  
  291. >From d88-bli@xbyse.nada.kth.se (Bo Lindbergh)
  292. Date: 19 Nov 1994 08:40:35 GMT
  293. Organization: Royal Institute of Technology, Stockholm, Sweden
  294.  
  295. In article <3aj05v$f9u@terminator.rs.itd.umich.edu> rhagopia@terminator.rs.itd.umich.edu writes:
  296. ) OK, I'm implementing the dragmanager into my program. Everything's great.
  297. ) Other programs get my data, yea. (I don't accept drags because it's a
  298. ) read-only document) HOWEVER, I seem to have a problem when my app is
  299. ) in the background and someone tries to drag hilited text out into the
  300. ) foreground. According to the HIG, and the way the Finder and Scrapbook
  301. ) behave, my app should NOT come to the foreground, the drag should just
  302. ) move from the background to the foreground. Now note that the Finder and
  303. ) the Scrapbook are the only two apps that I've found that do this properly;
  304. ) SimpleText, Zterm, and even StickyNotes (and I think the Notepad too) all
  305. ) botch it up and come to the front.
  306.  
  307. I could tell you how to do this, but then Apple would have both of us shot.
  308. This is yet another thing that only system programs like the Finder are
  309. allowed to do.
  310.  
  311.  
  312. /Bo Lindbergh
  313.  
  314. +++++++++++++++++++++++++++
  315.  
  316. >From rhagopia@terminator.rs.itd.umich.edu (Rob Hagopian)
  317. Date: 19 Nov 1994 05:24:27 -0500
  318. Organization: University of Michigan Archives
  319.  
  320. In article <3akdm3$oav@news.kth.se>,
  321. Bo Lindbergh <d88-bli@xbyse.nada.kth.se> wrote:
  322. :In article <3aj05v$f9u@terminator.rs.itd.umich.edu> rhagopia@terminator.rs.itd.umich.edu writes:
  323. :) OK, I'm implementing the dragmanager into my program. Everything's great.
  324. :) Other programs get my data, yea. (I don't accept drags because it's a
  325. :) read-only document) HOWEVER, I seem to have a problem when my app is
  326. :) in the background and someone tries to drag hilited text out into the
  327. :) foreground. According to the HIG, and the way the Finder and Scrapbook
  328. :) behave, my app should NOT come to the foreground, the drag should just
  329. :) move from the background to the foreground. Now note that the Finder and
  330. :) the Scrapbook are the only two apps that I've found that do this properly;
  331. :) SimpleText, Zterm, and even StickyNotes (and I think the Notepad too) all
  332. :) botch it up and come to the front.
  333. :
  334. :I could tell you how to do this, but then Apple would have both of us shot.
  335. :This is yet another thing that only system programs like the Finder are
  336. :allowed to do.
  337.  
  338. Any hints? I've traced through them and they don't even go through a call
  339. -- 
  340. | Rob Hagopian.           | FINGER me! (01/18) | Moon Over Miami |   Four   |
  341. | rhagopia@nyx.cs.du.edu  +--------------------+-----------------+ lines? I |
  342. | rhagopia@terminator.rs. |GC 1.0.1: GU d -p+(-) c++++ !l u++ e/+| only get |
  343. |          itd.umich.edu  |       m/- s/- !n h f? g+ w+ t-- r- y?|   four   |
  344.  
  345. +++++++++++++++++++++++++++
  346.  
  347. >From h+@metrowerks.com (Jon W{tte)
  348. Date: Sun, 20 Nov 1994 16:42:32 +0100
  349. Organization: The Conspiracy
  350.  
  351. In article <3akjor$ruj@terminator.rs.itd.umich.edu>,
  352. rhagopia@terminator.rs.itd.umich.edu (Rob Hagopian) wrote:
  353.  
  354. >:I could tell you how to do this, but then Apple would have both of us shot.
  355. >:This is yet another thing that only system programs like the Finder are
  356. >:allowed to do.
  357.  
  358. >Any hints? I've traced through them and they don't even go through a call
  359.  
  360. There is this magic system call you have to make to register 
  361. that you want clicks without a switchin.
  362.  
  363. There *WAS* a gestalt bit to test for this call, but in the 
  364. very latest Universal Headers, that bit has been conveniently 
  365. "forgotten".
  366.  
  367. Because of that, I don't think it's good idea to actually use 
  368. the stuff if you reverse-engineer it, but on the other hand, 
  369. it's functionality that Apple should *really* provide to 
  370. developers.
  371.  
  372. Cheers,
  373.  
  374.                     / h+
  375.  
  376.  
  377. --
  378.   Jon W‰tte (h+@metrowerks.com), Hagagatan 1, 113 48 Stockholm, Sweden
  379.  
  380.    Cookie Jar: Vanilla Yoghurt with Crushed Oreos.
  381.  
  382.  
  383. +++++++++++++++++++++++++++
  384.  
  385. >From rhagopia@terminator.rs.itd.umich.edu (Rob Hagopian)
  386. Date: 21 Nov 1994 00:11:26 -0500
  387. Organization: University of Michigan Archives
  388.  
  389. In article <AAF52CF8966820152@klkmac003.nada.kth.se>,
  390. Jon W{tte <h+@metrowerks.com> wrote:
  391. >There is this magic system call you have to make to register 
  392. >that you want clicks without a switchin.
  393. >
  394. >There *WAS* a gestalt bit to test for this call, but in the 
  395. >very latest Universal Headers, that bit has been conveniently 
  396. >"forgotten".
  397.  
  398. Really? It's still in the CW/4 Univ Headers... I believe it's
  399. bit 10... :-)
  400.  
  401. >Because of that, I don't think it's good idea to actually use 
  402. >the stuff if you reverse-engineer it, but on the other hand, 
  403. >it's functionality that Apple should *really* provide to 
  404. >developers.
  405.  
  406. I decided not to persue it further after I found out it was
  407. not kosher... Well, at least for anything I'll be releasing :-)
  408. -- 
  409. | Rob Hagopian.           | FINGER me! (01/18) | Moon Over Miami |   Four   |
  410. | rhagopia@nyx.cs.du.edu  +--------------------+-----------------+ lines? I |
  411. | rhagopia@terminator.rs. |GC 1.0.1: GU d -p+(-) c++++ !l u++ e/+| only get |
  412. |          itd.umich.edu  |       m/- s/- !n h f? g+ w+ t-- r- y?|   four   |
  413.  
  414. +++++++++++++++++++++++++++
  415.  
  416. >From wombat@claris.com (Scott Lindsey)
  417. Date: Thu, 01 Dec 1994 20:30:05 -0800
  418. Organization: Claris Corp., Vancouver WA
  419.  
  420. In article <3akjor$ruj@terminator.rs.itd.umich.edu>,
  421. rhagopia@terminator.rs.itd.umich.edu (Rob Hagopian) wrote:
  422.  
  423. > In article <3akdm3$oav@news.kth.se>,
  424. > Bo Lindbergh <d88-bli@xbyse.nada.kth.se> wrote:
  425. > :In article <3aj05v$f9u@terminator.rs.itd.umich.edu>
  426. rhagopia@terminator.rs.itd.umich.edu writes:
  427. > :) OK, I'm implementing the dragmanager into my program. Everything's great.
  428. > :) Other programs get my data, yea. (I don't accept drags because it's a
  429. > :) read-only document) HOWEVER, I seem to have a problem when my app is
  430. > :) in the background and someone tries to drag hilited text out into the
  431. > :) foreground. According to the HIG, and the way the Finder and Scrapbook
  432. > :) behave, my app should NOT come to the foreground, the drag should just
  433. > :) move from the background to the foreground. Now note that the Finder and
  434. > :) the Scrapbook are the only two apps that I've found that do this properly;
  435. > :) SimpleText, Zterm, and even StickyNotes (and I think the Notepad too) all
  436. > :) botch it up and come to the front.
  437. > :
  438. > :I could tell you how to do this, but then Apple would have both of us shot.
  439. > :This is yet another thing that only system programs like the Finder are
  440. > :allowed to do.
  441. > Any hints? I've traced through them and they don't even go through a call
  442.  
  443. Well, here's a hint: Scrapbook registers some sort of magic callback via
  444. _OSDispatch with a selector of $55.  This routine gets called by the
  445. system when there's a click in the non-active application, before the
  446. application's call to WNE returns.  This is where the drag (if there is
  447. one) gets initiated.  As it's been pointed out before, Apple hasn't
  448. documented this, and while there's a certain perverse pleasure in figuring
  449. out how things work (like the layer manager), using undocumented calls can
  450. hurt you when the system changes (like the layer manager).
  451.  
  452. While Apple hasn't documented this, it might be worth noting that the
  453. Scrapbook application (no, it's not a DA anymore) was written by a third
  454. party, Light Software, for whom it was either documented or who reverse
  455. engineered it with the expectation that the Scrapbook is system software
  456. and doesn't necessarily have to be compatible with future system software
  457. (since it can be revved).
  458.  
  459. -- 
  460. Scott Lindsey <wombat@claris.com>
  461.  
  462. ---------------------------
  463.  
  464. >From greg@cosc.canterbury.ac.nz (Greg Ewing)
  465. Subject: How do you use the mouse as a relative motion device?
  466. Date: 28 Nov 1994 00:15:33 GMT
  467. Organization: University of Canterbury, Christchurch, New Zealand
  468.  
  469.  
  470. Various games, such as Oxyd and Wolf 3D, use the
  471. mouse as a relative rather than absolute motion
  472. device. That is, moving the mouse causes some
  473. corresponding motion in the game, but there is
  474. no limit of the mouse hitting the edge of the
  475. screen.
  476.  
  477. How is this accomplished? Two approaches I
  478. can think of are:
  479.  
  480. (1) Somehow intercept the motion signals coming
  481. from the mouse at a lower level than the usual
  482. event mechanism.
  483.  
  484. (2) Periodically reset the pointer location to
  485. the middle of the screen.
  486.  
  487. There doesn't seem to be any official way of
  488. doing either of these. Does anyone know how
  489. the trick is usually done, and what is the
  490. least non-portable way of going about it?
  491.  
  492. Greg Ewing, Computer Science Dept, +--------------------------------------+
  493. University of Canterbury,       | A citizen of NewZealandCorp, a      |
  494. Christchurch, New Zealand       | wholly-owned subsidiary of Japan Inc.|
  495. greg@cosc.canterbury.ac.nz       +--------------------------------------+
  496.  
  497. +++++++++++++++++++++++++++
  498.  
  499. >From ingemar@lysator.liu.se (Ingemar Ragnemalm)
  500. Date: 28 Nov 1994 10:31:52 GMT
  501. Organization: (none)
  502.  
  503. greg@cosc.canterbury.ac.nz (Greg Ewing) writes:
  504.  
  505.  
  506. >Various games, such as Oxyd and Wolf 3D, use the
  507. >mouse as a relative rather than absolute motion
  508. >device. That is, moving the mouse causes some
  509. >corresponding motion in the game, but there is
  510. >no limit of the mouse hitting the edge of the
  511. >screen.
  512.  
  513. >How is this accomplished? Two approaches I
  514. >can think of are:
  515.  
  516. >(1) Somehow intercept the motion signals coming
  517. >from the mouse at a lower level than the usual
  518. >event mechanism.
  519.  
  520. "Somehow" is the word. I can't see any doumentation that tells us how
  521. to go this way.
  522.  
  523. >(2) Periodically reset the pointer location to
  524. >the middle of the screen.
  525.  
  526. This is what I did in HeartQuest. I'm not sure if it's the most portable
  527. one (though it seems to work on all present Macs - anyone know if it works
  528. with A/UX?) but it's pretty easy. The drawback is that I have to deped
  529. on a global that might go away some time.
  530.  
  531. >There doesn't seem to be any official way of
  532. >doing either of these. Does anyone know how
  533. >the trick is usually done, and what is the
  534. >least non-portable way of going about it?
  535.  
  536. It would really be nice if Apple could tell us what we should do when we
  537. *have* to do it. How about a mechanism that will ONLY work when the cursor
  538. is hidden? Then we won't break the interface rules as badly - if at all!
  539.  
  540. --
  541. - -
  542. Ingemar Ragnemalm, PhD
  543. Image processing, Mac shareware games
  544. E-mail address: ingemar@isy.liu.se or ingemar@lysator.liu.se
  545.  
  546. +++++++++++++++++++++++++++
  547.  
  548. >From casadygree@aol.com (CasadyGree)
  549. Date: 28 Nov 1994 10:20:32 -0500
  550. Organization: America Online, Inc. (1-800-827-6364)
  551.  
  552. In article <3bb7f5$4r7@cantua.canterbury.ac.nz>,
  553. greg@cosc.canterbury.ac.nz (Greg Ewing) writes:
  554.  
  555. >>>
  556. Various games, such as Oxyd and Wolf 3D, use the
  557. mouse as a relative rather than absolute motion
  558. device.
  559. ...
  560. (2) Periodically reset the pointer location to
  561. the middle of the screen.
  562. >>>
  563.  
  564. That's right.  Glider 4.0 did this in "joystick" mode (for the old Kraft
  565. QuickStick) - every pass through the game check the mouse location from
  566. the center - then center it (this also foiled AfterDark's auto-sleep
  567. feature as well).
  568.  
  569. There's a funtion floating around called SetMouse().  It can be found, for
  570. example, in the UMPG (Usenet Macintosh Programming Guide) available at
  571. reputable FTP sites.  Download the text - there are a lot of other useful
  572. (and some dated) FAQ's in it.
  573.  
  574. john calhoun
  575. (softdoroth@aol.com)
  576.  
  577. +++++++++++++++++++++++++++
  578.  
  579. >From ingemar@lysator.liu.se (Ingemar Ragnemalm)
  580. Date: 28 Nov 1994 16:51:56 GMT
  581. Organization: (none)
  582.  
  583. casadygree@aol.com (CasadyGree) writes:
  584.  
  585. >That's right.  Glider 4.0 did this in "joystick" mode (for the old Kraft
  586. >QuickStick) - every pass through the game check the mouse location from
  587. >the center - then center it (this also foiled AfterDark's auto-sleep
  588. >feature as well).
  589.  
  590. Any idea on how compatible it is?
  591.  
  592. >There's a funtion floating around called SetMouse().  It can be found, for
  593. >example, in the UMPG (Usenet Macintosh Programming Guide) available at
  594. >reputable FTP sites.  Download the text - there are a lot of other useful
  595. >(and some dated) FAQ's in it.
  596.  
  597. And here is one version of it:
  598.  
  599. procedure SetMouse (where: point);
  600.     var
  601.         LowGlob: integer;
  602.         LowMem: ptr;
  603.         PointPtr: ^point;
  604.     const
  605. {some dangerous low-memory-global equates}
  606.         MTemp = $828;        {point}
  607.         RawMouse = $82c;     {point}
  608.         CrsrNew = $8ce;      {byte}
  609.     begin
  610.         LocalToGlobal(where);             {Get ready to restore old mouse position}
  611.         LowMem := pointer(RawMouse);      {point to low memory}
  612.         PointPtr := @LowMem^;             {treat it as a point}
  613.         PointPtr^ := where;               {store saved mouse position into it}
  614.         LowMem := pointer(MTemp);         {point to low memory}
  615.         PointPtr := @LowMem^;             {treat it as a point}
  616.         PointPtr^ := where;               {store saved mouse position into it}
  617.         LowMem := pointer(CrsrNew);
  618.         LowMem^ := $ffff;                 {both CrsrNew & CrsrCouple}
  619.     end;       {SetMouse}
  620.  
  621. This is what I use in SAT/HeartQuest/Slime Invaders. I didn't write it; it's
  622. taken from UMPG or from a post here. Sorry for the bad capitalization; I
  623. never bothered to fix that.
  624.  
  625. --
  626. - -
  627. Ingemar Ragnemalm, PhD
  628. Image processing, Mac shareware games
  629. E-mail address: ingemar@isy.liu.se or ingemar@lysator.liu.se
  630.  
  631. +++++++++++++++++++++++++++
  632.  
  633. >From greg@cosc.canterbury.ac.nz (Greg Ewing)
  634. Date: 29 Nov 1994 01:00:22 GMT
  635. Organization: University of Canterbury, Christchurch, New Zealand
  636.  
  637.  
  638. In article <3bcbio$n2q@newsy.ifm.liu.se>, ingemar@lysator.liu.se (Ingemar Ragnemalm) writes:
  639. |> 
  640. |> It would really be nice if Apple could tell us what we should do when we
  641. |> *have* to do it.
  642.  
  643. What would be really nice for this problem would
  644. be to receive "raw mouse moved" events. These would
  645. be disabled by default, but when requested, would
  646. tell you every time the mouse was moved (regardless
  647. of whether the pointer is at the edge of the screen
  648. or not) and how much it has moved since the last
  649. such event.
  650.  
  651. I wonder if it would be possible to create a
  652. custom ADB device driver which does this?
  653. Is there any information around about how to
  654. write ADB drivers? If the ADB interface is stable
  655. enough, it might allow us to create a "relative
  656. mouse extension" that would be more reliable
  657. than messing with low memory globals.
  658.  
  659. |> Ingemar Ragnemalm, PhD
  660. |> E-mail address: ingemar@isy.liu.se or ingemar@lysator.liu.se
  661.  
  662. Greg Ewing, Computer Science Dept, +--------------------------------------+
  663. University of Canterbury,       | A citizen of NewZealandCorp, a      |
  664. Christchurch, New Zealand       | wholly-owned subsidiary of Japan Inc.|
  665. greg@cosc.canterbury.ac.nz       +--------------------------------------+
  666.  
  667. +++++++++++++++++++++++++++
  668.  
  669. >From lrucker@parcplace.com (Lee Ann Rucker)
  670. Date: Wed, 30 Nov 1994 11:59:57 +0800
  671. Organization: ParcPlace
  672.  
  673. In article <3bcbio$n2q@newsy.ifm.liu.se>, ingemar@lysator.liu.se (Ingemar
  674. Ragnemalm) wrote:
  675.  
  676. > >(2) Periodically reset the pointer location to
  677. > >the middle of the screen.
  678. > This is what I did in HeartQuest. I'm not sure if it's the most portable
  679. > one (though it seems to work on all present Macs - anyone know if it works
  680. > with A/UX?) but it's pretty easy. The drawback is that I have to deped
  681. > on a global that might go away some time.
  682. > >There doesn't seem to be any official way of
  683. > >doing either of these.
  684.  
  685. There is an official way, if the machine has the CursorDevice Manager. 
  686. This comes from my PowerMac specific code - I haven't written the Gestalt
  687. check yet, I still use low mem globals for 68k.
  688.  
  689.         /* Check Gestalt here for 68k (all PowerMacs have it) */
  690.         if (!gCrsrDevice) do {
  691.             CrsrDevNextDevice(&gCrsrDevice);
  692.         } while (gCrsrDevice && (gCrsrDevice->devClass != kDeviceClassMouse));
  693.  
  694.  
  695. ...
  696.  
  697.  
  698.     if (gCrsrDevice) {
  699.         CrsrDevMoveTo(gCrsrDevice, newPT.h, newPT.v);
  700.  }
  701.  else {
  702.     /* set using low memory globals */
  703.  }
  704.  
  705. +++++++++++++++++++++++++++
  706.  
  707. >From richard@rfbl.demon.co.uk (Richard Bleasdale)
  708. Date: Tue, 6 Dec 1994 04:02:57 GMT
  709. Organization: Demon Internet
  710.  
  711. In article <3bb7f5$4r7@cantua.canterbury.ac.nz>, greg@cosc.canterbury.ac.nz
  712. (Greg Ewing) wrote:
  713.  
  714. > Various games, such as Oxyd and Wolf 3D, use the
  715. > mouse as a relative rather than absolute motion
  716. > device. That is, moving the mouse causes some
  717. > corresponding motion in the game, but there is
  718. > no limit of the mouse hitting the edge of the
  719. > screen.
  720. > How is this accomplished? Two approaches I
  721. > can think of are:
  722. > (1) Somehow intercept the motion signals coming
  723. > from the mouse at a lower level than the usual
  724. > event mechanism.
  725. > (2) Periodically reset the pointer location to
  726. > the middle of the screen.
  727. > There doesn't seem to be any official way of
  728. > doing either of these. Does anyone know how
  729. > the trick is usually done, and what is the
  730. > least non-portable way of going about it?
  731. > Greg Ewing, Computer Science Dept, +--------------------------------------+
  732. > University of Canterbury,       | A citizen of NewZealandCorp, a      |
  733. > Christchurch, New Zealand       | wholly-owned subsidiary of Japan Inc.|
  734. > greg@cosc.canterbury.ac.nz       +--------------------------------------+
  735.  
  736. // I use this stuff in my code...
  737. //I cant remember how it works...But it still works on PowerPC
  738. void    StillMouseIncrement(Point*,Point*);
  739. void    StillMouseIncrement(Here,Inc)
  740. Point    *Here,*Inc;
  741. {/* see MacTutor July 1989 p 88 'Cursor Control' by Robert Gibson*/
  742. Point    *MTemp=(Point*)0x828,*RawMouse=(Point*)0x82c,*Mouse=(Point*)0x830;
  743. short    *CrsrNew=(short*)0x8ce;
  744. *Inc=*MTemp;
  745. Inc->v-=Here->v;
  746. Inc->h-=Here->h;
  747. *MTemp=*Here;
  748. *RawMouse=*Here;
  749. *Mouse=*Here;
  750. *CrsrNew=-1;
  751. }
  752.  
  753. Richard Bleasdale
  754. richard@rfbl.demon.co.uk
  755.  
  756. ---------------------------
  757.  
  758. >From ekstrom@aggroup.com (Harold Ekstrom)
  759. Subject: How to convert a Picture to a PixPat?
  760. Date: Wed, 30 Nov 1994 18:54:28 -0800
  761. Organization: Ag Group
  762.  
  763.  
  764. I'm trying to convert a pict (from the clipboard copied from the
  765. System 7.5 Desktop Patterns control panel) to a PixPat.
  766. Any help?
  767.  
  768. Thanks,
  769. harold
  770. - ------------------------------------------------------------
  771. Harold Ekstrom
  772. ekstrom@aggroup.com
  773. ag group, inc.
  774. 2540 camino diablo, suite 200
  775. walnut creek, ca 94596
  776. 510-937-7900 voice
  777. 510-937-2479 fax
  778. 510-937-6704 ara
  779. ftp.aggroup.com anonymous ftp
  780.  
  781.  
  782. +++++++++++++++++++++++++++
  783.  
  784. >From bhorling@trincoll.edu (Bryan Horling)
  785. Date: Sat, 03 Dec 1994 11:49:46 -0500
  786. Organization: Trinity College
  787.  
  788. In article <ekstrom-3011941854280001@harold.aggroup.com>,
  789. ekstrom@aggroup.com (Harold Ekstrom) wrote:
  790.  
  791. > I'm trying to convert a pict (from the clipboard copied from the
  792. > System 7.5 Desktop Patterns control panel) to a PixPat.
  793. > Any help?
  794.  
  795. You should just be able to paste it into a ppat resource (assumming it's <
  796. 64x64).  I think the Desktop Patterns are already in ppat resources in the
  797. first place, so if you opened it up with ResEdit you could cut & paste
  798. them directly into your program.
  799.  
  800. -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  801.        --Bryan Horling--       |  >>bhorling@mail.trincoll.edu<<
  802.        -Head Consultant-       |     Trinity College, #701235
  803.   "Do not use GAK on varnished |     300 Summit St
  804.     on unvarnished surfaces"   |     Hartford, CT 06106-3100
  805. -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  806.                 http://shakti.trincoll.edu/~bhorling
  807.  
  808. +++++++++++++++++++++++++++
  809.  
  810. >From Jens Alfke <jens_alfke@powertalk.apple.com>
  811. Date: Tue, 6 Dec 1994 17:40:16 GMT
  812. Organization: Apple Computer
  813.  
  814. Harold Ekstrom, ekstrom@aggroup.com writes:
  815. > I'm trying to convert a pict (from the clipboard copied from the
  816. > System 7.5 Desktop Patterns control panel) to a PixPat.
  817. > Any help?
  818.  
  819. You need to draw the picture into an offscreen GWorld of the proper
  820. dimensions, and then stuff the GWorld's PixMap into the PixPat. The hard part
  821. of this is figuring out the proper color table to use for the PixMap -- I had
  822. to write this stuff by hand for Wallpaper, but fortunately 7.0 and later
  823. include the Picture Utilities that will do things like generate a good color
  824. table for a PICT.
  825.  
  826. --Jens Alfke                           jens_alfke@powertalk.apple.com
  827.                    "A man, a plan, a yam, a can of Spam ... Bananama!"
  828.  
  829. ---------------------------
  830.  
  831. >From markr@owl-uk.co.uk (Mark Rogers)
  832. Subject: Info on BlockMoveData ?
  833. Date: Tue, 29 Nov 1994 15:27:25 GMT
  834. Organization: Office Workstations Ltd.
  835.  
  836. Does anyone know where I can get some information on the BlockMoveData
  837. trap. Specifically I want to know when it's safe to call and which
  838. systems it's available on. 
  839.  
  840. The only reference I can find is in Tech Note OS 05 "System Update 3.0"
  841. but I seem to recall seeing a more complete discussion sometime in the
  842. last 12 months.
  843.  
  844. Thanks,
  845.  
  846.     Mark Rogers (all opinions are my own)     
  847.     Office Workstations Ltd.
  848.     Edinburgh, UK
  849.     markr@owl-uk.co.uk
  850.  
  851.  
  852. +++++++++++++++++++++++++++
  853.  
  854. >From kenp@nmrfam.wisc.edu (Ken Prehoda)
  855. Date: Tue, 29 Nov 1994 14:45:10 -0600
  856. Organization: Univ of Wisc-Madison, Dept of Biochemistry
  857.  
  858. In article <D01C9p.D06@owl-uk.co.uk>, markr@owl-uk.co.uk (Mark Rogers) wrote:
  859.  
  860. > Does anyone know where I can get some information on the BlockMoveData
  861. > trap. Specifically I want to know when it's safe to call and which
  862. > systems it's available on. 
  863. > The only reference I can find is in Tech Note OS 05 "System Update 3.0"
  864. > but I seem to recall seeing a more complete discussion sometime in the
  865. > last 12 months.
  866.  
  867. It's always safe to call.  If it isn't present, then the regular,
  868. instruction cache flushing BlockMove is called.
  869.  
  870. I believe the only reference to BlockMoveData _is_ the tech note that you cite.
  871.  
  872. Ken Prehoda
  873. Department of Biochemistry
  874. University of Wisconsin-Madison
  875. kenp@nmrfam.wisc.edu
  876.  
  877. +++++++++++++++++++++++++++
  878.  
  879. >From larson@base.cs.ucla.edu (Christopher Larson)
  880. Date: 29 Nov 1994 22:45:38 GMT
  881. Organization: UCLA, Computer Science Department
  882.  
  883. In article <D01C9p.D06@owl-uk.co.uk> markr@owl-uk.co.uk (Mark Rogers) writes:
  884. >Does anyone know where I can get some information on the BlockMoveData
  885. >trap. Specifically I want to know when it's safe to call and which
  886. >systems it's available on. 
  887. >
  888. >The only reference I can find is in Tech Note OS 05 "System Update 3.0"
  889. >but I seem to recall seeing a more complete discussion sometime in the
  890. >last 12 months.
  891.  
  892. BlockMoveData() is just BlockMove() with one of the trap selector bits
  893. (or whatever those bits are called -- the same ones you use for SYS and
  894. CLEAR Memory Manager calls) set. This bit tells the OS that code was not
  895. moved so the instruction cache need not be flushed.
  896.  
  897. BlockMoveData() is just as safe as BlockMove(); you can use it at interrupt
  898. time, etc. Because BlockMoveData() uses the same trap as BlockMove(), it can
  899. be used on _any_ system. BlockMoveData() is implemented by extending the
  900. existing BlockMove() routine to examine this slector bit and change its
  901. cache flushing behavior acordingly. Thus, if BlockMoveData() is not
  902. implemented, a normal BlockMove() will occur, including the cache flush
  903. if the block was 12 (I think) bytes or longer.
  904.  
  905. BlockMoveData() is implemented in System Update 3.0 (as I'm sure you
  906. know) and System 7.5 (I think).
  907.  
  908. The only place I know that any of this is documented is the Tech Note you
  909. mention above. There was some discussion here (well, in csmp anyway) a
  910. while ago but I don't recall any official source of information entering
  911. the discussion.
  912.  
  913. Sorry about all the "I think"s, I'm away from my Mac at the moment.
  914.  
  915. --Chris
  916. _______________________________________________________________________________
  917. Chris Larson -- Amateur Macintosh Geek, CoBase Research Assistant
  918. L.A. Institute of Slowly and Painfully Working Out the Surprisingly Obvious
  919. Death to the Trojans! Go Bruins!
  920.  
  921. (Insert disclaimer here)
  922. Internet: larson@kingston.cs.ucla.edu
  923.  
  924. +++++++++++++++++++++++++++
  925.  
  926. >From jwbaxter@olympus.net (John W. Baxter)
  927. Date: Tue, 29 Nov 1994 14:05:42 -0800
  928. Organization: Internet for the Olympic Peninsula
  929.  
  930. In article <D01C9p.D06@owl-uk.co.uk>, markr@owl-uk.co.uk (Mark Rogers) wrote:
  931.  
  932. > Does anyone know where I can get some information on the BlockMoveData
  933. > trap. Specifically I want to know when it's safe to call and which
  934. > systems it's available on. 
  935.  
  936. BlockMoveData is safe to call anytime BlockMove is, unless what you are
  937. moving is object code.  BlockMoveData's job is to not flush the
  938. instruction cache on 68040 machines.  The trap differs from the BlockMove
  939. trap in only one bit...ROMs which don't know about BlockMoveData don't
  940. notice the bit, and execute BlockMove.
  941. --John
  942.  
  943. -- 
  944. John Baxter    Port Ludlow, WA, USA  [West shore, Puget Sound]
  945.    Sorry...clever signatures require cleverness, not found here.
  946.    jwbaxter@pt.olympus.net
  947.  
  948. ---------------------------
  949.  
  950. >From ftoth@cybernetics.net (Fred Toth)
  951. Subject: Installer advice please?
  952. Date: 2 Dec 1994 02:19:10 GMT
  953. Organization: Cybernetx, Inc.
  954.  
  955. Hi folks. We needed a slick installation package for our application
  956. some time ago. We looked briefly at the Apple installer stuff, but
  957. quickly settled on Stuffit Installer Maker from Aladdin (Great product!).
  958.  
  959. Now, of course, things have gotten more complicated, and we're 
  960. looking for solutions again. We need to do some things that Installer
  961. Maker won't do.
  962.  
  963. Could anyone advise on these issues:
  964.  
  965. 1. We know we can add functionality to Installer Maker by linking in
  966. C modules. How does this compare with off-the-shelf functionality
  967. available from Apple's installer?
  968.  
  969. 2. Putting together installation packages in Installer Maker is a snap.
  970. I've heard that creating Apple installer scripts is painful. Any comments?
  971.  
  972. 3. Are there other products out there that we should consider?
  973.  
  974. Many thanks,
  975.  
  976. Fred Toth, ftoth@cybernetics.net
  977.  
  978. +++++++++++++++++++++++++++
  979.  
  980. >From bsutter@aol.com (BSUTTER)
  981. Date: 7 Dec 1994 00:30:14 -0500
  982. Organization: America Online, Inc. (1-800-827-6364)
  983.  
  984. In article <3bm06u$cfb@jabba.cybernetics.net>, ftoth@cybernetics.net (Fred
  985. Toth) writes:
  986.  
  987. Hi!
  988. I work for MindVision software in Lincoln, NE
  989. (402)477-3269
  990. We have an installer application similar to InstallerMaker with MANY
  991. additional features.
  992. You can set up to 96 different packages.
  993. You can call external codes before and after every file that gets
  994. installed, so you can modify the file after it's installed, or whatever.
  995. You can get a full working version of the installer to try it out by
  996. calling Mindvision at the above phone number. All it does is bring up a
  997. slash screen saying it is an unauthorized copy, or something like that.
  998.  
  999. It's called Developer VISE. Several major companies are using it including
  1000. Intuit, Adobe, Apple (for internal software), Symantec, ...
  1001.  
  1002. Hope this helps,
  1003.  
  1004. Brian Sutter
  1005.  
  1006.  
  1007. +++++++++++++++++++++++++++
  1008.  
  1009. >From johannaa@eworld.com (Johanna Andrews)
  1010. Date: Fri, 09 Dec 1994 17:28:15 -0700
  1011. Organization: Apple Computer
  1012.  
  1013. In article <3bm06u$cfb@jabba.cybernetics.net>, ftoth@cybernetics.net (Fred
  1014. Toth) wrote:
  1015.  
  1016. > Hi folks. We needed a slick installation package for our application
  1017. > some time ago. We looked briefly at the Apple installer stuff, but
  1018. > quickly settled on Stuffit Installer Maker from Aladdin (Great product!).
  1019. > Now, of course, things have gotten more complicated, and we're 
  1020. > looking for solutions again. We need to do some things that Installer
  1021. > Maker won't do.
  1022. > Could anyone advise on these issues:
  1023. > 1. We know we can add functionality to Installer Maker by linking in
  1024. > C modules. How does this compare with off-the-shelf functionality
  1025. > available from Apple's installer?
  1026. > 2. Putting together installation packages in Installer Maker is a snap.
  1027. > I've heard that creating Apple installer scripts is painful. Any comments?
  1028. > 3. Are there other products out there that we should consider?
  1029. > Many thanks,
  1030. > Fred Toth, ftoth@cybernetics.net
  1031.  
  1032. Hi Fred,
  1033.  
  1034. Regarding Issue #1 - I've linked C modules into Apple installers, but
  1035. not Aladdin installers.  However, based on looking over Aladdin's
  1036. documentation,
  1037. I'd say Aladdin's functionality is roughly comparable with respect to this
  1038. feature.
  1039.  
  1040. Regarding issue #2 - The first time you create an Apple Installer it's
  1041. painful (fairly steep learning curve), but once you've written one
  1042. installer script it's not too bad.  One advantage the Aladdin installer
  1043. offers is that compression is automatic while the Apple installer requires
  1044. that files be compressed separately if compression is desired, using a
  1045. separate compression tool (such as InstaCompOne, which I believe is
  1046. included in the Installer 4.0.3 SDK).  Also, Aladdin Installers I have
  1047. created have been smaller and faster than analagous Apple Installers when
  1048. compression was necessary.
  1049.  
  1050. It used to be that InstallerMaker had significantly fewer features than
  1051. Apple's installer and was less flexible, but in the 2.0 version, Aladdin is
  1052. catching up.  However, Apple's custom install interface is still much more
  1053. configurable than Aladdin's.  Also, you can create updaters with the Apple
  1054. Installer (merging resources into existing files is supported) but not with
  1055. InstallerMaker.
  1056.  
  1057. I can't address issue #3, since I haven't checked out any other products.
  1058.  
  1059. In general, I would recommend that you figure out exactly what your
  1060. installer
  1061. needs to do and then find the package that offers the features you require
  1062. for the best price.
  1063.  
  1064. Good Luck,
  1065.  
  1066. Johanna Andrews
  1067. johannaa@eworld.com
  1068.  
  1069. ---------------------------
  1070.  
  1071. >From h+@metrowerks.com (Jon W{tte)
  1072. Subject: Mac FAQ now available as HTML using WWW!
  1073. Date: Mon, 05 Dec 1994 22:32:08 +0100
  1074. Organization: The Conspiracy
  1075.  
  1076. There are some issues about the FAQ:
  1077.  
  1078. 1) Someone keeps posting old and outdated versions of the FAQ 
  1079. questions in the info group. The real FAQ is only posted in 
  1080. comp.sys.mac.programmer, comp.answers and news.answers, and 
  1081. available for ftp on rtfm.mit.edu and nada.kth.se.
  1082.  
  1083. 2) The FAQ is now available as HTML document, either using 
  1084. ftp://ftp.nada.kth.se/pub/hacks/mac-faq/mac-faq.html OR from my 
  1085. home page http://www.nada.kth.se/~d88-jwa.
  1086.  
  1087. The HTML version is parsed from the "real" version using a 
  1088. simple parser I wrote, so there may be strangenesses or 
  1089. inelegancies. Please report them to me.
  1090.  
  1091. 3) The new co-maintainer and butler of the FAQ is Chris; 
  1092. THUNDERONE@Delphi.com. Mail your bug reports, requests etc to 
  1093. him; he collects it all and sends me a new, updated FAQ once a 
  1094. month.
  1095.  
  1096. Cheers,
  1097.  
  1098.                 / h+
  1099.  
  1100.  
  1101. --
  1102.   Jon W‰tte (h+@metrowerks.com), Hagagatan 1, 113 48 Stockholm, Sweden
  1103.    Had I known that I would program Macintosh for a living
  1104.    maybe I would have turned away from computers altogether.
  1105.                                             -- Hao-yang Wang
  1106.  
  1107.  
  1108. ---------------------------
  1109.  
  1110. >From zviki@techunix.technion.ac.il (Zviki Cohen)
  1111. Subject: PowerPlant vs. MacApp - opinions ?
  1112. Date: Wed, 9 Nov 1994 08:42:38 GMT
  1113. Organization: TECHNION - Izrael Institute of Technology
  1114.  
  1115.     Hello !
  1116.  
  1117.     Well, the title says most of it - I'm about to start a project using
  1118. CodeWarrior and I can choose to use either PowerPlant or MacApp. Which one is
  1119. better ?  Are there any major diffrences that anyone can point out ?
  1120.  
  1121.         TIA,
  1122.                 Zviki Cohen
  1123.  
  1124.  
  1125.  
  1126. +++++++++++++++++++++++++++
  1127.  
  1128. >From jwbaxter@olympus.net (John W. Baxter)
  1129. Date: Wed, 09 Nov 1994 10:25:02 -0800
  1130. Organization: Internet for the Olympic Peninsula
  1131.  
  1132. In article <Cyzs73.1uq@discus.technion.ac.il>,
  1133. zviki@techunix.technion.ac.il (Zviki Cohen) wrote:
  1134.  
  1135. >         Hello !
  1136. >         Well, the title says most of it - I'm about to start a project using
  1137. > CodeWarrior and I can choose to use either PowerPlant or MacApp. Which one is
  1138. > better ?  Are there any major diffrences that anyone can point out ?
  1139.  
  1140. MacApp:   Solid, stolid old code (more than 10 years old in concept...it
  1141. was being worked on before first Mac release).  At the same time, it's
  1142. based on oldish design ideas, and it has fallen behind the new additions
  1143. to the Mac Op Sys (can't say "Mac OS" any more without a license). 
  1144. [Version 3.5 will somewhat catch up.]  Essentially based on a tree
  1145. structure of classes (although your own code need not be part of the
  1146. tree...you can use your own classes not based on TObject if you like, and
  1147. it's often best for the "engine" part of your code).  Can build for System
  1148. 6 (if that matters to you).
  1149.  
  1150. PowerPlant:  Fresh and new, still evolving.  Based on a forest structure,
  1151. and the dependencies between classes are reduced as much as possible. 
  1152. [You can pick up the menu handling and use just that in your own app, just
  1153. as an example...no easy way to do that with MacApp.]  PP apps are
  1154. scriptable and recordable unless you go out of  your way to break that. 
  1155. Apps require System 7.
  1156.  
  1157. PowerPlant is Greg Dow's second chance to do this (TCL having been the
  1158. first), and he's taking good advantage of the more modern tools at his
  1159. disposal.
  1160.  
  1161. Bottom line:  it depends.
  1162.  
  1163.    --John
  1164.  
  1165. -- 
  1166. John Baxter    Port Ludlow, WA, USA  [West shore, Puget Sound]
  1167.    Sorry...clever signatures require cleverness, not found here.
  1168.    jwbaxter@pt.olympus.net
  1169.  
  1170. +++++++++++++++++++++++++++
  1171.  
  1172. >From red.riders
  1173. Date: Thu, 10 Nov 1994 00:53:57 -0500
  1174. Organization: DSC/Voicenet - BBS/Unix Shells/SLIP/NEWS - (215)443-7390
  1175.  
  1176. In article <jwbaxter-0911941025020001@ptpm002.olympus.net>,
  1177. jwbaxter@olympus.net (John W. Baxter) wrote:
  1178.  
  1179. > Bottom line:  it depends.
  1180.  
  1181. Yeah, on when you actually want to ship your app.
  1182.  
  1183. This is not a knock on PP. It simply is not yet
  1184. ready to do big time apps. Yet. MacApp today is
  1185. by FAR the best Mac framework solution available. Con-
  1186. trary to popular belief, it really isn't even a 
  1187. close race, unless you're making an app that has
  1188. relatively limited scope (like some sort of utility).
  1189.  
  1190. I would use anything that was better. I have no
  1191. hidden agendas against TCL or PP. Both have their
  1192. good points. I used TCL before MacApp in order to
  1193. avoid having to climb MacApp's (overstated) learning
  1194. curve. And I seriously examined PP and it's "modern"
  1195. approach to application design. Shows good promise, but it
  1196. simply is not yet something I would rely upon, or stake
  1197. my reputation upon when delivering a product.
  1198.  
  1199. Forget the "forest" and "monolithic" garbage. It doesn't
  1200. matter in a big app, particularly when the monolith is
  1201. a giant body of code that you never have to change.
  1202.  
  1203. Apple wants you to write OpenDoc parts; so they are telling
  1204. you that monolithic OOP frameworks are dinosaurs. Keep in
  1205. mind that Apple also told you that 040's were dinosaurs
  1206. the day PPC machines shipped. Still selling plenty 040 boxes
  1207. though.
  1208.  
  1209. Don't believe their hogwash, unless you plan on
  1210. writing something today that 0.0% of Mac users are currently
  1211. waiting for (OpenDoc parts). If you can wait 3 years to get
  1212. paid, then write OD parts. If you want to ship an app in 3-6
  1213. months, then MacApp is like having a ticket on the Concorde.
  1214.  
  1215. You will not believe how fast a MacApp application comes together.
  1216.  
  1217. Schedules are measured in days, not months. You can struggle with
  1218. PP today, and be an expert. OR you could ship product NOW, and
  1219. learn PP when it's API stops changing, and is stable enough to
  1220. take seriously.
  1221.  
  1222. MacApp is remarkably detailed, solid, and capable.
  1223. PP is really years away from this level of polish, and those
  1224. who are using it today are hampered by the amount of
  1225. stuff they have to write (and debug!) that MacApp users
  1226. have taken for granted for years. Tons and tons of services
  1227. are in MacApp, that PP may never have.
  1228.  
  1229. PP is catching up to MacApp faster than MacApp is pulling
  1230. away. Soon the choice will be a tough one. But not today.
  1231. The best thing to do is learn a bit about PP, and it's
  1232. ways and methodologies. Plan on possibly migrating to PP in the
  1233. future. Maybe you won't ever do it, but good OOP design will
  1234. allow your classes to function under EITHER framework; IF you
  1235. plan, design, and code your stuff with this mindset.
  1236.  
  1237. SOLID knowledge and use of C++ will help you a lot. Worth the effort.
  1238. Whatever you do though, USE CODEWARRIOR!!!!
  1239.  
  1240. the red riders!
  1241.  
  1242. +++++++++++++++++++++++++++
  1243.  
  1244. >From dkevery@aol.com (DKEvery)
  1245. Date: 10 Nov 1994 13:20:07 -0500
  1246. Organization: America Online, Inc. (1-800-827-6364)
  1247.  
  1248. Also...
  1249.  
  1250. MacApp abstracts you MORE from the toolbox (not completely, but
  1251. more-so).... and has more layers, and is a more full featured FrameWork
  1252. (not better, just more abstracted and more to learn).
  1253.  
  1254. For the most part if you are learning a framework and come from Mac
  1255. Programming... the PowerPlant will be much easier and better.... if you
  1256. are coming from heavy OOP and don't understand Mac programming (and have
  1257. to learn everything anyways)... then MacApp is probably better.
  1258.  
  1259. +++++++++++++++++++++++++++
  1260.  
  1261. >From aberno@genome.stanford.edu (Anthony Berno)
  1262. Date: Thu, 10 Nov 1994 13:31:34 -0800
  1263. Organization: Stanford DNA Sequence and Technology Center
  1264.  
  1265. In article
  1266. <red.riders-1011940053570001@slip-199-234-232-125.voicenet.com>,
  1267. red.riders wrote:
  1268.  
  1269. > In article <jwbaxter-0911941025020001@ptpm002.olympus.net>,
  1270. > jwbaxter@olympus.net (John W. Baxter) wrote:
  1271. > > Bottom line:  it depends.
  1272. > Yeah, on when you actually want to ship your app.
  1273.  
  1274. Unfortunately, this is true. PP, although it is a nice start, is a very
  1275. thin and cantankerous framework. Although it is much better than TCL
  1276. (which is, imho, a creeping horror that deserves to die) I would have been
  1277. much better off with MacApp in my current project, and I wish I had
  1278. started with that instead of PP.
  1279.  
  1280. The main problem is that the classes are not abstract enough - you still
  1281. have to dig around in the internals. For example, in using a popup menu, I
  1282. actually have to fiddle with the menu handle! That sucks! And, I've been
  1283. trying for half an hour to get my popup to show a particular item when it
  1284. is first created, and I can't manage it. Aargh!
  1285.  
  1286. Also, the classes are not very robust. For example, if you forget to call
  1287. UDesktop::Deactivate and UDesktop::Activate before and after a call that
  1288. generates a modal dialog, your desktop will be permanently screwed, and
  1289. won't figure out by itself that something is wrong.
  1290.  
  1291. I haven't actually *written* anything with MacApp, but unless PP gets a
  1292. lot better, I'm not going to use it for my next project. Even though
  1293. MacApp doesn't seem to support AEOM, it looks like the better choice. 
  1294.  
  1295. (Actually, I'd rather be using Dylan. ;-)
  1296.  
  1297. > SOLID knowledge and use of C++ will help you a lot. Worth the effort.
  1298. > Whatever you do though, USE CODEWARRIOR!!!!
  1299.  
  1300. Hear hear. Excellent advice.
  1301.  
  1302. -Anthony
  1303.  
  1304. +++++++++++++++++++++++++++
  1305.  
  1306. >From Jaeger@fquest.com (Brian Stern)
  1307. Date: 11 Nov 1994 04:12:11 GMT
  1308. Organization: The University of Texas at Austin, Austin, Texas
  1309.  
  1310. In article <aberno-1011941331340001@lyapunov.stanford.edu>,
  1311. aberno@genome.stanford.edu (Anthony Berno) wrote:
  1312.  
  1313. < The main problem is that the classes are not abstract enough - you still
  1314. < have to dig around in the internals. For example, in using a popup menu, I
  1315. < actually have to fiddle with the menu handle! That sucks! And, I've been
  1316. < trying for half an hour to get my popup to show a particular item when it
  1317. < is first created, and I can't manage it. Aargh!
  1318. Try this:      
  1319.  
  1320. thePopUp->SetValue( 5 );//Sets the popup to the 5th item in the menu
  1321.  
  1322. Although I will say that LListBox has no methods for adding rows
  1323. or columns.
  1324.  
  1325. < Also, the classes are not very robust. For example, if you forget to call
  1326. < UDesktop::Deactivate and UDesktop::Activate before and after a call that
  1327. < generates a modal dialog, your desktop will be permanently screwed, and
  1328. < won't figure out by itself that something is wrong.
  1329.  
  1330. This is mentioned in the docs and one of the sample apps.
  1331.  
  1332. < -Anthony
  1333.  
  1334. -- 
  1335. Brian  Stern  :-{)}
  1336. Toolbox commando and Menu bard
  1337. Jaeger@fquest.com
  1338.  
  1339. +++++++++++++++++++++++++++
  1340.  
  1341. >From scouten@uiuc.edu (Eric Scouten)
  1342. Date: Fri, 11 Nov 1994 10:08:28 -0600
  1343. Organization: University of Illinois
  1344.  
  1345. In article <Jaeger-1011942216470001@slip-23-2.ots.utexas.edu>,
  1346. Jaeger@fquest.com (Brian Stern) wrote:
  1347.  
  1348. > In article <aberno-1011941331340001@lyapunov.stanford.edu>,
  1349. > aberno@genome.stanford.edu (Anthony Berno) wrote:
  1350. > < The main problem is that the classes are not abstract enough - you still
  1351. > < have to dig around in the internals. For example, in using a popup menu, I
  1352. > < actually have to fiddle with the menu handle! That sucks!
  1353.  
  1354. Really. I actually rather like it. It's part of what makes PowerPlant a
  1355. nice, lightweight class library.
  1356.  
  1357. -es
  1358.  
  1359. __________________________________________________________________________
  1360. Eric Scouten <scouten@uiuc.edu> * MS Comp Sci '96, Univ of Illinois
  1361.  
  1362. IMPORTANT NOTICE TO READERS: The entire physical universe, including this
  1363. message, may one day collapse back into an infinitesimally small space.
  1364. Should another universe subsequently re-emerge, the existence of this message
  1365. cannot be guaranteed.
  1366.    -with apologies to Devine & Cohen (Absolute Zero Gravity)
  1367.  
  1368. +++++++++++++++++++++++++++
  1369.  
  1370. >From sw@network-analysis-ltd.co.uk (Sak Wathanasin)
  1371. Date: Sat, 12 Nov 94 21:24:37 GMT
  1372. Organization: Network Analysis Ltd
  1373.  
  1374.  
  1375. In article <1994Nov11.221337.1940@newsserver.rrzn.uni-hannover.de> 
  1376. (comp.sys.mac.programmer.codewarrior,comp.sys.mac.programmer), 
  1377. McCammond@sgi.siemens.com (McCammond) writes:
  1378.  
  1379. > If the design ideas in
  1380. > PowerPlant had been incorporated into the application I'm working on (a
  1381. > 500,000 line MacApp application--yes 500,000 lines) when it was
  1382. > created, then I would have a lot fewer headaches.
  1383.  
  1384. So are you converting that 500K line appl to PP? If so, how did you fare? If 
  1385. not, why not?
  1386.  
  1387. Sak Wathanasin
  1388. Network Analysis Limited
  1389. 178 Wainbody Ave South, Coventry CV3 6BX, UK
  1390.  
  1391. Internet: sw@network-analysis-ltd.co.uk 
  1392. uucp:     ...!uknet!nan!sw                       AppleLink: NAN.LTD
  1393. Phone: (+44) 203 419996 Mobile:(+44) 850 587411  Fax: (+44) 203 690690
  1394.  
  1395. +++++++++++++++++++++++++++
  1396.  
  1397. >From aberno@genome.stanford.edu (Anthony Berno)
  1398. Date: Mon, 14 Nov 1994 09:45:14 -0800
  1399. Organization: Stanford DNA Sequence and Technology Center
  1400.  
  1401.  
  1402. In article <Jaeger-1011942216470001@slip-23-2.ots.utexas.edu>,
  1403. Jaeger@fquest.com (Brian Stern) wrote:
  1404.  
  1405. > Try this:      
  1406. > thePopUp->SetValue( 5 );//Sets the popup to the 5th item in the menu
  1407.  
  1408. ...Except, of course, this didn't work. The reason it didn't work cuts to
  1409. the core of what I've been trying to say about the design of PowerPlant.
  1410.  
  1411. Because I had a popup whose contents were not determined until runtime, I
  1412. had to add items to the popup. Because there is no method for doing this,
  1413. I had to add it to the Mac menu directly, using GetMacMenuH() to retrieve
  1414. it.
  1415.  
  1416. The menu started out with zero items, so of course the value in mMaxValue
  1417. was zero. When adding values to the menu handle, I forgot to also update
  1418. the value in mMaxValue, thus causing the object to be in an internally
  1419. inconsistent state.
  1420.  
  1421. When I tried to use SetValue(), it said, "Oh, that is greater than the
  1422. maximum value of zero, so I will set the popup menu's value to zero
  1423. without telling the programmer about it."
  1424.  
  1425. This is an easy mistake to make, and it came about ***because the
  1426. encapsulation of the class was broken by forcing me to access the menu
  1427. handle***. 
  1428.  
  1429. The exposure of the MenuHandle goes against the most basic principles of
  1430. object-oriented design. The WHOLE POINT of having objects is so that you
  1431. can do things without having to worry about maintaining their internal
  1432. state. This is much more important than polymorphism, multiple
  1433. inheritance, or any other object-oriented feature. While I respect a lot
  1434. of things that Greg Dow has done, and I really like a lot of things about
  1435. PowerPlant, things like this waste an enormous amount of time and money. 
  1436.  
  1437. > Although I will say that LListBox has no methods for adding rows
  1438. > or columns.
  1439.  
  1440. Indeed. This results in the same problems I describe above. LListBox has
  1441. such simple behavior, I think it would be easier to implement it without
  1442. the ListManager.
  1443.  
  1444. > < Also, the classes are not very robust. For example, if you forget to call
  1445. > < UDesktop::Deactivate and UDesktop::Activate before and after a call that
  1446. > < generates a modal dialog, your desktop will be permanently screwed, and
  1447. > < won't figure out by itself that something is wrong.
  1448. > < 
  1449. > This is mentioned in the docs and one of the sample apps.
  1450.  
  1451. Documentation is not design, and does not substitute for it.There should
  1452. be consistency checks in UDesktop to catch these things. A major
  1453. difference between a good and bad framework is how often you have to run
  1454. back to the documentation - a good framework does what you expect, with no
  1455. surprises. 
  1456.  
  1457. -Anthony
  1458.  
  1459. +++++++++++++++++++++++++++
  1460.  
  1461. >From aberno@genome.stanford.edu (Anthony Berno)
  1462. Date: Mon, 14 Nov 1994 10:54:41 -0800
  1463. Organization: Stanford DNA Sequence and Technology Center
  1464.  
  1465. In article <1994Nov11.221337.1940@newsserver.rrzn.uni-hannover.de>,
  1466. McCammond@sgi.siemens.com (McCammond) wrote:
  1467.  
  1468. > What the heck, I'll play devil's advocate…
  1469. > (step up on the soap box)
  1470.  
  1471. [lots about PP deleted]
  1472.  
  1473. Yes, to be fair, I have to agree with your points about the design of
  1474. PowerPlant. The intelligent use of multiple inheritance is an enormous
  1475. advantage.
  1476.  
  1477. After all the negativity I've generated, I want to second the notion that
  1478. PP does have a lot going for its future, despite what I consider to be
  1479. some serious problems at present. I hope (dearly!) that PP evolves into
  1480. the robust, elegant framework that it deserves to be.
  1481.  
  1482. -Anthony
  1483.  
  1484. +++++++++++++++++++++++++++
  1485.  
  1486. >From rondavis@datawatch.com (Ron Davis)
  1487. Date: Mon, 14 Nov 1994 15:40:00 -0400
  1488. Organization: Creative Cybernetics -online services (704-549-5553 voice)
  1489.  
  1490. I'm going to jump in on this because I'm taking a break from cursing MPW
  1491. and MacApp.  I just recieved a rather small MacApp app (if there is such a
  1492. thing) that I have to make some modifications to.  It is driving me up the
  1493. wall.  I guess I'm spoiled I've been using PP for the last three or four
  1494. months and it is so much easier.  
  1495.  
  1496. MacApp is too big and complicated.  You have to have a special tool just
  1497. to compile something in it.  PP is lean.  
  1498.  
  1499. You have to have an idea what all of MacApp is doing from the beginning. 
  1500. In PP you only have to learn the parts you are using.
  1501.  
  1502. MacApp has its own special way of handling memory and segments.  PP
  1503. doesn't screw around with the basic structure of a Mac program.  This
  1504. memory thing is why it is so hard to get MacApp to work under
  1505. CodeWarrior.  I understand the people from Symantec got PP running under
  1506. thier system in a matter of hours, where as they never got MacApp to work
  1507. with Think.
  1508.  
  1509. And finally, didn't Apple announce they  weren't going to support MacApp
  1510. anymore?  Or was this a post-Bedrock promise that has been recended?
  1511.  
  1512. Ahhh...I feel better letting a little of that steam.
  1513.  
  1514. ___________________________________________________________________________
  1515. "I want to know God's thoughts...the rest are details."
  1516.                                            -- Albert Einstein
  1517. _________________________________________
  1518. Ron Davis                                  rondavis@datawatch.com        Datawatch, Research Triangle Park, NC      (919)549-0711
  1519.             **** Opinions are MINE, not Datawatch's. ****
  1520.         **** They don't pay me enough to own my opinions ****
  1521.  
  1522. +++++++++++++++++++++++++++
  1523.  
  1524. >From greg@cosc.canterbury.ac.nz (Greg Ewing)
  1525. Date: 15 Nov 1994 01:29:42 GMT
  1526. Organization: University of Canterbury, Christchurch, New Zealand
  1527.  
  1528.  
  1529. In article <aberno-1411940945140001@lyapunov.stanford.edu>, aberno@genome.stanford.edu (Anthony Berno) writes:
  1530. |> 
  1531. |> ...Except, of course, this didn't work. The reason it didn't work cuts to
  1532. |> the core of what I've been trying to say about the design of PowerPlant.
  1533.  
  1534. What you're complaining about doesn't seem to me to be
  1535. a fundamental flaw in the design of PowerPlant. It's
  1536. just a reflection of the fact that the class you're
  1537. using wasn't designed to do what you want.
  1538.  
  1539. Whenever you want to extend a class to do something
  1540. its author hadn't anticipated, you have to be prepared
  1541. to understand some of its internals.
  1542.  
  1543. |> This is an easy mistake to make, and it came about ***because the
  1544. |> encapsulation of the class was broken by forcing me to access the menu
  1545. |> handle***. 
  1546.  
  1547. Make yourself a subclass, and add a method which adds a
  1548. menu item and does whatever is necessary to keep the
  1549. internal state consistent. Now you have a new, properly
  1550. encapsulated class which does what you want. Put it
  1551. away for future use. If you're feeling generous enough,
  1552. post it to the net.
  1553.  
  1554. PowerPlant certainly does not yet do everything
  1555. everyone might want it to do. But you've given no
  1556. reason why the basic structure is not sufficient to
  1557. build upon.
  1558.  
  1559. |> LListBox has
  1560. |> such simple behavior, I think it would be easier to implement it without
  1561. |> the ListManager.
  1562.  
  1563. I can believe that. Recently I added a list view class to a
  1564. framework of my own I've been developing in Object Pascal.
  1565. I didn't even consider using the List Manager - it would
  1566. have taken more contortions just to interface it to my
  1567. object-oriented code than it took to do it all from
  1568. scratch. 
  1569.  
  1570. In today's environment of OO frameworks, it seems to me
  1571. that the List Manager is obsolete. I'd also almost say the
  1572. same thing about the Window and Control managers, insofar
  1573. as much of what they do could have been done much more
  1574. neatly if the whole toolbox had been written in an OO
  1575. language from the beginning, which it should have been!
  1576.  
  1577. |> -Anthony
  1578.  
  1579. Greg Ewing, Computer Science Dept, +--------------------------------------+
  1580. University of Canterbury,       | A citizen of NewZealandCorp, a      |
  1581. Christchurch, New Zealand       | wholly-owned subsidiary of Japan Inc.|
  1582. greg@cosc.canterbury.ac.nz       +--------------------------------------+
  1583.  
  1584. +++++++++++++++++++++++++++
  1585.  
  1586. >From sandvik@apple.com (Kent Sandvik)
  1587. Date: Mon, 14 Nov 1994 22:30:55 -0800
  1588. Organization: Apple Computer, Inc. Developer Technical Support
  1589.  
  1590. In article <3a92u6$io8@cantua.canterbury.ac.nz>,
  1591. greg@cosc.canterbury.ac.nz (Greg Ewing) wrote:
  1592. > In today's environment of OO frameworks, it seems to me
  1593. > that the List Manager is obsolete. I'd also almost say the
  1594. > same thing about the Window and Control managers, insofar
  1595. > as much of what they do could have been done much more
  1596. > neatly if the whole toolbox had been written in an OO
  1597. > language from the beginning, which it should have been!
  1598.  
  1599. They were, actually -- Lisa Toolbox. And there was a reason these were
  1600. rewritten in hand-coded asm in the Mac incarnation. But I agree, CPUs are
  1601. now fast enough to handle additional overhead of the toolbox.
  1602.  
  1603. --Kent
  1604.  
  1605. -- 
  1606. Kent Sandvik   sandvik@apple.com   New Media Analyst/Programmer
  1607. Private activities on Internet.
  1608.  
  1609. +++++++++++++++++++++++++++
  1610.  
  1611. >From aberno@genome.stanford.edu (Anthony Berno)
  1612. Date: Tue, 15 Nov 1994 09:06:13 -0800
  1613. Organization: Stanford DNA Sequence and Technology Center
  1614.  
  1615. In article <3a92u6$io8@cantua.canterbury.ac.nz>,
  1616. greg@cosc.canterbury.ac.nz (Greg Ewing) wrote:
  1617.  
  1618. > In article <aberno-1411940945140001@lyapunov.stanford.edu>,
  1619. aberno@genome.stanford.edu (Anthony Berno) writes:
  1620. > |> 
  1621. > |> ...Except, of course, this didn't work. The reason it didn't work cuts to
  1622. > |> the core of what I've been trying to say about the design of PowerPlant.
  1623. > What you're complaining about doesn't seem to me to be
  1624. > a fundamental flaw in the design of PowerPlant. It's
  1625. > just a reflection of the fact that the class you're
  1626. > using wasn't designed to do what you want.
  1627. > Whenever you want to extend a class to do something
  1628. > its author hadn't anticipated, you have to be prepared
  1629. > to understand some of its internals.
  1630.  
  1631. Just a sec here... all I wanted to do was to add an item to a popup menu!
  1632. Saying "the class wasn't designed for that" is like saying "This car
  1633. wasn't designed to have gas put into the tank" after it explodes at the
  1634. gas station.
  1635.  
  1636. -Anthony
  1637.  
  1638. +++++++++++++++++++++++++++
  1639.  
  1640. >From scott@kaiwan.kaiwan.com (Scott Ellsworth)
  1641. Date: 15 Nov 1994 09:24:00 -0800
  1642. Organization: KAIWAN Internet (310/527-4279,818/756-0180,714/638-4133)
  1643.  
  1644. One minor point - I was always taught to add methods to a class when 
  1645. modifying base behaviors.  Thus, whenever I need to fiddle with the 
  1646. underlying mac stuff, I wrap a member function around it and make sure 
  1647. that I fiddle with PowerPlant internals at the same time/place.
  1648.  
  1649. I realize that putting the modified behavior in a class wrapper does not 
  1650. magically cause it to understand the PP internals, and it would be really 
  1651. handy if one never needed to modify the internals, but I find that it 
  1652. works as a good reminder to me that I have to make sure I am not stomping 
  1653. on any behaviors.
  1654.  
  1655. Scott
  1656.  
  1657. -- 
  1658. Scott Ellsworth          scott@kaiwan.com
  1659. Missing mudders, put your email addrs in the directory!
  1660. "This is the aorta of the last person to ask me that" - Scott Adams
  1661.  
  1662. +++++++++++++++++++++++++++
  1663.  
  1664. >From greg@cosc.canterbury.ac.nz (Greg Ewing)
  1665. Date: 15 Nov 1994 22:27:46 GMT
  1666. Organization: University of Canterbury, Christchurch, New Zealand
  1667.  
  1668.  
  1669. In article <sandvik-1411942230550001@mac62.kip.apple.com>, sandvik@apple.com (Kent Sandvik) writes:
  1670. |> And there was a reason these were
  1671. |> rewritten in hand-coded asm in the Mac incarnation.
  1672.  
  1673. But they could have written it in OO assembly language...
  1674.  
  1675. |> Kent Sandvik   sandvik@apple.com   New Media Analyst/Programmer
  1676.  
  1677. Greg Ewing, Computer Science Dept, +--------------------------------------+
  1678. University of Canterbury,       | A citizen of NewZealandCorp, a      |
  1679. Christchurch, New Zealand       | wholly-owned subsidiary of Japan Inc.|
  1680. greg@cosc.canterbury.ac.nz       +--------------------------------------+
  1681.  
  1682. +++++++++++++++++++++++++++
  1683.  
  1684. >From greg@cosc.canterbury.ac.nz (Greg Ewing)
  1685. Date: 15 Nov 1994 22:34:18 GMT
  1686. Organization: University of Canterbury, Christchurch, New Zealand
  1687.  
  1688.  
  1689. In article <aberno-1511940906130001@lyapunov.stanford.edu>, aberno@genome.stanford.edu (Anthony Berno) writes:
  1690. |> Saying "the class wasn't designed for that" is like saying "This car
  1691. |> wasn't designed to have gas put into the tank" after it explodes at the
  1692. |> gas station.
  1693.  
  1694. You seemed to be saying "The author of PopUpMenu forgot to
  1695. include a method for adding items, so the basic, underlying
  1696. structure of PowerPlant is fundamentally and hopelessly
  1697. flawed!"
  1698.  
  1699. That's what I was arguing against.
  1700.  
  1701. |> -Anthony
  1702.  
  1703. Greg Ewing, Computer Science Dept, +--------------------------------------+
  1704. University of Canterbury,       | A citizen of NewZealandCorp, a      |
  1705. Christchurch, New Zealand       | wholly-owned subsidiary of Japan Inc.|
  1706. greg@cosc.canterbury.ac.nz       +--------------------------------------+
  1707.  
  1708. +++++++++++++++++++++++++++
  1709.  
  1710. >From Darryl Trujillo <dmt@pairoducks.com>
  1711. Date: Tue, 15 Nov 1994 21:55:42 GMT
  1712. Organization: Occidental Palace
  1713.  
  1714. In article <rondavis-1411941540000001@groomlake.datawatch.com> Ron Davis,
  1715. rondavis@datawatch.com writes:
  1716. >MacApp has its own special way of handling memory and segments.  PP
  1717. >doesn't screw around with the basic structure of a Mac program.  This
  1718. >memory thing is why it is so hard to get MacApp to work under
  1719. >CodeWarrior.  I understand the people from Symantec got PP running under
  1720. >thier system in a matter of hours, where as they never got MacApp to work
  1721. >with Think.
  1722.  
  1723. I think this had more to do with Think's lack of support for #pragma
  1724. segment than basic MacApp design.
  1725.  
  1726.     - dmt
  1727.  
  1728. +++++++++++++++++++++++++++
  1729.  
  1730. >From Bruce@hoult.actrix.gen.nz (Bruce Hoult)
  1731. Date: Wed, 16 Nov 1994 22:55:24 +1300 (NZDT)
  1732. Organization: (none)
  1733.  
  1734. greg@cosc.canterbury.ac.nz (Greg Ewing) writes:
  1735. > In article <aberno-1511940906130001@lyapunov.stanford.edu>, aberno@genome.stanford.edu (Anthony Berno) writes:
  1736. > |> Saying "the class wasn't designed for that" is like saying "This car
  1737. > |> wasn't designed to have gas put into the tank" after it explodes at the
  1738. > |> gas station.
  1739. > You seemed to be saying "The author of PopUpMenu forgot to
  1740. > include a method for adding items, so the basic, underlying
  1741. > structure of PowerPlant is fundamentally and hopelessly
  1742. > flawed!"
  1743. > That's what I was arguing against.
  1744.  
  1745. If MWerks say "we're planning to add more functionality in CW6" then fine.
  1746.  
  1747. But they seem to be saying: "We're not going to add that functionailty.  Not
  1748. encapsulating the underlying toolbox capabilities is a design feature, not
  1749. an oversight."
  1750.  
  1751. If they're going to take that kind of approach (which I disagree with), and
  1752. make the programmer reach through and fondle toolbox structures by themselves
  1753. anyway, then they shouldn't be caching *any* data (such as the number of items
  1754. in the menu) in the PP object.  If it's oversight they are forgiven.  If it's
  1755. by design, it's wrong.
  1756.  
  1757. -- Bruce
  1758.  
  1759. +++++++++++++++++++++++++++
  1760.  
  1761. >From pgontier@novell.com (Pete Gontier)
  1762. Date: Wed, 16 Nov 1994 11:41:33 -0700
  1763. Organization: Novell, Inc., Walnut Creek /Macintosh Site
  1764.  
  1765. In article <aberno-1511940906130001@lyapunov.stanford.edu>, 
  1766. aberno@genome.stanford.edu (Anthony Berno) wrote:
  1767.  
  1768. > Just a sec here... all I wanted to do was to add an item to a popup menu!
  1769. > Saying "the class wasn't designed for that" is like saying "This car
  1770. > wasn't designed to have gas put into the tank" after it explodes at the
  1771. > gas station.
  1772.  
  1773. Nobody said the class wasn't broken. (Nobody said it was, either, but I am
  1774. assuming for the sake of discussion that your observations about it are
  1775. damning enough that most reasonable observers would consider it broken.)
  1776. However, your earlier post seemed to claim that since the popup menu class
  1777. is broken, PowerPlant is broken. That's a generalization fallacy. I'm not
  1778. exactly what I would call a PowerPlant fan, but bashing its overall design
  1779. because of the deficiencies of one class is wrong.
  1780.  
  1781. A much more constructive use of your energy would be to alter the popup
  1782. menu class to work the way you want it to and send your changes to
  1783. Metrowerks, through which they will be routed to Greg. He's a receptive
  1784. guy.
  1785.  
  1786. If all you want is a popup menu that works the way you want it, then
  1787. sub-classing is another option. I'd rather see sub-classing used to add
  1788. functionality than to correct deficiencies, though.
  1789.  
  1790. -- 
  1791.  
  1792.  Views expressed here do not necessarily reflect those of my employer.
  1793.  
  1794. +++++++++++++++++++++++++++
  1795.  
  1796. >From Mike Lockwood <lockwood@cambridge.apple.com>
  1797. Date: 17 Nov 1994 01:13:27 GMT
  1798. Organization: Apple Computer, Inc.
  1799.  
  1800. In article <1994Nov11.221337.1940@newsserver.rrzn.uni-hannover.de>
  1801. McCammond, McCammond@sgi.siemens.com writes:
  1802. >As far as forgetting the "monolithic" vs. "forest" argument, RR can't
  1803. >so easily dismiss what is a major evolutionary step forward in OO
  1804. >design. Contrary to what RR is saying, I would argue that PowerPlant's
  1805. >design philosophy will allow it to be used to create applications that
  1806. >solve even more complex problems more quickly and easily. It takes the
  1807. >best advantages of OO design and builds on them--namely encapsulation
  1808. >and separation of concerns. Let's just take one example: TView. In
  1809. >MacApp it handles drawing, mouse clicks, keyboard and menu events, idle
  1810. >task handling. I could probably think of a few more things thrown into
  1811. >TView, if I put my mind to it. Face it. MacApp is bloated.
  1812. >
  1813. >PowerPlant's design is simply simpler. Easier to grasp. More natural
  1814. >and cleaner once you do. Let's take the functionality in TView.
  1815. >PowerPlant has an LPane class whose only responsibility is drawing on
  1816. >the screen and accepting clicks. LCommander handles keyboard and menu
  1817. >events. LPeriodical handles idle tasks. How is this used? Let's take an
  1818. >edit text, it is drawn on the screen, so it inherits from LPane. It
  1819. >handles keyboard events, so it inherits from LCommander. It
  1820. >periodically blinks the insertion point, so it inherits from
  1821. >LPeriodical. Each of these classes can be understood and used
  1822. >separately--or not used at all if its not appropriate. This leads to
  1823. >more cleanly separating functionality as well as having finer grained
  1824. >classes with fewer dependencies--a structure which is easier to learn
  1825. >and simpler to maintain.
  1826.  
  1827. I haven't had a chance to try Power Plant yet, so I can't make any
  1828. recommendations about Power Plant vs. MacApp.  But I was wondering...
  1829.  
  1830. If you want to have a view that can draw, handle mouse clicks, respond to
  1831. menu events and Apple events, do things at idle time (blink the cursor or
  1832. animate a selection with marching ants), etc.  it sounds like you have to
  1833. subclass from LPane, LCommander, LPeriodical and possibly some other
  1834. classes.  How well has this been working out for people?  I haven't used
  1835. MI in C++, but have heard that C++ MI has a lot of gotchas that you have
  1836. to be aware of.  Is this ever a problem, or am I nervous about this for
  1837. no good reason?
  1838.  
  1839. I thought about doing something like this in the Dylan framework, but
  1840. decided to do make the view system more like MacApp's view system.  I
  1841. wanted all views to have the ability to handle events, so you can add
  1842. behaviors to any view.  Providing the ability to add a behavior to any
  1843. view is critical for supporting an interface builder that can do live
  1844. editing of views in your running program.  I'm not sure how this could be
  1845. implemented in a view system that has views with no event handling
  1846. capabilities, but I suppose you could find a way to do it.
  1847. - ---------------------------------------------------------------------
  1848. Mike Lockwood                              lockwood@cambridge.apple.com
  1849. Full Time Dylan Hacker/Part Time CodeWarrior Hacker
  1850. Apple Computer, Inc.       "still cannot fix this broken machine" - NIN
  1851.  
  1852. +++++++++++++++++++++++++++
  1853.  
  1854. >From scouten@uiuc.edu (Eric Scouten)
  1855. Date: Thu, 17 Nov 1994 19:38:20 -0600
  1856. Organization: University of Illinois
  1857.  
  1858. In article <3aeann$kat@services.cambridge.apple.com>, Mike Lockwood
  1859. <lockwood@cambridge.apple.com> wrote:
  1860.  
  1861. > If you want to have a view that can draw, handle mouse clicks, respond to
  1862. > menu events and Apple events, do things at idle time (blink the cursor or
  1863. > animate a selection with marching ants), etc.  it sounds like you have to
  1864. > subclass from LPane, LCommander, LPeriodical and possibly some other
  1865. > classes.
  1866.  
  1867. Exactly.
  1868.  
  1869. > How well has this been working out for people?
  1870.  
  1871. Quite well in my mind.
  1872.  
  1873.  
  1874. > I haven't used
  1875. > MI in C++, but have heard that C++ MI has a lot of gotchas that you have
  1876. > to be aware of.  Is this ever a problem, or am I nervous about this for
  1877. > no good reason?
  1878.  
  1879. I think that the main problem with MI in C++ is that it's intimidating to
  1880. the new C++ programmer. (And I'm not intending to insult anybody with that
  1881. statement.) It is difficult to explain to somebody that a particular
  1882. object is both a LPane, LPeriodical, and an LEditField (or whatever).
  1883.  
  1884. But once you wrap your mind around it, it's a very flexible and powerful
  1885. mechanism. Here's one reason I like it. In one (hypothetical) application
  1886. I'm designing, I may need to display static information, but not respond
  1887. to any mouse down events in the window's content areas. Then I can totally
  1888. dismiss the LCommander hierarchy from the drawing routines; this makes
  1889. them simpler and smaller.
  1890.  
  1891. In the next application, I may need all kinds of controls and editable
  1892. fields and whatnot. Then I can drag in those methods (which are neatly
  1893. grouped in the LCommander base class).
  1894.  
  1895. So what I'm saying, in a long-winded way, is that I see no reason to shy
  1896. away from multiple inheritance.
  1897.  
  1898. -es
  1899.  
  1900. __________________________________________________________________________
  1901. Eric Scouten <scouten@uiuc.edu> * MS Comp Sci '96, Univ of Illinois
  1902.  
  1903. This message printed on 100% recycled electrons.
  1904.  
  1905. +++++++++++++++++++++++++++
  1906.  
  1907. >From greg@cosc.canterbury.ac.nz (Greg Ewing)
  1908. Date: 15 Nov 1994 22:34:18 GMT
  1909. Organization: University of Canterbury, Christchurch, New Zealand
  1910.  
  1911.  
  1912. In article <aberno-1511940906130001@lyapunov.stanford.edu>, aberno@genome.stanford.edu (Anthony Berno) writes:
  1913. |> Saying "the class wasn't designed for that" is like saying "This car
  1914. |> wasn't designed to have gas put into the tank" after it explodes at the
  1915. |> gas station.
  1916.  
  1917. You seemed to be saying "The author of PopUpMenu forgot to
  1918. include a method for adding items, so the basic, underlying
  1919. structure of PowerPlant is fundamentally and hopelessly
  1920. flawed!"
  1921.  
  1922. That's what I was arguing against.
  1923.  
  1924. |> -Anthony
  1925.  
  1926. Greg Ewing, Computer Science Dept, +--------------------------------------+
  1927. University of Canterbury,       | A citizen of NewZealandCorp, a      |
  1928. Christchurch, New Zealand       | wholly-owned subsidiary of Japan Inc.|
  1929. greg@cosc.canterbury.ac.nz       +--------------------------------------+
  1930.  
  1931. +++++++++++++++++++++++++++
  1932.  
  1933. >From Darryl Trujillo <dmt@pairoducks.com>
  1934. Date: Tue, 15 Nov 1994 21:55:42 GMT
  1935. Organization: Occidental Palace
  1936.  
  1937. In article <rondavis-1411941540000001@groomlake.datawatch.com> Ron Davis,
  1938. rondavis@datawatch.com writes:
  1939. >MacApp has its own special way of handling memory and segments.  PP
  1940. >doesn't screw around with the basic structure of a Mac program.  This
  1941. >memory thing is why it is so hard to get MacApp to work under
  1942. >CodeWarrior.  I understand the people from Symantec got PP running under
  1943. >thier system in a matter of hours, where as they never got MacApp to work
  1944. >with Think.
  1945.  
  1946. I think this had more to do with Think's lack of support for #pragma
  1947. segment than basic MacApp design.
  1948.  
  1949.     - dmt
  1950.  
  1951. +++++++++++++++++++++++++++
  1952.  
  1953. >From Bruce@hoult.actrix.gen.nz (Bruce Hoult)
  1954. Date: Wed, 16 Nov 1994 22:55:24 +1300 (NZDT)
  1955. Organization: (none)
  1956.  
  1957. greg@cosc.canterbury.ac.nz (Greg Ewing) writes:
  1958. > In article <aberno-1511940906130001@lyapunov.stanford.edu>, aberno@genome.stanford.edu (Anthony Berno) writes:
  1959. > |> Saying "the class wasn't designed for that" is like saying "This car
  1960. > |> wasn't designed to have gas put into the tank" after it explodes at the
  1961. > |> gas station.
  1962. > You seemed to be saying "The author of PopUpMenu forgot to
  1963. > include a method for adding items, so the basic, underlying
  1964. > structure of PowerPlant is fundamentally and hopelessly
  1965. > flawed!"
  1966. > That's what I was arguing against.
  1967.  
  1968. If MWerks say "we're planning to add more functionality in CW6" then fine.
  1969.  
  1970. But they seem to be saying: "We're not going to add that functionailty.  Not
  1971. encapsulating the underlying toolbox capabilities is a design feature, not
  1972. an oversight."
  1973.  
  1974. If they're going to take that kind of approach (which I disagree with), and
  1975. make the programmer reach through and fondle toolbox structures by themselves
  1976. anyway, then they shouldn't be caching *any* data (such as the number of items
  1977. in the menu) in the PP object.  If it's oversight they are forgiven.  If it's
  1978. by design, it's wrong.
  1979.  
  1980. -- Bruce
  1981.  
  1982. +++++++++++++++++++++++++++
  1983.  
  1984. >From greg@cosc.canterbury.ac.nz (Greg Ewing)
  1985. Date: 15 Nov 1994 22:34:18 GMT
  1986. Organization: University of Canterbury, Christchurch, New Zealand
  1987.  
  1988.  
  1989. In article <aberno-1511940906130001@lyapunov.stanford.edu>, aberno@genome.stanford.edu (Anthony Berno) writes:
  1990. |> Saying "the class wasn't designed for that" is like saying "This car
  1991. |> wasn't designed to have gas put into the tank" after it explodes at the
  1992. |> gas station.
  1993.  
  1994. You seemed to be saying "The author of PopUpMenu forgot to
  1995. include a method for adding items, so the basic, underlying
  1996. structure of PowerPlant is fundamentally and hopelessly
  1997. flawed!"
  1998.  
  1999. That's what I was arguing against.
  2000.  
  2001. |> -Anthony
  2002.  
  2003. Greg Ewing, Computer Science Dept, +--------------------------------------+
  2004. University of Canterbury,       | A citizen of NewZealandCorp, a      |
  2005. Christchurch, New Zealand       | wholly-owned subsidiary of Japan Inc.|
  2006. greg@cosc.canterbury.ac.nz       +--------------------------------------+
  2007.  
  2008. +++++++++++++++++++++++++++
  2009.  
  2010. >From Darryl Trujillo <dmt@pairoducks.com>
  2011. Date: Tue, 15 Nov 1994 21:55:42 GMT
  2012. Organization: Occidental Palace
  2013.  
  2014. In article <rondavis-1411941540000001@groomlake.datawatch.com> Ron Davis,
  2015. rondavis@datawatch.com writes:
  2016. >MacApp has its own special way of handling memory and segments.  PP
  2017. >doesn't screw around with the basic structure of a Mac program.  This
  2018. >memory thing is why it is so hard to get MacApp to work under
  2019. >CodeWarrior.  I understand the people from Symantec got PP running under
  2020. >thier system in a matter of hours, where as they never got MacApp to work
  2021. >with Think.
  2022.  
  2023. I think this had more to do with Think's lack of support for #pragma
  2024. segment than basic MacApp design.
  2025.  
  2026.     - dmt
  2027.  
  2028. +++++++++++++++++++++++++++
  2029.  
  2030. >From Bruce@hoult.actrix.gen.nz (Bruce Hoult)
  2031. Date: Wed, 16 Nov 1994 22:55:24 +1300 (NZDT)
  2032. Organization: (none)
  2033.  
  2034. greg@cosc.canterbury.ac.nz (Greg Ewing) writes:
  2035. > In article <aberno-1511940906130001@lyapunov.stanford.edu>, aberno@genome.stanford.edu (Anthony Berno) writes:
  2036. > |> Saying "the class wasn't designed for that" is like saying "This car
  2037. > |> wasn't designed to have gas put into the tank" after it explodes at the
  2038. > |> gas station.
  2039. > You seemed to be saying "The author of PopUpMenu forgot to
  2040. > include a method for adding items, so the basic, underlying
  2041. > structure of PowerPlant is fundamentally and hopelessly
  2042. > flawed!"
  2043. > That's what I was arguing against.
  2044.  
  2045. If MWerks say "we're planning to add more functionality in CW6" then fine.
  2046.  
  2047. But they seem to be saying: "We're not going to add that functionailty.  Not
  2048. encapsulating the underlying toolbox capabilities is a design feature, not
  2049. an oversight."
  2050.  
  2051. If they're going to take that kind of approach (which I disagree with), and
  2052. make the programmer reach through and fondle toolbox structures by themselves
  2053. anyway, then they shouldn't be caching *any* data (such as the number of items
  2054. in the menu) in the PP object.  If it's oversight they are forgiven.  If it's
  2055. by design, it's wrong.
  2056.  
  2057. -- Bruce
  2058.  
  2059. +++++++++++++++++++++++++++
  2060.  
  2061. >From pgontier@novell.com (Pete Gontier)
  2062. Date: Wed, 16 Nov 1994 11:41:33 -0700
  2063. Organization: Novell, Inc., Walnut Creek /Macintosh Site
  2064.  
  2065. In article <aberno-1511940906130001@lyapunov.stanford.edu>, 
  2066. aberno@genome.stanford.edu (Anthony Berno) wrote:
  2067.  
  2068. > Just a sec here... all I wanted to do was to add an item to a popup menu!
  2069. > Saying "the class wasn't designed for that" is like saying "This car
  2070. > wasn't designed to have gas put into the tank" after it explodes at the
  2071. > gas station.
  2072.  
  2073. Nobody said the class wasn't broken. (Nobody said it was, either, but I am
  2074. assuming for the sake of discussion that your observations about it are
  2075. damning enough that most reasonable observers would consider it broken.)
  2076. However, your earlier post seemed to claim that since the popup menu class
  2077. is broken, PowerPlant is broken. That's a generalization fallacy. I'm not
  2078. exactly what I would call a PowerPlant fan, but bashing its overall design
  2079. because of the deficiencies of one class is wrong.
  2080.  
  2081. A much more constructive use of your energy would be to alter the popup
  2082. menu class to work the way you want it to and send your changes to
  2083. Metrowerks, through which they will be routed to Greg. He's a receptive
  2084. guy.
  2085.  
  2086. If all you want is a popup menu that works the way you want it, then
  2087. sub-classing is another option. I'd rather see sub-classing used to add
  2088. functionality than to correct deficiencies, though.
  2089.  
  2090. -- 
  2091.  
  2092.  Views expressed here do not necessarily reflect those of my employer.
  2093.  
  2094. +++++++++++++++++++++++++++
  2095.  
  2096. >From Mike Lockwood <lockwood@cambridge.apple.com>
  2097. Date: 17 Nov 1994 01:13:27 GMT
  2098. Organization: Apple Computer, Inc.
  2099.  
  2100. In article <1994Nov11.221337.1940@newsserver.rrzn.uni-hannover.de>
  2101. McCammond, McCammond@sgi.siemens.com writes:
  2102. >As far as forgetting the "monolithic" vs. "forest" argument, RR can't
  2103. >so easily dismiss what is a major evolutionary step forward in OO
  2104. >design. Contrary to what RR is saying, I would argue that PowerPlant's
  2105. >design philosophy will allow it to be used to create applications that
  2106. >solve even more complex problems more quickly and easily. It takes the
  2107. >best advantages of OO design and builds on them--namely encapsulation
  2108. >and separation of concerns. Let's just take one example: TView. In
  2109. >MacApp it handles drawing, mouse clicks, keyboard and menu events, idle
  2110. >task handling. I could probably think of a few more things thrown into
  2111. >TView, if I put my mind to it. Face it. MacApp is bloated.
  2112. >
  2113. >PowerPlant's design is simply simpler. Easier to grasp. More natural
  2114. >and cleaner once you do. Let's take the functionality in TView.
  2115. >PowerPlant has an LPane class whose only responsibility is drawing on
  2116. >the screen and accepting clicks. LCommander handles keyboard and menu
  2117. >events. LPeriodical handles idle tasks. How is this used? Let's take an
  2118. >edit text, it is drawn on the screen, so it inherits from LPane. It
  2119. >handles keyboard events, so it inherits from LCommander. It
  2120. >periodically blinks the insertion point, so it inherits from
  2121. >LPeriodical. Each of these classes can be understood and used
  2122. >separately--or not used at all if its not appropriate. This leads to
  2123. >more cleanly separating functionality as well as having finer grained
  2124. >classes with fewer dependencies--a structure which is easier to learn
  2125. >and simpler to maintain.
  2126.  
  2127. I haven't had a chance to try Power Plant yet, so I can't make any
  2128. recommendations about Power Plant vs. MacApp.  But I was wondering...
  2129.  
  2130. If you want to have a view that can draw, handle mouse clicks, respond to
  2131. menu events and Apple events, do things at idle time (blink the cursor or
  2132. animate a selection with marching ants), etc.  it sounds like you have to
  2133. subclass from LPane, LCommander, LPeriodical and possibly some other
  2134. classes.  How well has this been working out for people?  I haven't used
  2135. MI in C++, but have heard that C++ MI has a lot of gotchas that you have
  2136. to be aware of.  Is this ever a problem, or am I nervous about this for
  2137. no good reason?
  2138.  
  2139. I thought about doing something like this in the Dylan framework, but
  2140. decided to do make the view system more like MacApp's view system.  I
  2141. wanted all views to have the ability to handle events, so you can add
  2142. behaviors to any view.  Providing the ability to add a behavior to any
  2143. view is critical for supporting an interface builder that can do live
  2144. editing of views in your running program.  I'm not sure how this could be
  2145. implemented in a view system that has views with no event handling
  2146. capabilities, but I suppose you could find a way to do it.
  2147. - ---------------------------------------------------------------------
  2148. Mike Lockwood                              lockwood@cambridge.apple.com
  2149. Full Time Dylan Hacker/Part Time CodeWarrior Hacker
  2150. Apple Computer, Inc.       "still cannot fix this broken machine" - NIN
  2151.  
  2152. +++++++++++++++++++++++++++
  2153.  
  2154. >From scouten@uiuc.edu (Eric Scouten)
  2155. Date: Thu, 17 Nov 1994 19:38:20 -0600
  2156. Organization: University of Illinois
  2157.  
  2158. In article <3aeann$kat@services.cambridge.apple.com>, Mike Lockwood
  2159. <lockwood@cambridge.apple.com> wrote:
  2160.  
  2161. > If you want to have a view that can draw, handle mouse clicks, respond to
  2162. > menu events and Apple events, do things at idle time (blink the cursor or
  2163. > animate a selection with marching ants), etc.  it sounds like you have to
  2164. > subclass from LPane, LCommander, LPeriodical and possibly some other
  2165. > classes.
  2166.  
  2167. Exactly.
  2168.  
  2169. > How well has this been working out for people?
  2170.  
  2171. Quite well in my mind.
  2172.  
  2173.  
  2174. > I haven't used
  2175. > MI in C++, but have heard that C++ MI has a lot of gotchas that you have
  2176. > to be aware of.  Is this ever a problem, or am I nervous about this for
  2177. > no good reason?
  2178.  
  2179. I think that the main problem with MI in C++ is that it's intimidating to
  2180. the new C++ programmer. (And I'm not intending to insult anybody with that
  2181. statement.) It is difficult to explain to somebody that a particular
  2182. object is both a LPane, LPeriodical, and an LEditField (or whatever).
  2183.  
  2184. But once you wrap your mind around it, it's a very flexible and powerful
  2185. mechanism. Here's one reason I like it. In one (hypothetical) application
  2186. I'm designing, I may need to display static information, but not respond
  2187. to any mouse down events in the window's content areas. Then I can totally
  2188. dismiss the LCommander hierarchy from the drawing routines; this makes
  2189. them simpler and smaller.
  2190.  
  2191. In the next application, I may need all kinds of controls and editable
  2192. fields and whatnot. Then I can drag in those methods (which are neatly
  2193. grouped in the LCommander base class).
  2194.  
  2195. So what I'm saying, in a long-winded way, is that I see no reason to shy
  2196. away from multiple inheritance.
  2197.  
  2198. -es
  2199.  
  2200. __________________________________________________________________________
  2201. Eric Scouten <scouten@uiuc.edu> * MS Comp Sci '96, Univ of Illinois
  2202.  
  2203. This message printed on 100% recycled electrons.
  2204.  
  2205. +++++++++++++++++++++++++++
  2206.  
  2207. >From Bruce@hoult.actrix.gen.nz (Bruce Hoult)
  2208. Date: Sat, 19 Nov 1994 12:27:18 +1300 (NZDT)
  2209. Organization: (none)
  2210.  
  2211. Mike Lockwood <lockwood@cambridge.apple.com> writes:
  2212. > I thought about doing something like this in the Dylan framework, but
  2213. > decided to do make the view system more like MacApp's view system.  I
  2214. > wanted all views to have the ability to handle events, so you can add
  2215. > behaviors to any view.  Providing the ability to add a behavior to any
  2216. > view is critical for supporting an interface builder that can do live
  2217. > editing of views in your running program.  I'm not sure how this could be
  2218. > implemented in a view system that has views with no event handling
  2219. > capabilities, but I suppose you could find a way to do it.
  2220.  
  2221. Behaviours certainly proved to be very useful in MacApp 3 and one of the most
  2222. important differences between MacApp 3 and MacApp2&TCL.  There are a lot of
  2223. situations where it's impossible to alter behaviour of some MacApp-internal
  2224. class because even if you subclass it you can't get access to the point
  2225. where it is *created* unless you reimplement a lot of other code, or alter
  2226. the source of MacApp.
  2227.  
  2228. It's possible, I guess, that this just indicates bad design within MacApp,
  2229. but I'm more inclined to think that the original designer simply can't
  2230. ever anticipate all possible future needs and split off a virtual function
  2231. for each one -- at some point you've got to provide a general method to
  2232. attach extra stuff to existing objects.
  2233.  
  2234. The minor downside of behaviours is a small performance penalty searching
  2235. sequentially through all the behaviours compared to virtual function dispatch.
  2236.  
  2237. The major downside is that there are no language facilities to ensure that
  2238. behaviours are checked for in every instance, and given a chance to act.
  2239. Thus the HandleEvent/DoEvent, HandleKeyDown/DoKeyDown etc dichotomy, where
  2240. HandleXXX checks for behaviours and passes the event to them if they exist,
  2241. or calls DoXXX otherwise.
  2242.  
  2243. This is a major source of potential errors, and would be better avoided.
  2244. But as far as I can see, Dylan works in exactly the same way as C++ in
  2245. this regard.
  2246.  
  2247. -- Bruce
  2248.  
  2249. +++++++++++++++++++++++++++
  2250.  
  2251. >From sandvik@apple.com (Kent Sandvik)
  2252. Date: Fri, 25 Nov 1994 14:59:13 -0800
  2253. Organization: Apple Computer, Inc. Developer Technical Support
  2254.  
  2255. In article <3aeann$kat@services.cambridge.apple.com>, Mike Lockwood
  2256. <lockwood@cambridge.apple.com> wrote:
  2257. > If you want to have a view that can draw, handle mouse clicks, respond to
  2258. > menu events and Apple events, do things at idle time (blink the cursor or
  2259. > animate a selection with marching ants), etc.  it sounds like you have to
  2260. > subclass from LPane, LCommander, LPeriodical and possibly some other
  2261. > classes.  How well has this been working out for people?  I haven't used
  2262. > MI in C++, but have heard that C++ MI has a lot of gotchas that you have
  2263. > to be aware of.  Is this ever a problem, or am I nervous about this for
  2264. > no good reason?
  2265.  
  2266. Ouch, my C++ arcana knowledge is pretty rusty, but what I remembered the
  2267. ordering of MI in C++ was not fully defined until the wonderful world of
  2268. C++ re-introduced a yet-another-definition of virtual, so defining virtual
  2269. in front of the mixin classes defines the ordering.
  2270.  
  2271. We still have the name clash issue that seems to drag on concerning a
  2272. standard; in other words if there are member functions with the same name
  2273. mixed in, let's say Initialize(), then it's really a compiler decision
  2274. which one to select from the possible ones mixed in. 
  2275.  
  2276. Otherwise MI is sort of fun, but it has it's funny moments. It will
  2277. certainly minimize code used in various places. Then again if we have most
  2278. of the framework inside a shared library, maybe that's not an issue unless
  2279. the notion of delegation and data separation are big ones in the design of
  2280. the framework.
  2281.  
  2282. Cheers, Kent
  2283.  
  2284. -- 
  2285. Kent Sandvik   sandvik@apple.com   New Media Analyst/Programmer
  2286. Private activities on Internet.
  2287.  
  2288. +++++++++++++++++++++++++++
  2289.  
  2290. >From Lars.Farm@nts.mh.se (Lars Farm)
  2291. Date: Sat, 26 Nov 1994 13:39:03 +0100
  2292. Organization: Mid Sweden University
  2293.  
  2294. In article <sandvik-2511941459130001@17.255.38.246>, sandvik@apple.com
  2295. (Kent Sandvik) wrote:
  2296.  
  2297. > We still have the name clash issue that seems to drag on concerning a
  2298. > standard; in other words if there are member functions with the same name
  2299. > mixed in, let's say Initialize(), then it's really a compiler decision
  2300. > which one to select from the possible ones mixed in. 
  2301.  
  2302. With virtual bases, dominance comes in to play but all ambiguities must be
  2303. resolved by the user. As far as I know there is no undefined behavior.
  2304.  
  2305. > Then again if we have most
  2306. > of the framework inside a shared library, maybe that's not an issue [...]
  2307.  
  2308. Code size is important, but other qualities are much more important:
  2309.  
  2310. Coupling: High coupling (like in MA/TCL) means that you must learn,
  2311. understand and use the whole framework to use some small part. Weak
  2312. coupling (PP at least compared to MA/TCL) means you only need to learn the
  2313. thing that you want to reuse and can ignore the rest of the framework. It
  2314. can also be reused without having to drag in the rest of the framework.
  2315.  
  2316. Cohesion: A class that has one and only one area of responsibility (PP) is
  2317. easy to learn, explain, understand and therefor easy to reuse, a class
  2318. that does it all plus a bit of this and a bit of that (MA/TCL) is hard to
  2319. learn, explain, understand and therefor hard to reuse. It is not cohesive.
  2320.  
  2321. A class or _small_ module of classes that can be reused and understood on
  2322. it's own is much preferred over a class or module that can only be reused
  2323. and understood in the context of the whole framework.
  2324.  
  2325. IMHO these quality measures are extremely important and the very reason
  2326. that PP feels cleaner than MA/TCL. Aim for high cohesion and low coupling.
  2327. This precludes the tree aproach and leads to a forrest of small trees
  2328. independant of each other or anything else. Code bloat is nothing compared
  2329. to this even though bloated code is bad in it self.
  2330.  
  2331. [...] unless
  2332. > the notion of delegation and data separation are big ones in the design of
  2333. > the framework.
  2334.  
  2335. Lars
  2336.  
  2337. -- 
  2338. Lars.Farm@nts.mh.se
  2339.  
  2340. +++++++++++++++++++++++++++
  2341.  
  2342. >From ersmith@ucsd.edu (Erik Smith)
  2343. Date: Tue, 29 Nov 1994 12:01:08 -0800
  2344. Organization: IR/PS
  2345.  
  2346. Greg does not want to isolate programmers from the toolbox.  I appreciate
  2347. the way this makes powerplant smaller and simpler.  On the other hand, I
  2348. find that I am subclassing almost everything and adding my own accessors
  2349. and mutators that isolate my higher level code from the toolbox.  This
  2350. isn't really a lot of work so I'm not complaining.  I like working with
  2351. the toolbox at the same time.
  2352.  
  2353. What if there was another layer of subclasses provided with powerplant
  2354. that provided a friendlier API and isolated the toolbox?  Programmers
  2355. could then choose to exclude those classes when they didn't want the extra
  2356. bulk.  I don't want to see a method for every call in quickdraw for LPane,
  2357. but some basic additions to LListBox,LPopup, and other classes would be
  2358. nice.
  2359.  
  2360. -Erik
  2361.  
  2362. +++++++++++++++++++++++++++
  2363.  
  2364. >From sandvik@apple.com (Kent Sandvik)
  2365. Date: Sun, 04 Dec 1994 18:13:04 -0800
  2366. Organization: Apple Computer, Inc. Developer Technical Support
  2367.  
  2368. In article <Lars.Farm-2611941339030001@sleipner.nts.mh.se>,
  2369. Lars.Farm@nts.mh.se (Lars Farm) wrote:
  2370.  
  2371. > In article <sandvik-2511941459130001@17.255.38.246>, sandvik@apple.com
  2372. > (Kent Sandvik) wrote:
  2373. > > We still have the name clash issue that seems to drag on concerning a
  2374. > > standard; in other words if there are member functions with the same name
  2375. > > mixed in, let's say Initialize(), then it's really a compiler decision
  2376. > > which one to select from the possible ones mixed in. 
  2377. > With virtual bases, dominance comes in to play but all ambiguities must be
  2378. > resolved by the user. As far as I know there is no undefined behavior.
  2379.  
  2380. As I remember virtual base classes defines the ordering of mixing
  2381. constructors. But it does not eliminate the problem if the mixin classes
  2382. each has a member function called Initialize(void), and the code called
  2383. uses this->Initialize(). Maybe this is resolved with RTTI, it's been ages
  2384. since I last hacked C++ inside out.
  2385.  
  2386. --Kent
  2387.  
  2388. -- 
  2389. Kent Sandvik   sandvik@apple.com   New Media Analyst/Programmer
  2390. Private activities on Internet.
  2391.  
  2392. +++++++++++++++++++++++++++
  2393.  
  2394. >From Lars.Farm@nts.mh.se (Lars Farm)
  2395. Date: Thu, 08 Dec 1994 13:41:40 +0100
  2396. Organization: Mid Sweden University
  2397.  
  2398. In article <sandvik-0412941813040001@17.255.38.234>, sandvik@apple.com
  2399. (Kent Sandvik) wrote:
  2400.  
  2401. > > > We still have the name clash issue that seems to drag on concerning a
  2402. > > > standard; in other words if there are member functions with the same name
  2403. > > > mixed in, let's say Initialize(), then it's really a compiler decision
  2404. > > > which one to select from the possible ones mixed in. 
  2405. > > 
  2406. > > With virtual bases, dominance comes in to play but all ambiguities must
  2407. > > be resolved by the user. As far as I know there is no undefined behavior.
  2408. >
  2409. > As I remember virtual base classes defines the ordering of mixing
  2410. > constructors. But it does not eliminate the problem if the mixin classes
  2411. > each has a member function called Initialize(void), and the code called
  2412. > uses this->Initialize(). Maybe this is resolved with RTTI, it's been ages
  2413. > since I last hacked C++ inside out.
  2414.  
  2415. This has nothing to do with rtti. Rtti is about asking an object about
  2416. it's type and about checked safe down casts.
  2417.  
  2418. Long answer : see ARM 10.1.1, p 202 -- Ambiguities.
  2419. Short answer: Access to base class members must be unambiguous.
  2420.  
  2421. Your example:  class base1 { public: void Initialize(); };
  2422.                class base2 { public: void Initialize(); };
  2423.                class derived : public base1, public base2 {};
  2424.  
  2425.                void g( derived *d )
  2426.                {
  2427.                   d->Initialize();        // error: ambiguous
  2428.                   d->base1::Initialize(); // ok
  2429.                   d->base2::Initialize(); // ok
  2430.                }
  2431.  
  2432. Virtual bases have a name resolution scheme - dominance - that can resolve
  2433. some name clashes in a well defined and predictable way. Sort of 'virtual'
  2434. names. 
  2435.  
  2436. Lars
  2437.  
  2438. -- 
  2439. Lars.Farm@nts.mh.se
  2440.  
  2441. ---------------------------
  2442.  
  2443. >From kenp@nmrfam.wisc.edu (Ken Prehoda)
  2444. Subject: QuickDraw GX Thread Safe?
  2445. Date: Tue, 06 Dec 1994 11:52:23 -0600
  2446. Organization: Univ of Wisc-Madison Dept of Biochemistry
  2447.  
  2448. I thought that I remember reading somewhere that QuickDraw GX is
  2449. completely reentrant.  I was hoping then, that it would be possible to
  2450. make GX calls in preemptive threads.  Unfortunately, this appears not to
  2451. be the case as GXDrawShape() will start to come up, but eventually dies in
  2452. a preemptive thread.
  2453.  
  2454. Does anyone know anything about this?  How about GX calls at interrupt time?
  2455.  
  2456. Thanks,
  2457. Ken Prehoda
  2458. Department of Biochemistry
  2459. University of Wisconsin-Madison
  2460.  
  2461. +++++++++++++++++++++++++++
  2462.  
  2463. >From h+@metrowerks.com (Jon W{tte)
  2464. Date: Wed, 07 Dec 1994 16:55:29 +0100
  2465. Organization: The Conspiracy
  2466.  
  2467. In article <kenp-0612941152230001@f180-035.net.wisc.edu>,
  2468. kenp@nmrfam.wisc.edu (Ken Prehoda) wrote:
  2469.  
  2470. >I thought that I remember reading somewhere that QuickDraw GX is
  2471. >completely reentrant.  I was hoping then, that it would be possible to
  2472. >make GX calls in preemptive threads.  Unfortunately, this appears not to
  2473. >be the case as GXDrawShape() will start to come up, but eventually dies in
  2474. >a preemptive thread.
  2475.  
  2476. GX is re-entrant. That's probably one of the reasons they have 
  2477. their own memory manager pool.
  2478.  
  2479. However, there are more things to calling stuff at interrupt 
  2480. time than being re-entrant:
  2481.  
  2482. Lower-priority interrupts don't happen. This may include things 
  2483. like Ticks being updated; I/O completing etc.
  2484.  
  2485. You can't cause the VM system to work, because that would make 
  2486. the interrupt handler take too long, and requires I/O which in 
  2487. turn is dependent on the interrupt system. Not to mention that 
  2488. you may have been interrupted while I/O was going on.
  2489.  
  2490. You can't interface with the rest of the toolbox, because 
  2491. that's not re-entrant. GXDrawShape does interface with the rest 
  2492. of the toolbox, because it draws into a WindowPtr somewhere 
  2493. deep down.
  2494.  
  2495. Cheers,
  2496.  
  2497.                 / h+
  2498.  
  2499.  
  2500. --
  2501.   Jon W‰tte (h+@metrowerks.com), Hagagatan 1, 113 48 Stockholm, Sweden
  2502.  
  2503.  Please prove me wrong. I'd rather learn something new than say something old.
  2504.  
  2505.  
  2506. ---------------------------
  2507.  
  2508. >From osiris@cs.utexas.edu (Rob Browning)
  2509. Subject: [Q] Need help with SetGWorld.
  2510. Date: Wed, 07 Dec 1994 03:03:03 -0600
  2511. Organization: The University of Texas at Austin
  2512.  
  2513. I got the impression from NIM:Imaging that you are supposed to use
  2514. SetGWorld and GetGWorld instead of SetPort and GetPort for all graphics
  2515. context switches when you are using color quickdraw (p. 2-18 (among other
  2516. places)).
  2517.  
  2518. Now my question is, if I create a window or CGrafPort, and I then want to
  2519. make it the current port, how do I know what to pass SetGWorld in the
  2520. device parameter?   In other words, if I have a pointer to a window that I
  2521. want to make the current port, how do I know what it's device is?
  2522.  
  2523. I saw some sample code that did something like this:
  2524.  
  2525. SetGWorld(myWin,GetMainDevice());
  2526.  
  2527. Will this always work?  Am I guaranteed that every onscreen window's
  2528. associated device is the main device?
  2529.  
  2530. Thanks,
  2531.  
  2532. --Rob.
  2533.  
  2534. +++++++++++++++++++++++++++
  2535.  
  2536. >From Paul Pharr <aabuva@wam.umd.edu>
  2537. Date: 7 Dec 1994 20:06:51 GMT
  2538. Organization: none
  2539.  
  2540. In article <osiris-0712940303030001@slip-8-15.ots.utexas.edu> Rob
  2541. Browning, osiris@cs.utexas.edu writes:
  2542. >Now my question is, if I create a window or CGrafPort, and I then want to
  2543. >make it the current port, how do I know what to pass SetGWorld in the
  2544. >device parameter?   In other words, if I have a pointer to a window that
  2545. I
  2546. >want to make the current port, how do I know what it's device is?
  2547. >
  2548.  
  2549. GetPort & SetPort work fine if the PixMaps of both the old & new port
  2550. are actually on screen. The only time they have problems is if the port
  2551. needs to be switched between a port on a screen and a port which is an
  2552. offscreen bitmap (i.e. GWorld) or vice-versa.
  2553.  
  2554. For example, if the current port is an offscreen GWorld which was set
  2555. with SetGWorld, then the current GDevice is the device associated with
  2556. that GWorld. If you then used SetPort to change the port to a window on
  2557. screen, the GrafPort would be changed to the one on screen, but the
  2558. GDevice would still be the one associated with your offscreen GWorld.
  2559. Drawing under these conditions causes terrible crashes!
  2560.  
  2561.  
  2562.  
  2563. The rule of thumb is:
  2564.  
  2565. *If you need to set the port to a GWorld you have created, use SetGWorld.
  2566.  
  2567. *If it is possible that the current port is a GWorld and you need to
  2568. save it and set a new port, then you must use GetGWorld/SetGWorld
  2569. rather than GetPort/SetPort.
  2570.  
  2571. In your case, unless you are switching to or from an offscreen GWorld,
  2572. then you need not call GetGWorld/SetGWorld. GetPort/SetPort will work
  2573. fine in any version of color QuickDraw.
  2574.  
  2575.  
  2576. >I saw some sample code that did something like this:
  2577. >
  2578. >SetGWorld(myWin,GetMainDevice());
  2579. >
  2580. >Will this always work?  Am I guaranteed that every onscreen window's
  2581. >associated device is the main device?
  2582.  
  2583.  
  2584. When QuickDraw draws, part of its job in supporting multiple screens is
  2585. setting the graphics device as appropriate for drawing operations on
  2586. each screen. As long as you pass a screen device when setting the
  2587. GWorld, QuickDraw will make sure it is set correctly if the window
  2588. spans multiple screens or is on a different screen altogether.
  2589.  
  2590. The short answer is Yes, it will work in all cases.
  2591.  
  2592. Paul C. Pharr
  2593. SW Engineer
  2594.  
  2595. +++++++++++++++++++++++++++
  2596.  
  2597. >From giles@med.cornell.edu (Aaron Giles)
  2598. Date: Wed, 07 Dec 1994 11:40:52 -0500
  2599. Organization: Cornell University Medical College
  2600.  
  2601. In article <osiris-0712940303030001@slip-8-15.ots.utexas.edu>,
  2602. osiris@cs.utexas.edu (Rob Browning) wrote:
  2603.  
  2604. > Now my question is, if I create a window or CGrafPort, and I then want to
  2605. > make it the current port, how do I know what to pass SetGWorld in the
  2606. > device parameter?
  2607.  
  2608. Just pass it a nil value, and the OS will figure it out for you.  That
  2609. goes for GWorlds, too.  In fact, the only time I ever use something other
  2610. than nil for the device parameter is when I'm saving and restoring the
  2611. port by using GetGWorld/SetGWorld, in which case I just pass the device
  2612. that GetGWorld gave me.
  2613. -- 
  2614. Aaron Giles (giles@med.cornell.edu)
  2615. Power Macintosh Developer, Cornell University Medical College
  2616. JPEGView home page: http://www.med.cornell.edu/jpegview.html
  2617. JPEGView FTP site:   ftp://ftp.med.cornell.edu/pub/jpegview/
  2618.  
  2619. +++++++++++++++++++++++++++
  2620.  
  2621. >From osiris@cs.utexas.edu (Rob Browning)
  2622. Date: Wed, 07 Dec 1994 13:35:36 -0600
  2623. Organization: The University of Texas at Austin
  2624.  
  2625. In article <giles-0712941140520001@wiggin.med.cornell.edu>,
  2626. giles@med.cornell.edu (Aaron Giles) wrote:
  2627.  
  2628. > Just pass it a nil value, and the OS will figure it out for you.  That
  2629. > goes for GWorlds, too.  In fact, the only time I ever use something other
  2630. > than nil for the device parameter is when I'm saving and restoring the
  2631. > port by using GetGWorld/SetGWorld, in which case I just pass the device
  2632. > that GetGWorld gave me.
  2633.  
  2634. OK, I was hoping to treat wins, ports, and worlds the same in some code
  2635. I'm writing, but I realized that since you have to LockPixels on a world,
  2636. you can't treat it exactly the same as a port.  So is there some
  2637. (standard, i.e. supported) way, given a pointer to a port or world, to
  2638. determine which one it is?
  2639.  
  2640. If not, I guess I can always create a wrapper class/structure that knows
  2641. which kind of pointer it has...
  2642.  
  2643. Thanks,
  2644.  
  2645. --Rob.
  2646.  
  2647. +++++++++++++++++++++++++++
  2648.  
  2649. >From greg@cosc.canterbury.ac.nz (Greg Ewing)
  2650. Date: 7 Dec 1994 23:35:59 GMT
  2651. Organization: University of Canterbury, Christchurch, New Zealand
  2652.  
  2653.  
  2654. In article <osiris-0712940303030001@slip-8-15.ots.utexas.edu>, osiris@cs.utexas.edu (Rob Browning) writes:
  2655. |> I saw some sample code that did something like this:
  2656. |> 
  2657. |> SetGWorld(myWin,GetMainDevice());
  2658. |> 
  2659. |> Will this always work?  Am I guaranteed that every onscreen window's
  2660. |> associated device is the main device?
  2661.  
  2662. Yes, I think so. There is some trickery going on which
  2663. effectively joins all your screens together and makes
  2664. them behave like a single grafport. The main screen's
  2665. grafport and its associated gdevice are the "representatives"
  2666. through which you deal with the whole collection.
  2667. Whenever you draw something while the current grafport's
  2668. pixmap is the main screen, it's also done to all the other
  2669. screens and their associated gdevices if necessary.
  2670.  
  2671. |> --Rob.
  2672.  
  2673. Greg Ewing, Computer Science Dept, +--------------------------------------+
  2674. University of Canterbury,       | A citizen of NewZealandCorp, a      |
  2675. Christchurch, New Zealand       | wholly-owned subsidiary of Japan Inc.|
  2676. greg@cosc.canterbury.ac.nz       +--------------------------------------+
  2677.  
  2678. +++++++++++++++++++++++++++
  2679.  
  2680. >From ldo@waikato.ac.nz (Lawrence D'Oliveiro, Waikato University)
  2681. Date: 8 Dec 94 15:03:32 +1300
  2682. Organization: University of Waikato, Hamilton, New Zealand
  2683.  
  2684. In article <3c5gsv$i8g@cantua.canterbury.ac.nz>, greg@cosc.canterbury.ac.nz (Greg Ewing) writes:
  2685. >
  2686. > In article <osiris-0712940303030001@slip-8-15.ots.utexas.edu>, osiris@cs.utexas.edu (Rob Browning) writes:
  2687. > |> I saw some sample code that did something like this:
  2688. > |>
  2689. > |> SetGWorld(myWin,GetMainDevice());
  2690. > |>
  2691. > |> Will this always work?  Am I guaranteed that every onscreen window's
  2692. > |> associated device is the main device?
  2693. >
  2694. > Yes, I think so.
  2695.  
  2696. Don't think, know. Inside Mac Vol V, page V-122: "when an application opens
  2697. a window, the window's port.portBits.baseAddr field is set to be equal to
  2698. the base address of the main screen. When QuickDraw draws into a grafPort or
  2699. cGrafPort, it compares the base address of the port to the main screen. If
  2700. they are equal, then QuickDraw might need to draw to multiple screens."
  2701.  
  2702. Hmm, can't find the equivalent statement inside the new "Inside Macintosh:
  2703. Imaging With QuickDraw"...
  2704.  
  2705. > Greg Ewing, Computer Science Dept, +--------------------------------------+
  2706. > University of Canterbury,       | A citizen of NewZealandCorp, a      |
  2707. > Christchurch, New Zealand       | wholly-owned subsidiary of Japan Inc.|
  2708. > greg@cosc.canterbury.ac.nz       +--------------------------------------+
  2709.  
  2710. Lawrence "RTFM" D'Oliveiro
  2711. just another member of the invading Asian horde
  2712.  
  2713. +++++++++++++++++++++++++++
  2714.  
  2715. >From ldo@waikato.ac.nz (Lawrence D'Oliveiro, Waikato University)
  2716. Date: 8 Dec 94 17:28:09 +1300
  2717. Organization: University of Waikato, Hamilton, New Zealand
  2718.  
  2719. In article <osiris-0712940303030001@slip-8-15.ots.utexas.edu>, osiris@cs.utexas.edu (Rob Browning) writes:
  2720. > I got the impression from NIM:Imaging that you are supposed to use
  2721. > SetGWorld and GetGWorld instead of SetPort and GetPort for all graphics
  2722. > context switches when you are using color quickdraw (p. 2-18 (among other
  2723. > places)).
  2724.  
  2725. Not really. You only need to use Get/SetGWorld if you're doing offscreen
  2726. drawing (typically using GWorlds).
  2727.  
  2728. > Now my question is, if I create a window or CGrafPort, and I then want to
  2729. > make it the current port, how do I know what to pass SetGWorld in the
  2730. > device parameter?   In other words, if I have a pointer to a window that I
  2731. > want to make the current port, how do I know what it's device is?
  2732.  
  2733. Pass nil. For an on-screen window, Color QuickDraw will automatically
  2734. substitute the main screen device. For an off-screen GWorld, the device you
  2735. pass is ignored anyway, and the one attached to the GWorld is used.
  2736.  
  2737. For off-screen drawing, the sequence I recommend you use is:
  2738.  
  2739.     GetGWorld(PreviousGWorld, PreviousGDevice);
  2740.     SetGWorld(MyGWorld, nil);
  2741.     ... { do your offscreen drawing }
  2742.     SetGWorld(PreviousGWorld, PreviousGDevice)
  2743.  
  2744. Another tip: always make sure the current GWorld is set to an on-screen window
  2745. before calling WaitNextEvent or using any other toolbox calls that may draw
  2746. on-screen.
  2747.  
  2748. > I saw some sample code that did something like this:
  2749. >
  2750. > SetGWorld(myWin,GetMainDevice());
  2751. >
  2752. > Will this always work?  Am I guaranteed that every onscreen window's
  2753. > associated device is the main device?
  2754.  
  2755. Yes, it will always work, but it's easier to just pass nil.
  2756.  
  2757. Lawrence D'Oliveiro                       fone: +64-7-856-2889
  2758. Computer Services Dept                     fax: +64-7-838-4066
  2759. University of Waikato            electric mail: ldo@waikato.ac.nz
  2760. Hamilton, New Zealand    37^ 47' 26" S, 175^ 19' 7" E, GMT+13:00
  2761.  
  2762. +++++++++++++++++++++++++++
  2763.  
  2764. >From hanrek@cts.com (Mark Hanrek)
  2765. Date: Thu, 8 Dec 1994 01:29:33 GMT
  2766. Organization: The Information Worskhop
  2767.  
  2768. In article <osiris-0712940303030001@slip-8-15.ots.utexas.edu>,
  2769. osiris@cs.utexas.edu (Rob Browning) wrote:
  2770.  
  2771. > I got the impression from NIM:Imaging that you are supposed to use
  2772. > SetGWorld and GetGWorld instead of SetPort and GetPort for all graphics
  2773. > context switches when you are using color quickdraw (p. 2-18 (among other
  2774. > places)).
  2775. > Now my question is, if I create a window or CGrafPort, and I then want to
  2776. > make it the current port, how do I know what to pass SetGWorld in the
  2777. > device parameter?   In other words, if I have a pointer to a window that I
  2778. > want to make the current port, how do I know what it's device is?
  2779. > I saw some sample code that did something like this:
  2780. > SetGWorld(myWin,GetMainDevice());
  2781. > Will this always work?  Am I guaranteed that every onscreen window's
  2782. > associated device is the main device?
  2783.  
  2784.  
  2785. Rob,
  2786.  
  2787. Good question.  Typically, dealing with ports starts in the event loop.
  2788.  
  2789. In your update handler, for instance, once you've extracted the port
  2790. (window) from the event, you can...
  2791.  
  2792.    SetPort( eventWindow );
  2793.    GetGWorld( &windowGW, &windowGD );
  2794.  
  2795. and keep the GDHandle ("windowGD") around for use later as needed. 
  2796.  
  2797. The event loop will pass control to you with the current device already
  2798. set to the one that goes with the event window.  If you wanted to
  2799. determine the actual device, you would do a GetWindowDevice() function,
  2800. the source code for which is available in the DTS.lib software, either in
  2801. "utility.c" or "windows.c" found on the Developer CD, eWorld, or at
  2802. ftp.apple.com.
  2803.  
  2804. Do this, and you'll see how everything else falls into place.
  2805.  
  2806.  
  2807. Hope this helps.
  2808.  
  2809. Mark Hanrek
  2810.  
  2811. ---------------------------
  2812.  
  2813. >From jmk3@crux4.cit.cornell.edu (Jay Krell)
  2814. Subject: static RoutineDescriptors
  2815. Date: 29 Nov 1994 14:02:55 GMT
  2816. Organization: Cornell University
  2817.  
  2818. 'm having trouble making static routine descriptors/upps in code for
  2819. 68K and PPC.
  2820.  
  2821. There is an example on p. 2-23 on IM:PPC, but it has a few problems.
  2822. It uses @ instead of &, trivial. It has incorrect typing on 68k, in
  2823. that a UniversalProcPtr is not the address of a RoutineDescriptor.
  2824.  
  2825. It seems to me that one simple solution is for RoutineDescriptor's to
  2826. exist in 68k, but simply be a jmp and the ProcPtr. But I guess...
  2827. that could cause problems in that you then have to find a place to
  2828. keep the stub around, but if you have to do it for PPC anyway it
  2829. shouldn't be a problem.
  2830.  
  2831. (p. 2-23 of IM is roughly:
  2832.  
  2833. RoutineDescriptor myRD= BUILD_ROUTINE_DESCRIPTOR(upptype, uppproc);
  2834. UniversalProcPtr myproc= &myRD;
  2835.  
  2836. ToolboxCall(myproc);
  2837.  
  2838. )
  2839.  
  2840. --
  2841.  -- jay.krell@cornell.edu
  2842.  
  2843. +++++++++++++++++++++++++++
  2844.  
  2845. >From jmk3@crux4.cit.cornell.edu (Jay Krell)
  2846. Date: 29 Nov 1994 17:29:37 GMT
  2847. Organization: Cornell University
  2848.  
  2849.   I came up with this disgusting solution for doing static
  2850.   upp's on 68k and PPC:
  2851.   
  2852.   #define JMP68k 0x4EF9
  2853.   #define JMP68k_bytes 0x4E, 0xF9
  2854.   #define NOP68k 0x4E71
  2855.   #define NOP68k_bytes 0x4E, 0x71
  2856.   #define NOP68k_long 0x4E714E71
  2857.   
  2858.   #if USESCODEFRAGMENTS
  2859.   #define build_upp(type,proc) BUILD_ROUTINE_DESCRIPTOR(type,proc)
  2860.   #else
  2861.   #define build_upp(type,proc) {NOP68k, NOP68k_bytes, NOP68k_long, \
  2862.   NOP68k_bytes, NOP68k, NOP68k_long, NOP68k_bytes, JMP68k, proc}
  2863.   #endif
  2864.   
  2865.   static RoutineDescriptor scrollrd= build_upp(uppControlActionProcInfo, (ProcPtr)ScrollProc2);
  2866.   
  2867.   TrackControl(theControl, myPt, (ControlActionUPP) &scrollrd);
  2868.   
  2869.   but I'd gladly be corrected with something nicer. I should
  2870.   probably replace all the nop's with a branch, but that is
  2871.   pushing my 68k assembly ability.
  2872.  
  2873. --
  2874.  -- jay.krell@cornell.edu
  2875.  
  2876. +++++++++++++++++++++++++++
  2877.  
  2878. >From kenp@nmrfam.wisc.edu (Ken Prehoda)
  2879. Date: Tue, 29 Nov 1994 12:31:20 -0600
  2880. Organization: Univ of Wisc-Madison, Dept of Biochemistry
  2881.  
  2882. In article <3bfoe1$j1m@tuba.cit.cornell.edu>, jmk3@crux4.cit.cornell.edu
  2883. (Jay Krell) wrote:
  2884.  
  2885. >   I came up with this disgusting solution for doing static
  2886. >   upp's on 68k and PPC:
  2887. >   
  2888. >   #define JMP68k 0x4EF9
  2889. >   #define JMP68k_bytes 0x4E, 0xF9
  2890. >   #define NOP68k 0x4E71
  2891. >   #define NOP68k_bytes 0x4E, 0x71
  2892. >   #define NOP68k_long 0x4E714E71
  2893. >   
  2894. >   #if USESCODEFRAGMENTS
  2895. >   #define build_upp(type,proc) BUILD_ROUTINE_DESCRIPTOR(type,proc)
  2896. >   #else
  2897. >   #define build_upp(type,proc) {NOP68k, NOP68k_bytes, NOP68k_long, \
  2898. >   NOP68k_bytes, NOP68k, NOP68k_long, NOP68k_bytes, JMP68k, proc}
  2899. >   #endif
  2900. >   
  2901. >   static RoutineDescriptor scrollrd= build_upp(uppControlActionProcInfo,
  2902. (ProcPtr)ScrollProc2);
  2903. >   
  2904. >   TrackControl(theControl, myPt, (ControlActionUPP) &scrollrd);
  2905.  
  2906. If I'm understanding your question, it's not at all that complicated:
  2907.  
  2908. static ControlActionUPP scrollrd;
  2909.  
  2910. scrollrd = NewControlDefProc(ScrollProc2);
  2911.  
  2912. TrackControl(theControl,myPt,scrollrd);
  2913.  
  2914. NewControlDefProc is conditionally compiled for 68K vs. PPC.  If compiling
  2915. for 68K, the ControlActionUPP is just a normal procptr, for PPC, it is a
  2916. routine descriptor (look in Controls.h).
  2917.  
  2918. Please let me know if I missed the point of your question.
  2919.  
  2920. Ken Prehoda
  2921. Department of Biochemistry
  2922. University of Wisconsin-Madison
  2923. kenp@nmrfam.wisc.edu
  2924.  
  2925. +++++++++++++++++++++++++++
  2926.  
  2927. >From dubois@primate.wisc.edu (Paul DuBois)
  2928. Date: 29 Nov 1994 14:27:05 -0600
  2929. Organization: Castra Parvulorum
  2930.  
  2931. >From article <3bfcaf$ee4@tuba.cit.cornell.edu>, by jmk3@crux4.cit.cornell.edu (Jay Krell):
  2932. > 'm having trouble making static routine descriptors/upps in code for
  2933. > 68K and PPC.
  2934. > (p. 2-23 of IM is roughly:
  2935. > RoutineDescriptor myRD= BUILD_ROUTINE_DESCRIPTOR(upptype, uppproc);
  2936. > UniversalProcPtr myproc= &myRD;
  2937. > ToolboxCall(myproc);
  2938.  
  2939. I do something like this:
  2940.  
  2941. #if ppc code
  2942. RoutineDescriptor myRD= BUILD_ROUTINE_DESCRIPTOR(upptype, uppproc);
  2943. UniversalProcPtr myproc= &myRD;
  2944. #else    /* 68K code */
  2945. UniversalProcPtr myproc= uppproc;
  2946. #endif
  2947.  
  2948. ToolboxCall(myproc);
  2949.  
  2950. This makes myproc point to a routine descriptor for PowerPC code and
  2951. and to the function itself for 68K code.
  2952. -- 
  2953. Paul DuBois
  2954. dubois@primate.wisc.edu
  2955.  
  2956. +++++++++++++++++++++++++++
  2957.  
  2958. >From omh@cs.brown.edu (Owen M. Hartnett)
  2959. Date: Wed, 30 Nov 1994 04:43:15 GMT
  2960. Organization: Brown University Department of Computer Science
  2961.  
  2962. In article <3bg2qpINNdvn@uakari.primate.wisc.edu> dubois@primate.wisc.edu writes:
  2963. >From article <3bfcaf$ee4@tuba.cit.cornell.edu>, by jmk3@crux4.cit.cornell.edu (Jay Krell):
  2964. >> 'm having trouble making static routine descriptors/upps in code for
  2965. >> 68K and PPC.
  2966. >> 
  2967. >> (p. 2-23 of IM is roughly:
  2968. >> 
  2969. >> RoutineDescriptor myRD= BUILD_ROUTINE_DESCRIPTOR(upptype, uppproc);
  2970. >> UniversalProcPtr myproc= &myRD;
  2971. >> 
  2972. >> ToolboxCall(myproc);
  2973. >
  2974. >I do something like this:
  2975. >
  2976. >#if ppc code
  2977. >RoutineDescriptor myRD= BUILD_ROUTINE_DESCRIPTOR(upptype, uppproc);
  2978. >UniversalProcPtr myproc= &myRD;
  2979. >#else    /* 68K code */
  2980. >UniversalProcPtr myproc= uppproc;
  2981. >#endif
  2982. >
  2983. >ToolboxCall(myproc);
  2984. >
  2985. >This makes myproc point to a routine descriptor for PowerPC code and
  2986. >and to the function itself for 68K code.
  2987.  
  2988. But the Universal Headers will do that for you anyway. They're macroed
  2989. on the 68K to just pass the procptr, and to do the right thing on the
  2990. PPC.
  2991.  
  2992. What you want to do is check your code for the Universal Headers, you
  2993. can do this by looking for #ifdef __CONDITIONALMACROS__
  2994.  
  2995. Here's a little standard file hacking:
  2996.  
  2997. // definitions
  2998. #ifdef __CONDITIONALMACROS__
  2999.     FileFilterUPP        myFolderFilterUPP;
  3000.     ModalFilterUPP    myFolderEventsUPP;
  3001.     DlgHookUPP        myDlgHookUPP;
  3002. #endif
  3003.  
  3004. // code
  3005. #ifdef __CONDITIONALMACROS__
  3006.     myFolderFilterUPP = NewFileFilterProc(FolderFilter);
  3007.     myFolderEventsUPP = NewModalFilterProc(FolderEvents);
  3008.     myDlgHookUPP = NewDlgHookYDProc(FolderItems);
  3009.     SFPGetFile(where, (StringPtr)0, myFolderFilterUPP, -1, 0, myDlgHookUPP,
  3010.            &reply, 20001, myFolderEventsUPP);
  3011.     DisposeRoutineDescriptor(myFolderFilterUPP);
  3012.     DisposeRoutineDescriptor(myFolderEventsUPP);
  3013.     DisposeRoutineDescriptor(myDlgHookUPP);
  3014. #else
  3015.     SFPGetFile(where, (StringPtr)0, (ProcPtr) FolderFilter, -1, 0, FolderItems,
  3016.            &reply, 20001, (ProcPtr) FolderEvents);
  3017. #endif
  3018.  
  3019. -Owen
  3020.  
  3021. -- 
  3022. Owen Hartnett                omh@cs.brown.edu
  3023. "FAITH, n. Belief without evidence in what is told by one who speaks
  3024.         without knowledge, of things without parallel."
  3025.             -Ambrose Bierce - The Devil's Dictionary
  3026.  
  3027. +++++++++++++++++++++++++++
  3028.  
  3029. >From dubois@primate.wisc.edu (Paul DuBois)
  3030. Date: 30 Nov 1994 09:48:56 -0600
  3031. Organization: Castra Parvulorum
  3032.  
  3033. >From article <1994Nov30.044315.15619@cs.brown.edu>, by omh@cs.brown.edu (Owen M. Hartnett):
  3034. > In article <3bg2qpINNdvn@uakari.primate.wisc.edu> dubois@primate.wisc.edu writes:
  3035. >>From article <3bfcaf$ee4@tuba.cit.cornell.edu>, by jmk3@crux4.cit.cornell.edu (Jay Krell):
  3036. >>> 'm having trouble making static routine descriptors/upps in code for
  3037. >>> 68K and PPC.
  3038. >>> 
  3039. >>> (p. 2-23 of IM is roughly:
  3040. >>> 
  3041. >>> RoutineDescriptor myRD= BUILD_ROUTINE_DESCRIPTOR(upptype, uppproc);
  3042. >>> UniversalProcPtr myproc= &myRD;
  3043. >>> 
  3044. >>> ToolboxCall(myproc);
  3045. >>
  3046. >>I do something like this:
  3047. >>
  3048. >>#if ppc code
  3049. >>RoutineDescriptor myRD= BUILD_ROUTINE_DESCRIPTOR(upptype, uppproc);
  3050. >>UniversalProcPtr myproc= &myRD;
  3051. >>#else    /* 68K code */
  3052. >>UniversalProcPtr myproc= uppproc;
  3053. >>#endif
  3054. >>
  3055. >>ToolboxCall(myproc);
  3056. >>
  3057. >>This makes myproc point to a routine descriptor for PowerPC code and
  3058. >>and to the function itself for 68K code.
  3059. > But the Universal Headers will do that for you anyway. They're macroed
  3060. > on the 68K to just pass the procptr, and to do the right thing on the
  3061. > PPC.
  3062.  
  3063. The Universal Headers will do *what* for you anyway?  Define
  3064. BUILD_ROUTINE_DESCRIPTOR for the 68K case?  Unless I'm missing something,
  3065. that macro isn't conditionally defined differently for 68K vs. PPC
  3066. code.
  3067.  
  3068. The example you give below works for the use of routine descriptor
  3069. generating functions that are called on the fly.  The original posting
  3070. asked for a method for static routine descriptor allocation.
  3071.  
  3072. > What you want to do is check your code for the Universal Headers, you
  3073. > can do this by looking for #ifdef __CONDITIONALMACROS__
  3074. > Here's a little standard file hacking:
  3075. > // definitions
  3076. > #ifdef __CONDITIONALMACROS__
  3077. >     FileFilterUPP        myFolderFilterUPP;
  3078. >     ModalFilterUPP    myFolderEventsUPP;
  3079. >     DlgHookUPP        myDlgHookUPP;
  3080. > #endif
  3081. > // code
  3082. > #ifdef __CONDITIONALMACROS__
  3083. >     myFolderFilterUPP = NewFileFilterProc(FolderFilter);
  3084. >     myFolderEventsUPP = NewModalFilterProc(FolderEvents);
  3085. >     myDlgHookUPP = NewDlgHookYDProc(FolderItems);
  3086. >     SFPGetFile(where, (StringPtr)0, myFolderFilterUPP, -1, 0, myDlgHookUPP,
  3087. >            &reply, 20001, myFolderEventsUPP);
  3088. >     DisposeRoutineDescriptor(myFolderFilterUPP);
  3089. >     DisposeRoutineDescriptor(myFolderEventsUPP);
  3090. >     DisposeRoutineDescriptor(myDlgHookUPP);
  3091. > #else
  3092. >     SFPGetFile(where, (StringPtr)0, (ProcPtr) FolderFilter, -1, 0, FolderItems,
  3093. >            &reply, 20001, (ProcPtr) FolderEvents);
  3094. > #endif
  3095. -- 
  3096. Paul DuBois
  3097. dubois@primate.wisc.edu
  3098.  
  3099. +++++++++++++++++++++++++++
  3100.  
  3101. >From pottier@corvette.ens.fr (Francois Pottier)
  3102. Date: 30 Nov 1994 18:28:36 GMT
  3103. Organization: Ecole Normale Superieure, PARIS, France
  3104.  
  3105. In article <3bi6t8INNjg2@uakari.primate.wisc.edu>,
  3106. Paul DuBois <dubois@primate.wisc.edu> wrote:
  3107.  
  3108. >> But the Universal Headers will do that for you anyway. They're macroed
  3109. >> on the 68K to just pass the procptr, and to do the right thing on the
  3110. >> PPC.
  3111. >
  3112. >The Universal Headers will do *what* for you anyway?  Define
  3113. >BUILD_ROUTINE_DESCRIPTOR for the 68K case?  Unless I'm missing something,
  3114. >that macro isn't conditionally defined differently for 68K vs. PPC
  3115. >code.
  3116.  
  3117. Paul is right. BUILD_ROUTINE_DESCRIPTOR is defined only on the PPC.
  3118. Using BUILD_ROUTINE_DESCRIPTOR instead of NewWhateverUPP() is better
  3119. because it doesn't cause any heap allocation. I remember discussing
  3120. this topic with Zalman Stern a while ago on csmp, he defines a macro
  3121. that simply returns a function pointer on 68k and builds a static
  3122. routine descriptor using BUILD_ROUTINE_DESCRIPTOR on PPC.
  3123.  
  3124.  
  3125.  
  3126. -- 
  3127. Francois Pottier                                            pottier@dmi.ens.fr
  3128. - ----------------------------------------------------------------------------
  3129. Check my WWW page at http://acacia.ens.fr:8080/home/pottier/index.html ...
  3130.  
  3131. +++++++++++++++++++++++++++
  3132.  
  3133. >From jpek@umich.edu (Jeff Pek)
  3134. Date: 30 Nov 1994 18:24:11 GMT
  3135. Organization: U of Mich (MBA)
  3136.  
  3137. In article <3bi6t8INNjg2@uakari.primate.wisc.edu>
  3138. dubois@primate.wisc.edu (Paul DuBois) writes:
  3139.  
  3140. > >>This makes myproc point to a routine descriptor for PowerPC code and
  3141. > >>and to the function itself for 68K code.
  3142. > > 
  3143. > > But the Universal Headers will do that for you anyway. They're macroed
  3144. > > on the 68K to just pass the procptr, and to do the right thing on the
  3145. > > PPC.
  3146. > The Universal Headers will do *what* for you anyway?  Define
  3147. > BUILD_ROUTINE_DESCRIPTOR for the 68K case?  Unless I'm missing something,
  3148. > that macro isn't conditionally defined differently for 68K vs. PPC
  3149. > code.
  3150.  
  3151. Univ Headers define macros (that are conditionally defined) to create
  3152. UPPs for all system callbacks (e.g. ControlActionUPP). You don't have
  3153. to have any #ifxxx junk in your code, as the appropriate univ hdr file
  3154. will take care of that.
  3155.  
  3156. > The example you give below works for the use of routine descriptor
  3157. > generating functions that are called on the fly.  The original posting
  3158. > asked for a method for static routine descriptor allocation.
  3159.  
  3160. To create a static upp, you just have to do (something like):
  3161.  
  3162. pascal Boolean fcn(...);
  3163. static xxxUPP = NewxxxProc(fcn);
  3164.  
  3165. Jeff
  3166. - -------------------------------------------
  3167. Jeff Pek                       jpek@umich.edu
  3168. Emerald Intelligence / University of Michigan
  3169.  
  3170. +++++++++++++++++++++++++++
  3171.  
  3172. >From chopps@water.emich.edu (Christian E. Hopps)
  3173. Date: 30 Nov 1994 18:58:22 GMT
  3174. Organization: University of Michigan EECS Dept.
  3175.  
  3176. Jeff Pek (jpek@umich.edu) wrote:
  3177. [...]
  3178. : To create a static upp, you just have to do (something like):
  3179.  
  3180. : pascal Boolean fcn(...);
  3181. : static xxxUPP = NewxxxProc(fcn);
  3182.  
  3183. Heh, obviously someone whose roots are in C++ (as opposed to C) :)
  3184. This doesn't work in C BTW.  Other solutions have been posted..
  3185.  
  3186. Chris.
  3187.  
  3188. +++++++++++++++++++++++++++
  3189.  
  3190. >From dubois@primate.wisc.edu (Paul DuBois)
  3191. Date: 30 Nov 1994 15:43:21 -0600
  3192. Organization: Castra Parvulorum
  3193.  
  3194. >From article <3big0b$bg5@lastactionhero.rs.itd.umich.edu>, by jpek@umich.edu (Jeff Pek):
  3195. > In article <3bi6t8INNjg2@uakari.primate.wisc.edu>
  3196. > dubois@primate.wisc.edu (Paul DuBois) writes:
  3197. >> >>This makes myproc point to a routine descriptor for PowerPC code and
  3198. >> >>and to the function itself for 68K code.
  3199. >> > 
  3200. >> > But the Universal Headers will do that for you anyway. They're macroed
  3201. >> > on the 68K to just pass the procptr, and to do the right thing on the
  3202. >> > PPC.
  3203. >> 
  3204. >> The Universal Headers will do *what* for you anyway?  Define
  3205. >> BUILD_ROUTINE_DESCRIPTOR for the 68K case?  Unless I'm missing something,
  3206. >> that macro isn't conditionally defined differently for 68K vs. PPC
  3207. >> code.
  3208. > Univ Headers define macros (that are conditionally defined) to create
  3209. > UPPs for all system callbacks (e.g. ControlActionUPP). You don't have
  3210. > to have any #ifxxx junk in your code, as the appropriate univ hdr file
  3211. > will take care of that.
  3212.  
  3213. Not for BUILD_ROUTINE_DESCRIPTOR, which isn't a callback and isn't
  3214. conditionally defined.
  3215.  
  3216. >> The example you give below works for the use of routine descriptor
  3217. >> generating functions that are called on the fly.  The original posting
  3218. >> asked for a method for static routine descriptor allocation.
  3219. > To create a static upp, you just have to do (something like):
  3220. > pascal Boolean fcn(...);
  3221. > static xxxUPP = NewxxxProc(fcn);
  3222.  
  3223. Well, perhaps I understand these issues less well than I *already* thought
  3224. I didn't understand them :-), but how would this work?  Wouldn't it allocate
  3225. a pointer object on the heap, as opposed to static allocation of the routine
  3226. descriptor?  (The latter being what is desired for the question that began
  3227. this thread.)
  3228.  
  3229.  
  3230. Another nice question is how to get the right sort of callback when you
  3231. want to generate either PPC or 68K code, *and* you want people that don't
  3232. have the universal headers to be able to compile the source.  (The latter
  3233. would be generating 68K code only, of course.)
  3234. -- 
  3235. Paul DuBois
  3236. dubois@primate.wisc.edu
  3237.  
  3238. +++++++++++++++++++++++++++
  3239.  
  3240. >From omh@cs.brown.edu (Owen M. Hartnett)
  3241. Date: Thu, 1 Dec 1994 02:41:55 GMT
  3242. Organization: Brown University Department of Computer Science
  3243.  
  3244. In article <3birlpINNoqk@uakari.primate.wisc.edu> dubois@primate.wisc.edu writes:
  3245. >From article <3big0b$bg5@lastactionhero.rs.itd.umich.edu>, by jpek@umich.edu (Jeff Pek):
  3246. >> In article <3bi6t8INNjg2@uakari.primate.wisc.edu>
  3247. >> dubois@primate.wisc.edu (Paul DuBois) writes:
  3248. >> 
  3249. >>> >>This makes myproc point to a routine descriptor for PowerPC code and
  3250. >>> >>and to the function itself for 68K code.
  3251. >>> > 
  3252. >>> > But the Universal Headers will do that for you anyway. They're macroed
  3253. >>> > on the 68K to just pass the procptr, and to do the right thing on the
  3254. >>> > PPC.
  3255. >>> 
  3256. >>> The Universal Headers will do *what* for you anyway?  Define
  3257. >>> BUILD_ROUTINE_DESCRIPTOR for the 68K case?  Unless I'm missing something,
  3258. >>> that macro isn't conditionally defined differently for 68K vs. PPC
  3259. >>> code.
  3260. >> 
  3261. >> Univ Headers define macros (that are conditionally defined) to create
  3262. >> UPPs for all system callbacks (e.g. ControlActionUPP). You don't have
  3263. >> to have any #ifxxx junk in your code, as the appropriate univ hdr file
  3264. >> will take care of that.
  3265. >
  3266. >Not for BUILD_ROUTINE_DESCRIPTOR, which isn't a callback and isn't
  3267. >conditionally defined.
  3268. >
  3269. >>> The example you give below works for the use of routine descriptor
  3270. >>> generating functions that are called on the fly.  The original posting
  3271. >>> asked for a method for static routine descriptor allocation.
  3272. >> 
  3273. >> To create a static upp, you just have to do (something like):
  3274. >> 
  3275. >> pascal Boolean fcn(...);
  3276. >> static xxxUPP = NewxxxProc(fcn);
  3277. >
  3278. >Well, perhaps I understand these issues less well than I *already* thought
  3279. >I didn't understand them :-), but how would this work?  Wouldn't it allocate
  3280. >a pointer object on the heap, as opposed to static allocation of the routine
  3281. >descriptor?  (The latter being what is desired for the question that began
  3282. >this thread.)
  3283. >
  3284. >
  3285. >Another nice question is how to get the right sort of callback when you
  3286. >want to generate either PPC or 68K code, *and* you want people that don't
  3287. >have the universal headers to be able to compile the source.  (The latter
  3288. >would be generating 68K code only, of course.)
  3289.  
  3290. Hmmm... As it turned out to be a deeper problem than I originally thought, I
  3291. went back and read Develop 16's explanation, which is less than clear.
  3292.  
  3293. It was my assumption that you could allocate the static routine
  3294. descriptor, and, under 68K, it would do the right thing. Indeed the article
  3295. somewhat implies that this is so (by stating you could either allocate a UPP
  3296. or use BUILDROUTINEDESCRIPTOR for static.
  3297.  
  3298. But looking at MixedMode.h, there's only one definition for it, and it
  3299. builds a full Routine Desciptor record. Now the question is, if you use
  3300. this record on a 68K, will you live to tell of it? (i.e. is the code
  3301. smart enough to know what you're doing.)
  3302.  
  3303. -Owen
  3304.  
  3305.  
  3306.  
  3307. -- 
  3308. Owen Hartnett                omh@cs.brown.edu
  3309. "FAITH, n. Belief without evidence in what is told by one who speaks
  3310.         without knowledge, of things without parallel."
  3311.             -Ambrose Bierce - The Devil's Dictionary
  3312.  
  3313. +++++++++++++++++++++++++++
  3314.  
  3315. >From kenp@nmrfam.wisc.edu (Ken Prehoda)
  3316. Date: Thu, 01 Dec 1994 13:26:43 -0600
  3317. Organization: Univ of Wisc-Madison, Dept of Biochemistry
  3318.  
  3319. In article <1994Dec1.024155.26434@cs.brown.edu>, omh@cs.brown.edu (Owen M.
  3320. Hartnett) wrote:
  3321.  
  3322. > But looking at MixedMode.h, there's only one definition for it, and it
  3323. > builds a full Routine Desciptor record. Now the question is, if you use
  3324. > this record on a 68K, will you live to tell of it? (i.e. is the code
  3325. > smart enough to know what you're doing.)
  3326. > -Owen
  3327.  
  3328. No, you won't.  The 68K expects a procptr to be a procptr.  If you give it
  3329. a routine descriptor, it will jump to the first entry in the descriptor,
  3330. which is _MixedModeMagic and is not implemented on 68K.  The CFM for 68k
  3331. may change this.
  3332.  
  3333. I haven't actually done this so...
  3334.  
  3335. Ken Prehoda
  3336. Department of Biochemistry
  3337. University of Wisconsin-Madison
  3338. kenp@nmrfam.wisc.edu
  3339.  
  3340. +++++++++++++++++++++++++++
  3341.  
  3342. >From rang@winternet.com (Anton Rang)
  3343. Date: 02 Dec 1994 02:57:44 GMT
  3344. Organization: Trillium Research, Inc.
  3345.  
  3346. In article <3big8k$8jo@nef.ens.fr> pottier@corvette.ens.fr (Francois Pottier) writes:
  3347. >Paul is right. BUILD_ROUTINE_DESCRIPTOR is defined only on the PPC.
  3348. >Using BUILD_ROUTINE_DESCRIPTOR instead of NewWhateverUPP() is better
  3349. >because it doesn't cause any heap allocation.
  3350.  
  3351.   If you're writing an accelerated code resource (e.g. a WDEF, CDEF,
  3352. or other resource called using 68K calling conventions), there's an
  3353. even better reason to use a static routine descriptor: the code
  3354. fragment manager will automatically make it point to the right place
  3355. if your code gets relocated.
  3356.  
  3357.   Of course, most accelerated resources are called at memory-safe
  3358. times, so you can allocate and deallocate a routine descriptor
  3359. dynamically, but....
  3360. --
  3361. Anton Rang (rang@winternet.com)
  3362.  
  3363. +++++++++++++++++++++++++++
  3364.  
  3365. >From Joe Francis <Joe.Francis@dartmouth.edu>
  3366. Date: 7 Dec 1994 16:04:32 GMT
  3367. Organization: Smooth Roo Software
  3368.  
  3369. #if USESROUTINEDESCRIPTORS
  3370.     RoutineDescriptor RBApp_DialogFilterProc_RD =
  3371.         BUILD_ROUTINE_DESCRIPTOR(uppFileFilterYDProcInfo,&OifFileHook);
  3372.     #define RBDIALOGFILT (FileFilterYDUPP)&RBApp_DialogFilterProc_RD
  3373. #else
  3374.     #define RBDIALOGFILT (FileFilterYDUPP)OifFileHook
  3375. #endif
  3376.  
  3377.  
  3378. - ------------------------------------------------------------------------
  3379. "When we gave Bill Gates his first demo of the Macintosh, the first 
  3380. question he asked was "What kind of hardware do you use for the cursor?"
  3381. -Andy Hertzfeld, at the MacHack '94 Keynote address
  3382. - ------------------------------------------------------------------------
  3383.  
  3384. ---------------------------
  3385.  
  3386. End of C.S.M.P. Digest
  3387. **********************
  3388.  
  3389.  
  3390.