Lion icon Suggestions for the xdvik GUI

SourceForge.net Logo
Sourceforge Xdvik Project Page
Documentation

SourceForge Links

This file contains some suggestions for the xdvik GUI to accomodate some new elements (such as page selector and some new dialogs). As of version 22.84, some of the suggestions have already been implemented in xdvik.

Main Window layout

  1. Here's how the current CVS HEAD (xdvik-22.84) looks: Xaw version, Motif version
  2. We should change the way the page boundaries are marked in the drawing area.
    • Use a separate widget for the drawing canvas (similar to gv); then the drawing area should be centered on a differently colored background, as shown in this mockup. The absence of borders would also allow to make the background use the same color, to have a continuous canvas which could be useful for presentations or if you don't care about the page borders.
    • Set off the drawing area with some kind of 3d-effect, similar to how it's done in Acroread 3.x, as shown in this mockup.
    • We need to think about what should happen with stuff that exceeds the drawing region (e.g. when viewing a landscape document without proper `paper' settings). The two possibilities are
      • Letting stuff overdraw the background, similar to how it is currently (stuff may exceed the page boundaries arbitrarily). However that won't be possible if the background can use a different color, because doing 2 different types of anti-aliasing for the different GC's would be rather silly. Also, text will become illegible anyway if the background is rather dark. See this mockup on how this might look like (the mockup doesn't show `proper' anti-aliasing for the background; it uses a medium dark background).
      • Clipping everything to the drawing region; this seems a much cleaner (and also visually better) solution; shown here (with 3d-border) and here (centered and without a border). Together with the implementation of dvips papersize specials (see this feature request) and a GUI page size selector (see below) this seems to be the best solution.

Menu layout

MenuEntries
File
Open ...
Reload
Recent Files >
Find ...
Save ...
Print ...
Info ...
View Logs ...
Quit
Navigate
(various navigation commands)
Back Hyperlink
Recent Hyperlinks >
Mark
Toggle current
Toggle all
Toggle odd
Toggle even
Zoom
(various magsteps, depending on configuration)
Fit to page
Fit to width
Fit visible
Options
Show PS
Show PS and bounding boxes
Show bounding boxes only
Keep postion
Use TeX pages for goto-page()
Fonts darker
Fonts lighter
Page size ...
Preferences ...
Help
General ...
Page Motion ...
Hypertex ...
Source Specials ...
Other Commands ...

Clicking on the hyperlinks jumps to details about the menu entries (below).

Between the buttons and the page selector, one could position some buttons to switch pages, like in gv:

(first page), (previous page), (next page), (last page).
The reason for having these buttons is that the user doesn't need to move the mouse in order to page quickly through the file.
  • Currenlty the page selector uses ascii-representations for marks and current page, as shown on the screenshots (`*' for a marked page; the same is used by xdvik-22.15-j1.03 and ghostview). It would be nicer to use use special widgets for the marks (like rectangular buttons with 3D-shape), as in gv.
  • Maybe it would be useful to have additional run-time options for positioning the menus; like -menubar-left, -menubar-right, -menubar-top (with page selector only changing between left/right). Otherwise, one could have compile-time options for the positioning.
  • It seems the buttons are best located on the right-hand side, because it doesn't conflict (visually, and operation-wise) with the current position of the scroll bar left of the canvas. (Most users probably wouldn't appreciate a change in the scrollbar position.) Also this way there's the least difference to the current layout. Here are some alternatives: Another mockup with the buttons on the left and the scrollbar on the right, and another one with both scrollbar and buttons on the left. However IMHO the latter looks rather cluttered/unbalanced: Too many GUI elements on the left, and none on the right.

Details of menu entries:

File -> Open:

Invokes the existing file selection dialog.

File -> Reload:

Same as `R' keystroke, reloads file.

File -> Recent Files:

Pops up a menu with recently opened files (as in kdvi). (Or a window, as in Netscape?) This can be used to open/browse several files (also passed via the command line, e.g.: `xdvi *.dvi'). Additional frills:
  • use a callback: recent-files(n) where n is the maximum number of files to display. Maybe: If the callback is bound to a mouse action, display a popup window, else (bound to a menu item) display a submenu.
  • If it's an extra window, the list could be sorted either alphabetically or by access time (as in Netscape's History).
  • The list shows the full path name of each file.
  • A non-ambiguous path component (if two filenames are the same) is displayed in the title bar.
  • In Motif, this could also be a tear-off menu for easy access.

File -> Find:

Pops up a dialog box to search for a string or regular expression in the DVI file.

Xdvik: Find in DVI file
Find:   
Regular expression
Case sensitive
Find backwards

File -> Save:

Pops up a dialog box to save a DVI file in one of the following formats (selectable via a selection box): DVI, PS, PDF, Plain Text.

Additional button with `Advanced options' to specify paper size, orientation, Type1 vs. PK fonts etc.

File -> Print:

Xdvi: Print file
Print to: Printer:   
File:   
Pages: All
Marked
From: to:

Remarks:

  • For a first version, we could rely on lpr doing something sensible with .dvi files and just pipe the file into lpr. Otherwise, the user can select `Print to file' which just calls dvips.
  • OTOH, it might be useful to use the dvips output when printing to a temp .ps file as `progress indicator' for printing; see the progress window below. This makes it possible to abort `printing' (as long as the dvips conversion is still in progress).
  • `File' contains as default filename main .dvi file with `.dvi' replaced by `.ps' (initially greyed out since the radio button is not active).
  • `Marked pages' is selected by default (and contains the appropriate range) iff there are currently pages marked. Else, it is unmarked, and contains the range `first page of document' to `last page of document'.
  • `Page range' default value is first to last page of current document.
  • `Browse ...' opens the same file browser as `Open ...' menu, but with .ps files to select from.
  • When `File' already exists, `Print' pops up a confirmation window:

    Xdvi: Confirmation
    File `test.ps' already exitsts.
    Overwrite it?

    where `No' goes back to `Browse ...' dialog and `Cancel' aborts printing.

  • When selecting `Print', there should be some temporary window (like in Acroread 4.05) (or maybe the statusline?) as progress indicator. This window pops down automatically after the file has been spooled. The `Cancel' button aborts dvips and removes the temporary .ps file if it exists. (We should always use `dvips -o tempfile' since otherwise it's too difficult to abort the print job).
  • Additional button with `Advanced options' to specify paper size, orientation, Type1 vs. PK fonts etc.

    Xdvi: Printing status
    Dvips conversion: page n of m ... done.
    Spooling ... done.

File -> Info:

Pops up a window with infos on the current .dvi file, fonts used (like in Acroread); e.g.:

Xdvi: File Info
File: test.dvi
Number of pages: 12
Creator/date: TeX output 2001.05.20:1455
Fonts used:
Name	Type	Encoding

The lising in `fonts used' would be a GUI equivalent to the `-l' option.

Info might eventually be extended to: info on specials used, included external files (.eps) etc.

File -> View Logs:

Pops up a window that shows the current log buffer in a scrollable window and has the following additional controls:
  • a button `Save to file' that pops up a file selector
  • a button `Clear' that erases the log buffer
  • a text field for customizing the log buffer size (default size: 1000).

Xdvi: Log messages
History size: lines

File -> Quit:

Same as `q' keystroke, quits xdvi.

Navigate -> various navigation commands:

Provides a list of navigation commands: First page, -10 pages, -5 pages, prev, next, +5 pages, +10 pages, Last page.

Navigate -> Back Hyperlink:

Jumps back to the last link anchor clicked, and updates the list of recent hyperlinks (see following menu item).

Navigate -> Recent Hyperlinks:

Pops up a list of recently browsed links (think Netscape's History window):

targetpagefile
section.3.195test.dvi
chapter.1104baz.dvi

Functionality for this is not yet implemented: Recently opened files could be kept in an X property at runtime (so that different xdvik processes share same list), and saved to a resource file on exit (see `Preferences' below); at startup, check whether propery exists (will if another xdvi is running), if so, use it, else read from file.

Mark -> Toggle current:

Toggles mark for current page, i.e. marks it if currently unmarked, unmarks else.

Alternative name: (Un)mark current.

Or 2 entries: `Mark current' - `Unmark current'.

Mark -> Toggle all:

Toggles marks for all pages, i.e. marks all pages currently unmarked.

Alternative name: (Un)mark all.

Or 2 entries: `Mark all' - `Unmark all'.

Mark -> Toggle odd:

Toggles marks for odd pages.

Alternative name: (Un)mark odd.

Or 2 entries, as above.

Mark -> Toggle even:

Toggles marks for even pages.

Alternative name: (Un)mark even.

Or 2 entries, as above.

Notes:

  • We could also have entries `Next page', `Previous page', `Go to page ...', but these are redundant given the page selector and the buttons:

Zoom menu:

This menu offers zooming to distinct magsteps, just like the `x s' key binding does. In addition, it would be nice to have three special pushbuttons, as in Acrobat reader: `Fit to page', `Fit width' and `Fit visible'. (TODO: Evaluate whether it would make sense to have hotkeys for this as well, and which keys would make sense).

Implementing this will require these additional features, the feasibility of which hasn't been evaluated yet:

  • shinking to arbitrary floating-point values, instead of integer values (otherwise it wouldn't be precise enough)
  • recognize bounding box of the entire page (for the `Fit visible' option). We probably could re-use code from forward search for this (which also records bounding boxes, but only for certain glyhphs).

Options menu:

The purpose of this menu is to provide new users easy access to the many `keystroke' commands in xdvi. Options that are likely to be used (repeatedly) while running the program should be put as items into this menu; other options that function as more persistent user preferences (e.g. color of hyperlinks, fonts) should go into the separate `Preferences' window.

Options -> Show PS:

Same as `v' keystroke.

Options -> Keep position:

Same as `k' keystroke.

Options -> Use TeX pages for goto-page():

Same as `T' keystroke.

Options -> Fonts darker():

Increases the density, same as Alt-Ctrl-+.

Options -> Fonts lighter():

Decreases the density, same as Alt-Ctrl--.

Options -> Fonts lighter():

Decreases the density, same as Alt-Ctrl--.

Options -> Page size ...:

Opens a popup window that lets the user select a page size, similar to the `Default paper type' preferences setting. There's also a feature request for this here.

Options -> Preferences:

Opens a preferences dialog with a list of the categories on the left and the single pages of options on the right, similar to the current layout of the `help' dialog (in xdvik-22.74-beta). A mockup of the layout can be found here.

The following mockups show the separate help windows, i.e. the stuff to appear in the right pane. Options must be preserved when switching the categories, i.e. the panes should not be destroyed, and the current values be remembered.

Appearance
Show statusline
Show toolbar
Show tooltips
in statusline
as popups with milliseconds delay
Show menu bar (??)

Font darkness: (NOTE: should be a SpinBox)

The following settings will only take effect after restarting xdvi:
Default paper type: Landscape
Font used for menus and popup windows:
Different font used for statusline:
Background color:

Notes:

  • Need code to query server for the list of suitable fonts.
  • It would be desirable to set `paper type' at runtime. Is that possible?

DVI files
Reload .dvi file on window raise
Watch .dvi file for changes every seconds
Reload .dvi file on explicit `Reload' command or `USR1' signal

Hyperlinks
Color of unvisited links:
  
Color of visited links:
  
Underline links
Browser for remote documents:  

Remarks

  • The colored button next to the `Link' labels displays the currently selected color; clicking on it opens a popup that lets you pick another color (similar to Netscape 4.x).

Specials
Enable PostScript specials (e.g. EPS files)
Source specials:
Editor command:  

Security
As a rule, you should always enable these settings for DVI files that you did not create yourself.
Don't allow DVI specials to execute shell commands
Run PostScript interpreter with -dSAFER option

Debugging
You can enable debugging output for Xdvi here, similar to what the `-debug' option does. These settings are special in that they will also affect other instances of xdvi that are started after selecting `Apply'. In parentheses, the corresponding command-line options are listed.
Bitmap creation (BITMAP)
DVI translation (DVI)
PK fonts (PK)
Batch mode: Exit after reading the DVI file (BATCH)
Event handling (EVENT)
Record all opened files (OPEN)
Postscript specials (PS)


Kpathsearch debugging:
Stat(2) calls (STAT)
Hash table lookups (HASH)
Path definitions (PATHS)
Path expansion (EXPAND)
Searching (SEARCH)

Hypertex specials (HTEX)
Source special handling (SRC)
Client mode for forward search (CLIENT)
Type1 font libarary messages (T1)
Verbose Type1 library messages (T1_VERBOSE)
Creation and handling of GUI elements (GUI)

Set for: This session only
All future sessions

Remarks

  • The functionality for `watch .dvi file for changes' isn't implemented yet: This would mean that the .dvi file is stat()ed every n seconds, and automatically reloaded even if the window is not exposed, similar to what gv does.
  • Turning off automatic reloading is more for completeness; but it prevents blanking out xdvi while compiling the .tex file, which might be useful for some people.
  • The `custom ...' entry in the color selection box could fire up a color dialog with some CMY-values + some pre-selected colors, similar to Netscape's `color links' dialog. (Won't be easy to implement in Xlib/Xt - definitely something `for later' ;-).
  • Open question: How are the user-set values saved? We could probably use something like a `.xdvirc' file with a syntax like .Xdefaults; e.g.:
         !!! created automatically by xdvi vXX.YY on DATE - do not edit this file!
         !!! Instead, put all personal customizations into ~/.Xdefaults, where
         !!! they will be merged with the stuff here.
         xdvi.keepPostion: True
         ... etc. ...
         

    Check Xlib functions like XrmPutFileDatabase or XResourceManagerString for creating this file.

    This file could be a dump of the entire X resources used by xdvik, so that it always reflects the state after merging of global with personal resources (~/.Xdefaults, command-line switches, ...). Check how the options are merged in gv, where a similar file (.gv) is used.

Misc Ideas

Have a customization page that lets user select action and keybindings:

Keystrokes and Actions
Assign this action:
to Mouse button: or Key:
with modifiers:

Current Bindings
Key	Modifier	Action
 

Help menu:

Implemented in xdvik-22.74-beta.

Miscellaneous suggestions/ideas

  • Add a button `Configure browser' to the `no browser specified' warning popup where user can set/select one from a pre-defined list of browsers:

    Xdvi: Choose a browser
    Use this browser to fetch remote documents:
    Set for: This session only
    All future sessions

    `Set also for future sessions' saves the value to the user's config file. `Other' pops up a dialog where user can enter the name of a binary (or navigate through file tree to select a binary). `Help' brings up a help window along the lines of:

    Xdvi: Help
    You have requested a remote document, and xdvi needs a web browser to fetch this document, but no browser has been specified yet. This dialog allows you to specify which browser to use for that task.

    You can either select a browser for the current session only, or also for future sessions. In the latter case, the name of the browser program will be saved to your personal preferences file.

  • For the `text selection' mode, add a mouse context menu that will toggle between the modes: magnifier/href mode -- ruler mode -- text selection mode. Text selection mode changes the bindings for unmodified mouse1 (and mouse2?) and the cursor to XC_xterm (152). The corresponding action could be called `context-menu()'.
Last updated on Sun, 10 May 2009 22:14:25 +0200 by Stefan Ulrich Valid HTML 4.01!