Implement access to a global toplevel GdkWindow in a way that does not require always having an extra GtkWindow.
And don't use "RootWindow" in the name, it is not a root window in the X11 sense. Also add wxGetPangoContext() to get access to a PangoContext. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@76465 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -24,7 +24,7 @@
|
||||
|
||||
#include <gtk/gtk.h>
|
||||
|
||||
extern GtkWidget *wxGetRootWindow();
|
||||
GdkWindow* wxGetTopLevelGDK();
|
||||
|
||||
#ifndef __WXGTK3__
|
||||
static void PixmapToPixbuf(GdkPixmap* pixmap, GdkPixbuf* pixbuf, int w, int h)
|
||||
@@ -245,7 +245,7 @@ bool wxMask::InitFromColour(const wxBitmap& bitmap, const wxColour& colour)
|
||||
}
|
||||
g_object_unref(image);
|
||||
}
|
||||
m_bitmap = gdk_bitmap_create_from_data(wxGetRootWindow()->window, (char*)out, w, h);
|
||||
m_bitmap = gdk_bitmap_create_from_data(wxGetTopLevelGDK(), (char*)out, w, h);
|
||||
delete[] out;
|
||||
#endif
|
||||
return true;
|
||||
@@ -260,7 +260,7 @@ bool wxMask::InitFromMonoBitmap(const wxBitmap& bitmap)
|
||||
#ifdef __WXGTK3__
|
||||
InitFromColour(bitmap, *wxBLACK);
|
||||
#else
|
||||
m_bitmap = gdk_pixmap_new( wxGetRootWindow()->window, bitmap.GetWidth(), bitmap.GetHeight(), 1 );
|
||||
m_bitmap = gdk_pixmap_new(wxGetTopLevelGDK(), bitmap.GetWidth(), bitmap.GetHeight(), 1);
|
||||
|
||||
if (!m_bitmap) return false;
|
||||
|
||||
@@ -375,7 +375,7 @@ wxBitmapRefData::wxBitmapRefData(int width, int height, int depth)
|
||||
m_bpp = 24;
|
||||
#else
|
||||
if (m_bpp < 0)
|
||||
m_bpp = gdk_drawable_get_depth(wxGetRootWindow()->window);
|
||||
m_bpp = gdk_drawable_get_depth(wxGetTopLevelGDK());
|
||||
m_alphaRequested = depth == 32;
|
||||
#endif
|
||||
}
|
||||
@@ -443,7 +443,7 @@ wxBitmap::wxBitmap(const char bits[], int width, int height, int depth)
|
||||
}
|
||||
#else
|
||||
M_BMPDATA->m_pixmap = gdk_bitmap_create_from_data(
|
||||
wxGetRootWindow()->window, bits, width, height);
|
||||
wxGetTopLevelGDK(), bits, width, height);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
@@ -466,7 +466,8 @@ wxBitmap::wxBitmap(const char* const* bits)
|
||||
}
|
||||
#else
|
||||
GdkBitmap* mask = NULL;
|
||||
GdkPixmap* pixmap = gdk_pixmap_create_from_xpm_d(wxGetRootWindow()->window, &mask, NULL, const_cast<char**>(bits));
|
||||
GdkPixmap* pixmap = gdk_pixmap_create_from_xpm_d(
|
||||
wxGetTopLevelGDK(), &mask, NULL, const_cast<char**>(bits));
|
||||
if (pixmap)
|
||||
{
|
||||
int width, height;
|
||||
@@ -655,7 +656,7 @@ bool wxBitmap::CreateFromImageAsPixmap(const wxImage& image, int depth)
|
||||
// move index to next byte boundary
|
||||
bit_index = (bit_index + 7) & ~7u;
|
||||
}
|
||||
SetPixmap(gdk_bitmap_create_from_data(wxGetRootWindow()->window, (char*)out, w, h));
|
||||
SetPixmap(gdk_bitmap_create_from_data(wxGetTopLevelGDK(), (char*)out, w, h));
|
||||
delete[] out;
|
||||
|
||||
if (!M_BMPDATA) // SetPixmap may have failed
|
||||
@@ -663,7 +664,7 @@ bool wxBitmap::CreateFromImageAsPixmap(const wxImage& image, int depth)
|
||||
}
|
||||
else
|
||||
{
|
||||
SetPixmap(gdk_pixmap_new(wxGetRootWindow()->window, w, h, depth));
|
||||
SetPixmap(gdk_pixmap_new(wxGetTopLevelGDK(), w, h, depth));
|
||||
if (!M_BMPDATA)
|
||||
return false;
|
||||
|
||||
@@ -1170,7 +1171,7 @@ GdkPixmap *wxBitmap::GetPixmap() const
|
||||
}
|
||||
else
|
||||
{
|
||||
bmpData->m_pixmap = gdk_pixmap_new(wxGetRootWindow()->window,
|
||||
bmpData->m_pixmap = gdk_pixmap_new(wxGetTopLevelGDK(),
|
||||
bmpData->m_width, bmpData->m_height, bmpData->m_bpp == 1 ? 1 : -1);
|
||||
}
|
||||
return bmpData->m_pixmap;
|
||||
|
Reference in New Issue
Block a user