[comp.sys.amiga] EXPOSE

john13@garfield.UUCP (04/21/87)

[]
Although I don't like to use the mouse if the keyboard will do just as well
(since it can easily break your train of thought) one of the things I do
use it for frequently is flipping between screens, and dragging them up
and down. However, just about every programmer starts his window up against
the top border - you may have to re-size then move several different windows
on several different screens before *all* the screen drag bars and *all* the
screen depth-arrangers are free.

Just say "expose" and it will do all this for you. Windows up against the
top border are sent a message saying "move down a pixel". If they happen to
be already as high as the screen, they are first sent a message saying
"get a bit smaller".

Note: I have not found anything that objects to this, although I'm sure that
      there are such programs. Be careful using it if you aren't familiar
      with the characteristics of the windows currently open. It's conceivable
      that a screen-size, non-resizable window could crash the system when
      moved (the Workbench backdrop window does not crash).

I did get some weird effects while experimenting. If I used Forbid() and 
Permit() it would work *once*, then not again until a re-boot. Instead a 
Delay() is used for 1/3 second every time it sends an IntuiMessage so that 
Intuition gets a chance to hear about it. There was also the Guru which showed 
up in two places, the usual black and red on top, and inverted Workbench 
colours down below, shifted to the left with wraparound. And the disabled
machine you get when you set IntuitionBase->FirstScreen to NULL (just to see
what would happen), although you can still move the mouse around you can't
"touch" anything.

John Russell               john13@garfield.mun.cdn
5 Alderdice Place          john13@garfield.UUCP
St. John's, NF (Canada)
A1B 2P8
(709) 726-7847

-----Cut Here-----Cut Here-----Cut Here-----Cut Here-----
#!/bin/sh
# shar:	Shell Archiver
#	Run the following text with /bin/sh to create:
#	expose.c
#	expose.uue
echo shar: extracting expose.c
sed 's/^X//' << 'END_OF_FILE' > expose.c
X/*
X *  This program will attempt to let you at the screen depth arrangment
X *  gadgets. All windows that are tight to the top border will be moved
X *  down by one pixel, and resized if necessary (ie they are as high as
X *  the screen). After running it, you can also access the screen drag
X *  bars.
X *
X *  Does anyone else hate having to fiddle with the initial CLI window
X *  and the VT100 window to get at those $@$@#$@ gadgets???
X *
X *  ((c)) 1987, John Russell
X *  Unlimited distribution; donations to starving programmers always welcome.
X */
X
Xchar *copyright = "((c)) 1987, John Russell"; /* never thought of that before */
Xchar *address = "5 Alderdice Place";
Xchar *city = "St. John's, Newfoundland, Canada";
Xchar *postal_code = "A1B 2P8";
Xchar *phone = "(709) 726-7847";
X
X#include "intuition/intuition.h"
X
Xstruct IntuitionBase *IntuitionBase;
X
Xmain(argc, argv)
Xint argc;
Xchar *argv[];
X{
X    struct Screen *Screen;
X    struct Window *Window;
X
X    if ((IntuitionBase=(struct IntuitionBase *)OpenLibrary("intuition.library"))==NULL) {
X        exit(0);
X    }
X
X    /* enclosing this section in a forbid/permit loop seems to prevent it
X       from functioning, since it talks to Intuition */
X
X    Screen=IntuitionBase->FirstScreen;
X    while(Screen != NULL) {
X
X        Window=Screen->FirstWindow;
X
X        while(Window != NULL) {
X
X            if (Window->TopEdge == 0) {   /* NOT "== screen->topedge" */
X
X                if (Window->Height == Screen->Height) {
X                    SizeWindow(Window,0,-1); /* need to squeeze a bit */
X                    Delay(10); /* allow time for Intuition to hear */
X                }
X                MoveWindow(Window,0,1); /* move down and expose gadgets */
X                Delay(10);  /* leave some time here too */
X            }
X            Window=Window->NextWindow;
X        }
X        Screen=Screen->NextScreen;
X    }
X
X    CloseLibrary(IntuitionBase);
X}
X
X
END_OF_FILE
echo 'Orignal Sum -> 08090     2'
echo -n 'Current Sum -> '
sum expose.c
echo shar: extracting expose.uue
sed 's/^X//' << 'END_OF_FILE' > expose.uue
Xbegin 600 expose
XM   #\P         #          (   &_    4P        /I   !OTZY   !
XM0"@H8RDI(#$Y.#<L($IO:&X@4G5S<V5L;   -2!!;&1E<F1I8V4@4&QA8V4 
XM4W0N($IO:&XG<RP@3F5W9F]U;F1L86YD+"!#86YA9&$  $$Q0B R4#@ *#<P
XM.2D@-S(V+3<X-#<  $Y5__A(>@"\3KH&-%A/*4" MDJ 9@A"ITZZ 0!83RQL
XM@+8K;@ \__Q*K?_\9P  ABQM__PK;@ $__A*K?_X9V@L;?_X-BX !DC#2H-F
XM4"QM__@V+@ *2,,L;?_\-"X #DC"MH)F'$AX__]"IR\M__A.N@8*3^\ #$AX
X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903RE @-9*@&<R*6R UH#B*6R UH#<
XM.7R  (#:.7R  8#F.7R  8#@)BR UN6#*T/__"QM__PG;@ ( *0O+("R0J=.
XMNOPN4$]"IV$H6$],WPQP3EU.=61O<RYL:6)R87)Y &UA=&AF9G N;&EB<F%R
XM>0 @ $Y5__Q"K?_\+RW__$ZZ /A83U*M__P,K0    K__&WH2JR &F<&+&R 
XM&DZ62JR RF<*+RR RDZZ ;I83TJL@,9G"B\L@,9.N@&J6$]*K("R9BXO+("F
XM+RR KDZZ <103R8L@*)2@^6#+P,O+("J3KH!L%!/+RT "$ZZ 3)83V 83KH!
XMEB\L@+).N@'&6$\@+0 (+FR NDYU3EU.=3 \?_]@!# O  X@;P $2AAF_%-(
XM(F\ "%- $-E7R/_\0B @+P $3G4@;P $( @B;P ($-EF_$YU(&\ !" (2AAF
XM_)' ( A3@$YU3.\#   $( @B+P ,8 (0V5?)__Q206 "0AA1R?_\3G5.50  
XM2.<.("@M  @@!'(&3KH 3$WL@-8D0-7.N+P     ;0RXO    !-N!$J29A(I
XM?     . SG#_3-\$<$Y=3G4V*@ $2,/&O   @ !F""\23KH +EA/0I)P &#<
XM2.<P #0!Q, F 4A#QL!(0T)#U(-(0,#!2$!"0-""3-\ #$YU(B\ !"QL@,).
XM[O_<(B\ !"QL@,).[O^"(B\ !"QL@,).[O\Z(B\ !"QL@,).[O]P+&R PD[N
XM_\I,[P &  0L;(#"3N[_XBQL@,).[O_$2.<!!$SO((  #"QL@+Y.KO^43-\@
XM@$YU3OH  B)O  0L;("^3N[^8DSO  , !"QL@+Y.[O\Z(F\ !"QL@+Y.[O[:
XM+&R OD[N_WPB;P $("\ ""QL@+Y.[O\N(&\ !"QL@+Y.[OZ,3OH  BQL@+XB
XM;P $("\ "$[N_=@B;P $+&R OD[N_H8@;P $+&R OD[N_H @;P $3.\  P (
XM+&R MD[N_U@@;P $3.\  P (+&R MD[N_N       ^P    !          ( 
XM       #\0    (              _(   /J    *     8    @    ,@  
XM %0   !<            (" @(" @(" @,# P,# @(" @(" @(" @(" @(" @
XM(""00$! 0$! 0$! 0$! 0$! # P,# P,# P,#$! 0$! 0$ )"0D)"0D! 0$!
XM 0$! 0$! 0$! 0$! 0$! 4! 0$! 0 H*"@H*"@(" @(" @(" @(" @(" @("
XM @("0$! 0"        /L    !0              !     @    ,    $   
XB      /Q     @             #\@   ^L        #\@@ 
X 
Xend
END_OF_FILE
echo 'Orignal Sum -> 32174     3'
echo -n 'Current Sum -> '
sum expose.uue
exit

john13@garfield.UUCP (04/22/87)

[]

It seems I made a typo in the source to EXPOSE. The call to OpenLibrary does
not specify INTUITION_REV, and as such it will work sometimes but not others.
If you called it several times in a row, it would always behave the same way,
which is why I was able to test it with multiple screens and windows, yet
this morning it didn't work.

Please either add the INTUITION_REV to the OpenLibrary call and recompile,
or wait till I post the better one (should be tomorrow). I want to make sure
I can get it to work with "odd" windows, as in DPaint. Currently it will
cause DPaint to "glitch" in several ways.

That's what I get for using lines that go off the end of the screen!

John