-
Notifications
You must be signed in to change notification settings - Fork 0
/
images.c
40 lines (34 loc) · 849 Bytes
/
images.c
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
/* Copyright 1998 DJ Delorie <[email protected]>
Distributed under the terms of the GNU GPL
http://www.delorie.com/store/hcalc/
Revisions copyright 2007,
Theodore Kilgore <[email protected]>
*/
#include "hcalc.h"
#include <X11/xpm.h>
#define xpm face_data
#include "face.xpm"
#undef xpm
#define xpm chars_data
#include "chars.xpm"
#undef xpm
Pixmap face;
Pixmap chars;
char charmap[] = " 0123456789ABCDEF-x,.ro+";
int char_to_x[256];
void
load_pixmaps()
{
int i, c;
XpmAttributes attr;
attr.valuemask = 0;
XpmCreatePixmapFromData(display, window, face_data, &face, 0, &attr);
XpmCreatePixmapFromData(display, window, chars_data, &chars, 0, &attr);
for (i=0; i<256; i++)
{
char_to_x[i] = 0;
for (c=0; charmap[c]; c++)
if (charmap[c] == i)
char_to_x[i] = c*12; /* Creates spacing on the output. */
}
}