-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwindow.h
More file actions
48 lines (36 loc) · 1.03 KB
/
window.h
File metadata and controls
48 lines (36 loc) · 1.03 KB
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
#ifndef __WINDOW_H__
#define __WINDOW_H__
#include <X11/Xlib.h>
#include <iostream>
#include <string>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <X11/keysym.h>
#include <jpeglib.h>
#include <jerror.h>
#ifndef u_char
#define u_char unsigned char
#endif
class Xwindow {
Display *d;
Window w;
int s;
GC gc;
unsigned long colours[11];
int width, height;
public:
Xwindow(int width=500, int height=500); // Constructor; displays the window.
~Xwindow(); // Destructor; destroys the window.
enum {White=0, Black,Royal, Red, Green, Blue, Cyan, Yellow, Magenta, Orange, Brown}; // Available colours.
// Draws a rectangle
void fillRectangle(int x, int y, int width, int height, int colour=Black);
// Draws a string
void drawString(int x, int y, std::string msg, int colour=Black);
// Draws a string
void drawBigString(int x, int y, std::string msg, int colour=Black);
// Prints the first 10000 available fonts
void showAvailableFonts();
};
#endif