"Fossies" - the Fresh Open Source Software Archive 
As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) C and C++ source code syntax highlighting (style:
standard) with prefixed line numbers and
code folding option.
Alternatively you can here
view or
download the uninterpreted source code file.
1 /* Copyright (C) 1993-2005 Ghostgum Software Pty Ltd. All rights reserved.
2
3 This software is provided AS-IS with no warranty, either express or
4 implied.
5
6 This software is distributed under licence and may not be copied,
7 modified or distributed except as expressly authorised under the terms
8 of the licence contained in the file LICENCE in this distribution.
9
10 For more information about licensing, please refer to
11 http://www.ghostgum.com.au/ or contact Ghostsgum Software Pty Ltd,
12 218 Gallaghers Rd, Glen Waverley VIC 3150, AUSTRALIA,
13 Fax +61 3 9886 6616.
14 */
15
16 /* $Id: cdoc.h,v 1.9 2005/01/14 08:15:52 ghostgum Exp $ */
17 /* Document header */
18
19 /* Public */
20 #ifndef Doc_TYPEDEF
21 #define Doc_TYPEDEF
22 typedef struct Doc_s Doc;
23 #endif
24
25 /* Information about a document, suitable for showing in a dialog */
26 typedef struct DocInfo_s DocInfo;
27 struct DocInfo_s {
28 TCHAR name[MAXSTR];
29 TCHAR type[MAXSTR];
30 TCHAR title[MAXSTR];
31 TCHAR date[MAXSTR];
32 TCHAR bbox[MAXSTR];
33 TCHAR hiresbbox[MAXSTR];
34 TCHAR orientation[MAXSTR];
35 TCHAR pageorder[MAXSTR];
36 TCHAR pagemedia[MAXSTR];
37 TCHAR pages[MAXSTR];
38 };
39
40 typedef enum DocType_e {
41 DOC_UNKNOWN,
42 DOC_PS,
43 DOC_PDF,
44 DOC_PCL,
45 DOC_BITMAP
46 } DocType;
47
48 Doc * doc_new(GSview *a);
49 int doc_add(Doc *d, GSview *a);
50 int doc_remove(Doc *d);
51 int doc_ref(Doc *d);
52 int doc_unref(Doc *d);
53 GSview * doc_app(Doc *d);
54 View **doc_views(Doc *doc);
55 int doc_open(Doc *doc, LPCTSTR filename);
56 int doc_close(Doc *doc);
57 DocType doc_type(Doc *doc);
58 BOOL doc_is_open(Doc *doc);
59 void doc_ignore_dsc(Doc *doc, BOOL flag);
60 void doc_dsc_warn(Doc *doc, int level);
61 void doc_verbose(Doc *doc, BOOL verbose);
62 void doc_dump(Doc *doc);
63 int doc_map_page(Doc *doc, int page);
64 int doc_page_limit(Doc *doc, int page);
65 LPCTSTR doc_name(Doc *doc);
66 void doc_info(Doc *doc, DocInfo *info);
67 void doc_ordlabel(Doc *doc, char *buf, int buflen, int page_number);
68 int doc_copyfile(Doc *doc, LPCTSTR filename);
69
70 /* platform specific */
71 void doc_savestat(Doc *doc); /* save file length and date/time */
72 BOOL doc_changed(Doc *doc);
73
74
75 /****************************************************/
76 /* Private */
77 #ifdef DEFINE_CDOC
78
79 #include "cpdfscan.h"
80
81 typedef struct tagTEXTINDEX {
82 int word; /* offset to word */
83 int line; /* line number on page */
84 CDSCBBOX bbox;
85 } TEXTINDEX;
86
87 /* If you change this, remember to update doc_begin and doc_end */
88 struct Doc_s {
89 void *handle; /* Platform specific handle */
90 /* e.g. pointer to MFC CDocument */
91
92 GSview *app; /* GSview app object */
93 Doc *next; /* next document in list */
94 int refcount; /* number of views of this document */
95
96 /* List of views */
97 View *viewlist;
98
99 TCHAR text_name[MAXSTR]; /* name of file containing extracted text */
100 #ifdef NOTUSED
101 TEXTINDEX *text_index;
102 unsigned int text_index_count; /* number of words in index */
103 char *text_words; /* storage for words */
104 #endif
105
106 TCHAR name[MAXSTR]; /* name of selected document file */
107 TCHAR tname[MAXSTR]; /* name of temporary file (uncompressed) */
108 DocType doctype; /* DOC_PS, DOC_PDF, etc. */
109 BOOL gzip; /* file compressed with gzip */
110 BOOL bzip2; /* file compressed with bzip2 */
111 int page_count;
112 DSC_OFFSET length1; /* length of selected file (uncompressed) */
113 DSC_OFFSET length2; /* length of selected file (uncompressed) */
114 unsigned long time1; /* date/time of open file */
115 unsigned long time2; /* date/time of open file */
116 unsigned int dpi; /* Resolution if available from PJL */
117
118 /* If doctype == DOC_PS, the following are used */
119 CDSC *dsc; /* DSC structure. NULL if not DSC */
120 #ifdef NOTUSED
121 BOOL ignore_special; /* %%PageOrder: Special to be ignored */
122 #endif
123 BOOL ignore_dsc; /* DSC comments to be ignored */
124 int dsc_warn; /* Warning level for DSC comments */
125 BOOL verbose; /* Enable DSC debug messages */
126 BOOL ctrld; /* file starts with ^D */
127 BOOL pjl; /* file starts with HP LaserJet PJL */
128
129 /* if doctype == DOC_PDF, the following is used */
130 PDFSCAN *pdfscan;
131 };
132
133 #endif /* DEFINE_CDOC */