summaryrefslogtreecommitdiff
path: root/src/Xw/Xw_set_fontmap.cxx
blob: 33fc2c8d6a26bb61bd1db938009ef8189af761a1 (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

#include <Xw_Extension.h>

	/* ifdef then trace on */
#ifdef TRACE
#define TRACE_SET_FONTMAP
#endif

/*
   XW_STATUS Xw_set_fontmap(awindow,afontmap):
   XW_EXT_WINDOW *awindow
   XW_EXT_FONTMAP *afontmap

	Set a fontmap to an existing window 

	Returns XW_ERROR if Bad Fontmap
	Returns XW_SUCCESS if successful

*/

#ifdef XW_PROTOTYPE
XW_STATUS Xw_set_fontmap (void *awindow,void *afontmap)
#else
XW_STATUS Xw_set_fontmap (awindow,afontmap)
void *awindow;
void *afontmap ;
#endif /*XW_PROTOTYPE*/
{
XW_EXT_WINDOW *pwindow = (XW_EXT_WINDOW*)awindow;
XW_EXT_FONTMAP *pfontmap = (XW_EXT_FONTMAP*)afontmap ;
    if( !Xw_isdefine_window(pwindow) ) {
        /*ERROR*Bad EXT_WINDOW Address*/
        Xw_set_error(24,"Xw_set_fontmap",pwindow) ;
        return (XW_ERROR) ;
    }

    if( !Xw_isdefine_fontmap(pfontmap) ) {
        /*ERROR*Bad EXT_FONTMAP Address*/
        Xw_set_error(44,"Xw_set_fontmap",pfontmap) ;
        return (XW_ERROR) ;
    }

    _FONTMAP = pfontmap ;
    _FONTMAP->maxwindow++ ;

#ifdef TRACE_SET_FONTMAP
if( Xw_get_trace() ) {
    printf(" Xw_set_fontmap(%lx,%lx)\n",(long ) pwindow,(long ) pfontmap) ;
}
#endif

	return (XW_SUCCESS);
}