Audacity 3.2.0
Public Member Functions | Static Private Member Functions | Private Attributes | List of all members
internal::x11::SocketWindow Class Reference

Wrapper for GtkSocket object, which provides X window mapping via XEmbed protocol. More...

#include <SocketWindow.h>

Inheritance diagram for internal::x11::SocketWindow:
[legend]
Collaboration diagram for internal::x11::SocketWindow:
[legend]

Public Member Functions

 SocketWindow (wxWindow *parent, wxWindowID winid, Steinberg::IPlugView *plugView)
 

Static Private Member Functions

static void OnMap (GtkWidget *widget, gpointer data)
 

Private Attributes

Steinberg::IPtr< Steinberg::IPlugView > mPlugView
 

Detailed Description

Wrapper for GtkSocket object, which provides X window mapping via XEmbed protocol.

Definition at line 33 of file SocketWindow.h.

Constructor & Destructor Documentation

◆ SocketWindow()

SocketWindow::SocketWindow ( wxWindow *  parent,
wxWindowID  winid,
Steinberg::IPlugView *  plugView 
)

Definition at line 52 of file SocketWindow.cpp.

53 : wxNativeWindow(parent, winid, gtk_socket_new()), mPlugView(plugView)
54{
55#ifdef __WXGTK3__
56 g_signal_connect(G_OBJECT(GetHandle()), "map", G_CALLBACK(&SocketWindow::OnMap), this);
57#else
58 gtk_signal_connect(GTK_OBJECT(GetHandle()), "map", G_CALLBACK(&SocketWindow::OnMap), this);
59#endif
60}
Steinberg::IPtr< Steinberg::IPlugView > mPlugView
Definition: SocketWindow.h:35
static void OnMap(GtkWidget *widget, gpointer data)

References OnMap().

Here is the call graph for this function:

Member Function Documentation

◆ OnMap()

void SocketWindow::OnMap ( GtkWidget *  widget,
gpointer  data 
)
staticprivate

Definition at line 28 of file SocketWindow.cpp.

29{
30 using namespace Steinberg;
31
32 auto self = reinterpret_cast<SocketWindow*>(data);
33
34 static auto runLoop = [&]() {
35 auto display = GDK_WINDOW_XDISPLAY(gtk_widget_get_window(widget));
36 return owned(safenew RunLoop(display));
37 }();
38
39 auto frame = owned(safenew PlugFrame(runLoop.get(), self->GetParent()));
40 if(self->mPlugView->setFrame(frame) == Steinberg::kResultOk)
41 {
42 self->mPlugView->attached(
43 (void*)gtk_socket_get_id(GTK_SOCKET(widget)),
44 Steinberg::kPlatformTypeX11EmbedWindowID
45 );
46 ViewRect initialSize;
47 if(self->mPlugView->getSize(&initialSize) == kResultOk)
48 frame->init(self->mPlugView.get(), &initialSize);
49 }
50}
#define safenew
Definition: MemoryX.h:10
Wrapper for GtkSocket object, which provides X window mapping via XEmbed protocol.
Definition: SocketWindow.h:34

References safenew.

Referenced by SocketWindow().

Here is the caller graph for this function:

Member Data Documentation

◆ mPlugView

Steinberg::IPtr<Steinberg::IPlugView> internal::x11::SocketWindow::mPlugView
private

Definition at line 35 of file SocketWindow.h.


The documentation for this class was generated from the following files: