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);
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 */
fb_window::OLD_cursor_ysize
int OLD_cursor_ysize
Definition: x11.h:80
fb_window::x11_graycolor
XColor x11_graycolor[N_GRAYCOLORS]
Definition: x11.h:63
fb_window::scaledown
int scaledown
Definition: x11.h:56
fb_window::OLD_cursor_xsize
int OLD_cursor_xsize
Definition: x11.h:79
x11_putpixel_fb
void x11_putpixel_fb(struct machine *, int, int x, int y, int color)
Definition: x11.cc:48
fb_window::cursor_on
int cursor_on
Definition: x11.h:76
x11_set_standard_properties
void x11_set_standard_properties(struct fb_window *fb_window, char *name)
fb_window::OLD_cursor_on
int OLD_cursor_on
Definition: x11.h:81
fb_window::x11_screen
int x11_screen
Definition: x11.h:59
fb_window::x11_screen_depth
int x11_screen_depth
Definition: x11.h:60
fb_window::cursor_xsize
int cursor_xsize
Definition: x11.h:74
fb_window::OLD_cursor_x
int OLD_cursor_x
Definition: x11.h:77
fb_window::fb_number
int fb_number
Definition: x11.h:51
fb_window::host_cursor_pixmap
Pixmap host_cursor_pixmap
Definition: x11.h:85
x11_redraw
void x11_redraw(struct machine *, int)
Definition: x11.cc:47
fb_window::x11_fb_winxsize
int x11_fb_winxsize
Definition: x11.h:55
fb_window::x11_fb_winysize
int x11_fb_winysize
Definition: x11.h:55
CURSOR_MAXX
#define CURSOR_MAXX
Definition: x11.h:48
fb_window::x11_display
Display * x11_display
Definition: x11.h:57
x11_redraw_cursor
void x11_redraw_cursor(struct machine *, int)
Definition: x11.cc:46
fb_window::cursor_y
int cursor_y
Definition: x11.h:73
fb_window::x11_fb_gc
GC x11_fb_gc
Definition: x11.h:65
CURSOR_MAXY
#define CURSOR_MAXY
Definition: x11.h:47
x11_init
void x11_init(struct machine *)
Definition: x11.cc:49
misc.h
fb_window::host_cursor
Cursor host_cursor
Definition: x11.h:84
machine
Definition: machine.h:97
fb_window::cursor_x
int cursor_x
Definition: x11.h:72
x11_fb_init
struct fb_window * x11_fb_init(int xsize, int ysize, char *name, int scaledown, struct machine *)
Definition: x11.cc:50
fb_window::fb_ximage
XImage * fb_ximage
Definition: x11.h:67
x11_putimage_fb
void x11_putimage_fb(struct machine *, int)
fb_window::OLD_cursor_y
int OLD_cursor_y
Definition: x11.h:78
N_GRAYCOLORS
#define N_GRAYCOLORS
Definition: x11.h:44
fb_window::cursor_ysize
int cursor_ysize
Definition: x11.h:75
x11_check_event
void x11_check_event(struct emul *emul)
Definition: x11.cc:53
fb_window::x11_fb_window
Window x11_fb_window
Definition: x11.h:64
emul
Definition: emul.h:37
fb_window::cursor_pixels
int cursor_pixels[CURSOR_MAXY][CURSOR_MAXX]
Definition: x11.h:71
fb_window
Definition: x11.h:50
fb_window::fg_color
unsigned long fg_color
Definition: x11.h:61
fb_window::ximage_data
unsigned char * ximage_data
Definition: x11.h:68
fb_window::bg_color
unsigned long bg_color
Definition: x11.h:62
x11_fb_resize
void x11_fb_resize(struct fb_window *win, int new_xsize, int new_ysize)

Generated on Tue Aug 25 2020 19:25:06 for GXemul by doxygen 1.8.18