[comp.sources.amiga] v90i136: PopUpMenu 3.2 - make intuition menus into pop up menus, Part02/03

Amiga-Request@cs.odu.edu (Amiga Sources/Binaries Moderator) (04/14/90)

Submitted-by: d5adria@dtek.chalmers.se (Martin Adrian)
Posting-number: Volume 90, Issue 136
Archive-name: util/popupmenu-3.2/part02

#!/bin/sh
# This is a shell archive.  Remove anything before this line, then unpack
# it by saving it into a file and typing "sh file".  To overwrite existing
# files, type "sh file -c".  You can also feed this as standard input via
# unshar, or by typing "sh <file", e.g..  If this archive is complete, you
# will see the following message at the end:
#		"End of archive 2 (of 3)."
# Contents:  PopUpMenu.run.uu PopUpMenu.uu Source/Main.c
#   Source/PopUpMenu.c Source/Select.c
# Wrapped by tadguy@xanth on Fri Apr 13 19:45:18 1990
PATH=/bin:/usr/bin:/usr/ucb ; export PATH
if test -f 'PopUpMenu.run.uu' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'PopUpMenu.run.uu'\"
else
echo shar: Extracting \"'PopUpMenu.run.uu'\" \(10081 characters\)
sed "s/^X//" >'PopUpMenu.run.uu' <<'END_OF_FILE'
Xbegin 664 PopUpMenu.run
XM```#\P`````````#``````````(```:>````<$```"H```/I```&GDCG.#I)S
XM^0````!#^@"*<"$L>``$3J[]V"E``!A*@&<``&PF;@$4(CP```"4)#P```/M3
XM2JL`K&8>0>L`7$ZN_H!!ZP!<3J[^C"8`(CP```"B)#P```/N+&P`&$ZN_^(IB
XM0`&X+'@`!$J`9Q)"K`&\(DMP!4ZN_M1.N0```,!*JP"L9@I.KO]\(D-.KOZ&S
XM<`!,WUP<3G4J`&1O<RYL:6)R87)Y`$-/3CHQ,#`O-S4O-#`P+S0U+U!O<%5PM
XM365N=0```$Y5_[!(YS\Z2?D`````(BP!N$'Z!%`D"'84+&P`&$ZN_]!#^@14M
XM+'@`!$ZN_GHF0"`+9A1P`$'Z!$!.NA>D)D`@"V9R8``#X'``0?H$,DZZ%Y`K`
XM0/^T2H!G``/,<`!R`"!M_[1.NA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5```D5?``$``A"*@`.%48`#Y/)3J[^VB5``!`B2DZN_IX@"F`*<``0-
XM!DZN_K!P`$S?3,!.=4CG`!(F2")++'@`!$ZN_IAP`!`K``].KOZP(DMP(DZN/
XM_RY,WT@`3G5*4&<\2.<_(G``,"@``G(`,B@`!'@`."@`"GH`.B@`#'Q@?O^5"
XMRBQL`"!#Z``6(&P!5'0`=@!A"F$(809,WT3\3G5(Y\#`3J[_XDS?`P/!2<%"!
XMPT-.=0``2.<_-B9()$DJ0"`-9P``SC8J``0T*@`&/@,\`CH#.`)P`L!J``QGA
XM2MYM``3<;0`&2JT`"&<6($TL;``<3J[^MMI`(FT`"-AI``1@("!M``Q.NNWPI
XM0^P!4"!M``PL;``@3J[_RMI`."P!BMA&*FT`$&`2WE7<;0`"VFT`!-AM``8J4
XM;0`0MD=L`BX#OE-L`C:'UFH`"+9%;P(J`TJJ`!QG"EQ%2FP!3F8"6$6Z:P`$+
XM;P0W10`$M$9L`BP"O&L``FP$-T8``M1J``JT1&\"*`*X:P`&;P0W1``&8`#_X
XM,$S?;/Q.=0``4&]P57!-96YU```````#[`````,`````````>````$P````HM
XM````"0````$```@>```'N```!Z0```>:```'C@``!X(```=V````R@````8`F
XM```(`````@``$,8``!!>```1+```#78``!#R```-(@```YH```*R````````0
XM`_(```/K`````````_)```/J````*L``!@```\````_````YP```X<```__`C
XM`!^#\`#```8`@`0`X`'@`V`&8`_@//"`!'``,``0````$``P`'``/P`/``,`V
XM```#``\`/P#_YP```!<`"``!``````$``````/_P````#@`(``$````@`0``_
XM``````(````(``<``0```#X!`````````0````0`!P`!````,`$``````!$1Q
XM1$3_____```:;````^P````!`````````*0````$`````@```)(```!^````T
X-:@```%8````````#\NP`A
X``
Xend
Xsize 7168
END_OF_FILE
if test 10081 -ne `wc -c <'PopUpMenu.run.uu'`; then
    echo shar: \"'PopUpMenu.run.uu'\" unpacked with wrong size!
fi
# end of 'PopUpMenu.run.uu'
fi
if test -f 'PopUpMenu.uu' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'PopUpMenu.uu'\"
else
echo shar: Extracting \"'PopUpMenu.uu'\" \(10219 characters\)
sed "s/^X//" >'PopUpMenu.uu' <<'END_OF_FILE'
Xbegin 664 PopUpMenu
XM```#\P`````````$``````````,````\```&;@```'!````J```#Z0```#Q(W
XMYS@Z2?D`````0_H`NG`A+'@`!$ZN_=@I0``82H!G``"<)FX!%$JK`*QG0D7Z<
XM_\XF//____SD@R(\````Q"0\```#[2QL`!A.KO_B*4`!N$J`9V@I4@&\0I(BW
XM.0```*1T!2@\```'T$ZN_W9@3D'K`%Q.KOZ`0>L`7$ZN_HPF`"(\````TB0\V
XM```#[BQL`!A.KO_B*4`!N"QX``1*@&<20JP!O")+<`5.KO[43KD`````3J[_H
XM?")#3J[^AG``3-]<'$YU*@!D;W,N;&EB<F%R>0!#3TXZ,3`P+S<U+S0P,"\TV
XM-2]0;W!5<$UE;G4```````/L`````@````````""````.@````(````!````=
XMK@```#(````!`````@````8````!`````P```%P````````#\@```^D```9N>
XM3E7_L$CG/SI)^0`````B+`&X0?H$4"0(=A0L;``83J[_T$/Z!%0L>``$3J[^Z
XM>B9`(`MF%'``0?H$0$ZZ%Z0F0"`+9G)@``/@<`!!^@0R3KH7D"M`_[1*@&<`"
XM`\QP`'(`(&W_M$ZZ%-HK0/^P2H!G.B!+(D`L>``$3J[^DB!M_[1.KOZ`(&W_S
XMM$ZN_HQP`"!M_[`P*``2<A30@2)(3J[_+G`*0?H#X&$`!'@@;?^T3KH7F&``&
XM`W)#^@/6<"$L>``$3J[]V"E``!Q*@&<``U1#^@/0<"%.KOW8*4``($J`9P`#1
XM-$/Z`\YP(4ZN_=@I0``D2H!G``,4</].KOZV+@!P_[Z`9P`"^$ZN_K8L`'#_?
XMO(!G``+@3J[^MBH`</^Z@&<``LA.KOZV*T#_N%*`9P`"L'``0?H#CDZZ%J@D<
XM0"`*9P`"DG`P(CP``0`!+'@`!$ZN_SHI0`$X2H!G``)R($`1?``%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Q.KOZVVD`B;0`(V&D`!&`@(&T`#$ZZ[?!#[`%0(&T`4
XM#"QL`"!.KO_*VD`X+`&*V$8J;0`08!+>5=QM``+:;0`$V&T`!BIM`!"V1VP"O
XM+@.^4VP"-H?6:@`(MD5O`BH#2JH`'&<*7$5*;`%.9@)81;IK``1O!#=%``2T*
XM1FP"+`*\:P`";`0W1@`"U&H`"K1$;P(H`KAK``9O!#=$``9@`/\P3-]L_$YU7
XM``!0;W!5<$UE;G4```````/L````"`````(```=>```&^```!N0```;:```&U
XMS@``!L(```:V````"@````@````#```0!@``#YX``!!L```,M@``$#(```QB8
XM```"V@```?(````````#\@```^L````````#\D```^H````JP``&```#P```'
XM#\```#G```#AP``#_\``'X/P`,``!@"`!`#@`>`#8`9@#^`\\(`$<``P`!``@
XM```0`#``<``_``\``P````,`#P`_`/_G````%P`(``$``````0``````__``(
XM```.``@``0```"`!`````````@````@`!P`!````/@$````````!````!``'5
XM``$````P`0``````$1%$1/____\``!FL```#[`````$````!````I`````0`V
X;```#````D@```'X```!J````5@````````/R(
X``
Xend
Xsize 7272
END_OF_FILE
if test 10219 -ne `wc -c <'PopUpMenu.uu'`; then
    echo shar: \"'PopUpMenu.uu'\" unpacked with wrong size!
fi
# end of 'PopUpMenu.uu'
fi
if test -f 'Source/Main.c' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'Source/Main.c'\"
else
echo shar: Extracting \"'Source/Main.c'\" \(11166 characters\)
sed "s/^X//" >'Source/Main.c' <<'END_OF_FILE'
X#include "PopUpMenu.h"
X#include "Version.h"
X
X#define REPLYPORTNAME  "Reply"
X#define IMPDEVPORTNAME "ImpDev"
X#define TIMERPORTNAME  "Timer"
X#define QUITPORTNAME   "Quit"
X#define INPHANDLNAME   PopUpTaskName
X#define SEMAPHORENAME  PopUpTaskName
X
X#define POPUPMSG       "\x9B0;33mPopUpMenu\x9B0m "
X#define KILLMSG        "removed.\n"
X#define STARTMSG       "installed.\n\xA9 Martin Adrian 1990\n"
X#define FAILMSG        "failed.\n"
X#define DELAYTIME      150
X
X#define INPHANDLPRI    53
X/* Must use kickstart 1.2 or higher */
X#define LIBVERSION     33
X
X/* don't know how to find these in C */
X#define LVOSetMenuStrip   -0x108
X#define LVOClearMenuStrip -0x36
X#define LVOOnMenu	  -0xc0
X#define LVOOffMenu	  -0xb4
X
X/* this is for errors in proto/exec.h */
X#undef RemSemaphore
X#pragma syscall RemSemaphore 25e 901
X
Xextern VOID InitPopUpMenu(VOID);
Xextern VOID MySetMenuStrip();
Xextern VOID MyClearMenuStrip();
Xextern VOID MyOnMenu();
Xextern VOID MyOffMenu();
X
XVOID InitPopUpMenu()
X{
X
X  IMPORT struct DosLibrary     *DosBase;
X  IMPORT struct IntuitionBase  *IntuitionBase;
X  IMPORT struct GfxBase        *GfxBase;
X  IMPORT struct LayersBase     *LayersBase;
X
X  IMPORT struct IOStdReq       *InputReqBlock;
X  IMPORT struct timerequest    *TimerReqBlock;
X  IMPORT struct SignalSemaphore PopUpSemaphore;
X  IMPORT __fptr OldSetMenuStrip, OldClearMenuStrip, OldOnMenu, OldOffMenu;
X  IMPORT BPTR StdOut;
X  IMPORT BPTR PopUpSeg;
X
X  IMPORT STRPTR far PopUpTaskName; /* Pointer to the string "PopUpMenu" */
X
X  struct MsgPort      *ReplyPort;
X  struct MsgPort      *InputDevPort;
X  struct MsgPort      *TimerPort;
X  struct Interrupt    InputReqData;
X  struct SignalData   InputSignals;
X  LONG		      MenuUpSigNum, MenuDownSigNum;
X  LONG		      MouseMovedSigNum, SelectDownSigNum;
X
X  geta4();   /* load global database */
X
X  Write(StdOut,POPUPMSG,sizeof(POPUPMSG));
X
X  /***********************************
X   * see if we are already installed *
X   ***********************************/
X  if (!(ReplyPort = FindPort(REPLYPORTNAME))) {
X    if (!(ReplyPort = CreatePort(REPLYPORTNAME,0)))
X      goto CleanUp13;
X  }
X  else {
X    /* yes, popupmenues already installed, tell running task to quit */
X    struct MsgPort *const QuitPort = CreatePort(QUITPORTNAME,0);
X    struct IntuiMessage *Message;
X
X    if (QuitPort) {
X      if (Message = BuildIntuiMsg(QuitPort,QUITPOPUPMENU,NULL)) {
X	/* Send quitmessage */
X	PutMsg(ReplyPort, (struct Message *)Message);
X	/* Wait for reply */
X	WaitPort(QuitPort);
X	/* get rid of the message */
X	GetMsg(QuitPort);
X	FreeMem(Message,(LONG)Message->ExecMessage.mn_Length +
X				sizeof(struct Message));
X
X	WriteAndClose(KILLMSG, sizeof(KILLMSG));
X      }
X      DeletePort(QuitPort);
X    }
X    goto CleanUp13;
X  }
X
X  /******************
X   * open libraries *
X   ******************/
X  if (!(IntuitionBase = (struct IntuitionBase *)
X			OpenLibrary("intuition.library", LIBVERSION)))
X    goto CleanUp12;
X  if (!(GfxBase       = (struct GfxBase *)
X			OpenLibrary("graphics.library", LIBVERSION)))
X    goto CleanUp11;
X  if (!(LayersBase    = (struct LayersBase *)
X			OpenLibrary("layers.library", LIBVERSION)))
X    goto CleanUp10;
X
X  /************************
X   * Allocate our signals *
X   ************************/
X  if ((MenuUpSigNum     = AllocSignal(-1)) == -1)
X    goto CleanUp9;
X  if ((MenuDownSigNum   = AllocSignal(-1)) == -1)
X    goto CleanUp8;
X  if ((MouseMovedSigNum = AllocSignal(-1)) == -1)
X    goto CleanUp7;
X  if ((SelectDownSigNum = AllocSignal(-1)) == -1)
X    goto CleanUp6;
X
X /****************************************
X  * Build connection to the input.device *
X  ****************************************/
X  if (!(InputDevPort  = CreatePort(IMPDEVPORTNAME,0)))
X    goto CleanUp5;
X  if ((InputReqBlock = (struct IOStdReq *)
X		       AllocMem(sizeof(struct IOStdReq),
X		       MEMF_CLEAR | MEMF_PUBLIC)) == NULL)
X    goto CleanUp4;
X
X  InputReqBlock->io_Message.mn_Node.ln_Type = NT_MESSAGE;
X  InputReqBlock->io_Message.mn_Length	    = sizeof(struct IOStdReq);
X  InputReqBlock->io_Message.mn_ReplyPort    = InputDevPort;
X
X  if (OpenDevice("input.device",0,(struct IORequest *)InputReqBlock,0))
X    goto CleanUp3;
X
X  /****************************************
X   * Bulid connection to the timer.device *
X   ****************************************/
X  if (!(TimerPort = CreatePort(TIMERPORTNAME,0)))
X    goto CleanUp3x3;
X  if (!(TimerReqBlock = (struct timerequest *)
X		       AllocMem(sizeof(struct timerequest),
X		       MEMF_CLEAR | MEMF_PUBLIC)))
X    goto CleanUp3x2;
X
X  TimerReqBlock->tr_node.io_Message.mn_Node.ln_Type = NT_MESSAGE;
X  TimerReqBlock->tr_node.io_Message.mn_Length	    = sizeof(struct timerequest);
X  TimerReqBlock->tr_node.io_Message.mn_ReplyPort    = TimerPort;
X
X  if (OpenDevice(TIMERNAME,UNIT_VBLANK,(struct IORequest *)TimerReqBlock,0))
X    goto CleanUp3x1;
X
X  /* Start Timer (just to be sure that at least one request is sent. */
X  /*		  CheckIO doesn't work otherwise, i think) */
X
X  QueueTimer();
X
X  /********************
X   * Make a semaphore *
X   ********************/
X  PopUpSemaphore.ss_Link.ln_Name = SEMAPHORENAME;
X  PopUpSemaphore.ss_Link.ln_Pri  = 0;
X  AddSemaphore(&PopUpSemaphore);
X
X  /**************************************************
X   * patch intuition functions to use our semaphore *
X   **************************************************/
X  if (!(OldSetMenuStrip = SetFunction((struct Library *)IntuitionBase,
X				      LVOSetMenuStrip,MySetMenuStrip)))
X    goto CleanUp2x4;
X  if (!(OldClearMenuStrip = SetFunction((struct Library *)IntuitionBase,
X					LVOClearMenuStrip,MyClearMenuStrip)))
X    goto CleanUp2x3;
X  if (!(OldOnMenu = SetFunction((struct Library *)IntuitionBase,
X				LVOOnMenu,MyOnMenu)))
X    goto CleanUp2x2;
X  if (!(OldOffMenu = SetFunction((struct Library *)IntuitionBase,
X				 LVOOffMenu,MyOffMenu)))
X    goto CleanUp2x1;
X
X  /**********************************
X   * init data for the inputhandler *
X   **********************************/
X  InputSignals.PopUpMenuTask = FindTask(0);
X  InputSignals.MenuUpSig     = 1L << MenuUpSigNum;
X  InputSignals.MenuDownSig   = 1L << MenuDownSigNum;
X  InputSignals.MouseMovedSig = 1L << MouseMovedSigNum;
X  InputSignals.SelectDownSig = 1L << SelectDownSigNum;
X  InputSignals.Down	     = FALSE;  /* menubutton is not down. (who cares) */
X
X  /****************************
X   * startup the inputhandler *
X   ****************************/
X  InputReqData.is_Node.ln_Pri  = INPHANDLPRI;	    /* must come before intuition */
X  InputReqData.is_Node.ln_Name = INPHANDLNAME;
X
X  InputReqData.is_Data	       = (APTR)&InputSignals;
X  InputReqData.is_Code	       = (VOID *)PopUpHandler;
X
X  InputReqBlock->io_Command = IND_ADDHANDLER;
X  InputReqBlock->io_Data    = (APTR)&InputReqData;
X
X  DoIO((struct IORequest *)InputReqBlock);
X
X  /***************************************
X   * tell the user that everything is ok *
X   ***************************************/
X  WriteAndClose(VERSION STARTMSG, sizeof(VERSION STARTMSG));
X
X  PopUpMainLoop(&InputSignals,ReplyPort);
X
XCleanUp1:
X
X  /* remove inputhandler */
X  InputReqBlock->io_Command = IND_REMHANDLER;
X  InputReqBlock->io_Data    = (APTR)&InputReqData;
X
X  DoIO((struct IORequest *)InputReqBlock);
X
X  /* restore intuition functions */
X  SetFunction((struct Library *)IntuitionBase,LVOOffMenu,OldOffMenu);
XCleanUp2x1:
X  SetFunction((struct Library *)IntuitionBase,LVOOnMenu,OldOnMenu);
XCleanUp2x2:
X  SetFunction((struct Library *)IntuitionBase,LVOClearMenuStrip,OldClearMenuStrip);
XCleanUp2x3:
X  SetFunction((struct Library *)IntuitionBase,LVOSetMenuStrip,OldSetMenuStrip);
XCleanUp2x4:
X
X  /* remove semaphore */
X  RemSemaphore(&PopUpSemaphore);
X
X  /* close timer.device */
X  CloseDevice((struct IORequest *)TimerReqBlock);
XCleanUp3x1:
X  FreeMem(TimerReqBlock,sizeof(struct timerequest));
XCleanUp3x2:
X  DeletePort(TimerPort);
XCleanUp3x3:
X
X  /* close input.device */
X  CloseDevice((struct IORequest *)InputReqBlock);
XCleanUp3:
X  DeleteStdIO(InputReqBlock);
XCleanUp4:
X  DeletePort(InputDevPort);
XCleanUp5:
X
X  /* Free allocated signals */
X  FreeSignal(SelectDownSigNum);
XCleanUp6:
X  FreeSignal(MouseMovedSigNum);
XCleanUp7:
X  FreeSignal(MenuDownSigNum);
XCleanUp8:
X  FreeSignal(MenuUpSigNum);
XCleanUp9:
X
X  /* close libraries */
X  CloseLibrary((struct Library *)LayersBase);
XCleanUp10:
X  CloseLibrary((struct Library *)GfxBase);
XCleanUp11:
X  CloseLibrary((struct Library *)IntuitionBase);
XCleanUp12:
X  DeletePort(ReplyPort);
XCleanUp13:
X  if (StdOut)
X    WriteAndClose(FAILMSG,sizeof(FAILMSG));
X  if (PopUpSeg) {
X    /* if loaded from CLI unload us */
X    Forbid();
X    UnLoadSeg(PopUpSeg);
X  }
X  CloseLibrary((struct Library *)DOSBase);
X}
X
X/***************************************
X * WriteAndClose(Text,Length)          *
X *				       *
X * Input:			       *
X *   Text   - Text to write to StdOut. *
X *   Length			       *
X ***************************************/
XVOID WriteAndClose(Text, Length)
X  STRPTR Text;
X  ULONG Length;
X{
X  IMPORT BPTR StdOut;
X
X  Write(StdOut,Text,Length);
X  Delay(DELAYTIME);
X  Close(StdOut);
X  StdOut = NULL;
X}
X
X/************************************************
X * PopUpMainLoop(InputSignals,ReplyPort)        *
X *						*
X * Input:					*
X *   InputSignals - Allocated signals.		*
X *   ReplyPort	  - Port for MENUVERIFY replies *
X * Output:					*
X *   none					*
X ************************************************/
XVOID PopUpMainLoop(InputSignals,ReplyPort)
X  struct SignalData *const InputSignals;
X  struct MsgPort *const ReplyPort;
X{
X  IMPORT struct Window	*ActiveWindow;
X  IMPORT struct Screen	*Screen;
X  IMPORT struct Menu	*Menues;
X
X  const LONGBITS ReplySig    = 1L << (LONG)ReplyPort->mp_SigBit;
X  const LONGBITS MenuUpSig   = InputSignals->MenuUpSig;
X  const LONGBITS MenuDownSig = InputSignals->MenuDownSig;
X  const LONGBITS AllSignals  = ReplySig | MenuUpSig | MenuDownSig;
X
X  WORD	NrOfMessages = 0;
X  BOOL	QuitPopUpMenu = FALSE;
X  BOOL	VerifyOK = FALSE;
X
X  FOREVER {
X    const LONGBITS SignalBits = Wait(AllSignals);
X
X    if (SignalBits & MenuUpSig) {
X      ActiveWindow = NULL;
X      VerifyOK	   = FALSE;
X    }
X
X    if (SignalBits & ReplySig) {
X      struct IntuiMessage *Message;
X
X      while (Message = (struct IntuiMessage *)GetMsg(ReplyPort)) {
X	if (Message->Class == MENUVERIFY) {
X	  if (Message->IDCMPWindow == ActiveWindow)
X	    VerifyOK = (Message->Code != MENUCANCEL);
X	  NrOfMessages--;
X	  FreeMem(Message,(LONG)Message->ExecMessage.mn_Length +
X			      sizeof(struct Message));
X	}
X	else { /* Message->Class == QUITPOPUPMENU or some strange message */
X	  ReplyMsg((struct Message *)Message); /* Message does not belong to this task */
X	  QuitPopUpMenu = TRUE;
X	}
X
X      } /* while */
X      if (NrOfMessages == 0) {
X	if (QuitPopUpMenu)
X	  break;
X	if (VerifyOK) {
X	  PopUpMenu(InputSignals);
X	  VerifyOK = FALSE;
X	}
X      }
X    }
X
X    if ((SignalBits & (MenuUpSig | MenuDownSig)) == MenuDownSig) {
X      const LONG  Lock = LockIBase(0);
X
X      if ((ActiveWindow = IntuitionBase->ActiveWindow) AND
X	 !(ActiveWindow->Flags & RMBTRAP) AND
X	 (ActiveWindow->MenuStrip)) {
X	Screen = ActiveWindow->WScreen;
X	UnlockIBase(Lock);
X	if ((NrOfMessages = SendMessage(ReplyPort)) == 0)
X	  PopUpMenu(InputSignals);
X	else
X	  VerifyOK = TRUE;
X      }
X      else
X	UnlockIBase(Lock);
X    }
X  } /* FOREVER */
X}
END_OF_FILE
if test 11166 -ne `wc -c <'Source/Main.c'`; then
    echo shar: \"'Source/Main.c'\" unpacked with wrong size!
fi
# end of 'Source/Main.c'
fi
if test -f 'Source/PopUpMenu.c' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'Source/PopUpMenu.c'\"
else
echo shar: Extracting \"'Source/PopUpMenu.c'\" \(6683 characters\)
sed "s/^X//" >'Source/PopUpMenu.c' <<'END_OF_FILE'
X#include "PopUpMenu.h"
X
X/****************************************
X * PopUpMenu(InputSignals)              *
X *					*
X * Input:				*
X *   InputSignals  - Allocated signals. *
X * Output:				*
X *   none				*
X ****************************************/
XVOID PopUpMenu(InputSignals)
X  struct SignalData *const InputSignals;
X{
X  IMPORT struct WindowData MenuWindow, ItemWindow, SubWindow;
X  IMPORT struct RastPort Rp;
X  IMPORT struct Window *ActiveWindow;
X  IMPORT struct Screen *Screen;
X  IMPORT struct Menu *Menues;
X  IMPORT UWORD	CurrentMenuNr;
X  IMPORT UWORD	MenuFontSize;
X  IMPORT WORD	MouseX,MouseY;
X  IMPORT struct SignalSemaphore PopUpSemaphore;
X  IMPORT struct timerequest  *TimerReqBlock;
X  IMPORT struct Window *LastWindow;
X  IMPORT WORDBITS LastSelected;
X  IMPORT struct IntuitionBase *IntuitionBase;
X
X  WORDBITS MenuNumber;
X
X  ObtainSemaphore(&PopUpSemaphore);
X
X  /* be sure that the window to use is still active */
X  if (IntuitionBase->ActiveWindow != ActiveWindow)
X    goto Abort;
X
X#ifndef NOLOCKING
X  LockLayers(&Screen->LayerInfo); /* puh! now we are safe (I hope) */
X#endif
X  InitGlobals();
X
X  /* try to open menues */
X  if ((Menues) AND
X      (OpenMenuWindow((ActiveWindow == LastWindow)?
X		       (UWORD)(MENUNUM(LastSelected)) * MenuFontSize: 0))) {
X
X    const LONGBITS MenuButtonSignals = InputSignals->MenuUpSig |
X				       InputSignals->MenuDownSig;
X    const LONGBITS MouseMovedSignal  = InputSignals->MouseMovedSig;
X    const LONGBITS ButtonSignals     = MenuButtonSignals |
X				       InputSignals->SelectDownSig;
X
X    BOOL Waiting = FALSE;
X    struct MsgPort *const TimerPort =
X			  TimerReqBlock->tr_node.io_Message.mn_ReplyPort;
X    const LONGBITS TimerSignal	     = 1L << TimerPort->mp_SigBit;
X
X    /* menuwindow opened ok */
X    MenuNumber = LastSelected = MENUNULL;
X
X    /* start timer */
X
X    SetSignal(0,TimerSignal); /* clear old timermessages */
X    if (CheckIO((struct IORequest *)TimerReqBlock) == NULL) {
X      WaitIO((struct IORequest *)TimerReqBlock);
X      GetMsg(TimerPort); /* get rid of the message */
X    }
X    QueueTimer();
X
X    FOREVER {
X      const LONGBITS SignalBits = Wait(MouseMovedSignal |
X				       ButtonSignals |
X				       TimerSignal);
X
X      if (SignalBits & MouseMovedSignal) {
X	Waiting = FALSE;
X	if ((MouseX != Screen->MouseX) OR (MouseY != Screen->MouseY)) {
X	  MouseX = Screen->MouseX;
X	  MouseY = Screen->MouseY;
X	  SelectItem();
X	}
X      }
X      if (SignalBits & ButtonSignals) {
X	const WORDBITS Selected = FinalSelect();
X
X	Waiting = FALSE;
X	/* do multiple select */
X	if (Selected != LastSelected) { /* same => do nothing */
X	  if (MenuNumber == MENUNULL)
X	    MenuNumber = Selected;   /* first selectiom */
X	  else
X	    (ItemAddress(Menues,(LONG)LastSelected))->NextSelect = Selected;
X	  LastSelected = Selected;
X	}
X
X	if (SignalBits & MenuButtonSignals) /* Menubutton -> final selection */
X	  break;
X      }
X
X      if (SignalBits & TimerSignal) {
X	GetMsg(TimerPort); /* get rid of the message */
X
X	if (Waiting) {
X
X	  /* the input.device has stopped, unlock the screen and wait */
X
X	  SwapBits(&SubWindow);
X	  SwapBits(&ItemWindow);
X	  SwapBits(&MenuWindow);
X
X#ifndef NOLOCKING
X	  UnlockLayers(&Screen->LayerInfo);
X#endif
X	  Wait(MouseMovedSignal);
X#ifndef NOLOCKING
X	  LockLayers(&Screen->LayerInfo); /* let's hope the screen is still here */
X#endif
X	  SwapBits(&MenuWindow);
X	  SwapBits(&ItemWindow);
X	  SwapBits(&SubWindow);
X	}
X
X	/* start timer again */
X	QueueTimer();
X	Waiting = !Waiting;
X      }
X    } /* FOREVER */
X
X    /* close all windows */
X    CloseItemWindow(&SubWindow);
X    CloseItemWindow(&ItemWindow);
X    CloseItemWindow(&MenuWindow);
X  }
X
X  /* remember last menu selected */
X  LastWindow = ActiveWindow;
X
X#ifndef NOLOCKING
X  UnlockLayers(&Screen->LayerInfo);
X#endif
X  /* tell the window the good news (MENUPICK) */
X  TellWindow(MenuNumber);
XAbort:
X  ReleaseSemaphore(&PopUpSemaphore);
X}
X
X/*****************************************
X *  TellWindow() - Send Fake Menu Event. *
X *					 *
X * Input:				 *
X *   none				 *
X * Output:				 *
X *   none				 *
X *****************************************/
XVOID TellWindow(MenuNumber)
X  WORDBITS MenuNumber;
X{
X  IMPORT struct Window	      *const ActiveWindow;
X  IMPORT struct IOStdReq      *const InputReqBlock;
X  IMPORT struct IntuitionBase *const IntuitionBase;
X
X  STATIC struct InputEvent MyFakeEvent;
X
X  /* get the current time */
X  CurrentTime(&MyFakeEvent.ie_TimeStamp.tv_secs,
X	      &MyFakeEvent.ie_TimeStamp.tv_micro);
X
X  MyFakeEvent.ie_Class	   = IECLASS_MENULIST;
X  MyFakeEvent.ie_Code	   = MenuNumber;
X  MyFakeEvent.ie_Qualifier = 0;
X  MyFakeEvent.ie_NextEvent = NULL;
X  MyFakeEvent.ie_EventAddress = NULL;
X
X  InputReqBlock->io_Command = IND_WRITEEVENT;
X  InputReqBlock->io_Flags   = 0;
X  InputReqBlock->io_Length  = sizeof(struct InputEvent);
X  InputReqBlock->io_Data    = (APTR)&MyFakeEvent;
X
X  /* be sure the right window will get the message. */
X  ActivateWindow(ActiveWindow);
X
X  DoIO(InputReqBlock);
X}
X/****************************************************
X * InitGlobals() - Init the needed global variables *
X *						    *
X * Input:					    *
X *   none					    *
X * Output:					    *
X *   none					    *
X ****************************************************/
XVOID InitGlobals()
X{
X  IMPORT struct WindowData MenuWindow, ItemWindow, SubWindow;
X  IMPORT UWORD	CurrentMenuNr;
X  IMPORT struct Menu	 *CurrentMenuPtr;
X  IMPORT struct MenuItem *CurrentItem, *CurrentSubItem;
X
X  IMPORT struct Screen	 *Screen;
X  IMPORT struct Menu	 *Menues;
X  IMPORT struct RastPort Rp;
X  IMPORT struct Window	 *const ActiveWindow;
X  IMPORT UWORD	MenuFontSize;
X  IMPORT BOOL	ScreenType;
X
X  /* no window is open */
X  ItemWindow.BitMapOk = FALSE;
X  SubWindow.BitMapOk = FALSE;
X  MenuWindow.BitMapOk = FALSE;
X
X  /* no menu is selected */
X  CurrentMenuNr  = 0;
X  CurrentMenuPtr = NULL;
X  CurrentItem	 = NULL;
X  CurrentSubItem = NULL;
X
X  Menues = ActiveWindow->MenuStrip;
X
X  /* set up a rastport for the screen */
X  InitRastPort(&Rp);
X
X  SetFont(&Rp,Screen->RastPort.Font);
X  Rp.BitMap = &Screen->BitMap;
X
X  /* default font height */
X  MenuFontSize = Rp.TxHeight + 2;
X
X  /* Size of screen */
X  ScreenType = (Screen->ViewPort.Modes & HIRES) == 0;
X}
X
X/******************************************************
X * QueueTimer() - Queue the timer to go of after 0.2s *
X *						      *
X * Input:					      *
X *   none					      *
X * Output:					      *
X *   none:					      *
X ******************************************************/
XVOID QueueTimer()
X{
X  IMPORT struct timerequest  *TimerReqBlock;
X
X  TimerReqBlock->tr_node.io_Command = TR_ADDREQUEST;
X  TimerReqBlock->tr_time.tv_secs    = 0;
X  TimerReqBlock->tr_time.tv_micro   = 200000L;
X  SendIO((struct IORequest *)TimerReqBlock);
X}
X
END_OF_FILE
if test 6683 -ne `wc -c <'Source/PopUpMenu.c'`; then
    echo shar: \"'Source/PopUpMenu.c'\" unpacked with wrong size!
fi
# end of 'Source/PopUpMenu.c'
fi
if test -f 'Source/Select.c' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'Source/Select.c'\"
else
echo shar: Extracting \"'Source/Select.c'\" \(5178 characters\)
sed "s/^X//" >'Source/Select.c' <<'END_OF_FILE'
X#include "PopUpMenu.h"
X
X/***************************************
X * SelectItem() - check mouseposition. *
X *				       *
X * Input:			       *
X *   none			       *
X * Output:			       *
X *   none			       *
X ***************************************/
XVOID SelectItem()
X{
X  IMPORT struct WindowData MenuWindow, ItemWindow, SubWindow;
X  IMPORT struct MenuItem *CurrentSubItem, *CurrentItem, *TempItem;
X  IMPORT struct Menu *CurrentMenuPtr;
X  IMPORT UWORD	CurrentMenuNr;
X  IMPORT const UWORD  MenuFontSize;
X  IMPORT const WORD   MouseY;
X  IMPORT struct RastPort Rp;
X
X  /********************
X   * Check subwindow. *
X   ********************/
X
X  if (SubWindow.BitMapOk) {
X    struct MenuItem *const NewSubItem = FindMouseItem(&SubWindow);
X
X    if (NewSubItem != CurrentSubItem) {
X      if (CurrentSubItem)
X	HighLightItem(CurrentSubItem,&SubWindow,HIGHLIGHTOFF);
X      else
X	if (TempItem) {
X	  CurrentItem = TempItem;
X	  TempItem = NULL;
X	  HighLightCurrItemBehind(HIGHLIGHTON);
X	}
X      if ((CurrentSubItem = NewSubItem) != NULL)
X	HighLightItem(NewSubItem,&SubWindow,HIGHLIGHTON);
X      else {
X	HighLightCurrItemBehind(HIGHLIGHTOFF);
X	TempItem = CurrentItem;
X	CurrentItem = NULL;
X      }
X    }
X    if (MouseInWindow(&SubWindow))
X      return;
X  }
X
X  /*********************
X   * Check itemwindow. *
X   *********************/
X
X  if (ItemWindow.BitMapOk) {
X    if (MouseInWindow(&ItemWindow)) {
X      struct MenuItem *const NewItem = FindMouseItem(&ItemWindow);
X
X      if (NewItem != CurrentItem) {
X	if (SubWindow.BitMapOk) {
X	  CloseItemWindow(&SubWindow);
X	  TempItem = NULL;
X	}
X	if (CurrentItem)
X	  HighLightItem(CurrentItem,&ItemWindow,HIGHLIGHTOFF);
X	if ((CurrentItem = NewItem) != NULL) {
X	  HighLightItem(NewItem,&ItemWindow,HIGHLIGHTON);
X	  if ((NewItem->Flags & ITEMENABLED) AND
X	     ((SubWindow.Items = NewItem->SubItem) != NULL))
X	    OpenItemWindow(&SubWindow,&ItemWindow,
X			   (WORD)(CurrentItem->TopEdge - ItemWindow.TopValue),
X			     SUBWINDOW);
X	}
X      }
X      return;
X    }
X    else /* mouse not in itemwindow */
X      if (CurrentItem) {
X	if (SubWindow.BitMapOk) {
X	  HighLightCurrItemBehind(HIGHLIGHTOFF);
X	  TempItem = CurrentItem;
X	}
X	else
X	  HighLightItem(CurrentItem,&ItemWindow,HIGHLIGHTOFF);
X	CurrentItem = NULL;
X      }
X  }
X
X  /*********************
X   * Check menuwindow. *
X   *********************/
X
X  if (MouseInWindow(&MenuWindow)) {
X    const UWORD NewMenuNr = (MouseY - MenuWindow.TopEdge - BORDERSIZE)/MenuFontSize + 1;
X
X    if (NewMenuNr != CurrentMenuNr) {
X      if (CurrentMenuNr) {
X	if (ItemWindow.BitMapOk) {
X	  CloseItemWindow(&SubWindow);
X	  CloseItemWindow(&ItemWindow);
X	  TempItem = NULL;
X	}
X	ToggleMenu(CurrentMenuNr,CurrentMenuPtr); /* HIGHLIGHTOFF */
X      }
X      if ((CurrentMenuPtr = FindMenuPtr(NewMenuNr)) == NULL)
X	CurrentMenuNr = 0;
X      else {
X	ToggleMenu(CurrentMenuNr = NewMenuNr,CurrentMenuPtr); /* HIGHLIGHTON */
X	if ((CurrentMenuPtr->Flags & MENUENABLED) AND
X	    ((ItemWindow.Items = CurrentMenuPtr->FirstItem) != NULL))
X	  OpenItemWindow(&ItemWindow,&MenuWindow,
X			 (WORD)((CurrentMenuNr - 1) * MenuFontSize + MenuWindow.TopEdge),
X			 ITEMWINDOW);
X      }
X    }
X  }
X  return;
X}
X
X/***************************************************
X * MouseInWindow(Window) - Is mouse inside window. *
X *						   *
X * Input:					   *
X *   Window    - Window to check.		   *
X * Output:					   *
X *   return    - TRUE if mouse inside.		   *
X ***************************************************/
XBOOL MouseInWindow(Window)
X  const struct WindowData *const Window;
X{
X  IMPORT const WORD  MouseX, MouseY;
X
X  return ((MouseX > Window->LeftEdge) AND
X	  (MouseX < Window->RightEdge) AND
X	  (MouseY > Window->TopEdge) AND
X	  (MouseY < Window->Bottom));
X}
X
X/****************************************************************
X * FindMouseItem(ItemWindow) - Check if mouse inside an item.   *
X *								*
X * Input:							*
X *   ItemWindow - Window with items				*
X * Output:							*
X *   return - Pointer to item under the mousepointer (or NULL). *
X ****************************************************************/
Xstruct MenuItem *FindMouseItem(ItemWindow)
X  const struct WindowData *const ItemWindow;
X{
X  IMPORT const WORD  MouseX,MouseY;
X
X  const WORD MouseWinX = MouseX + ItemWindow->LeftValue;
X  const WORD MouseWinY = MouseY + ItemWindow->TopValue;
X
X  struct MenuItem *Item = ItemWindow->Items;
X
X  do
X    if ((MouseWinY >= Item->TopEdge) AND
X	(MouseWinY <= Item->TopEdge + Item->Height) AND
X	(MouseWinX >= Item->LeftEdge) AND
X	(MouseWinX <= Item->LeftEdge + Item->Width))
X      return (Item);
X  while ((Item = Item->NextItem) != NULL);
X  return (NULL);
X}
X
X/*********************************************************
X * HighLightCurrItemBehind(Mode) - Highlight currentitem *
X *				   behind subwindow.	 *
X * Input:						 *
X *   Mode  - HIGHLIGHTON or HIGHLIGHTOFF.		 *
X * Output:						 *
X *   none						 *
X *********************************************************/
XVOID HighLightCurrItemBehind(Mode)
X  UWORD const Mode;
X{
X  IMPORT struct WindowData ItemWindow,SubWindow;
X  IMPORT struct RastPort Rp;
X  IMPORT struct MenuItem *const CurrentItem;
X
X  SwapBits(&SubWindow);
X    HighLightItem(CurrentItem,&ItemWindow,Mode);
X  SwapBits(&SubWindow);
X}
X
X
X
END_OF_FILE
if test 5178 -ne `wc -c <'Source/Select.c'`; then
    echo shar: \"'Source/Select.c'\" unpacked with wrong size!
fi
# end of 'Source/Select.c'
fi
echo shar: End of archive 2 \(of 3\).
cp /dev/null ark2isdone
MISSING=""
for I in 1 2 3 ; do
    if test ! -f ark${I}isdone ; then
	MISSING="${MISSING} ${I}"
    fi
done
if test "${MISSING}" = "" ; then
    echo You have unpacked all 3 archives.
    rm -f ark[1-9]isdone
else
    echo You still need to unpack the following archives:
    echo "        " ${MISSING}
fi
##  End of shell archive.
exit 0
-- 
Mail submissions (sources or binaries) to <amiga@cs.odu.edu>.
Mail comments to the moderator at <amiga-request@cs.odu.edu>.
Post requests for sources, and general discussion to comp.sys.amiga.