wx/gtk/font.h \
wx/gtk/filehistory.h \
wx/gtk/minifram.h \
+ wx/gtk/nonownedwnd.h \
wx/gtk/pen.h \
wx/gtk/popupwin.h \
wx/gtk/private/win_gtk.h \
monodll_gtk_font.o \
monodll_gtk_sockgtk.o \
monodll_gtk_minifram.o \
+ monodll_gtk_nonownedwnd.o \
monodll_gtk_pen.o \
monodll_gtk_popupwin.o \
monodll_private.o \
monodll_gtk_font.o \
monodll_gtk_sockgtk.o \
monodll_gtk_minifram.o \
+ monodll_gtk_nonownedwnd.o \
monodll_gtk_pen.o \
monodll_gtk_popupwin.o \
monodll_private.o \
monolib_gtk_font.o \
monolib_gtk_sockgtk.o \
monolib_gtk_minifram.o \
+ monolib_gtk_nonownedwnd.o \
monolib_gtk_pen.o \
monolib_gtk_popupwin.o \
monolib_private.o \
monolib_gtk_font.o \
monolib_gtk_sockgtk.o \
monolib_gtk_minifram.o \
+ monolib_gtk_nonownedwnd.o \
monolib_gtk_pen.o \
monolib_gtk_popupwin.o \
monolib_private.o \
coredll_gtk_font.o \
coredll_gtk_sockgtk.o \
coredll_gtk_minifram.o \
+ coredll_gtk_nonownedwnd.o \
coredll_gtk_pen.o \
coredll_gtk_popupwin.o \
coredll_private.o \
coredll_gtk_font.o \
coredll_gtk_sockgtk.o \
coredll_gtk_minifram.o \
+ coredll_gtk_nonownedwnd.o \
coredll_gtk_pen.o \
coredll_gtk_popupwin.o \
coredll_private.o \
corelib_gtk_font.o \
corelib_gtk_sockgtk.o \
corelib_gtk_minifram.o \
+ corelib_gtk_nonownedwnd.o \
corelib_gtk_pen.o \
corelib_gtk_popupwin.o \
corelib_private.o \
corelib_gtk_font.o \
corelib_gtk_sockgtk.o \
corelib_gtk_minifram.o \
+ corelib_gtk_nonownedwnd.o \
corelib_gtk_pen.o \
corelib_gtk_popupwin.o \
corelib_private.o \
@COND_TOOLKIT_GTK_TOOLKIT_VERSION_2_USE_GUI_1@monodll_gtk_minifram.o: $(srcdir)/src/gtk/minifram.cpp $(MONODLL_ODEP)
@COND_TOOLKIT_GTK_TOOLKIT_VERSION_2_USE_GUI_1@ $(CXXC) -c -o $@ $(MONODLL_CXXFLAGS) $(srcdir)/src/gtk/minifram.cpp
+@COND_TOOLKIT_GTK_TOOLKIT_VERSION_2_USE_GUI_1@monodll_gtk_nonownedwnd.o: $(srcdir)/src/gtk/nonownedwnd.cpp $(MONODLL_ODEP)
+@COND_TOOLKIT_GTK_TOOLKIT_VERSION_2_USE_GUI_1@ $(CXXC) -c -o $@ $(MONODLL_CXXFLAGS) $(srcdir)/src/gtk/nonownedwnd.cpp
+
@COND_TOOLKIT_GTK_TOOLKIT_VERSION_2_USE_GUI_1@monodll_gtk_pen.o: $(srcdir)/src/gtk/pen.cpp $(MONODLL_ODEP)
@COND_TOOLKIT_GTK_TOOLKIT_VERSION_2_USE_GUI_1@ $(CXXC) -c -o $@ $(MONODLL_CXXFLAGS) $(srcdir)/src/gtk/pen.cpp
@COND_TOOLKIT_GTK_TOOLKIT_VERSION_2_USE_GUI_1@monolib_gtk_minifram.o: $(srcdir)/src/gtk/minifram.cpp $(MONOLIB_ODEP)
@COND_TOOLKIT_GTK_TOOLKIT_VERSION_2_USE_GUI_1@ $(CXXC) -c -o $@ $(MONOLIB_CXXFLAGS) $(srcdir)/src/gtk/minifram.cpp
+@COND_TOOLKIT_GTK_TOOLKIT_VERSION_2_USE_GUI_1@monolib_gtk_nonownedwnd.o: $(srcdir)/src/gtk/nonownedwnd.cpp $(MONOLIB_ODEP)
+@COND_TOOLKIT_GTK_TOOLKIT_VERSION_2_USE_GUI_1@ $(CXXC) -c -o $@ $(MONOLIB_CXXFLAGS) $(srcdir)/src/gtk/nonownedwnd.cpp
+
@COND_TOOLKIT_GTK_TOOLKIT_VERSION_2_USE_GUI_1@monolib_gtk_pen.o: $(srcdir)/src/gtk/pen.cpp $(MONOLIB_ODEP)
@COND_TOOLKIT_GTK_TOOLKIT_VERSION_2_USE_GUI_1@ $(CXXC) -c -o $@ $(MONOLIB_CXXFLAGS) $(srcdir)/src/gtk/pen.cpp
@COND_TOOLKIT_GTK_TOOLKIT_VERSION_2_USE_GUI_1@coredll_gtk_minifram.o: $(srcdir)/src/gtk/minifram.cpp $(COREDLL_ODEP)
@COND_TOOLKIT_GTK_TOOLKIT_VERSION_2_USE_GUI_1@ $(CXXC) -c -o $@ $(COREDLL_CXXFLAGS) $(srcdir)/src/gtk/minifram.cpp
+@COND_TOOLKIT_GTK_TOOLKIT_VERSION_2_USE_GUI_1@coredll_gtk_nonownedwnd.o: $(srcdir)/src/gtk/nonownedwnd.cpp $(COREDLL_ODEP)
+@COND_TOOLKIT_GTK_TOOLKIT_VERSION_2_USE_GUI_1@ $(CXXC) -c -o $@ $(COREDLL_CXXFLAGS) $(srcdir)/src/gtk/nonownedwnd.cpp
+
@COND_TOOLKIT_GTK_TOOLKIT_VERSION_2_USE_GUI_1@coredll_gtk_pen.o: $(srcdir)/src/gtk/pen.cpp $(COREDLL_ODEP)
@COND_TOOLKIT_GTK_TOOLKIT_VERSION_2_USE_GUI_1@ $(CXXC) -c -o $@ $(COREDLL_CXXFLAGS) $(srcdir)/src/gtk/pen.cpp
@COND_TOOLKIT_GTK_TOOLKIT_VERSION_2_USE_GUI_1@corelib_gtk_minifram.o: $(srcdir)/src/gtk/minifram.cpp $(CORELIB_ODEP)
@COND_TOOLKIT_GTK_TOOLKIT_VERSION_2_USE_GUI_1@ $(CXXC) -c -o $@ $(CORELIB_CXXFLAGS) $(srcdir)/src/gtk/minifram.cpp
+@COND_TOOLKIT_GTK_TOOLKIT_VERSION_2_USE_GUI_1@corelib_gtk_nonownedwnd.o: $(srcdir)/src/gtk/nonownedwnd.cpp $(CORELIB_ODEP)
+@COND_TOOLKIT_GTK_TOOLKIT_VERSION_2_USE_GUI_1@ $(CXXC) -c -o $@ $(CORELIB_CXXFLAGS) $(srcdir)/src/gtk/nonownedwnd.cpp
+
@COND_TOOLKIT_GTK_TOOLKIT_VERSION_2_USE_GUI_1@corelib_gtk_pen.o: $(srcdir)/src/gtk/pen.cpp $(CORELIB_ODEP)
@COND_TOOLKIT_GTK_TOOLKIT_VERSION_2_USE_GUI_1@ $(CXXC) -c -o $@ $(CORELIB_CXXFLAGS) $(srcdir)/src/gtk/pen.cpp
src/gtk/font.cpp
src/gtk/sockgtk.cpp
src/gtk/minifram.cpp
+ src/gtk/nonownedwnd.cpp
src/gtk/pen.cpp
src/gtk/popupwin.cpp
src/gtk/private.cpp
wx/gtk/font.h
wx/gtk/filehistory.h
wx/gtk/minifram.h
+ wx/gtk/nonownedwnd.h
wx/gtk/pen.h
wx/gtk/popupwin.h
wx/gtk/private/win_gtk.h
--- /dev/null
+///////////////////////////////////////////////////////////////////////////////
+// Name: wx/gtk/nonownedwnd.h
+// Purpose: wxGTK-specific wxNonOwnedWindow declaration.
+// Author: Vadim Zeitlin
+// Created: 2011-10-12
+// RCS-ID: $Id: wxhead.h,v 1.12 2010-04-22 12:44:51 zeitlin Exp $
+// Copyright: (c) 2011 Vadim Zeitlin <vadim@wxwidgets.org>
+// Licence: wxWindows licence
+///////////////////////////////////////////////////////////////////////////////
+
+#ifndef _WX_GTK_NONOWNEDWND_H_
+#define _WX_GTK_NONOWNEDWND_H_
+
+// ----------------------------------------------------------------------------
+// wxNonOwnedWindow contains code common to wx{Popup,TopLevel}Window in wxGTK.
+// ----------------------------------------------------------------------------
+
+class WXDLLIMPEXP_CORE wxNonOwnedWindow : public wxNonOwnedWindowBase
+{
+public:
+ wxNonOwnedWindow() { }
+
+ virtual bool SetShape(const wxRegion& region);
+
+ // Overridden to actually set the shape when the window becomes realized.
+ virtual void GTKHandleRealized();
+
+private:
+ // If valid, defines the custom shape of the window.
+ wxRegion m_shape;
+
+ wxDECLARE_NO_COPY_CLASS(wxNonOwnedWindow);
+};
+
+#endif // _WX_GTK_NONOWNEDWND_H_
virtual bool ShowFullScreen(bool show, long style = wxFULLSCREEN_ALL);
virtual bool IsFullScreen() const { return m_fsIsShowing; };
- virtual bool SetShape(const wxRegion& region);
-
virtual void RequestUserAttention(int flags = wxUSER_ATTENTION_INFO);
virtual void SetWindowStyleFlag( long style );
// size of WM decorations
wxSize m_decorSize;
- // shape of the frame
- wxRegion m_shape;
-
// private gtk_timeout_add result for mimicing wxUSER_ATTENTION_INFO and
// wxUSER_ATTENTION_ERROR difference, -2 for no hint, -1 for ERROR hint, rest for GtkTimeout handle.
int m_urgency_hint;
#if defined(__WXDFB__)
#include "wx/dfb/nonownedwnd.h"
+#elif defined(__WXGTK__)
+ #include "wx/gtk/nonownedwnd.h"
#elif defined(__WXMAC__)
#include "wx/osx/nonownedwnd.h"
#elif defined(__WXMSW__)
#include "wx/msw/nonownedwnd.h"
#else
// No special class needed in other ports, they can derive both wxTLW and
- // wxPopupWindow directly from wxWindow and don't implement SetShape() (at
- // least at this level, wxGTK does do it in wxTLW).
+ // wxPopupWindow directly from wxWindow and don't implement SetShape().
class wxNonOwnedWindow : public wxNonOwnedWindowBase
{
};
--- /dev/null
+///////////////////////////////////////////////////////////////////////////////
+// Name: src/gtk/nonownedwnd.cpp
+// Purpose: wxGTK implementation of wxNonOwnedWindow.
+// Author: Vadim Zeitlin
+// Created: 2011-10-12
+// RCS-ID: $Id: wxhead.cpp,v 1.11 2010-04-22 12:44:51 zeitlin Exp $
+// Copyright: (c) 2011 Vadim Zeitlin <vadim@wxwidgets.org>
+// Licence: wxWindows licence
+///////////////////////////////////////////////////////////////////////////////
+
+// ============================================================================
+// declarations
+// ============================================================================
+
+// ----------------------------------------------------------------------------
+// headers
+// ----------------------------------------------------------------------------
+
+// for compilers that support precompilation, includes "wx.h".
+#include "wx/wxprec.h"
+
+#ifdef __BORLANDC__
+ #pragma hdrstop
+#endif
+
+#ifndef WX_PRECOMP
+ #include "wx/string.h"
+#endif // WX_PRECOMP
+
+#include "wx/gtk/private.h"
+
+#include <gdk/gdk.h>
+
+namespace
+{
+
+// helper
+bool do_shape_combine_region(GdkWindow* window, const wxRegion& region)
+{
+ if (window)
+ {
+ if (region.IsEmpty())
+ {
+ gdk_window_shape_combine_mask(window, NULL, 0, 0);
+ }
+ else
+ {
+ gdk_window_shape_combine_region(window, region.GetRegion(), 0, 0);
+ return true;
+ }
+ }
+ return false;
+}
+
+} // anonymous namespace
+
+
+// ============================================================================
+// wxNonOwnedWindow implementation
+// ============================================================================
+
+void wxNonOwnedWindow::GTKHandleRealized()
+{
+ wxNonOwnedWindowBase::GTKHandleRealized();
+
+ if (HasFlag(wxFRAME_SHAPED))
+ SetShape(m_shape);
+}
+
+bool wxNonOwnedWindow::SetShape(const wxRegion& region)
+{
+ wxCHECK_MSG( HasFlag(wxFRAME_SHAPED), false,
+ wxT("Shaped windows must be created with the wxFRAME_SHAPED style."));
+
+ if ( gtk_widget_get_realized(m_widget) )
+ {
+ if ( m_wxwindow )
+ do_shape_combine_region(gtk_widget_get_window(m_wxwindow), region);
+
+ return do_shape_combine_region(gtk_widget_get_window(m_widget), region);
+ }
+ else // not realized yet
+ {
+ // store the shape to set, it will be really set once we're realized
+ m_shape = region;
+
+ // we don't know if we're going to succeed or fail, be optimistic by
+ // default
+ return true;
+ }
+}
const wxIconBundle& icons = GetIcons();
if (icons.GetIconCount())
SetIcons(icons);
-
- if (HasFlag(wxFRAME_SHAPED))
- SetShape(m_shape); // it will really set the window shape now
}
//-----------------------------------------------------------------------------
}
-// helper
-static bool do_shape_combine_region(GdkWindow* window, const wxRegion& region)
-{
- if (window)
- {
- if (region.IsEmpty())
- {
- gdk_window_shape_combine_mask(window, NULL, 0, 0);
- }
- else
- {
- gdk_window_shape_combine_region(window, region.GetRegion(), 0, 0);
- return true;
- }
- }
- return false;
-}
-
-
-bool wxTopLevelWindowGTK::SetShape(const wxRegion& region)
-{
- wxCHECK_MSG( HasFlag(wxFRAME_SHAPED), false,
- wxT("Shaped windows must be created with the wxFRAME_SHAPED style."));
-
- if ( gtk_widget_get_realized(m_widget) )
- {
- if ( m_wxwindow )
- do_shape_combine_region(gtk_widget_get_window(m_wxwindow), region);
-
- return do_shape_combine_region(gtk_widget_get_window(m_widget), region);
- }
- else // not realized yet
- {
- // store the shape to set, it will be really set once we're realized
- m_shape = region;
-
- // we don't know if we're going to succeed or fail, be optimistic by
- // default
- return true;
- }
-}
-
bool wxTopLevelWindowGTK::IsActive()
{
return (this == (wxTopLevelWindowGTK*)g_activeFrame);