示例#1
0
int
AutoGetMaxListPosition(
        Widget widget )
{
    int widget_class_code, n;
    int visible_count, item_count;
    char msg_string[125];
    Arg	args[2];



    widget_class_code  = mvsGetClassCode(widget);

    switch (widget_class_code) {
	case mvsXmTextWidgetClass:	break;
	case mvsXmListWidgetClass:	n = 0;
					XtSetArg(args[n], XmNvisibleItemCount, 
						 &visible_count);	n++;
					XtSetArg(args[n], XmNitemCount, 
						 &item_count);	n++;
					XtGetValues(widget, args, n);
					if (item_count < visible_count)
						return(item_count - 1);
					else
						return(visible_count - 1);
	default:			AutoMessage(_AutoMessages[SCRMSG1]);
					return(0);
    }
}
示例#2
0
void
AutoMoveMaxOrMinText(
        Widget widget,
        int location )
{
    int widget_class_code, n;
    XisObjectRecord   *object;
    char msg_string[125];
    Arg	args[5];
    int x, y, width, height, move_x, move_y;
    Dimension shadow, border, highlight, margin_width, margin_height;

    xisProcessObjects();
    xisUpdateObjectAttributes();

    

    widget_class_code  = mvsGetClassCode(widget);
    if (widget_class_code != mvsXmTextWidgetClass &&
	widget_class_code != mvsXmTextFieldWidgetClass) {
	AutoMessage(_AutoMessages[SCRMSG1]);
	return;
    }

    object = xisFindObjectFromWidget(widget);

    x = object->x;
    y = object->y;
    width = object->width;
    height = object->height;

    n = 0;
    XtSetArg(args[n], XmNshadowThickness, &shadow);		n++;
    XtSetArg(args[n], XmNborderWidth, &border);			n++;
    XtSetArg(args[n], XmNhighlightThickness, &highlight);	n++;
    XtSetArg(args[n], XmNmarginWidth, &margin_width);		n++;
    XtSetArg(args[n], XmNmarginHeight, &margin_height);		n++;
    XtGetValues(widget, args, n);

    if (location == AUTOMAX) {
    	move_x = (x + width) 
			- (shadow + border + highlight + margin_width) - 1;
    	move_y = (y + height) 
			- (shadow + border + highlight + margin_height) - 1;
    }
    else {
	move_x = x + (shadow + border + highlight + margin_width + 1);
	move_y = y + (shadow + border + highlight + margin_height + 1);
    }

    AutoProcessAllEvents();
    AutoLocatePointerAbs(move_x, move_y);

}
示例#3
0
void xisRestorePointer()
{
    static char routine_name[] = "xisRestorePointer";

    xisUseSessionInfo(routine_name);

    if (!xisPointerSaved)
        AutoMessage(_AutoMessages[SCRMSG40]);
    else {
        xisMovePointer(xisSavePointerX,xisSavePointerY);

        if (!xisIsMapped(xisSaveFocusWindow))
            xisSaveFocusWindow = xisRootWindow;

        XSetInputFocus(xisDisplay,xisSaveFocusWindow,xisSaveFocusRevert,CurrentTime);
    }

} /* End xisRestorePointer() */
示例#4
0
void
AutoSystem(
        char *command_name,
        char **command_args )
{
	pid_t	chl_pid;
	char	msg_string[125];

#ifdef PORT_NOVFORK
	chl_pid = fork();
#else
	chl_pid = vfork();
#endif
	if (chl_pid == -1)
		AutoError(_AutoMessages[WARNMSG1]);
	else 
	{
		if (!(chl_pid))
		{ /* 0 return is child process image */
#ifdef DEBUG
			printf("[child]: id=%ld\n", (long)getpid());
#endif
			if (execvp(command_name, command_args) == -1) {
				sprintf(msg_string, _AutoMessages[WARNMSG122], errno);
				  
				AutoMessage(msg_string);
				exit(1);
			}
		}
		else
		{ /* pid return is parent process image (pid is child's pid) */
#ifdef DEBUG
			printf("[parent]: child's id=%ld\n", (long)chl_pid);
#endif
			waitpid(chl_pid, NULL, 0);
#ifdef DEBUG
			printf("[parent]: after wait\n");
#endif
		}
	}
}
示例#5
0
void
AutoDragRelative(
        int location,
        int XCoord,
        int YCoord,
        int mask,
        int XButton )
{
    int		x, y;
    Boolean	invalid = False;

    switch(location) {
	case UP:	y = -XCoord;
			x = 0;
			break;
	case DOWN:	y = XCoord;
			x = 0;
			break;
	case LEFT:	y = 0;
			x = -XCoord;
			break;
	case RIGHT:	y = 0;
			x = XCoord;
			break;
	case ANY:	x = XCoord;
			y = YCoord;
			break;
	case OFF:
	default:	invalid = True;
			AutoMessage(_AutoMessages[SCRMSG2]);
			break;
    }
		
    if (!invalid) {
	xisPressMouseButton(mask, XButton);
	xisMovePointerRelative(x, y);
	xisReleaseMouseButton(mask, XButton);
    }

}
示例#6
0
void InterpretCommand(MenuInstanceData * pMenuData, const char *pszScript) {
  char szCmd[31], szParam1[51], szParam2[51];
  char szTempScript[ 255 ];
  memset(szTempScript, 0, sizeof(szTempScript));
  strncpy(szTempScript, pszScript, 250);

  if (pszScript[0] == 0) {
    return;
  }

  char* pszScriptPointer = szTempScript;
  while (pszScriptPointer && !hangup) {
    pszScriptPointer = MenuParseLine(pszScriptPointer, szCmd, szParam1, szParam2);

    if (szCmd[0] == 0) {    // || !pszScriptPointer || !*pszScriptPointer
      break;
    }

    // -------------------------
    // Run a new menu instance

    int nCmdID = GetMenuIndex(szCmd);
    switch (nCmdID) {
    case 0: {
      // "MENU"
      // Spawn a new menu
      MenuInstanceData *pNewMenuData = static_cast<MenuInstanceData *>(malloc(sizeof(MenuInstanceData)));

      memset(pNewMenuData, 0, sizeof(MenuInstanceData));
      pNewMenuData->nFinished = 0;
      pNewMenuData->nReload = 0;

      Menus(pNewMenuData, pMenuData->szPath, szParam1);
      free(pNewMenuData);
    }
    break;
    case 1: {
      // -------------------------
      // Exit out of this instance
      // of the menu
      // -------------------------
      // "ReturnFromMenu"
      InterpretCommand(pMenuData, pMenuData->header.szExitScript);
      pMenuData->nFinished = 1;
    }
    break;
    case 2: {
      // "EditMenuSet"
      EditMenus();           // flag if we are editing this menu
      pMenuData->nFinished = 1;
      pMenuData->nReload = 1;
    }
    break;
    case 3: {
      // "DLFreeFile"
      align(szParam2);
      MenuDownload(szParam1, szParam2, true, true);
    }
    break;
    case 4: {
      // "DLFile"
      align(szParam2);
      MenuDownload(szParam1, szParam2, false, true);
    }
    break;
    case 5: {
      // "RunDoor"
      MenuRunDoorName(szParam1, false);
    }
    break;
    case 6: {
      // "RunDoorFree"
      MenuRunDoorName(szParam1, true);
    }
    break;
    case 7: {
      // "RunDoorNumber"
      int nTemp = atoi(szParam1);
      MenuRunDoorNumber(nTemp, false);
    }
    break;
    case 8: {
      // "RunDoorNumberFree"
      int nTemp = atoi(szParam1);
      MenuRunDoorNumber(nTemp, true);
    }
    break;
    case 9: {
      // "PrintFile"
      printfile(szParam1, true);
    }
    break;
    case 10: {
      // "PrintFileNA"
      printfile(szParam1, false);
    }
    break;
    case 11: {
      // "SetSubNumber"
      SetSubNumber(szParam1);
    }
    break;
    case 12: {
      // "SetDirNumber"
      SetDirNumber(szParam1);
    }
    break;
    case 13: {
      // "SetMsgConf"
      SetMsgConf(szParam1[0]);
    }
    break;
    case 14: {
      // "SetDirConf"
      SetDirConf(szParam1[0]);
    }
    break;
    case 15: {
      // "EnableConf"
      EnableConf();
    }
    break;
    case 16: {
      // "DisableConf"
      DisableConf();
    }
    break;
    case 17: {
      // "Pause"
      pausescr();
    }
    break;
    case 18: {
      // "ConfigUserMenuSet"
      ConfigUserMenuSet();
      pMenuData->nFinished = 1;
      pMenuData->nReload = 1;
    }
    break;
    case 19: {
      // "DisplayHelp"
      if (GetSession()->GetCurrentUser()->IsExpert()) {
        AMDisplayHelp(pMenuData);
      }
    }
    break;
    case 20: {
      // "SelectSub"
      ChangeSubNumber();
    }
    break;
    case 21: {
      // "SelectDir"
      ChangeDirNumber();
    }
    break;
    case 22: {
      // "SubList"
      SubList();
    }
    break;
    case 23: {
      // "UpSubConf"
      UpSubConf();
    }
    break;
    case 24: {
      // "DownSubConf"
      DownSubConf();
    }
    break;
    case 25: {
      // "UpSub"
      UpSub();
    }
    break;
    case 26: {
      // "DownSub"
      DownSub();
    }
    break;
    case 27: {
      // "ValidateUser"
      ValidateUser();
    }
    break;
    case 28: {
      // "Doors"
      Chains();
    }
    break;
    case 29: {
      // "TimeBank"
      TimeBank();
    }
    break;
    case 30: {
      // "AutoMessage"
      AutoMessage();
    }
    break;
    case 31: {
      // "BBSList"
      BBSList();
    }
    break;
    case 32: {
      // "RequestChat"
      RequestChat();
    }
    break;
    case 33: {
      // "Defaults"
      Defaults(pMenuData);
    }
    break;
    case 34: {
      // "SendEMail"
      SendEMail();
    }
    break;
    case 35: {
      // "Feedback"
      FeedBack();
    }
    break;
    case 36: {
      // "Bulletins"
      Bulletins();
    }
    break;
    case 37: {
      // "HopSub"
      HopSub();
    }
    break;
    case 38: {
      // "SystemInfo"
      SystemInfo();
    }
    break;
    case 39: {
      // "JumpSubConf"
      JumpSubConf();
    }
    break;
    case 40: {
      // "KillEMail"
      KillEMail();
    }
    break;
    case 41: {
      // "LastCallers"
      LastCallers();
    }
    break;
    case 42: {
      // "ReadEMail"
      ReadEMail();
    }
    break;
    case 43: {
      // "NewMessageScan"
      NewMessageScan();
    }
    break;
    case 44: {
      // "Goodbye"
      GoodBye();
    }
    break;
    case 45: {
      // "PostMessage"
      WWIV_PostMessage();
    }
    break;
    case 46: {
      // "NewMsgScanCurSub"
      ScanSub();
    }
    break;
    case 47: {
      // "RemovePost"
      RemovePost();
    }
    break;
    case 48: {
      // "TitleScan"
      TitleScan();
    }
    break;
    case 49: {
      // "ListUsers"
      ListUsers();
    }
    break;
    case 50: {
      // "Vote"
      Vote();
    }
    break;
    case 51: {
      // "ToggleExpert"
      ToggleExpert();
    }
    break;
    case 52: {
      // "YourInfo"
      YourInfo();
    }
    break;
    case 53: {
      // "ExpressScan"
      ExpressScan();
    }
    break;
    case 54: {
      // "WWIVVer"
      WWIVVersion();
    }
    break;
    case 55: {
      // "InstanceEdit"
      InstanceEdit();
    }
    break;
    case 56: {
      // "ConferenceEdit"
      JumpEdit();
    }
    break;
    case 57: {
      // "SubEdit"
      BoardEdit();
    }
    break;
    case 58: {
      // "ChainEdit"
      ChainEdit();
    }
    break;
    case 59: {
      // "ToggleAvailable"
      ToggleChat();
    }
    break;
    case 60: {
      // "ChangeUser"
      ChangeUser();
    }
    break;
    case 61: {
      // "CLOUT"
      CallOut();
    }
    break;
    case 62: {
      // "Debug"
      Debug();
    }
    break;
    case 63: {
      // "DirEdit"
      DirEdit();
    }
    break;
    case 65: {
      // "Edit"
      EditText();
    }
    break;
    case 66: {
      // "BulletinEdit"
      EditBulletins();
    }
    break;
    case 67: {
      // "LoadText"
      // LoadText and LoadTextFile are the same, so they are now merged.
      LoadTextFile();
    }
    break;
    case 68: {
      // "ReadAllMail"
      ReadAllMail();
    }
    break;
    case 69: {
      // "Reboot"
      RebootComputer();
    }
    break;
    case 70: {
      // "ReloadMenus"
      ReloadMenus();
    }
    break;
    case 71: {
      // "ResetUserIndex"
      ResetFiles();
    }
    break;
    case 72: {
      // "ResetQScan"
      ResetQscan();
    }
    break;
    case 73: {
      // "MemStat"
      MemoryStatus();
    }
    break;
    case 74: {
      // "PackMsgs"
      PackMessages();
    }
    break;
    case 75: {
      // "VoteEdit"
      InitVotes();
    }
    break;
    case 76: {
      // "Log"
      ReadLog();
    }
    break;
    case 77: {
      // "NetLog"
      ReadNetLog();
    }
    break;
    case 78: {
      // "Pending"
      PrintPending();
    }
    break;
    case 79: {
      // "Status"
      PrintStatus();
    }
    break;
    case 80: {
      // "TextEdit"
      TextEdit();
    }
    break;
    case 81: {
      // "UserEdit"
      UserEdit();
    }
    break;
    case 82: {
      // "VotePrint"
      VotePrint();
    }
    break;
    case 83: {
      // "YLog"
      YesturdaysLog();
    }
    break;
    case 84: {
      // "ZLog"
      ZLog();
    }
    break;
    case 85: {
      // "ViewNetDataLog"
      ViewNetDataLog();
    }
    break;
    case 86: {
      // "UploadPost"
      UploadPost();
    }
    break;
    case 87: {
      // "ClearScreen"
      GetSession()->bout.ClearScreen();
    }
    break;
    case 88: {
      // "NetListing"
      NetListing();
    }
    break;
    case 89: {
      // "WHO"
      WhoIsOnline();
    }
    break;
    case 90: {
      // /A "NewMsgsAllConfs"
      NewMsgsAllConfs();
    }
    break;
    case 91: {
      // /E "MultiEMail"
      MultiEmail();
    }
    break;
    case 92: {
      // "NewMsgScanFromHere"
      NewMsgScanFromHere();
    }
    break;
    case 93: {
      // "ValidatePosts"
      ValidateScan();
    }
    break;
    case 94: {
      // "ChatRoom"
      ChatRoom();
    }
    break;
    case 95: {
      // "DownloadPosts"
      DownloadPosts();
    }
    break;
    case 96: {
      // "DownloadFileList"
      DownloadFileList();
    }
    break;
    case 97: {
      // "ClearQScan"
      ClearQScan();
    }
    break;
    case 98: {
      // "FastGoodBye"
      FastGoodBye();
    }
    break;
    case 99: {
      // "NewFilesAllConfs"
      NewFilesAllConfs();
    }
    break;
    case 100: {
      // "ReadIDZ"
      ReadIDZ();
    }
    break;
    case 101: {
      // "UploadAllDirs"
      UploadAllDirs();
    }
    break;
    case 102: {
      // "UploadCurDir"
      UploadCurDir();
    }
    break;
    case 103: {
      // "RenameFiles"
      RenameFiles();
    }
    break;
    case 104: {
      // "MoveFiles"
      MoveFiles();
    }
    break;
    case 105: {
      // "SortDirs"
      SortDirs();
    }
    break;
    case 106: {
      // "ReverseSortDirs"
      ReverseSort();
    }
    break;
    case 107: {
      // "AllowEdit"
      AllowEdit();
    }
    break;
    case 109: {
      // "UploadFilesBBS"
      UploadFilesBBS();
    }
    break;
    case 110: {
      // "DirList"
      DirList();
    }
    break;
    case 111: {
      // "UpDirConf"
      UpDirConf();
    }
    break;
    case 112: {
      // "UpDir"
      UpDir();
    }
    break;
    case 113: {
      // "DownDirConf"
      DownDirConf();
    }
    break;
    case 114: {
      // "DownDir"
      DownDir();
    }
    break;
    case 115: {
      // "ListUsersDL"
      ListUsersDL();
    }
    break;
    case 116: {
      // "PrintDSZLog"
      PrintDSZLog();
    }
    break;
    case 117: {
      // "PrintDevices"
      PrintDevices();
    }
    break;
    case 118: {
      // "ViewArchive"
      ViewArchive();
    }
    break;
    case 119: {
      // "BatchMenu"
      BatchMenu();
    }
    break;
    case 120: {
      // "Download"
      Download();
    }
    break;
    case 121: {
      // "TempExtract"
      TempExtract();
    }
    break;
    case 122: {
      // "FindDescription"
      FindDescription();
    }
    break;
    case 123: {
      // "ArchiveMenu"
      TemporaryStuff();
    }
    break;
    case 124: {
      // "HopDir"
      HopDir();
    }
    break;
    case 125: {
      // "JumpDirConf"
      JumpDirConf();
    }
    break;
    case 126: {
      // "ListFiles"
      ListFiles();
    }
    break;
    case 127: {
      // "NewFileScan"
      NewFileScan();
    }
    break;
    case 128: {
      // "SetNewFileScanDate"
      SetNewFileScanDate();
    }
    break;
    case 129: {
      // "RemoveFiles"
      RemoveFiles();
    }
    break;
    case 130: {
      // "SearchAllFiles"
      SearchAllFiles();
    }
    break;
    case 131: {
      // "XferDefaults"
      XferDefaults();
    }
    break;
    case 132: {
      // "Upload"
      Upload();
    }
    break;
    case 133: {
      // "YourInfoDL"
      YourInfoDL();
    }
    break;
    case 134: {
      // "UploadToSysop"
      UploadToSysop();
    }
    break;
    case 135: {
      // "ReadAutoMessage"
      ReadAutoMessage();
    }
    break;
    case 136: {
      // "SetNewScanMsg"
      SetNewScanMsg();
    }
    break;
    case 137: {
      // "ReadMessages"
      ReadMessages();
    }
    break;
    /*
    case 138:
    { // "RUN"
    ExecuteBasic(szParam1);
    } break;
    */
    case 139: {
      // "EventEdit"
      EventEdit();
    }
    break;
    case 140: {
      // "LoadTextFile"
      LoadTextFile();
    }
    break;
    case 141: {
      // "GuestApply"
      GuestApply();
    }
    break;
    case 142: {
      // "ConfigFileList"
      ConfigFileList();
    }
    break;
    case 143: {
      // "ListAllColors"
      ListAllColors();
    }
    break;
#ifdef QUESTIONS
    case 144: {
      // "EditQuestions"
      EditQuestions();
    }
    break;
    case 145: {
      // "Questions"
      Questions();
    }
    break;
#endif
    case 146: {
      // "RemoveNotThere"
      RemoveNotThere();
    }
    break;
    case 147: {
      // "AttachFile"
      AttachFile();
    }
    break;
    case 148: {
      // "InternetEmail"
      InternetEmail();
    }
    break;
    case 149: {
      // "UnQScan"
      UnQScan();
    }
    break;
    // ppMenuStringsIndex[150] thru ppMenuStringsIndex[153] not used.....
    case 154: {
      // "Packers"
      Packers();
    }
    break;
    case 155: {
      // Color_Config
      color_config();
    }
    break;
    //------------------------------------------------------------------
    //  ppMenuStringsIndex[156] and [157] are reserved for SDS Systems and systems
    //  that distribute modifications.  DO NOT reuse these strings for
    //  other menu options.
    //------------------------------------------------------------------
    //    case 156:
    //    { // ModAccess
    //        ModsAccess();
    //    } break;
    //    case 157:
    //    { // SDSAccess
    //        SDSAccess();
    //      } break;
    //------------------------------------------------------------------
    case 158: {
      // InitVotes
      InitVotes();
    }
    break;
    case 161: {
      // TurnMCIOn
      TurnMCIOn();
    }
    break;
    case 162: {
      // TurnMCIOff
      TurnMCIOff();
    }
    break;
    default: {
      MenuSysopLog("The following command was not recognized");
      MenuSysopLog(szCmd);
    }
    break;
    }
  }
}
示例#7
0
void
AutoDragSliderValue(
        int location,
        int XCoord,
        int YCoord,
        int mask,
        int XButton )
{
    int 		x, y, widget_class_code, n;
    int			maximum, minimum, value;
    Boolean		invalid = False;
    XisObjectRecord 	*object;
    Widget		widget, tmp_widget;
    CompositeWidget 	cw;
    XmScrollBarWidget   sb_widget;
    Boolean		IsScale = False;
    Arg			args[5];
    short 		s_x1, s_y1, s_width1, s_height1;
    short 		s_x2, s_y2, s_width2, s_height2;
    short		change_x, change_y;
    int 		value1, value2, slider_size, slidersize;

    xisGetPointerLocation(&x,&y);
    object = xisFindObjectAtLocation(x, y);

    widget = (Widget) object->id.widget;
    if (widget == NULL)
	AutoError(_AutoMessages[SCRMSG18]);

    tmp_widget = XtParent(widget);
    widget_class_code  = mvsGetClassCode(tmp_widget);

    if (widget_class_code == mvsXmScaleWidgetClass) {
	widget = tmp_widget;
	IsScale = True;
    }

    widget_class_code  = mvsGetClassCode(widget);
    if (widget_class_code != mvsXmScaleWidgetClass)
	if (widget_class_code != mvsXmScrollBarWidgetClass) {
		AutoMessage(_AutoMessages[SCRMSG19]);
		return;
	}

    n = 0;
    XtSetArg(args[n], XmNvalue, &value);				n++;
    XtSetArg(args[n], XmNminimum, &minimum);				n++;
    XtSetArg(args[n], XmNmaximum, &maximum);				n++;
    XtSetArg(args[n], XmNsliderSize, &slidersize);		n++;
    XtGetValues(widget, args, n);

    if (! IsScale && XCoord == AUTOMAX)
	XCoord = maximum - slidersize;
    else
	if (! IsScale && XCoord != AUTOMIN)
		XCoord = (int) (((maximum - slidersize) * XCoord) / 100);

    if (XCoord == AUTOMAX && IsScale)
	XCoord = maximum;

    if (XCoord == AUTOMIN)
	XCoord = minimum;

    /* We know that the second composite child is the Scrollbar child */

    if (IsScale) {
    	cw = (CompositeWidget) widget;
    	sb_widget = (XmScrollBarWidget) cw->composite.children[SCROLLBAR_CHILD];

    	widget_class_code  = mvsGetClassCode((Widget) sb_widget);
    	if (widget_class_code != mvsXmScrollBarWidgetClass)
		AutoError(_AutoMessages[SCRMSG20]);
		     

    	CalcScrollBarData((XmScaleWidget)widget, value, &value1, &slider_size);
    	CalcScrollBarData((XmScaleWidget)widget, XCoord, &value2, &slider_size);

    	CalcSliderRect(sb_widget, &s_x1, &s_y1, &s_width1, &s_height1, value1);
    	CalcSliderRect(sb_widget, &s_x2, &s_y2, &s_width2, &s_height2, value2);
    }
    else {
	CalcSliderRect((XmScrollBarWidget)widget, &s_x1, &s_y1, 
			&s_width1, &s_height1, value);
    	CalcSliderRect((XmScrollBarWidget)widget, &s_x2, &s_y2, 
			&s_width2, &s_height2, XCoord);
    }

    change_x = abs(s_x2 - s_x1);
    change_y = abs(s_y2 - s_y1);

    switch(location) {
   	case DOWN:     	x = 0;
			y = change_y;
			break;
	case UP:	x = 0;
			y = -change_y;
			break;
	case RIGHT:     y = 0;
			x = change_x;
			break;
      	case LEFT:      y = 0;
			x = -change_x;
			break;
	default:        invalid = True;
			AutoMessage(_AutoMessages[SCRMSG3]);
			break;
    }

    if (!invalid) {
	xisPressMouseButton(mask, XButton);
	xisMovePointerRelative(x, y);
	xisReleaseMouseButton(mask, XButton);
    }

}
示例#8
0
void
AutoInputString(
        char *istring )
{
    int 	i;
    int 	code;
    Boolean 	AddShift, valid;
    int 	KeyStart = KEYA;
    int 	NumberStart = KEY0;
    char	msg_string[125];

    for (i = 1; istring[i] != '"'; i++) {
	AddShift = False;
	valid = False;
	/* Character in string is a number */
	if (isdigit(istring[i])) {
		code = (istring[i] - '0') + NumberStart;
		valid = True;
	}
	/* Character in string is a letter */
	if (isalpha(istring[i]))
		if (isupper(istring[i])) {
			AddShift = True;
			code = (tolower(istring[i]) - 'a') + KeyStart;
			valid = True;
		}
		else {
			code = (istring[i] - 'a') + KeyStart;
			valid = True;
		}
	/* Special Cases */
	if (istring[i] == '!') {
		code = KEYEXCLAM;
		valid = True;
	}
	if (istring[i] == '@') {
		code = KEYAT;
		valid = True;
	}
	if (istring[i] == '#') {
		code = KEYNUMBERSIGN;
		valid = True;
	}
	if (istring[i] == '$') {
		code = KEYDOLLAR;
		valid = True;
	}
	if (istring[i] == '%') {
		code = KEYPERCENT;
		valid = True;
	}
	if (istring[i] == '^') {
		code = KEYCARET;
		valid = True;
	}
	if (istring[i] == '&') {
		code = KEYAMPERSAND;
		valid = True;
	}
	if (istring[i] == '*') {
		code = KEYASTERISK;
		valid = True;
	}
	if (istring[i] == '(') {
		code = KEYPARENLEFT;
		valid = True;
	}
	if (istring[i] == ')') {
		code = KEYPARENRIGHT;
		valid = True;
	}
	if (istring[i] == '/') {
		code = KEYSLASH;
		valid = True;
	}
	if (istring[i] == '{') {
		code = KEYBRACKETLEFT;
		valid = True;
	}
	if (istring[i] == '}') {
		code = KEYBRACKETRIGHT;
		valid = True;
	}
	if (istring[i] == '[') {
		code = KEYBRACELEFT;
		valid = True;
	}
	if (istring[i] == ']') {
		code = KEYBRACERIGHT;
		valid = True;
	}
	if (istring[i] == ' ') {
		code = SPACE;
		valid = True;
	}
	if (istring[i] == '\\') {
		if (istring[i + 1] == 'n') {
			code = KEYRETURN;
			valid = True;
			i++;
		}
		else {
			if (istring[i + 1] == 't') {
				code = TAB;
				valid = True;
				i++;
			}
			else {
				code = KEYBACKSLASH;
				valid = True;
			}
		}
	}

	if (istring[i] == '\t') {
		code = TAB;
		valid = True;
	}
	if (istring[i] == '\n') {
		code = KEYRETURN;
		valid = True;
	}

	if (! valid) {
		sprintf(msg_string, _AutoMessages[SCRMSG38], istring[i]);
		AutoMessage(msg_string);
	}
	else
		if (AddShift)
			AutoProcessKey(code, ShiftMask, CLICKKEY);
		else
			AutoProcessKey(code, NoModifierKeys, CLICKKEY);
    }

}
示例#9
0
void
AutoProcessKey(
        int key,
        int mask,
        int func_type )
{
    void            (*keyproc)();

    switch (func_type) {
	case CLICKKEY:		keyproc = xisClickKey;
				break;
	case PRESSKEY:		keyproc = xisKeyPress;
				break;
	case RELEASEKEY:	keyproc = xisKeyRelease;
				break;
	default:		AutoError(_AutoMessages[WARNMSG87]);
				break;
    }

    switch (key) {
	case BACKSPACE:
		(*keyproc)(mask | KeyBackSpace);
		break;
	case INSERT:
		(*keyproc)(mask | KeyInsert);
		break;
	case DELETE:
		(*keyproc)(mask | KeyDelete);
		break;
	case COPY:
		(*keyproc)(mask | KeyCopy);
		break;
	case CUT:
		(*keyproc)(mask | KeyCut);
		break;
	case PASTE:
		(*keyproc)(mask | KeyPaste);
		break;
	case ADDMODE:
		(*keyproc)(mask | KeyAddMode);
		break;
	case PRIMARYPASTE:
		(*keyproc)(mask | KeyPrimaryPaste);
		break;
	case QUICKPASTE:
		(*keyproc)(mask | KeyQuickPaste);
		break;
	case PAGEUP:
		(*keyproc)(mask | KeyPageUp);
		break;
	case PAGEDOWN:
		(*keyproc)(mask | KeyPageDown);
		break;
	case ENDLINE:
		(*keyproc)(mask | KeyEndLine);
		break;
	case BEGINLINE:
		(*keyproc)(mask | KeyBeginLine);
		break;
	case ACTIVATE:
		(*keyproc)(mask | KeyActivate);
		break;
	case MENUBAR:
		(*keyproc)(mask | KeyMenuBar);
		break;
	case CLEAR:
		(*keyproc)(mask | KeyClear);
		break;
	case CANCEL:
		(*keyproc)(mask | KeyCancel);
		break;
	case HELP:
		(*keyproc)(mask | KeyHelp);
		break;
	case MENU:
		(*keyproc)(mask | KeyMenu);
		break;
	case SELECT:
		(*keyproc)(mask | KeySelect);
		break;
	case UNDO:
		(*keyproc)(mask | KeyUndo);
		break;
	case UPK:
		(*keyproc)(mask | KeyUp);
		break;
	case RIGHTK:
		(*keyproc)(mask | KeyRight);
		break;
	case DOWNK:
		(*keyproc)(mask | KeyDown);
		break;
	case LEFTK:
		(*keyproc)(mask | KeyLeft);
		break;
	case BACKTAB:
		(*keyproc)(mask | KeyBackTab);
		break;
	case BEGINDATA:
		(*keyproc)(mask | KeyBeginData);
		break;
	case DESELECTALL:
		(*keyproc)(mask | KeyDeselectAll);
		break;
	case ENDDATA:
		(*keyproc)(mask | KeyEndData);
		break;
	case ENTER:
		(*keyproc)(mask | KeyEnter);
		break;
	case ESCAPE:
		(*keyproc)(mask | KeyEscape);
		break;
	case EXTEND:
		(*keyproc)(mask | KeyExtend);
		break;
	case NEXTFIELD:
		(*keyproc)(mask | KeyNextField);
		break;
	case NEXTMENU:
		(*keyproc)(mask | KeyNextMenu);
		break;
	case PAGERIGHT:
		(*keyproc)(mask | KeyPageRight);
		break;
	case PAGELEFT:
		(*keyproc)(mask | KeyPageLeft);
		break;
	case PREVFIELD:
		(*keyproc)(mask | KeyPrevField);
		break;
	case PREVMENU:
		(*keyproc)(mask | KeyPrevMenu);
		break;
	case PRIMARYCOPY:
		(*keyproc)(mask | KeyPrimaryCopy);
		break;
	case PRIMARYCUT:
		(*keyproc)(mask | KeyPrimaryCut);
		break;
	case QUICKCOPY:
		(*keyproc)(mask | KeyQuickCopy);
		break;
	case QUICKCUT:
		(*keyproc)(mask | KeyQuickCut);
		break;
	case QUICKEXTEND:
		(*keyproc)(mask | KeyQuickExtend);
		break;
	case RESELECT:
		(*keyproc)(mask | KeyReselect);
		break;
	case RESTORE:
		(*keyproc)(mask | KeyRestore);
		break;
	case SELECTALL:
		(*keyproc)(mask | KeySelectAll);
		break;
	case SPACE:
		(*keyproc)(mask | KeySpace);
		break;
	case TAB:
		(*keyproc)(mask | KeyTab);
		break;
	case KEYA:
		(*keyproc)(mask | Keya);
		break;
	case KEYB:
		(*keyproc)(mask | Keyb);
		break;
	case KEYC:
		(*keyproc)(mask | Keyc);
		break;
	case KEYD:
		(*keyproc)(mask | Keyd);
		break;
	case KEYE:
		(*keyproc)(mask | Keye);
		break;
	case KEYF:
		(*keyproc)(mask | Keyf);
		break;
	case KEYG:
		(*keyproc)(mask | Keyg);
		break;
	case KEYH:
		(*keyproc)(mask | Keyh);
		break;
	case KEYI:
		(*keyproc)(mask | Keyi);
		break;
	case KEYJ:
		(*keyproc)(mask | Keyj);
		break;
	case KEYK:
		(*keyproc)(mask | Keyk);
		break;
	case KEYL:
		(*keyproc)(mask | Keyl);
		break;
	case KEYM:
		(*keyproc)(mask | Keym);
		break;
	case KEYN:
		(*keyproc)(mask | Keyn);
		break;
	case KEYO:
		(*keyproc)(mask | Keyo);
		break;
	case KEYP:
		(*keyproc)(mask | Keyp);
		break;
	case KEYQ:
		(*keyproc)(mask | Keyq);
		break;
	case KEYR:
		(*keyproc)(mask | Keyr);
		break;
	case KEYS:
		(*keyproc)(mask | Keys);
		break;
	case KEYT:
		(*keyproc)(mask | Keyt);
		break;
	case KEYU:
		(*keyproc)(mask | Keyu);
		break;
	case KEYV:
		(*keyproc)(mask | Keyv);
		break;
	case KEYW:
		(*keyproc)(mask | Keyw);
		break;
	case KEYX:
		(*keyproc)(mask | Keyx);
		break;
	case KEYY:
		(*keyproc)(mask | Keyy);
		break;
	case KEYZ:
		(*keyproc)(mask | Keyz);
		break;
	case KEYSLASH:
		(*keyproc)(mask | KeySlash);
		break;
	case KEYBACKSLASH:
		(*keyproc)(mask | KeyBackSlash);
		break;
	case KEYBRACERIGHT:
		(*keyproc)(mask | KeyBraceRight);
		break;
	case KEYBRACELEFT:
		(*keyproc)(mask | KeyBraceLeft);
		break;
	case KEYBRACKETRIGHT:
		(*keyproc)(mask | KeyBracketRight);
		break;
	case KEYBRACKETLEFT:
		(*keyproc)(mask | KeyBracketLeft);
		break;
	case KEYRETURN:
		(*keyproc)(mask | KeyReturn);
		break;
	case KEY1:
		(*keyproc)(mask | Key1);
		break;
	case KEY2:
		(*keyproc)(mask | Key2);
		break;
	case KEY3:
		(*keyproc)(mask | Key3);
		break;
	case KEY4:
		(*keyproc)(mask | Key4);
		break;
	case KEY5:
		(*keyproc)(mask | Key5);
		break;
	case KEY6:
		(*keyproc)(mask | Key6);
		break;
	case KEY7:
		(*keyproc)(mask | Key7);
		break;
	case KEY8:
		(*keyproc)(mask | Key8);
		break;
	case KEY9:
		(*keyproc)(mask | Key9);
		break;
	case KEY0:
		(*keyproc)(mask | Key0);
		break;
	case KEYEXCLAM:
		(*keyproc)(mask | KeyExclamation);
		break;
	case KEYAT:
		(*keyproc)(mask | KeyAt);
		break;
	case KEYNUMBERSIGN:
		(*keyproc)(mask | KeyNumberSign);
		break;
	case KEYDOLLAR:
		(*keyproc)(mask | KeyDollar);
		break;
	case KEYPERCENT:
		(*keyproc)(mask | KeyPercent);
		break;
	case KEYCARET:
		(*keyproc)(mask | KeyCaret);
		break;
	case KEYAMPERSAND:
		(*keyproc)(mask | KeyAmpersand);
		break;
	case KEYASTERISK:
		(*keyproc)(mask | KeyAsterisk);
		break;
	case KEYPARENLEFT:
		(*keyproc)(mask | KeyParenLeft);
		break;
	case KEYPARENRIGHT:
		(*keyproc)(mask | KeyParenRight);
		break;
	case KEYNONE:
		(*keyproc)(mask | KeyNone);
		break;
	default:
		AutoMessage(_AutoMessages[WARNMSG2]);
		break;
    }
}