本文整理汇总了C++中ps_output::get_file方法的典型用法代码示例。如果您正苦于以下问题:C++ ps_output::get_file方法的具体用法?C++ ps_output::get_file怎么用?C++ ps_output::get_file使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ps_output
的用法示例。
在下文中一共展示了ps_output::get_file方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: print_header_comments
void resource_manager::print_header_comments(ps_output &out)
{
for (resource *r = resource_list; r; r = r->next)
if (r->type == RESOURCE_FONT && (r->flags & resource::FONT_NEEDED))
supply_resource(r, 0, 0);
print_resources_comment(resource::NEEDED, out.get_file());
print_resources_comment(resource::SUPPLIED, out.get_file());
print_language_level_comment(out.get_file());
print_extensions_comment(out.get_file());
}
示例2: import_file
void resource_manager::import_file(const char *filename, ps_output &out)
{
out.end_line();
string name(filename);
resource *r = lookup_resource(RESOURCE_FILE, name);
supply_resource(r, -1, out.get_file(), 1);
}
示例3: output_prolog
void resource_manager::output_prolog(ps_output &out)
{
FILE *outfp = out.get_file();
out.end_line();
char *path;
if (!getenv("GROPS_PROLOGUE")) {
string e = "GROPS_PROLOGUE";
e += '=';
e += GROPS_PROLOGUE;
e += '\0';
if (putenv(strsave(e.contents())))
fatal("putenv failed");
}
char *prologue = getenv("GROPS_PROLOGUE");
FILE *fp = font::open_file(prologue, &path);
if (!fp)
fatal("can't find `%1'", prologue);
fputs("%%BeginResource: ", outfp);
procset_resource->print_type_and_name(outfp);
putc('\n', outfp);
process_file(-1, fp, path, outfp);
fclose(fp);
a_delete path;
fputs("%%EndResource\n", outfp);
}
示例4: media_set
void ps_printer::media_set()
{
/*
* The setpagedevice implies an erasepage and initgraphics, and
* must thus precede any descriptions for a particular page.
*
* NOTE:
* This does not work with ps2pdf when there are included eps
* segments that contain PageSize/setpagedevice.
* This might be a bug in ghostscript -- must be investigated.
* Using setpagedevice in an .eps is really the wrong concept, anyway.
*
* NOTE:
* For the future, this is really the place to insert other
* media selection features, like:
* MediaColor
* MediaPosition
* MediaType
* MediaWeight
* MediaClass
* TraySwitch
* ManualFeed
* InsertSheet
* Duplex
* Collate
* ProcessColorModel
* etc.
*/
if (!(broken_flags & (USE_PS_ADOBE_2_0|NO_PAPERSIZE))) {
out.begin_comment("BeginFeature:")
.comment_arg("*PageSize")
.comment_arg(media_name())
.end_comment();
int w = media_width();
int h = media_height();
if (w > 0 && h > 0)
// warning to user is done elsewhere
fprintf(out.get_file(),
"<< /PageSize [ %d %d ] /ImagingBBox null >> setpagedevice\n",
w, h);
out.simple_comment("EndFeature");
}
}
示例5: document_setup
void resource_manager::document_setup(ps_output &out)
{
int nranks = 0;
resource *r;
for (r = resource_list; r; r = r->next)
if (r->rank >= nranks)
nranks = r->rank + 1;
if (nranks > 0) {
// Sort resource_list in reverse order of rank.
Presource *head = new Presource[nranks + 1];
Presource **tail = new Presource *[nranks + 1];
int i;
for (i = 0; i < nranks + 1; i++) {
head[i] = 0;
tail[i] = &head[i];
}
for (r = resource_list; r; r = r->next) {
i = r->rank < 0 ? 0 : r->rank + 1;
*tail[i] = r;
tail[i] = &(*tail[i])->next;
}
resource_list = 0;
for (i = 0; i < nranks + 1; i++)
if (head[i]) {
*tail[i] = resource_list;
resource_list = head[i];
}
a_delete head;
a_delete tail;
// check it
for (r = resource_list; r; r = r->next)
if (r->next)
assert(r->rank >= r->next->rank);
for (r = resource_list; r; r = r->next)
if (r->type == RESOURCE_FONT && r->rank >= 0)
supply_resource(r, -1, out.get_file());
}
}