Next Previous Contents

23. Mathoms

This section is a dumping ground for things that don't belong anywhere else (mathom is a Hobbit term: a mathom is something that no one knows what to do with but they don't want to throw it away).

23.1 Enlightening mgv

If you're into the enlightened look, then you should make sure you don't try and specify a backgroundPixmap for the main scrolled window. Resource settings like this:

        MGv*view*backgroundPixmap:        XmUNSPECIFIED_PIXMAP
        MGv*backgroundPixmap:             /full/path/to/tile.xpm
        MGv*foreground:                   fg
        MGv*background:                   bg
        MGv*XmText.backgroundPixmap:      XmUNSPECIFIED_PIXMAP
        MGv*XmTextField.backgroundPixmap: XmUNSPECIFIED_PIXMAP
        MGv*XmList.backgroundPixmap:      XmUNSPECIFIED_PIXMAP
should give you the enlightened look (text and list widgets look pretty crappy with background pixmaps so there's no point in even trying). If you try and specify a backgroundPixmap for view, you will probably get an X protocol error at startup. For best results, fg should contrast with the whole tiling pixmap (smooth pixmaps work best) and bg should be a solid color that is close the pixmap colors. Better results can be had if you're willing to set up different pixmaps for the various types of widgets; if you come up with anything really cool, let me know. If you're wondering what this stuff looks like, my homepage has a couple of screen shots.

If you don't have Motif 2.0.1+ then the backgroundPixmap resource might not work (it does work with Netscape 4.X/Linux and that uses Motif 1.2.X). I have tried this stuff with Irix and CDE (Motif 1.2.5) without success: mgv died on Irix and ignored the pixmap under CDE. I think the problem could be fixed by adding a String to Pixmap type converter that understood XPM files but that will have to wait. Most LessTif libraries supply a String to Pixmap type converter that understands XPM files so LessTif users should be able use fancy tiling as well.

23.2 Using mgv With Netscape

If you want to use mgv as the PostScript viewer with Netscape you just have to set the application/postscript MIME handler to "mgv %s". The MIME handlers can be configured in the big Preferences dialog for Netscape 4 or in the Helpers tab of the General Preferences dialog in Netscape 3.

This is the original reason that I changed the saving behavior of mgv: in version one you could only save marked pages, now you can save whatever you want.

23.3 Using mgv With CDE

If you want to use mgv in the CDE desktop, the following article from comp.unix.cde may be of interest:

Article 1968 of comp.unix.cde:
From: Larry Gardner <lkg@atl.hp.com>
Newsgroups: comp.unix.cde
Subject: Re: Registering new file types
Date: Wed, 25 Jun 1997 10:11:39 -0400
Organization: Hewlett Packard TIS/SEM/IES
Lines: 109
Message-ID: <33B1271B.3BC4@atl.hp.com>
References: <5oojdv$823@bioko.ifi.unizh.ch>
NNTP-Posting-Host: wscoe2.atl.hp.com
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-Mailer: Mozilla 3.01 (X11; I; HP-UX B.10.00 9000/747)
To: Dimitrios Tombros <tombros@ifi.unizh.ch>
Xref: news.lglobal.com comp.unix.cde:1968

Dimitrios Tombros wrote:
> 
> Is it possible to register new file types with CDE for a specific
> user so that when clicking on these types from the file manager
> the respective application is started?
> 
> Any help will be appreciated; if this is a FAQ then please point me
> to the FAQ location.
> 
> --
> 
> ----------------------------------------------------------------------
> Dimitrios Tombros                   Database Technology Research Group
> e-mail: tombros@ifi.unizh.ch               Computer Science Department
> http://www.ifi.unizh.ch/staff/tombros.html        University of Zurich

Here's an example for the postscript file type that will use ghostscript
and ghostview to print/view postscript files.

HTH

Larry

ghostview.dt

################################################################################
#
# File:         ghostview.dt
# RCS:          $ Header: ghostview.dt,v 1.0 97/06/04 16:39:57 lkg Exp $
# Description:  CDE generic action for application execution.
# Author:       TIS/SEM/IES WS-COE Team.
# Created:      Wed Jun  4 16:39:27 EDT 1997
# Modified:
# Language:     CDE 1.0 Actions
#
################################################################################
#
# Initialize Variables
#
################################################################################

set GHOSTVIEW=/opt/gnu/bin/X11/ghostview

################## END OF VARIABLE INITIALIZATION
##############################

ACTION GhostView
{
    ARG_COUNT   0
    ICON        gv
    TYPE        COMMAND
    WINDOW_TYPE NO_STDIO
    EXEC_STRING $GHOSTVIEW
    DESCRIPTION Ghostview postscript viewer.
}

ACTION GhostView
{
    ARG_COUNT   *
    ARG_TYPE    POSTSCRIPT
    ICON        gv
    TYPE        COMMAND
    WINDOW_TYPE NO_STDIO
    EXEC_STRING $GHOSTVIEW %(File)Arg_1%
    DESCRIPTION Ghostview postscript viewer.
}

ACTION gsPrint
{
    TYPE        COMMAND
    WINDOW_TYPE NO_STDIO
    EXEC_STRING sh -c '/opt/gnu/bin/gs -q -sDEVICE=ljet4 -r300 -dNOPAUSE \
                       -sOutputFile=- \
                       %(File)Arg_1"Postscript File To Print:"% \
                       %(File)Args% | lp -s -oraw'
    DESCRIPTION The gsPrint action formats its arguments \
                using the 'gs' command and prints them to \
                the default printer using 'lp'.
}

DATA_ATTRIBUTES POSTSCRIPT
{
    ICON        Dtps
    ACTIONS     Open,Print
    DESCRIPTION This is a postscript file.
}
DATA_CRITERIA POSTSCRIPT1
{
    DATA_ATTRIBUTES_NAME POSTSCRIPT
    MODE                 !d
    NAME_PATTERN         *.[Pp][Ss]
}

ACTION Open
{
    ARG_TYPE    POSTSCRIPT
    TYPE        MAP
    MAP_ACTION  GhostView
    DESCRIPTION This action opens the postscript file type.
}

ACTION Print
{
    ARG_TYPE    POSTSCRIPT
    TYPE        MAP
    MAP_ACTION  gsPrint
    DESCRIPTION This action prints the postscript file type.
}
This would probably work with mgv if you change "ghostview" to "mgv" all over the place. You'll have to make your own icons though (lib/icon.xpm would be a good starting place but it is the wrong size). I can't really help you with this so you're on your own (of course, I'd be interested in any results).

23.4 Splash Screen

Here's the PostScript program from the splash screen for the curious:

        %!PS-Adobe-3.0
        %%Title: MGv
        %%Pages: (atend)
        %%Orientation: Portrait
        %%DocumentMedia: Letter 612 792 0 () ()
        %%PageOrder: Ascend
        %%Creator: $\mu$
        %%EndComments
        %%BeginProlog
        /SF {
                findfont exch dup
                type /arraytype eq {makefont} {scalefont} ifelse
                setfont
        } def
        /MGv {
                72 /Helvetica-Bold-Oblique SF
                50 700 moveto (MGv) show showpage
        } def
        %%EndProlog
        %%Page: 1 1
        MGv
        %%Trailer
        %%EOF

23.5 Binaries

I stopped making Linux binaries because LessTif is good enough for mgv these days.

Binaries for HP-UX are available from the HP-UX Porting and Archive Center (okay, I admit, I submitted the request for this).

Binaries for FreeBSD are available from the porting section of the FreeBSD Homepage (I didn't submit the request for this, someone else did).

If anyone knows where people can get binaries for other platforms, RPM packages, or Debian packages, please let me know so that I can add links to the mgv web page.


Next Previous Contents