File: appDraw.h

package info (click to toggle)
ted 2.6-1
  • links: PTS
  • area: main
  • in suites: potato
  • size: 7,928 kB
  • ctags: 8,734
  • sloc: ansic: 71,878; makefile: 2,363; sh: 159
file content (124 lines) | stat: -rw-r--r-- 3,346 bytes parent folder | download
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
#   ifndef	APP_DRAW_H
#   define	APP_DRAW_H

#   include	<X11/Intrinsic.h>
#   include	<appGeo.h>
#   include	<docFont.h>
#   include	<psFont.h>

/************************************************************************/
/*									*/
/*  An attempt to consistently use the same formula to convert from	*/
/*  twips to pixels.							*/
/*									*/
/************************************************************************/

#   define	TWIPStoPIXELS(xmag,t) ((xmag)*(t))
#   define	PIXELStoTWIPS(p,xmag) ((p)/(xmag))

/************************************************************************/
/*									*/
/*  For the administration of the relation between PostScript fonts and	*/
/*  X11 fonts.								*/
/*									*/
/************************************************************************/

typedef struct AppPhysicalFont
    {
    TextAttribute	apfAttribute;
    int			apfDocFamilyNumber;

    int			apfPsFamilyNumber;
    int			apfPsFaceNumber;

    XFontStruct *	apfFontStruct;
    XFontSet		apfFontSet;
    unsigned long	apfUnderLinePositionPixels;
    unsigned long	apfUnderlineThicknessPixels;
    int			apfAscentPixels;
    int			apfDescentPixels;
    int			apfFullSizePixels;
    } AppPhysicalFont;

typedef struct AppPhysicalFontList
    {
    const char *	apflAfmDirectory;
    int			apflCount;
    AppPhysicalFont *	apflFonts;
    } AppPhysicalFontList;

typedef struct AppDrawingData
    {
    DocumentRectangle	addBackRect;
    DocumentRectangle	addPaperRect;
    DocumentRectangle	addDocRect;

    int			sgTabInterval;

    double		sgMagnification;
    double		addMagnifiedPixelsPerTwip;

    char *		addAfmDirectory;
    Display *		addDisplay;
    AppPhysicalFontList	addPhysicalFontList;
    } AppDrawingData;

/************************************************************************/
/*									*/
/*  Procedure declarations.						*/
/*									*/
/************************************************************************/

extern void appCollectExposures(	DocumentRectangle *	drClip,
					int			ox,
					int			oy,
					Display *		display,
					Window			win,
					GC			gc,
					XEvent *		event );

extern void appInitDrawingData(		AppDrawingData *	add );
extern void appCleanDrawingData(	AppDrawingData *	add );


extern void appInitFontList(	AppPhysicalFontList *	apfl );
extern void appCleanFontList(	Display *		display,
				AppPhysicalFontList *	apfl );

extern void appEnableFontsTool(	void *	voidafc,
				int	enabled );

extern void appShowFontsTool(		void *	voidefc	);

extern int appFontCatalog(	Display *		display,
				AppFontFamily **	pFamilies,
				int *			pCount		);

extern void appFontFormatCurrent(	char *			target,
					AppFontFamily *		aff,
					AppFontTypeface *	aft,
					int			size	);

extern int appOpenDocumentFont(	AppDrawingData *	add,
				DocumentFontList *	dfl,
				TextAttribute		ta	);

extern int appFontSetCurrentFont(	void *		voidefc,
					int		fontFamilyNumber,
					unsigned int	updMask,
					TextAttribute	taNew );

extern void appFontAttributeString(	char *			target,
					const char *		familyName,
					unsigned int		updMask,
					TextAttribute		taNew );

extern int appGetPsFont(	int *			pFamily,
				int *			pFace,
				AppFontFamily **	pAff,
				AppFontTypeface **	pAft,
				const char *		afmDirectory,
				const DocumentFont *	df,
				TextAttribute		ta );

#   endif							/*  }}  */