HDTenEightyP/NetNews huggingface dataset:
Newsgroups: comp.sys.mac.programmer
Subject: Re: LockPixels() before every CopyBits()?
From: jmatthews@desire.wright.edu
Date: 12 Sep 92 23:22:33 EST
Organization: Wright State University 

> Assuming that the address is okay, I noticed that we don't call
> LockPixels() before CopyBits().  After inserting calls to LockPixels()
> and UnlockPixels(), it looks something like this:
> 
> 	HLock((Handle) pixHandle1);
> 	HLock((Handle) pixHandle2);
> 	LockPixels(pixHandle1);
> 	LockPixels(pixHandle2);
> 	CopyBits((BitMap *)*pixHandle1, (BitMap *)*pixHandle2, ...);
> 	UnlockPixels(pixHandle2);
> 	UnlockPixels(pixHandle1);
> 	HUnlock((Handle) pixHandle2);
> 	HUnlock((Handle) pixHandle1);
> 
> Now this seems to be a bit much for every call to CopyBits.

LockPixels and UnlockPixels should be suffucient; the HLock and
HUnlock aren't needed. I think you may need to be calling
GetGWorldPixMap instead of getting the pixMap directly (except
under ColorQD version 1.2 where it's broken (see the Q & A stack)).

IM VI just says use GetGWorldPixMap without much explanation. I've
imagined this makes a difference with GWorlds on graphic accelerators
or temporary memory, but I don't really know.

Any thoughts?

o----------------------------------------------------------------------------o
| John B. Matthews, jmatthews@desire.wright.edu, disclaimer:= myViews <> WSU |
|      "Whom the gods would destroy, they first invite to program in C"      |
o----------------------------------------------------------------------------o
From: rc05@gte.com (Ramesh Chandak)
Newsgroups: comp.sys.mac.programmer
Subject: cut and paste PICTs : using COPYBITS ?
Date: 9 Sep 92 21:48:02 GMT
Organization: GTE Laboratories Incorporated, Waltham MA

Okay here's the problem.  I have PICT resources pasted onto one window
of this application that I am trying to build.  What I want to do is simple :
cut one PICT resource and paste it onto another window.  I think I should
use COPYBITS to do that.  But I am confused as to what arguments should I
pass on to COPYBITS.  How do take the PICT resource's portbits ? I mean
how do I access them ?

Any help in this regard will be much appreciated.  If possible, please email
your responses to Ramesh at rc05@gte.com.  Thanx much.

- Ramesh
From: ldo@waikato.ac.nz (Lawrence D'Oliveiro, Waikato University)
Newsgroups: comp.sys.mac.programmer
Subject: Re: CopyBits question
Date: 11 Sep 92 18:46:24 +1200
Organization: University of Waikato, Hamilton, New Zealand

In article <1992Sep11.001409.13276@cs.cornell.edu>, csuley@cs.cornell.edu (Christopher Suley) writes:
> I have a color image residing in an offscreen pixmap that I want to
> CopyBits to the screen.  Not too hard, but there's a catch.  I want
> all of the white pixels in the offscreen image to become a certain
> color when they appear on the screen.

This is easy, provided the offscreen pixmap is an indexed one. In an indexed
pixmap, a pixel represents white because it indexes into a CLUT entry containing
white. Want that pixel value to represent a colour other than white? Just
change the CLUT entry!

> Setting the background color to the color I want would work, but it
> would colorize the rest of the image. (right?  I am programming on
> an SE, so this color stuff is mostly a mental experiment until I
> run up the massive hill to school and test it on a color computer
> there... talk about an expensive code/compile/run cycle. ;)

Aye, that it would. Also remember that the colouring effect is different
between System 6 and System 7; the effect under System 6 is dependent on
a whole bunch of other entries in the CLUT (the gory details are in TN 163),
whereas System 7 interpolates between the foreground and background colours.

Lawrence D'Oliveiro                       fone: +64-7-856-2889
Computer Services Dept                     fax: +64-7-838-4066
University of Waikato            electric mail: ldo@waikato.ac.nz
Hamilton, New Zealand    37^ 47' 26" S, 175^ 19' 7" E, GMT+12:00
I don't claim to be consistent. Yes I do!
From: wombat@claris.com (Scott Lindsey)
Newsgroups: comp.sys.mac.programmer
Subject: Re: vrefNum from Path Name
Date: 4 Sep 92 23:37:28 GMT
Distribution: usa
Organization: Spartacus Software

In article <Btwwt5.7Bv@taligent.com>, keith@taligent.com (Keith Rollin) writes:
> 
> 
> Remember, Inside Mac says that you should _NOT_ create FSSpecs by hand. You
> should always call FSMakeFSSpec. Don't go filling in the parID and vRefNum
> fields yourself. (There is one exception to this, which is that you can freely
> assign one FSSpec record to another.)

Hmm.  But what if you're under System 6 without FSSpec calls?  In particular,
FTSend() requires an FSSpecArrayPtr, apparently without regard to whether
you're running System 6 or 7.
In this case I fill in the FSSpec by hand and hope that the FT tool can deal
with the fact that it can't use FSSpec calls to process the file referred to. 
--
Scott Lindsey <wombat@claris.com>
From: Glen.Stewart@f175.n2240.z1.ieee.org (Glen Stewart)
Newsgroups: comp.sys.mac.programmer
Subject: RE: Hermes external in C
Date: 31 Aug 92 14:21:01 GMT
Organization: FidoNet node 1:2240/175 - The Associati, Grand Blanc MI

Mary -

You're pretty ambitious.  First I read you're looking for Basic source, now C
tips for Hermes...

I'm just completing a Think C project which is a very functional Hermes
external.  It's almost fully commented, and the program flow is pretty
understandable.  I'm no pro, but I've picked up that the standard printing
command is not acceptable to Hermes - it wants control of everything like
that.  So there are some special functions you can call that will take care of 
this for you.

I'm struggling to fix a problem from the modification I made to the original
program, by Robert Duran Jr.  Once it is fixed (I'll be working on it this
afternoon, I hope), I'll put it online on my BBS and on the Hermes support
BBS.

The more basic functions are really easy to implement (simple textual
interaction), but anything calling the idle loop (hooks into the main
interface) are tricky and poorly documented.  I'm also trying to update the
HermesHeader.h to Hermes 2.0 status.  This update is also nearly complete -
trying to get a little help from Robert on this one.

Bye for now.


--  
=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=
 Glen Stewart - Internet: Glen.Stewart@f175.n2240.z1.ieee.org
Newsgroups: comp.sys.mac.programmer
From: valerio@cpsc.ucalgary.ca (Valerio Franceschin)
Subject: AppleEvent error -903 ???
Organization: University of Calgary Computer Science
Date: Sat, 5 Sep 1992 00:55:10 GMT


I can't seem to get Apple Events working on my Mac. AESend returns
error -903.  There is no error -903 listed in Inside Macintosh 6.
I get this error when running sample programs that I got out of
Macintosh C Programming Primer, Vol 1, 2n Ed.  I copied the programs,
EventTracker(pg 143) and EventTrigger(pg 190), and although EventTracker
works just like the book says, EventTrigger results in error -903
when trying to do the AESend.

Has anyone had a similar problem, or know what error -903 could be.
Any help would be very much appreciated.  Please e-mail replies directly
to me.

Thanks,
V
From: bwilliam@iat.holonet.net (Bill Williams)
Newsgroups: comp.sys.mac.programmer
Subject: PGP - public key encryption for the Mac!!
Date: 12 Sep 92 05:58:50 GMT
Organization: HoloNet (BBS: 510-704-1058)

"David Meyers at Georgia Institute of Technology" observed that several
people are using a VERY GOOD mail encryption technology called PGP (Pretty
Good Privacy) and asked for the following info...
 
PGP 2.0 is discussed in detail in Sept 1992 "BoardWatch" BBS magazine.
 
PGP uses some RSA-ish stuff and other cryptographic technologies. And is
IMPORTED from abroad and therefore in theory can be exported from this
fascist sick country controlled by the NSA.
 
PGP  2.0 uses IDEA (International Data Encryption Algorithm" from the
Univ. of Switzerland (ETH Zurich) and thus is not controlled or crippled
by NSA "plants" or NSA restrictions.
 
PGP SOURCE can be obtained from locations directed from its original
author at address "prz@sage.cgd.ucar.edu" but if you bother Philip
Zimmerman unless you are a researcher with important issues, it would be
tacky. Instead FTP the MSDOS source directly from outside the country!
 
just ftp kauri.vuw.ac.nz  and   cd to /pub/ms-dos/Encryption to get the
source files "PGP20SRC.ZIP"
 
If you are not a programmer this knowledge will do you no good for the Mac.
 
BWilliams
 
 
Newsgroups: comp.sys.mac.programmer
From: zben@ni.umd.edu (Charles B. Cranston)
Newsgroups: comp.sys.mac.programmer
Subject: Re: Is a resource fork already open?
Date: 8 Sep 92 23:32:07 GMT
Followup-To: comp.sys.mac.programmer
Organization: UM Home for the Terminally Analytical

In article <BuA4CH.9C4@taligent.com>, keith@taligent.com (Keith Rollin)
wrote:

> Sometimes you want to know if the resource fork is open in _your_
> application. Calling PBGetCatInfo will tell you if the file is open
> within _any_ application. The method Lawrence posted is the proper method.
> 
> (Another method, which is more fun but which is very likely to break at some
> time in the future is to walk the resource chain, pull out refnums, call
> GetFCBInfo on them, and see if the file you are interested in is returned.)

Yeah, I missed the ioFlAttib too, since the doc on the field is so far
away from the doc on the trap.  I came up with the follwing:

Do GetCatInfo, if ioFRefNum is zero then no access path onto either fork
is open, so the resource fork is not open.

Else use a series of indexed GetFCBInfo calls to look for one that
matches ParID and NamePtr and has bit 1 set in ioFCBFlags which says
it is a resource fork path.  I think this is a slightly cleaner version
of what Keith jokingly suggests...

zben@ni.umd.edu     -KA3ZDF
Newsgroups: comp.sys.mac.programmer
From: francois@welchgate.welch.jhu.edu (Francois Schiettecatte)
Subject: handles and MoveHHi
Organization: Johns Hopkins Univ. Welch Medical Library
Date: Sun, 13 Sep 1992 16:12:38 GMT

Hi, sorry if these questions are a FAQ but here goes:

- is there a real advantage to using MoveHHi before locking your
handles, I have not really seen much on that except that Think Reference
suggests that is *may* help in reducing heap fragmentation. Are there
any definite rules for using MoveHHi and caveat.

- Also when passing parameters in C is it better to use pointers or
handles. I guess the answer is really along the lines of it depends
on what you do with them afterwards, ie do you lock them, do you need to 
allocate new memory, etc. Does anyone have any guidelines for this.

If there is interest, I wil post back a summary.

thansk

francois


francois@welchgate.welch.jhu.edu

Newsgroups: comp.sys.mac.programmer
From: lsr@taligent.com (Larry Rosenstein)
Subject: Re: GNU C++ for the Macintosh?
Followup-To: comp.sys.mac.programmer
Organization: Taligent, Inc.
Date: Tue, 8 Sep 1992 22:54:41 GMT

In article <D2150035.cllrbx@outpost.SF-Bay.org>, peirce@outpost.SF-Bay.org
(Michael Peirce) wrote:
> 
> Isn't it about time they [FSF] drop their boycott now that the Apple lawsuit
> is over and Apple lost?  

I don't think the FSF will ever drop their boycott, because I don't think
Apple will publicly renounce their views on UI copyrights.  I believe that
the FSF reasons that if Apple has sued once they will sue again, and that
because of this they will continue the boycott.  (There may also be
something about Apple appealing the ruling, etc.)

Also, I think there's not much motivation for the FSF to drop the boycott. 
The boycott seems to be a rallying point for the FSF "followers",
especially when the target is a highly visible company such as Apple.  

I don't think they ever did any development on Macs, so the boycott isn't
much of a burden on them.  (Although it is a burden for some people who own
Macs and have to reluctantly rely on them.)  

Even if they did drop the boycott, the FSF probably would not actively
support the Mac (especially not the Mac OS).  They don't actively support
all possible machines, although they don't actively discourage use and
support of those machines (as they do with Macs).

Larry Rosenstein
Taligent, Inc.

lsr@taligent.com
Newsgroups: comp.sys.mac.programmer
From: niko@iastate.edu (Nikolaus E Schuessler)
Subject: ********** MAJOR CRISIS ***********
Organization: Iowa State University, Ames, IA
Date: Tue, 8 Sep 1992 23:28:44 GMT


I have done nothing on my computer since yesterday since I did
some dial up work on the computer systems here. Today I came home
to find it wouldn't find the hard drive... * nothing * will..
What in the world could have caused this?  Humidity? dust? It was
just sitting here...

I am much more interested in how I can recover my stuff.  It is
a standard issue Apple 40M jobber... (jammed full although).

Any suggestions?? 

It boots 'fine' off a floppy.

* sigh *

-- 
Niko Schuessler               
Project Vincent Systems Manager              email: niko@iastate.edu
Iowa State University Computation Center     voice: (515) 294-1672
Ames IA 50010                                snail: 272 Durham 
Newsgroups: comp.sys.mac.programmer
From: d88-jwa@cyklop.nada.kth.se (Jon W{tte)
Subject: Re: What is error -5016?
Originator: d88-jwa@cyklop.nada.kth.se
Organization: Royal Institute of Technology, Stockholm, Sweden
Date: Sat, 12 Sep 1992 12:35:31 GMT

   meaning of that error number?  I'd like to be able to give a reasonable
   error message to the user; can I just assume that -5016 means, "You're
   not connected to the network, bozo"?

geterrortext -5016
Server not responding (OS error -5016)


-- 
Jon W{tte, h+@nada.kth.se, Sweden, Phone +46-8-107069

Help eradicate FIDO-Net <-> Usenet gateways in our time!
Newsgroups: comp.sys.mac.programmer
From: kpm@well.sf.ca.us (Keith Morgan)
Subject: Opinions requested: Bedrock path
Organization: Whole Earth 'Lectronic Link
Distribution: usa
Date: Mon, 7 Sep 1992 23:58:42 GMT

I am a new Mac developer interested in cross-platform development. I am 
eliciting others opinions on what development tools to buy and learn
that will be most useful in positioning me for Bedrock, when it becomes 
available. I am concerned both about purchase price and the time-cost of 
learning. 

On the one hand, since Bedrock will be an Apple product based on C++, 
buying MPW would appear to be the most direct path. Cons include the entry 
price (currently about $600 for C++ bundle) and the uncertain applicability 
of hard-won MPW expertise to Bedrock development. 

On the other hand, Think C is an inexpensive tool, and since Symantec is 
building Bedrock, one could assume that they will do their best to remain 
compatible with their existing product line, or at least provide a smooth 
transition path to Bedrock. Cons include the facts that TCL is not 
completely C++ compatible, and thus knowledge of TCL may not transition over 
well to C++, and that the initial delivery of Bedrock may very well run on 
top of MPW. 

Xref: sparky comp.sys.mac.programmer:15097 comp.sys.mac.apps:14261
From: sdorner@qualcomm.com (Steven Dorner)
Newsgroups: comp.sys.mac.programmer,comp.sys.mac.apps
Subject: 2up, double-sided printing
Date: 7 Sep 92 22:14:03 GMT
Organization: Qualcomm, Inc

I have a very large (500+ pages) document (the AppleEvents registry), which
I would like to print.  However, printing this single-sided at full size
would take an entire ream of paper, which is unacceptable.

What I would really like is to be able to print this document 2-up, on both
sides of a sheet.  That way, I use 125 pieces of paper, not 500.  If I
could simply manage to print it 2up OR double-sided, that would be less
good but still helpful.

I have tried importing the document into WriteNow (which could print it
double-sided), but it doesn't import cleanly, and I'm chary of printing it
out only to find many pages ruined.

I have tried post-editing the PostScript; while I can make this work for
normal PS output, it doesn't work for this MS-Word doc (not surprising
:-().

I tried changing the source document.  Unfortunately, it uses many dozens
of styles, I haven't the foggiest idea how to use MS Word, and so it's
basically hopeless.

If anyone knows of any way I can get this monster printed out 2up or
2-sided or (preferably) both, I would be very grateful.  I have a copy of
MS-Word (legal, but no manual), MPW, Perl, WriteNow, and some knowledge of
PostScript (though I lost my Red Book when I changed jobs).  I have ETO
(but not AppleLink, so the copy in AppleLink format on ETO is of limited
use, since it is evidently too big for the freeware Glue viewer).  I also
have a PS Printer (a Personal LW NTR, should that matter).

Suggestions?  Utilities?  Ps files of the even and odd sides of the AE
Registry printed 2up :-)?

Please email, and I will post a solution if I find one.

--
Steve Dorner, Qualcomm, Inc.
Giving one of them new-fangled Mac newsreaders a try.
From: chuck@gte.com (Chuck Hoffman)
Newsgroups: comp.sys.mac.programmer
Subject: Re: Look before you Leap
Date: 9 Sep 92 19:23:17 GMT
Followup-To: comp.sys.mac.programmer
Organization: GTE Laboratories

In article <1992Sep9.143915.19555@nic.funet.fi>, asunta@convex.csc.FI
(Miika Asunta) wrote:
> 
> In <lanbtrINN8tj@pollux.usc.edu> suhler@pollux.usc.edu (Paul A. Suhler) writes:
> 
> >A note for those writing programs that calculate future dates:
> >unless I'm mistaken, any year which is integrally divisible by 400
> >is NOT a leap year.
> 
> >Paul Suhler
> 
> Howzabout 2000/400=5?
> 
> 1980,1984,1988,1992,1996,2000

If it is integrally divisible by 400 it *IS* a leap year.  The year 1900
was not a leap year (divisible by 4, but not by 400).  The year 2000 will
be.

Chuck Hoffman
chuck@gte.com
GTE Laboratories, Waltham, Massachusetts, USA
(617) 466-2131
=====================================
I'm not sure why we're here, but I am sure that while we're here we're
supposed to help each other.
=====================================
From: podenski@bcsaic.boeing.com (Patrick Podenski)
Newsgroups: comp.sys.mac.programmer
Subject: Re: Adding Balloon help
Date: 9 Sep 92 22:13:20 GMT
Organization: Boeing Computer Services AI Center, Seattle

In article <1992Sep8.154613.10915@bmers95.bnr.ca> ross@bnr.ca (Ross Brown) writes:
>In article <1992Sep4.162113.17663@hobbes.kzoo.edu> k044477@hobbes.kzoo.edu
>(Jamie R. McCarthy) writes:
>>TidBITS doesn't seem to have anything about QuickTime in balloons.
>>Leonard R.'s movie-for-a-finder-icon hack is mentioned (hey, Leonard,
>>want to upload that somewhere?) but that's it.
>
>You're right, Jamie, the movie was in a Finder icon, not in a balloon.  My
>error.  I think I'd rather see the movie in an icon, especially if you could
>turn the movie on and off by selecting/deselecting the icon.

I attempted to place a QuickTime movie in balloon help within a Prograph
application. It was very easy to do because Prograph has a very nice
built-in balloon editor. However, when I bring up the balloon, there is
no way to go and activate the QuickTime movie. I am using Wild Magic,
which has a small icon which must be clicked to deploy the QuickTime
movie controls. Once you mouse out of the object to which the balloon
help corresponds, the balloon goes away. Therefore, I cannot click on
the Wild Magic icon.

I certainly can see the value of QuickTime in balloon help. I hope that
someone will make it possible.
Newsgroups: comp.sys.mac.programmer
From: rsilvers@powwow.nynexst.com (Rob Silvers)
Subject: Need small example of playing a sound in THINK C.
Originator: rsilvers@powwow
Organization: Nynex Science and Technology
Date: Mon, 7 Sep 92 00:19:53 GMT




	I have gotton the Mac to play sampled sound resources in
THINK C, but I am having trouble playing a synthesized square wave.
Could someone send me a small example of playing a simple note?

					Thanks,
						--Rob.
From: chris@benton.prepress.com (christopher m. knox)
Newsgroups: comp.sys.mac.programmer
Subject: Re: Game Techniques (was: NON-QUICKDRAW GAMES)
Date: 10 Sep 92 17:05:49 GMT
     <D88-JWA.92Sep9134048@musta.nada.kth.se>
     <D88-JWA.92Sep9192844@cyklop.nada.kth.se> <BuD6qK.7HM@acsu.buffalo.edu>
Organization: Pre-Press Technologies, Inc.
X-Useragent: Nuntius v1.1b2

Subject: Re: Game Techniques (was: NON-QUICKDRAW GAMES)
From: Nick B Triantos, triantos@acsu.buffalo.edu
In article <BuD6qK.7HM@acsu.buffalo.edu> Nick B Triantos,
triantos@acsu.buffalo.edu writes:
>2.  More importantly, from the THINK debugger,
>      offset + base_address (an extern Ptr) + i * 1024
>    moves me to the correct scan line, but I get an error compiling with
>    longPtr assigned to this equation because of a type conflict.  But
if I
>    type cast base_address to (long *) (as done in the code, see PROBLEM
LINE
>    below), it changes the value of longPtr from being incremented
0x0400 to
>    being incremented by 0x1000.  
>
>PROBLEM LINE:   longPtr = offset + (long *)base_address + i * 1024 ;
>                                                   /* 1024=bytes/scan
line */

Greetings...
I've grappled with the same problem a few times. In C, if you increment a
pointer, it gets incremented by the size of the base type e.g.:
	char *pc;
	long *pl;

++pc;	/* gets incremented by 1 byte, since sizeof(char) is 1 byte */
++pl;	/* gets incremented by 4 bytes, since sizeof(long) is 4 bytes */

this is convenient most of the time but also easy to forget. To fix your
problem line, change it to:  longPtr = (long *) ((long) offset + (long)
base_address + (long) i * 1024L);
this performs the calculation as arithmetic rather than pointer
arithmetic (all the casts
are not necessary but at least you know exactly what's going on).
Hope this helps.
chris knox "Omne animal triste est post (or without) coitum"
Newsgroups: comp.sys.mac.programmer
From: moofster@world.std.com (Robert M Seretny)
Subject: Hey!  Check out page 126 of MacWeek
Organization: The Nest of the Moofster
Date: Tue, 15 Sep 1992 16:04:13 GMT


Syquests for under $400 with cart and toshiba's 870 MB mech for $1300.... not
bad!  Never heard of Spin before, but it sounds like their 800-number is worth
a call...  standard warranty and 30-day money back guarantee...  Hmmmm....

let's see.. they take visa/mc...  (800) 466-1200 the hours say 9 to 9.

Toodles,
Moofster

PS: NO affiliation with any person or organization of Spin Peripherals is
claimed.  The ad caught my eye since it's broken through some price points...