[comp.sys.mac.programmer] System 7.0 question

ranson@cnetlu.UUCP (Ranson) (06/16/89)

How does Apple see the interaction between dynamic cut&paste and undo?
Imagine I have a graph hot-pasted from a server file in my letter. I
then delete a paragraph. I can always undo delete if I made a mistake.
Now someone modifies the graph on the server, and I receive the new
version, that update (and modifies) my letter automatically. Can I still
undo the paragraph deletion after that? If no, this is extremely unfriendly.
If yes, the undo schemes used currently (eg. by MacApp) need to be reworked.
I guess most commands don't expect the document to be modified between Do
and Undo!
     Daniel Ranson
     ranson@cnetlu.fr
     ...!mcvax!inria!cnetlu!ranson

awd@dbase.UUCP (Alastair Dallas) (06/18/89)

In article <964@cnetlu.UUCP>, ranson@cnetlu.UUCP (Ranson) writes:
> 
> How does Apple see the interaction between dynamic cut&paste and undo?
> Imagine I have a graph hot-pasted from a server file in my letter. I
> then delete a paragraph. I can always undo delete if I made a mistake.
> Now someone modifies the graph on the server, and I receive the new
						    ^^^^^^^^^
> version, that update (and modifies) my letter automatically. Can I still
> undo the paragraph deletion after that? If no, this is extremely unfriendly.
> If yes, the undo schemes used currently (eg. by MacApp) need to be reworked.
> I guess most commands don't expect the document to be modified between Do
> and Undo!
>      Daniel Ranson
>      ranson@cnetlu.fr
>      ...!mcvax!inria!cnetlu!ranson

I hope we'll see a lot of discussion here about IAC.  I, for one, am very
interested in it.  Let's see if I'm just revealing my ignorance here, but
I don't think Daniel's point is a real problem.  As I understand it, the
system receives updates from, in this case, the graph program, and makes
them available to applications manipulating documents containing links,
such as the letter document in question.

The sequence is: user uses wp app to view document containing link to graph
program.  Then user deletes paragraph containing graph.  Then the graph
program reports a change in the graph to the system.  At this point, the wp
app's view of the document is out of date.  The wp app asks the system if
anything has changed, the system mentions the graph, and the wp app modifies
its private undo scrap.  Now the user says Undo.  Result: the updated 
graph is replaced.  Magic.  But the point is, the wp app is in charge--it
decides when to ask the system about updates and it decides what to do
with updates when it gets them.

Apps can provide various levels of support for Undo.  Many Unix and PC apps
support Undo stacks, but these are rare on Macs (for good reason).  MacDraw II
actually stores Undo data in the document (Dear Claris: I figured this
out before I signed your non-disclosure).  That's amazing persistence for
an Undo buffer, if you ask me.  A reduced level of Undo persistence is
tolerated by the users of many apps--often, Saving a document wipes out 
the Undo buffer, for example.  So, it is not unreasonable to say that
updating a link with one app may flush a reader app's Undo buffer.  Not
wildly friendly, but not unreasonable and only non-intuitive in multi-user
situations (I mean, a single-user switching apps can figure out that his
actions caused Undo to get grayed out).

One last thing: it may be that hot updates are like automatic recalc in a
spreadsheet--if they are slow or otherwise disruptive, users may want to
be able to turn off dynamic updates (particularly in a multi-user situation).
In that case, asking for an update (like Saving the file) might not be a
bad checkpoint at which to flush the Undo buffer.

As I said, I'd like to read a lot more discussion about the issues surrounding
IAC, and I would be happy to have my misconceptions here corrected.  As 
software gets more and more complex, user's expectations get harder to
intuit.  Nonetheless, that's our job...

/alastair/

Disclaimer: I write IBM PC code for Ashton-Tate and they are nice enough
to give me usenet access to discuss real systems:-).  That is, these are
my opinions, not A-T's.

shebanow@apple.com (Andrew Shebanow) (06/19/89)

In article <119@dbase.UUCP> awd@dbase.UUCP (Alastair Dallas) writes:
> program.  Then user deletes paragraph containing graph.  Then the graph
> program reports a change in the graph to the system.  At this point, the 
wp
> app's view of the document is out of date.  The wp app asks the system if
> anything has changed, the system mentions the graph, and the wp app 
modifies
> its private undo scrap.  Now the user says Undo.  Result: the updated 
> graph is replaced.  Magic.  But the point is, the wp app is in charge--it
> decides when to ask the system about updates and it decides what to do
> with updates when it gets them.

Close, but the wp application doesn't really "ask" for changes - it 
receives a "publication changed" event in its normal event loop, and it 
can either process it immediately or save the information for later use, 
as long as it accepts the event (using the AcceptHighLevel event call) 
immediately. The important point is still true: the application decides 
when it will update the document containing the subscription, and whether 
or not the previous command is undoable. 

The model should be that the subscription data isn't part of the document, 
but that the "frame" (that is, the subscription info itself) that holds 
the data is: anything that the user changes about the frame (resizing it, 
turning off updates for it, etc) should be done as a command, and it 
should commit the previous command. When the application changes the 
contents of the frame in response to a "publication changed" method, it 
should mark the document dirty, but it should not render the previous 
command non-undoable. In MacApp, this simply means that you should avoid 
generating a TCommand object to process these events. 

Have fun,

Andrew Shebanow
Macintosh Developer Technical Support
Disclaimer: these opinions are mine, and mine alone, and should not be taken as official Apple gospel on IAC.

kent@sunfs2.camex.uucp (Kent Borg) (06/19/89)

In article <964@cnetlu.UUCP> ranson@cnetlu.UUCP (Ranson) writes:
>
>How does Apple see the interaction between dynamic cut&paste and undo?
>Imagine I have a graph hot-pasted from a server file in my letter. I
>then delete a paragraph. I can always undo delete if I made a mistake.

The problem is worse then just undo.  What if you subscribe (what
Apple is calling the "paste" half of "live copy/paste"--"publish' is
the name for the first half of the procedure) to some text and then go
in and change the spelling of one of the words?  What happens if the
publisher then updates the published file?

The answer is that you will not be able to `edit' a subscribed
section, you can only `adorn' it.  The difference is that it must be
something that the computer will be able to do again for you whenever
the published file changes.  You could change the point size or
justification of text because they could be done again for you
automatically.  You could change the scale or maybe the color of a
graphic.  You might be able to change the font in only the third
paragraph, but that could break if the publication were changed to be
only two paragraphs long.  

The exact details of what you can do with a subscribed section will
differ from program to program but the common denominator will be that
they will be changes which have meaning which is separable from the
details of what the raw data might be.

Kent Borg
kent@lloyd,uucp
or
...!husc6!lloyd!kent

sce@runx.oz (Simon Evans) (06/21/89)

I was wondering a couple of things.
	1. Has Apple announced whether MacApp will be available
	as C++ source code at the same time as the C++ product 
	itself?
	2. Has Apple announced an actual date (or even quarter)
	for C++?
	3. Will there be a MacApp 2.5 or 3.0 or whatever at the time
	System 7.0 is released to take advantage o IAC and the other
	System 7.0 goodies, and make programming with them simpler?

Thanks for any light you can shed, Simon Evans.
Sometime programmer, JAM Software.
27a Nowranie St, Summer Hill, NSW 2130, AUSTRALIA.

shebanow@Apple.COM (Andrew Shebanow) (06/29/89)

> 1. Has Apple announced whether MacApp will be available
> as C++ source code at the same time as the C++ product 
> itself?

MacApp will still be written in Object Pascal, but we have
extended C++ to provide full Object Pascal compatibility, and
we will supply C++ headers to interface to the MacApp class
heirarchy (with MacApp 2.1).

> 2. Has Apple announced an actual date (or even quarter)
> for C++?

A beta version should be available real soon.

> 3. Will there be a MacApp 2.5 or 3.0 or whatever at the time
> System 7.0 is released to take advantage o IAC and the other
> System 7.0 goodies, and make programming with them simpler?

Yes. No specific release dates, though.

Have fun,

Andrew Shebanow

Andrew Shebanow, Amway Representative
Developer Technical Support, Apple Computer, Inc.
------------------------------------------------------------------------------
INTERNET: shebanow@apple.com
    UUCP: {decwrl, hoptoad, nsc, sun, amdahl}!apple!shebanow

sho@pur-phy (Sho Kuwamoto) (07/02/89)

In article <32754@apple.Apple.COM> shebanow@Apple.COM (Andrew Shebanow) writes:
>MacApp will still be written in Object Pascal, but we have
>extended C++ to provide full Object Pascal compatibility, and
>we will supply C++ headers to interface to the MacApp class
>heirarchy (with MacApp 2.1).
>
How much have you extended C++?  Is it just a matter of developing
some sort of syntax to specify that a class comes from object pascal
in the header files, or are calling conventions fundamentally different?
We, who have convinced our bosses that we need to use C++ in our
projects just so we can learn it, want to know!

-Sho
-- 
address: sho@risc.com <-- NOTE:  Not the same as above.

shebanow@Apple.COM (Andrew Shebanow) (07/02/89)

I won't post a full description of the extensions here, but here is
a quick summary of the ones concerning Object Pascal compatibility:

* Classes derived from the builtin class 'PascalObject' are handle
based, and use Object Pascal's method dispatching scheme. Multiple
inheritance is not allowed in PascalObject classes.

* The pascal keyword from MPW C works inside of (or outside of)
class definitions

* You can say inherited::Method() to get at your superclass's
method. This only works for single inheritance classes.

Here is a simple Object Pascal compatible class definition:

class TMyView : public TView {
public:
	virtual pascal Draw();
};

We also added extensions to support SANE, direct function calls,
and other standard MPW C features.

By the way, there is a MPW C++ sample program (CPlusTESample) I wrote
that is available from DTS (via the Sample Code disks), and the source
code should be available from the info-mac archives. Kind of a bummer that
the compiler itself isn't available, but what can I say?

Andrew Shebanow
MacDTS
Andrew Shebanow, Amway Representative
Developer Technical Support, Apple Computer, Inc.
------------------------------------------------------------------------------
INTERNET: shebanow@apple.com
    UUCP: {decwrl, hoptoad, nsc, sun, amdahl}!apple!shebanow