wxGTK now chooses the best visual X offers,
instead of the default one. Reordered object files for library creation. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@2886 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -944,7 +944,7 @@ wxBitmap wxImage::ConvertToBitmap() const
|
|||||||
// Retrieve depth
|
// Retrieve depth
|
||||||
|
|
||||||
GdkVisual *visual = gdk_window_get_visual( bitmap.GetPixmap() );
|
GdkVisual *visual = gdk_window_get_visual( bitmap.GetPixmap() );
|
||||||
if (visual == NULL) visual = gdk_window_get_visual( (GdkWindow*) &gdk_root_parent );
|
if (visual == NULL) visual = gdk_visual_get_best();
|
||||||
int bpp = visual->depth;
|
int bpp = visual->depth;
|
||||||
|
|
||||||
bitmap.SetDepth( bpp );
|
bitmap.SetDepth( bpp );
|
||||||
@@ -984,7 +984,7 @@ wxBitmap wxImage::ConvertToBitmap() const
|
|||||||
// Create picture image
|
// Create picture image
|
||||||
|
|
||||||
GdkImage *data_image =
|
GdkImage *data_image =
|
||||||
gdk_image_new( GDK_IMAGE_FASTEST, gdk_visual_get_system(), width, height );
|
gdk_image_new( GDK_IMAGE_FASTEST, gdk_visual_get_best(), width, height );
|
||||||
|
|
||||||
// Create mask image
|
// Create mask image
|
||||||
|
|
||||||
@@ -994,7 +994,7 @@ wxBitmap wxImage::ConvertToBitmap() const
|
|||||||
{
|
{
|
||||||
unsigned char *mask_data = (unsigned char*)malloc( ((width >> 3)+8) * height );
|
unsigned char *mask_data = (unsigned char*)malloc( ((width >> 3)+8) * height );
|
||||||
|
|
||||||
mask_image = gdk_image_new_bitmap( gdk_visual_get_system(), mask_data, width, height );
|
mask_image = gdk_image_new_bitmap( gdk_visual_get_best(), mask_data, width, height );
|
||||||
|
|
||||||
wxMask *mask = new wxMask();
|
wxMask *mask = new wxMask();
|
||||||
mask->m_bitmap = gdk_pixmap_new( (GdkWindow*)&gdk_root_parent, width, height, 1 );
|
mask->m_bitmap = gdk_pixmap_new( (GdkWindow*)&gdk_root_parent, width, height, 1 );
|
||||||
@@ -1009,7 +1009,7 @@ wxBitmap wxImage::ConvertToBitmap() const
|
|||||||
|
|
||||||
if (bpp >= 24)
|
if (bpp >= 24)
|
||||||
{
|
{
|
||||||
GdkVisual *visual = gdk_visual_get_system();
|
GdkVisual *visual = gdk_visual_get_best();
|
||||||
if ((visual->red_mask > visual->green_mask) && (visual->green_mask > visual->blue_mask)) b_o = RGB;
|
if ((visual->red_mask > visual->green_mask) && (visual->green_mask > visual->blue_mask)) b_o = RGB;
|
||||||
else if ((visual->red_mask > visual->blue_mask) && (visual->blue_mask > visual->green_mask)) b_o = RGB;
|
else if ((visual->red_mask > visual->blue_mask) && (visual->blue_mask > visual->green_mask)) b_o = RGB;
|
||||||
else if ((visual->blue_mask > visual->red_mask) && (visual->red_mask > visual->green_mask)) b_o = BRG;
|
else if ((visual->blue_mask > visual->red_mask) && (visual->red_mask > visual->green_mask)) b_o = BRG;
|
||||||
|
@@ -33,36 +33,22 @@ libwx_gtk_la_SOURCES = \
|
|||||||
parser.c \
|
parser.c \
|
||||||
\
|
\
|
||||||
cmndata.cpp \
|
cmndata.cpp \
|
||||||
dynarray.cpp \
|
|
||||||
filefn.cpp \
|
|
||||||
hash.cpp \
|
|
||||||
list.cpp \
|
|
||||||
matrix.cpp \
|
|
||||||
memory.cpp \
|
|
||||||
module.cpp \
|
|
||||||
object.cpp \
|
|
||||||
string.cpp \
|
|
||||||
timercmn.cpp \
|
|
||||||
utilscmn.cpp \
|
|
||||||
tokenzr.cpp \
|
|
||||||
variant.cpp \
|
|
||||||
wxchar.cpp \
|
|
||||||
\
|
|
||||||
config.cpp \
|
config.cpp \
|
||||||
date.cpp \
|
date.cpp \
|
||||||
datstrm.cpp \
|
datstrm.cpp \
|
||||||
db.cpp \
|
|
||||||
dbtable.cpp \
|
|
||||||
dcbase.cpp \
|
dcbase.cpp \
|
||||||
docmdi.cpp \
|
docmdi.cpp \
|
||||||
docview.cpp \
|
docview.cpp \
|
||||||
|
dynarray.cpp \
|
||||||
dynlib.cpp \
|
dynlib.cpp \
|
||||||
event.cpp \
|
event.cpp \
|
||||||
file.cpp \
|
file.cpp \
|
||||||
fileconf.cpp \
|
fileconf.cpp \
|
||||||
|
filefn.cpp \
|
||||||
framecmn.cpp \
|
framecmn.cpp \
|
||||||
ftp.cpp \
|
ftp.cpp \
|
||||||
gdicmn.cpp \
|
gdicmn.cpp \
|
||||||
|
hash.cpp \
|
||||||
helpbase.cpp \
|
helpbase.cpp \
|
||||||
http.cpp \
|
http.cpp \
|
||||||
image.cpp \
|
image.cpp \
|
||||||
@@ -73,10 +59,15 @@ libwx_gtk_la_SOURCES = \
|
|||||||
intl.cpp \
|
intl.cpp \
|
||||||
ipcbase.cpp \
|
ipcbase.cpp \
|
||||||
layout.cpp \
|
layout.cpp \
|
||||||
|
list.cpp \
|
||||||
log.cpp \
|
log.cpp \
|
||||||
longlong.cpp \
|
longlong.cpp \
|
||||||
|
matrix.cpp \
|
||||||
|
memory.cpp \
|
||||||
mimetype.cpp \
|
mimetype.cpp \
|
||||||
|
module.cpp \
|
||||||
mstream.cpp \
|
mstream.cpp \
|
||||||
|
object.cpp \
|
||||||
objstrm.cpp \
|
objstrm.cpp \
|
||||||
odbc.cpp \
|
odbc.cpp \
|
||||||
paper.cpp \
|
paper.cpp \
|
||||||
@@ -92,18 +83,27 @@ libwx_gtk_la_SOURCES = \
|
|||||||
serbase.cpp \
|
serbase.cpp \
|
||||||
socket.cpp \
|
socket.cpp \
|
||||||
stream.cpp \
|
stream.cpp \
|
||||||
|
string.cpp \
|
||||||
tbarbase.cpp \
|
tbarbase.cpp \
|
||||||
tbarsmpl.cpp \
|
tbarsmpl.cpp \
|
||||||
textfile.cpp \
|
textfile.cpp \
|
||||||
time.cpp \
|
time.cpp \
|
||||||
|
timercmn.cpp \
|
||||||
|
utilscmn.cpp \
|
||||||
|
tokenzr.cpp \
|
||||||
url.cpp \
|
url.cpp \
|
||||||
valgen.cpp \
|
valgen.cpp \
|
||||||
validate.cpp \
|
validate.cpp \
|
||||||
valtext.cpp \
|
valtext.cpp \
|
||||||
|
variant.cpp \
|
||||||
wfstream.cpp \
|
wfstream.cpp \
|
||||||
wincmn.cpp \
|
wincmn.cpp \
|
||||||
|
wxchar.cpp \
|
||||||
wxexpr.cpp \
|
wxexpr.cpp \
|
||||||
zstream.cpp \
|
zstream.cpp \
|
||||||
|
\
|
||||||
|
db.cpp \
|
||||||
|
dbtable.cpp \
|
||||||
\
|
\
|
||||||
caret.cpp \
|
caret.cpp \
|
||||||
choicdgg.cpp \
|
choicdgg.cpp \
|
||||||
|
@@ -297,9 +297,13 @@ wxApp::~wxApp()
|
|||||||
|
|
||||||
bool wxApp::OnInitGui()
|
bool wxApp::OnInitGui()
|
||||||
{
|
{
|
||||||
/* Nothing to do for 15, 16, 24, 32 bit displays */
|
/* on some SGIs, the default visual is just 256 colours, so we
|
||||||
|
make sure we get the best. this can sometimes be wasteful,
|
||||||
|
of course, but what do these guys pay $30.000 for? */
|
||||||
|
GdkVisual* visual = gdk_visual_get_best();
|
||||||
|
gtk_widget_set_default_visual( visual );
|
||||||
|
|
||||||
GdkVisual *visual = gdk_visual_get_system();
|
/* Nothing to do for 15, 16, 24, 32 bit displays */
|
||||||
if (visual->depth > 8) return TRUE;
|
if (visual->depth > 8) return TRUE;
|
||||||
|
|
||||||
/* this initiates the standard palette as defined by GdkImlib
|
/* this initiates the standard palette as defined by GdkImlib
|
||||||
|
@@ -33,36 +33,22 @@ libwx_gtk_la_SOURCES = \
|
|||||||
parser.c \
|
parser.c \
|
||||||
\
|
\
|
||||||
cmndata.cpp \
|
cmndata.cpp \
|
||||||
dynarray.cpp \
|
|
||||||
filefn.cpp \
|
|
||||||
hash.cpp \
|
|
||||||
list.cpp \
|
|
||||||
matrix.cpp \
|
|
||||||
memory.cpp \
|
|
||||||
module.cpp \
|
|
||||||
object.cpp \
|
|
||||||
string.cpp \
|
|
||||||
timercmn.cpp \
|
|
||||||
utilscmn.cpp \
|
|
||||||
tokenzr.cpp \
|
|
||||||
variant.cpp \
|
|
||||||
wxchar.cpp \
|
|
||||||
\
|
|
||||||
config.cpp \
|
config.cpp \
|
||||||
date.cpp \
|
date.cpp \
|
||||||
datstrm.cpp \
|
datstrm.cpp \
|
||||||
db.cpp \
|
|
||||||
dbtable.cpp \
|
|
||||||
dcbase.cpp \
|
dcbase.cpp \
|
||||||
docmdi.cpp \
|
docmdi.cpp \
|
||||||
docview.cpp \
|
docview.cpp \
|
||||||
|
dynarray.cpp \
|
||||||
dynlib.cpp \
|
dynlib.cpp \
|
||||||
event.cpp \
|
event.cpp \
|
||||||
file.cpp \
|
file.cpp \
|
||||||
fileconf.cpp \
|
fileconf.cpp \
|
||||||
|
filefn.cpp \
|
||||||
framecmn.cpp \
|
framecmn.cpp \
|
||||||
ftp.cpp \
|
ftp.cpp \
|
||||||
gdicmn.cpp \
|
gdicmn.cpp \
|
||||||
|
hash.cpp \
|
||||||
helpbase.cpp \
|
helpbase.cpp \
|
||||||
http.cpp \
|
http.cpp \
|
||||||
image.cpp \
|
image.cpp \
|
||||||
@@ -73,10 +59,15 @@ libwx_gtk_la_SOURCES = \
|
|||||||
intl.cpp \
|
intl.cpp \
|
||||||
ipcbase.cpp \
|
ipcbase.cpp \
|
||||||
layout.cpp \
|
layout.cpp \
|
||||||
|
list.cpp \
|
||||||
log.cpp \
|
log.cpp \
|
||||||
longlong.cpp \
|
longlong.cpp \
|
||||||
|
matrix.cpp \
|
||||||
|
memory.cpp \
|
||||||
mimetype.cpp \
|
mimetype.cpp \
|
||||||
|
module.cpp \
|
||||||
mstream.cpp \
|
mstream.cpp \
|
||||||
|
object.cpp \
|
||||||
objstrm.cpp \
|
objstrm.cpp \
|
||||||
odbc.cpp \
|
odbc.cpp \
|
||||||
paper.cpp \
|
paper.cpp \
|
||||||
@@ -92,18 +83,27 @@ libwx_gtk_la_SOURCES = \
|
|||||||
serbase.cpp \
|
serbase.cpp \
|
||||||
socket.cpp \
|
socket.cpp \
|
||||||
stream.cpp \
|
stream.cpp \
|
||||||
|
string.cpp \
|
||||||
tbarbase.cpp \
|
tbarbase.cpp \
|
||||||
tbarsmpl.cpp \
|
tbarsmpl.cpp \
|
||||||
textfile.cpp \
|
textfile.cpp \
|
||||||
time.cpp \
|
time.cpp \
|
||||||
|
timercmn.cpp \
|
||||||
|
utilscmn.cpp \
|
||||||
|
tokenzr.cpp \
|
||||||
url.cpp \
|
url.cpp \
|
||||||
valgen.cpp \
|
valgen.cpp \
|
||||||
validate.cpp \
|
validate.cpp \
|
||||||
valtext.cpp \
|
valtext.cpp \
|
||||||
|
variant.cpp \
|
||||||
wfstream.cpp \
|
wfstream.cpp \
|
||||||
wincmn.cpp \
|
wincmn.cpp \
|
||||||
|
wxchar.cpp \
|
||||||
wxexpr.cpp \
|
wxexpr.cpp \
|
||||||
zstream.cpp \
|
zstream.cpp \
|
||||||
|
\
|
||||||
|
db.cpp \
|
||||||
|
dbtable.cpp \
|
||||||
\
|
\
|
||||||
caret.cpp \
|
caret.cpp \
|
||||||
choicdgg.cpp \
|
choicdgg.cpp \
|
||||||
|
@@ -297,9 +297,13 @@ wxApp::~wxApp()
|
|||||||
|
|
||||||
bool wxApp::OnInitGui()
|
bool wxApp::OnInitGui()
|
||||||
{
|
{
|
||||||
/* Nothing to do for 15, 16, 24, 32 bit displays */
|
/* on some SGIs, the default visual is just 256 colours, so we
|
||||||
|
make sure we get the best. this can sometimes be wasteful,
|
||||||
|
of course, but what do these guys pay $30.000 for? */
|
||||||
|
GdkVisual* visual = gdk_visual_get_best();
|
||||||
|
gtk_widget_set_default_visual( visual );
|
||||||
|
|
||||||
GdkVisual *visual = gdk_visual_get_system();
|
/* Nothing to do for 15, 16, 24, 32 bit displays */
|
||||||
if (visual->depth > 8) return TRUE;
|
if (visual->depth > 8) return TRUE;
|
||||||
|
|
||||||
/* this initiates the standard palette as defined by GdkImlib
|
/* this initiates the standard palette as defined by GdkImlib
|
||||||
|
Reference in New Issue
Block a user