aboutsummaryrefslogtreecommitdiff
path: root/hcalc.h
blob: a469c9a6cb54e8d3f9b3e9d0138e6c7da4f2d606 (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
54
55
56
57
58
59
60
61
62
/* Copyright 1998 DJ Delorie <dj@delorie.com>
   Distributed under the terms of the GNU GPL
   http://www.delorie.com/store/hcalc/
   Revisions copyright 2007,  
   Theodore Kilgore <kilgota@auburn.edu>
	More revisions copyright 2023, B. Watson <urchlay@slackware.uk>
*/

#include <stdio.h>
#include <X11/Xlib.h>
#include <X11/Xutil.h>
#include <X11/keysym.h>
#include <X11/Xatom.h>

#define SELF "HCalc"
#include "version.h"

extern Display *display;
extern int screen;
extern Visual *visual;
extern Colormap cmap;
extern Window window;
extern Window rootwin;
extern GC gc;
extern Atom wm_protocols_atom;
extern Atom delete_atom;
extern Atom paste_atom;
extern XEvent event;

extern Pixmap face;
extern Pixmap chars;

extern int base;
extern int bit_on;
extern int bit_off;

extern int char_to_x[256];
extern char charmap[];

extern int widths[3];
extern int heights[3];
extern int winsize;
extern int scale_factor;

extern double value, saved, stored;
extern int quiet;

void set_bits(int b);
void set_string(char *s);
void redraw();
void key(char c);
void button(int b, int x, int y);
void complete_paste(unsigned char *s, int n);
void send_current_display();
void setup_x(void);
void load_pixmaps(void);
void process_input();
void load_config(void);
void save_config(void);
void show_value();

#define MAXCHARS 15