Back to index

tetex-bin  3.0
Classes | Defines | Typedefs | Enumerations | Functions | Variables
xdvi.h File Reference
#include "xdvi-config.h"
#include "xdvi-debug.h"
#include "c-auto.h"
#include "kpathsea/c-auto.h"
#include "kpathsea/config.h"
#include <stdio.h>
#include <stdlib.h>
#include <limits.h>
#include "kpathsea/systypes.h"
#include "kpathsea/c-memstr.h"
#include "kpathsea/c-pathmx.h"
#include <X11/Xlib.h>
#include <X11/Xutil.h>
#include <X11/Xos.h>
#include <X11/Xfuncs.h>
#include <X11/Intrinsic.h>
#include <X11/Xmd.h>
#include <string.h>
#include <setjmp.h>
#include "kpathsea/c-dir.h"
#include "kpathsea/c-vararg.h"

Go to the source code of this file.

Classes

struct  frame
struct  frame::framedata
struct  x_resources
struct  WindowRec
struct  event_info
struct  pause_info
struct  gc_info
struct  cursor_info
struct  window_expose_info
struct  src_info
struct  widget_info
struct  page_info
struct  dvi_file_info
struct  program_globals
struct  scan_info
struct  geom_info

Defines

#define USE_LANGINFO   0
#define GS_PIXMAP_CLEARING_HACK   1
#define _XOPEN_SOURCE_EXTENDED   1
#define __EXTENSIONS__   1 /* needed to get struct timeval on SunOS 5.5 */
#define _SVID_SOURCE   1 /* needed to get S_IFLNK in glibc */
#define _BSD_SOURCE   1 /* needed to get F_SETOWN in glibc-2.1.3 */
#define DIR_SEPARATOR   '/'
#define True   1
#define False   0
#define Maybe   2
#define LENGTH_OF_INT   ((sizeof(int) * CHAR_BIT + 2) / 3 + 1 + 1)
#define LENGTH_OF_LONG   ((sizeof(long) * CHAR_BIT + 2) / 3 + 1 + 1)
#define LENGTH_OF_ULONG   ((sizeof(unsigned long) * CHAR_BIT + 2) / 3 + 1 + 1)
#define OPEN_MODE_ARGS   const char *
#define MAXDIM   32767
#define spell_conv0(n, f)   ((long) (n * f))
#define spell_conv(n)   spell_conv0(n, dimconv)
#define BMBITS   (8 * BMBYTES) /* number of bits in a bmTypeT */
#define ADD(a, b)   ((bmUnitT *) (((char *) a) + b))
#define SUB(a, b)   ((bmUnitT *) (((char *) a) - b))
#define STRING_OR_NULL(x)   ((x == NULL ? "<NULL>" : x))
#define INSIDE_MANE_WIN   ((currwin.win == mane.win))
#define MAGNIFIER_ACTIVE   ((magnifier.win != 0))
#define mane_base_x   0
#define mane_base_y   0
#define ROUNDUP(x, y)   (((x)+(y)-1)/(y))
#define PS   0
#define CURSOR_LINK   1
#define CURSOR_MAG   2
#define CURSOR_DRAG_V   4
#define CURSOR_DRAG_H   8
#define CURSOR_DRAG_A   16
#define CURSOR_CORRUPTED   32 /* if file is corrupted */
#define CURSOR_TEXT   64
#define G_depth   (unsigned int) DefaultDepthOfScreen(SCRN)
#define G_visual   DefaultVisualOfScreen(SCRN)
#define G_colormap   DefaultColormapOfScreen(SCRN)
#define TNTABLELEN   30 /* length of TeXnumber array (dvi file) */
#define VFTABLELEN   5 /* length of TeXnumber array (virtual fonts) */
#define CURSORWIN   mane.win
#define XDVI_XT_TIMER_HACK   0
#define get_byte(fp)   ((unsigned char)getc(fp))
#define get_lbyte(fp)   ((long)get_byte(fp))
#define REPORT_XDVI_BUG_TEMPLATE   "Please report this as a bug to:\n\ http://sourceforge.net/tracker/?group_id=23164&atid=377580\n"
#define HAVE_ICONV_H   0
#define vfork   fork
#define DEVEL_MODE   0

Typedefs

typedef char Bool3
typedef unsigned long xuint32
typedef unsigned char ubyte
typedef ubyte wide_ubyte
typedef Boolean wide_bool
typedef BMTYPE bmTypeT
typedef unsigned BMTYPE bmUnitT
typedef long setcharRetvalT
typedef setcharRetvalT(* set_char_proc )(wide_ubyte ch)
typedef void(* mouse_proc )(XEvent *)
typedef ICONV_CHAR_PPTR_TYPE iconv_char_pptrT

Enumerations

enum  expertFlagT {
  XPRT_SHOW_NONE = 0U, XPRT_SHOW_STATUSLINE = 1, XPRT_SHOW_SCROLLBARS = 2, XPRT_SHOW_BUTTONS = 4,
  XPRT_SHOW_ALL = 7
}
enum  mouseModeT { MOUSE_MAGNIFIER_MODE, MOUSE_TEXT_MODE, MOUSE_RULER_MODE, MOUSE_MAX_MODE }
enum  subpixelOrderT { SUBPIXEL_NONE, SUBPIXEL_RGB, SUBPIXEL_BGR }

Functions

void reload_app_resources (void)
const char ** get_paper_types (void)
size_t get_paper_types_size (void)
size_t get_magglass_items (void)
int get_magglass_width (int idx)
int get_magglass_height (int idx)
void get_icon_and_title (const char *filename, char **icon_name, char **title_name)
void set_icon_and_title (const char *icon_name, const char *title_name)
void reconfigure_window (Boolean fullsize, Dimension w, Dimension h, Boolean save_position)
void set_windowsize (Dimension *ret_w, Dimension *ret_h, int add_w, int add_h, Boolean override)

Variables

KPSEDLL char * kpathsea_version_string
bmUnitT bit_masks [BMBITS+1]
struct x_resources resource
struct program_globals globals
XtAppContext app
char * dvi_property
size_t dvi_property_length
XImage * G_image
int G_backing_store
DisplayDISP
Screen * SCRN
XtAccelerators G_accels_cr
struct fonttn_table [TNTABLELEN]
struct fontfont_head
struct tntn_head
wide_ubyte maxchar
unsigned short current_timestamp
int current_page
int total_pages
unsigned long magnification
double dimconv
double tpic_conv
Boolean have_src_specials
Boolean dragcurs
int drag_flags
mouse_proc mouse_motion
mouse_proc mouse_release
Boolean dvi_file_corrupted
short magnifier_stat
int scanned_page
int scanned_page_reset
ubyteG_dvi_buf_ptr
Boolean drawing_mag
Boolean htex_inside_href
char * g_anchor_pos
size_t g_anchor_len
char * g_link_color_rgb
char * g_visited_link_color_rgb
Boolean psfig_begun
Boolean ignore_papersize_specials
Boolean have_raw_postscript
int global_statusline_h
Widget statusline

Class Documentation

struct frame

Definition at line 353 of file xdvi.h.

Collaboration diagram for frame:
Class Members
struct framedata data
struct frame * next
struct frame * prev
struct frame::framedata

Definition at line 357 of file xdvi.h.

Class Members
long dvi_h
long dvi_v
int pxl_v
long w
long x
long y
long z
struct x_resources

Definition at line 421 of file xdvi.h.

Class Members
Boolean allow_shell
const char * alt_font
char * anchor_pos
int app_defaults_fileversion
Pixel back_Pixel
char * browser
Dimension btn_between_extra
Dimension btn_between_spacing
Dimension btn_border_width
Dimension btn_side_spacing
Dimension btn_top_spacing
Boolean copy
Pixel cr_Pixel
const char * debug_arg
int default_printing_target
int default_saving_format
Boolean delay_rulers
int density
int dvips_fail_hang
int dvips_hang
const char * dvips_options_str
const char * dvips_path
const char * dvips_printer_str
const char * editor
Boolean expert
int expert_mode
const char * file_history
int file_history_size
const char * find_string
Pixel fore_Pixel
Boolean fullscreen
const char * geometry
char * help_general
char * help_hypertex
char * help_marking
char * help_modes
char * help_mousebuttons
char * help_othercommands
char * help_pagemotion
char * help_search
char * help_sourcespecials
Pixel hl_Pixel
Boolean hush_chars
Boolean hush_chk
Boolean hush_stdout
const char * icon_geometry
Boolean keep_flag
char * link_color
int link_style
Boolean list_fonts
const char * main_translations
Boolean makepk
Boolean match_highlight_inverted
const char * menu_translations
const char * mfmode
const char * mg_arg
int mouse_mode
Boolean no_file_arg_use_history
Boolean no_init_file
char * no_mime_suffix
Boolean omega
int page_history_size
Boolean pagelist_highlight_current
Dimension pagelist_width
const char * paper
Boolean paper_landscape
Boolean pause
const char * pause_special
int pixels_per_inch
int postscript
Boolean prescan
const char * ps2pdf_path
Boolean regression
Boolean remember_windowsize
Boolean reverse
char * rule_color
Pixel rule_pixel
Boolean safer
unsigned int search_window_defaults
int shrinkfactor
const char * sidemargin
int sidemargin_int
Boolean src_fork
const char * src_pos
Boolean statusline
const char * sub_pixels
float subpixel_energy
subpixelOrderT subpixel_order
Boolean t1lib
const char * text_encoding
Boolean thorough
int tick_length
char * tick_units
const char * topmargin
int topmargin_int
Boolean unique
char * unknown_mime_suffix
Boolean use_current_offset
Boolean use_temp_fp
Boolean use_tex_pages
char * visited_link_color
Boolean warn_spec
float watch_file
const char * wheel_translations
int wheel_unit
const char * windowsize
const char * xoffset
int xoffset_int
const char * yoffset
int yoffset_int
struct WindowRec

Definition at line 600 of file xdvi.h.

Class Members
int base_x
int base_y
unsigned int height
int max_x
int max_y
int min_x
int min_y
int shrinkfactor
unsigned int width
Window win
struct event_info

Definition at line 614 of file xdvi.h.

Class Members
jmp_buf canit
VOLATILE int ctr
int flags
jmp_buf next
struct pause_info

Definition at line 621 of file xdvi.h.

Class Members
Boolean flag
int num
int * num_save
struct gc_info

Definition at line 627 of file xdvi.h.

Class Members
GC copy
Boolean do_copy
GC fore
GC fore2
GC fore2_bak
GC fore2_bak1
GC high
GC inverted
GC linkcolor
GC rule
GC ruler
GC visited_linkcolor
struct cursor_info

Definition at line 652 of file xdvi.h.

Class Members
Cursor corrupted
Cursor drag_a
Cursor drag_h
Cursor drag_v
unsigned long flags
Cursor link
Cursor mag
Cursor pause
Cursor ready
Cursor rule
Cursor text
Cursor wait
struct window_expose_info

Definition at line 672 of file xdvi.h.

Class Members
int max_x
int max_y
int min_x
int min_y
struct src_info

Definition at line 677 of file xdvi.h.

Class Members
int fwd_box_page
const char * fwd_string
struct widget_info

Definition at line 682 of file xdvi.h.

Class Members
Widget clip_widget
Widget draw_background
Widget draw_widget
Widget form_widget
Widget paned
Widget top_level
Widget vport_widget
Widget x_bar
Widget y_bar
struct page_info

Definition at line 693 of file xdvi.h.

Class Members
unsigned int h
unsigned int unshrunk_h
unsigned int unshrunk_w
unsigned int w
struct dvi_file_info

Definition at line 698 of file xdvi.h.

Class Members
FILE * bak_fp
size_t dirlen
char * dirname
time_t time
struct program_globals

Definition at line 708 of file xdvi.h.

Class Members
Boolean broken_motif_event_handling
char * curr_browser
char * curr_editor
float curr_gamma
char * curr_paper
Boolean curr_use_color
unsigned long debug
char * dvi_name
Boolean load_init_file
char * orig_locale
int pageno_correct
const char * program_name
Boolean warn_spec_now
const char * xdvi_dir

Define Documentation

#define __EXTENSIONS__   1 /* needed to get struct timeval on SunOS 5.5 */

Definition at line 108 of file xdvi.h.

#define _BSD_SOURCE   1 /* needed to get F_SETOWN in glibc-2.1.3 */

Definition at line 110 of file xdvi.h.

#define _SVID_SOURCE   1 /* needed to get S_IFLNK in glibc */

Definition at line 109 of file xdvi.h.

#define _XOPEN_SOURCE_EXTENDED   1

Definition at line 107 of file xdvi.h.

#define ADD (   a,
  b 
)    ((bmUnitT *) (((char *) a) + b))

Definition at line 338 of file xdvi.h.

#define BMBITS   (8 * BMBYTES) /* number of bits in a bmTypeT */

Definition at line 336 of file xdvi.h.

#define CURSOR_CORRUPTED   32 /* if file is corrupted */

Definition at line 649 of file xdvi.h.

#define CURSOR_DRAG_A   16

Definition at line 648 of file xdvi.h.

#define CURSOR_DRAG_H   8

Definition at line 647 of file xdvi.h.

#define CURSOR_DRAG_V   4

Definition at line 646 of file xdvi.h.

#define CURSOR_LINK   1

Definition at line 643 of file xdvi.h.

#define CURSOR_MAG   2

Definition at line 644 of file xdvi.h.

#define CURSOR_TEXT   64

Definition at line 650 of file xdvi.h.

#define CURSORWIN   mane.win

Definition at line 992 of file xdvi.h.

#define DEVEL_MODE   0

Definition at line 1122 of file xdvi.h.

#define DIR_SEPARATOR   '/'

Definition at line 119 of file xdvi.h.

#define False   0

Definition at line 174 of file xdvi.h.

#define G_colormap   DefaultColormapOfScreen(SCRN)

Definition at line 794 of file xdvi.h.

#define G_depth   (unsigned int) DefaultDepthOfScreen(SCRN)

Definition at line 792 of file xdvi.h.

#define G_visual   DefaultVisualOfScreen(SCRN)

Definition at line 793 of file xdvi.h.

#define get_byte (   fp)    ((unsigned char)getc(fp))

Definition at line 1065 of file xdvi.h.

#define get_lbyte (   fp)    ((long)get_byte(fp))

Definition at line 1066 of file xdvi.h.

#define GS_PIXMAP_CLEARING_HACK   1

Definition at line 96 of file xdvi.h.

#define HAVE_ICONV_H   0

Definition at line 1098 of file xdvi.h.

#define INSIDE_MANE_WIN   ((currwin.win == mane.win))

Definition at line 346 of file xdvi.h.

#define LENGTH_OF_INT   ((sizeof(int) * CHAR_BIT + 2) / 3 + 1 + 1)

Definition at line 226 of file xdvi.h.

#define LENGTH_OF_LONG   ((sizeof(long) * CHAR_BIT + 2) / 3 + 1 + 1)

Definition at line 227 of file xdvi.h.

#define LENGTH_OF_ULONG   ((sizeof(unsigned long) * CHAR_BIT + 2) / 3 + 1 + 1)

Definition at line 228 of file xdvi.h.

#define MAGNIFIER_ACTIVE   ((magnifier.win != 0))

Definition at line 347 of file xdvi.h.

#define mane_base_x   0

Definition at line 349 of file xdvi.h.

#define mane_base_y   0

Definition at line 350 of file xdvi.h.

#define MAXDIM   32767

Definition at line 314 of file xdvi.h.

#define Maybe   2

Definition at line 175 of file xdvi.h.

#define OPEN_MODE_ARGS   const char *

Definition at line 301 of file xdvi.h.

#define PS   0

Definition at line 389 of file xdvi.h.

#define REPORT_XDVI_BUG_TEMPLATE   "Please report this as a bug to:\n\ http://sourceforge.net/tracker/?group_id=23164&atid=377580\n"

Definition at line 1090 of file xdvi.h.

#define ROUNDUP (   x,
  y 
)    (((x)+(y)-1)/(y))

Definition at line 376 of file xdvi.h.

#define spell_conv (   n)    spell_conv0(n, dimconv)

Definition at line 331 of file xdvi.h.

#define spell_conv0 (   n,
  f 
)    ((long) (n * f))

Definition at line 330 of file xdvi.h.

#define STRING_OR_NULL (   x)    ((x == NULL ? "<NULL>" : x))

Definition at line 344 of file xdvi.h.

#define SUB (   a,
  b 
)    ((bmUnitT *) (((char *) a) - b))

Definition at line 339 of file xdvi.h.

#define TNTABLELEN   30 /* length of TeXnumber array (dvi file) */

Definition at line 798 of file xdvi.h.

#define True   1

Definition at line 173 of file xdvi.h.

#define USE_LANGINFO   0

Definition at line 64 of file xdvi.h.

#define vfork   fork

Definition at line 1109 of file xdvi.h.

#define VFTABLELEN   5 /* length of TeXnumber array (virtual fonts) */

Definition at line 799 of file xdvi.h.

#define XDVI_XT_TIMER_HACK   0

Definition at line 1004 of file xdvi.h.


Typedef Documentation

typedef BMTYPE bmTypeT

Definition at line 333 of file xdvi.h.

typedef unsigned BMTYPE bmUnitT

Definition at line 334 of file xdvi.h.

typedef char Bool3

Definition at line 171 of file xdvi.h.

typedef ICONV_CHAR_PPTR_TYPE iconv_char_pptrT

Definition at line 1120 of file xdvi.h.

typedef void(* mouse_proc)(XEvent *)

Definition at line 822 of file xdvi.h.

Definition at line 370 of file xdvi.h.

typedef long setcharRetvalT

Definition at line 367 of file xdvi.h.

typedef unsigned char ubyte

Definition at line 316 of file xdvi.h.

typedef Boolean wide_bool

Definition at line 323 of file xdvi.h.

typedef ubyte wide_ubyte

Definition at line 322 of file xdvi.h.

typedef unsigned long xuint32

Definition at line 189 of file xdvi.h.


Enumeration Type Documentation

Enumerator:
XPRT_SHOW_NONE 
XPRT_SHOW_STATUSLINE 
XPRT_SHOW_SCROLLBARS 
XPRT_SHOW_BUTTONS 
XPRT_SHOW_ALL 

Definition at line 392 of file xdvi.h.

             {
    XPRT_SHOW_NONE = 0U,
    XPRT_SHOW_STATUSLINE = 1,
    XPRT_SHOW_SCROLLBARS = 2,
#ifdef MOTIF
    XPRT_SHOW_PAGELIST = 4,
    XPRT_SHOW_TOOLBAR = 8,
    XPRT_SHOW_MENUBAR = 16,
    XPRT_SHOW_ALL = 31
#else
    XPRT_SHOW_BUTTONS = 4,
    XPRT_SHOW_ALL = 7
#endif
} expertFlagT;
enum mouseModeT
Enumerator:
MOUSE_MAGNIFIER_MODE 
MOUSE_TEXT_MODE 
MOUSE_RULER_MODE 
MOUSE_MAX_MODE 

Definition at line 407 of file xdvi.h.

Enumerator:
SUBPIXEL_NONE 
SUBPIXEL_RGB 
SUBPIXEL_BGR 

Definition at line 416 of file xdvi.h.


Function Documentation

void get_icon_and_title ( const char *  filename,
char **  icon_name,
char **  title_name 
)

Definition at line 1490 of file xdvi.c.

{
    /* Use basename of DVI file for name in icon and title.  */
    const char *ptr;
    char *ptr2;

    /* SU 2000/12/16: added page number information */
    const char *const title_name_fmt = "%s:  %s   (%d page%s)";

    MYTRACE((stderr, "get_icon_and_title called with: |%s|", filename));

    ptr = strrchr(filename, '/');
    if (ptr != NULL)
       ++ptr;
    else {
       ptr = filename;
    }
        
    /*
     * Remove the `file:' prefix from the icon name; since some windowmanagers
     * only display a prefix in window lists etc., it's more significant this
     * way.
     */

    if (memcmp(ptr, "file:", 5) == 0) {
       ptr += 5;
    }
    *icon_name = xstrdup(ptr);
    
    MYTRACE((stderr, "before chopping: icon_name: |%s|", *icon_name));
    if ((ptr2 = strstr(*icon_name, ".dvi")) != NULL) {
       /* chop off .dvi extension */
       *ptr2 = '\0';
    }
    MYTRACE((stderr, "after chopping: icon_name: |%s|", *icon_name));

    *title_name = xmalloc(strlen(title_name_fmt)
                       + strlen(XDVIK_PROGNAME)
                       + strlen(*icon_name)
                       + LENGTH_OF_INT
                       + 2);       /* 2 for additional plural `s' */
    MYTRACE((stderr, "total_pages: %d", total_pages));
    sprintf(*title_name, title_name_fmt, XDVIK_PROGNAME, *icon_name, total_pages,
           (total_pages > 1) ? "s" : "");

    MYTRACE((stderr, "title_name, icon_name: |%s|%s|", *title_name, *icon_name));
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 356 of file xdvi.c.

                                 {
    return mg_size[idx].h;
}

Here is the caller graph for this function:

Definition at line 348 of file xdvi.c.

                                {
    return XtNumber(mg_size);
}

Here is the caller graph for this function:

Definition at line 352 of file xdvi.c.

                                {
    return mg_size[idx].w;
}

Here is the caller graph for this function:

const char** get_paper_types ( void  )

Definition at line 1474 of file xdvi.c.

                                   {
    return paper_types;
}

Here is the caller graph for this function:

Definition at line 1478 of file xdvi.c.

                                  {
    return XtNumber(paper_types);
}

Here is the caller graph for this function:

void reconfigure_window ( Boolean  fullsize,
Dimension  w,
Dimension  h,
Boolean  save_position 
)

Definition at line 1843 of file xdvi.c.

{
    static int x_old = 5, y_old = 15;
#ifdef SIZECONFIGURE_WORKS
    int sizeconfiguremask;
    XWindowChanges sizeconfigure;
#endif /* SIZECONFIGURE_WORKS */
#ifdef MOTIF
    static int save_wm_decorations;
#else
    static struct PropMotifWmHints MWMHints = {MWM_HINTS_DECORATIONS, 0, 0, 0, 0};
    Atom WM_HINTS = XInternAtom(DISP, "_MOTIF_WM_HINTS", True);
#endif
    int x, y;

#ifdef SIZECONFIGURE_WORKS
    sizeconfiguremask = CWX | CWY | CWWidth | CWHeight | CWBorderWidth;
    sizeconfigure.width = width;
    sizeconfigure.height = height;
#endif /* SIZECONFIGURE_WORKS */
    
    if (fullscreen) {
#if 0
       static Boolean first_time = True;
       /* offsets between the raw window and the decorated window */
       static int wm_x_offset = 0;
       static int wm_y_offset = 0;
#endif
       Window dummy;

#ifdef SIZECONFIGURE_WORKS
       sizeconfigure.x = 0;
       sizeconfigure.y = 0;
       sizeconfigure.border_width = 0;
#endif /* SIZECONFIGURE_WORKS */
       
       /* Note ZLB: avoid to call XTranslateCoordinates if the window is
          not yet mapped since XTranslateCoordinates implicitly maps the
          window (note: calling the function XGetWindowAttributes also
          makes the window mapped).

          This effectively eliminates the flashing effect when xdvik is
          started in fullscreen mode for the Motif version. For the Xaw
          version we still get flashing effect (seems that the window is
          already mapped). */

        if (save_position) {
          /* save current window coordinates so that we can change them back */
           (void)XTranslateCoordinates(DISP, XtWindow(globals.widgets.top_level),
                                   RootWindowOfScreen(SCRN),
                                   0, 0,
                                   &x_old, &y_old,
                                   &dummy);
#if 0
            if (first_time) {
              first_time = False;
              /* This is a hack for finding out wm_x_offset, wm_y_offset */
              XMoveWindow(DISP, XtWindow(globals.widgets.top_level), 0, 0);
              XSync(DISP, False);
              (void)XTranslateCoordinates(DISP, XtWindow(globals.widgets.top_level),
                                   RootWindowOfScreen(SCRN),
                                   0, 0, &wm_x_offset, &wm_y_offset,
                                   &dummy);
              fprintf(stderr, "wm offset = (%d,%d)\n",
                     wm_x_offset, wm_y_offset);
           }
           x_old -= wm_x_offset;
           y_old -= wm_y_offset;
#endif
        }

       x = y = 0;

#ifdef MOTIF
       XtVaGetValues(globals.widgets.top_level, XmNmwmDecorations, &save_wm_decorations, NULL);
       /* FIXME: this doesn't work e.g. with KDE */
       XtVaSetValues(globals.widgets.top_level,
                    XmNmwmDecorations, 0,
                    XmNgeometry, "+0+0",
                    NULL);
       XtVaSetValues(globals.widgets.main_window, XmNshadowThickness, 0, NULL);
#else
       MWMHints.decorations = 0;
       if (WM_HINTS != None) {
           XChangeProperty(DISP, XtWindow(globals.widgets.top_level),
                         WM_HINTS, WM_HINTS, 32,
                         PropModeReplace, (unsigned char *)&MWMHints,
                         sizeof(MWMHints) / 4);
       }
#endif
       /* SU: apparently some new standard that is supposed to work
          with some WMs ... but it doesn't with my versions of Gnome and KDE. */
       net_wm_toggle_fullscreen(1);

#ifdef SIZECONFIGURE_WORKS
       XConfigureWindow(DISP, XtWindow(globals.widgets.top_level), sizeconfiguremask, &sizeconfigure);
#endif /* SIZECONFIGURE_WORKS */
    }
    else {
#ifdef SIZECONFIGURE_WORKS
       sizeconfiguremask = CWWidth | CWHeight | CWX | CWY;
       sizeconfigure.x = x_old;
       sizeconfigure.y = y_old;
       sizeconfigure.border_width = 20;
#endif /* SIZECONFIGURE_WORKS */
       XtVaSetValues(globals.widgets.top_level, XtNx, x_old, XtNy, y_old, NULL);
#ifdef MOTIF
       XtVaSetValues(globals.widgets.top_level, XmNmwmDecorations, save_wm_decorations, NULL);
#if USE_XAW_PANNER
       XtVaSetValues(globals.widgets.main_window, XmNshadowThickness, g_save_shadow_thickness, NULL);
#endif
#else
       MWMHints.decorations = MWM_DECOR_ALL;
       if (WM_HINTS != None) {
           XChangeProperty(DISP, XtWindow(globals.widgets.top_level),
                         WM_HINTS, WM_HINTS, 32,
                         PropModeReplace, (unsigned char *)&MWMHints,
                         sizeof(MWMHints) / 4);
       }
#endif
       net_wm_toggle_fullscreen(0);

       x = x_old;
       y = y_old;
    }

#if 1
#if 0
    XUnmapWindow(DISP, XtWindow(globals.widgets.top_level));
#else
    XWithdrawWindow(DISP, XtWindow(globals.widgets.top_level), XScreenNumberOfScreen(SCRN));
#endif

    /* Note ZLB: Placing XResizeWindow before XUnmapWindow or after XMapWindow
       makes the fullscreen window size smaller than the screen size when
       using `mwm' of Lesstif */
    XSetWindowBorderWidth(DISP, XtWindow(globals.widgets.top_level), 0);
    XResizeWindow(DISP, XtWindow(globals.widgets.top_level), width, height);

    XMapRaised(DISP, XtWindow(globals.widgets.top_level));

    /* Note ZLB: XMapWindow might change the window position with some WMs
       (like Sawfish), so we place the window position after it's mapped. */
    XMoveWindow(DISP, XtWindow(globals.widgets.top_level), x, y);
#endif /* 0 */

    /* need to redraw the page to avoid artifacts */
    globals.ev.flags |= EV_NEWPAGE;
    XFlush(DISP);
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 3495 of file xdvi.c.

{
/*     /\* reset some resources to built-in defaults *\/ */
/*     resource.browser = NULL; */
/*     resource.editor = NULL; */
/*     resource.gamma = 1; */
/*     resource.link_style = 3; */
/*     resource.link_color = LINK_COLOR_FALLBACK; */
/*     resource.visited_link_color = VISITED_LINK_COLOR_FALLBACK; */
/*     resource.expert_mode = 31; */
/*     resource.use_color = True; */
/*     resource.match_highlight_inverted = True; */
    
    XtGetApplicationResources(globals.widgets.top_level, (XtPointer)&resource,
                           application_resources, XtNumber(application_resources),
                           (ArgList)NULL, 0);
    XtGetApplicationResources(globals.widgets.top_level, (XtPointer)&resource,
                           app_pixel_resources, XtNumber(app_pixel_resources),
                           (ArgList)NULL, 0);
/*      fprintf(stderr, "gamma: %f\n", resource.gamma); */
}
void set_icon_and_title ( const char *  icon_name,
const char *  title_name 
)

Definition at line 1539 of file xdvi.c.

{
    if (!XtIsRealized(globals.widgets.top_level)) {
       MYTRACE((stderr, "set_icon_and_title: returning"));
       return;
    }
    XtVaSetValues(globals.widgets.top_level, XtNtitle, (XtArgVal) title_name, XtNiconName, (XtArgVal) icon_name, NULL);
    XSetStandardProperties(DISP, XtWindow(globals.widgets.top_level), title_name, icon_name,
                        (Pixmap) 0, NULL, 0, NULL);
}

Here is the caller graph for this function:

void set_windowsize ( Dimension ret_w,
Dimension ret_h,
int  add_w,
int  add_h,
Boolean  override 
)

Definition at line 1642 of file xdvi.c.

{
    static Arg set_wh_args[] = {
       {XtNwidth, (XtArgVal) 0},
       {XtNheight, (XtArgVal) 0},
    };
    Dimension screen_w, screen_h;

    const char *test_geometry = resource.geometry;
    
    if (resource.fullscreen) {
       Dimension w = WidthOfScreen(SCRN), h = HeightOfScreen(SCRN);

       if (currwin.shrinkfactor == 0) { /* if not set by user */
           Dimension height_factor = ROUNDUP(globals.page.unshrunk_h, h);
           currwin.shrinkfactor = ROUNDUP(globals.page.unshrunk_w, w);
           if (height_factor >= currwin.shrinkfactor)
              currwin.shrinkfactor = height_factor;
/*         fprintf(stderr, "factor was 0, using %d\n", currwin.shrinkfactor); */
       }
/*     else */
/*         fprintf(stderr, "factor != 0, using %d\n", currwin.shrinkfactor); */

       mane.shrinkfactor = currwin.shrinkfactor;
       init_page();
       set_wh_args[0].value = (XtArgVal)w;
       set_wh_args[1].value = (XtArgVal)h;
       *ret_w = w;
       *ret_h = h;
#ifdef MOTIF
#if USE_XAW_PANNER
       XtVaGetValues(globals.widgets.main_window, XmNshadowThickness, &g_save_shadow_thickness, NULL);
#endif
       XtVaSetValues(globals.widgets.main_window, XmNshadowThickness, 0, NULL);
#endif
       XtSetValues(globals.widgets.top_level, set_wh_args, XtNumber(set_wh_args));
    }
    else if (override) {
       set_wh_args[0].value = (XtArgVal)*ret_w;
       set_wh_args[1].value = (XtArgVal)*ret_h;
       XtSetValues(globals.widgets.top_level, set_wh_args, XtNumber(set_wh_args));
    }
    else { /* determine a window size that fits the current shrink factor */
       Arg temp_args3 = { XtNborderWidth, (XtArgVal)&bwidth };
       XtWidgetGeometry reply;
       
       XtGetValues(globals.widgets.top_level, &temp_args3, 1); /* get border width */
       screen_w = WidthOfScreen(SCRN) - 2 * bwidth;

       screen_w -= add_w;
       screen_h = HeightOfScreen(SCRN) - 2 * bwidth - global_statusline_h - 6;
       for (;;) {    /* actually, at most two passes */
           Dimension height_factor;

           TRACE_GUI((stderr, "geometry: |%s|; remember: %d, windowsize: %s",
                     resource.geometry ? resource.geometry : "<NULL>",
                     resource.remember_windowsize,
                     resource.windowsize ? resource.windowsize : "<NULL>"));
           
           if (resource.geometry == NULL && !resource.remember_windowsize) {
              /* geometry not set by user, try to find geometry that fits the shrink factor */
              get_window_constraints(&reply, screen_w, screen_h, add_h);
           }
           else {
              int x, y;
              unsigned int width, height;
              int flags;

              if (resource.remember_windowsize && resource.windowsize != NULL)
                  test_geometry = resource.windowsize;
              else
                  test_geometry = resource.geometry;
              flags = XParseGeometry(test_geometry, &x, &y, &width, &height);

              if (!(flags & WidthValue) || !(flags & HeightValue)) {
                  /* no geometry specified, use fallback */
                  get_window_constraints(&reply, screen_w, screen_h, add_h);
              }

              /* warn about bad values */
              if (flags & WidthValue) {
                  if (width > (unsigned int)(2 * bwidth + add_w)) {
                     TRACE_FILES((stderr, "width: %hu, bwidth: %hu, add_w: %d",
                                 width, bwidth, add_w));
                     reply.width = width - 2 * bwidth - add_w;
                  }
                  else {
                     reply.width = width;
                  }
              }
              if (flags & HeightValue) {
                  if (height > (unsigned int)(2 * bwidth + add_h)) {
                     TRACE_FILES((stderr, "height: %hu, bwidth: %hu, add_h: %d",
                                 height, bwidth, add_h));
                     reply.height = height - 2 * bwidth - add_h;
                  }
                  else {
                     reply.height = height;
                  }
              }
              TRACE_FILES((stderr, "setting geometry: %dx%d", (int)reply.width, (int)reply.height));
           }
           
           /* now reply.{width,height} contain max. usable window size */

           /* User didn't use `-s 0', use either default or other user-specified value */
           if (currwin.shrinkfactor != 0) {
/*            fprintf(stderr, "factor != 0, using %d\n", currwin.shrinkfactor); */
              break;
           }
/*         else { */
/*            fprintf(stderr, "factor was 0, using %d\n", currwin.shrinkfactor); */
/*         } */

           /* else, try to find a suitable shrink factor: */
           currwin.shrinkfactor = ROUNDUP(globals.page.unshrunk_w, reply.width - 2);
/*         fprintf(stderr, "factor w: %d\n", currwin.shrinkfactor); */
           
           height_factor = ROUNDUP(globals.page.unshrunk_h, reply.height - 2);
/*         fprintf(stderr, "factor h: %d\n", height_factor); */
           if (height_factor >= currwin.shrinkfactor)
              currwin.shrinkfactor = height_factor;

/*         fprintf(stderr, "factor now is: %d\n", currwin.shrinkfactor); */
           
           mane.shrinkfactor = currwin.shrinkfactor;
           init_page();
           set_wh_args[0].value = (XtArgVal)globals.page.w;
           set_wh_args[1].value = (XtArgVal)globals.page.h;
           *ret_w = globals.page.w;
           *ret_h = globals.page.h;
           XtSetValues(globals.widgets.draw_widget, set_wh_args, XtNumber(set_wh_args));
       }
#ifdef MOTIF
       /*
         SU 2002/11/23: Added scrollbar width to height computation.
         Otherwise, when the vertical space isn't sufficient, a
         vertical scrollbar will be added, but since this makes the
         display narrower, a horizontal scrollbar will be added as
         well, even if this wouldn't be neccessary.

         SU 2003/09/30: Apparently the size computation works now, even
         though I'm not sure why (scrollbar value isn't in add_w). Investigate.
       */
       /* HACK ALERT: 4 for window decoration borders - FIXME: get actual values?? */
       set_wh_args[0].value = reply.width + add_w + (test_geometry == NULL ? 4 : 0);
       set_wh_args[1].value = reply.height + add_h - (test_geometry == NULL ? 4 : 0);
       XtSetValues(globals.widgets.top_level, set_wh_args, XtNumber(set_wh_args));

#else /* MOTIF */

       set_wh_args[0].value = reply.width + add_w + (test_geometry == NULL ? 15 : (2 * bwidth));
       /*
         FIXME: use real height of statusline here
         Somehow I didn't manage to use XtVaCreateWidget in a call to
         create_statusline() above, and XtManageChild() below.
         In that case, we could do without global_statusline_h.
        */
       set_wh_args[1].value = reply.height + (test_geometry == NULL ? (2 * bwidth + add_h) : 0);
       XtSetValues(globals.widgets.top_level, set_wh_args, XtNumber(set_wh_args));
       set_wh_args[0].value -= add_w;
       XtSetValues(globals.widgets.vport_widget, set_wh_args, XtNumber(set_wh_args));

#endif /* MOTIF */
       *ret_w = set_wh_args[0].value;
       *ret_h = set_wh_args[1].value;
       TRACE_FILES((stderr, "returning: w=%d, h=%d", *ret_w, *ret_h));
    }
}

Here is the call graph for this function:

Here is the caller graph for this function:


Variable Documentation

XtAppContext app

Definition at line 329 of file xdvi.c.

Definition at line 624 of file dvi-draw.c.

Definition at line 84 of file dvi-init.c.

Definition at line 76 of file dvi-init.c.

double dimconv

Definition at line 80 of file dvi-init.c.

Definition at line 245 of file xdvi.c.

Definition at line 139 of file dvi-draw.c.

char* dvi_property

Definition at line 241 of file xdvi.c.

Definition at line 242 of file xdvi.c.

struct font* font_head

Definition at line 73 of file dvi-init.c.

XtAccelerators G_accels_cr

Definition at line 247 of file xdvi.c.

Definition at line 99 of file hypertex.c.

char* g_anchor_pos

Definition at line 98 of file hypertex.c.

Definition at line 244 of file xdvi.c.

Definition at line 586 of file dvi-draw.c.

XImage* G_image

Definition at line 243 of file xdvi.c.

Definition at line 96 of file hypertex.c.

Definition at line 97 of file hypertex.c.

Definition at line 68 of file statusline.c.

Definition at line 3887 of file events.c.

Definition at line 137 of file dvi-draw.c.

Definition at line 299 of file xdvi.c.

Definition at line 4 of file version.c.

unsigned long magnification

Definition at line 79 of file dvi-init.c.

Definition at line 70 of file mag.c.

Definition at line 75 of file dvi-init.c.

Definition at line 329 of file events.c.

Definition at line 330 of file events.c.

Definition at line 195 of file special.c.

Definition at line 134 of file dvi-draw.c.

Definition at line 134 of file dvi-draw.c.

Screen* SCRN

Definition at line 246 of file xdvi.c.

Widget statusline

Definition at line 53 of file statusline.c.

struct tn* tn_head

Definition at line 74 of file dvi-init.c.

Definition at line 72 of file dvi-init.c.

Definition at line 85 of file dvi-init.c.

double tpic_conv

Definition at line 81 of file dvi-init.c.