home *** CD-ROM | disk | FTP | other *** search
/ Kosovo Orphans' Appeal Charity CD / KosovoOrphansAppeal.iso / commercialdemos / claresmicrosupplies / pca / docs / msgs_spec < prev    next >
Text File  |  1996-08-28  |  30KB  |  731 lines

  1. Plug In Compliant Application protocol
  2. ======================================
  3.  
  4.  
  5. Plug In Compliant Application Message specification
  6. ===================================================
  7.  
  8.  
  9. Author : Rob Davison (rdavison@xtra.co.nz)
  10. Date : 22/08/96
  11. Status : Release 1
  12.  
  13. Notes: Filetype is divided into two fields with this format: 
  14.  
  15.  
  16.            b 0-12 RISC OS filetype
  17.            b13-31 reserved - zero.
  18.   
  19. On reading, please mask bits 13-31 out before checking the filetype.
  20.  
  21. Strings are null terminated but supporting applications should accept Ctrl.
  22. terminated (ASCII 0-31).
  23.  
  24. 'Address of base' is the beginning of the data structure which contains the
  25. object.
  26.  
  27. 'Offset to object' is the offset from the Address of base to the
  28. object-of-interest
  29.  
  30. For example, the 'Offset to object' of a sprite is the offset to the sprite
  31. itself (base!8 for the first sprite in a sprite area). The 'Address of base'
  32. is the address of the sprite area in which the sprite resides. For objects
  33. where the offset has no meaning the offset to the object must be zero.
  34.  
  35. The PCA references objects using 'tags'. Each tag is usually 16 bytes in
  36. length and its format is defined thus: 
  37.  
  38. tag+0  = Address of base. (anchor)
  39. tag+4  = Offset to object from base.
  40. tag+8  = Length of object. (if applicable - see note below)
  41. tag+12 = Extension size and flags
  42.                b0-15 These bits are to provide for expansion of the size of a
  43.                tag by up to 65532 bytes. Typically, this is for app. or object
  44.                specific data. This document specifies two extensions to show
  45.                you how it's done. Details below.
  46.  
  47.                b16-31 (reserved, set to zero)
  48.  
  49. The first two values in a tag are most important as they are pointers to the
  50. address of the object and the base of the data structure containing it.
  51. Remote tasks must *always* reference an object by reading these values.
  52. Generally speaking, Remote tasks can usually trust the address and offset
  53. until the next Wimp_Poll but if in doubt, re-read it from the tag. The Local
  54. task has the responsibility of creating the object's tag when the object
  55. joins the PCA system, updating the relevant fields in the tag if the object
  56. is moved or resized and discarding the tag when it is sure it is no longer
  57. needed. Tags must themselves be in a common memory area and they must not
  58. move during the lifetime of the object in the PCA system. Clares provide a
  59. small module called 'PCASupport' which may be freely distributed by
  60. registered PCA developers to facilitate the creation of PCA tags for
  61. applications which do not want to create tags themselves.
  62.  
  63. Notes:
  64.  
  65. Many objects store their length within the object data structure itself and
  66. in that case you must use the value stored within the object's data instead
  67. of relying on the length field in the tag. It is intended for object types
  68. which include no record of their size (text for example).
  69.  
  70. Tag extensions must adhere to the following standard: 
  71.  
  72. tag+12.b0-15   = (bytes required+4). Multiples of 4 bytes only.
  73. tag+16           extension id. Types 0-&fff are reserved for Clares PCA.
  74.                  Other values are allocated in line with SWI/Message
  75.                  chunk numbers for application developers.
  76. (extended data dependant on tag id) 
  77.  
  78. To give an example of a tag extension we define two tag extensions which may
  79. be used with PCA text objects. 
  80.  
  81.  
  82. Simple text object
  83. ------------------
  84.  
  85. tag+12 8
  86. tag+16 &FFF
  87. tag+20 length of buffer allocated to object
  88.        (ie the remote task can extend the size of the text (as given at tag+8)
  89.        until its size reaches tag+20 bytes before calling Message_Resize.
  90.  
  91. Edited text object
  92. ------------------
  93.  
  94. tag+12 16
  95. tag+16 &FFE
  96. tag+20 length of buffer for first chunk
  97. tag+24 offset to rest of text from object base
  98. tag+28 length of rest of text 
  99.  
  100. Edited text objects are split into two separate parts, the pointer to base
  101. at the beginning of the tag, points to the start of the first chunk of text,
  102. the offset to object points to the end of this chunk of text (= the caret
  103. position) while the values at tag+24 and tag+28 point to the rest of the
  104. text. Suitable manipulation of these values should allow a text editor to
  105. work with PCA. Note: this has not been tested with any code - any comments
  106. please contact the author of PCA.
  107.  
  108. The tag extension system is potentially very powerful but please do not
  109. abuse it. If everyone who ever writes a PCA program creates a tag extension
  110. for their own object format then chaos will reign and the PCA system will
  111. become useless. (Anyone questioning this is invited to use the specification
  112. document for the TIFF file format as bedside reading - a perfect example of
  113. a tagged file format gone wrong). In general, the basic tag structure or the
  114. 'pca text' extension defined above will do for most data types. If you
  115. really feel you have to create your own extension then please double check
  116. with Clares that a suitable extension does not already exist. The extension
  117. should then be defined in the format given above and the information sent to
  118. Clares for distribution to the PCA community.
  119.  
  120. On receipt of a PCA message you should decide if the message refers to one
  121. of your objects (either a local one you created yourself or a remote object
  122. which you are editing). You do this by comparing the object's tag address,
  123. passed in the message, with a local array of tags that you know about. Get
  124. into the habit of doing it this way (rather than comparing the tag's address
  125. fields with your own data structures) as one message, Message_Deselect may
  126. pass a tag address which no longer actually contains valid data (the object
  127. itself having been deleted). See its entry for details.
  128.  
  129. In the following documentation ' Local ' is the 'owning task' being the task
  130. to which the object is 'local'. This task created the object and its PCA
  131. tag. It knows how to resize and how to delete the object.
  132.  
  133. ' Remote ' is the 'utility' task - the one which modifies an object for the
  134. 'local' or owning task.
  135.  
  136. Please note which messages are to be broadcast and which are sent
  137. task-to-task. The correct functioning of the system depends on the correct
  138. usage.
  139.  
  140.  
  141. PCA Message Summary
  142. ===================
  143.  
  144. This is intended to give the programmer an overview of what goes on in a
  145. typical PCA session. It ignores many of the finer points of the protocol.
  146.  
  147. 1. Local task broadcasts Message_WhosAbout for a selected object.
  148.  
  149. 2. Remote tasks examine message data and respond with Message_ImHere.
  150.  
  151. 3. Local task, in response to users choice of Remote sends
  152.    Message_DoYourStuff.
  153.  
  154. 4. (if doing inplace editing) Remote task, on receipt of DoYourStuff sends
  155.    Message_HookMe.
  156.  
  157. 5. (repeated) Remote and Local tasks broadcast Message_UpdateArea if the
  158.    user changes the object.
  159.  
  160. 6. Remote task sends Message_Unhook when user closes window/toolbar onto
  161.    object.
  162.  
  163. 7. Local task broadcasts Message_Deselect if user deletes object/quits
  164.    program.
  165.  
  166. The variable names used in the example BASIC program are included after the
  167. message number. 
  168.  
  169. Message_WhosAbout(&83484) (Msg_Whos%)
  170. -------------------------------------
  171.  
  172. Broadcast by Local task when opening Utility sub-menu/popup (see the section
  173. on user interface).
  174.  
  175. The block pointed to by R1 contains: 
  176.  
  177. R1+20   filetype of object
  178. R1+24   address of object tag
  179. R1+28   reserved - 0 
  180.  
  181. Receiving remote tasks should respond with Message_ImHere as defined below
  182. if the filetype is 'interesting'. You can examine the data in the tag at
  183. R1+24 if the filetype alone does not suffice (for example, a program which
  184. can only edit 32bpp sprites should examine the sprite type word at
  185. !(R1+24)+(R1+24)!4) +40 (ie tag address field+offset to object field)+40
  186. before sending Message_ImHere ). 
  187.  
  188. Message_ImHere(&83485) (Msg_Im%)
  189. -------------------------------- 
  190.  
  191. Sent by Remote task to Local task. Local records the data passed for later
  192. use in creating a dialogue box or menu.
  193.  
  194. The block pointed to by R1 contains: 
  195.  
  196. R1+20
  197.         bits 0-7 flags:
  198.                 b0 Spritename supplied
  199.                 b1 Info available
  200.                 b2 Generate 'Ping' messages.
  201.                 b3 Tool wants to 'own' the object
  202.                 b4 Tool wants In place editing
  203.                 b5-7 Reserved - 0
  204.                 b8-31 Reserved - 0
  205.  
  206. R1+24           Tool id.
  207. R1+28           String. Menu entry/Function name (eg. Contrast...).
  208.                 Length limited to 31chars+terminator.
  209. R1+60           String. Name of sprite in wimp sprite pool
  210.                 (if b0 of R1+20 is set)
  211.  
  212.  
  213.   
  214. The tool id is intended for remote tasks which provide more than one
  215. utility. It is returned to the task with Message_DoYourStuff . 
  216.  
  217. Flags: 
  218.  
  219. b0      indicates to the recipient that there is a sprite name at R1+60
  220.         - the sprite is stored in the Wimp sprite pool and should be
  221.         used when rendering the popup dialogue box.
  222.  
  223.  
  224. b1      indicates that the tool can provide a response
  225.         to  Message_Info .
  226.  
  227. b2      indicates that the tool would like to 'move' with
  228.         the selected object (ie it gets sent  Message_DoYourStuff  
  229.         again when the 'selected object' changes.
  230.         Note: If preferred, the local application can offer this as an
  231.         option as it is part of the standard that remote applications
  232.         must accept  Message_DoYourStuff  messages for objects
  233.         they cannot edit without producing an error.
  234.  
  235. b3      indicates that the tool wants to 'own' the object.
  236.         Local task should send Msg_Deselect for the object
  237.         before sending  Message_DoYourStuff  if this bit is
  238.         set. Do not set this bit unless you have to as it
  239.         will prevent other remote tasks from sharing the
  240.         object at the same time. It should only be set when
  241.         the remote task wants to 'take over' the object completely.
  242.  
  243.         - such as Composition taking over a 32bpp sprite
  244.         for use as a canvas.
  245.  
  246. b4      This bit is designed to allow for real 'in place editing'
  247.         operations. Because of the amount of code necessary
  248.         at the local end to handle this it has been defined
  249.         as an optional part of the standard. 
  250.  
  251. Local applications which do not support in place editing should clear bit 4
  252. of the flags word and send that with DoYourStuff. On receipt, the remote
  253. application should check if bit 4 is still set and if not open a remote
  254. window onto the object.
  255.  
  256. Notes: In early versions of this standard bits 28-31 of the flags word had
  257. another use. This data has been moved to Message_HookMe. Please see below. 
  258.  
  259. Message_DoYourStuff(&83486) (Msg_Do%) 
  260. -------------------------------------
  261.  
  262. The block pointed to by R1 contains: 
  263.  
  264. R1+20   Filetype of object
  265. R1+24   Address of object tag
  266. R1+28   reserved - 0
  267. R1+32   Tool id
  268. R1+36   Tool flags word
  269. R1+40   String. Name of object or null (&0) 
  270.  
  271. Sent by Local task to remote task depending on entry selected in Utilities
  272. sub-menu/dialogue. Remote task should record the tag address and open its
  273. window (or just its toolbar if bit 4 of the flags word is set). 
  274.  
  275. Notes: 
  276.  
  277. If the Remote task set bit 4 of the flags word in Message_ImHere when
  278. replying to  Message_WhosAbout it should check that this bit is still set
  279. now. If it has been cleared then the Local task cannot handle remote
  280. messaging and the Remote task must open a separate window onto the object.
  281.  
  282. If bit 4 is still set it means that the local task is willing to participate
  283. in an in-place editing session. In this case the Remote task should simply
  284. open its toolbar and send Message_HookMe to the Local task to ask it to
  285. intercept mouse button and other Wimp events. Receipt of this message will
  286. also cause the Local task to send Message_ObjectPosition to move the remote
  287. tasks toolbar to the correct position.
  288.  
  289. Nothing about the standard prevents the object changing type (eg from sprite
  290. to Drawfile) between  Message_WhosAbout and this message. On receipt of this
  291. message the Remote task must therefore check the filetype field and as much
  292. of the object's data structure as necessary to ensure that it can edit the
  293. object and delink/ignore the message quietly if the type is not to its
  294. liking. This allows the Local task to 'move' a remote task to different
  295. objects cleanly.
  296.  
  297. Before sending Message_DoYourStuff with bit 4 set the local task should
  298. broadcast  Message_UnhookMe to prevent more than one remote task attempting
  299. to do in-place editing at once.
  300.  
  301. Before sending Message_DoYourStuff with bit 3 set the local task should
  302. broadcast  Message_Deselect as the remote task in question wants to 'own'
  303. the object. 
  304.  
  305. Message_Deselect(&83487) (Msg_Desel%) 
  306. -------------------------------------
  307.  
  308. Broadcast by Local task when the object has been deleted.
  309.  
  310. The block pointed to by R1 contains: 
  311.  
  312. R1+20   Filetype of object.
  313. R1+24   Address of object tag 
  314.  
  315. All Tasks interested in the object should close their window/abandon their
  316. operations as the object in question has been removed from the PCA system
  317. (usually because it has been deleted). Local tasks  must generate this
  318. message when deleting an object, quitting etc. or remote tasks using the
  319. object will crash. If the Local task is using PCASupport for tag generation
  320. it should call SWI PCA_DeleteAndKill which will delete the tag and send this
  321. message in one operation but only when the object really is being deleted.
  322.  
  323. Note: This implies that the remote task, on receipt of this message cannot
  324. rely on more than the tag address as a key to the object. It _cannot_ access
  325. the object data via the tag passed as SWI PCA_DeleteTag has already been
  326. called (the address fields within the tag will contain -1 and the object
  327. data itself may well have been discarded). This is unavoidable without a two
  328. message (Message/Ack) deselection system which would be more difficuilt for
  329. tasks to handle. Especially (as is often the case) if the local task is
  330. about to quit. 
  331.  
  332. Message_DoneMyStuff(&83488) (Msg_Done%) 
  333. ---------------------------------------
  334.  
  335. Broadcast by a task when it has modified the object. All tasks accessing the
  336. object other than the originator of the message should recognise this
  337. message and redraw the object.
  338.  
  339. The block pointed to by R1 contains: 
  340.  
  341. R1+20   0
  342. R1+24   Address of object tag
  343.   
  344. Use this message for 'whole object changed' operations which do not involve
  345. changes to the object's basic structure (Eg. image filter of sprite).
  346.  
  347. Note: Receipt of this message by the Local task should not be taken as an
  348. indication that the remote task is no longer interested in it. That is what
  349. Message_UnhookMe is for. 
  350.  
  351. Message_Changed(&8348A) (Msg_Changed%) 
  352. --------------------------------------
  353.  
  354. Broadcast by Local or Remote task when the object has changed (either in
  355. size or its details). Task should act as if it had got a new DoYourStuff
  356. message.
  357.  
  358. Broadcast by Remote task after it has changed the object's size. Local and
  359. other interested Remote tasks will re-read the object's details and redraw
  360. the object.
  361.  
  362. The block pointed to by R1 contains: 
  363.  
  364. R1+20   Filetype of object
  365. R1+24   Address of object tag
  366. R1+28   reserved - 0
  367. R1+32   String. New name of object or zero for no change.
  368.   
  369. Note: Nothing about the standard prevents the object changing type (eg from
  370. sprite to Drawfile). On receipt of this message please check the filetype
  371. field as well as all necessary aspects of the object's data structure. If
  372. the object is not to a Remote task's liking it should send Message_UnHook
  373. and delink quietly. 
  374.  
  375. Message_ResizeRequest(&8348B) (Msg_Resize%) 
  376. -------------------------------------------
  377.  
  378. Sent by Remote task to Local (task handle in R1+4 of DoYourStuff message).
  379. If the Local task fails to deal successfully it will claim the message.
  380.  
  381. The block pointed to by R1 contains: 
  382.  
  383. R1+20   0
  384. R1+24   Address of object tag
  385. R1+28   reserved - 0
  386. R1+32   New size. Total size of object structure
  387.         (including header, offset to base etc.) if flags b1
  388.         clear otherwise new size of object itself.
  389. R1+36   Flags
  390.                b0 set 'Resize associated objects as well'
  391.                b1 set 'New Size is for object alone - does not include header.' 
  392.  
  393. If the Local task succeeds then it will send Message_ResizeAck (basically,
  394. copy R1+8 to R1+12, put Message ResizeAck into R1+16, update R1+32 and
  395. return to sender). On receipt of ResizeAck message the sender of
  396. ResizeRequest should modify the object appropriately (for example, adding
  397. rows/columns to a sprite). 
  398.  
  399. Notes:
  400.  
  401. You must be prepared for the resize request to fail in which case it is the
  402. responsibility of the Local task to report to the user and the Remote task
  403. to continue safely.
  404.  
  405. If the ResizeAck message returns to a Remote task you must check that the
  406. field in R1+12 is equal to the MyRef generated by the Resize message you
  407. sent to ensure that the ResizeAck is for the object you have requested be
  408. resized. If it is, ensure that the object is in a renderable state before
  409. the next Wimp_Poll by updating the relevant parts of the object's internal
  410. data structure.
  411.  
  412. The local task's only modification to the data after a Resize is to write
  413. new size fields where appropriate and to update the object's tag address
  414. fields if the object moves. For sprites the new total area size should be
  415. written into 'Base of data'+0 - it does not know what the Remote task is
  416. going to do with the sprite and therefore cannot make any other
  417. modifications to the data.
  418.  
  419. For data types which do not store size within their data structure then the
  420. length field of the tag should also be modified (along with the address
  421. fields if the object has to be moved).
  422.  
  423. After modifying the object the Remote task must broadcast Message_Changed . 
  424. Composition will read bit zero of the flags word. If this bit is set, it
  425. will resize masks associated with the sprite in question as well. The amount
  426. by which masks will be resized is calculated from the resize-request for the
  427. sprite itself. Other applications can ignore or act on this bit as they
  428. wish. The task which requested the resize must be able to handle either
  429. action.
  430.  
  431. Bit one of the flags word is intended to facilitate the resizing of paths in
  432. Drawfiles and similar data structures under the PCA though no code has been
  433. written to do this yet.
  434.  
  435.  
  436. Resize Summary
  437. ==============
  438.  
  439. This is what you do to change the size of an object you are editing: 
  440.  
  441. From a Remote task's point of view: 
  442. -----------------------------------
  443.  
  444. Send Message_ResizeRequest and keep myref generated from the message. On
  445. receipt of ResizeAck check myref, modify object data and broadcast
  446. Message_Changed .  
  447.  
  448. From the Local task's point of view: 
  449. ------------------------------------
  450.  
  451. On receipt of Message_ResizeRequest resize object if possible, update the
  452. objects tag anchors and send ResizeAck otherwise claim the message and
  453. report an error to user. 
  454.  
  455. Both Remote and Local tasks:
  456. ---------------------------- 
  457.  
  458. On receipt of Message_Changed re-read the object header as if it was newly
  459. created and redraw the entire object. (You may need to regenerate an area of
  460. your window the size of the old object - remember the new object may occupy
  461. less screen area). 
  462.  
  463. Resize speed issues 
  464. -------------------
  465.  
  466. When the object being resized is very large, VM (Virtual Memory)is being
  467. used, or the resize requests are frequent, there may be a performance issue.
  468. In such situations the Local task should consider moving the object to the
  469. top of its data storage area to prevent repeated memory moving operations.
  470. In applications where many small resize requests are likely then consider
  471. employing a tag extension system similar to the one defined above for text
  472. files to reduce the frequency of the resize requests. 
  473.  
  474. Message_UpdateArea(&8348C) (Msg_Uparea%) 
  475. ----------------------------------------
  476.  
  477. Broadcast by task when it has modified part of an object. Apps interested in
  478. the object should redraw the appropriate area of the object as quickly as
  479. possible if they have a window onto the object open.
  480.  
  481. The block pointed to by R1 contains: 
  482.  
  483. R1+20   Format of subsequent data (0)
  484. R1+24   Address of object tag
  485. R1+28   Xlow  (OS units at 1:1 scale)
  486. R1+32   Ylow  (OS units at 1:1 scale)
  487. R1+36   Xhi   (OS units at 1:1 scale)
  488. R1+40   Yhi   (OS units at 1:1 scale) 
  489.  
  490. where coordinates are relative to the bottom left of the object.
  491.  
  492. Currently this is the only format supported by code (working with bitmap
  493. sprites).
  494.  
  495. Other proposed formats are as follows: 
  496.  
  497. R1+20   Format of subsequent data (1)
  498. R1+24   Address of object tag
  499. R1+28   Xlow (Draw units = OS units <<8)
  500. R1+32   Ylow (Draw units = OS units <<8)
  501. R1+36   Xhi  (Draw units = OS units <<8)
  502. R1+40   Yhi  (Draw units = OS units <<8) 
  503.  
  504. where coordinates are relative to the bottom left of the object. 
  505.  
  506. R1+20   Format of subsequent data (2)
  507. R1+24   Address of object tag
  508. R1+28   Xlow (Draw units = OS units <<8)
  509. R1+32   Ylow (Draw units = OS units <<8)
  510. R1+36   Xhi  (Draw units = OS units <<8)
  511. R1+40   Yhi  (Draw units = OS units <<8) 
  512.  
  513. where coordinates are relative to the top left of the object.
  514.  
  515. If you have anyother suggestions please contact Clares or the author. 
  516.  
  517. Message_ResizeAck(&8348D) (Msg_ResizeAck%) 
  518. ------------------------------------------
  519.  
  520. Sent by Local task when a resize request has succeeded. On receipt by a
  521. Remote task, check that R1+12 is the myref generated from
  522. Message_ResizeRequest before modifying the object data structure and
  523. broadcasting Message_Changed . 
  524.  
  525. The block pointed to by R1 contains: 
  526.  
  527. R1+20   reserved - 0
  528. R1+24   Address of object tag
  529. R1+28   reserved - 0
  530. R1+32   New size allocated to object
  531. R1+36   Flags
  532.   
  533. Message_MiscOp(&8348E) (Msg_Misc%) 
  534. ----------------------------------
  535.  
  536. This message is designed to provide a private interface option for PCA
  537. programs without them having to request other message allocations from
  538. Acorn.
  539.  
  540. The block pointed to by R1 contains: 
  541.  
  542. R1+20   Sub-reason code 
  543. - other data dependant on sub-reason code.
  544.  
  545. The sub-reason codes available to application developers are allocated in
  546. line with SWI and Message blocks - if you have one of these then those
  547. values may be used by your programs. Where appropriate, please make details
  548. of your messages available to the PCA community by sending them to Clares
  549. for distribution.
  550.  
  551. Currently, only two sub-reasons are defined for use with Composition. The
  552. current format of these is given below but is subject to change. Please
  553. contact Clares before releasing programs which rely on it: 
  554.  
  555. SubReason_GiveAssociatedData (&83480) 
  556. -------------------------------------
  557.  
  558. Broadcast by remote plug-in when it would like to know more about the
  559. object.
  560.  
  561. The block pointed to by R1 contains: 
  562.  
  563.         R1+24   Address of object tag 
  564.  
  565. SubReason_AssociatedDataCompo (&83481) 
  566.  
  567. Sent by Compo to Remote which broadcast GiveAssociatedData containing a tag
  568. pointing to a Compo object.
  569.  
  570. The block pointed to by R1 contains: 
  571.  
  572.         R1+24   Address of object tag
  573.         R1+28   reserved - 0
  574.         R1+32   two eight bit and one sixteen bit fields
  575.                 bits 0-7     Masks in use by object
  576.                 bits 8-15    Format of subsequent data (zero)
  577.                 bits 16-31   Reserved
  578.         R1+36   Reserved (0)
  579.         R1+40   Blend mask address or zero    = no Blend mask
  580.         R1+44   Tint mask address or zero     = no Tint mask
  581.         R1+48   Curve mask address or zero    = no Curve mask
  582.         R1+52   Displace mask address or zero = no Displace mask
  583.         R1+56   Shadow mask address or zero   = no Shadow mask
  584.         R1+60   Reserved
  585.         R1+64   Reserved
  586.         R1+68   Opacity of object (65536=solid 0=transparent)
  587.         R1+72   Math type in use for object
  588.   
  589. Notes: The 'mask address' passed is the address of the base of a sprite area
  590. containing one eight bit greyscale sprite (at address+address!8). The size
  591. of a mask should not be assumed to be the same as that of the object - read
  592. it from the mask sprite data or use OS_SpriteOp to extract it.
  593.  
  594. The data returned by this message is fragile - re-read whenever you want to
  595. make use of it. 
  596.  
  597. Message_Info(&8348F) (Msg_Info%) 
  598. --------------------------------
  599.  
  600. Sent by Local to Remote application when the info button in the pop-up is
  601. clicked.
  602.  
  603. The block pointed to by R1 contains: 
  604.  
  605. R1+20   0 
  606.  
  607. Remote application should write a suitable info string into +20, change the
  608. message size and return the message to the sender.
  609.  
  610. Example info strings:
  611.  
  612. "Image Filter. No image linked at the moment."
  613.  
  614. "Image Filter. Image 'Face' linked at the moment." 
  615.  
  616.  
  617. Message_ObjectPosition(&83490) (Msg_ObjPos%) 
  618. --------------------------------------------
  619.  
  620. This message is generated by the Local application after receipt of
  621. Message_HookMe , object repositioning operations and window open operations,
  622. if the Local application supports 'Inplace editing'.
  623.  
  624. The block pointed to by R1 contains: 
  625.  
  626. R1+20   0
  627. R1+24   Address of object tag
  628. R1+28   Y scale of object in Local window (65536=1:1 or 100%)
  629. R1+32   Xlow of object on screen in 'Local' window.
  630. R1+36   Ylow of object on screen in 'Local' window.
  631. R1+40   Handle of 'Local' window.
  632. R1+44   Handle of Local windows toolbar window (or -1 if no toolbar)
  633. R1+48   X scale factor of object in Local window (16.16 format eg 65536=1:1 or 100%)
  634. R1+52   Xlow of object on screen in Local window. (unlimited)
  635. R1+56   Ylow of object on screen in Local window. (unlimited)
  636.   
  637. On receipt, the Remote task should open its toolbar/infobar relative to the
  638. positions in R1+32 and R1+36 behind the window handle at R1+44. The
  639. coordinates passed in R1+32 and R1+36 should be limited to the windows
  640. visible area (by the Local task) while those at +52 and +56 should not. 
  641.  
  642. The information at R1+28 and R1+48 onwards is for use by the Remote task
  643. during mouse click operations on the object. To convert mouse coordinates
  644. read directly it should subtract the values at R1+52,R1+56 from the raw
  645. mousex and mousey coordinates, and then scale according to the value in
  646. R1+48. 
  647.  
  648. The X and Y scale factors are in 16.16 format. To convert a scale factor
  649. into this format, multiply by 1 << 16. For example, 100% = a scale factor of
  650. one and is therefore (1 << 16) * 1 which is 65536 or &10000. 150% = a scale
  651. factor of 1.5 and is therefore (1 << 16) * 1.5 which is 98304 or &18000.
  652.  
  653. See the remote painting code (DEFPROCremote_win) in !Spaint for a practical
  654. example of what you should do. 
  655.  
  656. Message_HookMe(&83491) (Msg_Hook%) 
  657. ----------------------------------
  658.  
  659. This message is sent by the Remote task to the Local task. It indicates to
  660. the Local task that it should begin intercepting mouse button and other Wimp
  661. events to the object and send them to the Remote task. On receipt, the Local
  662. task should create a trap icon over the object (using the button type in
  663. r1+28) and send Message_ObjectPosition.
  664.  
  665. The block pointed to by R1 contains: 
  666.  
  667. R1+20   0
  668. R1+24   Address of object tag
  669. R1+28   bits 0-27 Flags - reserved and set to zero.
  670.         bits 28-31 Window 'work area' button type to use for trap icon.
  671. R1+32   Window handle
  672. R1+36   String. indirection string for icon or Null (&0) 
  673.  
  674. To make life easier for the remote task the Local task should also take note
  675. of the window handle at R1+32 and insert that value into the window handle
  676. field when passing on Wimp messages. This allows the remote task to use much
  677. of the same code to deal with remotely generated messages and messages to
  678. their own window.
  679.  
  680. The optional indirection string at R1+36 is intended to allow for adding a
  681. mouse pointer change when entering in-place edited objects. Take care with
  682. this string as certain settings can disrupt the Local task's message
  683. trapping. This extension is optional. Some local tasks may not support it so
  684. do not rely on it.
  685.  
  686. If the remote task is already editing an object in-place (and it is going to
  687. replace it) then it should send Message_Unhook to the local task previously
  688. being worked with so that it deletes its trap icon.
  689.  
  690. Please see the section below on In-place editing for details of the best
  691. method of trapping messages and the alterations which should be made before
  692. forwarding them. 
  693.  
  694. Message_UnhookMe(&83492) (Msg_Unhook%) 
  695. --------------------------------------
  696.  
  697. This message is sent by a remote task to the Local task (or local to remote)
  698. when it wants to 'unhook' from the object.
  699.  
  700. The block pointed to by R1 contains: 
  701.  
  702. R1+20   0
  703. R1+24   Address of object tag
  704. R1+28   reserved  - 0
  705. R1+32   Window handle
  706. R1+36   Unhook 'type'
  707.   
  708. This message should be used by a Remote task to indicate its lack of
  709. interest in an object. After sending this message the Remote task should
  710. forget any references to the object and close its toolbar and/or window.
  711.  
  712. Little action need be taken at the Local end on receipt of this message
  713. unless 'Inplace editing' is going on between the tasks in which case it
  714. should remove the traps on Button click messages etc for the object. If the
  715. Local task wishes to be efficient in its generation of PCA messages then it
  716. should keep a counter for each object in the PCA system, increase the
  717. counter on each call to Message_DoYourStuff and decrease it on each receipt
  718. of Message_UnHook. Then PCA messages need only be generated in response to
  719. changes made by the Local task if the objects counter is greater than zero.
  720. When the counter reaches zero the Local task should broadcast
  721. Message_Deselect as a saftey measure to ensure that all Remote tasks stop
  722. using the object.
  723.  
  724. The 'unhook type' at R1+36 currently has two defined values: 
  725.  
  726. R1+36   0 'Unhook' is temporary
  727.           (used by Compo to support the 'Track selected'
  728.           preference option)
  729. R1+36   1 'Unhook' is permanent - forget about this PCA. 
  730.  
  731. All values other than zero should currently be treated as 'permanent'.