x11.h Source File

Back to the index.

x11.h
Go to the documentation of this file.
1 #ifndef X11_H
2 #define X11_H
3 
4 /*
5  * Copyright (C) 2003-2010 Anders Gavare. All rights reserved.
6  *
7  * Redistribution and use in source and binary forms, with or without
8  * modification, are permitted provided that the following conditions are met:
9  *
10  * 1. Redistributions of source code must retain the above copyright
11  * notice, this list of conditions and the following disclaimer.
12  * 2. Redistributions in binary form must reproduce the above copyright
13  * notice, this list of conditions and the following disclaimer in the
14  * documentation and/or other materials provided with the distribution.
15  * 3. The name of the author may not be used to endorse or promote products
16  * derived from this software without specific prior written permission.
17  *
18  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
19  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
21  * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
22  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
23  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
24  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
25  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
26  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
27  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
28  * SUCH DAMAGE.
29  *
30  *
31  * Headerfile for src/x11.c.
32  */
33 
34 #include "misc.h"
35 
36 struct emul;
37 
38 #ifdef WITH_X11
39 #include <X11/Xlib.h>
40 #endif
41 
42 
43 /* x11.c: */
44 #define N_GRAYCOLORS 16
45 #define CURSOR_COLOR_TRANSPARENT -1
46 #define CURSOR_COLOR_INVERT -2
47 #define CURSOR_MAXY 64
48 #define CURSOR_MAXX 64
49 /* Framebuffer windows: */
50 struct fb_window {
51  int fb_number;
52 
53 #ifdef WITH_X11
54  /* x11_fb_winxsize > 0 for a valid fb_window */
56  int scaledown;
57  Display *x11_display;
58 
61  unsigned long fg_color;
62  unsigned long bg_color;
64  Window x11_fb_window;
66 
67  XImage *fb_ximage;
68  unsigned char *ximage_data;
69 
70  /* -1 means transparent, 0 and up are grayscales */
72  int cursor_x;
73  int cursor_y;
76  int cursor_on;
82 
83  /* Host's X11 cursor: */
84  Cursor host_cursor;
86 #endif
87 };
88 void x11_redraw_cursor(struct machine *, int);
89 void x11_redraw(struct machine *, int);
90 void x11_putpixel_fb(struct machine *, int, int x, int y, int color);
91 #ifdef WITH_X11
92 void x11_putimage_fb(struct machine *, int);
93 #endif
94 void x11_init(struct machine *);
95 void x11_fb_resize(struct fb_window *win, int new_xsize, int new_ysize);
96 void x11_set_standard_properties(struct fb_window *fb_window, char *name);
97 struct fb_window *x11_fb_init(int xsize, int ysize, char *name,
98  int scaledown, struct machine *);
99 void x11_check_event(struct emul *emul);
100 
101 
102 #endif /* X11_H */
int cursor_on
Definition: x11.h:76
int x11_screen
Definition: x11.h:59
void x11_redraw_cursor(struct machine *, int)
Definition: x11.cc:46
int OLD_cursor_x
Definition: x11.h:77
XColor x11_graycolor[N_GRAYCOLORS]
Definition: x11.h:63
int OLD_cursor_xsize
Definition: x11.h:79
void x11_check_event(struct emul *emul)
Definition: x11.cc:53
#define N_GRAYCOLORS
Definition: x11.h:44
Definition: x11.h:50
int x11_screen_depth
Definition: x11.h:60
int cursor_xsize
Definition: x11.h:74
void x11_putimage_fb(struct machine *, int)
int x11_fb_winysize
Definition: x11.h:55
int OLD_cursor_on
Definition: x11.h:81
struct fb_window * x11_fb_init(int xsize, int ysize, char *name, int scaledown, struct machine *)
Definition: x11.cc:50
Display * x11_display
Definition: x11.h:57
int fb_number
Definition: x11.h:51
Pixmap host_cursor_pixmap
Definition: x11.h:85
int cursor_y
Definition: x11.h:73
void x11_putpixel_fb(struct machine *, int, int x, int y, int color)
Definition: x11.cc:48
int x11_fb_winxsize
Definition: x11.h:55
int cursor_ysize
Definition: x11.h:75
Cursor host_cursor
Definition: x11.h:84
int cursor_x
Definition: x11.h:72
void x11_fb_resize(struct fb_window *win, int new_xsize, int new_ysize)
GC x11_fb_gc
Definition: x11.h:65
Definition: emul.h:37
void x11_set_standard_properties(struct fb_window *fb_window, char *name)
void x11_redraw(struct machine *, int)
Definition: x11.cc:47
int OLD_cursor_y
Definition: x11.h:78
#define CURSOR_MAXX
Definition: x11.h:48
XImage * fb_ximage
Definition: x11.h:67
unsigned char * ximage_data
Definition: x11.h:68
#define CURSOR_MAXY
Definition: x11.h:47
void x11_init(struct machine *)
Definition: x11.cc:49
int cursor_pixels[CURSOR_MAXY][CURSOR_MAXX]
Definition: x11.h:71
int scaledown
Definition: x11.h:56
Window x11_fb_window
Definition: x11.h:64
unsigned long fg_color
Definition: x11.h:61
unsigned long bg_color
Definition: x11.h:62
int OLD_cursor_ysize
Definition: x11.h:80

Generated on Fri Dec 7 2018 19:52:23 for GXemul by doxygen 1.8.13