cgrchart.h

来自「开放源码的编译器open watcom 1.6.0版的源代码」· C头文件 代码 · 共 770 行 · 第 1/2 页

H
770
字号
/****************************************************************************
*
*                            Open Watcom Project
*
*    Portions Copyright (c) 1983-2002 Sybase, Inc. All Rights Reserved.
*
*  ========================================================================
*
*    This file contains Original Code and/or Modifications of Original
*    Code as defined in and that are subject to the Sybase Open Watcom
*    Public License version 1.0 (the 'License'). You may not use this file
*    except in compliance with the License. BY USING THIS FILE YOU AGREE TO
*    ALL TERMS AND CONDITIONS OF THE LICENSE. A copy of the License is
*    provided with the Original Code and Modifications, and is also
*    available at www.sybase.com/developer/opensource.
*
*    The Original Code and all software distributed under the License are
*    distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
*    EXPRESS OR IMPLIED, AND SYBASE AND ALL CONTRIBUTORS HEREBY DISCLAIM
*    ALL SUCH WARRANTIES, INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF
*    MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR
*    NON-INFRINGEMENT. Please see the License for the specific language
*    governing rights and limitations under the License.
*
*  ========================================================================
*
* Description:  WHEN YOU FIGURE OUT WHAT THIS FILE DOES, PLEASE
*               DESCRIBE IT HERE!
*
****************************************************************************/


#ifndef CGR_CHART_H
#define CGR_CHART_H
/*
 Description:
 ============
     This file defines the structures which define a chart.

*/

#define LEN_TEXT                80      // max length of a text_desc line
#define LEN_FORMAT              20      // max length of a prefix or suffix
#include "wpitypes.h"

/* all the enum types are unsigned int since they are set in
   radio buttons through formdev. Toggle fields are declared type 'ibool' */

typedef int     ibool;

enum {
    CGR_WHITE           = 1,
    CGR_BLACK,
    CGR_LBLUE,
    CGR_LRED,
    CGR_LPURPLE,
    CGR_LGREEN,
    CGR_LCYAN,
    CGR_LGREY,
    CGR_LYELLOW,
    CGR_BLUE,
    CGR_RED,
    CGR_PURPLE,
    CGR_GREEN,
    CGR_CYAN,
    CGR_GREY,
    CGR_YELLOW,
    CGR_LAST_COLOR
};
typedef int cgr_color;

enum {          // types of orientation
    COUNTERCLOCKWISE    = 1,
    CLOCKWISE
};
typedef int orientation;

enum {          // the types of charts
    CHART_BAR           = 1,
    CHART_AREA,
    CHART_PIE,
    CHART_XY,
    CHART_BAR_ONLY,
    CHART_AREA_ONLY,
    CHART_LINE_ONLY,
    CHART_PROPORTIONAL,
    CHART_RADAR,
    CHART_STOCK,
    CHART_A100,
    CHART_GANTT,
    CHART_BUBBLE,
    CHART_BOX_WHISKER,
    CHART_LAST
};
typedef unsigned chart_type;

enum {
    ON_TOP,
    ON_BOTTOM,
    ON_LEFT,
    ON_RIGHT,
    ON_FRONT,           // used for 3d bla charts
    ON_BACK
};
typedef unsigned int position_op;

enum {                  // the types of draw items
    DRAW_ARROW          = 1,
    DRAW_TEXT,
    DRAW_LAST
};
typedef unsigned int draw_item_type;

enum {                  // the width of the arrowhead
    VERYNARROW_HEAD     = 1,
    NARROW_HEAD,
    MEDIUM_HEAD,
    WIDE_HEAD,
    VERYWIDTH_HEAD,
    HEAD_WIDTH_LAST
};
typedef unsigned int arrowhead_width;

enum {                  // the length of the arrowhead
    SHORT_HEAD          = 1,
    AVERAGE_HEAD,
    LONG_HEAD,
    VERYLONG_HEAD,
    HEAD_LENGTH_LAST
};
typedef unsigned int arrowhead_length;

enum {                  // the type of the arrowhead
    NO_HEAD             = 1,
    LINE_HEAD,
    FILL_HEAD,
    WHITE_HEAD,
    HEAD_TYPE_LAST
};
typedef unsigned int arrowhead_type;

typedef struct wcoord {
    float               xcoord;
    float               ycoord;
} wcoord;

typedef struct label_coords {
    float       rotation[2][2];
    wcoord      min;
    wcoord      max;
    wcoord      left;           // left side of axis line
    wcoord      right;
    bool        minmax_set;
} label_coords;

enum {
    SCALE_3D_OFF,
    SCALE_3D_ON,
    SCALE_3D_SKIP       // skip first scale label
};
typedef unsigned int three_d_scale;

enum {          // 3d display
    THREE_D_OFF         = 1,
    THREE_D_ON
};
typedef unsigned three_d_display;

enum {          // format of values option
    VALUES_OFF  = 1,
    VALUES_ON,
    VALUES_ON_PERCENT
};
typedef unsigned int values_op;

enum {          // format of labels option
    LABELS_OFF          = 1,
    LABELS_ON,
    LABELS_VERTICAL
};
typedef unsigned int labels_op;
typedef unsigned int pie_labels_op;     // no slanted

enum {
    X_SCALE             = 0,
    Y_SCALE             = 1,
    Y2_SCALE
};
typedef unsigned int scale_xy;

enum {
    SCALE_MANUAL        = 1,
    SCALE_AUTO
};
typedef unsigned int scale_type;

#define FILL_SOLID_COLOR        0       // FOR INTERNAL USE ONLY
enum {                          // fill style for slice/bar/area
    FILL_SOLID  = 1,            // solid fill
    FILL_HOLLOW,                // outline, background fill for interior
    FILL_HATCH_LD,             // hatch: left diagonal
    FILL_HATCH_RD,             // hatch: right diagonal
    FILL_HATCH_HC,              // hatch: horz. cross
    FILL_HATCH_H,             // hatch: horz. lines
    FILL_HATCH_V,              // hatch: vert. lines
    FILL_HATCH_DC,             // hatch: diag. cross
    FILL_LAST
};
typedef unsigned int fill_style;

enum {                  // types of markers
    MARKER_DOT          = 1,    // '.'
    MARKER_PLUS,                // '+'
    MARKER_STAR,                // '*'
    MARKER_CIRCLE,              // 'o'
    MARKER_CROSS,               // 'x'
    MARKER_SQUARE,              // a square
    MARKER_SOLID_SQUARE,        // a solid square
    MARKER_SOLID_CIRCLE,        // a solid circle
    MARKER_SOLID_TRIANGLE,      // a solid triangle
    MARKER_SOLID_DIAMOND,       // a solid diamond
    MARKER_NONE,                // no marker
    MARKER_LAST
};
typedef unsigned int marker_style;

enum {                  // types of line styles
    LINE_NONE           = 0,    // FOR INTERNAL USE ONLY
    LINE_SOLID,
    LINE_DASHED,
    LINE_DOTTED,
    LINE_MIXED,                 // dashed and dotted
    LINE_LAST
};
typedef unsigned int line_style;

enum {
    WIDTH_SINGLE        = 1,
    WIDTH_NARROW,
    WIDTH_MEDIUM,
    WIDTH_LAST
};
typedef unsigned int line_width;

enum {                  // arrangement of bars/areas
    ARRANGE_STACKED =   1,      // stacked bars/areas
    ARRANGE_OVERLAP,            // overlapping bars/areas
    ARRANGE_CLUSTERED,          // clustered bars (N/A for areas)
    ARRANGE_PROPORTIONAL        // for rowscale.c
};
typedef unsigned int arrange;

#define ARRANGE_DEPTH ARRANGE_OVERLAP

enum {                  // the alignment of text
    TEXT_ALIGN_LEFT             = 1,
    TEXT_ALIGN_CENTER,
    TEXT_ALIGN_RIGHT
};
typedef unsigned int text_align;

enum {                  // drawing type for each column (series)
    COLUMN_NO_CHECK     = -2,   // INTERNAL: for column_type
    COLUMN_EMPTY,               // INTERNAL: an empty column flag
    COLUMN_PIE,                 // INTERNAL: pie chart column

    COLUMN_BAR          = 1,    // draw column as bars
    COLUMN_LINE,                // draw column as lines
    COLUMN_CURVE,               // draw column as curved line
    COLUMN_POINT,               // draw column as set of points (scatter)
    COLUMN_TREND,               // draw column as least squares trend line
    COLUMN_CIRCLE,              // draw column as circle
    COLUMN_LAST
};
typedef int col_type;
#define COLUMN_AREA     1       // first in above is this if it is an area chart

enum {
    XY_LINE             = 1,
    XY_CURVE,
    XY_POINT,
    XY_TREND,
    XY_LAST
};
typedef int x_y_type;

enum {
    DRAW_COLOR          = 1,    // draw slices/bars/areas/lines with color only
    DRAW_FILL,                  // draw slices/bars/areas/lines with fill only
    DRAW_BOTH                   // use color and fill styles
};
typedef unsigned int draw_type;

enum {
    GRID_NONE           = 1,    // no grid line
    GRID_DOTTED,                // dotted grid line
    GRID_LINE                   // a solid grid line
};
typedef unsigned int grid_type;

enum {
    TICK_NONE           = 1,    // no tick marks
    TICK_IN,                    // inside chart tick marks
    TICK_OUT,                   // outside chart tick marks
    TICK_BOTH                   // in and out tick marks
};
typedef unsigned int tick_type;

#ifdef __NT__
#undef STOCK_LAST
#endif

enum {
    STOCK_MARK          = 1,
    STOCK_BAR,
    STOCK_AREA,
    STOCK_LINE,
    STOCK_LAST
};
typedef unsigned int stck_type;

enum {
    HORZ_CHART          = 1,    // horizontal bar/area chart
    VERT_CHART                  // vertical bar/area chart
};
typedef unsigned int chart_dir_type;

enum {
    PROJ_PARALLEL   = 1,        // parallel projection for 3d charts
    PROJ_PERSPECTIVE            // perspective  "       "  "    "
};
typedef unsigned int proj_type;

enum {
    LIGHT_AUTO          = 1,
    LIGHT_MANUAL
};
typedef unsigned int light_type;

enum {
    LIGHT_VERT_TOP      = 1,    // vertical light placement for 3d charts
    LIGHT_VERT_MID,
    LIGHT_VERT_BOTTOM
};
typedef unsigned int light_vert_pos;

enum {
    LIGHT_HORZ_LEFT     = 1,    // horizontal light placement
    LIGHT_HORZ_MID,
    LIGHT_HORZ_RIGHT
};
typedef unsigned int light_horz_pos;

enum {
    LIGHT_DEPTH_FRONT   = 1,    // depth light placement
    LIGHT_DEPTH_MID,
    LIGHT_DEPTH_BACK
};
typedef unsigned int light_depth_pos;

enum {
    SURFACE_RES_LOW     = 1,    // surface resolutions for 3d pie & ribbon
    SURFACE_RES_MED,
    SURFACE_RES_HIGH
};
typedef unsigned int surface_res;

enum {
    PRECISION_COLUMN    = 1,    // use column attr precision
    PRECISION_GLOBAL,           // use global precision field
    PRECISION_AUTOMATIC,
    PRECISION_LAST
};
typedef unsigned int prec_op;

enum {
    SCALE_PREC_GLOBAL   = 1,
    SCALE_PREC_AUTOMATIC,
    SCALE_PREC_LAST
};
typedef unsigned int scale_prec_op;

enum {
    FRAME_XY            = 1,
    FRAME_FULL,

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?