home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #1 / NN_1993_1.iso / spool / comp / sys / acorn / tech / 1224 < prev    next >
Encoding:
Internet Message Format  |  1993-01-11  |  3.8 KB

  1. Path: sparky!uunet!wupost!waikato.ac.nz!aukuni.ac.nz!cs18.cs.aukuni.ac.nz!jwil1
  2. Newsgroups: comp.sys.acorn.tech
  3. Subject: Re: new template format
  4. Message-ID: <1993Jan11.013356.13820@cs.aukuni.ac.nz>
  5. From: jwil1@cs.aukuni.ac.nz (TMOTA)
  6. Date: Mon, 11 Jan 1993 01:33:56 GMT
  7. Sender: jwil1@cs.aukuni.ac.nz (TMOTA)
  8. Organization: Computer Science Dept. University of Auckland
  9. Lines: 66
  10.  
  11.  
  12. [talking about icon tags]
  13.  
  14. >(1) It's inefficient. Just think about it - *every* time you change an
  15. >icon's contents, set its flags, read its selection state, decode a mouse
  16. >click - you go through a string look up table routine.
  17.  
  18. It's not all that inefficient, for the following reasons:
  19.   a) You can have short tags. I would be happy with 4-byte tags, which can
  20.      be compared very swiftly (rather than arbitrary strings).
  21.      4-byte tags also take up no/minimal extra space.
  22.      If arbitrarly length strings are used, then they need only be defined
  23.      and used for icons whicah are actually used/altered 'by name' by the
  24.      application, so you won't have to compare your way through screeds of
  25.      icons to find the only button in the window which does something!
  26.  
  27.   b) You don't have to convert on *every* access. I think you'll find that
  28.      most icon accesses are very infrequent, and only a few icons are accessed
  29.      enough to warrant caching their WIMP-icon equivalents.
  30.  
  31.   c) As Glass format is going to supply extra functionality (meta-icons etc)
  32.      some kind of lookup will have to be performed to some extent anyway - the
  33.      program cannot deal directly in terms of WIMP icons all the time.
  34.  
  35.      The whole idea of (for example) a slider meta-icon is that you will
  36.      refer to it as a single entity in the program and in the editor, and
  37.      the support code will convert operations upon the meta-icon into
  38.      operations on one or more WIMP icons to simulate the meta-icon's
  39.      abilities.
  40.  
  41. >(2) What's the point?  Heretical, I know, but what do you actually gain by
  42. >being able to decode icon names at run time?
  43.  
  44. Well, it has user-friendly advantages everywhere you refer to an icon
  45. external to the program: References in debugging information and in
  46. message tags, etc, for example.
  47.  
  48. It would also be handy for defining template sets for different languages
  49. etc. without having to worry about getting the numbering exactly right -
  50. you want the references to be the same for any icon: By defining a name you
  51. can be sure, but if the name is converted to some arbitrary internal
  52. reference by Glazier at edit-time, then you can't guarantee that the
  53. relationship between #define names and actual references will hold over
  54. all your different template files.
  55.  
  56. So due to this fact, and the fact that you have to do some
  57. glass-icon-reference to wimp-icon-reference conversions anyway, I can't see
  58. how you are going to handle everything correctly in a nicer way than icon
  59. tags...
  60.  
  61. Note that many icons could be marked as unimportant, so that they don't have
  62. specific tags, and are ignored when scanning for tags. This includes titles
  63. and boxes and other inert icons. Writable icons can be looked up once to
  64. find the indirected workspace, and then have that address cached, etc.
  65.  
  66. In DSEdit, I can only think of about 10 icons out of the hundreds I have
  67. that would be 'touched' nearly often enough to justify caching their
  68. handles in order to improve efficiency. Although there is an extra overhead
  69. on accessing icons, remember that often icon updates are to do things like
  70. responding to a click by indenting, in which case, an extra 100 cpu cycles
  71. is a negligible delay... Also note that I believe that a large proportion
  72. of icon accesses should move into the Glass support module, for example,
  73. continuous update of a slider icon should be handled by Glass, not by the
  74. user program, so the overheads do not apply...
  75. -- 
  76. themasterofthearcanejwil1@cs.aukuni.ac.nzthismessagewassentonrecycledelectrons
  77.