-
Notifications
You must be signed in to change notification settings - Fork 6
/
jlAxisP.h
95 lines (79 loc) · 2.8 KB
/
jlAxisP.h
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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
/*************************************************************************\
* Copyright (c) 1994-2004 The University of Chicago, as Operator of Argonne
* National Laboratory.
* Copyright (c) 1997-2003 Southeastern Universities Research Association,
* as Operator of Thomas Jefferson National Accelerator Facility.
* Copyright (c) 1997-2002 Deutches Elektronen-Synchrotron in der Helmholtz-
* Gemelnschaft (DESY).
* This file is distributed subject to a Software License Agreement found
* in the file LICENSE that is included with this distribution.
\*************************************************************************/
#ifndef _jlAxisP
#define _jlAxisP
#include <Xm/PrimitiveP.h>
#include "jlAxis.h"
#define AXIS_MAX_DIGITS 4
#define AXIS_MAX_LABEL 32
#define AXIS_MAJOR_TIC_LENGTH 5
#define AXIS_MINOR_TIC_LENGTH 2
#define AXIS_LABEL_MAX_SKEW 2
#define AXIS_LABEL_PAD 2
/* ====== New fields for the Axis widget class record ====== */
typedef struct _AxisClassPart
{
int make_compiler_happy; /* keep compiler happy */
}
AxisClassPart;
/* ====== Full class record declaration ====== */
typedef struct _AxisClassRec
{
CoreClassPart core_class;
XmPrimitiveClassPart primitive_class;
AxisClassPart axis_class;
}
AxisClassRec;
extern AxisClassRec axisClassRec;
/* ====== New fields for the Axis widget record ====== */
typedef struct _AxisPart
{
/* resources */
XFontStruct *font;
Pixel text_color;
String unit_string;
AxisDirection direction;
AxisTransform transform;
AxisValueType value_type;
double min_val, max_val;
AxisEndpointPosition min_pos, max_pos;
Dimension min_margin;
double log_epsilon;
Boolean use_pixmap;
double *pmin_val;
double *pmax_val;
double *plog_epsilon;
/* private state */
GC draw_gc;
GC erase_gc;
GC text_gc;
Pixmap pixmap;
Boolean need_refresh;
short n_tics;
double tic_offsets[AXIS_MAX_TICS+1]; /* normalized */
short tic_lengths[AXIS_MAX_TICS+1];
char tic_labels[AXIS_MAX_TICS+1][AXIS_MAX_LABEL+1];
char tic_scale[AXIS_MAX_LABEL+1];
short log_n_powers;
short log_epsilon_index;
double log_epsilon_offset;
double log_delta;
}
AxisPart;
/* ====== Full instance record declaration ====== */
typedef struct _AxisRec
{
CorePart core;
XmPrimitivePart primitive;
AxisPart axis;
}
AxisRec;
#endif