Lugaru's Epsilon
Editor 14.04

Epsilon User's Manual and Reference
   Primitives and EEL Subroutines
      Operating System Primitives
         System Primitives
         Window System Primitives
            . . .
            Menu Bar Primitives
            Tool Bar Primitives
            Printing Primitives
         . . .

Previous   Up    Next
Tool Bar Primitives  Primitives and EEL Subroutines   Timing

Epsilon User's Manual and Reference > Primitives and EEL Subroutines > Operating System Primitives > Window System Primitives >

Printing Primitives

struct print_options {
    int flags;      // Flags: see below.
    int frompage;   // The range of pages to print.
    int topage;
    int height;
    int width;

/* Epsilon supports these printer flags. */
#define PD_SELECTION                 0x00000001
#define PD_PAGENUMS                  0x00000002
#define PD_PRINTSETUP                0x00000040

short select_printer(struct print_options *p)

In the Windows version of Epsilon, the select_printer( ) primitive displays a dialog box that lets the user choose a printer, select page numbers, and so forth. The flags and parameters are a subset of those of the Windows API function PrintDlg(). The primitive returns zero if the user canceled printing, or nonzero if the user now wants to print. In the latter case, Epsilon will have filled in the height and width parameters of the provided structure with the number of characters that can fit on a page of text using the selected printer.

The page_setup_dialog( ) displays the standard Windows page setup dialog, which you can use to set printer margins or switch to a different printer.

short start_print_job(char *jobname)
short print_eject()
short end_print_job()

After using the select_printer( ) primitive, an EEL program that wishes to print must execute the start_print_job( ) primitive. It takes a string specifying the name of this job in the print queue. The EEL program can then print one or more pages, ending each page with a call to print_eject( ). After all pages have been printed, the EEL program must call end_print_job( ).

short print_line(char *str, ?int scheme)
short print_window(int win)
int create_invisible_window(int width, int height, int buf)

To actually produce output, two primitives are available. The print_line( ) primitive simply prints the given line of text, and advances to the next line. It prints using the "text" color class in the current color scheme. If the optional parameter scheme is nonzero, Epsilon uses that color scheme instead.

The print_window( ) primitive prints the contents of a special kind of Epsilon window. The window must have been created by calling create_invisible_window( ), passing it the desired dimensions of the window, in characters, and the buffer it should display. The create_invisible_window( ) primitive returns a window handle which can be passed to print_window( ). An EEL program can move through the buffer, letting different parts of the buffer "show" in this window, to accomplish printing the entire buffer. The invisible window may be deleted using the window_kill( ) primitive once the desired text has been printed.

Previous   Up    Next
Tool Bar Primitives  Primitives and EEL Subroutines   Timing

Lugaru Epsilon Programmer's Editor 14.04 manual. Copyright (C) 1984, 2021 by Lugaru Software Ltd. All rights reserved.