1 /************************************************************************/
2 /*									*/
3 /*  Drawing surface implementation implementation.			*/
4 /*									*/
5 /************************************************************************/
6 
7 #   include "appFrameConfig.h"
8 
9 #   include <drawDrawingSurface.h>
10 #   include <appDebugon.h>
11 #   include <uniUtf8.h>
12 
drawSetForegroundColorWhite(DrawingSurface ds)13 int drawSetForegroundColorWhite(	DrawingSurface	ds )
14     {
15     RGB8Color	rgb8;
16 
17     utilRGB8SolidWhite( &rgb8 );
18 
19     return drawSetForegroundColor( ds, &rgb8 );
20     }
21 
drawSetForegroundColorBlack(DrawingSurface ds)22 int drawSetForegroundColorBlack(	DrawingSurface	ds )
23     {
24     RGB8Color	rgb8;
25 
26     utilRGB8SolidBlack( &rgb8 );
27 
28     return drawSetForegroundColor( ds, &rgb8 );
29     }
30 
31 /************************************************************************/
32 /*									*/
33 /*  Draw a single unicode symbol.					*/
34 /*									*/
35 /************************************************************************/
36 
drawGetSymbolExtents(DocumentRectangle * drText,DrawingSurface ds,int x0,int y0,int screenFont,int symbol)37 int drawGetSymbolExtents(	DocumentRectangle *	drText,
38 				DrawingSurface		ds,
39 				int			x0,
40 				int			y0,
41 				int			screenFont,
42 				int			symbol )
43     {
44     int				step;
45     char			scratch[10];
46 
47     step= uniPutUtf8( scratch, symbol );
48     if  ( step < 1 )
49 	{ return -1;	}
50     scratch[step]= '\0';
51 
52     return drawGetTextExtents( drText, ds, x0, y0, screenFont, scratch, step );
53     }
54 
55 
drawSymbol(DrawingSurface ds,int x,int y,int screenFont,int symbol)56 void drawSymbol(		DrawingSurface		ds,
57 				int			x,
58 				int			y,
59 				int			screenFont,
60 				int			symbol )
61     {
62     int				step;
63     char			scratch[10];
64 
65     step= uniPutUtf8( scratch, symbol );
66     if  ( step < 1 )
67 	{ return;	}
68     scratch[step]= '\0';
69 
70     drawString( ds, x, y, screenFont, scratch, step );
71 
72     return;
73     }
74 
75