NetSurf
|
Conception: Generalized output-in-pages. More...
#include <stdbool.h>
#include <libcss/libcss.h>
Go to the source code of this file.
Data Structures | |
struct | print_settings |
Settings for a print - filled in by print_make_settings or 'manually' by the caller. More... | |
Enumerations | |
enum | { MARGINLEFT = 0 , MARGINRIGHT = 1 , MARGINTOP = 2 , MARGINBOTTOM = 3 } |
enum | print_configuration { PRINT_DEFAULT , PRINT_OPTIONS } |
Predefined printing configuration names. More... | |
Functions | |
bool | print_basic_run (struct hlcache_handle *, const struct printer *, struct print_settings *) |
This function calls print setup, prints page after page until the whole content is printed calls cleaning up afterwise. More... | |
bool | print_set_up (struct hlcache_handle *content, const struct printer *printer, struct print_settings *settings, double *height) |
This function prepares the content to be printed. More... | |
bool | print_draw_next_page (const struct printer *printer, struct print_settings *settings) |
This function draws one page, beginning with the height offset of done_height. More... | |
bool | print_cleanup (struct hlcache_handle *, const struct printer *, struct print_settings *settings) |
Memory allocated during printing is being freed here. More... | |
struct print_settings * | print_make_settings (print_configuration configuration, const char *url, const struct gui_layout_table *font_func) |
Setup print settings for print render operation. More... | |
Variables | |
bool | html_redraw_printing |
int | html_redraw_printing_border |
int | html_redraw_printing_top_cropped |
Conception: Generalized output-in-pages.
Allows the current content to be 'printed': either into a pdf file (any other later?) or to any kind of other output destination that divides the website into pages - as a printer. The basic usage is calling print_basic_run which sets everything up, prints page after page until the whole content is printed and cleans everyting up. If there are any other, printer specific routines to be performed in the meantime - there can be set up any other printing funcion, which can use print_set_up, print_draw_next_page and print_cleanup directly.
Definition in file print.h.
anonymous enum |
enum print_configuration |
bool print_basic_run | ( | hlcache_handle * | content, |
const struct printer * | printer, | ||
struct print_settings * | settings | ||
) |
This function calls print setup, prints page after page until the whole content is printed calls cleaning up afterwise.
content | The content to be printed |
printer | The printer interface for the printer to be used |
settings | The settings for printing to use |
Definition at line 64 of file print.c.
References content_get_height(), done_height, print_cleanup(), print_draw_next_page(), print_set_up(), printed_content, and settings.
Referenced by pdf_button_clicked_cb().
bool print_cleanup | ( | hlcache_handle * | content, |
const struct printer * | printer, | ||
struct print_settings * | settings | ||
) |
Memory allocated during printing is being freed here.
content | The original content |
printer | The printer interface for the printer to be used |
settings | The print settings to use. |
Definition at line 228 of file print.c.
References hlcache_handle_release(), html_redraw_printing, print_settings::output, printer::print_end, printed_content, and settings.
Referenced by ami_print_cont(), gtk_print_signal_end_print(), and print_basic_run().
bool print_draw_next_page | ( | const struct printer * | printer, |
struct print_settings * | settings | ||
) |
This function draws one page, beginning with the height offset of done_height.
printer | The printer interface for the printer to be used |
settings | The settings for printing to use |
Definition at line 176 of file print.c.
References content_redraw_data::background_colour, clip(), content_redraw(), done_height, content_redraw_data::height, html_redraw_printing, html_redraw_printing_border, html_redraw_printing_top_cropped, redraw_context::interactive, nsoption_bool, page_content_height, page_content_width, printer::plotter, printer::print_next_page, printed_content, print_settings::priv, content_redraw_data::repeat_x, content_redraw_data::repeat_y, print_settings::scale, content_redraw_data::scale, settings, content_redraw_data::width, content_redraw_data::x, and content_redraw_data::y.
Referenced by ami_print_cont(), gtk_print_signal_draw_page(), and print_basic_run().
struct print_settings * print_make_settings | ( | print_configuration | configuration, |
const char * | filename, | ||
const struct gui_layout_table * | font_func | ||
) |
Setup print settings for print render operation.
Setup print settings for print render operation.
configuration | the requested configuration |
filename | the filename or NULL |
font_func | font handling functions |
Definition at line 254 of file print.c.
References print_settings::copies, DEFAULT_COPIES, DEFAULT_EXPORT_SCALE, DEFAULT_MARGIN_BOTTOM_MM, DEFAULT_MARGIN_LEFT_MM, DEFAULT_MARGIN_RIGHT_MM, DEFAULT_MARGIN_TOP_MM, DEFAULT_PAGE_HEIGHT, DEFAULT_PAGE_WIDTH, print_settings::font_func, MARGINBOTTOM, MARGINLEFT, MARGINRIGHT, print_settings::margins, MARGINTOP, nsoption_int, print_settings::output, print_settings::page_height, print_settings::page_width, PRINT_DEFAULT, PRINT_OPTIONS, print_settings::scale, and settings.
Referenced by ami_print(), pdf_button_clicked_cb(), and print_button_clicked_cb().
bool print_set_up | ( | hlcache_handle * | content, |
const struct printer * | printer, | ||
struct print_settings * | settings, | ||
double * | height | ||
) |
This function prepares the content to be printed.
The current browser content is duplicated and resized, printer initialization is called.
content | The content to be printed |
printer | The printer interface for the printer to be used |
settings | The settings for printing to use |
height | updated to the height of the printed content |
Definition at line 148 of file print.c.
References content_get_height(), done_height, height, print_apply_settings(), printer::print_begin, print_init(), printed_content, and settings.
Referenced by ami_print(), gtk_print_signal_begin_print(), and print_basic_run().
|
extern |
Definition at line 51 of file print.c.
Referenced by html_redraw_box(), html_redraw_inline_background(), html_redraw_text_decoration(), print_cleanup(), and print_draw_next_page().
|
extern |
Definition at line 52 of file print.c.
Referenced by html_redraw_box(), and print_draw_next_page().
|
extern |
Definition at line 53 of file print.c.
Referenced by html_redraw_box(), and print_draw_next_page().