home *** CD-ROM | disk | FTP | other *** search
/ ARM Club 3 / TheARMClub_PDCD3.iso / programs / desktop / newbar / ReadMe < prev   
Text File  |  1998-08-08  |  17KB  |  391 lines

  1.  
  2.                          IbarPatch version 1.10          (8th August 1998)
  3.                         ========================
  4.  
  5. 0. Contents
  6. -----------
  7.    1. What is it?
  8.    2. Installation
  9.    3. Customisation
  10.    4. The Pinboard patcher
  11.    5. How it works
  12.    6. Bugs, problems, compatibility, and things unimplemented
  13.    7. Making your programs work well with IbarPatch
  14.    8. Compiling and understanding the source
  15.    9. Version history
  16.   10. Possible future improvements
  17.   11. Copyright
  18.   12. And finally
  19.  
  20.  
  21. 1. What is it?
  22. --------------
  23. Bored with the standard, dull iconbar?  Don't like the way it flickers when
  24. it's updated?  Looking to reclaim a precious few OS units of your screen? 
  25. Or just want to see a neat example of how to hack the Window Manager?
  26.  
  27. IbarPatch may be the thing for you!
  28.  
  29. IbarPatch is a replacement iconbar for RISC OS.  It was written originally
  30. as a programming exercise in patching the Window Manager (which I started
  31. over a year ago, around January 1997, and have just come back to, so is
  32. also an exercise in understanding my own code).  It will also patch the
  33. Pinboard to cope with a different size iconbar.  Although currently its only
  34. use is to make the iconbar look different, it could be extended to allow
  35. iconbar icons to be moved to the Pinboard, for example.
  36.  
  37. IharPatch has a range of configuration options to allow the iconbar's
  38. appearance be customised.  Plus you get the source code, so you can modify
  39. it further yourself if you want.
  40.  
  41. New versions will be available from: 
  42. <http://www.argonet.co.uk/users/mseaborn/comp/programs.html>
  43.  
  44.  
  45. 2. Installation
  46. ---------------
  47.  
  48. Before you install
  49. - - - - - - - - - 
  50. Installation is simpler than the last version.  If you had a previous
  51. version installed, you must uninstall it first by reversing any steps you
  52. made to install it!
  53.  
  54. If you are using RISC OS 3.6 or RISC OS 3.7, make sure you have a newish
  55. version of ROMPatch installed, otherwise there may be problems.  The latest
  56. version is available from <http://www.acorn.com/browser/download.html>.
  57.  
  58. Installing
  59. - - - - - 
  60. To install this version, simply copy the !NewBar application into your
  61. `!Boot.Choices.Boot.PreDesk' directory.  If you're not using Acorn's
  62. standard boot sequence (which comes with RISC OS 3.5 onwards), just make
  63. sure that !NewBar gets run before the desktop starts.
  64.  
  65. Reboot, and everything should work.  If something goes wrong and the desktop
  66. won't start, you can use Shift-Break to get back into the desktop and change
  67. things.
  68.  
  69. Beyond installation, no more instructions for NewBar are needed, apart from
  70. altering its options.
  71.  
  72.  
  73. 3. Customisation
  74. ----------------
  75.  
  76. Editing the Choices file
  77. - - - - - - - - - - - - 
  78. The NewBar application has a large number of options for configuring the
  79. appearance of the iconbar.  These can be changed by editing the
  80. !NewBar.Choices file:  you can get to this either by selecting `Edit
  81. choices' from NewBar's menu, or by Shift-double-clicking on !NewBar and
  82. loading the Choices file inside.
  83.  
  84. Once you have changed some options, you can reload them by selecting `Reload
  85. choices' from NewBar's menu, or by quitting NewBar and reloading it. 
  86. NewBar's menu can be opened by clicking Menu on an empty part of its
  87. iconbar.
  88.  
  89. The format of the Choices file
  90. - - - - - - - - - - - - - - - 
  91. This is fairly straightforward:  On each line, there is the name of an
  92. option, followed by the value assigned to it.  I will not list all the
  93. available options here -- they are all listed in the provided Choices
  94. file with comments explaining each (comments start with `#' and extend to
  95. the end of the line).
  96.  
  97. There is a special feature, option groups.  These allow a set of options to
  98. be switched on and off in one go.  For example:
  99.  
  100. # An iconbar with small sprites
  101. group small-iconbar off {
  102.   small-icons        on
  103.   icon-height        72
  104.   window-height        72
  105.   sprite-margin        10
  106. }
  107.  
  108. By changing `group small-iconbar off' to `group small-iconbar on', all the
  109. options inside the curly brackets come into effect.  (Options later in the
  110. file override those that came before.)
  111.  
  112. The Choices file included with NewBar contains all the default options at
  113. the beginning (ie. those that would be used anyway if the file did not
  114. specify them).  After this I have put some option groups for various things. 
  115. You can switch these groups on and off to see what they do, add your own
  116. groups, or modify the options at the beginning directly.
  117.  
  118.  
  119. 4. The Pinboard patcher
  120. -----------------------
  121. IbarPatch includes code to patch the Pinboard module.  The most important
  122. patch is to ensure that the Pinboard's background window reaches down to the
  123. top of the smaller iconbar.  As a bonus, it can also change the colour of
  124. the Pinboard's background.
  125.  
  126. The patcher has been tested with the versions of the Pinboard module that
  127. come with RISC OS 3.1 and 3.7.  However, it will try to patch other versions
  128. by searching for the instructions to change.
  129.  
  130. The patcher will be run by NewBar before the desktop starts up.  What
  131. patches are made can be changed in NewBar's Choices file.
  132.  
  133. If you are using a version of the Pinboard module that the patcher won't
  134. patch, contact me and I'll see what I can do.
  135.  
  136.  
  137. 5. How it works
  138. ---------------
  139. There are two main parts to IbarPatch:
  140.  
  141. IconbarPatch -- This module intercepts Wimp SWIs using Doggysoft's WimpSWIVe
  142. module (version 0.05, which is included).  Any call relating to the iconbar
  143. it queues and/or responds to with information that it knows.  eg. Adding a
  144. new icon is queued (but responds with a new icon handle); and opening a menu
  145. can be altered so that menus appear in the correct place.
  146.  
  147. NewBar -- This application provides the replacement iconbar.  It interacts
  148. with IconbarPatch by looking at its queue and updating its iconbar
  149. appropriately.  It delivers iconbar mouse clicks to icons' owners.  It also
  150. tells IconbarPatch information such as where to open iconbar menus.
  151.  
  152. This division of labour is intentional.  Although it makes things a lot
  153. harder (because IconbarPatch has no idea of its client's data structures and
  154. can't always respond instantly), it means more than one task can handle
  155. iconbar icons.  So in the future, they could be moved to the Pinboard with
  156. an Alt-drag, or something.  It also means I don't have to write a module
  157. task (I can never get them to work).
  158.  
  159.  
  160. 6. Bugs, problems, compatibility, and things unimplemented
  161. ----------------------------------------------------------
  162. Hint:  If NewBar dies (or you quit it accidentally), it can be reloaded by
  163. pressing F12, typing `WimpTask Desktop_StartIconbar' and pressing Enter a
  164. few times.
  165.  
  166. Known problems that can be fixed:
  167.  * NewBar gets bitten by the bug in Wimp_TransferBlock in RISC OS 3.7.  To
  168.    fix this, make sure you use ROMPatch.
  169.  
  170. Known problems that have not been fixed yet:
  171.  * IconbarPatch may not cope properly with soft resets under RISC OS 3.1.
  172.  * NewBar sometimes dies when Help is running.
  173.  * NewBar doesn't yet re-open fonts on a mode change, so if the pixel sizes
  174.    change, the fonts used will be the wrong size.
  175.  
  176. Things that are not implemented:
  177.  * TinyDirs doesn't work properly, because NewBar doesn't do different
  178.    button types (such as icons that can be double-clicked).
  179.  * Shift-clicks on windows' toggle-size icons.  The Wimp thinks that there
  180.    is no iconbar, and still opens windows at full size.
  181.  * Similarly, NewBar doesn't do the new Nested Wimp's trick of putting the
  182.    iconbar to the front when the pointer is kept at the bottom of the screen
  183.    long enough; and it doesn't use Menu clicks at the bottom of the screen
  184.    to do the same either.  There are modules you can use to provide this
  185.    functionality separately.
  186.  
  187. IconbarPatch intercepts all iconbar-related SWIs.  The essential ones are
  188. implemented fully, but some of the non-essential ones are partially
  189. implemented because certain programs (such as Alarm and ANT's Hotlist) rely
  190. on them.  The SWIs intercepted are:
  191.  * Wimp_CreateIcon:  creation is queued.
  192.  * Wimp_DeleteIcon:  deletion is queued.
  193.  * Wimp_CreateMenu:  menu co-ordinates patched.
  194.  * Wimp_GetWindowState:  window state as recorded by NewBar is returned.
  195.  * Wimp_GetWindowInfo:  only window state info is returned.
  196.  * Wimp_SetIconState:  update is queued.
  197.  * Wimp_GetIconState:  gives info in some circumstances.
  198.  * Wimp_ForceRedraw:  ignored.
  199.  * Wimp_WhichIcon:  returns error.
  200.  * Wimp_DragBox:  returns error.
  201.  * Wimp_SendMessage:  messages are sent to icon's owning task.
  202.  * Wimp_GetWindowOutline:  state as recorded by NewBar is returned.
  203.  * Wimp_GetPointerInfo:  return data changed.
  204.  * Wimp_ResizeIcon:  returns error.
  205.  
  206.  
  207. 7. Making your programs work well with IbarPatch
  208. ------------------------------------------------
  209. Iconbar height:
  210. Don't assume you know the height of the iconbar.  NewBar sets the system
  211. variable Iconbar$Height to the height of the iconbar in OS units, so try
  212. reading this before reverting to the default Wimp height of 134 OS units. 
  213. Pinboard replacements, for example, should do this.  The exception is
  214. opening menus -- iconbar menus can be opened in the same way as usual, and
  215. are patched to open in the right place.
  216.  
  217. Sprite areas:
  218. If your program uses its own sprite area for an iconbar sprite, make sure
  219. the size of the area is correctly filled in.  SwiftJPEG fails to do this, so
  220. NewBar has to make some guesses to work around the fault.
  221.  
  222.  
  223. 8. Compiling and understanding the source
  224. -----------------------------------------
  225.  
  226. Prerequisites
  227. - - - - - - -
  228. Full source code is provided.  To compile it, you'll need:
  229.  * A C compiler (such as Acorn's C or gcc, although I haven't tried
  230.    compiling it with gcc).
  231.  * An Assembler (Acorn's ObjAsm, or `as' probably).
  232.  * A copy of OSLib.
  233.  * My library, Dreamscape.
  234.  * Probably some other stuff I've forgotten as well.
  235.  
  236. Optional things are:
  237.  * Some sort of `make'.
  238.  * Makatic 2.
  239.  * Dr Smith's C Dev Toolkit helps debugging (commercial from WSS).
  240.  
  241. Source components
  242. - - - - - - - - -
  243. For IconbarPatch:
  244.  
  245. ibpatch.hdr -- The data structures used by the module, which are accessible
  246.         by other programs (by reading its workspace address).
  247. debug.hdr -- Some debugging macros for the module.
  248. module.s -- Module header and init/finalisation code.
  249. handler.s -- Contains the routines for handling Wimp SWIs.
  250.  
  251. For NewBar:
  252. This is quite modular, and the modules are (each with .c and .h files):
  253.  
  254. gadget (iconbar_gadget) -- Handles display of iconbar icon gadgets.
  255. iconmgr (iconbar_manager_task) -- Communicates with the module.
  256. iconbar (thiniconbar) -- Arranges icons in a window (and scrolls it, etc.).
  257. pinpatch -- Will patch the Pinboard.
  258. hotkeys -- Creates a window for grabbing keypresses, but doesn't actually
  259.         work properly (not sure why).
  260. font -- A few font-handling routines.
  261. options -- Reads the Choices file into a structure.
  262.  
  263. There are some miscellaneous files:
  264. debug.h -- Debugging facilities.
  265. ibarpatch.h -- Details of the module's structures.
  266. various.h -- Prototypes for some misc functions.
  267. hacky.c -- Extracts icon and sprite data.
  268. main.c -- Starts and ends task, creates the menu.
  269.  
  270.  
  271. 9. Version history
  272. ------------------
  273. <1.00    Originally written around January 1997.  Not released, not numbered.
  274.  
  275. 1.00 (released 9th March 1998):
  276.     Over a year later, I came back to my code.  Finished the program
  277.     properly, tidied it up a lot and added comments.  The first release
  278.     version.
  279.  
  280. 1.10 (released 8th August 1998):
  281.  * Made a few bug fixes.  Is now stable; NewBar has not died for ages, at
  282.    least with the programs I use.
  283.  * Have resolved to document changes properly.  Added this section.
  284.  * Updated PatchPinbd; should work for arbitrary Pinboard versions.
  285.  * Fixed problem where iconbar was not getting resized properly.  Didn't
  286.    notice this before because Alarm ticks and forces a resize anyway.
  287.  * Added code to read an options file (instead of recompiling options).
  288.    Supports ints, floats and strings.  Later added enumerations, as well as
  289.    boolean and colour types (which are implemented as enumerations).
  290.  * Added a few options to configure icon appearance (colours, borders).  The
  291.    motivation was to make it go with XEarth.  Later, added support for
  292.    groups of options, so styles can be enabled with the flick of a switch.
  293.  * IconbarPatch can now start NewIconbar when the desktop starts (reduces
  294.    installation complexity).
  295.  * Did a large amount of rearranging, creating a class for icons.  Also
  296.    simplified icon creation:  both text and sprite are now done as Wimp icons
  297.    (previously text was a Button and sprite could be either).  Better design
  298.    in this area should reduce icon flicker (especially on Alarm).
  299.  * Added the option of changing the font (and font size) of iconbar text.
  300.  * Will now keep essential event data, so that if NewBar is reloaded, the
  301.    icons will still be there!  Also added a usage count for IconbarPatch,
  302.    although not needed, because the module now doesn't have to be killed when
  303.    NewBar quits.
  304.  * Split main() program and iconbar object into separate files.
  305.  * Now patches Wimp_ResizeIcon (just gives an error for iconbar).
  306.  * Added different types of scrolling.  Quite a variety, any of which might
  307.    Do The Right Thing according to your tastes.
  308.  * Fixed tricky bug:  If the iconbar was above other windows on a mode
  309.    change, those windows would become obscured by the Pinboard.  Why:  If a
  310.    window with the `backdrop' flag set is sent to the bottom of the stack,
  311.    it is actually put to the *top* of the stack of backdrop windows.  On a
  312.    mode change, the Pinboard opens its backdrop at the `bottom' of the stack
  313.    (instead of reading the current state); on top of the iconbar and all the
  314.    other windows.  Now NewBar unsets the backdrop flag when the iconbar is
  315.    brought to the front (this is done by poking the Wimp's workspace under
  316.    old Wimp versions).  This is actually what the Wimp does (since you can
  317.    use a window's back icon to put it below the iconbar when the iconbar has
  318.    been brought to the front).  NewBar now also makes sure that, on startup,
  319.    the iconbar is opened at the bottom of the stack.
  320.  * Added option for iconbar to have a border (like the Wimp's one).
  321.  * Implemented half-size icons.  Will use the icon name prefixed by `sm' if
  322.    possible (if in Wimp pool), otherwise will use the Wimp's half-size
  323.    facility.
  324.  * Added capability to take options via the command line.
  325.  * Recoded the Pinboard patcher in C.  With easier argument passing, I have
  326.    made it a bit smarter.  The Pinboard's background colour is also patched
  327.    now.  At the moment, PinPatch is linked into the NewBar !RunImage and
  328.    invoked with a command line switch.  This lets it share the option reading
  329.    code, although space is now taken up by the patcher code when NewBar is
  330.    running (not really significant though).
  331.  * Added an option to arrange icons with the text to the right of sprites,
  332.    instead of underneath the sprites.  This lets the iconbar be even thinner,
  333.    but makes it wider.  It also looks a bit like Windoze 95's task bar.
  334.  * Another significant rearrangement:  Split off from the iconbar object all
  335.    code involved in dealing with the IconbarPatch module and mouse clicks.
  336.    The iconbar object now just deals with arranging icons in a window, and
  337.    has been mostly rewritten to be a lot more elegant and efficient.  Fixed
  338.    a few bugs and problems in the process.
  339.  * Moved the font handling code into its own file.
  340.  * IconbarPatch module will now free its event lists when killed.
  341.  * Fixed some bugs:  Realised than the newer ROMPatch is needed.  Seem to
  342.    have fixed problem with Window_WimpToToolbox.  Fixed icon rearrangement
  343.    for icons on the far right (eg. XEarth).  Tested again on RISC OS 3.1.
  344.  
  345.  
  346. 10. Possible future improvements
  347. --------------------------------
  348. Fix bugs:
  349.  * Fix font mode change omission.
  350.  * Interferes with Printers on RO 3.1.
  351.  * NewBar dies sometimes under Help.
  352.  * Improve error handling.
  353.  * Make more efficient speedwise.
  354.  
  355. Add features:
  356.  * Alternative background textures for iconbar.
  357.  
  358. Larger changes:
  359.  * Allow different tasks to handle different iconbar icons, using a filter
  360.    options file to redirect them.
  361.  * Write a new icon arranger, allowing icons to be placed in themed
  362.    `drawers' (Matthew Bloch's idea).
  363.  * Allow icons to be dragged between tasks that will handle them.
  364.  * Write a Pinboard replacement that will take iconbar icons (long term,
  365.    this one!).
  366.  
  367.  
  368. 11. Copyright
  369. -------------
  370. IbarPatch is copyright (c) 1997/8 Mark Seaborn.  You can modify and
  371. distribute it under the terms and conditions of the GNU General Public
  372. Licence version 2, or, at your option, a later version.
  373.  
  374. The WimpSWIVe module is (c) Doggysoft (see <http://www.doggysoft.co.uk/>).
  375.  
  376.  
  377. 12. And finally
  378. ---------------
  379. If you've got any comments, you can e-mail me, Mark Seaborn, via
  380. <mseaborn@argonet.co.uk>.  If that fails sometime in the future, try my
  381. forwarding address <mseaborn@bigfoot.com>.
  382.  
  383. Bug reports are encouraged, but bug fixes are even more appreciated (use the
  384. source, Luke!).  If you make any improvements to the source code, tell me
  385. about them, because they may well be worth putting into a future release.
  386.  
  387. Lastly, you will be able to find future versions of IbarPatch at
  388. <http://www.argonet.co.uk/users/mseaborn/comp/programs.html>, and my home
  389. page can be found at <http://www.argonet.co.uk/users/mseaborn/> (there is
  390. also a forwarding address at <http://www.bigfoot.com/~mseaborn/>).
  391.