⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 xlc_init.c

📁 <B>Digital的Unix操作系统VAX 4.2源码</B>
💻 C
📖 第 1 页 / 共 2 页
字号:
    cg_st.cgst_sheet_len = 79200;/*    cg_st.cgst_last_showpage = TRUE; Moved to xlc_main*/    cg_st.cgst_vm_size = ONE_MEGABYTE - PREAMBLE_SIZE;    /* cg_st.print_prologue has already been set by XLC_MAIN, so it is now valid */    if	(cg_st.print_prologue) 	{	    cg_st .cgst_vm_size = ONE_MEGABYTE - PREAMBLE_SIZE;    	}    	else	{	    cg_st .cgst_vm_size = ONE_MEGABYTE;	}    cg_st.cgst_output_mode = trn$k_eight_bit; 		/*By default full binary enabled */    cg_st.cgst_output_sixel_ptr = output_sixel_in_bin; 	/* by default full binary enabled */    cg_st.cgst_image_mode = trn$k_image_readhexstring;    /*     * Scan the item list updating the auto-variables width, height, and     * orient, if trn$_page_width, trn$_page_height, and trn$_page_orientation     * items codes are found.     */    while (item_ptr->code != trn$_end_of_list)       {	switch (item_ptr->code)           {	    case trn$_font_SGR:		if (	(item_ptr->address >= 10) 		     && (item_ptr->address <= 19)		    )		    {			cg_st.cgst_item_list_sgr = item_ptr->address;		    }		ITEM_TRACE_MACRO("(Got an SGR selection of %d) print flush\n",item_ptr->address);		break;	    case trn$_page_width:		width = item_ptr->address;		ITEM_TRACE_MACRO("(Got a page width item value of %d) print flush\n",item_ptr->address);		break;	    case trn$_page_orientation:		if (item_ptr->address == trn$k_page_portrait)			orient = 0;		if (item_ptr->address == trn$k_page_landscape)			orient = 1;		ITEM_TRACE_MACRO("(Got a page orientation item value of %d) print flush\n",item_ptr->address);		break;	    case trn$_page_height:		height = item_ptr->address;		/* convert point->centipoint, and set the sheet length */		cg_st.cgst_sheet_len = height * 100 ;		ITEM_TRACE_MACRO("(Got a page height item value of %d) print flush\n",item_ptr->address);		break;/* Moved to xlc_main**	    case trn$_page_fragment:**    		switch (item_ptr->address) **		   {**    		    case trn$k_multi_page:**    			cg_st.cgst_last_showpage = TRUE;	break;**    		    case trn$k_page_fragment:**    			cg_st.cgst_last_showpage = FALSE;	break;**    		   }**		ITEM_TRACE_MACRO("(Got a page fragment item value of %d) print flush\n",item_ptr->address);**		break;*/	    case trn$_vmsize:    		if  (cg_st.print_prologue) 		    {			cg_st .cgst_vm_size = item_ptr->address - PREAMBLE_SIZE;		    }		else		    {			cg_st .cgst_vm_size = item_ptr->address;		    }		ITEM_TRACE_MACRO("(Got a VM size item value of %d) print flush\n",item_ptr->address);		break;	    case trn$_seven_bit:		switch (item_ptr->address)		   {			/* Note, do not move the instruction 			**	cg_st.cgst_output_mode = item_ptr->address;			** out of the case statements.			** although it is the same for all cases			** it should only be executed if a valid case is encountered			*/			case trn$k_eight_bit:				cg_st.cgst_output_mode = item_ptr->address;				if ( cg_st.cgst_output_sixel_ptr != output_sixel_as_font )				  cg_st.cgst_output_sixel_ptr = output_sixel_in_bin;			/* bin vs. hex now part of image_compression case */				break;			case trn$k_seven_bit:			case trn$k_gl_gr_only:			case trn$k_gl_only:				cg_st.cgst_output_mode = item_ptr->address;				if ( cg_st.cgst_output_sixel_ptr != output_sixel_as_font )				  cg_st.cgst_output_sixel_ptr = output_sixel_in_hex; 			/* bin vs. hex now part of image_compression case */				break;		    }		    		ITEM_TRACE_MACRO("(Got a 7/8 bit item value of %d) print flush\n",item_ptr->address);		break;	    case trn$_image_compression:		switch (item_ptr->address) {			case trn$k_image_readsixelstring:	/* not implemented -							treat as normal image */			case trn$k_image_readhexstring:				/* includes both hex and binary formats */				cg_st.cgst_image_mode = item_ptr->address;				if ( cg_st.cgst_output_mode == trn$k_eight_bit )				        cg_st.cgst_output_sixel_ptr = output_sixel_in_bin;				  else  cg_st.cgst_output_sixel_ptr = output_sixel_in_hex;				break;			case trn$k_image_sixel_font:				cg_st.cgst_image_mode = item_ptr->address;				cg_st.cgst_output_sixel_ptr = output_sixel_as_font; 				/* right now output_sixel_as_font uses					seven bit characters only;  enhance					this test if it ever uses characters					from the right side */				break;		    }		break;	    }	item_ptr++;	}    /*     * If landscape mode was explicitly selected on the print comand     * then preload PFS 21 and SGR 15, then go through the normal     * page format selection process.      * If landscape mode was selected, swap the usage of height and      * width (Change made on  1-APR-1987 13:44:19, to close     * a hole in the interface specification.     * The symbiont was always passing the same numbers regardless      * of orientation, and we were a minority in believing that      * height should always be height     */    if (orient == 1)        {	swap_buffer = width;	width = height;	height = swap_buffer;        cg_st.cpinit_vals.initial_sgr = 5;	cg_st.cpinit_vals.initial_pfs = decpfstbl[21 - FIRST_PRIVATE_PFS];       }    /* Now go through and try to match one of the eight page formats */    if ((width  >=  607  &&  width  <=  617) &&	(height >=  787  &&  height <=  797) &&	(orient == 0))        {    	/* Portrait, North American matched */        cg_st.cpinit_vals.initial_sgr = 0;	cg_st.cpinit_vals.initial_pfs = decpfstbl[20 - FIRST_PRIVATE_PFS];         }    else  if ((width  >=  787  &&  width  <=  797) &&	(height >=  607  &&  height <=  617) &&	(orient == 1))        {    	/* Landscape, North American matched */        cg_st.cpinit_vals.initial_sgr = 5;	cg_st.cpinit_vals.initial_pfs = decpfstbl[21 - FIRST_PRIVATE_PFS];         }    else  if ((width  >=  590  &&  width  <=  600) &&	(height >=  837  &&  height <=  847) &&	(orient == 0))        {    	/* Portrait, A4 matched */        cg_st.cpinit_vals.initial_sgr = 6;	cg_st.cpinit_vals.initial_pfs = decpfstbl[22 - FIRST_PRIVATE_PFS];         }    else  if ((width  >=  837  &&  width  <=  847) &&	(height >=  590  &&  height <=  600) &&	(orient == 1))        {    	/* Landscape, A4 matched */        cg_st.cpinit_vals.initial_sgr = 5;	cg_st.cpinit_vals.initial_pfs = decpfstbl[23 - FIRST_PRIVATE_PFS];         }   else  if ((width  >=  607 &&  width  <=  617) &&	(height >=  1003  &&  height <=  1013) &&	(orient == 0))        {    	/* Portrait, legal matched */        cg_st.cpinit_vals.initial_sgr = 0;	cg_st.cpinit_vals.initial_pfs = decpfstbl[24 - FIRST_PRIVATE_PFS];         }    else  if ((width  >=  1003  &&  width <= 1013) &&	(height >=  607 &&  height <=  617 ) &&	(orient == 1))        {    	/* Landscape, legal matched */        cg_st.cpinit_vals.initial_sgr = 5;	cg_st.cpinit_vals.initial_pfs = decpfstbl[25 - FIRST_PRIVATE_PFS];     	}    else  if ((width  >=  787  &&  width  <=  797) &&	(height >=  1219  &&  height <=  1229) &&	(orient == 0))        {    	/* Portrait, B matched */        cg_st.cpinit_vals.initial_sgr = 0;	cg_st.cpinit_vals.initial_pfs = decpfstbl[26 - FIRST_PRIVATE_PFS];         }    else  if ((width  >=  1219  &&  width  <=  1229) &&	(height >=  787  &&  height <=  797) &&	(orient == 1))        {    	/* Landscape, B matched */        cg_st.cpinit_vals.initial_sgr = 5;	cg_st.cpinit_vals.initial_pfs = decpfstbl[27 - FIRST_PRIVATE_PFS]; 	}    else    /*     * If we are here the paper size is does not have a traditional Page     * Format Select sequence or PFS number.  Fill in the PFSBOUNDS      * structure in cg_st.cpinit_vals.initial_pfs by hand using the      * page width and page height.  Subtract 150 pixels (HALF_INCH_CTPT centipoints)     * to get the right margin, line end, bottom margin, and page end.     */        {    	cg_st.cpinit_vals.initial_pfs.pfs_lrm.min = 0;    	cg_st.cpinit_vals.initial_pfs.pfs_lrm.max = (width * 100) - HALF_INCH_CTPT;    	cg_st.cpinit_vals.initial_pfs.pfs_lhe.min = 0;    	cg_st.cpinit_vals.initial_pfs.pfs_lhe.max = (width * 100) - HALF_INCH_CTPT;    	cg_st.cpinit_vals.initial_pfs.pfs_tbm.min = 0;    	cg_st.cpinit_vals.initial_pfs.pfs_tbm.max = (height * 100) - HALF_INCH_CTPT;   	cg_st.cpinit_vals.initial_pfs.pfs_phe.min = 0;   	cg_st.cpinit_vals.initial_pfs.pfs_phe.max = (height * 100) - HALF_INCH_CTPT;    	cg_st.cpinit_vals.initial_pfs.pfs_pwid = orient ? height * 100 : width * 100;    	cg_st.cpinit_vals.initial_pfs.pfs_plen = orient ? width * 100 : height * 100;    	cg_st.cpinit_vals.initial_pfs.pfs_or = orient ? ORIENT_LAND : ORIENT_PORT;    	}   /* Let's see if the default SGR for the paper has been overriden */    if	(cg_st.cgst_item_list_sgr !=0)	{	    cg_st.cpinit_vals.initial_sgr = cg_st.cgst_item_list_sgr - 10;	}}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -