HDTenEightyP/NetNews huggingface dataset:
From: mhall@occs.cs.oberlin.edu (Matthew Hall)
Subject: Suggestion: Graphics Help Compilation
Organization: Oberlin College Computer Science
Distribution: comp.sys.mac.programmer
Date: Tue, 13 Oct 1992 21:27:47 GMT
X-Posted-From: occs.cs.oberlin.edu
NNTP-Posting-Host: sol.ctr.columbia.edu

Hello-
	I have a simple proposition.  Since so many people on this
newsgroup ask about implementing graphics, and several questions are
asked quite a bit, and graphics is a very large subject, how about
compiling the wisdom of the net to create a graphics manual, much like
UMPG.  I realize there are books about this, including "How to program
quickdraw" or something like that, but that didn't really answer a lot
of the questions I have had.  The topics that it could include could
start very simple (how do I create a bitmap) to very complex (how do I
do direct-to-screen animation linked to slot VBL's)  This seems to me
a very worthy idea, and one that many (including myself) could benefit
from. Once finished, it could be posted to SUMEX.  
	Certainly it would need someone to compile it.  I will do it,
however my graphics knowledge is limited and I wouldn't be able to
verify everything.  Also, I only know pascal.  However, this is
something I would really like to see done, since piecing information
together from several different threads can be time consuming and
confusing, and it would be nice to have a single tome I could browse
if I had a question on something such as direct-to-offscreen drawing.

Please, let me know if you would like to help, or if you just think
it's a good idea (or a bad one)

Sincerely,
matt hall

--
-------------------------------------------------------------------------------
Matt Hall.    mhall@occs.oberlin.edu  OR  SMH9666@OBERLIN.BITNET
              (216)-775-6613 (That's a Cleveland Area code. Lucky Me)

"Life's good, but not fair at all"  -Lou Reed

Newsgroups: comp.sys.mac.programmer
From: d88-jwa@dront.nada.kth.se (Jon Wtte)
Subject: Re: Parsing a text file (TP 4.01, MacApp 2.01)
Originator: d88-jwa@dront.nada.kth.se
Organization: Royal Institute of Technology, Stockholm, Sweden
Date: Sun, 11 Oct 1992 19:13:06 GMT

> roessli@sc2a.unige.ch writes:

   The problem is the following: I'm using THINK Pascal 4.01 and MacApp 2.01
   as programing environment and librairies. I planned to use THINK's built
   in procedures (OldFileName,..) to identify the file to import, and then


Bad idea.

Use SFGetFile to get the file (or, if you're System 7 Studly,
StandardGetFile) and then call GetWDInfo on the vRefNum to get
a REAL vRefNum and dirID; the call HOpen on the vRefNum, dirID
and name to open the file.

You have to do your own file reading buffering; maybe make a
small class that keeps a buffer, fRefNum and has a method for
reading the next real by using another method that gets the
next character. That method could look like:

	if ( bufferFill == 0 ) {

		ReadIntoBuffer ( ) ;
		if ( bufferFill == 0 ) {

			EndOfFile ( ) ;
		}
	}
	c = bufferPtr ;
	bufferPtr = bufferPtr + 1 ;
	bufferFill = bufferFill - 1 ;

	return c ;


This is of course "C," but I have written it in a form I hope
is easy for a pascal person to read.

Have a good one,

-- 
 -- Jon W{tte, h+@nada.kth.se, Mac Hacker Suedoise (not french speaking) --
  "It was, in fact, cool as all get-out.  Fortunately it was a little
   too late (historically speaking) to be groovy."
                     -- Dennis Pelton
From: stevec@apple.com (Steve Christensen)
Newsgroups: comp.sys.mac.programmer
Subject: Re: PowerBook Traps?
Date: 12 Oct 92 22:25:42 GMT
Organization: Apple Computer, Inc.
X-Useragent: Nuntius v1.1

Daryl Spitzer, Daryl_Spitzer@mindlink.bc.ca writes:
>I should have mentioned that I have read the Power Manager chapter, but
>couldn't find any information on switching between the internal modem and
>external (just info on turning off and on power to the ports) nor on
turning
>on and off rest mode or powersaver mode.
>
>Are there traps for these?
>
>Perhaps I should did around in the Portable control panel and Battery DA
with
>MacsBug to see what I can find...

No, there are no programming interfaces for dealing with the Power Manager
other than those documented in IM VI.  Part of the reason for this is that
mucking around with the power management system if you don't know how
everything works can cause stuff to break.  The folks who are providing
some of these features (Connectix' CPU comes to mind) do so by playing in
the Power Manager.  This is potentially "dangerous" because we're not
obligated to keep the Power Manager's internals the same from PowerBook
to PowerBook.  Evolution and improvements to the model force things to
change...

steve
Newsgroups: comp.sys.mac.programmer
From: paulr@syma.sussex.ac.uk (Paul Russell)
Subject: Re: Moving the mouse pointer-- how?
Organization: University of Sussex
Date: Wed, 7 Oct 1992 14:31:06 GMT

>>jkreibic@sumter.cso.uiuc.edu (Jay Arnold Kreibich) writes:
>>
>>
>>
>>>  I am writing a driver program that needs to move the mouse cursor  
>>>location around the screen, but I'm not quite sure how to do that.  Any  
>>>tips on where to lookup functions that will assign a new mouse pointer  
>>>location?
>>

Shame on me for posting this - my only excuse is that I work in a
psychology department... ;-) This code was written by me a long time
ago, and may be freely used...

---

unit UMouseStuff; { mouse utilities }

interface

  procedure SetMouse (pt: Point); { move the current cursor position to the given point }

implementation

  const { low memory globals }
    jCrsrTask = $08EE; { ProcPtr }
    MTemp = $0828; { Point - Low Level interupt mouse location }
    RawMouse = $082C; { Point - unprocessed mouse location }
    Mouse = $830; { Point - processed mouse location }
    CrsrNew = $08CE; { char - set != 0 if mouse has moved }
    CrsrCouple = $08CF; { char - set = 0 if cursor not allowed to move }

  type
    PointPtr = ^Point; { a pointer to a point }

{--- private functions for accessing low memory globals ---}

  function Get_MTemp: Point;

  begin
    Get_MTemp := PointPtr(MTemp)^;
  end; { Get_MTemp }

  procedure Set_MTemp (pt: Point);

    var
      ptp: PointPtr;

  begin
    ptp := PointPtr(MTemp);
    ptp^ := pt;
  end; { Set_MTemp }

  function Get_RawMouse: Point;

  begin
    Get_RawMouse := PointPtr(RawMouse)^;
  end; { Get_RawMouse }

  procedure Set_RawMouse (pt: Point);

    var
      ptp: PointPtr;

  begin
    ptp := PointPtr(RawMouse);
    ptp^ := pt;
  end; { Set_RawMouse }

  function Get_Mouse: Point;

  begin
    Get_Mouse := PointPtr(Mouse)^;
  end; { Get_Mouse }

  procedure Set_Mouse (pt: Point);

    var
      ptp: PointPtr;

  begin
    ptp := PointPtr(Mouse);
    ptp^ := pt;
  end; { Set_Mouse }

  procedure Set_CrsrNew;

    var
      p: Ptr;

  begin
    p := Ptr(CrsrNew);
    p^ := 1;
  end;

  procedure SetMouse (pt: Point);

  begin
    Set_MTemp(pt); { set both of these low memory mouse positions to the new point }
    Set_RawMouse(pt); { (this prevents scaling) }
    Set_CrsrNew; { flag that the mouse has moved }
  end; { SetMouse }

end.

---
| Paul Russell              | "Some instructions have legal operation codes |
| Experimental Psychology   |  but try to perform nonsensical operations.   |
| Sussex University, Falmer |  These are called insane instructions."       |
| Brighton BN1 9QG, England |             -- Motorola DSP 56k User's Manual |

-- 
| Paul Russell              | "Some instructions have legal operation codes |
| Experimental Psychology   |  but try to perform nonsensical operations.   |
| Sussex University, Falmer |  These are called insane instructions."       |
| Brighton BN1 9QG, England |             -- Motorola DSP 56k User's Manual |
From: thepope@bigboy (Michael Kohne)
Newsgroups: comp.sys.mac.programmer
Subject: Re: DisposeHandle vs. ReleaseResource
Date: 15 Oct 92 23:38:59 GMT
Organization: House of the Techno-Discordians


system@asuvax.eas.asu.edu (Marc Lesure) writes:
: I have a routine that deletes, adds, and updates a resource in a
: preference file.  The function performs what it is suppose to do, however
: it doesn't seem to release the memory (if I call the routine enough times,
: it dies with a dsMemFullErr).  I understand that you need to use
: ReleaseResource(), if the allocated handle came from GetResource().  But
: what if the handle is created via a NewHandle() call?
:
<Some code deleted> 
: /* add new resource */
: 	if (aH == NIL)
: 	{
: 		aH = NewHandle(...);
: 		if (aH == NIL)
: 			return;
: 		AddResource(aH, TYPE, baseID, NAME);
At this point you will need to ReleaseResource. I always do a ChangedResource,
then a WriteResource first, but the ChangedResource might not be necessary.
: 	}
 	
: -----------------------------------------------------------------------
: Marc Lesure / Arizona State University / Tempe, AZ
: "Between the world of men and make-believe, I can be found..."
: "False faces and meaningless chases, I travel alone..."
: "And where do you go when you come to the end of your dream?"
: 
: UUCP:       ...!ncar!noao!asuvax!lesure  
: Internet:   lesure@asuvax.eas.asu.edu

Michael Kohne
thepope@bigboy.cis.temple.edu
House of the Techno-Discorians, Ammunition Amusements Division
<bang!>
From: time@ice.com (Tim Endres)
Newsgroups: comp.sys.mac.programmer
Subject: Re: Best way to get A5 into VBLTaskProc?
Date: Wed, 14 Oct 92 15:46:29 EST
Organization: ICE Engineering, Inc.
Reply-To: time@ice.com (Tim Endres)
X-Mailer: uAccess - Macintosh Release: 1.6v1


In article <16947@pitt.UUCP> (comp.sys.mac.programmer), sherman@michael.nmr.upmc.edu (Sherman Uitzetter) writes:
> blank.  Ok, I declare a global in my application,
> gVBLCount, but I need a way for the VBLTaskProc to get
> at this global to increment it.  "Oh this is easy", I

One way is to extend your VBLTask structure:

typedef struct {
	VBLTask		gTask;
	long		A5;
	} MyVBLTask;

And then you can set this field in your app, and send a pointer to
the extended struct into the VBL manager to install. Now, you get
the extended structure in your VBL task. If you are paranoid about
Apple later extending the VBLTask structure themselves, you might
try:

typedef struct {
	VBLTask		gTask;
	char		paranoia[32];
	long		A5;
	} MyVBLTask;

or similar approaches to pad out your value...

tim.


tim endres - time@ice.com  -or- tbomb!time
ICE Engineering, Inc - 8840 Main St, Whitmore Lake, MI 48189
Phone (313) 449 8288 - FAX (313) 449-9208
USENET - a slow moving self parody... ph
Newsgroups: comp.sys.mac.programmer
From: bredell@tdb.uu.se (Mats Bredell)
Subject: Re: Forcing Sys6 on a Q700?
Reply-To: Mats.Bredell@udac.uu.se
Organization: Uppsala University Computing Center (UDAC)
X-Newsreader: TIN [version 1.1 PL6]
Date: Thu, 15 Oct 1992 08:12:27 GMT

Kenneth Hughes (kjh+@cs.cmu.edu) wrote:
: Anyone know the inside technical details as to why a Q700 (or any other
: System-7-only platform) cannot run System 6.0.x ?  I'm wondering how feasible
: it'd be to hack something up so that I can test and debug some code under
: System 6 without having to pick up another Mac besides my Q700.
: 
: Along those lines, does anyone know the current break-down of System 7 vs
: System 6 users?  Has it passed 50/50 yet?  Thanks for any info.

There's a version of system 6 that works on the PowerBooks. I think this also
works on the Quadras. The version is called 6.0.8L.

/Mats
-- 
Mats Bredell                                   Mats.Bredell@udac.uu.se
Uppsala University Computing Center (UDAC)     Ph:  +46 18 187817
Department of medical systems                  Fax: +46 18 187825
Sweden                                         Think straight - be gay!
Newsgroups: comp.sys.mac.programmer
From: Bruce.Hoult@bbs.actrix.gen.nz
Subject: Re: Novice MacApp question
Organization: Actrix Information Exchange
Date: Tue, 13 Oct 1992 10:35:16 GMT

In article <1992Oct12.224802.1418@enterprise.rdd.lmsc.lockheed.com> enterprise.rdd.lmsc.lockheed.com (Darrell Merrick) writes:
> I'm just starting to go through the MacApp C++ tutorial and can't even get 
> the first build to work.  The example command is "MABuild Nothing -autobuild
> -nodebug".  It gives an error of "MPW 3.2.3:Tools:Pascal does not exist; no 
> rules to build it".  Is this a symptom of a common problem, such as something 
> I forgot to set up?  I am using MPW 3.2.3 with MacApp 3.0.1.

Looks as if you don't have the Pascal compiler  I don't think you should
need it at all in which case there's obviously a bug in the makefile.

Try getting rid of the -autobuild part, if you've already copied a
prebuilt version of MacApp off the CD.

...

Ok, I just tried it after dragging my Pascal compiler out of my tools folder.
You're right, an -autobuild fails when it shouldn't.  Dropping the
-autobuild works, since I've already got a compiled version of MacApp
on my hard disk.

You might try putting an dummy file called "Pascal" in your
"{MPW}"Tools folder -- even a little text file that just says...

   echo "Sorry, but you don't have Pascal!"

... should do fine.

-- Bruce
-- 
Bruce.Hoult@bbs.actrix.gen.nz   Twisted pair: +64 4 477 2116
BIX: brucehoult                 Last Resort:  PO Box 4145 Wellington, NZ
"Cray's producing a 500 MIPS personal computer with 256MB RAM and 8 GB
hard disk that fits in your pocket!"   "Great!  Is it PC compatible?"
Newsgroups: comp.sys.mac.programmer
From: jess@gn.ecn.purdue.edu (Jess M Holle)
Subject: Re: Think C++??
Organization: Purdue University Engineering Computer Network
Date: Tue, 13 Oct 92 23:12:22 GMT

In article <1992Oct13.124312.887@gagme.chi.il.us> essam@gagme.chi.il.us (Essam Khairullah) writes:
>I'm pretty sure that Symantec has bought out Zortech on their Mac C++ compiler,
>but I don't know if it's nearly as good as THINK C.  In fact, it might even
>be a tool for MPW!  I'm not really sure...

Zortech C++ IS a tool for MPW, as most are aware.

>I have never quite figure out why people would want to use MPW anything to
>do any programming!  It just seems to be so archaic!  Maybe if they put a
>Commando shell on it (ala A/UX) it would be easier to use...  But then just
>remember that this (MPW) is coming from the same people who invented the idea
>of using a Lisa to program a Mac...

I agree with all of this, BUT MPW does have a Commando shell (where do you
think they got the A/UX version).  Is there significant addition/change
in the Commando functionality available in A/UX as compared to MPW?

Jess Holle
Newsgroups: comp.sys.mac.programmer
From: pjs1@cec2.wustl.edu (Philip John Schielke)
Subject: HELP - New Sound Manager and Think C
Organization: Washington University, St. Louis Mo.
Date: Tue, 13 Oct 1992 22:21:08 GMT

Hi,

I am trying to write a program using sound on a Mac II si.
I am running in system 7.0 and using Think C 5.0

I am trying to use the wavetable synthesizer with the "new"
sound manager.  My problem is setting the pointer to the
beginning of my wave (which is a 512 element array of 
unsigned char.).  This is SndCommand 60.  I have an idea
of what it *should* sound like, and it doesn't. So either I'm
not setting the pointer properly, or not using the command 
properly.  I have Inside Mac V, and am still a bit lost.
Any help or insights would be appreciated.
Thanks

-Phil
please e-mail to pjs1@cec2.wustl.edu
I am Phil
Newsgroups: comp.sys.mac.programmer
From: bwilliam@iat.holonet.net (Bill Williams)
Subject: Re: scanf equivalent calls that does not use global variables?
Organization: HoloNet (BBS: 510-704-1058)
Distribution: usa
Date: Thu, 8 Oct 1992 09:25:54 GMT

>"Since I cannot
include any global references in code resource"....

I know what you probably mean, but I write code resources all the time
with lots of global references. I use Think C 5.0.3 with globals off of
register a4 using a custom header (so I can call other code segments of
mine back and forth at any point).


Bill Williams

Newsgroups: comp.sys.mac.programmer
From: rhorn@csws17.ic.sunysb.edu (Robert Horn)
Subject: Re: Suggestions for Font/Size menu handling
Organization: State University of New York at Stony Brook
Date: Fri, 9 Oct 1992 16:32:16 GMT

In article <1992Oct8.002357.8698@alw.nih.gov> fixer@faxcsl.dcrt.nih.gov writes:
>At present, I reconstruct the size menu every time the selected font
>changes.  To determine what sizes are available, I call RealFont() on
>every point size from 6 to 64 (the practical limit for this list) for
>that font, adding an entry to the size menu every time I find a legitimate
>size.
>
>This seems like a horribly brute-force way to find the allowable sizes
>for a given font, but having to special-case TrueType makes me nervous.
>This code has to run under systems that don't have Gestalt....
>
>Anyone have any better ideas?

Special casing TrueType fonts should be fairly simple, just call RealFont with
some font size that no bitmap font would come it (43, 14617, 137, something of
that nature.) If RealFont says that you have the font in this size, that it's 
probably a TrueType font (either that, or the user collects strange font sizes,
but this is very unlikely). It will work happily under old systems, and you never
have to use Gestalt. Of course, it will break just as soon as people start
distributing bitmapped fonts in size 43.
-- 
rhorn@ic.sunysb.edu           Never choose a college because it has a duckpond.
Newsgroups: comp.sys.mac.programmer
From: Andreas Wuertz <wuertz@tik.ethz.ch>
Subject: Re: Deferred Tasks - What can I do?
Organization: Federal Institute of Technology
X-Useragent: Nuntius v1.1
Date: Wed, 7 Oct 1992 09:58:30 GMT

In article <Bvq666.MHH@news.cso.uiuc.edu> Pete Resnick,
resnick@cogsci.uiuc.edu writes:
>Simple question:
>
>Can I move memory (e.g. call NewPtr) in a deferred task, i.e. one I
>installed with DTInstall?

Simple question, simple answer: Deferred tasks are defined as tasks that
are too lengthy to execute as a direct response to an irq, so they're
deferred to execution with irqs reenabled but just BEFORE returning to
normal execution; so I'd say you CAN'T make calls to NewPtr a.s.o. But
this is only MY opinion.

Andy (wuertz@tik.ethz.ch)

========================================================================
The only person who got all his work done by Friday was Robinson Crusoe.
========================================================================
Newsgroups: comp.sys.mac.programmer
From: d88-jwa@byse.nada.kth.se (Jon Wtte)
Subject: Re: Event loop with appevents
Originator: d88-jwa@byse.nada.kth.se
Organization: Royal Institute of Technology, Stockholm, Sweden
Distribution: comp.sys.mac.programmer
Date: Fri, 16 Oct 1992 12:20:03 GMT

> aleskine@cs.hut.fi (Arto Leskinen) writes:

   Does anyone have sample how to make up an event loop that uses apple
   events for real work. So when user clicks Quit, it will send quit 
   apple event to itself. How slow would it be?

Not very slow, since your event loop would never see the
event IF you send to the special process serial number
{ 0 , kCurrentProcess }
IF that process number is the destination of an AppleEvent,
several things will happen:
- Any Apple-Event macro package will see this event and
  record it
- The AppleEvent manager will see the address and short-cut
  the sending to dispatch the event using the dispatch tables
  directly, i.e. your appleevent handler will have been
  called before AESend returns.

   What is PPC, program to program communication? How it differ from
   apple events.

PPC is a way of saying "I want to send <unspecified> data to this
here process" while AppleEvents is a protocol that lies on top
of the HighLevelEvent manager, which uses the PPC manager for
sending the actual data. This may change.

-- 
 -- Jon W{tte, h+@nada.kth.se, Mac Hacker Suedoise (not french speaking) --
  _/~|   Yellow
 / * \_  Shark                      (This signature has won the "Worst ASCII
 ~~~~\/  Software                    Logo of the Year" award)
Newsgroups: comp.sys.mac.programmer
From: Michael F. Kamprath <kamprath@space-grant.sprl.umich.edu>
Subject: Re: Code-Resources
Date: Mon, 12 Oct 92 23:02:55 EDT
Organization: University of Michigan, Aerospace Engineering
X-Useragent: Nuntius v1.1.1d12
X-Xxmessage-Id: <A6FFB5485801C4FC@sprl-mac2016.sprl.umich.edu>
X-Xxdate: Mon, 12 Oct 92 23:05:44 GMT

In article <1992Oct12.193218@uni-paderborn.de> Andreas Sorgatz, andi@uni-paderborn.de writes:
>My problem:
>
>I want to generate a ResourceFile with a code-resource in it
>(from C, for example with Think-C), in order to open and exe-
>cute it from and within another program. 
>
	.
	.
	.
>
>So, please please is there anybody who can help me, having
>experince with it and/or can tell me where I have to look and
>what I have to read for further information ?
>
>Thanx in advance
>

I ask this very same question a while back . . . and now its my turn to
answer :-)

Basically you just load it, cast it, then use it.  Oh, of course, you have
first got to write it.  Let's say you are writing a mathmatical function that
get's two double's passed and returns one value.  You would then write then
code for the code-resource in the form:

double main(double x, double y)
{
	.
	.
	.
}

Once you've got it written, you need to include libraries.  If you use ANSI,
use the ANSI-A4 library (has to do with addressing schemes I don't fully 
understand), and compile it all as a CODE resource (see THICK C manual).

Then to use it in a program:

main()
{
	double		(**myFuncHandle)(double x, double y);
	double		xx,yy,z;
	.
	.
	.
	myFuncHandle = GetResource('PROC',128);  //resource type and number arbitary
	HLock(myFuncHandle);
	.
	.
	.
	z = (*myFuncHandle)(xx,yy);
	.
	.
	.
	HUnlock(myFuncHandle);
	ReleaseResource(myFuncHandle);
}

Oh, I forgot to say, if you are writing a math type code resource, you'll 
have to recompile ANSI-A4 so that it includes the math files from ANSI.
Currently, it doesn't (at least mine didn't).

========================================================================
| Michael F. Kamprath                   | The University of Michigan   |
|   kamprath@space-grant.sprl.umich.edu |      Aerospace Engineering   |
|   kamprath@engin.umich.edu            |      Graduate Student        |
+---------------------------------------+------------------------------+
| This country is a _democracy_.  It is NOT a "Two Party Sytem."  DO   |
| NOT believe The Lie that not voting Republican or Democratic will    |
| waste your vote.  Vote for who ever you please, and let the          |
| politicians find out what a democratic republic is all about.        | 
========================================================================
From: de19@umail.umd.edu (Dana S Emery)
Newsgroups: comp.sys.mac.programmer
Subject: Re: Think C++??
Date: 11 Oct 92 05:05:40 GMT
Followup-To: comp.sys.mac.programmer
Organization: Personal

In article <D88-JWA.92Oct10234259@dront.nada.kth.se>,
d88-jwa@dront.nada.kth.se (Jon Wtte) wrote:
> 
> Well, [...] Think C 6.0 will support ToolServer for MPW... 

Dont you think it a bit absurd to depend on an external device from a third
party (with attendant fees) to debreif the internally specified
preferences?  Spiting out a plaintext make file is hardly a difficult
project, reading it back is a bit more of a challange, but since we are
discussing a compiler, I should "think" that would be no great difficulty
for such "wits" as these.
--

Dana S Emery <de19@umail.umd.edu> | "Novo, de Novo,
                                  |     de novo, de no-o-o-o-o---, 
                                  | Novemba come an' dey gonna go home."
From: viens@broue.rot.qc.ca (Robert Viens)
Newsgroups: comp.sys.mac.programmer
Subject: Wrong fonts with DocViewer
Date: 7 Oct 92 03:28:36 GMT
Organization: Groupe de Recherche Operationnelle en Telecommunication (ROT)
X-Newsreader: TIN [version 1.1 PL6]

Hi,

I need a little help to print my "MPW Command Reference"
document from "The Macintosh Programmer's C WorkShop' with the
Apple DocViewer.

What I try to do is to print the document with the
original fonts used to create it. What I've got is something
print in Palatino & Helvetica instead of Frutiger
& New Aster.
 
Please, can someone help me on this.
 
Regards,

Robert Viens
Newsgroups: comp.sys.mac.programmer