home *** CD-ROM | disk | FTP | other *** search
- Plug In Compliant Application protocol
- ======================================
-
-
-
- Introduction
- ============
-
-
- The Clares Plug In Compliant Application (PCA) specification provides an
- easy to implement way of allowing multiple applications to share common
- objects residing in shared memory areas. A program written to the PCA
- specification will work with any other which supports the standard and uses
- the same type of objects.
-
- What does PCA do for me as a user ?
-
- The PCA standard works at two levels. In each case a document in a common
- memory area can be 'shared' between two or more applications. This is not
- like the versions of OLE implemented on the Acorn platform. There is a major
- difference in that OLE copies the document for the second application to
- work on, thus your data takes up twice as much RAM. With PCA all
- applications work on the same document thus incurring no RAM overheads.
-
- The controlling application is called the Local application and the slave
- application is called the Remote application.
-
- When a document is edited in a Remote application the object in the Local
- application is automatically updated.
-
- What we have up to now is a more efficient way of doing OLE. However, PCA
- does not stop there. Take an application like Composition which provides a
- page make up environment for bit image and vector images - all of which can
- be moved and edited - a bit like Draw for bit images but with a LOT of
- extras. Composition does not provide 'painting' tools but ProArtisan 24
- does. If both applications are PCA compliant then a Utilities menu in Compo
- will show ProArt 24 as a 'tool'. Clicking on this menu entry opens a PA24
- window showing the selected Compo object. PA24 can paint into this object or
- indeed perform any of its functions on the object. All changes are reflected
- immediately in Compo.
-
- This means that an application can have other applications as 'tools'. Small
- 'applets' can be written to provide specific functions to a PCA application
- and they will be usable by any other PCA compliant application.
-
- Imagine a simple application that does nothing else except display a
- sprite and conform to the PCA standard. Another application could provide
- paint tools, yet another could provide filters, another might provide
- warping tools - you get the picture I'm sure. From this range of applets you
- can construct the tool that you require to get the job done.
-
- What's more, more than one remote applet can work on the same object at the
- same time and changes made in any one of these will be immediately reflected
- in all of them.
-
- This is an awful lot better than OLE but there's still more.
-
- Instead of each applet opening its own window we can use 'In-place' editing.
- This means that only the Local application displays the document. When you
- click on a 'tool' entry in the Utilities menu the new tool's Toolbar opens
- over the Local application's window. All tools then work on the image in the
- Local's window.
-
- Now you are really able to construct an application from a range of applets.
- All you will see is one window displaying the document.
-
- Take this a little further and imagine a DTP package supporting the PCA
- standard. It could have a frame containing a graphic image and you could
- link this to PA24, Compo or any other PCA application, which could
- manipulate the image. The changes would be reflected immediately in the DTP
- window. However, if In-place editing is used, the Toolbars would appear in
- the DTP window and allow you to edit the graphic directly in the DTP window.
-
- What we now have is a system whereby an application can have an infinite
- number of additional tools and all applications conforming to PCA can be
- used with and by all other PCA applications. An example of this could be an
- image in a DTP frame linked to Compo which used this image as a 'canvas' for
- a composite picture. From Compo one of the images in the composite picture
- could also be linked to ProArt24 and any changes would immediately be
- reflected in Compo and the DTP package.
-
- Things may become clearer if you take a look at the example applications and
- documentation provided. The main document to read is 'ToTest'.
-
-
- A more technical explanation
- ============================
-
-
- There are two 'sides' to PCA support. Applications may support either or
- both as it suits them.
-
- Local
- -----
-
- A Local application creates and maintains an area of shared memory (on the
- RiscPC this is most likely to be a dynamic area, older hardware must use RMA
- or something like the Dynamite memory manager). Objects in this area may be
- edited by any PCA 'remote' application which is running, provided that it
- knows about the type of object concerned. It is the local application's
- responsibility to create and maintain pointers to objects and to take the
- correct action when an object moves or changes size.
-
- Remote
- ------
-
- A Remote application modifies an object in some way when requested to do so
- by a Local application. Remote applications can be small 'applets' or major
- programs in their own right. The PCA specification sets no limits on the
- changes which may be made to an object.
-
- In practice, the two sides blur considerably. For example, it is possible
- for more than one 'Remote' task to work on the same object at the same time
- in which case the 'Remote' tasks must respond to some messages in a similar
- way to the 'Local' task.
-
- In addition, an optional extension to the standard provides support for
- 'In-place' editing of objects directly in another application's window.
-
- Limitations, assumptions and philosophy
- =======================================
-
- The PCA standard requires the following:
-
- Objects are stored in an area of memory available to all tasks. (eg. Dynamic
- areas). Beyond that the PCA is designed to be as transparent as possible to
- the memory management system used by a program. See below for some notes on
- memory management related issues.
-
- Objects are either entirely paged into RAM during any PCA exchange, or a
- virtual memory system which is transparent to the program accessing memory
- is used (Eg. Clares Virtualise).
-
- Objects are stored in a cross-program standard format for which there is a
- method of rendering readily available to other programmers. Examples are
- RISC OS Sprites, Drawfiles, ArtWorks files, Plain text etc.
-
- If you are writing or have written a program which produces data objects
- that may be desirable for other programs to render, you should consider
- providing a rendering module (or some code) which other applications can use
- to display your object types. You should also consider placing the details
- (if not the rendering code itself) in the public domain.
-
- No well written RISC OS application is an island. By supporting the PCA
- standard programs can take advantage of each other's good features and
- minimise their weaknesses while providing the user with a far richer and
- more productive working environment.
-
- Memory management issues
- ========================
-
- For backwards compatability programs that wish to use PCA on pre RiscPC
- hardware can fall back to using the RMA or something like the Dynamite
- memory manager. We do not however believe that Dynamite is the best solution
- for a PCA task on the RiscPC. This is because Dynamite uses one dynamic area
- to store all of its data rather than one dynamic area for each task. This
- practice means that, in the event of a PCA remote task going wrong and
- writing beyond the end of the object being edited, *all* tasks using
- Dynamite could crash rather than just the one local task in question. Also,
- Dynamite will not work with Virtualise which provides a PCA compatible
- virtual memory system.