MCPcopy Create free account
hub / github.com/NetHack/NetHack / getlind

Function getlind

sys/amiga/winreq.c:818–982  ·  view source on GitHub ↗

and with default */

Source from the content-addressed store, hash-verified

816
817/* and with default */
818void
819getlind(const char *prompt, char *bufp, const char *dflt)
820{
821#ifndef TOPL_GETLINE
822 struct Window *cwin;
823 struct IntuiMessage *imsg;
824 long class, code, qual;
825 int aredone = 0;
826 struct Gadget *gd;
827 static int once;
828
829 *StrString = 0;
830 if (dflt)
831 strcpy(StrString, dflt);
832 StrWindow.Title = (UBYTE *) prompt;
833 StrWindow.Screen = HackScreen;
834
835 if (!once) {
836 if (bigscreen) {
837 StrWindow.LeftEdge =
838 (HackScreen->Width / 2) - (StrWindow.Width / 2);
839 if (amii_wins[WIN_MAP]) {
840 StrWindow.TopEdge = amii_wins[WIN_MAP]->win->TopEdge;
841 } else {
842 StrWindow.TopEdge =
843 (HackScreen->Height / 2) - (StrWindow.Height / 2);
844 }
845 }
846 SetBorder(&String);
847 SetBorder(&Gadget2);
848 once = 1;
849 }
850
851 if (WINVERS_AMIV || WINVERS_AMII) {
852#ifdef INTUI_NEW_LOOK
853 StrWindow.Extension = wintags;
854 StrWindow.Flags |= WFLG_NW_EXTENDED;
855 fillhook.h_Entry = (void *) &LayerFillHook;
856 fillhook.h_Data = (void *) -2;
857 fillhook.h_SubEntry = 0;
858#endif
859 }
860
861 if ((cwin = OpenWindow((void *) &StrWindow)) == NULL) {
862 return;
863 }
864
865 while (!aredone) {
866 WaitPort(cwin->UserPort);
867 while ((imsg = (void *) GetMsg(cwin->UserPort)) != NULL) {
868 class = imsg->Class;
869 code = imsg->Code;
870 qual = imsg->Qualifier;
871 gd = (struct Gadget *) imsg->IAddress;
872
873 switch (class) {
874 case VANILLAKEY:
875 if (code == '\033'

Callers 2

saveDiskPromptFunction · 0.85
amii_getlinFunction · 0.85

Calls 8

SetBorderFunction · 0.85
amii_clear_nhwindowFunction · 0.85
amii_putstrFunction · 0.85
cursor_onFunction · 0.85
WindowGetcharFunction · 0.85
cursor_offFunction · 0.85
amii_cursFunction · 0.85
amii_addtoplFunction · 0.85

Tested by

no test coverage detected