Пример #1
0
bool text_widget(widget_t *self, dspace_t *space)
{
	text_widget_params_t *params;

	if(self == NULL)
		return false;

	if(self->data_p == NULL)
		return false;

	params = (text_widget_params_t *)(self->data_p);

	dsetv(space, self->location);

	dtext(space, params->font, params->string, params->fg);

	return true;
}
#ifdef hookapi
#define dtext(x) x
#else
#define dtext(x) 0
#endif

// #########################################################################

#define neo_asic_cmd "\x00\xff\xd2\x00\x00\x00\x15\x00\x00\x01\xd2\x00\x00\x02\x15\x00\x00\xfe\x15\x00"

// #########################################################################

const neocontrolcode neocontrolcodes[]=
{
/*00*/    {"\x01\x02\x00\xc0\xa2\x01\x01\x00\x00\x00\x08\x00",0x0c,dtext("sync_code")},
/*01*/    {"\x00\x02\x00\x40\xaa\x01\x01\x00\x01\x00\x04\x00",0x0c,dtext("writecmd0_code")},
/*02*/    {"\x00\x02\x00\x40\xaa\x01\x01\x00\x02\x00\x04\x00",0x0c,dtext("readdata0_code")},
/*03*/    {"\x00\x02\x00\x40\xa0\x01\x01\x00\x00\x00\x0c\x00",0x0c,dtext("readdata1_code")},
/*04*/    {neo_asic_cmd "\x00\x37\x00\x23",0x18,dtext("asicreset_code")},
/*05*/    {neo_asic_cmd "\x00\x90\x35\x00\x0e\x80\x01\x0a\x80\x02\x0a\x80\x04\x0a\x80\x08\x0a\x80\x10\x0a\x80\x20\x0a\x80\x40\x0a\x80\x80\x0a\x81\x00\x0a\x82\x00\x0a\x84\x00\x0a\x88\x00\x0a\x90\x00\x0a\xa0\x00" neo_asic_cmd "\x00\x90\x49\x00",0x5a,dtext("getpcbpins_code")},
/*06*/    {neo_asic_cmd "\x00\xe2\x15\x00" neo_asic_cmd "\x00\x37\x20\x03" neo_asic_cmd "\x00\xda\x0e\x44" neo_asic_cmd "\x00\xc4\x00\x00\x05\x00\x05\x56\x00\xaa\x05\x00\x02\xab\x00\x55\x05\x00\x05\x56\x00\x90\x05\x00\x05\x55\x00\xaa\x05\x00\x02\xaa\x00\x55\x05\x00\x05\x55\x00\x90\x0c\x00\x00\x00\x08\x00\x00\x01\x08\x00\x00\x02\x08\x00\x00\x03\x01\x00\x00\x00\x00\xff\x01\x00\x00\x01\x00\xff\x01\x00\x00\x02\x00\xff\x01\x00\x00\x03\x00\xff\x01\x00\x00\x00\x00\xf0\x01\x00\x00\x01\x00\xf0\x01\x00\x00\x02\x00\xf0\x01\x00\x00\x03\x00\xf0",0xc4,dtext("getmenuid_code")},
/*07*/    /* will be deleted        ---------------------------------*/{neo_asic_cmd "\x00\xe2\x15\x00" neo_asic_cmd "\x00\x37\x32\x02" neo_asic_cmd "\x00\xda\x8e\x44" neo_asic_cmd "\x00\xc4\x00\x00\x01\x00\x05\x56\x00\xaa\x01\x00\x02\xab\x00\x55\x01\x00\x05\x56\x00\x90\x01\x00\x05\x55\x00\xaa\x01\x00\x02\xaa\x00\x55\x01\x00\x05\x55\x00\x90\x0c\x00\x00\x00\x08\x00\x00\x01\x08\x00\x00\x02\x08\x00\x00\x03\x01\x00\x00\x00\x00\xff\x01\x00\x00\x01\x00\xff\x01\x00\x00\x02\x00\xff\x01\x00\x00\x03\x00\xff\x01\x00\x00\x00\x00\xf0\x01\x00\x00\x01\x00\xf0\x01\x00\x00\x02\x00\xf0\x01\x00\x00\x03\x00\xf0" neo_asic_cmd "\x00\xe2\x15\x00" neo_asic_cmd "\x00\x37\x32\x02" neo_asic_cmd "\x00\xda\x8e\x44" neo_asic_cmd "\x00\xc4\x08\x00\x01\x00\x05\x56\x00\xaa\x01\x00\x02\xab\x00\x55\x01\x00\x05\x56\x00\x90\x01\x00\x05\x55\x00\xaa\x01\x00\x02\xaa\x00\x55\x01\x00\x05\x55\x00\x90\x08\x00\x00\x00\x08\x00\x00\x01\x08\x00\x00\x02\x08\x00\x00\x03\x01\x00\x00\x00\x00\xff\x01\x00\x00\x01\x00\xff\x01\x00\x00\x02\x00\xff\x01\x00\x00\x03\x00\xff\x01\x00\x00\x00\x00\xf0\x01\x00\x00\x01\x00\xf0\x01\x00\x00\x02\x00\xf0\x01\x00\x00\x03\x00\xf0",0x188,dtext("getflashid_code")},
/*08*/    /* will be deleted        ---------------------------------*/{neo_asic_cmd "\x00\xe2\x15\x00" neo_asic_cmd "\x00\x37\x20\x03" neo_asic_cmd "\x00\xda\x0e\x44",0x48,dtext("write2select_menu_code")},
/*09*/    /* will be deleted        ---------------------------------*/{neo_asic_cmd "\x00\xe2\x15\x00" neo_asic_cmd "\x00\x37\x36\x02" neo_asic_cmd "\x00\xda\xae\x44" neo_asic_cmd "\x00\xc4\x00\x00",0x60,dtext("write2select_flash_code0")},
/*10*/    {neo_asic_cmd "\x00\xe0\x00\x00",0x18,dtext("write2select_srambank0_code")},
/*11*/    /* will be deleted        ---------------------------------*/{neo_asic_cmd "\x00\xe0\x00\x08",0x18,dtext("write2select_srambank1_code")},
/*12*/    /* will be deleted        ---------------------------------*/{neo_asic_cmd "\x00\xe0\x00\x10",0x18,dtext("write2select_srambank2_code")},
/*13*/    /* will be deleted        ---------------------------------*/{neo_asic_cmd "\x00\xe0\x00\x18",0x18,dtext("write2select_srambank3_code")},
/*14*/    /* will be deleted        ---------------------------------*/{neo_asic_cmd "\x00\xe0\x00\x20",0x18,dtext("write2select_srambank4_code")},
/*15*/    /* will be deleted        ---------------------------------*/{neo_asic_cmd "\x00\xe0\x00\x28",0x18,dtext("write2select_srambank5_code")},
Пример #3
0
/***********************************************************************
 **  PostScript mainline processor.				      **
 ***********************************************************************/
static void psmain(void)
{
    int color_done;			/* done doing colors */
	int i;
	
	ini_JOB();					/* init job stuff		*/
    ini_PAGE();					/* init %%Page: comment state */
	Fofd = 0;
    GraphicsPresentFlag = 0;
    NoFont = 0;
	width_open(); /* Open WIDTH for H&Js char-width round-off errors*/
	FontBase = 1000;
#ifdef TRACE
    if(debugger_trace)
		p_info(PI_TRACE, "Starting job:%s\n",JobName);
#endif
    cc_hit = 0;
	cc_mask = (1 & Plates); /* hit nothing, set all black */
	if ( !cc_mask) 
		m_fopen(tpname, "w+", 1); /* delete prev version of .tp */
    spot_pass = 1;				/* 1st pass */
    color_done = 0;				/* not done yet */
	PageRotationAngle = 0;
	frame_fg_attribute = 0;		/* default is opaque */
	prologue_output_flag = 0;
	PageNo1 = 1;
	underscore_min = 10;
	overflow_page_buff_count = 0;
	memset ( (char *)overflow_page_buff, 0, sizeof (overflow_page_buff) );
	ExitError = 0;
	HNJ_LockFailureFlag = 0;
    while(color_done != 1 )		/* until we get all colors */
    {
		FootnoteFrameFlag = 0;
		BlackPaint_cc_mask = cc_mask;
		PaintOnPage = 0;
		blend_flag = 0;
		BlendAngle = 0;
		BlendEndColor = 0;
		in_overflow = 0;
		was_overflow = 0;
		Linesub = -1;			/* clear text/escapement buffer	*/
		flagGlyph = 0;
		*GlyphName = 0;
		for(i=0; i<1999; i++)
		{
			Line[i] = 0;
			Kspace[i] = 0;
		}
		for(i=0; i<40; i++)
			bf_kmd80[i].active_flag = 0;
		fowrd =  256;
		Xmark =  0;
		y_max =  0;
		Oldfont = -1;
		Holdfont =  0;
		usw = 0;
		StrikeThruRuleStartFlag = 0;
		FlashOn = 1;
		CurrentFrame = 0;
		CurrentEle = 0;
		memset( (char *)&fo_line_def.FoStatusLength, 0, sizeof(LDEF) );
		DontPaintFlag = fo_line_def.MiscLineFlags & 0x10;
		not_lnum = 1;			/* Default: Put text font, not line-num font*/
		last_lnum = 0;
		jbl = 0;
		repeatno = 0;
		Obdegree = 0;
		Old_ob = 0;
		Hold_ob = 0;
		Holdss = 0;
		Holdps = 0;
		Oldss = 0;
		Oldps = 0;
		Ktabmode = 0;
		psend = 0;
		WidthOfNumeric = 0;
		memset ( page_number, 0, sizeof(page_number) );
		CurrentLineBcEc = 0;
		PrevLineBcEc = 0;
		BcEcExtraLeadNeeded = 0;
		BcEcExtraLead = 0;
		LastLinemaxErr = 0;
		cc_hit &= (Plates & ~1); /* only use plates to be output */
#ifdef TRACE
		if(debugger_trace)
		{
			p_info(PI_TRACE, "spot color pass %d, cc_mask: %lo , cc_hit: %lo\n",
				   spot_pass, cc_mask, cc_hit);
			p_info(PI_TRACE, "processing Tree: '%s', Dir: '%s',file: '%s', type= %d\n",
				   TreeName, SubDirName, JobName, FileType);
		}
#endif
		switch(FileType)
		{
		  case 0:				/* Galley output */
			if (spot_pass != 2)
				cc_hit = 0;
			if((err = dtext()) )
				error("processing FO file, err = ",JobName,err);
			if( (cc_hit < 2) ||	/* picked up no color(s) */
			   (spot_pass != 1) || /* or on second pass thru file */
				( !KeyOutputType) )	/* or composite */
				color_done = 1;	/* we are done */
			else
			{
				spot_pass = 2;	/* mark as 2nd pass thru file */
				cc_hit &= (Plates & ~1); /* mask off black */
				cc_mask = 0;	/* not the black we start with */
				galley_count = 0;
				MasterOutputSwitch = 1;
				if(Fofd)		/* if still open */
					foread(1);	/* rewind open FO file */
			}
			break;
			
		  case 1:				/* DesignMaster */
			if((err = dxy()) )
				p_info(PI_ELOG, "ERROR --processing Tree: '%s', Dir: '%s', Unit: %s\n",
					   TreeName,SubDirName,JobName);
			color_done = 1;		/* color loop inside dxy */
			break;
		}						/* end switch(FileType) */
		m_close(-1);			/* close all output */
    }							/* end while(color_done!=1) */
    if (wdfd)
    {
		p_close (wdfd);
		wdfd = 0;
    }
    if (Fofd)
    {
		p_close(Fofd);
		Fofd = 0;
		FoName[0] = 0;
    }
   if (TrailerName) {
		fclose(TrailerName);
		TrailerName = NULL;
    }
    if (PrologName)
    {
		fclose(PrologName);
		PrologName = NULL;

		if (EpsFlag)
		   strcpy (logname, p_path(TreeName, EPS_FILE, SubDirName, tpname));
		else if (BookPrint)
		   strcpy (logname, p_path(TreeName, OUTPUT_FILE, ParentDirName, tpname));
		else
		   strcpy (logname, p_path(TreeName, OUTPUT_FILE, SubDirName, tpname));

	  	sprintf(shell_msg,"cat %s >> %s \n mv %s %s \n cat %s >> %s \n mv %s %s",
			prologname, trailername,
			trailername, prologname,
			logname, prologname,
			prologname, logname);
		system(shell_msg);
    }
#ifdef TRACE
    if(debugger_trace)
		p_info(PI_TRACE, "Finished job, Tree: '%s', Dir: '%s', Name: '%s'.\n",
			   TreeName,SubDirName,JobName);
#endif
}