]>
git.saurik.com Git - wxWidgets.git/blob - include/wx/x11/reparent.h
1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: Reparenting classes
4 // Author: Julian Smart
8 // Copyright: (c) Julian Smart
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
12 #ifndef _WX_REPARENT_H_
13 #define _WX_REPARENT_H_
15 #if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
16 #pragma interface "reparent.h"
19 #include "wx/window.h"
22 * This class helps to reparent a specific window
25 class wxAdoptedWindow
;
26 class wxReparenter
: public wxObject
31 // We assume that toReparent has had its X window set
32 // appropriately. toReparent is typically a wxAdoptedWindow.
33 bool Reparent(wxWindow
* newParent
, wxAdoptedWindow
* toReparent
);
35 // Wait for an appropriate window to be created.
36 // If exactMatch is FALSE, a substring match is OK.
37 // If windowName is empty, then wait for the next overrideRedirect window.
38 bool WaitAndReparent(wxWindow
* newParent
, wxAdoptedWindow
* toReparent
,
39 const wxString
& windowName
= wxEmptyString
,
40 bool exactMatch
= TRUE
);
44 bool ProcessXEvent(WXEvent
* event
);
45 WXWindow
FindAClientWindow(WXWindow window
, const wxString
& name
);
48 static wxAdoptedWindow
* sm_toReparent
;
49 static wxWindow
* sm_newParent
;
50 static wxString sm_name
;
51 static bool sm_exactMatch
;
55 * A window that adopts its handle from the native
56 * toolkit. It has no parent until reparented.
59 class wxAdoptedWindow
: public wxWindow
63 wxAdoptedWindow(WXWindow window
);
66 void SetHandle(WXWindow window
) { m_mainWindow
= window
; m_clientWindow
= window
; }
67 WXWindow
GetHandle() const { return GetMainWindow(); }