/*----------------------------------------------------------------------
       Can we display this type/subtype?

   Args: type      -- the MIME type to check
         subtype   -- the MIME subtype
         params    -- parameters

 Result: returns 1 if the type is displayable, 0 otherwise.
 ----*/
mime_can_display(type, subtype, params)
    int type;
    char *subtype;
    PARAMETER *params;
{
    if (mailcap_can_display(type, subtype)) {
	return(1) ;
    }
    else {
	switch(type) {
	  case TYPETEXT:		/* always try to display text */
	    return(1);

	  case TYPEAUDIO:		/* no native audio tool */
	    return(0);
      
	  case TYPEIMAGE:		/* in xterm and valid subtype? ok. */
	    return(getenv("DISPLAY")
		   && (strucmp(subtype, "gif") == 0
		       || strucmp(subtype, "pgm") == 0
		       || strucmp(subtype, "pbm") == 0
		       || strucmp(subtype, "tiff") == 0
		       || strucmp(subtype, "jpeg") == 0));

	  case TYPEAPPLICATION:
	    return(0);

	  case TYPEMULTIPART:
	    return(1);

	  case TYPEMESSAGE:
	    return(1);

	    default:
	    return(0);
	}
    }
}


