"Fossies" - the Fresh Open Source Software Archive

Member "ghostview-1.5/gv.h" (24 Jul 1993, 8416 Bytes) of package /linux/misc/old/ghost/gnu/ghostview/ghostview-1.5.tar.gz:


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 /*
    2  * gv.h -- Main include file for ghostview.
    3  * Copyright (C) 1992  Timothy O. Theisen
    4  *
    5  * This program is free software; you can redistribute it and/or modify
    6  * it under the terms of the GNU General Public License as published by
    7  * the Free Software Foundation; either version 2 of the License, or
    8  * (at your option) any later version.
    9  *
   10  * This program is distributed in the hope that it will be useful,
   11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
   12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   13  * GNU General Public License for more details.
   14  *
   15  * You should have received a copy of the GNU General Public License
   16  * along with this program; if not, write to the Free Software
   17  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
   18  *
   19  *   Author: Tim Theisen           Systems Programmer
   20  * Internet: tim@cs.wisc.edu       Department of Computer Sciences
   21  *     UUCP: uwvax!tim             University of Wisconsin-Madison
   22  *    Phone: (608)262-0438         1210 West Dayton Street
   23  *      FAX: (608)262-9777         Madison, WI   53706
   24  */
   25 
   26 #include <stdio.h>
   27 #include <X11/Xos.h>
   28 #include <sys/stat.h>
   29 #include <X11/Intrinsic.h>
   30 #define XtSetFloatArg(arg, n, d) \
   31     if (sizeof(float) > sizeof(XtArgVal)) { \
   32     XtSetArg(arg, n, &(d)); \
   33     } else { \
   34     XtArgVal *ld = (XtArgVal *)&(d); \
   35     XtSetArg(arg, n, *ld); \
   36     }
   37 #include "Ghostview.h"
   38 
   39 /* Application resources */
   40 typedef struct _AppResources {
   41     Boolean show_title;     /* whether to show title */
   42     Boolean show_date;      /* whether to show date */
   43     Boolean show_locator;   /* whether to show locator */
   44     Boolean auto_center;    /* whether to automatically center the page */
   45     int wm_horiz_margin;    /* Space taken by window manager */
   46     int wm_vert_margin;     /* Space taken by window manager */
   47     int minimum_magstep;    /* smallest magstep allowed */
   48     int maximum_magstep;    /* largest magstep allowed */
   49     int magstep;        /* default magstep */
   50     XtPageOrientation orientation;  /* default orientation */
   51     String page;        /* first page to show */
   52     String pagemedia;       /* default page media */
   53     Boolean force_orientation;  /* use default to override document comments */
   54     Boolean force_pagemedia;    /* use default to override document comments */
   55     Boolean swap_landscape; /* Landscape comment maps to Seascape */
   56     String print_command;   /* command used to print doc, usually "lpr" */
   57     String printer_variable;    /* env varaible to use, usually "PRINTER" */
   58     String default_printer; /* printer to use if no PRINTER is not set*/
   59     String print_prompt;    /* string to prompt user for printer name */
   60     String print_fail;      /* string to inform user that print failed */
   61     String open_prompt;     /* string to prompt for file name to open */
   62     String open_fail;       /* string to inform user that open failed */
   63     String save_prompt;     /* string to prompt for file name to save */
   64     String save_fail;       /* string to inform user that save failed */
   65     /* Work arounds for others' bugs */
   66     Boolean openwindows;    /* whether to work around openwindow bug */
   67     Boolean ncdwm;      /* whether to work around ncdwm bug */
   68 } AppResources;
   69 
   70 extern float    default_xdpi;
   71 extern float    default_ydpi;
   72 
   73 extern int  num_ghosts;
   74 extern FILE *psfile;
   75 extern String   filename;
   76 extern String   oldfilename;
   77 extern int  current_page;
   78 extern int  current_magstep;
   79 extern XtPageOrientation    current_orientation;
   80 extern int  default_pagemedia;
   81 extern int  current_pagemedia;
   82 extern Boolean  force_document_media;
   83 extern int  document_media;
   84 extern int  current_llx;
   85 extern int  current_lly;
   86 extern int  current_urx;
   87 extern int  current_ury;
   88 extern int  base_papersize;
   89 extern Boolean  info_up;
   90 extern int  force_setting;
   91 extern Pixmap   dot_bitmap;
   92 extern Pixmap   menu16_bitmap;
   93 extern Pixmap   tie_fighter_bitmap;
   94 extern String   toc_text;
   95 extern int  toc_length;
   96 extern int  toc_entry_length;
   97 extern int  info_length;
   98 extern time_t   mtime;
   99 extern struct document *doc;
  100 extern struct document *olddoc;
  101 extern Atom wm_delete_window;
  102 extern int  catch_Xerror();
  103 extern XErrorHandler    old_Xerror;
  104 extern Boolean  dying;
  105 extern XErrorEvent  bomb;
  106 
  107 enum {OPEN, PRINT_WHOLE, PRINT_MARKED, SAVE};
  108 extern int  mode;
  109 
  110 extern XtAppContext app_con;
  111 extern AppResources app_res;
  112 
  113 /* Widgets */
  114 extern Widget toplevel;
  115 extern Widget     form;
  116 extern Widget         titlebutton;
  117 extern Widget             titlemenu;
  118 extern Widget         datebutton;
  119 extern Widget             datemenu;
  120 extern Widget         locator;
  121 extern Widget         box;
  122 extern Widget             filebutton;
  123 extern Widget                 filemenu;
  124 extern Widget                     openbutton;
  125 extern Widget                     reopenbutton;
  126 extern Widget                     printwholebutton;
  127 extern Widget                     printmarkedbutton;
  128 extern Widget                     savebutton;
  129 extern Widget                     copyrightbutton;
  130 extern Widget                     quitbutton;
  131 extern Widget             pagebutton;
  132 extern Widget                 pagemenu;
  133 extern Widget                     nextbutton;
  134 extern Widget                     showbutton;
  135 extern Widget                     prevbutton;
  136 extern Widget                     centerbutton;
  137 extern Widget                     markbutton;
  138 extern Widget                     unmarkbutton;
  139 extern Widget             magstepbutton;
  140 extern Widget                 magstepmenu;
  141 extern Widget                     *magstepentry;
  142 extern Widget             orientationbutton;
  143 extern Widget                 orientationmenu;
  144 extern Widget                     portraitbutton;
  145 extern Widget                     landscapebutton;
  146 extern Widget                     upsidedownbutton;
  147 extern Widget                     seascapebutton;
  148 extern Widget                     swapbutton;
  149 extern Widget             pagemediabutton;
  150 extern Widget                 pagemediamenu;
  151 extern Widget                     *pagemediaentry;
  152 extern Widget         toc;
  153 extern Widget         pageview;
  154 extern Widget             page;
  155 
  156 /* Popup widgets */
  157 extern Widget infopopup;
  158 extern Widget     infoform;
  159 extern Widget         infotext;
  160 extern Widget         infobutton;
  161 extern Widget copyrightpopup;
  162 extern Widget     copyrightform;
  163 extern Widget         copyrighttext;
  164 extern Widget         copyrightbutton;
  165 extern Widget dialogpopup;
  166 extern Widget     dialog;
  167 
  168 /* Dialogs */
  169 extern Widget CreateDialog();
  170 extern String GetDialogPrompt();
  171 extern void SetDialogPrompt();
  172 extern String GetDialogResponse();
  173 extern void SetDialogResponse();
  174 extern void ClearDialogResponse();
  175 
  176 /* Callbacks */
  177 extern void quit_ghostview();
  178 extern void popup();
  179 extern void popup_dialog();
  180 extern void reopen_file();
  181 extern void prev_page();
  182 extern void this_page();
  183 extern void next_page();
  184 extern void center_page();
  185 extern void mark_page();
  186 extern void unmark_page();
  187 extern void set_magstep();
  188 extern void set_orientation();
  189 extern void swap_landscape();
  190 extern void set_pagemedia();
  191 extern void track_and_zoom();
  192 extern void message();
  193 extern void output();
  194 extern void okay();
  195 extern void dismiss();
  196 extern void destroy();
  197 extern void destroy_ghost();
  198 
  199 /* Actions */
  200 extern void gv_copyright();
  201 extern void gv_quit();
  202 extern void gv_open();
  203 extern void gv_reopen();
  204 extern void gv_save();
  205 extern void gv_print_whole();
  206 extern void gv_print_marked();
  207 extern void gv_prev();
  208 extern void gv_show();
  209 extern void gv_next();
  210 extern void gv_center();
  211 extern void gv_mark();
  212 extern void gv_unmark();
  213 extern void gv_set_magstep();
  214 extern void gv_increase_magstep();
  215 extern void gv_decrease_magstep();
  216 extern void gv_set_orientation();
  217 extern void gv_swap_landscape();
  218 extern void gv_set_pagemedia();
  219 extern void gv_default();
  220 extern void gv_force();
  221 extern void gv_delete_window();
  222 extern void gv_delete_zoom();
  223 extern void gv_dismiss();
  224 extern void gv_scroll_up();
  225 extern void gv_scroll_down();
  226 extern void gv_scroll_left();
  227 extern void gv_scroll_right();
  228 extern void gv_erase_locator();
  229 extern void gv_check_file();
  230 
  231 /* Misc */
  232 extern void show_page();
  233 extern Boolean setup_ghostview();
  234 extern void layout_ghostview();
  235 extern void magnify();
  236 extern String open_file();
  237 extern String save_file();
  238 extern String print_file();
  239 extern void pscopydoc();
  240 extern void positionpopup();
  241 extern Boolean set_new_magstep();
  242 extern Boolean set_new_orientation();
  243 extern Boolean set_new_pagemedia();
  244 extern void build_pagemedia_menu();
  245 extern Widget build_label_menu();
  246 extern void new_file();