]>
git.saurik.com Git - wxWidgets.git/blob - src/gtk/nonownedwnd.cpp
20f05258e3eb8169cc74c18840a29725bd156d60
1 ///////////////////////////////////////////////////////////////////////////////
2 // Name: src/gtk/nonownedwnd.cpp
3 // Purpose: wxGTK implementation of wxNonOwnedWindow.
4 // Author: Vadim Zeitlin
6 // RCS-ID: $Id: wxhead.cpp,v 1.11 2010-04-22 12:44:51 zeitlin Exp $
7 // Copyright: (c) 2011 Vadim Zeitlin <vadim@wxwidgets.org>
8 // Licence: wxWindows licence
9 ///////////////////////////////////////////////////////////////////////////////
11 // ============================================================================
13 // ============================================================================
15 // ----------------------------------------------------------------------------
17 // ----------------------------------------------------------------------------
19 // for compilers that support precompilation, includes "wx.h".
20 #include "wx/wxprec.h"
27 #include "wx/string.h"
30 #include "wx/gtk/private.h"
38 bool do_shape_combine_region(GdkWindow
* window
, const wxRegion
& region
)
44 gdk_window_shape_combine_mask(window
, NULL
, 0, 0);
48 gdk_window_shape_combine_region(window
, region
.GetRegion(), 0, 0);
55 } // anonymous namespace
58 // ============================================================================
59 // wxNonOwnedWindow implementation
60 // ============================================================================
62 void wxNonOwnedWindow::GTKHandleRealized()
64 wxNonOwnedWindowBase::GTKHandleRealized();
66 if (HasFlag(wxFRAME_SHAPED
))
70 bool wxNonOwnedWindow::SetShape(const wxRegion
& region
)
72 wxCHECK_MSG( HasFlag(wxFRAME_SHAPED
), false,
73 wxT("Shaped windows must be created with the wxFRAME_SHAPED style."));
75 if ( gtk_widget_get_realized(m_widget
) )
78 do_shape_combine_region(gtk_widget_get_window(m_wxwindow
), region
);
80 return do_shape_combine_region(gtk_widget_get_window(m_widget
), region
);
82 else // not realized yet
84 // store the shape to set, it will be really set once we're realized
87 // we don't know if we're going to succeed or fail, be optimistic by