~ubuntu-branches/ubuntu/maverick/ntop/maverick

« back to all changes in this revision

Viewing changes to gdchart0.94c/gdcpie.h

  • Committer: Bazaar Package Importer
  • Author(s): Dennis Schoen
  • Date: 2002-04-12 11:38:47 UTC
  • Revision ID: james.westby@ubuntu.com-20020412113847-4k4yydw0pzybc6g8
Tags: upstream-2.0.0
ImportĀ upstreamĀ versionĀ 2.0.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* GDCHART 0.10.0dev  GDCHART.H  2 Nov 2000 */
 
2
/* Copyright Bruce Verderaime 1998, 1999, 2000 */
 
3
 
 
4
#ifndef _GDCPIE_H
 
5
#define _GDCPIE_H
 
6
 
 
7
#ifndef _GDC_H
 
8
#include "gdc.h"
 
9
#endif
 
10
 
 
11
#ifdef GDC_LIB
 
12
extern struct GDC_FONT_T        GDC_fontc[];
 
13
#endif
 
14
 
 
15
typedef enum {
 
16
             GDC_3DPIE,
 
17
             GDC_2DPIE
 
18
             } GDCPIE_TYPE;
 
19
 
 
20
typedef enum {
 
21
             GDCPIE_PCT_NONE,
 
22
             GDCPIE_PCT_ABOVE,          /* relative to label, if any */
 
23
             GDCPIE_PCT_BELOW,
 
24
             GDCPIE_PCT_RIGHT,
 
25
             GDCPIE_PCT_LEFT
 
26
             } GDCPIE_PCT_TYPE;
 
27
 
 
28
 
 
29
/**************************************************/
 
30
/**** USER DEFINABLE PIE OPTIONS  w/ defaults *****/
 
31
/**************************************************/
 
32
EXTERND unsigned long           GDCPIE_BGColor                  DEFAULTO( 0x000000L );  /* black */
 
33
EXTERND unsigned long           GDCPIE_PlotColor                DEFAULTO( 0xC0C0C0L );  /* gray */
 
34
EXTERND unsigned long           GDCPIE_LineColor                DEFAULTO( GDC_DFLTCOLOR );
 
35
EXTERND unsigned long           GDCPIE_EdgeColor                DEFAULTO( GDC_NOCOLOR ); /* edging on/off */
 
36
 
 
37
EXTERND char                            GDCPIE_other_threshold  DEFAULTO( -1 );
 
38
EXTERND unsigned short          GDCPIE_3d_angle                 DEFAULTO( 45 );                 /* 0-360 */
 
39
EXTERND unsigned short          GDCPIE_3d_depth                 DEFAULTO( 10 );                 /* % image width */
 
40
EXTERND char                            *GDCPIE_title                   DEFAULTO( NULL );               /* NLs ok here */
 
41
EXTERND enum GDC_font_size      GDCPIE_title_size               DEFAULTO( GDC_MEDBOLD );
 
42
EXTERND enum GDC_font_size      GDCPIE_label_size               DEFAULTO( GDC_SMALL );
 
43
EXTERND int                                     GDCPIE_label_dist               DEFAULTO( 1+8/2 );              /* 1+GDC_fontc[GDCPIE_label_size].h/2 */
 
44
EXTERND unsigned char           GDCPIE_label_line               DEFAULTO( FALSE );              /* from label to slice */
 
45
 
 
46
EXTERND int                                     *GDCPIE_explode                 DEFAULTO( (int*)NULL ); /* [num_points] */
 
47
                                                                                                                        /* [num_points] supercedes GDCPIE_PlotColor */
 
48
EXTERND unsigned long           *GDCPIE_Color                   DEFAULTO( (unsigned long*)NULL );
 
49
EXTERND unsigned char           *GDCPIE_missing                 DEFAULTO( (unsigned char*)NULL );       /* TRUE/FALSE */
 
50
 
 
51
EXTERND GDCPIE_PCT_TYPE         GDCPIE_percent_labels   DEFAULTO( GDCPIE_PCT_NONE );
 
52
EXTERND char                            *GDCPIE_percent_fmt             DEFAULTO( "%.0f%%" );   /* printf fmt'ing */
 
53
/**** COMMON OPTIONS ******************************/
 
54
/* NOTE:  common options copy here for reference only! */
 
55
/*        they live in gdc.h                           */
 
56
#ifndef _GDC_COMMON_OPTIONS
 
57
#define _GDC_COMMON_OPTIONS
 
58
EXTERND char                            GDC_generate_img        DEFAULTO( TRUE );
 
59
 
 
60
EXTERND GDC_HOLD_IMAGE_T        GDC_hold_img            DEFAULTO( GDC_DESTROY_IMAGE );
 
61
EXTERND void                            *GDC_image                      DEFAULTO( (void*)NULL );        /* in/out */
 
62
#endif
 
63
/**************************************************/
 
64
 
 
65
#ifndef clrallocate
 
66
#define clrallocate( im, rawclr )               _clrallocate( im, rawclr, GDCPIE_BGColor )
 
67
#define clrshdallocate( im, rawclr )    _clrshdallocate( im, rawclr, GDCPIE_BGColor )
 
68
#endif
 
69
 
 
70
void GDC_out_pie( short                 width,
 
71
                                  short                 height,
 
72
                                  FILE*,                                                /* open file pointer, can be stdout */
 
73
                                  GDCPIE_TYPE,
 
74
                                  int                   num_points,
 
75
                                  char                  *labels[],              /* slice labels */
 
76
                                  float                 data[] );
 
77
 
 
78
#endif /*!_GDCPIE_H*/