OS4 DepotLogo by Nickman 
(anonymous IP:,2179) 

   Bug tracker
   Locale browser


   o Audio (343)
   o Datatype (51)
   o Demo (203)
   o Development (595)
   o Document (22)
   o Driver (97)
   o Emulation (146)
   o Game (995)
   o Graphics (497)
   o Library (114)
   o Network (231)
   o Office (66)
   o Utility (919)
   o Video (69)

Total files: 4348

Full index file
Recent index file



Support the site

 Readme for:  Utility » Workbench » wb2filer.lha


Description: Hack to run Filer when dbl-click on desktop icons
Download: wb2filer.lha       (TIPS: Use the right click menu if your browser takes you back here all the time)
Size: 48kb
Version: 0.10
Date: 20 Feb 2024
Author: kas1e
Submitter: kas1e
Email: kas1e/yandex ru
Homepage: https://www.youtube.com/@OMEGA12001
Requirements: amigaos4
Category: utility/workbench
Replaces: utility/workbench/wb2filer.lha
License: Other
Distribute: yes
Min OS Version: 4.0
FileID: 12840
Comments: 0
Snapshots: 0
Videos: 0
Downloads: 14  (Current version)
73  (Accumulated)
Votes: 0 (0/0)  (30 days/7 days)

Show comments Show snapshots Show videos Show content Show crashlogs Replace file 
=== What is WB2Filer for and what it does ====

   WB2Filer is a hack  which patch Intuition's functions via SetMethod() to
allow transparently
   run of the Filer  binary pointing to the  given partition on  Workbench's
Desktop instead of
   original Workbench windows.

=== How to use ===

   WB2Filer is just a binary which you run from the shell with path to the Filer
   binary as argument:

   amiga shell:> wb2filer system:utilities/filer/filer

   Hitting "ctrl+c", will clean the patches up and exit.

   You can run it from User-Startup as well, just by adding something like this:

   RUN >NIL >NIL: work:wb2filer/wb2filer system:utilitites/filer/filer

=== How It Works ===

   The  main  patched  function where all magic  happens is 
OpenWindwowTagList(), which is the
   function Workbench use for opening its windows.

   When WB2Filer is running,every doubleclick on Workbench's desktop icons will
be hijacked and
   instead of return to original OpenWindowTagList,a patched function will run
Filer and return
   NULL (so to not show up original  Workbench window). This action by default
cause "blink" of
   the Workbench topbar (if you had relevant setting in the prefs:sound sets),
so we also patch
   relevant Intuition's DisplayBeep() to disable blinking of top bar, while
keeps it working as
   expected for all other cases as before

   Technically speaking, what happens inside of the WB2Filer is:

    --- Implemented own _start() to avoid C lib startup codes. So we obtain
IExec manually, etc
    --- Hijacked Intuitions's OpenWindowTagList() and DisplayBeep() via
    --- Check: if  task's name is "AsyncWB - textinput" one, and if so  for the
next  Workbench 
        window we return to original OpenWindowTagList()
    --- Check: If Opened window is not Workbench one, we return to original
    --- Parse "Title"  of  Window : if it had spaces, % and , then for 99.9%
this is a DISK, so
        strip it off, and add ":" at the end
    --- Check: If Active window is not Workbench one, we return to original
    --- Construct a command line to run (path_to_filer/filer "DISK:")
    --- disable the Intuitions's DisplayBeep() (to avoid blinking when return
    --- runs the Filer and return NULL

   Also,different cases supported:you still can use WBRUN from the shell,from
AsyncWB's amiga+e
   or from Filer's "Open Workbench" to have original Workbench windows opened,
in which you can 
   navigate the same as before. All what  changed from User's POV is just  the
clicking on  the 
   partitions  on the WB Desktop will run a Filer on given Disks, the same as
"Open Volumes" or
   "Open" from the Workbench's Menu.
=== Limitations and Corner Cases ===

   To be find

=== TODO ===

   -- commoditie
   -- tooltype support
   -- when  open more than one  Filers, need to  make them to be opened not on
the same position
   -- when doubleclick on a partition with already opened filer, instead of
opening Filer again,
      we need to make an opened Filer to be active instead
   -- some qualifier which, once held down together with click on disk icon,
open an original WB
=== Version History ===

   v.01 (24.11.2023)
      -- initial release
   v.02 (25.11.2023)
      -- removed all debug output
      -- made size of binary to be as small as possible
      -- added readme
      -- source included
   v.03 (27.11.2023)
      -- few logical fixes: replaced three calls of asprintf() by one, ditch
unused vars, shift
         parsing of argv (thanks Balaton)
      -- now hijack only WBICON volumes, so you still can continue to open pure
WB folders from
         Filer or via "wbrun" tool as before
   v.04 (30.11.2023)
      -- hijack Intuition->DisplayBeep() as well,to disable wb-bar blinks after
Filer's run and
         original OpenWindowTagList() returning NULL (thanks msteed for idea)
      -- updated readme to be in sync
   v.05 (01.12.2023)
      -- build with -Wall and -O3, later of which made binary be smaller on 1kb 
      -- made a changes/fixes following Balaton's coding style suggestions
(kudos for help!)
      -- made struct Task to be local to Patched_OpenWindowTagList()
      -- cleaned and simplify ctrl+c loop by get  rid of unused vars and
shifting printf out of
         ctrl+c check-loop
      -- minimize multitasking risks of calling DisplayBeep() out of our hack
      -- added error checking for Task creation and asnprinf() result
      -- using sizeof(..) with WBOBJA_FullPathSize to  avoid future's issues
when code grow up.
      -- fixed missing return in Patched_DisplayBeep()

   v.06 (07.12.2023)
      -- get rid of WhichWorkbenchObject() in favor of WorkbenchControl()'s
         (allow more control)
      -- handled correctly selecting  of more than 1 icon at time. Thanks to
msteed and Javier!
      -- added  unselecting of icons  after Filer is running  (to gain
flexibility of different 
         Open WB windows cases)
      -- restructured code: more error checking, more comments,and more
different cases handled
      -- added icons from Mason (yeah!)
      -- readme rewritten
   v.07 (14.12.2023)
      -- totaly rewrote  logic of patch: now instead of WB's WorkbenchControl()
and manual icon
         selection,we simply based on window title names. This simplify patch a
lot and make it
         work much better in all situations (thanks Joerg)
      -- get rid of WFLG_BACKDROP check as struct *NewWindow never had
      -- code cleaning  by Balaton's suggestions (simplify DISK icon check,
remove some  nested
         ifs and indentation for readability, vars renaming, simplification of
code, etc.)      
      -- added check on ActiveWindow to distinguish between main desktop and
other windows more
         when  want to  have original  Workbench  windows  while run wbrun from 
shell or  from
         Filer's "Open Workbench"
      -- added check on "Amiga+e" window (AsynWB - texinput process) : so when
we hit "Amiga+e"
         we are able to do "wbrun" from it to have Original WB window.
      -- rewrote README and made another version in true amiga.guide format     

      -- cosmetic fixes for the icons (thanks msteed for note)

   v.08 (17.12.2023)

      -- fixed NULL pointer  crash when  we deselect WB Backdrop from the 
Workbench's menu and
         select it back by  adding null pointer check on the nw->Title (which
are NULL for pure
         NewWindow->Title when we back from)
      -- replaced usage of C lib malloc and I/O based functions, incl. functions
like strdup(),
         asnprintf(), etc., in the  patched functions to AmigaOS4 native ones. 
Because patched
         functions running in foreign tasks may not have called the required C
library setup to
         be able to use such functions in a thread safe way.Thanks to Joerg for
pointing out on

      -- get rid of -lauto and open/close all the libraries manually

      -- ditched completely newlib's startup code, and going true Amiga
way:_start() instead of
         main(),obtaining of exec manually,etc.For such a hack where size and
bloat are matter,
         this is the way to go.

      -- replaced  every C function on the  Amiga native ones from dos, utility,
intuition, and
         exec libraries.

      -- switched to Amiga way of parsing argv/argc via ReadArgs()

      -- binary  builds now without "ld" , just "gcc -S" to build assembler
output, and then by
         "as" to build from assembler a ready binary.

      -- all the above points reduced the size of binary even more

   v.09 (18.12.2023)
      -- code cleaning based on Joergs suggestions, thanks!

      -- first os4depot release

   v.10 (21.12.2023)
      -- better parsing of the titles to handle spaces

      -- better parsing of the Filer's path, which also may contain spaces

      -- Added "static inline" in front of all functions (except _start and
original functions)
         to reduce size of the binary even more.

         Thanks joerg for all the points about!

=== Author ===

       Roman "kas1e" Kargin

=== Thanks To ===

       Petrol for original idea
       Balaton and msteed for code-checking and advices
       Joerg for his valuable AmigaOS knowledge
       Javier for ideas and code-help
       Mason for icons
       and all other ppls from amigans.net for their help and support! 

Copyright © 2004-2024 by Björn Hagström All Rights Reserved