1 /*
2 **
3 ** types.h
4 **
5 ** Copyright (C) 1997 Johannes Plass
6 ** Copyright (C) 2004 Jose E. Marchesi
7 **
8 ** This program is free software; you can redistribute it and/or modify
9 ** it under the terms of the GNU General Public License as published by
10 ** the Free Software Foundation; either version 3 of the License, or
11 ** (at your option) any later version.
12 **
13 ** This program is distributed in the hope that it will be useful,
14 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
15 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16 ** GNU General Public License for more details.
17 **
18 ** You should have received a copy of the GNU General Public License
19 ** along with GNU gv; see the file COPYING.  If not, write to
20 ** the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
21 ** Boston, MA 02111-1307, USA.
22 **
23 ** Author:   Johannes Plass (plass@thep.physik.uni-mainz.de)
24 **           Department of Physics
25 **           Johannes Gutenberg-University
26 **           Mainz, Germany
27 **
28 **           Jose E. Marchesi (jemarch@gnu.org)
29 **           GNU Project
30 **
31 */
32 
33 #ifndef _GV_TYPES_H_
34 #define _GV_TYPES_H_
35 
36 
37 #include <sys/types.h>
38 
39 
40 /*##############################################
41   options
42 ##############################################*/
43 
44 typedef void (*OptionPopupCreateProc)(void);
45 
46 typedef void (*OptionPopupUpdateProc)(void);
47 
48 typedef struct OptionPopupStruct_ {
49   Widget popup;
50   OptionPopupCreateProc create;
51   OptionPopupUpdateProc update;
52   Boolean visible;
53 } OptionPopupStruct, *OptionPopup;
54 
55 /*##############################################
56   miscmenu
57 ##############################################*/
58 
59 typedef struct MiscMenuEntryStruct_ {
60   char  *name;
61   XtCallbackProc cb;
62   XtPointer client_data;
63   int sensitivity_type;
64 } MiscMenuEntryStruct, *MiscMenuEntry;
65 
66 /*##############################################
67   magmenu
68 ##############################################*/
69 
70 typedef struct MagMenuEntryStruct_ {
71   char  *name;
72   float scale;
73   int   is_base;
74   int   is_center;
75 } MagMenuEntryStruct, *MagMenuEntry;
76 
77 /*##############################################
78   media
79 ##############################################*/
80 
81 typedef struct documentmedia {
82   char *name;
83   int  width;
84   int  height;
85   int  used;
86 } MediaStruct, *Media;
87 
88 /*##############################################
89   scale
90 ##############################################*/
91 
92 typedef struct ScaleStruct_ {
93   char  *name;
94   float scale;
95   int   is_base;
96   int   is_center;
97 } ScaleStruct, *Scale;
98 
99 #define SCALE_IS_REAL_BASED   1
100 #define SCALE_IS_PIXEL_BASED  2
101 
102 /*##############################################
103   process
104 ##############################################*/
105 
106 typedef void (*ProcessNotifyProc)(XtPointer /* data */, int /* type */);
107 
108 #define PROCESS_NONE	0
109 #define PROCESS_NOTIFY	1
110 #define PROCESS_KILL	2
111 
112 typedef struct ProcessDataStruct_ *ProcessData;
113 
114 typedef struct ProcessDataStruct_ {
115    int               type;
116    pid_t             pid;
117    XtIntervalId      timer;
118    ProcessNotifyProc notify_proc;
119    XtPointer         data;
120    ProcessData       next;
121    Widget            menuentry;
122    String            name;
123 } ProcessDataStruct;
124 
125 /*##############################################
126   Definitions
127 ##############################################*/
128 
129 #define REQUEST_OPTION_CHANGE		-10
130 #define REQUEST_TOGGLE_RESIZE		-9
131 #define REQUEST_REDISPLAY		-8
132 #define REQUEST_SETUP			-7
133 #define REQUEST_NEW_SCALE		-6
134 #define REQUEST_NEW_PAGEMEDIA		-5
135 #define REQUEST_NEW_ORIENTATION		-4
136 #define REQUEST_REOPEN			-3
137 #define REQUEST_NEW_FILE		-2
138 #define NO_CURRENT_PAGE			-1 /* NO_CURRENT_PAGE must be -1 */
139 
140 #define EYEGUIDE_DRAW   (1<<0)
141 #define EYEGUIDE_REMOVE (1<<1)
142 #define EYEGUIDE_RESET  (1<<2)
143 
144 #define SPM_ALL                         (1<<0)
145 #define SPM_EVEN                        (1<<1)
146 #define SPM_ODD                         (1<<2)
147 #define SPM_CURRENT			(1<<3)
148 #define SPM_TOGGLE			(1<<4)
149 #define SPM_MARK			(1<<5)
150 #define SPM_UNMARK			(1<<6)
151 
152 #define PAGE_MODE_INVALID		0
153 #define PAGE_MODE_ALL			(1<<0)
154 #define PAGE_MODE_MARKED		(1<<1)
155 #define PAGE_MODE_CURRENT		(1<<2)
156 
157 #define PAGE_NONE			0
158 #define PAGE_LEFT			(1<<0)
159 #define PAGE_RIGHT			(1<<1)
160 #define PAGE_UP				(1<<2)
161 #define PAGE_DOWN			(1<<3)
162 #define PAGE_TOP			(1<<4)
163 #define PAGE_BOTTOM			(1<<5)
164 #define PAGE_LEFTEDGE			(1<<6)
165 #define PAGE_RIGHTEDGE			(1<<7)
166 #define PAGE_CENTER			(1<<8)
167 #define PAGE_REDISPLAY			(1<<9)
168 #define PAGE_PAGE			(1<<10)
169 #define PAGE_H				(1<<11)
170 #define PAGE_V				(1<<12)
171 #define PAGE_NOT       			(1<<13)
172 
173 #define CHECK_FILE_DATE			(1<<0)
174 #define CHECK_FILE_VERSION		(1<<1)
175 
176 #define SCROLL_MODE_NONE                0
177 #define SCROLL_MODE_PANNER              (1<<0)
178 #define SCROLL_MODE_GHOSTVIEW           (1<<1)
179 #define SCROLL_MODE_SCROLLBAR           (1<<2)
180 
181 #define FILE_TYPE_PS			0
182 #define FILE_TYPE_PDF			1
183 
184 #define SAVE_MODE_NONE                  0
185 #define SAVE_MODE_FILE                  1
186 #define SAVE_MODE_PRINTER               2
187 
188 #define PROCESS_NONE   0
189 #define PROCESS_NOTIFY 1
190 #define PROCESS_KILL   2
191 
192 #define PROCESS_MENU_NONE       0
193 #define PROCESS_MENU_HIDE       1
194 #define PROCESS_MENU_SHOW       2
195 #define PROCESS_MENU_ADD_ENTRY  3
196 #define PROCESS_MENU_DEL_ENTRY  4
197 #define PROCESS_MENU_PROGRESS   5
198 
199 /* orientations below match the definitions in ps.h */
200 #define O_INVALID         -1000
201 #define O_UNSPECIFIED     0
202 #define O_PORTRAIT        1
203 #define O_LANDSCAPE       2
204 #define O_SEASCAPE        3
205 #define O_UPSIDEDOWN      4
206 #define O_AUTOMATIC       8
207 #define O_SWAP_LANDSCAPE  1000
208 
209 #define MEDIA_ID_INVALID  -3
210 #define MEDIA_ID_AUTO     -2
211 
212 #define SCALE_REL         (1<<8)
213 #define SCALE_ABS         (1<<9)
214 #define SCALE_BAS         (1<<10)
215 #define SCALE_MIN         (1<<11)
216 #define SCALE_VAL         (~(SCALE_REL|SCALE_ABS|SCALE_BAS|SCALE_MIN))
217 
218 #endif /* _GV_TYPES_H_ */
219 
220