File: g_havecap.c

package info (click to toggle)
plotutils 2.4.1-15
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 11,072 kB
  • ctags: 6,952
  • sloc: ansic: 76,305; cpp: 12,402; sh: 8,475; yacc: 2,604; makefile: 894; lex: 144
file content (45 lines) | stat: -rw-r--r-- 1,593 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
/* This file contains the havecap method, which is a GNU extension to
   libplot.  It queries the current plotter to determine whether or not it
   has a specified capability, specified by a string.

   Return value is 0/1/2 (no/yes/maybe).  If the capability is not
   recognized, the return value is 0. */


#include "sys-defines.h"
#include "extern.h"

int
#ifdef _HAVE_PROTOS
_API_havecap (R___(Plotter *_plotter) const char *s)
#else
_API_havecap (R___(_plotter) s)
     S___(Plotter *_plotter;) 
     const char *s;
#endif
{
  if (strcasecmp (s, "WIDE_LINES") == 0)
    return _plotter->data->have_wide_lines;
  else if (strcasecmp (s, "SOLID_FILL") == 0)
    return _plotter->data->have_solid_fill;
  else if (strcasecmp (s, "DASH_ARRAY") == 0)
    return _plotter->data->have_dash_array;
  else if (strcasecmp (s, "EVEN_ODD_FILL") == 0)
    return _plotter->data->have_odd_winding_fill;
  else if (strcasecmp (s, "NONZERO_WINDING_NUMBER_FILL") == 0)
    return _plotter->data->have_nonzero_winding_fill;
  else if (strcasecmp (s, "SETTABLE_BACKGROUND") == 0)
    return _plotter->data->have_settable_bg;
  else if (strcasecmp (s, "HERSHEY_FONTS") == 0)
    return 1;			/* always supported */
  else if (strcasecmp (s, "PS_FONTS") == 0)
    return _plotter->data->have_ps_fonts;
  else if (strcasecmp (s, "PCL_FONTS") == 0)
    return _plotter->data->have_pcl_fonts;
  else if (strcasecmp (s, "STICK_FONTS") == 0)
    return _plotter->data->have_stick_fonts;
  else if (strcasecmp (s, "EXTRA_STICK_FONTS") == 0)
    return _plotter->data->have_extra_stick_fonts;
  else
    return 0;
}