gui_x11.cpp File Reference


Detailed Description

X-Windows GUI implementation.

Allows use of gfx without SDL on Linux.

Id
gui_x11.cpp,v 1.5 2008/03/26 19:19:53 iamcamiel Exp

X-1.5 Camiel Vanderhoeven 26-MAR-2008 Fix compiler warnings.

X-1.4 Pepito Grillo 15-MAR-2008 Fixed FAILURE macro

X-1.3 Camiel Vanderhoeven 14-MAR-2008 Formatting

X-1.2 Camiel Vanderhoeven 12-FEB-2008 Moved keyboard code into it's own class (CKeyboard)

X-1.1 Camiel Vanderhoeven 20-JAN-2008 Initial version for ES40 emulator.

Definition in file gui_x11.cpp.

#include "../StdAfx.h"
#include "gui.h"
#include "keymap.h"
#include "../Configurator.h"
#include "../VGA.h"
#include "../Keyboard.h"
#include <X11/Xlib.h>
#include <X11/Xutil.h>
#include <X11/Xos.h>
#include <X11/Xatom.h>
#include <X11/keysym.h>
#include "gui_win32_font.h"

Go to the source code of this file.

Data Structures

class  bx_x11_gui_c

Defines

#define XK_PUBLISHING
#define XK_TECHNICAL
#define MAX_MAPPED_STRING_LENGTH   10
#define ROUNDUP(nbytes, pad)   ((((nbytes) + ((pad) - 1)) / (pad)) * ((pad) >> 3))
#define MAX_VGA_COLORS   256

Functions

int libx11_LTX_plugin_init (CConfigurator *cfg)
void libx11_LTX_plugin_fini (void)
static void warp_cursor (int dx, int dy)
static void disable_cursor ()
static void enable_cursor ()
static u32 convertStringToXKeysym (const char *string)
static void send_keyboard_mouse_status (void)
static void create_internal_vga_font (void)
 Create a bitmap for VGA font data.
static void xkeypress (KeySym keysym, int press_release)
static bool test_alloc_colors (Colormap cmap, u32 n_tries)

Variables

static bx_x11_gui_ctheGui = NULL
Display * bx_x_display
int bx_x_screen_num
static Visual * default_visual
static Colormap default_cmap
static unsigned long white_pixel = 0
static unsigned long black_pixel = 0
static char * progname
static unsigned int text_rows = 25
static unsigned int text_cols = 80
static u8 h_panning = 0
static u8 v_panning = 0
static u16 line_compare = 1023
static Window win
static GC gc
static GC gc_inv
static unsigned font_width
static unsigned font_height
static unsigned dimension_x = 0
static unsigned dimension_y = 0
static unsigned vga_bpp = 8
static XImage * ximage = NULL
static unsigned imDepth
static unsigned imWide
static unsigned imBPP
static int prev_x = -1
static int prev_y = -1
static int current_x = -1
static int current_y = -1
static int current_z = 0
static unsigned mouse_button_state = 0
static bool CTRL_pressed = 0
static unsigned prev_cursor_x = 0
static unsigned prev_cursor_y = 0
static int warp_home_x = 200
static int warp_home_y = 200
static int mouse_enable_x = 0
static int mouse_enable_y = 0
static int warp_dx = 0
static int warp_dy = 0
static bool x_init_done = false
static Pixmap vgafont [256]
static bool x_keymapping
static bool x_private_colormap
u32 ascii_to_key_event [0x5f]
u8 graphics_snapshot [32 *1024]
unsigned long col_vals [256]
unsigned curr_foreground
unsigned curr_background
static unsigned x_tilesize
static unsigned y_tilesize


Define Documentation

#define MAX_MAPPED_STRING_LENGTH   10

Definition at line 123 of file gui_x11.cpp.

Referenced by bx_x11_gui_c::handle_events().

#define MAX_VGA_COLORS   256

Definition at line 308 of file gui_x11.cpp.

Referenced by bx_x11_gui_c::specific_init(), and test_alloc_colors().

#define ROUNDUP ( nbytes,
pad   )     ((((nbytes) + ((pad) - 1)) / (pad)) * ((pad) >> 3))

Definition at line 307 of file gui_x11.cpp.

#define XK_PUBLISHING

Definition at line 55 of file gui_x11.cpp.

#define XK_TECHNICAL

Definition at line 56 of file gui_x11.cpp.


Function Documentation

static u32 convertStringToXKeysym ( const char *  string  )  [static]

Definition at line 1939 of file gui_x11.cpp.

References BX_KEYMAP_UNKNOWN.

Referenced by bx_x11_gui_c::specific_init().

void create_internal_vga_font ( void   )  [static]

Create a bitmap for VGA font data.

Definition at line 663 of file gui_x11.cpp.

References BX_PANIC, and bx_vgafont.

Referenced by bx_x11_gui_c::specific_init().

static void disable_cursor (  )  [static]

Definition at line 1885 of file gui_x11.cpp.

Referenced by bx_x11_gui_c::mouse_enabled_changed_specific().

static void enable_cursor (  )  [static]

Definition at line 1928 of file gui_x11.cpp.

Referenced by bx_x11_gui_c::mouse_enabled_changed_specific().

void libx11_LTX_plugin_fini ( void   ) 

Definition at line 122 of file gui_x11.cpp.

int libx11_LTX_plugin_init ( CConfigurator cfg  ) 

Definition at line 122 of file gui_x11.cpp.

void send_keyboard_mouse_status ( void   )  [static]

Definition at line 874 of file gui_x11.cpp.

References BX_DEBUG, current_y, current_z, prev_y, and warp_cursor().

Referenced by bx_x11_gui_c::handle_events().

static bool test_alloc_colors ( Colormap  cmap,
u32  n_tries 
) [static]

Definition at line 325 of file gui_x11.cpp.

References BX_INFO, and MAX_VGA_COLORS.

Referenced by bx_x11_gui_c::specific_init().

static void warp_cursor ( int  dx,
int  dy 
) [static]

void xkeypress ( KeySym  keysym,
int  press_release 
) [static]


Variable Documentation

Definition at line 180 of file gui_x11.cpp.

unsigned long black_pixel = 0 [static]

Definition at line 132 of file gui_x11.cpp.

Referenced by bx_x11_gui_c::specific_init().

Display* bx_x_display

Definition at line 128 of file gui_x11.cpp.

Definition at line 129 of file gui_x11.cpp.

unsigned long col_vals[256]

Definition at line 310 of file gui_x11.cpp.

bool CTRL_pressed = 0 [static]

Definition at line 153 of file gui_x11.cpp.

unsigned curr_background

Definition at line 311 of file gui_x11.cpp.

unsigned curr_foreground

Definition at line 311 of file gui_x11.cpp.

int current_x = -1 [static]

Definition at line 151 of file gui_x11.cpp.

int current_y = -1 [static]

int current_z = 0 [static]

Definition at line 151 of file gui_x11.cpp.

Referenced by bx_x11_gui_c::handle_events(), and send_keyboard_mouse_status().

Colormap default_cmap [static]

Definition at line 131 of file gui_x11.cpp.

Visual* default_visual [static]

Definition at line 130 of file gui_x11.cpp.

unsigned dimension_x = 0 [static]

Definition at line 143 of file gui_x11.cpp.

unsigned dimension_y = 0 [static]

Definition at line 143 of file gui_x11.cpp.

unsigned font_height [static]

Definition at line 142 of file gui_x11.cpp.

unsigned font_width [static]

Definition at line 142 of file gui_x11.cpp.

GC gc [static]

Definition at line 141 of file gui_x11.cpp.

GC gc_inv [static]

Definition at line 141 of file gui_x11.cpp.

u8 graphics_snapshot[32 *1024]

u8 h_panning = 0 [static]

Definition at line 137 of file gui_x11.cpp.

unsigned imBPP [static]

Definition at line 147 of file gui_x11.cpp.

unsigned imDepth [static]

Definition at line 147 of file gui_x11.cpp.

unsigned imWide [static]

Definition at line 147 of file gui_x11.cpp.

u16 line_compare = 1023 [static]

Definition at line 138 of file gui_x11.cpp.

unsigned mouse_button_state = 0 [static]

Definition at line 152 of file gui_x11.cpp.

int mouse_enable_x = 0 [static]

Definition at line 160 of file gui_x11.cpp.

int mouse_enable_y = 0 [static]

Definition at line 161 of file gui_x11.cpp.

unsigned prev_cursor_x = 0 [static]

Definition at line 155 of file gui_x11.cpp.

unsigned prev_cursor_y = 0 [static]

Definition at line 156 of file gui_x11.cpp.

int prev_x = -1 [static]

Definition at line 150 of file gui_x11.cpp.

int prev_y = -1 [static]

Definition at line 150 of file gui_x11.cpp.

Referenced by bx_x11_gui_c::handle_events(), and send_keyboard_mouse_status().

char* progname [static]

Definition at line 134 of file gui_x11.cpp.

unsigned int text_cols = 80 [static]

Definition at line 136 of file gui_x11.cpp.

unsigned int text_rows = 25 [static]

Definition at line 136 of file gui_x11.cpp.

bx_x11_gui_c* theGui = NULL [static]

Definition at line 121 of file gui_x11.cpp.

u8 v_panning = 0 [static]

Definition at line 137 of file gui_x11.cpp.

unsigned vga_bpp = 8 [static]

Pixmap vgafont[256] [static]

Definition at line 173 of file gui_x11.cpp.

int warp_dx = 0 [static]

Definition at line 162 of file gui_x11.cpp.

int warp_dy = 0 [static]

Definition at line 163 of file gui_x11.cpp.

int warp_home_x = 200 [static]

Definition at line 158 of file gui_x11.cpp.

int warp_home_y = 200 [static]

Definition at line 159 of file gui_x11.cpp.

unsigned long white_pixel = 0 [static]

Definition at line 132 of file gui_x11.cpp.

Window win [static]

Definition at line 140 of file gui_x11.cpp.

bool x_init_done = false [static]

Definition at line 171 of file gui_x11.cpp.

bool x_keymapping [static]

Definition at line 177 of file gui_x11.cpp.

bool x_private_colormap [static]

Definition at line 178 of file gui_x11.cpp.

unsigned x_tilesize [static]

Definition at line 313 of file gui_x11.cpp.

XImage* ximage = NULL [static]

Definition at line 146 of file gui_x11.cpp.

unsigned y_tilesize [static]

Definition at line 313 of file gui_x11.cpp.


SourceForge.net Logo
Project space on SourceForge.net