File: appRuler.h

package info (click to toggle)
ted 2.11-1
  • links: PTS
  • area: main
  • in suites: woody
  • size: 11,064 kB
  • ctags: 13,935
  • sloc: ansic: 120,446; makefile: 7,469; sh: 253
file content (103 lines) | stat: -rw-r--r-- 2,490 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
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
/************************************************************************/
/*									*/
/*  Common resources used by Rulers.					*/
/*									*/
/************************************************************************/

#   ifndef	APP_RULER_H
#   define	APP_RULER_H

#   include	<appDraw.h>

typedef struct RulerData
    {
    int				rdSizeAcross;
    int				rdSizeAlong;
    int				rdFontHeight;

    int				rdMinUsed;
    int				rdMaxUsed;
    int				rdExtraAfterMaxUsed;

    const char *		rdFontName;

				/****************************************/
				/*					*/
				/*  Pixel coordinate ranges for the	*/
				/*  ruler.				*/
				/*					*/
				/****************************************/
    int				rdDocumentC0;
    int				rdDocumentC1;
    int				rdVisibleC0;
    int				rdVisibleC1;
    int				rdRulerC1;

    APP_FONT *			rdFontStruct;
    VerticalXFont		rdVerticalFont;
    APP_BITMAP_MASK		rdBackStipple;
    AppDrawingData		rdDrawingData;
    int				rdDrawingDataAllocated;

    int				rdUnit;
    int				rdTicksPerTag;
    int				rdTicksPerText;
    double			rdUnitsPerTick;

    double			rdTwipsPerUnit;
    double			rdMagnifiedPixelsPerTwip;
    } RulerData;

typedef void (*DragHair)( void * voided, int from, int to, int asUpper );

/************************************************************************/
/*									*/
/*  Routine declarations.						*/
/*									*/
/************************************************************************/

extern void appInitRulerData(		RulerData *	rd );

extern void appCleanRulerData(		RulerData *	rd );

extern void appRulerDrawBackground(	RulerData *	rd,
					int		x,
					int		y,
					int		wide,
					int		high );

extern void appRulerAllocateDrawingData( RulerData *	rd,
					int		vertical,
					int		fontHeight,
					double		magnification,
					APP_WIDGET	w );

extern int appRulerTextWidth(		RulerData *	rd,
					const char *	s,
					int		len );

extern void appRulerDrawVerticalString(	RulerData *	rd,
					int		x,
					int		y,
					char *		s,
					int		len );

extern void appRulerCalculateIncrements( RulerData *	rd,
					double		magnifiedPixelsPerTwip,
					double		magnification );

extern void appRulerTagText(		char *		to,
					int *		pWide,
					int *		pLen,
					RulerData *	rd,
					double		units );

extern void appScrollHorizontalRuler(	RulerData *		rd,
					DocumentRectangle *	drClip,
					int			d );

void appScrollVerticalRuler(		RulerData *		rd,
					DocumentRectangle *	drClip,
					int			d );

#   endif