Ejemplo n.º 1
0
void ami_print_end(void)
{
	ami_free_layers(ami_print_info.gg);
	FreeVec(ami_print_info.gg);
	DisposeObject(ami_print_info.objects[OID_MAIN]);
	glob = &browserglob;

	ami_print_close_device();
}
Ejemplo n.º 2
0
void ami_print_end(void)
{
	ami_free_layers(ami_print_info.gg);
	FreeVec(ami_print_info.gg);
	DisposeObject(ami_print_info.objects[OID_MAIN]);
	ami_gui_set_default_gg();

	ami_print_close_device();
	ami_print_free();
}
Ejemplo n.º 3
0
void ami_print(struct hlcache_handle *c, int copies)
{
	double height;
	float scale = nsoption_int(print_scale) / 100.0;

	if(ami_print_info.msgport == NULL)
		ami_print_init();
#ifdef __amigaos4__
	if(!(ami_print_info.PReq =
			(struct IODRPTagsReq *)AllocSysObjectTags(ASOT_IOREQUEST,
				ASOIOR_Size, sizeof(struct IODRPTagsReq),
				ASOIOR_ReplyPort, ami_print_info.msgport,
				ASO_NoTrack, FALSE,
				TAG_DONE))) return;
#else
	if(!(ami_print_info.PReq =
			(struct IODRPTagsReq *)CreateIORequest(ami_print_info.msgport,
				sizeof(struct IODRPTagsReq)))) return;
#endif

	if(OpenDevice("printer.device", nsoption_int(printer_unit),
			(struct IORequest *)ami_print_info.PReq, 0))
	{
		amiga_warn_user("CompError","printer.device");
		return;
	}

	ami_print_info.PD = (struct PrinterData *)ami_print_info.PReq->io_Device;
	ami_print_info.PED = &ami_print_info.PD->pd_SegmentData->ps_PED;

	ami_print_info.ps = print_make_settings(PRINT_DEFAULT, nsurl_access(hlcache_handle_get_url(c)), ami_layout_table);
	ami_print_info.ps->page_width = ami_print_info.PED->ped_MaxXDots;
	ami_print_info.ps->page_height = ami_print_info.PED->ped_MaxYDots;
	ami_print_info.ps->scale = scale;

	if(!print_set_up(c, &amiprinter, ami_print_info.ps, &height))
	{
		amiga_warn_user("PrintError","print_set_up() returned false");
		ami_print_close_device();
		return;
	}

	height *= ami_print_info.ps->scale;
	ami_print_info.pages = height / ami_print_info.ps->page_height;
	ami_print_info.c = c;

	ami_print_progress();

	while(ami_print_cont()); /* remove while() for async printing */
}
Ejemplo n.º 4
0
void ami_print(struct hlcache_handle *c, int copies)
{
	double height, print_height;
	float scale = option_print_scale / 100.0;

	if(!ami_print_info.msgport) return;

	if(!(ami_print_info.PReq =
			(struct IODRPTagsReq *)AllocSysObjectTags(ASOT_IOREQUEST,
				ASOIOR_Size, sizeof(struct IODRPTagsReq),
				ASOIOR_ReplyPort, ami_print_info.msgport,
				ASO_NoTrack, FALSE,
				TAG_DONE))) return;

	if(OpenDevice("printer.device", option_printer_unit,
			(struct IORequest *)ami_print_info.PReq, 0))
	{
		warn_user("CompError","printer.device");
		return;
	}

	ami_print_info.PD = (struct PrinterData *)ami_print_info.PReq->io_Device;
	ami_print_info.PED = &ami_print_info.PD->pd_SegmentData->ps_PED;

	ami_print_info.ps = print_make_settings(PRINT_DEFAULT, content_get_url(c), &nsfont);
	ami_print_info.ps->page_width = ami_print_info.PED->ped_MaxXDots;
	ami_print_info.ps->page_height = ami_print_info.PED->ped_MaxYDots;
	ami_print_info.ps->scale = scale;

	if(!print_set_up(c, &amiprinter, ami_print_info.ps, &height))
	{
		warn_user("PrintError","print_set_up() returned false");
		ami_print_close_device();
		return;
	}

	height *= ami_print_info.ps->scale;
	ami_print_info.pages = height / ami_print_info.ps->page_height;
	ami_print_info.c = c;

	ami_print_progress();

	while(ami_print_cont()); /* remove while() for async printing */
}