everybody HAVE_XSHM; deduplicate colors_sx/gx
This commit is contained in:
parent
af52793518
commit
c69b172736
6 changed files with 454 additions and 395 deletions
|
@ -270,10 +270,8 @@ void do_shutdown( void ) {
|
||||||
device.display_touched = 0;
|
device.display_touched = 0;
|
||||||
update_display();
|
update_display();
|
||||||
#if defined( GUI_IS_X11 )
|
#if defined( GUI_IS_X11 )
|
||||||
#ifdef HAVE_XSHM
|
|
||||||
if ( disp.display_update )
|
if ( disp.display_update )
|
||||||
refresh_display();
|
refresh_display();
|
||||||
#endif
|
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -300,10 +298,8 @@ void do_shutdown( void ) {
|
||||||
got_alarm = 0;
|
got_alarm = 0;
|
||||||
|
|
||||||
#if defined( GUI_IS_X11 )
|
#if defined( GUI_IS_X11 )
|
||||||
#ifdef HAVE_XSHM
|
|
||||||
if ( disp.display_update )
|
if ( disp.display_update )
|
||||||
refresh_display();
|
refresh_display();
|
||||||
#endif
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
ticks = get_t1_t2();
|
ticks = get_t1_t2();
|
||||||
|
|
|
@ -529,10 +529,8 @@ static void do_load( int argc, char** argv ) {
|
||||||
init_display();
|
init_display();
|
||||||
update_display();
|
update_display();
|
||||||
#if defined( GUI_IS_X11 )
|
#if defined( GUI_IS_X11 )
|
||||||
#ifdef HAVE_XSHM
|
|
||||||
if ( disp.display_update )
|
if ( disp.display_update )
|
||||||
refresh_display();
|
refresh_display();
|
||||||
#endif
|
|
||||||
#endif
|
#endif
|
||||||
} else {
|
} else {
|
||||||
printf( "Loading emulator-state from files failed.\n" );
|
printf( "Loading emulator-state from files failed.\n" );
|
||||||
|
@ -1177,10 +1175,8 @@ int debug( void ) {
|
||||||
device.display_touched = 0;
|
device.display_touched = 0;
|
||||||
update_display();
|
update_display();
|
||||||
#if defined( GUI_IS_X11 )
|
#if defined( GUI_IS_X11 )
|
||||||
#ifdef HAVE_XSHM
|
|
||||||
if ( disp.display_update )
|
if ( disp.display_update )
|
||||||
refresh_display();
|
refresh_display();
|
||||||
#endif
|
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -2379,10 +2379,8 @@ inline void schedule( void ) {
|
||||||
got_alarm = 0;
|
got_alarm = 0;
|
||||||
|
|
||||||
#if defined( GUI_IS_X11 )
|
#if defined( GUI_IS_X11 )
|
||||||
#ifdef HAVE_XSHM
|
|
||||||
if ( disp.display_update )
|
if ( disp.display_update )
|
||||||
refresh_display();
|
refresh_display();
|
||||||
#endif
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
get_ui_event();
|
get_ui_event();
|
||||||
|
|
38
src/lcd.c
38
src/lcd.c
|
@ -56,7 +56,7 @@ void init_nibble_maps( void ) {
|
||||||
nibble_maps[ i ] =
|
nibble_maps[ i ] =
|
||||||
XCreateBitmapFromData( dpy, disp.win, ( char* )nibbles[ i ], 8, 2 );
|
XCreateBitmapFromData( dpy, disp.win, ( char* )nibbles[ i ], 8, 2 );
|
||||||
}
|
}
|
||||||
#ifdef HAVE_XSHM
|
|
||||||
if ( shm_flag ) {
|
if ( shm_flag ) {
|
||||||
if ( disp.disp_image->bitmap_bit_order == MSBFirst ) {
|
if ( disp.disp_image->bitmap_bit_order == MSBFirst ) {
|
||||||
nibble_bits[ 0x0 ] = 0x00; /* ---- */
|
nibble_bits[ 0x0 ] = 0x00; /* ---- */
|
||||||
|
@ -94,10 +94,10 @@ void init_nibble_maps( void ) {
|
||||||
nibble_bits[ 0xf ] = 0xff; /* **** */
|
nibble_bits[ 0xf ] = 0xff; /* **** */
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
#if defined( GUI_IS_SDL1 )
|
#elif defined( GUI_IS_SDL1 )
|
||||||
|
|
||||||
ann_struct_t ann_tbl[] = {
|
ann_struct_t ann_tbl[] = {
|
||||||
{ ANN_LEFT, 16, 4, ann_left_width, ann_left_height, ann_left_bits },
|
{ ANN_LEFT, 16, 4, ann_left_width, ann_left_height, ann_left_bits },
|
||||||
{ ANN_RIGHT, 61, 4, ann_right_width, ann_right_height, ann_right_bits },
|
{ ANN_RIGHT, 61, 4, ann_right_width, ann_right_height, ann_right_bits },
|
||||||
|
@ -205,11 +205,9 @@ void update_display( void ) {
|
||||||
static int old_offset = -1;
|
static int old_offset = -1;
|
||||||
static int old_lines = -1;
|
static int old_lines = -1;
|
||||||
#if defined( GUI_IS_X11 )
|
#if defined( GUI_IS_X11 )
|
||||||
#ifdef HAVE_XSHM
|
|
||||||
int addr_pad;
|
int addr_pad;
|
||||||
int val, line_pad, line_length;
|
int val, line_pad, line_length;
|
||||||
word_20 data_addr, data_addr_2;
|
word_20 data_addr, data_addr_2;
|
||||||
#endif
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if ( !disp.mapped ) {
|
if ( !disp.mapped ) {
|
||||||
|
@ -221,7 +219,6 @@ void update_display( void ) {
|
||||||
if ( display.on ) {
|
if ( display.on ) {
|
||||||
addr = display.disp_start;
|
addr = display.disp_start;
|
||||||
#if defined( GUI_IS_X11 )
|
#if defined( GUI_IS_X11 )
|
||||||
#ifdef HAVE_XSHM
|
|
||||||
if ( shm_flag ) {
|
if ( shm_flag ) {
|
||||||
data_addr = 0;
|
data_addr = 0;
|
||||||
data_addr_2 = disp.disp_image->bytes_per_line;
|
data_addr_2 = disp.disp_image->bytes_per_line;
|
||||||
|
@ -242,7 +239,6 @@ void update_display( void ) {
|
||||||
}
|
}
|
||||||
disp.display_update |= UPDATE_DISP;
|
disp.display_update |= UPDATE_DISP;
|
||||||
} else {
|
} else {
|
||||||
#endif
|
|
||||||
#endif
|
#endif
|
||||||
if ( display.offset != old_offset ) {
|
if ( display.offset != old_offset ) {
|
||||||
memset(
|
memset(
|
||||||
|
@ -265,14 +261,11 @@ void update_display( void ) {
|
||||||
addr += display.nibs_per_line;
|
addr += display.nibs_per_line;
|
||||||
}
|
}
|
||||||
#if defined( GUI_IS_X11 )
|
#if defined( GUI_IS_X11 )
|
||||||
#ifdef HAVE_XSHM
|
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
#endif
|
#endif
|
||||||
if ( i < DISP_ROWS ) {
|
if ( i < DISP_ROWS ) {
|
||||||
addr = display.menu_start;
|
addr = display.menu_start;
|
||||||
#if defined( GUI_IS_X11 )
|
#if defined( GUI_IS_X11 )
|
||||||
#ifdef HAVE_XSHM
|
|
||||||
if ( shm_flag ) {
|
if ( shm_flag ) {
|
||||||
data_addr = 0;
|
data_addr = 0;
|
||||||
data_addr_2 = disp.menu_image->bytes_per_line;
|
data_addr_2 = disp.menu_image->bytes_per_line;
|
||||||
|
@ -291,21 +284,17 @@ void update_display( void ) {
|
||||||
}
|
}
|
||||||
disp.display_update |= UPDATE_MENU;
|
disp.display_update |= UPDATE_MENU;
|
||||||
} else {
|
} else {
|
||||||
#endif
|
|
||||||
#endif
|
#endif
|
||||||
for ( ; i < DISP_ROWS; i++ ) {
|
for ( ; i < DISP_ROWS; i++ ) {
|
||||||
draw_row( addr, i );
|
draw_row( addr, i );
|
||||||
addr += NIBBLES_PER_ROW;
|
addr += NIBBLES_PER_ROW;
|
||||||
}
|
}
|
||||||
#if defined( GUI_IS_X11 )
|
#if defined( GUI_IS_X11 )
|
||||||
#ifdef HAVE_XSHM
|
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
#if defined( GUI_IS_X11 )
|
#if defined( GUI_IS_X11 )
|
||||||
#ifdef HAVE_XSHM
|
|
||||||
if ( shm_flag ) {
|
if ( shm_flag ) {
|
||||||
memset( disp.disp_image->data, 0,
|
memset( disp.disp_image->data, 0,
|
||||||
( size_t )( disp.disp_image->bytes_per_line *
|
( size_t )( disp.disp_image->bytes_per_line *
|
||||||
|
@ -315,7 +304,6 @@ void update_display( void ) {
|
||||||
disp.menu_image->height ) );
|
disp.menu_image->height ) );
|
||||||
disp.display_update = UPDATE_DISP | UPDATE_MENU;
|
disp.display_update = UPDATE_DISP | UPDATE_MENU;
|
||||||
} else {
|
} else {
|
||||||
#endif
|
|
||||||
#endif
|
#endif
|
||||||
memset( disp_buf, 0xf0, sizeof( disp_buf ) );
|
memset( disp_buf, 0xf0, sizeof( disp_buf ) );
|
||||||
for ( i = 0; i < 64; i++ ) {
|
for ( i = 0; i < 64; i++ ) {
|
||||||
|
@ -324,9 +312,7 @@ void update_display( void ) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#if defined( GUI_IS_X11 )
|
#if defined( GUI_IS_X11 )
|
||||||
#ifdef HAVE_XSHM
|
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -343,9 +329,7 @@ void redraw_display( void ) {
|
||||||
void disp_draw_nibble( word_20 addr, word_4 val ) {
|
void disp_draw_nibble( word_20 addr, word_4 val ) {
|
||||||
long offset;
|
long offset;
|
||||||
#if defined( GUI_IS_X11 )
|
#if defined( GUI_IS_X11 )
|
||||||
#ifdef HAVE_XSHM
|
|
||||||
int shm_addr;
|
int shm_addr;
|
||||||
#endif
|
|
||||||
#endif
|
#endif
|
||||||
int x, y;
|
int x, y;
|
||||||
|
|
||||||
|
@ -358,7 +342,6 @@ void disp_draw_nibble( word_20 addr, word_4 val ) {
|
||||||
if ( y < 0 || y > 63 )
|
if ( y < 0 || y > 63 )
|
||||||
return;
|
return;
|
||||||
#if defined( GUI_IS_X11 )
|
#if defined( GUI_IS_X11 )
|
||||||
#ifdef HAVE_XSHM
|
|
||||||
if ( shm_flag ) {
|
if ( shm_flag ) {
|
||||||
shm_addr = ( 2 * y * disp.disp_image->bytes_per_line ) + x;
|
shm_addr = ( 2 * y * disp.disp_image->bytes_per_line ) + x;
|
||||||
disp.disp_image->data[ shm_addr ] = nibble_bits[ val ];
|
disp.disp_image->data[ shm_addr ] = nibble_bits[ val ];
|
||||||
|
@ -367,20 +350,16 @@ void disp_draw_nibble( word_20 addr, word_4 val ) {
|
||||||
nibble_bits[ val ];
|
nibble_bits[ val ];
|
||||||
disp.display_update |= UPDATE_DISP;
|
disp.display_update |= UPDATE_DISP;
|
||||||
} else {
|
} else {
|
||||||
#endif
|
|
||||||
#endif
|
#endif
|
||||||
if ( val != disp_buf[ y ][ x ] ) {
|
if ( val != disp_buf[ y ][ x ] ) {
|
||||||
disp_buf[ y ][ x ] = val;
|
disp_buf[ y ][ x ] = val;
|
||||||
draw_nibble( x, y, val );
|
draw_nibble( x, y, val );
|
||||||
}
|
}
|
||||||
#if defined( GUI_IS_X11 )
|
#if defined( GUI_IS_X11 )
|
||||||
#ifdef HAVE_XSHM
|
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
#endif
|
#endif
|
||||||
} else {
|
} else {
|
||||||
#if defined( GUI_IS_X11 )
|
#if defined( GUI_IS_X11 )
|
||||||
#ifdef HAVE_XSHM
|
|
||||||
if ( shm_flag ) {
|
if ( shm_flag ) {
|
||||||
shm_addr = x;
|
shm_addr = x;
|
||||||
for ( y = 0; y < display.lines; y++ ) {
|
for ( y = 0; y < display.lines; y++ ) {
|
||||||
|
@ -391,7 +370,6 @@ void disp_draw_nibble( word_20 addr, word_4 val ) {
|
||||||
}
|
}
|
||||||
disp.display_update |= UPDATE_DISP;
|
disp.display_update |= UPDATE_DISP;
|
||||||
} else {
|
} else {
|
||||||
#endif
|
|
||||||
#endif
|
#endif
|
||||||
for ( y = 0; y < display.lines; y++ ) {
|
for ( y = 0; y < display.lines; y++ ) {
|
||||||
if ( val != disp_buf[ y ][ x ] ) {
|
if ( val != disp_buf[ y ][ x ] ) {
|
||||||
|
@ -400,9 +378,7 @@ void disp_draw_nibble( word_20 addr, word_4 val ) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#if defined( GUI_IS_X11 )
|
#if defined( GUI_IS_X11 )
|
||||||
#ifdef HAVE_XSHM
|
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -410,15 +386,12 @@ void disp_draw_nibble( word_20 addr, word_4 val ) {
|
||||||
void menu_draw_nibble( word_20 addr, word_4 val ) {
|
void menu_draw_nibble( word_20 addr, word_4 val ) {
|
||||||
long offset;
|
long offset;
|
||||||
#if defined( GUI_IS_X11 )
|
#if defined( GUI_IS_X11 )
|
||||||
#ifdef HAVE_XSHM
|
|
||||||
int shm_addr;
|
int shm_addr;
|
||||||
#endif
|
|
||||||
#endif
|
#endif
|
||||||
int x, y;
|
int x, y;
|
||||||
|
|
||||||
offset = ( addr - display.menu_start );
|
offset = ( addr - display.menu_start );
|
||||||
#if defined( GUI_IS_X11 )
|
#if defined( GUI_IS_X11 )
|
||||||
#ifdef HAVE_XSHM
|
|
||||||
if ( shm_flag ) {
|
if ( shm_flag ) {
|
||||||
shm_addr =
|
shm_addr =
|
||||||
2 * ( offset / NIBBLES_PER_ROW ) * disp.menu_image->bytes_per_line +
|
2 * ( offset / NIBBLES_PER_ROW ) * disp.menu_image->bytes_per_line +
|
||||||
|
@ -428,7 +401,6 @@ void menu_draw_nibble( word_20 addr, word_4 val ) {
|
||||||
nibble_bits[ val ];
|
nibble_bits[ val ];
|
||||||
disp.display_update |= UPDATE_MENU;
|
disp.display_update |= UPDATE_MENU;
|
||||||
} else {
|
} else {
|
||||||
#endif
|
|
||||||
#endif
|
#endif
|
||||||
x = offset % NIBBLES_PER_ROW;
|
x = offset % NIBBLES_PER_ROW;
|
||||||
y = display.lines + ( offset / NIBBLES_PER_ROW ) + 1;
|
y = display.lines + ( offset / NIBBLES_PER_ROW ) + 1;
|
||||||
|
@ -437,10 +409,8 @@ void menu_draw_nibble( word_20 addr, word_4 val ) {
|
||||||
draw_nibble( x, y, val );
|
draw_nibble( x, y, val );
|
||||||
}
|
}
|
||||||
#if defined( GUI_IS_X11 )
|
#if defined( GUI_IS_X11 )
|
||||||
#ifdef HAVE_XSHM
|
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined( GUI_IS_X11 )
|
#if defined( GUI_IS_X11 )
|
||||||
|
|
452
src/x48.c
452
src/x48.c
|
@ -51,11 +51,9 @@ static char* defaults[] = {
|
||||||
"*disassemblerMnemonics: class",
|
"*disassemblerMnemonics: class",
|
||||||
0 };
|
0 };
|
||||||
|
|
||||||
#ifdef HAVE_XSHM
|
|
||||||
extern int XShmQueryExtension( Display* );
|
extern int XShmQueryExtension( Display* );
|
||||||
extern int XShmGetEventBase( Display* );
|
extern int XShmGetEventBase( Display* );
|
||||||
static int CompletionType = -1;
|
static int CompletionType = -1;
|
||||||
#endif
|
|
||||||
|
|
||||||
extern int saved_argc;
|
extern int saved_argc;
|
||||||
extern char** saved_argv;
|
extern char** saved_argv;
|
||||||
|
@ -71,6 +69,9 @@ Window iconW = 0;
|
||||||
|
|
||||||
disp_t disp;
|
disp_t disp;
|
||||||
|
|
||||||
|
keypad_t keypad;
|
||||||
|
color_t* colors;
|
||||||
|
|
||||||
#if defined( GUI_IS_X11 )
|
#if defined( GUI_IS_X11 )
|
||||||
Atom wm_delete_window, wm_save_yourself, wm_protocols;
|
Atom wm_delete_window, wm_save_yourself, wm_protocols;
|
||||||
Atom ol_decor_del, ol_decor_icon_name;
|
Atom ol_decor_del, ol_decor_icon_name;
|
||||||
|
@ -81,21 +82,15 @@ Pixmap icon_text_pix;
|
||||||
Pixmap icon_disp_pix;
|
Pixmap icon_disp_pix;
|
||||||
static int last_icon_state = -1;
|
static int last_icon_state = -1;
|
||||||
|
|
||||||
#ifdef HAVE_XSHM
|
|
||||||
int shm_flag;
|
int shm_flag;
|
||||||
int xerror_flag;
|
int xerror_flag;
|
||||||
#endif
|
|
||||||
|
|
||||||
int dynamic_color;
|
int dynamic_color;
|
||||||
int direct_color;
|
int direct_color;
|
||||||
int does_backing_store;
|
int does_backing_store;
|
||||||
int color_mode;
|
int color_mode;
|
||||||
int icon_color_mode;
|
int icon_color_mode;
|
||||||
#endif
|
#elif defined( GUI_IS_SDL1 )
|
||||||
#if defined( GUI_IS_SDL1 )
|
|
||||||
keypad_t keypad;
|
|
||||||
color_t* colors;
|
|
||||||
|
|
||||||
// This will take the value of the defines, but can be run-time modified
|
// This will take the value of the defines, but can be run-time modified
|
||||||
unsigned KEYBOARD_HEIGHT, KEYBOARD_WIDTH, TOP_SKIP, SIDE_SKIP, BOTTOM_SKIP,
|
unsigned KEYBOARD_HEIGHT, KEYBOARD_WIDTH, TOP_SKIP, SIDE_SKIP, BOTTOM_SKIP,
|
||||||
DISP_KBD_SKIP, DISPLAY_WIDTH, DISPLAY_HEIGHT, DISPLAY_OFFSET_X,
|
DISP_KBD_SKIP, DISPLAY_WIDTH, DISPLAY_HEIGHT, DISPLAY_OFFSET_X,
|
||||||
|
@ -103,267 +98,451 @@ unsigned KEYBOARD_HEIGHT, KEYBOARD_WIDTH, TOP_SKIP, SIDE_SKIP, BOTTOM_SKIP,
|
||||||
KBD_UPLINE;
|
KBD_UPLINE;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
color_t colors_sx[] = { { "white",
|
||||||
|
255,
|
||||||
|
255,
|
||||||
|
255
|
||||||
#if defined( GUI_IS_X11 )
|
#if defined( GUI_IS_X11 )
|
||||||
typedef struct keypad_t {
|
,
|
||||||
unsigned int width;
|
|
||||||
unsigned int height;
|
|
||||||
Pixmap pixmap;
|
|
||||||
} keypad_t;
|
|
||||||
|
|
||||||
keypad_t keypad;
|
|
||||||
color_t* colors;
|
|
||||||
|
|
||||||
color_t colors_sx[] = {
|
|
||||||
{ "white",
|
|
||||||
255,
|
255,
|
||||||
255,
|
255,
|
||||||
255,
|
{ 0, 0, 0, 0, DoRed | DoGreen | DoBlue, 0 }
|
||||||
255,
|
#endif
|
||||||
255,
|
},
|
||||||
{ 0, 0, 0, 0, DoRed | DoGreen | DoBlue, 0 } },
|
|
||||||
{ "left",
|
{ "left",
|
||||||
255,
|
255,
|
||||||
166,
|
166,
|
||||||
0,
|
0
|
||||||
|
#if defined( GUI_IS_X11 )
|
||||||
|
,
|
||||||
255,
|
255,
|
||||||
230,
|
230,
|
||||||
{ 0, 0, 0, 0, DoRed | DoGreen | DoBlue, 0 } },
|
{ 0, 0, 0, 0, DoRed | DoGreen | DoBlue, 0 }
|
||||||
|
#endif
|
||||||
|
},
|
||||||
{ "right",
|
{ "right",
|
||||||
0,
|
0,
|
||||||
210,
|
210,
|
||||||
255,
|
255
|
||||||
|
#if defined( GUI_IS_X11 )
|
||||||
|
,
|
||||||
255,
|
255,
|
||||||
169,
|
169,
|
||||||
{ 0, 0, 0, 0, DoRed | DoGreen | DoBlue, 0 } },
|
{ 0, 0, 0, 0, DoRed | DoGreen | DoBlue, 0 }
|
||||||
|
#endif
|
||||||
|
},
|
||||||
{ "but_top",
|
{ "but_top",
|
||||||
109,
|
109,
|
||||||
93,
|
93,
|
||||||
93,
|
93
|
||||||
|
#if defined( GUI_IS_X11 )
|
||||||
|
,
|
||||||
0,
|
0,
|
||||||
91,
|
91,
|
||||||
{ 0, 0, 0, 0, DoRed | DoGreen | DoBlue, 0 } },
|
{ 0, 0, 0, 0, DoRed | DoGreen | DoBlue, 0 }
|
||||||
|
#endif
|
||||||
|
},
|
||||||
{ "button",
|
{ "button",
|
||||||
90,
|
90,
|
||||||
77,
|
77,
|
||||||
77,
|
77
|
||||||
|
#if defined( GUI_IS_X11 )
|
||||||
|
,
|
||||||
0,
|
0,
|
||||||
81,
|
81,
|
||||||
{ 0, 0, 0, 0, DoRed | DoGreen | DoBlue, 0 } },
|
{ 0, 0, 0, 0, DoRed | DoGreen | DoBlue, 0 }
|
||||||
|
#endif
|
||||||
|
},
|
||||||
{ "but_bot",
|
{ "but_bot",
|
||||||
76,
|
76,
|
||||||
65,
|
65,
|
||||||
65,
|
65
|
||||||
|
#if defined( GUI_IS_X11 )
|
||||||
|
,
|
||||||
0,
|
0,
|
||||||
69,
|
69,
|
||||||
{ 0, 0, 0, 0, DoRed | DoGreen | DoBlue, 0 } },
|
{ 0, 0, 0, 0, DoRed | DoGreen | DoBlue, 0 }
|
||||||
|
#endif
|
||||||
|
},
|
||||||
{ "lcd_col",
|
{ "lcd_col",
|
||||||
202,
|
202,
|
||||||
221,
|
221,
|
||||||
92,
|
92
|
||||||
|
#if defined( GUI_IS_X11 )
|
||||||
|
,
|
||||||
255,
|
255,
|
||||||
205,
|
205,
|
||||||
{ 0, 0, 0, 0, DoRed | DoGreen | DoBlue, 0 } },
|
{ 0, 0, 0, 0, DoRed | DoGreen | DoBlue, 0 }
|
||||||
|
#endif
|
||||||
|
},
|
||||||
{ "pix_col",
|
{ "pix_col",
|
||||||
0,
|
0,
|
||||||
0,
|
0,
|
||||||
128,
|
128
|
||||||
|
#if defined( GUI_IS_X11 )
|
||||||
|
,
|
||||||
0,
|
0,
|
||||||
20,
|
20,
|
||||||
{ 0, 0, 0, 0, DoRed | DoGreen | DoBlue, 0 } },
|
{ 0, 0, 0, 0, DoRed | DoGreen | DoBlue, 0 }
|
||||||
|
#endif
|
||||||
|
},
|
||||||
{ "pad_top",
|
{ "pad_top",
|
||||||
109,
|
109,
|
||||||
78,
|
78,
|
||||||
78,
|
78
|
||||||
|
#if defined( GUI_IS_X11 )
|
||||||
|
,
|
||||||
0,
|
0,
|
||||||
88,
|
88,
|
||||||
{ 0, 0, 0, 0, DoRed | DoGreen | DoBlue, 0 } },
|
{ 0, 0, 0, 0, DoRed | DoGreen | DoBlue, 0 }
|
||||||
{ "pad", 90, 64, 64, 0, 73, { 0, 0, 0, 0, DoRed | DoGreen | DoBlue, 0 } },
|
#endif
|
||||||
|
},
|
||||||
|
{ "pad",
|
||||||
|
90,
|
||||||
|
64,
|
||||||
|
64
|
||||||
|
#if defined( GUI_IS_X11 )
|
||||||
|
,
|
||||||
|
0,
|
||||||
|
73,
|
||||||
|
{ 0, 0, 0, 0, DoRed | DoGreen | DoBlue, 0 }
|
||||||
|
#endif
|
||||||
|
},
|
||||||
{ "pad_bot",
|
{ "pad_bot",
|
||||||
76,
|
76,
|
||||||
54,
|
54,
|
||||||
54,
|
54
|
||||||
|
#if defined( GUI_IS_X11 )
|
||||||
|
,
|
||||||
0,
|
0,
|
||||||
60,
|
60,
|
||||||
{ 0, 0, 0, 0, DoRed | DoGreen | DoBlue, 0 } },
|
{ 0, 0, 0, 0, DoRed | DoGreen | DoBlue, 0 }
|
||||||
|
#endif
|
||||||
|
},
|
||||||
{ "disp_pad_top",
|
{ "disp_pad_top",
|
||||||
155,
|
155,
|
||||||
118,
|
118,
|
||||||
84,
|
84
|
||||||
|
#if defined( GUI_IS_X11 )
|
||||||
|
,
|
||||||
0,
|
0,
|
||||||
124,
|
124,
|
||||||
{ 0, 0, 0, 0, DoRed | DoGreen | DoBlue, 0 } },
|
{ 0, 0, 0, 0, DoRed | DoGreen | DoBlue, 0 }
|
||||||
|
#endif
|
||||||
|
},
|
||||||
{ "disp_pad",
|
{ "disp_pad",
|
||||||
124,
|
124,
|
||||||
94,
|
94,
|
||||||
67,
|
67
|
||||||
|
#if defined( GUI_IS_X11 )
|
||||||
|
,
|
||||||
0,
|
0,
|
||||||
99,
|
99,
|
||||||
{ 0, 0, 0, 0, DoRed | DoGreen | DoBlue, 0 } },
|
{ 0, 0, 0, 0, DoRed | DoGreen | DoBlue, 0 }
|
||||||
|
#endif
|
||||||
|
},
|
||||||
{ "disp_pad_bot",
|
{ "disp_pad_bot",
|
||||||
100,
|
100,
|
||||||
75,
|
75,
|
||||||
53,
|
53
|
||||||
|
#if defined( GUI_IS_X11 )
|
||||||
|
,
|
||||||
0,
|
0,
|
||||||
79,
|
79,
|
||||||
{ 0, 0, 0, 0, DoRed | DoGreen | DoBlue, 0 } },
|
{ 0, 0, 0, 0, DoRed | DoGreen | DoBlue, 0 }
|
||||||
|
#endif
|
||||||
|
},
|
||||||
{ "logo",
|
{ "logo",
|
||||||
204,
|
204,
|
||||||
169,
|
169,
|
||||||
107,
|
107
|
||||||
|
#if defined( GUI_IS_X11 )
|
||||||
|
,
|
||||||
255,
|
255,
|
||||||
172,
|
172,
|
||||||
{ 0, 0, 0, 0, DoRed | DoGreen | DoBlue, 0 } },
|
{ 0, 0, 0, 0, DoRed | DoGreen | DoBlue, 0 }
|
||||||
|
#endif
|
||||||
|
},
|
||||||
{ "logo_back",
|
{ "logo_back",
|
||||||
64,
|
64,
|
||||||
64,
|
64,
|
||||||
64,
|
64
|
||||||
|
#if defined( GUI_IS_X11 )
|
||||||
|
,
|
||||||
0,
|
0,
|
||||||
65,
|
65,
|
||||||
{ 0, 0, 0, 0, DoRed | DoGreen | DoBlue, 0 } },
|
{ 0, 0, 0, 0, DoRed | DoGreen | DoBlue, 0 }
|
||||||
|
#endif
|
||||||
|
},
|
||||||
{ "label",
|
{ "label",
|
||||||
202,
|
202,
|
||||||
184,
|
184,
|
||||||
144,
|
144
|
||||||
|
#if defined( GUI_IS_X11 )
|
||||||
|
,
|
||||||
255,
|
255,
|
||||||
185,
|
185,
|
||||||
{ 0, 0, 0, 0, DoRed | DoGreen | DoBlue, 0 } },
|
{ 0, 0, 0, 0, DoRed | DoGreen | DoBlue, 0 }
|
||||||
{ "frame", 0, 0, 0, 255, 0, { 0, 0, 0, 0, DoRed | DoGreen | DoBlue, 0 } },
|
#endif
|
||||||
|
},
|
||||||
|
{ "frame",
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0
|
||||||
|
#if defined( GUI_IS_X11 )
|
||||||
|
,
|
||||||
|
255,
|
||||||
|
0,
|
||||||
|
{ 0, 0, 0, 0, DoRed | DoGreen | DoBlue, 0 }
|
||||||
|
#endif
|
||||||
|
},
|
||||||
{ "underlay",
|
{ "underlay",
|
||||||
60,
|
60,
|
||||||
42,
|
42,
|
||||||
42,
|
42
|
||||||
|
#if defined( GUI_IS_X11 )
|
||||||
|
,
|
||||||
0,
|
0,
|
||||||
48,
|
48,
|
||||||
{ 0, 0, 0, 0, DoRed | DoGreen | DoBlue, 0 } },
|
{ 0, 0, 0, 0, DoRed | DoGreen | DoBlue, 0 }
|
||||||
{ "black", 0, 0, 0, 0, 0, { 0, 0, 0, 0, DoRed | DoGreen | DoBlue, 0 } },
|
#endif
|
||||||
|
},
|
||||||
|
{ "black",
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0
|
||||||
|
#if defined( GUI_IS_X11 )
|
||||||
|
,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
{ 0, 0, 0, 0, DoRed | DoGreen | DoBlue, 0 }
|
||||||
|
#endif
|
||||||
|
},
|
||||||
{ 0 } };
|
{ 0 } };
|
||||||
|
|
||||||
color_t colors_gx[] = {
|
color_t colors_gx[] = { { "white",
|
||||||
{ "white",
|
|
||||||
255,
|
255,
|
||||||
255,
|
255,
|
||||||
|
255
|
||||||
|
#if defined( GUI_IS_X11 )
|
||||||
|
,
|
||||||
255,
|
255,
|
||||||
255,
|
255,
|
||||||
255,
|
{ 0, 0, 0, 0, DoRed | DoGreen | DoBlue, 0 }
|
||||||
{ 0, 0, 0, 0, DoRed | DoGreen | DoBlue, 0 } },
|
#endif
|
||||||
|
},
|
||||||
{ "left",
|
{ "left",
|
||||||
255,
|
255,
|
||||||
186,
|
186,
|
||||||
255,
|
255
|
||||||
|
#if defined( GUI_IS_X11 )
|
||||||
|
,
|
||||||
255,
|
255,
|
||||||
220,
|
220,
|
||||||
{ 0, 0, 0, 0, DoRed | DoGreen | DoBlue, 0 } },
|
{ 0, 0, 0, 0, DoRed | DoGreen | DoBlue, 0 }
|
||||||
|
#endif
|
||||||
|
},
|
||||||
{ "right",
|
{ "right",
|
||||||
0,
|
0,
|
||||||
255,
|
255,
|
||||||
204,
|
204
|
||||||
|
#if defined( GUI_IS_X11 )
|
||||||
|
,
|
||||||
255,
|
255,
|
||||||
169,
|
169,
|
||||||
{ 0, 0, 0, 0, DoRed | DoGreen | DoBlue, 0 } },
|
{ 0, 0, 0, 0, DoRed | DoGreen | DoBlue, 0 }
|
||||||
|
#endif
|
||||||
|
},
|
||||||
{ "but_top",
|
{ "but_top",
|
||||||
104,
|
104,
|
||||||
104,
|
104,
|
||||||
104,
|
104
|
||||||
|
#if defined( GUI_IS_X11 )
|
||||||
|
,
|
||||||
0,
|
0,
|
||||||
104,
|
104,
|
||||||
{ 0, 0, 0, 0, DoRed | DoGreen | DoBlue, 0 } },
|
{ 0, 0, 0, 0, DoRed | DoGreen | DoBlue, 0 }
|
||||||
|
#endif
|
||||||
|
},
|
||||||
{ "button",
|
{ "button",
|
||||||
88,
|
88,
|
||||||
88,
|
88,
|
||||||
88,
|
88
|
||||||
|
#if defined( GUI_IS_X11 )
|
||||||
|
,
|
||||||
0,
|
0,
|
||||||
88,
|
88,
|
||||||
{ 0, 0, 0, 0, DoRed | DoGreen | DoBlue, 0 } },
|
{ 0, 0, 0, 0, DoRed | DoGreen | DoBlue, 0 }
|
||||||
|
#endif
|
||||||
|
},
|
||||||
{ "but_bot",
|
{ "but_bot",
|
||||||
74,
|
74,
|
||||||
74,
|
74,
|
||||||
74,
|
74
|
||||||
|
#if defined( GUI_IS_X11 )
|
||||||
|
,
|
||||||
0,
|
0,
|
||||||
74,
|
74,
|
||||||
{ 0, 0, 0, 0, DoRed | DoGreen | DoBlue, 0 } },
|
{ 0, 0, 0, 0, DoRed | DoGreen | DoBlue, 0 }
|
||||||
|
#endif
|
||||||
|
},
|
||||||
{ "lcd_col",
|
{ "lcd_col",
|
||||||
202,
|
202,
|
||||||
221,
|
221,
|
||||||
92,
|
92
|
||||||
|
#if defined( GUI_IS_X11 )
|
||||||
|
,
|
||||||
255,
|
255,
|
||||||
205,
|
205,
|
||||||
{ 0, 0, 0, 0, DoRed | DoGreen | DoBlue, 0 } },
|
{ 0, 0, 0, 0, DoRed | DoGreen | DoBlue, 0 }
|
||||||
|
#endif
|
||||||
|
},
|
||||||
{ "pix_col",
|
{ "pix_col",
|
||||||
0,
|
0,
|
||||||
0,
|
0,
|
||||||
128,
|
128
|
||||||
|
#if defined( GUI_IS_X11 )
|
||||||
|
,
|
||||||
0,
|
0,
|
||||||
20,
|
20,
|
||||||
{ 0, 0, 0, 0, DoRed | DoGreen | DoBlue, 0 } },
|
{ 0, 0, 0, 0, DoRed | DoGreen | DoBlue, 0 }
|
||||||
|
#endif
|
||||||
|
},
|
||||||
{ "pad_top",
|
{ "pad_top",
|
||||||
88,
|
88,
|
||||||
88,
|
88,
|
||||||
88,
|
88
|
||||||
|
#if defined( GUI_IS_X11 )
|
||||||
|
,
|
||||||
0,
|
0,
|
||||||
88,
|
88,
|
||||||
{ 0, 0, 0, 0, DoRed | DoGreen | DoBlue, 0 } },
|
{ 0, 0, 0, 0, DoRed | DoGreen | DoBlue, 0 }
|
||||||
{ "pad", 74, 74, 74, 0, 74, { 0, 0, 0, 0, DoRed | DoGreen | DoBlue, 0 } },
|
#endif
|
||||||
|
},
|
||||||
|
{ "pad",
|
||||||
|
74,
|
||||||
|
74,
|
||||||
|
74
|
||||||
|
#if defined( GUI_IS_X11 )
|
||||||
|
,
|
||||||
|
0,
|
||||||
|
74,
|
||||||
|
{ 0, 0, 0, 0, DoRed | DoGreen | DoBlue, 0 }
|
||||||
|
#endif
|
||||||
|
},
|
||||||
{ "pad_bot",
|
{ "pad_bot",
|
||||||
64,
|
64,
|
||||||
64,
|
64,
|
||||||
64,
|
64
|
||||||
|
#if defined( GUI_IS_X11 )
|
||||||
|
,
|
||||||
0,
|
0,
|
||||||
64,
|
64,
|
||||||
{ 0, 0, 0, 0, DoRed | DoGreen | DoBlue, 0 } },
|
{ 0, 0, 0, 0, DoRed | DoGreen | DoBlue, 0 }
|
||||||
|
#endif
|
||||||
|
},
|
||||||
{ "disp_pad_top",
|
{ "disp_pad_top",
|
||||||
128,
|
128,
|
||||||
128,
|
128,
|
||||||
138,
|
138
|
||||||
|
#if defined( GUI_IS_X11 )
|
||||||
|
,
|
||||||
0,
|
0,
|
||||||
128,
|
128,
|
||||||
{ 0, 0, 0, 0, DoRed | DoGreen | DoBlue, 0 } },
|
{ 0, 0, 0, 0, DoRed | DoGreen | DoBlue, 0 }
|
||||||
|
#endif
|
||||||
|
},
|
||||||
{ "disp_pad",
|
{ "disp_pad",
|
||||||
104,
|
104,
|
||||||
104,
|
104,
|
||||||
110,
|
110
|
||||||
|
#if defined( GUI_IS_X11 )
|
||||||
|
,
|
||||||
0,
|
0,
|
||||||
104,
|
104,
|
||||||
{ 0, 0, 0, 0, DoRed | DoGreen | DoBlue, 0 } },
|
{ 0, 0, 0, 0, DoRed | DoGreen | DoBlue, 0 }
|
||||||
|
#endif
|
||||||
|
},
|
||||||
{ "disp_pad_bot",
|
{ "disp_pad_bot",
|
||||||
84,
|
84,
|
||||||
84,
|
84,
|
||||||
90,
|
90
|
||||||
|
#if defined( GUI_IS_X11 )
|
||||||
|
,
|
||||||
0,
|
0,
|
||||||
84,
|
84,
|
||||||
{ 0, 0, 0, 0, DoRed | DoGreen | DoBlue, 0 } },
|
{ 0, 0, 0, 0, DoRed | DoGreen | DoBlue, 0 }
|
||||||
|
#endif
|
||||||
|
},
|
||||||
{ "logo",
|
{ "logo",
|
||||||
176,
|
176,
|
||||||
176,
|
176,
|
||||||
184,
|
184
|
||||||
|
#if defined( GUI_IS_X11 )
|
||||||
|
,
|
||||||
255,
|
255,
|
||||||
176,
|
176,
|
||||||
{ 0, 0, 0, 0, DoRed | DoGreen | DoBlue, 0 } },
|
{ 0, 0, 0, 0, DoRed | DoGreen | DoBlue, 0 }
|
||||||
|
#endif
|
||||||
|
},
|
||||||
{ "logo_back",
|
{ "logo_back",
|
||||||
104,
|
104,
|
||||||
104,
|
104,
|
||||||
110,
|
110
|
||||||
|
#if defined( GUI_IS_X11 )
|
||||||
|
,
|
||||||
0,
|
0,
|
||||||
104,
|
104,
|
||||||
{ 0, 0, 0, 0, DoRed | DoGreen | DoBlue, 0 } },
|
{ 0, 0, 0, 0, DoRed | DoGreen | DoBlue, 0 }
|
||||||
|
#endif
|
||||||
|
},
|
||||||
{ "label",
|
{ "label",
|
||||||
240,
|
240,
|
||||||
240,
|
240,
|
||||||
240,
|
240
|
||||||
|
#if defined( GUI_IS_X11 )
|
||||||
|
,
|
||||||
255,
|
255,
|
||||||
240,
|
240,
|
||||||
{ 0, 0, 0, 0, DoRed | DoGreen | DoBlue, 0 } },
|
{ 0, 0, 0, 0, DoRed | DoGreen | DoBlue, 0 }
|
||||||
{ "frame", 0, 0, 0, 255, 0, { 0, 0, 0, 0, DoRed | DoGreen | DoBlue, 0 } },
|
#endif
|
||||||
|
},
|
||||||
|
{ "frame",
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0
|
||||||
|
#if defined( GUI_IS_X11 )
|
||||||
|
,
|
||||||
|
255,
|
||||||
|
0,
|
||||||
|
{ 0, 0, 0, 0, DoRed | DoGreen | DoBlue, 0 }
|
||||||
|
#endif
|
||||||
|
},
|
||||||
{ "underlay",
|
{ "underlay",
|
||||||
104,
|
104,
|
||||||
104,
|
104,
|
||||||
110,
|
110
|
||||||
|
#if defined( GUI_IS_X11 )
|
||||||
|
,
|
||||||
0,
|
0,
|
||||||
104,
|
104,
|
||||||
{ 0, 0, 0, 0, DoRed | DoGreen | DoBlue, 0 } },
|
{ 0, 0, 0, 0, DoRed | DoGreen | DoBlue, 0 }
|
||||||
{ "black", 0, 0, 0, 0, 0, { 0, 0, 0, 0, DoRed | DoGreen | DoBlue, 0 } },
|
#endif
|
||||||
|
},
|
||||||
|
{ "black",
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0
|
||||||
|
#if defined( GUI_IS_X11 )
|
||||||
|
,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
{ 0, 0, 0, 0, DoRed | DoGreen | DoBlue, 0 }
|
||||||
|
#endif
|
||||||
|
},
|
||||||
{ 0 } };
|
{ 0 } };
|
||||||
|
|
||||||
#elif defined( GUI_IS_SDL1 )
|
#if defined( GUI_IS_SDL1 )
|
||||||
|
|
||||||
// Control how the screen update is performed: at regular intervals (delayed)
|
// Control how the screen update is performed: at regular intervals (delayed)
|
||||||
// or immediatly Note: this is only for the LCD. The annunciators and the
|
// or immediatly Note: this is only for the LCD. The annunciators and the
|
||||||
|
@ -372,50 +551,6 @@ color_t colors_gx[] = {
|
||||||
// Interval in millisecond between screen updates
|
// Interval in millisecond between screen updates
|
||||||
#define DISPUPDATEINTERVAL 200
|
#define DISPUPDATEINTERVAL 200
|
||||||
|
|
||||||
color_t colors_sx[] = { { "white", 255, 255, 255 },
|
|
||||||
{ "left", 255, 166, 0 },
|
|
||||||
{ "right", 0, 210, 255 },
|
|
||||||
{ "but_top", 109, 93, 93 },
|
|
||||||
{ "button", 90, 77, 770 },
|
|
||||||
{ "but_bot", 76, 65, 65 },
|
|
||||||
{ "lcd_col", 202, 221, 92 },
|
|
||||||
{ "pix_col", 0, 0, 128 },
|
|
||||||
{ "pad_top", 109, 78, 78 },
|
|
||||||
{ "pad", 90, 64, 64 },
|
|
||||||
{ "pad_bot", 76, 54, 54 },
|
|
||||||
{ "disp_pad_top", 155, 118, 84 },
|
|
||||||
{ "disp_pad", 124, 94, 67 },
|
|
||||||
{ "disp_pad_bot", 100, 75, 53 },
|
|
||||||
{ "logo", 204, 169, 107 },
|
|
||||||
{ "logo_back", 64, 64, 64 },
|
|
||||||
{ "label", 202, 184, 144 },
|
|
||||||
{ "frame", 0, 0, 0 },
|
|
||||||
{ "underlay", 60, 42, 42 },
|
|
||||||
{ "black", 0, 0, 0 },
|
|
||||||
{ 0 } };
|
|
||||||
|
|
||||||
color_t colors_gx[] = { { "white", 255, 255, 255 },
|
|
||||||
{ "left", 255, 186, 255 },
|
|
||||||
{ "right", 0, 255, 204 },
|
|
||||||
{ "but_top", 104, 104, 104 },
|
|
||||||
{ "button", 88, 88, 88 },
|
|
||||||
{ "but_bot", 74, 74, 74 },
|
|
||||||
{ "lcd_col", 202, 221, 92 },
|
|
||||||
{ "pix_col", 0, 0, 128 },
|
|
||||||
{ "pad_top", 88, 88, 88 },
|
|
||||||
{ "pad", 74, 74, 74 },
|
|
||||||
{ "pad_bot", 64, 64, 64 },
|
|
||||||
{ "disp_pad_top", 128, 128, 138 },
|
|
||||||
{ "disp_pad", 104, 104, 110 },
|
|
||||||
{ "disp_pad_bot", 84, 84, 90 },
|
|
||||||
{ "logo", 176, 176, 184 },
|
|
||||||
{ "logo_back", 104, 104, 110 },
|
|
||||||
{ "label", 240, 240, 240 },
|
|
||||||
{ "frame", 0, 0, 0 },
|
|
||||||
{ "underlay", 104, 104, 110 },
|
|
||||||
{ "black", 0, 0, 0 },
|
|
||||||
{ 0 } };
|
|
||||||
|
|
||||||
unsigned int ARGBColors[ BLACK + 1 ];
|
unsigned int ARGBColors[ BLACK + 1 ];
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -1173,12 +1308,8 @@ void adjust_contrast( int contrast ) {
|
||||||
colors[ PIXEL ].b = b;
|
colors[ PIXEL ].b = b;
|
||||||
AllocColors();
|
AllocColors();
|
||||||
XSetForeground( dpy, disp.gc, COLOR( PIXEL ) );
|
XSetForeground( dpy, disp.gc, COLOR( PIXEL ) );
|
||||||
#ifdef HAVE_XSHM
|
|
||||||
disp.display_update = UPDATE_DISP | UPDATE_MENU;
|
disp.display_update = UPDATE_DISP | UPDATE_MENU;
|
||||||
refresh_display();
|
refresh_display();
|
||||||
#else
|
|
||||||
redraw_display();
|
|
||||||
#endif
|
|
||||||
redraw_annunc();
|
redraw_annunc();
|
||||||
last_icon_state = -1;
|
last_icon_state = -1;
|
||||||
refresh_icon();
|
refresh_icon();
|
||||||
|
@ -1193,12 +1324,8 @@ void adjust_contrast( int contrast ) {
|
||||||
} else {
|
} else {
|
||||||
XFreeColors( dpy, cmap, &old, 1, 0 );
|
XFreeColors( dpy, cmap, &old, 1, 0 );
|
||||||
XSetForeground( dpy, disp.gc, COLOR( PIXEL ) );
|
XSetForeground( dpy, disp.gc, COLOR( PIXEL ) );
|
||||||
#ifdef HAVE_XSHM
|
|
||||||
disp.display_update = UPDATE_DISP | UPDATE_MENU;
|
disp.display_update = UPDATE_DISP | UPDATE_MENU;
|
||||||
refresh_display();
|
refresh_display();
|
||||||
#else
|
|
||||||
redraw_display();
|
|
||||||
#endif
|
|
||||||
redraw_annunc();
|
redraw_annunc();
|
||||||
last_icon_state = -1;
|
last_icon_state = -1;
|
||||||
refresh_icon();
|
refresh_icon();
|
||||||
|
@ -1408,7 +1535,6 @@ int InitDisplay( int argc, char** argv ) {
|
||||||
*/
|
*/
|
||||||
does_backing_store = XDoesBackingStore( XScreenOfDisplay( dpy, screen ) );
|
does_backing_store = XDoesBackingStore( XScreenOfDisplay( dpy, screen ) );
|
||||||
|
|
||||||
#ifdef HAVE_XSHM
|
|
||||||
/*
|
/*
|
||||||
* Try to use XShm-Extension
|
* Try to use XShm-Extension
|
||||||
*/
|
*/
|
||||||
|
@ -1422,13 +1548,6 @@ int InitDisplay( int argc, char** argv ) {
|
||||||
}
|
}
|
||||||
if ( shm_flag )
|
if ( shm_flag )
|
||||||
fprintf( stderr, "%s: using XShm extension.\n", progname );
|
fprintf( stderr, "%s: using XShm extension.\n", progname );
|
||||||
#else
|
|
||||||
if ( useXShm ) {
|
|
||||||
if ( !quiet )
|
|
||||||
fprintf( stderr, "%s: not compiled to use XShm extension.\n",
|
|
||||||
progname );
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -2800,13 +2919,11 @@ void DrawIcon( void ) {
|
||||||
hp48_icon_height, 0, 0 );
|
hp48_icon_height, 0, 0 );
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef HAVE_XSHM
|
|
||||||
int handle_xerror( Display* the_dpy, XErrorEvent* eev ) {
|
int handle_xerror( Display* the_dpy, XErrorEvent* eev ) {
|
||||||
xerror_flag = 1;
|
xerror_flag = 1;
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
void CreateDispWindow( void ) {
|
void CreateDispWindow( void ) {
|
||||||
XSetWindowAttributes xswa;
|
XSetWindowAttributes xswa;
|
||||||
|
@ -2843,7 +2960,6 @@ void CreateDispWindow( void ) {
|
||||||
|
|
||||||
XSetForeground( dpy, disp.gc, COLOR( PIXEL ) );
|
XSetForeground( dpy, disp.gc, COLOR( PIXEL ) );
|
||||||
|
|
||||||
#ifdef HAVE_XSHM
|
|
||||||
disp.display_update = UPDATE_DISP | UPDATE_MENU;
|
disp.display_update = UPDATE_DISP | UPDATE_MENU;
|
||||||
|
|
||||||
xerror_flag = 0;
|
xerror_flag = 0;
|
||||||
|
@ -2993,15 +3109,12 @@ shm_error:
|
||||||
XFlush( dpy );
|
XFlush( dpy );
|
||||||
|
|
||||||
if ( !shm_flag ) {
|
if ( !shm_flag ) {
|
||||||
#endif
|
|
||||||
rect.x = 5;
|
rect.x = 5;
|
||||||
rect.y = 0;
|
rect.y = 0;
|
||||||
rect.width = 262;
|
rect.width = 262;
|
||||||
rect.height = disp.h;
|
rect.height = disp.h;
|
||||||
XSetClipRectangles( dpy, disp.gc, 0, 0, &rect, 1, Unsorted );
|
XSetClipRectangles( dpy, disp.gc, 0, 0, &rect, 1, Unsorted );
|
||||||
#ifdef HAVE_XSHM
|
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int CreateWindows( int argc, char** argv ) {
|
int CreateWindows( int argc, char** argv ) {
|
||||||
|
@ -3313,12 +3426,10 @@ int CreateWindows( int argc, char** argv ) {
|
||||||
DrawButtons();
|
DrawButtons();
|
||||||
DrawIcon();
|
DrawIcon();
|
||||||
|
|
||||||
#ifdef HAVE_XSHM
|
|
||||||
if ( shm_flag ) {
|
if ( shm_flag ) {
|
||||||
XSetForeground( dpy, disp.gc, COLOR( PIXEL ) );
|
XSetForeground( dpy, disp.gc, COLOR( PIXEL ) );
|
||||||
XFillRectangle( dpy, disp.win, disp.gc, 5, 20, 262, 128 );
|
XFillRectangle( dpy, disp.win, disp.gc, 5, 20, 262, 128 );
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -3433,7 +3544,6 @@ int key_event( int b, XEvent* xev ) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef HAVE_XSHM
|
|
||||||
void refresh_display( void ) {
|
void refresh_display( void ) {
|
||||||
if ( shm_flag ) {
|
if ( shm_flag ) {
|
||||||
if ( disp.display_update & UPDATE_DISP ) {
|
if ( disp.display_update & UPDATE_DISP ) {
|
||||||
|
@ -3449,10 +3559,8 @@ void refresh_display( void ) {
|
||||||
disp.display_update = 0;
|
disp.display_update = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
void DrawDisp( void ) {
|
void DrawDisp( void ) {
|
||||||
#ifdef HAVE_XSHM
|
|
||||||
if ( shm_flag ) {
|
if ( shm_flag ) {
|
||||||
XShmPutImage( dpy, disp.win, disp.gc, disp.disp_image, disp.offset, 0,
|
XShmPutImage( dpy, disp.win, disp.gc, disp.disp_image, disp.offset, 0,
|
||||||
5, 20, 262, ( unsigned int )( disp.lines + 2 ), 0 );
|
5, 20, 262, ( unsigned int )( disp.lines + 2 ), 0 );
|
||||||
|
@ -3463,11 +3571,9 @@ void DrawDisp( void ) {
|
||||||
}
|
}
|
||||||
disp.display_update = 0;
|
disp.display_update = 0;
|
||||||
} else {
|
} else {
|
||||||
#endif
|
|
||||||
redraw_display();
|
redraw_display();
|
||||||
#ifdef HAVE_XSHM
|
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
redraw_annunc();
|
redraw_annunc();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
13
src/x48.h
13
src/x48.h
|
@ -6,11 +6,9 @@
|
||||||
#include <X11/Xresource.h>
|
#include <X11/Xresource.h>
|
||||||
#include <X11/Xutil.h>
|
#include <X11/Xutil.h>
|
||||||
#include <X11/keysym.h>
|
#include <X11/keysym.h>
|
||||||
#ifdef HAVE_XSHM
|
|
||||||
#include <X11/extensions/XShm.h>
|
#include <X11/extensions/XShm.h>
|
||||||
#include <sys/ipc.h>
|
#include <sys/ipc.h>
|
||||||
#include <sys/shm.h>
|
#include <sys/shm.h>
|
||||||
#endif
|
|
||||||
#elif defined( GUI_IS_SDL1 )
|
#elif defined( GUI_IS_SDL1 )
|
||||||
#include <SDL/SDL.h>
|
#include <SDL/SDL.h>
|
||||||
#include <SDL/SDL_gfxPrimitives.h>
|
#include <SDL/SDL_gfxPrimitives.h>
|
||||||
|
@ -145,12 +143,13 @@ extern color_t* colors;
|
||||||
#define UPDATE_DISP 2
|
#define UPDATE_DISP 2
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined( GUI_IS_SDL1 )
|
|
||||||
typedef struct keypad_t {
|
typedef struct keypad_t {
|
||||||
unsigned int width;
|
unsigned int width;
|
||||||
unsigned int height;
|
unsigned int height;
|
||||||
} keypad_t;
|
#if defined( GUI_IS_X11 )
|
||||||
|
Pixmap pixmap;
|
||||||
#endif
|
#endif
|
||||||
|
} keypad_t;
|
||||||
|
|
||||||
typedef struct disp_t {
|
typedef struct disp_t {
|
||||||
unsigned int w, h;
|
unsigned int w, h;
|
||||||
|
@ -162,22 +161,18 @@ typedef struct disp_t {
|
||||||
int offset;
|
int offset;
|
||||||
int lines;
|
int lines;
|
||||||
#if defined( GUI_IS_X11 )
|
#if defined( GUI_IS_X11 )
|
||||||
#ifdef HAVE_XSHM
|
|
||||||
int display_update;
|
int display_update;
|
||||||
XShmSegmentInfo disp_info;
|
XShmSegmentInfo disp_info;
|
||||||
XImage* disp_image;
|
XImage* disp_image;
|
||||||
XShmSegmentInfo menu_info;
|
XShmSegmentInfo menu_info;
|
||||||
XImage* menu_image;
|
XImage* menu_image;
|
||||||
#endif
|
#endif
|
||||||
#endif
|
|
||||||
} disp_t;
|
} disp_t;
|
||||||
|
|
||||||
#if defined( GUI_IS_X11 )
|
#if defined( GUI_IS_X11 )
|
||||||
extern disp_t disp;
|
extern disp_t disp;
|
||||||
|
|
||||||
#ifdef HAVE_XSHM
|
|
||||||
extern int shm_flag;
|
extern int shm_flag;
|
||||||
#endif
|
|
||||||
|
|
||||||
extern Display* dpy;
|
extern Display* dpy;
|
||||||
extern int screen;
|
extern int screen;
|
||||||
|
@ -264,9 +259,7 @@ extern void exit_x48( int tell_x11 );
|
||||||
|
|
||||||
#if defined( GUI_IS_X11 )
|
#if defined( GUI_IS_X11 )
|
||||||
|
|
||||||
#ifdef HAVE_XSHM
|
|
||||||
extern void refresh_display( void );
|
extern void refresh_display( void );
|
||||||
#endif
|
|
||||||
|
|
||||||
#elif defined( GUI_IS_SDL1 )
|
#elif defined( GUI_IS_SDL1 )
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue