Data Structures | Macros | Enumerations | Functions
hardcopy.c File Reference
#include <assert.h>
#include <inttypes.h>
#include <string.h>
#include "nvim/ascii.h"
#include "nvim/vim.h"
#include "nvim/buffer.h"
#include "nvim/charset.h"
#include "nvim/eval.h"
#include "nvim/ex_cmds2.h"
#include "nvim/ex_docmd.h"
#include "nvim/fileio.h"
#include "nvim/garray.h"
#include "nvim/hardcopy.h"
#include "nvim/mbyte.h"
#include "nvim/memline.h"
#include "nvim/memory.h"
#include "nvim/message.h"
#include "nvim/option.h"
#include "nvim/os/input.h"
#include "nvim/os/os.h"
#include "nvim/path.h"
#include "nvim/screen.h"
#include "nvim/strings.h"
#include "nvim/syntax.h"
#include "nvim/ui.h"
#include "nvim/version.h"

Data Structures

struct  prt_pos_T
 
struct  prt_mediasize_S
 
struct  prt_ps_font_S
 
struct  prt_ps_encoding_S
 
struct  prt_ps_charset_S
 
struct  prt_ps_mbfont_S
 
struct  prt_ps_resource_S
 
struct  prt_dsc_comment_S
 
struct  prt_dsc_line_S
 
struct  prt_resfile_buffer_S
 

Macros

#define PRCOLOR_BLACK   0
 
#define PRCOLOR_WHITE   0xffffff
 
#define OPT_MBFONT_USECOURIER   0
 
#define OPT_MBFONT_ASCII   1
 
#define OPT_MBFONT_REGULAR   2
 
#define OPT_MBFONT_BOLD   3
 
#define OPT_MBFONT_OBLIQUE   4
 
#define OPT_MBFONT_BOLDOBLIQUE   5
 
#define OPT_MBFONT_NUM_OPTIONS   6
 
#define PRT_FILE_BUFFER_LEN   (2048)
 
#define PRT_PS_DEFAULT_DPI   (72)
 
#define PRT_PS_DEFAULT_FONTSIZE   (10)
 
#define PRT_MEDIASIZE_LEN   ARRAY_SIZE(prt_mediasize)
 
#define PRT_PS_FONT_ROMAN   (0)
 
#define PRT_PS_FONT_BOLD   (1)
 
#define PRT_PS_FONT_OBLIQUE   (2)
 
#define PRT_PS_FONT_BOLDOBLIQUE   (3)
 
#define CS_JIS_C_1978   (0x01)
 
#define CS_JIS_X_1983   (0x02)
 
#define CS_JIS_X_1990   (0x04)
 
#define CS_NEC   (0x08)
 
#define CS_MSWINDOWS   (0x10)
 
#define CS_CP932   (0x20)
 
#define CS_KANJITALK6   (0x40)
 
#define CS_KANJITALK7   (0x80)
 
#define CS_GB_2312_80   (0x01)
 
#define CS_GBT_12345_90   (0x02)
 
#define CS_GBK2K   (0x04)
 
#define CS_SC_MAC   (0x08)
 
#define CS_GBT_90_MAC   (0x10)
 
#define CS_GBK   (0x20)
 
#define CS_SC_ISO10646   (0x40)
 
#define CS_CNS_PLANE_1   (0x01)
 
#define CS_CNS_PLANE_2   (0x02)
 
#define CS_CNS_PLANE_1_2   (0x04)
 
#define CS_B5   (0x08)
 
#define CS_ETEN   (0x10)
 
#define CS_HK_GCCS   (0x20)
 
#define CS_HK_SCS   (0x40)
 
#define CS_HK_SCS_ETEN   (0x80)
 
#define CS_MTHKL   (0x100)
 
#define CS_MTHKS   (0x200)
 
#define CS_DLHKL   (0x400)
 
#define CS_DLHKS   (0x800)
 
#define CS_TC_ISO10646   (0x1000)
 
#define CS_KR_X_1992   (0x01)
 
#define CS_KR_MAC   (0x02)
 
#define CS_KR_X_1992_MS   (0x04)
 
#define CS_KR_ISO10646   (0x08)
 
#define PRT_PROLOG_VERSION   ((char_u *)"1.4")
 
#define PRT_CID_PROLOG_VERSION   ((char_u *)"1.0")
 
#define PRT_RESOURCE_HEADER   "%!PS-Adobe-"
 
#define PRT_RESOURCE_RESOURCE   "Resource-"
 
#define PRT_RESOURCE_PROCSET   "ProcSet"
 
#define PRT_RESOURCE_ENCODING   "Encoding"
 
#define PRT_RESOURCE_CMAP   "CMap"
 
#define PRT_DSC_MISC_TYPE   (-1)
 
#define PRT_DSC_TITLE_TYPE   (1)
 
#define PRT_DSC_VERSION_TYPE   (2)
 
#define PRT_DSC_ENDCOMMENTS_TYPE   (3)
 
#define PRT_DSC_TITLE   "%%Title:"
 
#define PRT_DSC_VERSION   "%%Version:"
 
#define PRT_DSC_ENDCOMMENTS   "%%EndComments:"
 
#define SIZEOF_CSTR(s)   (sizeof(s) - 1)
 
#define PRT_PS_FONT_TO_USER(scale, size)   ((size) * ((scale)/1000.0))
 
#define PSLF   (0x0a)
 
#define PSCR   (0x0d)
 
#define prt_dsc_atend(c)   prt_dsc_text((c), "atend")
 

Enumerations

enum  PrtResourceType { PRT_RESOURCE_TYPE_PROCSET = 0, PRT_RESOURCE_TYPE_ENCODING = 1, PRT_RESOURCE_TYPE_CMAP = 2 }
 

Functions

char * parse_printoptions (void)
 
char * parse_printmbfont (void)
 
int prt_header_height (void)
 
int prt_use_number (void)
 
int prt_get_unit (int idx)
 
void ex_hardcopy (exarg_T *eap)
 
static void vim_snprintf (prt_line_buffer, sizeof(prt_line_buffer), " %s\n", string)
 
 prt_write_file (prt_line_buffer)
 
void mch_print_cleanup (void)
 
int mch_print_init (prt_settings_T *psettings, char_u *jobname, int forceit)
 
int mch_print_begin (prt_settings_T *psettings)
 
void mch_print_end (prt_settings_T *psettings)
 
int mch_print_end_page (void)
 
int mch_print_begin_page (char_u *str)
 
int mch_print_blank_page (void)
 
void mch_print_start_line (const bool margin, const int page_line)
 
int mch_print_text_out (char_u *const textp, size_t len)
 
void mch_print_set_font (const TriState iBold, const TriState iItalic, const TriState iUnderline)
 
void mch_print_set_bg (uint32_t bgcol)
 
void mch_print_set_fg (uint32_t fgcol)
 

Macro Definition Documentation

◆ CS_B5

#define CS_B5   (0x08)

◆ CS_CNS_PLANE_1

#define CS_CNS_PLANE_1   (0x01)

◆ CS_CNS_PLANE_1_2

#define CS_CNS_PLANE_1_2   (0x04)

◆ CS_CNS_PLANE_2

#define CS_CNS_PLANE_2   (0x02)

◆ CS_CP932

#define CS_CP932   (0x20)

◆ CS_DLHKL

#define CS_DLHKL   (0x400)

◆ CS_DLHKS

#define CS_DLHKS   (0x800)

◆ CS_ETEN

#define CS_ETEN   (0x10)

◆ CS_GB_2312_80

#define CS_GB_2312_80   (0x01)

◆ CS_GBK

#define CS_GBK   (0x20)

◆ CS_GBK2K

#define CS_GBK2K   (0x04)

◆ CS_GBT_12345_90

#define CS_GBT_12345_90   (0x02)

◆ CS_GBT_90_MAC

#define CS_GBT_90_MAC   (0x10)

◆ CS_HK_GCCS

#define CS_HK_GCCS   (0x20)

◆ CS_HK_SCS

#define CS_HK_SCS   (0x40)

◆ CS_HK_SCS_ETEN

#define CS_HK_SCS_ETEN   (0x80)

◆ CS_JIS_C_1978

#define CS_JIS_C_1978   (0x01)

◆ CS_JIS_X_1983

#define CS_JIS_X_1983   (0x02)

◆ CS_JIS_X_1990

#define CS_JIS_X_1990   (0x04)

◆ CS_KANJITALK6

#define CS_KANJITALK6   (0x40)

◆ CS_KANJITALK7

#define CS_KANJITALK7   (0x80)

◆ CS_KR_ISO10646

#define CS_KR_ISO10646   (0x08)

◆ CS_KR_MAC

#define CS_KR_MAC   (0x02)

◆ CS_KR_X_1992

#define CS_KR_X_1992   (0x01)

◆ CS_KR_X_1992_MS

#define CS_KR_X_1992_MS   (0x04)

◆ CS_MSWINDOWS

#define CS_MSWINDOWS   (0x10)

◆ CS_MTHKL

#define CS_MTHKL   (0x100)

◆ CS_MTHKS

#define CS_MTHKS   (0x200)

◆ CS_NEC

#define CS_NEC   (0x08)

◆ CS_SC_ISO10646

#define CS_SC_ISO10646   (0x40)

◆ CS_SC_MAC

#define CS_SC_MAC   (0x08)

◆ CS_TC_ISO10646

#define CS_TC_ISO10646   (0x1000)

◆ OPT_MBFONT_ASCII

#define OPT_MBFONT_ASCII   1

◆ OPT_MBFONT_BOLD

#define OPT_MBFONT_BOLD   3

◆ OPT_MBFONT_BOLDOBLIQUE

#define OPT_MBFONT_BOLDOBLIQUE   5

◆ OPT_MBFONT_NUM_OPTIONS

#define OPT_MBFONT_NUM_OPTIONS   6

◆ OPT_MBFONT_OBLIQUE

#define OPT_MBFONT_OBLIQUE   4

◆ OPT_MBFONT_REGULAR

#define OPT_MBFONT_REGULAR   2

◆ OPT_MBFONT_USECOURIER

#define OPT_MBFONT_USECOURIER   0

◆ PRCOLOR_BLACK

#define PRCOLOR_BLACK   0

◆ PRCOLOR_WHITE

#define PRCOLOR_WHITE   0xffffff

◆ PRT_CID_PROLOG_VERSION

#define PRT_CID_PROLOG_VERSION   ((char_u *)"1.0")

◆ prt_dsc_atend

#define prt_dsc_atend (   c)    prt_dsc_text((c), "atend")

◆ PRT_DSC_ENDCOMMENTS

#define PRT_DSC_ENDCOMMENTS   "%%EndComments:"

◆ PRT_DSC_ENDCOMMENTS_TYPE

#define PRT_DSC_ENDCOMMENTS_TYPE   (3)

◆ PRT_DSC_MISC_TYPE

#define PRT_DSC_MISC_TYPE   (-1)

◆ PRT_DSC_TITLE

#define PRT_DSC_TITLE   "%%Title:"

◆ PRT_DSC_TITLE_TYPE

#define PRT_DSC_TITLE_TYPE   (1)

◆ PRT_DSC_VERSION

#define PRT_DSC_VERSION   "%%Version:"

◆ PRT_DSC_VERSION_TYPE

#define PRT_DSC_VERSION_TYPE   (2)

◆ PRT_FILE_BUFFER_LEN

#define PRT_FILE_BUFFER_LEN   (2048)

◆ PRT_MEDIASIZE_LEN

#define PRT_MEDIASIZE_LEN   ARRAY_SIZE(prt_mediasize)

◆ PRT_PROLOG_VERSION

#define PRT_PROLOG_VERSION   ((char_u *)"1.4")

◆ PRT_PS_DEFAULT_DPI

#define PRT_PS_DEFAULT_DPI   (72)

◆ PRT_PS_DEFAULT_FONTSIZE

#define PRT_PS_DEFAULT_FONTSIZE   (10)

◆ PRT_PS_FONT_BOLD

#define PRT_PS_FONT_BOLD   (1)

◆ PRT_PS_FONT_BOLDOBLIQUE

#define PRT_PS_FONT_BOLDOBLIQUE   (3)

◆ PRT_PS_FONT_OBLIQUE

#define PRT_PS_FONT_OBLIQUE   (2)

◆ PRT_PS_FONT_ROMAN

#define PRT_PS_FONT_ROMAN   (0)

◆ PRT_PS_FONT_TO_USER

#define PRT_PS_FONT_TO_USER (   scale,
  size 
)    ((size) * ((scale)/1000.0))

◆ PRT_RESOURCE_CMAP

#define PRT_RESOURCE_CMAP   "CMap"

◆ PRT_RESOURCE_ENCODING

#define PRT_RESOURCE_ENCODING   "Encoding"

◆ PRT_RESOURCE_HEADER

#define PRT_RESOURCE_HEADER   "%!PS-Adobe-"

◆ PRT_RESOURCE_PROCSET

#define PRT_RESOURCE_PROCSET   "ProcSet"

◆ PRT_RESOURCE_RESOURCE

#define PRT_RESOURCE_RESOURCE   "Resource-"

◆ PSCR

#define PSCR   (0x0d)

◆ PSLF

#define PSLF   (0x0a)

◆ SIZEOF_CSTR

#define SIZEOF_CSTR (   s)    (sizeof(s) - 1)

Enumeration Type Documentation

◆ PrtResourceType

Enumerator
PRT_RESOURCE_TYPE_PROCSET 
PRT_RESOURCE_TYPE_ENCODING 
PRT_RESOURCE_TYPE_CMAP 

Function Documentation

◆ ex_hardcopy()

void ex_hardcopy ( exarg_T eap)

◆ mch_print_begin()

int mch_print_begin ( prt_settings_T psettings)

◆ mch_print_begin_page()

int mch_print_begin_page ( char_u str)

◆ mch_print_blank_page()

int mch_print_blank_page ( void  )

◆ mch_print_cleanup()

void mch_print_cleanup ( void  )

◆ mch_print_end()

void mch_print_end ( prt_settings_T psettings)

◆ mch_print_end_page()

int mch_print_end_page ( void  )

◆ mch_print_init()

int mch_print_init ( prt_settings_T psettings,
char_u jobname,
int  forceit 
)

◆ mch_print_set_bg()

void mch_print_set_bg ( uint32_t  bgcol)

◆ mch_print_set_fg()

void mch_print_set_fg ( uint32_t  fgcol)

◆ mch_print_set_font()

void mch_print_set_font ( const TriState  iBold,
const TriState  iItalic,
const TriState  iUnderline 
)

◆ mch_print_start_line()

void mch_print_start_line ( const bool  margin,
const int  page_line 
)

◆ mch_print_text_out()

int mch_print_text_out ( char_u *const  textp,
size_t  len 
)

◆ parse_printmbfont()

char* parse_printmbfont ( void  )

◆ parse_printoptions()

char* parse_printoptions ( void  )

◆ prt_get_unit()

int prt_get_unit ( int  idx)

◆ prt_header_height()

int prt_header_height ( void  )

◆ prt_use_number()

int prt_use_number ( void  )

◆ prt_write_file()

prt_write_file ( prt_line_buffer  )

◆ vim_snprintf()

static void vim_snprintf ( prt_line_buffer  ,
sizeof(prt_line_buffer)  ,
" %s\n"  ,
string   
)