home *** CD-ROM | disk | FTP | other *** search
- /* IntelOutside for Directory Opus 5.5
- by Leo 'Nudel' Davidson for Gods'Gift Utilities
- email: leo.davidson@keble.oxford.ac.uk www: http://users.ox.ac.uk/~kebl0364
-
- $VER: IntelOutside.dopus5 1.4 (1.7.96)
-
- Adds an icon to your Opus screen. Supports close and snapshot (writes
- snapshot information to the filecomment of the icon -- don't snapshot
- if you want to keep the comment).
-
- What's the point? I wanted to have a nice, transparent "Intel Outside"
- icon on my bench and didn't want the little left-out arrow in the
- corner spoiling it. You should fine 1:1 and 1:2 aspect Intel Outside
- icons somewhere with this script (put them in DOpus5:Icons if they
- are not there already).
-
- Just put this script in DOpus5:Modules to enable it.
-
- Specify your icon below, without ".info" at the end.
-
- If you want the AppIcon to be there from startup set "initstart" below
- to "y". Whether you do or not a command called "OpenIntOut" will be added
- to Opus which can be used to open a new AppIcon at any time. "OpenIntOut"
- takes an optional argument which specifies the name of a different icon
- to use, without ".info" at the end.
-
- //---------------------------------------------------------------------------*/
- iconname = "DOpus5:Icons/IntelOutsideEmboss"
- initstart = y
- /*---------------------------------------------------------------------------*/
-
- options results
- options failat 11
- parse arg DOpusPort function source dest arguments
-
- If (function~='init' & function~="OpenIntOut") then exit
-
- Address value DOpusPort
-
- If ~Show('L','rexxsupport.library') then
- call addlib('rexxsupport.library',0,-30,0)
-
- /* add restart command (for restart after closing the icon) - quit after that if initstart off */
- if function = 'init' then do
- dopus command "OpenIntOut" program "IntelOutside" desc "'(Re)open IntelOutside AppIcon'" template "ICON/K"
- if left(Upper(initstart),1) ~= "Y" then exit
- end
-
-
- If (function="OpenIntOut" & arguments~="") then do
- iconname = arguments
- end
-
- /* Get unique name and open a port. */
- Call Forbid()
- i = 0
- myportname = "DOIntOutIcon."i
- Do i=0 While Show("P",myportname)
- myportname = "DOIntOutIcon."i
- End
- If ~openport(myportname) then do
- Call Permit()
- dopus request '"IntelOutSide Icon: Could not open message port" OK'
- Exit
- End
- Call Permit()
-
-
- /* See if there is any snapshot info in the icon's filecomment */
- address command "list >PIPE:"myportname" "iconname".info LFORMAT %c"
- if open(comfile,"PIPE:"myportname,"R") then do
- comment = readln(comfile)
- close(comfile)
- end
-
- If Word(comment,1) = "NudelSnap:" Then do
- comment = word(comment,2)
- comcom = index(comment,",")
- comx = left(comment,comcom-1)
- comy = right(comment,length(comment) - comcom)
- comment = "POS" comx comy
- End
- Else
- comment = ""
-
-
- /* add an icon */
- dopus addappicon myportname "''" 1 comment info snap close local icon iconname
- icon=result
-
-
- flag = 0
-
- /* loop around */
- do while flag = 0
- call waitpkt(myportname)
-
- packet=getpkt(myportname)
- arg0=getarg(packet,0)
- arg1=getarg(packet,1)
- arg2=getarg(packet,2)
- arg3=getarg(packet,3)
- arg4=getarg(packet,4)
-
- call reply(packet,0)
-
- if arg0 = 'close' then flag = 1
- if arg0 = 'removed' then flag = 2
- if (arg0 = 'info' | arg0 = 'doubleclick') then do
- dopus setappicon icon busy on
- dopus request '"IntelOutside for Directory Opus'|| '0a'x ||"by Leo 'Nudel' Davidson"||'" OK|Close'
- If RC = 0 then flag = 1
- dopus setappicon icon busy off
- end
- if arg0 = 'snapshot' then
- address command 'filenote 'iconname'.info "NudelSnap:' arg2'"'
- if arg0 = 'unsnapshot' then
- address command 'filenote 'iconname'.info'
- end
-
- /* remove icon */
- if flag~=2 then dopus remappicon icon
-
- Call closeport(myportname)
-
- Exit
-