aboutsummaryrefslogtreecommitdiff
path: root/generic/Attrs.h
blob: 1d9ba0e98bbdf9f3673f604d7a9c6b23acdeead5 (plain)
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
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
/*
 * Attrs.h -- Header for the attribute manipulation routines.
 *
 * Authors		: Patrick Lecoanet.
 * Creation date	: Fri Dec 31 10:06:37 1999
 *
 * $Id$
 */

/*
 *  Copyright (c) 1993 - 1999 CENA, Patrick Lecoanet --
 *
 * This code is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Library General Public
 * License as published by the Free Software Foundation; either
 * version 2 of the License, or (at your option) any later version.
 *
 * This code is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Library General Public License for more details.
 *
 * You should have received a copy of the GNU Library General Public
 * License along with this code; if not, write to the Free
 * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 *
 */


#ifndef _Attrs_h
#define _Attrs_h

#ifdef __CPLUSPLUS__
extern "C" {
#endif


#include <Types.h>
  

/*
 * Label Formats.
 */
  
/*
 * field flags.
 */
#define	LF_ATTACH_PIXEL	0
#define	LF_ATTACH_FWD	1
#define	LF_ATTACH_BWD	2
#define	LF_ATTACH_LEFT	3	/* Align left on left or top on top */
#define	LF_ATTACH_RIGHT	4	/* Align right on right or bottom on bottom */

#define LF_DIM_PIXEL	0
#define	LF_DIM_FONT	1
#define	LF_DIM_ICON	2
#define LF_DIM_AUTO	3
  
typedef struct {
  int		x_spec;
  int		y_spec;
  short		width_spec;
  short		height_spec;
  char		x_attach;
  char		y_attach;
  char		x_dim;
  char		y_dim;
} FieldFormatStruct, *FieldFormat;

typedef struct {
  short		clip_width;
  short		clip_height;
  int		num_fields;
  Tcl_HashEntry	*entry;
  int		ref_count;
  FieldFormatStruct fields[1];
} LabelFormatStruct, *LabelFormat;


LabelFormat
LabelFormatCreate(Tcl_Interp	* /* interp */,
		  char		* /* format_str */,
		  int		/* num_fields */);
LabelFormat
LabelFormatDuplicate(LabelFormat	/* label_format */);
void
LabelFormatDelete(LabelFormat	/* label_format */);
char *
LabelFormatGetString(LabelFormat	/* label_format */);
RadarBool
LabelFormatGetClipBox(LabelFormat	/* label_format */,
		      RadarDim		*/* width */,
		      RadarDim		*/* height */);
#define LabelFormatNumFields(lf)	((lf)->num_fields)
void
LabelFormatGetField(LabelFormat	/* label_format */,
		    int		/* field */,
		    char	*/* x_attach */,
		    char	*/* y_attach */,
		    char	*/* x_dim */,
		    char	*/* y_dim */,
		    int		*/* x_spec */,
		    int		*/* y_spec */,
		    short	*/* width_spec */,
		    short	*/* height_spec */);

/*
 * Line Ends.
 */
typedef struct {
  RadarReal	shape_a;
  RadarReal	shape_b;
  RadarReal	shape_c;
  Tcl_HashEntry	*entry;
  int		ref_count;
} LineEndStruct, *LineEnd;

LineEnd
LineEndCreate(Tcl_Interp	*interp,
	      char		*line_end_str);
LineEnd
LineEndDuplicate(LineEnd	le);
void
LineEndDelete(LineEnd	le);
char *
LineEndGetString(LineEnd	le);

#ifdef __CPLUSPLUS__
}
#endif

#endif	/* _Attrs_h */