libgeda

f_print.c File Reference

functions to write postscript files More...

#include <config.h>
#include <version.h>
#include <stdio.h>
#include <unistd.h>
#include <time.h>
#include <math.h>
#include "libgeda_priv.h"
Include dependency graph for f_print.c:

Go to the source code of this file.

Data Structures

struct  glyph_list

Defines

#define PROLOG_BUFFER_SIZE   8192

Functions

static int f_print_get_unicode_chars (TOPLEVEL *toplevel, const GList *obj_list, int count, gunichar *table)
 Converts all text strings to unicode format.
static void f_print_unicode_map (FILE *fp, int count, gunichar *table)
 Prints unicode map to postscript document.
void f_print_set_line_width (FILE *fp, int width)
 Prints the line width in mils to a postscript document.
int f_print_set_color (TOPLEVEL *toplevel, FILE *fp, int color)
 Prints the color to a postscript document.
int f_print_header (TOPLEVEL *toplevel, PAGE *page, FILE *fp, int paper_size_x, int paper_size_y, int eps)
 Prints the header to a postscript document.
void f_print_footer (FILE *fp)
 Prints the footer to a postscript document.
void f_print_objects (TOPLEVEL *toplevel, FILE *fp, const GList *obj_list, int start_x, int start_y, float scale, int unicode_count, gunichar *unicode_table)
 Print all objects from the toplevel TOPLEVEL object.
int f_print_file (TOPLEVEL *toplevel, PAGE *page, const char *filename)
 Print the current TOPLEVEL object to a file as a postscript document.
int f_print_command (TOPLEVEL *toplevel, PAGE *page, const char *command)
 Opens a pipe to the specified command and prints the current TOPLEVEL object to the pipe as a postscript document.
int f_print_stream (TOPLEVEL *toplevel, PAGE *page, FILE *fp)
 Print the current TOPLEVEL object to a stream as a postscript document.
void f_print_set_type (TOPLEVEL *toplevel, int type)
 Sets the current TOPLEVEL object output type.
int f_print_initialize_glyph_table (void)
 Initializes the glyph translation table.

Variables

GHashTable * unicode_char_to_glyph = NULL
 Hashtable storing mapping between character and postscript glyph name.
static struct glyph_list glyphs []

Detailed Description

Definition in file f_print.c.


Define Documentation

#define PROLOG_BUFFER_SIZE   8192

Function Documentation

static int f_print_get_unicode_chars ( TOPLEVEL toplevel,
const GList *  obj_list,
int  count,
gunichar *  table 
) [static]
Function Description
Converts all text strings to unicode format.
Parameters:
[in,out]toplevelThe output TOPLEVEL element to store converted strings in.
[in]obj_listThe object containing strings for conversion.
[in]countThe number of elements in the unicode table.
[in]tableThe unicode table.
Returns:
count on success, 0 otherwise.

Definition at line 639 of file f_print.c.

Here is the call graph for this function:

static void f_print_unicode_map ( FILE *  fp,
int  count,
gunichar *  table 
) [static]
Function Description
Prints unicode map to postscript document.
Parameters:
[in]fpThe postscript document to write unicode map to.
[in]countSize of unicode map table.
[in]tableThe unicode map to write.

Definition at line 706 of file f_print.c.

void f_print_set_line_width ( FILE *  fp,
int  width 
)
Function Description
This function writes the line width in mils to the specified postscript document.
Parameters:
[in]fpThe postscript document to write to.
[in]widthThe width of the line in mils to set.

Definition at line 53 of file f_print.c.

int f_print_set_color ( TOPLEVEL toplevel,
FILE *  fp,
int  color 
)
Function Description
This function converts the color number passed to a string and prints it to the postscript document provided.
Parameters:
[in]toplevelThe current TOPLEVEL structure.
[in]fpThe postscript document to print the color to.
[in]colorInteger color to convert and print.
Returns:
1 if the colour is enabled, 0 if disabled.

Definition at line 71 of file f_print.c.

Here is the call graph for this function:

int f_print_header ( TOPLEVEL toplevel,
PAGE page,
FILE *  fp,
int  paper_size_x,
int  paper_size_y,
int  eps 
)
Function Description
This function will print a document preamble and header for a postscript document.
Parameters:
[in]toplevelThe TOPLEVEL object.
[in]pageThe page to create document for.
[in]fpThe postscript document to write to.
[in]paper_size_xThe width of the document on paper in inches.
[in]paper_size_yThe height of the document on paper in inches.
[in]epswhether to create a eps of a ps document
Returns:
0 on success, -1 on failure.

Definition at line 105 of file f_print.c.

void f_print_footer ( FILE *  fp)
Function Description
This function will print a document footer and end a postscript document.
Parameters:
[in]fpThe postscript document to write footer to.

Definition at line 217 of file f_print.c.

void f_print_objects ( TOPLEVEL toplevel,
FILE *  fp,
const GList *  obj_list,
int  start_x,
int  start_y,
float  scale,
int  unicode_count,
gunichar *  unicode_table 
)
Function Description
This function will parse the head parameter for all objects and write the to the postscript document.
Parameters:
[in]toplevelThe current TOPLEVEL object.
[in]fpThe postscript document to print to.
[in]obj_listList of objects to be printed.
[in]start_xX origin on page to start printing objects.
[in]start_yY origin on page to start printing objects.
[in]scaleScale factor for object output.
[in]unicode_countNumber of items in unicode table.
[in]unicode_tableTable of unicode items.
Returns:
void

Definition at line 238 of file f_print.c.

Here is the call graph for this function:

int f_print_file ( TOPLEVEL toplevel,
PAGE page,
const char *  filename 
)
Function Description
Parameters:
[in]toplevelThe TOPLEVEL object.
[in]pageThe PAGE to print.
[in]filenameThe file name of the output postscript document.
Returns:
0 on success, -1 on failure.

Definition at line 365 of file f_print.c.

Here is the call graph for this function:

int f_print_command ( TOPLEVEL toplevel,
PAGE page,
const char *  command 
)
Function Description
Parameters:
[in]toplevelThe TOPLEVEL object.
[in]pageThe PAGE to print.
[in]commandThe command to print to.
Returns:
0 on success, -1 on failure.

Definition at line 399 of file f_print.c.

Here is the call graph for this function:

int f_print_stream ( TOPLEVEL toplevel,
PAGE page,
FILE *  fp 
)
Function Description
Parameters:
[in]toplevelThe TOPLEVEL object to print.
[in]fpA pointer to an open IO stream
Returns:
0 on success, -1 on failure.

Definition at line 428 of file f_print.c.

Here is the call graph for this function:

void f_print_set_type ( TOPLEVEL toplevel,
int  type 
)
Function Description
Sets the current TOPLEVEL object output type.
Parameters:
[in,out]toplevelThe TOPLEVEL object to set output type in.
[in]typeThe print type to set.

Definition at line 623 of file f_print.c.

int f_print_initialize_glyph_table ( void  )
Function Description
Initializes the glyph translation table
Returns:
0

Definition at line 4441 of file f_print.c.


Variable Documentation

GHashTable* unicode_char_to_glyph = NULL

Definition at line 38 of file f_print.c.

struct glyph_list glyphs[] [static]
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines