Exemplo n.º 1
0
void xapi_set_videomode(void *d) {
	int vmode; 
	if (getvidmode() !=0) {
		remote_printf(413, "cannot change videomode while window is open.");
		return;
	}
	vmode=parsevidoutname(d);
	if (vmode==0 ) vmode = atoi((char*)d);
	if (vmode <0) {
		remote_printf(414, "video mode needs to be a positive integer or 0 for autodetect.");
		return;
	}
	render_fmt = vidoutmode(vmode);
	remote_printf(100, "setting video mode to %i",getvidmode());

	open_window(); // required here; else VOutout callback fn will fail.

	if (pFrameFMT && current_file) { 
		// reinit buffer with new format
		char *fn=strdup(current_file);
		open_movie(fn);
		free(fn);
	} else {
		if(buffer) free(buffer); buffer=NULL;
		// set videomode to 0 or loop_flag=0?
	}
	init_moviebuffer();
	force_redraw=1;
}
Exemplo n.º 2
0
void xapi_open_window(void *d) {
	if (getvidmode() !=0) {
		remote_printf(412, "window already open.");
		return;
	}
	xapi_set_videomode("0");
}
Exemplo n.º 3
0
void xapi_pvideomode(void *d) {
	remote_printf(201,"videomode=%i", getvidmode());
}
Exemplo n.º 4
0
//******************************************************
//    evalstatus - evaluates the status returned from
//     acceptscreen library function 
//*******************************************************    
void evalstatus(unsigned int status, const int bVerbose)
{
unsigned char type;
char dir;
int mode, cols, page, attr, len=0;
    static char *goodmsg=   "GOOD DATA  ";
    static char *lenmsg=    "LENGTH ERR ";
    static char *inputmsg=  "INPUT TYPE ERR";
    static char *barmsg=    "BAR KEY    ";
    static char *farmsg=    "FAR KEY    ";
    static char *darmsg=    "DAR KEY    ";
    static char *uarmsg=    "UAR KEY    ";
    static char *clrmsg=    "CLR KEY    ";
    static char *bskeymsg=  "BS KEY     ";
    static char *delmsg=    "DELETE KEY ";
    static char *ltormsg=   "L to R SCAN ";
    static char *rtolmsg=   "R to L SCAN ";
    static char *unknown=   "UNKNOWN RETVAL";

    attr = NORMAL_VID;
    getvidmode(&mode, &cols, &page);
    setcurpos(page, 4, 2);
    switch (status)
    {
  case GOOD_DATA :
       if (bVerbose) writestr (page, goodmsg, len, attr);
       break;
  case LENGTH_ERR :
       if (bVerbose) writestr (page, lenmsg, len, attr);
       break;
  case INPUT_TYPE_ERR :
       if (bVerbose) writestr (page, inputmsg, len, attr);
       break;
  case WND :
       dir = getlabeltype(&type);
       if ( dir == L_TO_R)
    if (bVerbose) writestr(page, ltormsg, len, attr);
       else
    if (bVerbose) writestr(page, rtolmsg, len, attr);
       switch (type)
       {
    case PLESSEY:
        if (bVerbose) writestr(page, "Plessey", len, attr);
        break;
    case ALPHA_PLESS:
        if (bVerbose) writestr(page, "Alpha Plessey", len, attr);
        break;
    case ISBN_PLESS:
        if (bVerbose) writestr(page, "Isbn Plessey", len, attr);
        break;
    case PURE_PLESS:
        if (bVerbose) writestr(page, "Pure Plessey", len, attr);
        break;
    case SAIN_PLESS:
        if (bVerbose) writestr(page, "Sainesbury Plessey", len, attr);
        break;
    case UPC:
        if (bVerbose) writestr(page, "UPC", len, attr);
        break;
    case EAN:
        if (bVerbose) writestr(page, "Ean", len, attr);
        break;
    case UPC_EAN:
        if (bVerbose) writestr(page, "Upc Ean", len, attr);
        break;
    case CODABAR:
        if (bVerbose) writestr(page, "Codabar", len, attr);
        break;
    case CODE_3_9:
        if (bVerbose) writestr(page, "Code 3 of 9", len, attr);
        break;
    case CODE_2_5:
        if (bVerbose) writestr(page, "Code 2 of 5", len, attr);
        break;
    case DISCR_2_5:
        if (bVerbose) writestr(page, "Discr 2 of 5", len, attr);
        break;
    case INTERL_2_5:
        if (bVerbose) writestr(page, "Interl 2 of 5", len, attr);
        break;
    case INDUST_2_5:
        if (bVerbose) writestr(page, "Indust 2 of 5", len, attr);
        break;
    case CODE_11:
        if (bVerbose) writestr(page, "Code 11", len, attr);
        break;
    case CODE_128:
        if (bVerbose) writestr(page, "Code 128", len, attr);
        break;
       }
       break;

      case BAR :
       if (bVerbose) writestr (page, barmsg, len, attr);
       break;
  case FAR :
       if (bVerbose) writestr (page, farmsg, len, attr);
       break;
  case DAR :
       if (bVerbose) writestr (page, darmsg, len, attr);
       break;
  case UAR :
       if (bVerbose) writestr (page, uarmsg, len, attr);
       break;
  case CLR :
       if (bVerbose) writestr (page, clrmsg, len, attr);
       break;
  case BSKEY :
           if (bVerbose) writestr (page, bskeymsg, len, attr);
       break;
  case DEL :
       if (bVerbose) writestr (page, delmsg, len, attr);
       break;
  default : if (bVerbose) write(page, unknown, len, attr);
       break;
    }
    sysdelay(SECOND);
}