- fixed xpm-related warnings in 'x' and 'wx'
- use X desktop size for the maximum guest resulution
This commit is contained in:
parent
2d57f0c3e9
commit
613b146974
@ -96,7 +96,7 @@ LIBS = @LIBS@
|
||||
X_LIBS = @X_LIBS@
|
||||
X_PRE_LIBS = @X_PRE_LIBS@
|
||||
XPM_LIB = @XPM_LIB@
|
||||
GUI_LINK_OPTS_X = $(X_LIBS) $(X_PRE_LIBS) -lX11 $(XPM_LIB)
|
||||
GUI_LINK_OPTS_X = $(X_LIBS) $(X_PRE_LIBS) -lX11 $(XPM_LIB) -lXrandr
|
||||
GUI_LINK_OPTS_SDL = `sdl-config --cflags --libs`
|
||||
GUI_LINK_OPTS_SVGA = -lvga -lvgagl
|
||||
GUI_LINK_OPTS_BEOS = -lbe
|
||||
|
@ -69,7 +69,7 @@ OBJS_THAT_CAN_BE_PLUGINS = @GUI_OBJS@
|
||||
|
||||
X_LIBS = @X_LIBS@
|
||||
X_PRE_LIBS = @X_PRE_LIBS@
|
||||
GUI_LINK_OPTS_X = $(X_LIBS) $(X_PRE_LIBS) -lX11 -lXpm
|
||||
GUI_LINK_OPTS_X = $(X_LIBS) $(X_PRE_LIBS) -lX11 $(XPM_LIB) -lXrandr
|
||||
GUI_LINK_OPTS_SDL = `sdl-config --cflags --libs`
|
||||
GUI_LINK_OPTS_SVGA = -lvga -lvgagl
|
||||
GUI_LINK_OPTS_BEOS = -lbe
|
||||
|
@ -1,5 +1,5 @@
|
||||
/* XPM */
|
||||
static char *cdromd_xpm[] = {
|
||||
static const char *cdromd_xpm[] = {
|
||||
/* width height num_colors chars_per_pixel */
|
||||
" 32 32 2 1",
|
||||
/* colors */
|
||||
|
@ -1,5 +1,5 @@
|
||||
/* XPM */
|
||||
static char *configbutton_xpm[] = {
|
||||
static const char *configbutton_xpm[] = {
|
||||
/* width height num_colors chars_per_pixel */
|
||||
" 32 32 2 1",
|
||||
/* colors */
|
||||
|
@ -1,5 +1,5 @@
|
||||
/* XPM */
|
||||
static char *copy_xpm[] = {
|
||||
static const char *copy_xpm[] = {
|
||||
/* width height num_colors chars_per_pixel */
|
||||
" 32 32 2 1",
|
||||
/* colors */
|
||||
|
@ -1,5 +1,5 @@
|
||||
/* XPM */
|
||||
static char *floppya_xpm[] = {
|
||||
static const char *floppya_xpm[] = {
|
||||
/* width height num_colors chars_per_pixel */
|
||||
" 32 32 2 1",
|
||||
/* colors */
|
||||
|
@ -1,5 +1,5 @@
|
||||
/* XPM */
|
||||
static char *floppyb_xpm[] = {
|
||||
static const char *floppyb_xpm[] = {
|
||||
/* width height num_colors chars_per_pixel */
|
||||
" 32 32 2 1",
|
||||
/* colors */
|
||||
|
@ -1,5 +1,5 @@
|
||||
/* XPM */
|
||||
static char *mouse_xpm[] = {
|
||||
static const char *mouse_xpm[] = {
|
||||
/* width height num_colors chars_per_pixel */
|
||||
" 32 32 2 1",
|
||||
/* colors */
|
||||
|
@ -1,5 +1,5 @@
|
||||
/* XPM */
|
||||
static char *paste_xpm[] = {
|
||||
static const char *paste_xpm[] = {
|
||||
/* width height num_colors chars_per_pixel */
|
||||
" 32 32 2 1",
|
||||
/* colors */
|
||||
|
@ -1,5 +1,5 @@
|
||||
/* XPM */
|
||||
static char *power_xpm[] = {
|
||||
static const char *power_xpm[] = {
|
||||
/* width height num_colors chars_per_pixel */
|
||||
" 32 32 2 1",
|
||||
/* colors */
|
||||
|
@ -1,5 +1,5 @@
|
||||
/* XPM */
|
||||
static char *reset_xpm[] = {
|
||||
static const char *reset_xpm[] = {
|
||||
/* width height num_colors chars_per_pixel */
|
||||
" 32 32 2 1",
|
||||
/* colors */
|
||||
|
@ -1,5 +1,5 @@
|
||||
/* XPM */
|
||||
static char *saverestore_xpm[] = {
|
||||
static const char *saverestore_xpm[] = {
|
||||
/* width height num_colors chars_per_pixel */
|
||||
" 32 32 2 1",
|
||||
/* colors */
|
||||
|
@ -1,5 +1,5 @@
|
||||
/* XPM */
|
||||
static char *snapshot_xpm[] = {
|
||||
static const char *snapshot_xpm[] = {
|
||||
/* width height num_colors chars_per_pixel */
|
||||
" 32 32 2 1",
|
||||
/* colors */
|
||||
|
@ -1,5 +1,5 @@
|
||||
/* XPM */
|
||||
static char *userbutton_xpm[] = {
|
||||
static const char *userbutton_xpm[] = {
|
||||
/* columns rows colors chars-per-pixel */
|
||||
"32 32 2 1",
|
||||
". c None",
|
||||
|
@ -1,5 +1,5 @@
|
||||
/* XPM */
|
||||
static char *icon_bochs_xpm[] = {
|
||||
static const char *icon_bochs_xpm[] = {
|
||||
/* columns rows colors chars-per-pixel */
|
||||
"32 32 7 1",
|
||||
" c black",
|
||||
|
@ -1,5 +1,5 @@
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
// $Id: x.cc,v 1.132 2010-05-18 15:33:41 vruppert Exp $
|
||||
// $Id: x.cc,v 1.133 2011-02-10 23:00:56 vruppert Exp $
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (C) 2002-2009 The Bochs Project
|
||||
@ -39,6 +39,7 @@ extern "C" {
|
||||
#include <X11/Xos.h>
|
||||
#include <X11/Xatom.h>
|
||||
#include <X11/keysym.h>
|
||||
#include <X11/extensions/Xrandr.h>
|
||||
#if BX_HAVE_XPM_H
|
||||
#include <X11/xpm.h>
|
||||
#endif
|
||||
@ -477,11 +478,11 @@ void bx_x_gui_c::specific_init(int argc, char **argv, unsigned tilewidth, unsign
|
||||
|
||||
#if BX_HAVE_XPM_H
|
||||
/* Create pixmap from XPM for icon */
|
||||
XCreatePixmapFromData(bx_x_display, win, icon_bochs_xpm, &icon_pixmap, &icon_mask, NULL);
|
||||
XCreatePixmapFromData(bx_x_display, win, (char **)icon_bochs_xpm, &icon_pixmap, &icon_mask, NULL);
|
||||
#else
|
||||
/* Create pixmap of depth 1 (bitmap) for icon */
|
||||
icon_pixmap = XCreateBitmapFromData(bx_x_display, win,
|
||||
(char *) bochs_icon_bits, bochs_icon_width, bochs_icon_height);
|
||||
(char *)bochs_icon_bits, bochs_icon_width, bochs_icon_height);
|
||||
#endif
|
||||
|
||||
/* Set size hints for window manager. The window manager may
|
||||
@ -1985,8 +1986,18 @@ void bx_x_gui_c::beep_off()
|
||||
|
||||
void bx_x_gui_c::get_capabilities(Bit16u *xres, Bit16u *yres, Bit16u *bpp)
|
||||
{
|
||||
*xres = 1024;
|
||||
*yres = 768;
|
||||
int num_sizes;
|
||||
Rotation original_rotation;
|
||||
|
||||
Display *dpy = XOpenDisplay(NULL);
|
||||
Window root = RootWindow(dpy, 0);
|
||||
XRRScreenSize *xrrs = XRRSizes(dpy, 0, &num_sizes);
|
||||
XRRScreenConfiguration *conf = XRRGetScreenInfo(dpy, root);
|
||||
SizeID original_size_id = XRRConfigCurrentConfiguration(conf, &original_rotation);
|
||||
*xres = xrrs[original_size_id].width;
|
||||
*yres = xrrs[original_size_id].height;
|
||||
XCloseDisplay(dpy);
|
||||
// always return 32 bit depth
|
||||
*bpp = 32;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user