This file is indexed.

/usr/include/wx-2.6/wx/html/htmprint.h is in wx2.6-headers 2.6.3.2.2-5ubuntu4.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
/////////////////////////////////////////////////////////////////////////////
// Name:        htmprint.h
// Purpose:     html printing classes
// Author:      Vaclav Slavik
// Created:     25/09/99
// RCS-ID:      $Id: htmprint.h,v 1.28 2005/05/04 18:52:47 JS Exp $
// Copyright:   (c) Vaclav Slavik
// Licence:     wxWindows licence
/////////////////////////////////////////////////////////////////////////////

#ifndef _WX_HTMPRINT_H_
#define _WX_HTMPRINT_H_

#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
#pragma interface "htmprint.h"
#endif

#include "wx/defs.h"

#if wxUSE_HTML & wxUSE_PRINTING_ARCHITECTURE

#include "wx/html/htmlcell.h"
#include "wx/html/winpars.h"
#include "wx/html/htmlfilt.h"

#include "wx/print.h"
#include "wx/printdlg.h"

#include <limits.h> // INT_MAX

//--------------------------------------------------------------------------------
// wxHtmlDCRenderer
//                  This class is capable of rendering HTML into specified
//                  portion of DC
//--------------------------------------------------------------------------------

class WXDLLIMPEXP_HTML wxHtmlDCRenderer : public wxObject
{
public:
    wxHtmlDCRenderer();
    ~wxHtmlDCRenderer();

    // Following 3 methods *must* be called before any call to Render:

    // Assign DC to this render
    void SetDC(wxDC *dc, double pixel_scale = 1.0);

    // Sets size of output rectangle, in pixels. Note that you *can't* change
    // width of the rectangle between calls to Render! (You can freely change height.)
    void SetSize(int width, int height);

    // Sets the text to be displayed.
    // Basepath is base directory (html string would be stored there if it was in
    // file). It is used to determine path for loading images, for example.
    // isdir is false if basepath is filename, true if it is directory name
    // (see wxFileSystem for detailed explanation)
    void SetHtmlText(const wxString& html, const wxString& basepath = wxEmptyString, bool isdir = true);

    // Sets fonts to be used when displaying HTML page. (if size null then default sizes used).
    void SetFonts(wxString normal_face, wxString fixed_face, const int *sizes = NULL);

    // Sets font sizes to be relative to the given size or the system
    // default size; use either specified or default font
    void SetStandardFonts(int size = -1,
                          const wxString& normal_face = wxEmptyString,
                          const wxString& fixed_face = wxEmptyString);

    // [x,y] is position of upper-left corner of printing rectangle (see SetSize)
    // from is y-coordinate of the very first visible cell
    // to is y-coordinate of the next following page break, if any
    // Returned value is y coordinate of first cell than didn't fit onto page.
    // Use this value as 'from' in next call to Render in order to print multiple pages
    // document
    // If dont_render is TRUE then nothing is rendered into DC and it only counts
    // pixels and return y coord of the next page
    //
    // known_pagebreaks and number_of_pages are used only when counting pages;
    // otherwise, their default values should be used. Their purpose is to
    // support pagebreaks using a subset of CSS2's <DIV>. The <DIV> handler
    // needs to know what pagebreaks have already been set so that it doesn't
    // set the same pagebreak twice.
    //
    // CAUTION! Render() changes DC's user scale and does NOT restore it!
    int Render(int x, int y, int from = 0, int dont_render = FALSE,
               int maxHeight = INT_MAX,
               int *known_pagebreaks = NULL, int number_of_pages = 0);

    // returns total height of the html document
    // (compare Render's return value with this)
    int GetTotalHeight();

private:
    wxDC *m_DC;
    wxHtmlWinParser *m_Parser;
    wxFileSystem *m_FS;
    wxHtmlContainerCell *m_Cells;
    int m_MaxWidth, m_Width, m_Height;

    DECLARE_NO_COPY_CLASS(wxHtmlDCRenderer)
};





enum {
    wxPAGE_ODD,
    wxPAGE_EVEN,
    wxPAGE_ALL
};



//--------------------------------------------------------------------------------
// wxHtmlPrintout
//                  This class is derived from standard wxWidgets printout class
//                  and is used to print HTML documents.
//--------------------------------------------------------------------------------


class WXDLLIMPEXP_HTML wxHtmlPrintout : public wxPrintout
{
public:
    wxHtmlPrintout(const wxString& title = wxT("Printout"));
    ~wxHtmlPrintout();

    void SetHtmlText(const wxString& html, const wxString &basepath = wxEmptyString, bool isdir = true);
            // prepares the class for printing this html document.
            // Must be called before using the class, in fact just after constructor
            //
            // basepath is base directory (html string would be stored there if it was in
            // file). It is used to determine path for loading images, for example.
            // isdir is false if basepath is filename, true if it is directory name
            // (see wxFileSystem for detailed explanation)

    void SetHtmlFile(const wxString &htmlfile);
            // same as SetHtmlText except that it takes regular file as the parameter

    void SetHeader(const wxString& header, int pg = wxPAGE_ALL);
    void SetFooter(const wxString& footer, int pg = wxPAGE_ALL);
            // sets header/footer for the document. The argument is interpreted as HTML document.
            // You can use macros in it:
            //   @PAGENUM@ is replaced by page number
            //   @PAGESCNT@ is replaced by total number of pages
            //
            // pg is one of wxPAGE_ODD, wxPAGE_EVEN and wx_PAGE_ALL constants.
            // You can set different header/footer for odd and even pages

    // Sets fonts to be used when displaying HTML page. (if size null then default sizes used).
    void SetFonts(wxString normal_face, wxString fixed_face, const int *sizes = NULL);

    // Sets font sizes to be relative to the given size or the system
    // default size; use either specified or default font
    void SetStandardFonts(int size = -1,
                          const wxString& normal_face = wxEmptyString,
                          const wxString& fixed_face = wxEmptyString);

    void SetMargins(float top = 25.2, float bottom = 25.2, float left = 25.2, float right = 25.2,
                    float spaces = 5);
            // sets margins in milimeters. Defaults to 1 inch for margins and 0.5cm for space
            // between text and header and/or footer

    // wxPrintout stuff:
    bool OnPrintPage(int page);
    bool HasPage(int page);
    void GetPageInfo(int *minPage, int *maxPage, int *selPageFrom, int *selPageTo);
    bool OnBeginDocument(int startPage, int endPage);
    void OnPreparePrinting();

    // Adds input filter
    static void AddFilter(wxHtmlFilter *filter);

    // Cleanup
    static void CleanUpStatics();

private:

    void RenderPage(wxDC *dc, int page);
            // renders one page into dc
    wxString TranslateHeader(const wxString& instr, int page);
            // substitute @PAGENUM@ and @PAGESCNT@ by real values
    void CountPages();
            // counts pages and fills m_NumPages and m_PageBreaks


private:
    int m_NumPages;
    int m_PageBreaks[wxHTML_PRINT_MAX_PAGES];

    wxString m_Document, m_BasePath;
    bool m_BasePathIsDir;
    wxString m_Headers[2], m_Footers[2];

    int m_HeaderHeight, m_FooterHeight;
    wxHtmlDCRenderer *m_Renderer, *m_RendererHdr;
    float m_MarginTop, m_MarginBottom, m_MarginLeft, m_MarginRight, m_MarginSpace;

    // list of HTML filters
    static wxList m_Filters;

    DECLARE_NO_COPY_CLASS(wxHtmlPrintout)
};





//--------------------------------------------------------------------------------
// wxHtmlEasyPrinting
//                  This class provides very simple interface to printing
//                  architecture. It allows you to print HTML documents only
//                  with very few commands.
//
//                  Note : do not create this class on stack only.
//                         You should create an instance on app startup and
//                         use this instance for all printing. Why? The class
//                         stores page&printer settings in it.
//--------------------------------------------------------------------------------

class WXDLLIMPEXP_HTML wxHtmlEasyPrinting : public wxObject
{
public:
    wxHtmlEasyPrinting(const wxString& name = wxT("Printing"), wxWindow *parentWindow = NULL);
    ~wxHtmlEasyPrinting();

    bool PreviewFile(const wxString &htmlfile);
    bool PreviewText(const wxString &htmltext, const wxString& basepath = wxEmptyString);
            // Preview file / html-text for printing
            // (and offers printing)
            // basepath is base directory for opening subsequent files (e.g. from <img> tag)

    bool PrintFile(const wxString &htmlfile);
    bool PrintText(const wxString &htmltext, const wxString& basepath = wxEmptyString);
            // Print file / html-text w/o preview

    void PageSetup();
            // pop up printer or page setup dialog

    void SetHeader(const wxString& header, int pg = wxPAGE_ALL);
    void SetFooter(const wxString& footer, int pg = wxPAGE_ALL);
            // sets header/footer for the document. The argument is interpreted as HTML document.
            // You can use macros in it:
            //   @PAGENUM@ is replaced by page number
            //   @PAGESCNT@ is replaced by total number of pages
            //
            // pg is one of wxPAGE_ODD, wxPAGE_EVEN and wx_PAGE_ALL constants.
            // You can set different header/footer for odd and even pages

    void SetFonts(wxString normal_face, wxString fixed_face, const int *sizes = 0);
    // Sets fonts to be used when displaying HTML page. (if size null then default sizes used)

    // Sets font sizes to be relative to the given size or the system
    // default size; use either specified or default font
    void SetStandardFonts(int size = -1,
                          const wxString& normal_face = wxEmptyString,
                          const wxString& fixed_face = wxEmptyString);

    wxPrintData *GetPrintData();
    wxPageSetupDialogData *GetPageSetupData() {return m_PageSetupData;}
            // return page setting data objects.
            // (You can set their parameters.)

protected:
    virtual wxHtmlPrintout *CreatePrintout();
    virtual bool DoPreview(wxHtmlPrintout *printout1, wxHtmlPrintout *printout2);
    virtual bool DoPrint(wxHtmlPrintout *printout);

private:
    wxPrintData *m_PrintData;
    wxPageSetupDialogData *m_PageSetupData;
    wxString m_Name;
    int m_FontsSizesArr[7];
    int *m_FontsSizes;
    wxString m_FontFaceFixed, m_FontFaceNormal;

    enum FontMode
    {
        FontMode_Explicit,
        FontMode_Standard
    };
    FontMode m_fontMode;

    wxString m_Headers[2], m_Footers[2];
    wxWindow *m_ParentWindow;

    DECLARE_NO_COPY_CLASS(wxHtmlEasyPrinting)
};




#endif  // wxUSE_HTML & wxUSE_PRINTING_ARCHITECTURE

#endif // _WX_HTMPRINT_H_