예제 #1
0
파일: grabber.cpp 프로젝트: alexlav/conemu
int Grabber::ProcessMouse(MOUSE_EVENT_RECORD *MouseEvent)
{
	if (MouseEvent->dwEventFlags==DOUBLE_CLICK ||
	        (!MouseEvent->dwEventFlags && (MouseEvent->dwButtonState & RIGHTMOST_BUTTON_PRESSED)))
	{
		ProcessKey(KEY_ENTER);
		return TRUE;
	}

	if (IntKeyState.MouseButtonState!=FROM_LEFT_1ST_BUTTON_PRESSED)
		return FALSE;

	GArea.CurX=Min(Max(static_cast<SHORT>(0),IntKeyState.MouseX),ScrX);
	GArea.CurY=Min(Max(static_cast<SHORT>(0),IntKeyState.MouseY),ScrY);

	if (!MouseEvent->dwEventFlags)
		ResetArea=TRUE;
	else if (MouseEvent->dwEventFlags==MOUSE_MOVED)
	{
		if (ResetArea)
		{
			GArea.X2=GArea.CurX;
			GArea.Y2=GArea.CurY;
			ResetArea=FALSE;
		}

		GArea.X1=GArea.CurX;
		GArea.Y1=GArea.CurY;
	}

	//VerticalBlock=MouseEvent->dwControlKeyState&(LEFT_ALT_PRESSED|RIGHT_ALT_PRESSED);
	DisplayObject();
	return TRUE;
}
예제 #2
0
파일: emvCallback.c 프로젝트: yb76/vx
unsigned short EmvFnOnlinePin(void)
{
	int iret = 0;
	char usrpin[14] = "";	//ID 0000039
	char outevent[100];
	char outpin[15]="";
	
	gEmv.onlinepin = false;
	gEmv.offlinepin = false;
	gEmv.pinentry = false;

	vSetPinParams(!gEmv.pinbypass_disable);//SECURE_PIN_MODULE changes
	inVXEMVAPSetDisplayPINPrompt(NULL);

	{
	char scrlines[1024] ;
	char sAmt[30];
	
	sprintf(sAmt, "$%.2f", gEmv.amt/100.0);
	sprintf( scrlines, "WIDELBL,THIS,TOTAL:           %9s,2,3;", sAmt);
	strcat( scrlines,gEmv.pinbypass_disable?"PIN,,,P5,P11,1;":"PIN,,,P5,P11,0;");
	DisplayObject(scrlines,KEY_OK_BIT+KEY_CNCL_BIT+( gEmv.pinbypass_disable?0:KEY_NO_PIN_BIT),EVT_SCT_OUT+EVT_TIMEOUT,30000,outevent,outpin);
	}

	if (strcmp(outevent ,"KEY_NO_PIN")==0) {
		return(E_USR_PIN_BYPASSED);
	} else if (strcmp(outevent ,"KEY_OK")==0) { 
		gEmv.pinentry = true;
		gEmv.onlinepin = true;
		return(EMV_SUCCESS);
	} else {
		return(E_USR_ABORT);
	}
}
예제 #3
0
파일: grabber.cpp 프로젝트: alexlav/conemu
Grabber::Grabber()
{
	Frame *pFrame = FrameManager->GetCurrentFrame();
	pFrame->Lock();
	SaveScr=new SaveScreen;
	PrevMacroMode=CtrlObject->Macro.GetMode();
	CtrlObject->Macro.SetMode(MACRO_OTHER);
	ClearStruct(GArea);
	ClearStruct(PrevArea);
	bool Visible=false;
	DWORD Size=0;
	GetCursorType(Visible,Size);

	if (Visible)
		GetCursorPos(GArea.CurX,GArea.CurY);
	else
	{
		GArea.CurX=0;
		GArea.CurY=0;
	}

	GArea.X1=-1;
	SetCursorType(TRUE,60);
	PrevArea=GArea;
	ResetArea=TRUE;
	VerticalBlock=FALSE;
	DisplayObject();
	Process();
	delete SaveScr;
	pFrame->Unlock();
	FrameManager->RefreshFrame();
}
예제 #4
0
/////////////////////////////////////////////////////////////////
// HRESULT CAsynchBase::Initialize
//
/////////////////////////////////////////////////////////////////
HRESULT CAsynchBase::Initialize()
{
	HRESULT	hr = S_OK;
	DWORD dwCreateOpts = GetOptions()->m_dwCreateOpts;

	if(!m_pIDBInitialize)
		goto CLEANUP;

	//Initailize
	//NOTE: Expect S_OK or DB_E_CANCELED, since canceling the dialog always returns DB_E_CANCELED
	XTEST_(hr = m_pIDBInitialize->Initialize(), DB_E_CANCELED);
	TRACE_METHOD(hr, L"IDBInitialize::Initialize()");

	//Display any property errors...
	TESTC(hr = DisplayPropErrors(hr, IID_IDBProperties, m_pIDBInitialize));

	//We are now Initialized
	m_fInitialized = TRUE;

	//Obtain all interfaces, now that we are initialized
	TESTC(hr = AutoQI(dwCreateOpts));
	
	//Also "redraw" the object now that more interfaces are available for use
	//For Example: If the rowset was originally obtained Asynchronously and now interfaces
	//to obtain columns and data are available, display the object...
	TESTC(hr = DisplayObject());

CLEANUP:
	return hr;
}
예제 #5
0
파일: emvCallback.c 프로젝트: yb76/vx
/*
** unsigned short	EmvGetUsrPin(unsigned char *ucPin);
**
**	This function provides an implementation of the Verix-V EMV Library
**	getUsrPin() callback function (VerixV EMV function-ID: GET_USER_PIN).
**
**	This function conforms to the specification of the Verifone getUsrPin()
**	callback function, as defined in the following document:
**
**		Author: 	Verifone Inc
**		Title:		Verix/Verix-V EMV Module
**					Reference Manual
**
**	This function performs offline PIN-entry. The function prompts the
**	user to enter a PIN & returns it in the supplied buffer.
**
**	ucPin	Buffer (unsigned char*) provided for the storage of the
**			entered PIN.
**
**	return:
**  > 0					Operation completed successfully. Value returned is the length of the PIN (characters)
**	E_USR_PIN_BYPASSED	PIN-entry has been bypassed
**	E_USR_PIN_CANCELLED	PIN-entry has been cancelled by the customer.
**	EMV_FAILURE			Operation aborted due to some other error.
*/
unsigned short	EmvGetUsrPin(unsigned char *ucPin)
{
	char scrlines[1024] ;
	char outevent[100];
	char outpin[15]="";//ID 0000039
	char sAmt[30];
	
	sprintf(sAmt, "$%.2f", gEmv.amt/100.0);
	sprintf( scrlines, "WIDELBL,THIS,TOTAL:           %9s,2,3;", sAmt);
	strcat( scrlines,"LARGE,THIS,ENTER PIN OR OK,5,C;");
	strcat( scrlines,"LHIDDEN,,0,7,C,12;");
	strcpy( (char *)ucPin,"");

	GetSetEmvPin(1,"");
	while(1) {

		DisplayObject(scrlines,KEY_OK_BIT+KEY_CNCL_BIT,EVT_SCT_OUT+EVT_TIMEOUT,30000,outevent,outpin);

		if(strcmp(outevent,"KEY_OK")==0) {
			if( strlen(outpin) == 0) {
				if( gEmv.pinbypass_disable ) {
					char * nopinbypass = "******";
					DisplayObject(nopinbypass,KEY_OK_BIT+KEY_CNCL_BIT,EVT_TIMEOUT,2000,outevent,outpin);
					continue;
				} else {
					return(E_USR_PIN_BYPASSED);
				}
			}
			else if(( strlen(outpin) >= 4) && ( strlen(outpin) <= 12)){
				strcpy( (char *)ucPin, outpin );
				GetSetEmvPin(1,(unsigned char *)outpin);
				return(strlen((const char *)ucPin));
			}
			else {
				char event[64]="";
				char input[256]="";
				char srcline1[1024]="WIDELBL,THIS,INVALID PIN,2,C;WIDELBL,THIS,PLEASE RETRY,4,C;";
				DisplayObject(srcline1,0,EVT_TIMEOUT,2000,event,input);
				continue;
			}
			//END ..Dwarika .. to fix bug id 3346 from bash report by CBA
		} else {
			return(E_USR_ABORT);
		}
	}
}
예제 #6
0
파일: emvCallback.c 프로젝트: yb76/vx
void EmvDispUsrPin()
{
	char scrlines[1024] ="";
	char outevent[100];
	char outpin[15]="";
	char sAmt[30];
	
	sprintf(sAmt, "$%.2f", gEmv.amt/100.0);
	sprintf( scrlines, "WIDELBL,THIS,TOTAL:           %9s,2,3;", sAmt);
	strcat( scrlines,gEmv.pinbypass_disable?"LARGE,THIS,ENTER PIN AND OK,5,C;":"LARGE,THIS,ENTER PIN OR OK,5,C;");
	
	DisplayObject(scrlines,0,0,0,outevent,outpin);

}
예제 #7
0
파일: scrobj.cpp 프로젝트: CyberShadow/FAR
void ScreenObject::Show()
{
	if (Locked())
		return;

//  _tran(SysLog(L"[%p] ScreenObject::Show()",this));
	if (!Flags.Check(FSCROBJ_SETPOSITIONDONE))
		return;

//  if (Flags.Check(FSCROBJ_ISREDRAWING))
//    return;
//  Flags.Set(FSCROBJ_ISREDRAWING);
	SavePrevScreen();
	DisplayObject();
//  Flags.Clear(FSCROBJ_ISREDRAWING);
}
예제 #8
0
void CProviderTableDlg::OnOpenProfileSection()
{
    HRESULT			hRes = S_OK;

    if (!m_lpProviderAdmin) return;

    CEditor MyUID(
        this,
        IDS_OPENPROFSECT,
        IDS_OPENPROFSECTPROMPT,
        2,
        CEDITOR_BUTTON_OK|CEDITOR_BUTTON_CANCEL);

    MyUID.InitPane(0, CreateDropDownGuidPane(IDS_MAPIUID, false));
    MyUID.InitPane(1, CreateCheckPane(IDS_MAPIUIDBYTESWAPPED, false, false));

    WC_H(MyUID.DisplayDialog());
    if (S_OK != hRes) return;

    GUID guid = {0};
    SBinary MapiUID = {sizeof(GUID),(LPBYTE) &guid};
    (void) MyUID.GetSelectedGUID(0, MyUID.GetCheck(1), &guid);

    LPPROFSECT lpProfSect = NULL;
    EC_H(OpenProfileSection(
             m_lpProviderAdmin,
             &MapiUID,
             &lpProfSect));
    if (lpProfSect)
    {
        LPMAPIPROP lpTemp = NULL;
        EC_MAPI(lpProfSect->QueryInterface(IID_IMAPIProp,(LPVOID*) &lpTemp));
        if (lpTemp)
        {
            EC_H(DisplayObject(
                     lpTemp,
                     MAPI_PROFSECT,
                     otContents,
                     this));
            lpTemp->Release();
        }
        lpProfSect->Release();
    }
    MAPIFreeBuffer(MapiUID.lpb);
} // CProviderTableDlg::OnOpenProfileSection
예제 #9
0
void DisplayPlots(){
	DisplayObject("test1.png",wl.Display("Emission"));
	{
	  TGraph* gr2=wl.Display("Emission");
	  gr2->SetLineColor(kBlack);
	  gr2->SetMarkerColor(kBlack);
	  gr2->SetLineWidth(1);
	  gr2->SetLineStyle(1);
	  gr2->SetMarkerStyle(0);
	  gr2->SetMarkerSize(0);
	  TGaxis *sec_axis=new TGaxis(xmax,ymin,xmax,ymax,ymin,ymax,50510,"+L");
	  sec_axis->SetLabelColor(kBlack);
	  sec_axis->SetLabelSize(0.03);
	  sec_axis->SetTitle("Emission intensity [a.u.]");
	  TMultiGraph *mgr=new TMultiGraph();
	  TGraph* gr0=absor.Display("");
	  mgr->Add(gr0);
	  gr0->SetLineWidth(4);
	  gr0->SetMarkerStyle(0);
	  gr0->SetMarkerSize(0);
	  DisplayObject_plusplus("absorbtion.png",[](TCanvas* c1,TMultiGraph* ){
		  TPad *pad1=new TPad("pad1","",0.05,0,1,1);
		  pad1->Draw();pad1->cd();
		  TH1F *th1f=c1->DrawFrame(xmin,0,xmax,0.01);
		  th1f->GetXaxis()->SetTitle("Wavelength [nm]");
		  th1f->GetYaxis()->SetTitle("Absorption coefficient [mm^{-1}]");
		  th1f->GetXaxis()->SetLabelSize(0.05);
		  th1f->GetXaxis()->SetTitleSize(0.05);
		  th1f->GetYaxis()->SetLabelSize(0.05);
		  th1f->GetYaxis()->SetTitleSize(0.05);
		  th1f->GetYaxis()->SetTitleOffset(1.5);
	  },mgr,"",[gr2,sec_axis](TCanvas*,TMultiGraph*){
		  TPad *pad2=new TPad("pad2","",0,0,1,1);
		  pad2->SetFillStyle(4000);
		  double dy = (ymax-ymin)/0.8;double dx = (xmax-xmin)/0.8;
		  pad2->Range(xmin-0.1*dx,ymin-0.1*dy,xmax+0.1*dx,ymax+0.1*dy);
		  pad2->Draw();pad2->cd();
		  gr2->Draw("LP");sec_axis->Draw();
	  });
	  delete gr2;delete sec_axis;
	 }{
	  TGraph* gr2=wl.Display("Emission");
	  gr2->SetLineColor(kBlack);
	  gr2->SetMarkerColor(kBlack);
	  gr2->SetLineWidth(1);
	  gr2->SetLineStyle(1);
	  gr2->SetMarkerStyle(0);
	  gr2->SetMarkerSize(0);
	  TGaxis *sec_axis=new TGaxis(xmax,ymin,xmax,ymax,ymin,ymax,50510,"+L");
	  sec_axis->SetLabelColor(kBlack);
	  sec_axis->SetLabelSize(0.03);
	  sec_axis->SetTitle("Emission intensity [a.u.]");
	  TMultiGraph *mgr=new TMultiGraph();
	  TGraph* gr0=eff.Display("R4998");
	  mgr->Add(gr0);
	  gr0->SetLineWidth(4);
	  gr0->SetMarkerStyle(0);
	  gr0->SetMarkerSize(0);
	  TGraph* gr1=eff2.Display("Silicon");
	  mgr->Add(gr1);
	  gr1->SetLineWidth(4);
	  gr1->SetLineStyle(kDashed);
	  gr1->SetMarkerStyle(0);
	  gr1->SetMarkerSize(0);
	  DisplayObject_plusplus("displ_fn.png",[](TCanvas* c1,TMultiGraph* ){
		  TPad *pad1=new TPad("pad1","",0,0,1,1);
		  pad1->Draw();pad1->cd();
		  TH1F *th1f=c1->DrawFrame(xmin,0,xmax,1);
		  th1f->GetXaxis()->SetTitle("Wavelength [nm]");
		  th1f->GetYaxis()->SetTitle("Quantum efficiency");
		  th1f->GetXaxis()->SetLabelSize(0.05);
		  th1f->GetXaxis()->SetTitleSize(0.05);
		  th1f->GetYaxis()->SetLabelSize(0.05);
		  th1f->GetYaxis()->SetTitleSize(0.05);
	  },mgr,"",[gr2,sec_axis](TCanvas*,TMultiGraph*){
		  TPad *pad2=new TPad("pad2","",0,0,1,1);
		  pad2->SetFillStyle(4000);
		  double dy = (ymax-ymin)/0.8;double dx = (xmax-xmin)/0.8;
		  pad2->Range(xmin-0.1*dx,ymin-0.1*dy,xmax+0.1*dx,ymax+0.1*dy);
		  pad2->Draw();pad2->cd();
		  gr2->Draw("LP");sec_axis->Draw();
	  });
	  delete gr2;delete sec_axis;
	}
	DisplayObject("test2.png",wl.Display("Emission"));
}
예제 #10
0
void CBaseDialog::OnOpenEntryID(_In_opt_ LPSBinary lpBin)
{
	HRESULT			hRes = S_OK;
	if (!m_lpMapiObjects) return;

	CEditor MyEID(
		this,
		IDS_OPENEID,
		IDS_OPENEIDPROMPT,
		10,
		CEDITOR_BUTTON_OK | CEDITOR_BUTTON_CANCEL);

	MyEID.InitPane(0, CreateSingleLinePane(IDS_EID, BinToHexString(lpBin, false), false));

	LPMDB lpMDB = m_lpMapiObjects->GetMDB(); // do not release
	MyEID.InitPane(1, CreateCheckPane(IDS_USEMDB, lpMDB ? true : false, lpMDB ? false : true));

	LPADRBOOK lpAB = m_lpMapiObjects->GetAddrBook(false); // do not release
	MyEID.InitPane(2, CreateCheckPane(IDS_USEAB, lpAB ? true : false, lpAB ? false : true));

	LPMAPISESSION lpMAPISession = m_lpMapiObjects->GetSession(); // do not release
	MyEID.InitPane(3, CreateCheckPane(IDS_SESSION, lpMAPISession ? true : false, lpMAPISession ? false : true));

	MyEID.InitPane(4, CreateCheckPane(IDS_PASSMAPIMODIFY, false, false));

	MyEID.InitPane(5, CreateCheckPane(IDS_PASSMAPINOCACHE, false, false));

	MyEID.InitPane(6, CreateCheckPane(IDS_PASSMAPICACHEONLY, false, false));

	MyEID.InitPane(7, CreateCheckPane(IDS_EIDBASE64ENCODED, false, false));

	MyEID.InitPane(8, CreateCheckPane(IDS_ATTEMPTIADDRBOOKDETAILSCALL, false, lpAB ? false : true));

	MyEID.InitPane(9, CreateCheckPane(IDS_EIDISCONTAB, false, false));

	WC_H(MyEID.DisplayDialog());
	if (S_OK != hRes) return;

	// Get the entry ID as a binary
	LPENTRYID lpEnteredEntryID = NULL;
	LPENTRYID lpEntryID = NULL;
	size_t cbBin = NULL;
	EC_H(MyEID.GetEntryID(0, MyEID.GetCheck(7), &cbBin, &lpEnteredEntryID));

	if (MyEID.GetCheck(9) && lpEnteredEntryID)
	{
		(void)UnwrapContactEntryID((ULONG)cbBin, (LPBYTE)lpEnteredEntryID, (ULONG*)&cbBin, (LPBYTE*)&lpEntryID);
	}
	else
	{
		lpEntryID = lpEnteredEntryID;
	}

	if (MyEID.GetCheck(8) && lpAB) // Do IAddrBook->Details here
	{
		ULONG_PTR ulUIParam = (ULONG_PTR)(void*)m_hWnd;

		EC_H_CANCEL(lpAB->Details(
			&ulUIParam,
			NULL,
			NULL,
			(ULONG)cbBin,
			lpEntryID,
			NULL,
			NULL,
			NULL,
			DIALOG_MODAL)); // API doesn't like unicode
	}
	else
	{
		LPUNKNOWN lpUnk = NULL;
		ULONG ulObjType = NULL;

		EC_H(CallOpenEntry(
			MyEID.GetCheck(1) ? lpMDB : 0,
			MyEID.GetCheck(2) ? lpAB : 0,
			NULL,
			MyEID.GetCheck(3) ? lpMAPISession : 0,
			(ULONG)cbBin,
			lpEntryID,
			NULL,
			(MyEID.GetCheck(4) ? MAPI_MODIFY : MAPI_BEST_ACCESS) |
			(MyEID.GetCheck(5) ? MAPI_NO_CACHE : 0) |
			(MyEID.GetCheck(6) ? MAPI_CACHE_ONLY : 0),
			&ulObjType,
			&lpUnk));

		if (lpUnk)
		{
			LPWSTR szFlags = NULL;
			InterpretNumberAsStringProp(ulObjType, PR_OBJECT_TYPE, &szFlags);
			DebugPrint(DBGGeneric, _T("OnOpenEntryID: Got object (%p) of type 0x%08X = %ws\n"), lpUnk, ulObjType, szFlags);
			delete[] szFlags;
			szFlags = NULL;

			LPMAPIPROP lpTemp = NULL;
			WC_MAPI(lpUnk->QueryInterface(IID_IMAPIProp, (LPVOID*)&lpTemp));
			if (lpTemp)
			{
				WC_H(DisplayObject(
					lpTemp,
					ulObjType,
					otHierarchy,
					this));
				lpTemp->Release();
			}
			lpUnk->Release();
		}
	}

	delete[] lpEnteredEntryID;
} // CBaseDialog::OnOpenEntryID
예제 #11
0
파일: grabber.cpp 프로젝트: alexlav/conemu
int Grabber::ProcessKey(int Key)
{
	if(CloseFAR)
	{
		Key = KEY_ESC;
	}

	/* $ 14.03.2001 SVS
	  [-] Неправильно воспроизводился макрос в режиме грабления экрана.
	      При воспроизведении клавиша Home перемещала курсор в координаты
	      0,0 консоли.
	  Не было учтено режима выполнения макроса.
	*/
	SetCursorType(TRUE,60);

	if (CtrlObject->Macro.IsExecuting())
	{
		if ((Key&KEY_SHIFT) && Key!=KEY_NONE && ResetArea)
			Reset();
		else if (Key!=KEY_IDLE && Key!=KEY_NONE && !(Key&KEY_SHIFT) && !IntKeyState.ShiftPressed && !IntKeyState.AltPressed)
			ResetArea=TRUE;
	}
	else
	{
		if ((IntKeyState.ShiftPressed || Key!=KEY_SHIFT) && (Key&KEY_SHIFT) && Key!=KEY_NONE && Key!=KEY_CTRLA && Key!=KEY_RCTRLA && !IntKeyState.AltPressed && ResetArea)
			Reset();
		else if (Key!=KEY_IDLE && Key!=KEY_NONE && Key!=KEY_SHIFT && Key!=KEY_CTRLA && Key!=KEY_RCTRLA && !IntKeyState.ShiftPressed && !IntKeyState.AltPressed && !(Key&KEY_SHIFT))
			ResetArea=TRUE;
	}

	switch (Key)
	{
		case KEY_CTRLU:
		case KEY_RCTRLU:
			Reset();
			GArea.X1=-2;
			break;
		case KEY_ESC:
			SetExitCode(0);
			break;
		case KEY_NUMENTER:
		case KEY_ENTER:
		case KEY_CTRLINS:   case KEY_CTRLNUMPAD0:
		case KEY_RCTRLINS:  case KEY_RCTRLNUMPAD0:
		case KEY_CTRLADD:
		case KEY_RCTRLADD:
			CopyGrabbedArea(Key == KEY_CTRLADD || Key == KEY_RCTRLADD,VerticalBlock);
			SetExitCode(1);
			break;
		case KEY_LEFT:      case KEY_NUMPAD4:   case L'4':

			if (GArea.CurX>0)
				GArea.CurX--;

			break;
		case KEY_RIGHT:     case KEY_NUMPAD6:   case L'6':

			if (GArea.CurX<ScrX)
				GArea.CurX++;

			break;
		case KEY_UP:        case KEY_NUMPAD8:   case L'8':

			if (GArea.CurY>0)
				GArea.CurY--;

			break;
		case KEY_DOWN:      case KEY_NUMPAD2:   case L'2':

			if (GArea.CurY<ScrY)
				GArea.CurY++;

			break;
		case KEY_HOME:      case KEY_NUMPAD7:   case L'7':
			GArea.CurX=0;
			break;
		case KEY_END:       case KEY_NUMPAD1:   case L'1':
			GArea.CurX=ScrX;
			break;
		case KEY_PGUP:      case KEY_NUMPAD9:   case L'9':
			GArea.CurY=0;
			break;
		case KEY_PGDN:      case KEY_NUMPAD3:   case L'3':
			GArea.CurY=ScrY;
			break;
		case KEY_CTRLHOME:  case KEY_CTRLNUMPAD7:
		case KEY_RCTRLHOME: case KEY_RCTRLNUMPAD7:
			GArea.CurX=GArea.CurY=0;
			break;
		case KEY_CTRLEND:   case KEY_CTRLNUMPAD1:
		case KEY_RCTRLEND:  case KEY_RCTRLNUMPAD1:
			GArea.CurX=ScrX;
			GArea.CurY=ScrY;
			break;
		case KEY_CTRLLEFT:       case KEY_CTRLNUMPAD4:
		case KEY_RCTRLLEFT:      case KEY_RCTRLNUMPAD4:
		case KEY_CTRLSHIFTLEFT:  case KEY_CTRLSHIFTNUMPAD4:
		case KEY_RCTRLSHIFTLEFT: case KEY_RCTRLSHIFTNUMPAD4:

			if ((GArea.CurX-=10)<0)
				GArea.CurX=0;

			if (Key == KEY_CTRLSHIFTLEFT || Key == KEY_RCTRLSHIFTLEFT || Key == KEY_CTRLSHIFTNUMPAD4 || Key == KEY_RCTRLSHIFTNUMPAD4)
				GArea.X1=GArea.CurX;

			break;
		case KEY_CTRLRIGHT:       case KEY_CTRLNUMPAD6:
		case KEY_RCTRLRIGHT:      case KEY_RCTRLNUMPAD6:
		case KEY_CTRLSHIFTRIGHT:  case KEY_CTRLSHIFTNUMPAD6:
		case KEY_RCTRLSHIFTRIGHT: case KEY_RCTRLSHIFTNUMPAD6:

			if ((GArea.CurX+=10)>ScrX)
				GArea.CurX=ScrX;

			if (Key == KEY_CTRLSHIFTRIGHT || Key == KEY_RCTRLSHIFTRIGHT || Key == KEY_CTRLSHIFTNUMPAD6 || Key == KEY_RCTRLSHIFTNUMPAD6)
				GArea.X1=GArea.CurX;

			break;
		case KEY_CTRLUP:        case KEY_CTRLNUMPAD8:
		case KEY_RCTRLUP:       case KEY_RCTRLNUMPAD8:
		case KEY_CTRLSHIFTUP:   case KEY_CTRLSHIFTNUMPAD8:
		case KEY_RCTRLSHIFTUP:  case KEY_RCTRLSHIFTNUMPAD8:

			if ((GArea.CurY-=5)<0)
				GArea.CurY=0;

			if (Key == KEY_CTRLSHIFTUP || Key == KEY_RCTRLSHIFTUP || Key == KEY_CTRLSHIFTNUMPAD8 || Key == KEY_RCTRLSHIFTNUMPAD8)
				GArea.Y1=GArea.CurY;

			break;
		case KEY_CTRLDOWN:       case KEY_CTRLNUMPAD2:
		case KEY_RCTRLDOWN:      case KEY_RCTRLNUMPAD2:
		case KEY_CTRLSHIFTDOWN:  case KEY_CTRLSHIFTNUMPAD2:
		case KEY_RCTRLSHIFTDOWN: case KEY_RCTRLSHIFTNUMPAD2:

			if ((GArea.CurY+=5)>ScrY)
				GArea.CurY=ScrY;

			if (Key == KEY_CTRLSHIFTDOWN || Key == KEY_RCTRLSHIFTDOWN || Key == KEY_CTRLSHIFTNUMPAD8 || Key == KEY_RCTRLSHIFTNUMPAD8)
				GArea.Y1=GArea.CurY;

			break;
		case KEY_SHIFTLEFT:  case KEY_SHIFTNUMPAD4:

			if (GArea.X1>0)
				GArea.X1--;

			GArea.CurX=GArea.X1;
			GArea.CurY=GArea.Y1;
			break;
		case KEY_SHIFTRIGHT: case KEY_SHIFTNUMPAD6:

			if (GArea.X1<ScrX)
				GArea.X1++;

			GArea.CurX=GArea.X1;
			GArea.CurY=GArea.Y1;
			break;
		case KEY_SHIFTUP:    case KEY_SHIFTNUMPAD8:

			if (GArea.Y1>0)
				GArea.Y1--;

			GArea.CurX=GArea.X1;
			GArea.CurY=GArea.Y1;
			break;
		case KEY_SHIFTDOWN:  case KEY_SHIFTNUMPAD2:

			if (GArea.Y1<ScrY)
				GArea.Y1++;

			GArea.CurX=GArea.X1;
			GArea.CurY=GArea.Y1;
			break;
		case KEY_SHIFTHOME:  case KEY_SHIFTNUMPAD7:
			GArea.CurX=GArea.X1=0;
			break;
		case KEY_SHIFTEND:   case KEY_SHIFTNUMPAD1:
			GArea.CurX=GArea.X1=ScrX;
			break;
		case KEY_SHIFTPGUP:  case KEY_SHIFTNUMPAD9:
			GArea.CurY=GArea.Y1=0;
			break;
		case KEY_SHIFTPGDN:  case KEY_SHIFTNUMPAD3:
			GArea.CurY=GArea.Y1=ScrY;
			break;

		case KEY_ALTSHIFTHOME:  case KEY_ALTSHIFTNUMPAD7:
		case KEY_RALTSHIFTHOME: case KEY_RALTSHIFTNUMPAD7:
			GArea.X2=0;
			break;
		case KEY_ALTSHIFTEND:   case KEY_ALTSHIFTNUMPAD1:
		case KEY_RALTSHIFTEND:  case KEY_RALTSHIFTNUMPAD1:
			GArea.X2=ScrX;
			break;
		case KEY_ALTSHIFTPGUP:  case KEY_ALTSHIFTNUMPAD9:
		case KEY_RALTSHIFTPGUP: case KEY_RALTSHIFTNUMPAD9:
			GArea.Y2=0;
			break;
		case KEY_ALTSHIFTPGDN:  case KEY_ALTSHIFTNUMPAD3:
		case KEY_RALTSHIFTPGDN: case KEY_RALTSHIFTNUMPAD3:
			GArea.Y2=ScrY;
			break;

		case KEY_ALTSHIFTLEFT:  case KEY_ALTSHIFTNUMPAD4:
		case KEY_RALTSHIFTLEFT: case KEY_RALTSHIFTNUMPAD4:
			if (GArea.X2>0)
				GArea.X2--;
			break;
		case KEY_ALTSHIFTRIGHT:  case KEY_ALTSHIFTNUMPAD6:
		case KEY_RALTSHIFTRIGHT: case KEY_RALTSHIFTNUMPAD6:
			if (GArea.X2<ScrX)
				GArea.X2++;
			break;
		case KEY_ALTSHIFTUP:    case KEY_ALTSHIFTNUMPAD8:
		case KEY_RALTSHIFTUP:   case KEY_RALTSHIFTNUMPAD8:
			if (GArea.Y2>0)
				GArea.Y2--;
			break;
		case KEY_ALTSHIFTDOWN:  case KEY_ALTSHIFTNUMPAD2:
		case KEY_RALTSHIFTDOWN: case KEY_RALTSHIFTNUMPAD2:
			if (GArea.Y2<ScrY)
				GArea.Y2++;
			break;

		case KEY_CTRLA:
		case KEY_RCTRLA:
			GArea.X1=GArea.CurX=ScrX;
			GArea.X2=0;
			GArea.Y1=GArea.CurY=ScrY;
			GArea.Y2=0;
			break;

		case KEY_ALTLEFT:
		case KEY_RALTLEFT:
			if ((GArea.X1>0) && (GArea.X2>0))
			{
				GArea.X1--;
				GArea.X2--;
				GArea.CurX=GArea.X1;
				GArea.CurY=GArea.Y1;
			}
			break;
		case KEY_ALTRIGHT:
		case KEY_RALTRIGHT:
			if ((GArea.X1<ScrX) && (GArea.X2<ScrX))
			{
				GArea.X1++;
				GArea.X2++;
				GArea.CurX=GArea.X1;
				GArea.CurY=GArea.Y1;
			}
			break;
		case KEY_ALTUP:
		case KEY_RALTUP:
			if ((GArea.Y1>0) && (GArea.Y2>0))
			{
				GArea.Y1--;
				GArea.Y2--;
				GArea.CurX=GArea.X1;
				GArea.CurY=GArea.Y1;
			}
			break;
		case KEY_ALTDOWN:
		case KEY_RALTDOWN:
			if ((GArea.Y1<ScrY) && (GArea.Y2<ScrY))
			{
				GArea.Y1++;
				GArea.Y2++;
				GArea.CurX=GArea.X1;
				GArea.CurY=GArea.Y1;
			}
			break;

		case KEY_ALTHOME:
		case KEY_RALTHOME:
			GArea.X1=GArea.CurX=abs(GArea.X1-GArea.X2);
			GArea.X2=0;
			break;
		case KEY_ALTEND:
		case KEY_RALTEND:
			GArea.X2=ScrX-abs(GArea.X1-GArea.X2);
			GArea.X1=GArea.CurX=ScrX;
			break;
		case KEY_ALTPGUP:
		case KEY_RALTPGUP:
			GArea.Y1=GArea.CurY=abs(GArea.Y1-GArea.Y2);
			GArea.Y2=0;
			break;
		case KEY_ALTPGDN:
		case KEY_RALTPGDN:
			GArea.Y2=ScrY-abs(GArea.Y1-GArea.Y2);
			GArea.Y1=GArea.CurY=ScrY;
			break;

	}

	DisplayObject();
	return TRUE;
}
예제 #12
0
파일: emvCallback.c 프로젝트: yb76/vx
/*!
** 	void	EmvFnPromptManager(unsigned short usPromptId)
**
**	This function provides an implementation of the Verix-V EMV Library
**	vdPromptManager() callback function using our
**	"pPromptFunc" callback function.
**
**	This function conforms to the specification of the Verifone
**	vdPromptManager() callback function
**
**	This function displays a specified prompt obtained from a prompt
**	table on the terminal screen.
**
**	usPromptId	Prompt index indicating which prompt is to be
**				displayed
**
*/
void	EmvCallbackFnPromptManager(unsigned short usPromptId)
{
	char stmp[100];
	char stmp2[100];
	char *szDspMsg="";
	char outevent[200];
	unsigned long keys =KEY_CNCL_BIT|KEY_OK_BIT|KEY_CLR_BIT;
	
	
	/*
	** Map Verifone Prompt-ID to our Prompt-ID
	*/
      
    switch (usPromptId)
    {
		case E_CAPK_FILE_NOT_FOUND:    
            //szDspMsg = "CAPK FILE Missing";
			break;
    	case E_INVALID_CAPK:		
    	case E_CAPK_FILE_EXPIRED:		
		case E_NO_CAPK_DATA:		
		//Return without displaying any messages
			break;
        case E_ICC_BLOCKED:
            szDspMsg =  "CARD BLOCKED";
            break;
        case E_PIN_REQD:
			gEmv.pinentry = false;
            szDspMsg =  "PIN Required";
            break;
        case E_LAST_PIN_TRY:
			gEmv.pinentry = false;
            szDspMsg = "Last PIN Try";
            break;
        case E_PIN_TRY_LT_EXCEED:
			gEmv.pinentry = false;
            szDspMsg = "PIN Try Exceeded";
            break;        	
		case E_USR_ABORT:
		case E_USR_PIN_CANCELLED:
			gEmv.pinentry = false;
 			szDspMsg = "PIN Cancelled" ;
            break;
        case E_USR_PIN_BYPASSED:
            //szDspMsg = "PIN Bypassed" ;
            break;        
        case E_PIN_BLOCKED:
			gEmv.pinentry = false;
            szDspMsg =  "PIN Blocked";
            break;
        case EMV_PIN_SESSION_IN_PROGRESS:
             //szDspMsg = "PIN Progress" ;
             break;
        case EMV_PIN_SESSION_COMPLETE:
            //szDspMsg = "PIN Complete" ;
            break;
		case E_APP_EXPIRED:
			/*  szDspMsg = "CARD ERROR";*/
			break;
		case E_INVALID_PIN:
			gEmv.pinentry = false;
            szDspMsg =  "Incorrect PIN";
            break;
		///****************************
        case TRANS_APPROVED:
            szDspMsg  = "TRANS APPROVED" ;
            break;
        case TRANS_DECLINED:
            szDspMsg = "TRANS DECLINED" ;
            break;
        case OFFLINE_APPROVED:
            szDspMsg = "OFFLINE APPROVED" ;
            break;
        case OFFLINE_DECLINED:
            szDspMsg = "OFFLINE DECLINED" ;
            break;
        case OFFLINE_NOTALLOWED:
            szDspMsg = "OFFLINE NOT ALLOWED" ;
            break;
        case FAILURE:
		case EMV_FAILURE:
        case EMV_CHIP_ERROR:
        case CHIP_ERROR:
            szDspMsg =  "CHIP ERROR";
            break;
        case CARD_REMOVED:
            szDspMsg = "CARD REMOVED" ;
            break;
        case CARD_BLOCKED:
            szDspMsg = "CARD BLOCKED BY ISS" ;
            break;
        case APPL_BLOCKED:
            szDspMsg = "APPLICATION BLOCKED" ;
            break;
        case CANDIDATELIST_EMPTY:
            szDspMsg = "CANDIDATELIST EMPTY" ;
            break;
        case BAD_DATA_FORMAT:
            szDspMsg = "BAD DATA FORMAT" ;
            break;
        case APPL_NOT_AVAILABLE:
            szDspMsg = "APP NOT AVAIL" ;
            break;
        case TRANS_CANCELLED:
            szDspMsg = "TRANS CANCELLED" ;
            break;
        case EASY_ENTRY_APPL:
            szDspMsg = "EASY ENTRY APPL" ;
            break;
        case ICC_DATA_MISSING:
            szDspMsg = "ICC DATA MISSING" ;
            break;
        case CONFIG_FILE_NOT_FOUND:
            szDspMsg = "CONFIG FILE NOT FOUND" ;
            break;
        case FAILED_TO_CONNECT:
            szDspMsg = "FAILED TO CONNECT";
            break;
        case SELECT_FAILED:
            szDspMsg = "SELECT FAILED" ;
            break;
        case USE_CHIP:
            szDspMsg = "USE CHIP READER" ;
            break;
        case REMOVE_CARD:
            szDspMsg = "REMOVE CARD" ;
            break;
        case BAD_ICC_RESPONSE:
            szDspMsg = "BAD ICC RESPONSE" ;
            break;
		case USE_MAG_CARD:
            szDspMsg = "SWIPE CARD" ;
            break;
		case E_TAG_NOTFOUND:
            szDspMsg = "TAG NOT FOUND";
            break;
			
		case INVALID_CAPK_FILE:
            szDspMsg = "INVALID KEY FILE";
			break;
	
        case INVALID_ATR:
            szDspMsg = "INVALID ATR" ;
			break ;
		case 0x6985: 
			szDspMsg = "OFFLINE NOT ALLOWED" ;
			break;
		/*
		case E_INVALID_MODULE: 
			szDspMsg = MSG_INVALID_MODULE ;
			break;*/
		
        default:
            szDspMsg = "Chip Error" ;
            break;
   	}

	if(strlen( szDspMsg) == 0 ) return;

	sprintf(stmp,"WIDELBL,THIS,%s,2,C;",szDspMsg);
	DisplayObject(stmp,keys,EVT_TIMEOUT,2000,outevent,stmp2);
	return;
}