gtkIOStream  1.7.0
GTK+ << C++ IOStream operators for GTK+. Now with ORBing, numerical computation, audio client and more ...
JackPortMonitorGui.C
Go to the documentation of this file.
1 /* Copyright 2000-2018 Matt Flax <flatmax@flatmax.org>
2  This file is part of GTK+ IOStream class set
3 
4  GTK+ IOStream is free software; you can redistribute it and/or modify
5  it under the terms of the GNU General Public License as published by
6  the Free Software Foundation; either version 2 of the License, or
7  (at your option) any later version.
8 
9  GTK+ IOStream is distributed in the hope that it will be useful,
10  but WITHOUT ANY WARRANTY; without even the implied warranty of
11  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  GNU General Public License for more details.
13 
14  You have received a copy of the GNU General Public License
15  along with GTK+ IOStream
16  */
17 #include "JackPortMonitorGui.H"
18 #include "DragNDrop.H"
19 
21  *this<<BoxIS(true, true, true)<<portVBox.show();
22  show();
23 }
24 
26  init();
27 }
28 
29 ClientIOGui::ClientIOGui(string clientName_) {
30  renameClient(clientName_);
31  init();
32 }
33 
34 void ClientIOGui::renameClient(string clientName_) {
35  while (clientNameButton.getCount())
36  *this>>clientNameButton.remove();
37  clientNameButton<<BUTTONLABELSTRUCT(clientName_, NULL, NULL); // create a button which is the client name
38  *this<<clientNameButton; // Add the button and the port verticall box to the HBox
39 }
40 
41 void ClientIOGui::setPorts(vector<string> &portNames) {
42  vector<string>::iterator p; // this will be the knownClient if it already exists
43  for (p=portNames.begin(); p!=portNames.end(); ++p) {
44  portButtons<<BUTTONLABELSTRUCT(p->c_str(), reinterpret_cast<GCallback>(NULL), NULL); // add a new button.
45  portVBox<<BoxIS(true, false, true)<<portButtons.current(); // add the new button to the vertical box.
46  }
47 }
48 
49 void ClientIOGui::setPorts(map<string, map<string, vector<string> > > &portNames) {
50  map<string, map<string, vector<string> > >::iterator p; // this will be the knownClient if it already exists
51  for (p=portNames.begin(); p!=portNames.end(); ++p) { // the port names are the keys to the primary map
52  portButtons<<BUTTONLABELSTRUCT(p->first.c_str(), reinterpret_cast<GCallback>(NULL), NULL); // add a new button.
53  portVBox<<BoxIS(true, false, true)<<portButtons.current(); // add the new button to the vertical box.
54  }
55 }
56 
58  *this>>Widget(clientNameButton.grab(1)).ref()>>portVBox.ref(); // make sure the widgets don't dissappear.
59  *this<<BoxIS(true, true, true)<<clientNameButton.grab(1)<<portVBox;
60  Widget(clientNameButton.grab(1)).unref(); // ensure they can be garbage collected by decrementing their reference.
61  portVBox.unref();
62 }
63 
64 string ClientIOGui::getFullPortName(GtkWidget *wid){
65  string ret;
66  int index;
67  if ((index=portButtons.findIndex(wid))==0) // if not found. Indicate an error
68  return ret;
69  portButtons.grab(index);
70  ret+=getClientName()+":"+portButtons.getLabel();
71  return ret;
72 }
73 
75  inputWidgetConnections=map<GtkWidget*, vector<GtkWidget*> >();
76 }
77 
78 void ClientIOGui::addWidgetConnections(GtkWidget *wid, GtkWidget*cWid) {
79  // if cWid isn't already known, then add it to the list.
80  if (find(inputWidgetConnections[wid].begin(), inputWidgetConnections[wid].end(), cWid)==inputWidgetConnections[wid].end())
81  inputWidgetConnections[wid].push_back(cWid);
82  //cout<<inputWidgetConnections[wid].size()<<endl;
83 }
84 
85 GtkWidget* ClientIOGui::getPortWidget(string portName) {
86  GtkWidget *ret=NULL;
87  for (int i=0; i<portButtons.getCount(); i++)
88  if (portName==portButtons.getLabel()) // If the current port button is the one we are after, then return it
89  ret=portButtons.current();
90  else // if not the one we are after, then try the next
91  portButtons.next();
92  return ret;
93 }
94 
96  dnd<<*this; // tell dnd that this class is the user data for DND callbacks (in the case of dragging)
97  Widget(clientNameButton.current())>>dnd; // Tell the client button that it will be dragged around
98  for (int i=0; i<portButtons.getCount(); i++) // tell each of the port buttons that they will be dragged around
99  Widget(portButtons.next())>>dnd;
100 }
101 
103  Widget(clientNameButton.current())<<dnd; // Tell the client button that it will be dragged to
104  for (int i=0; i<portButtons.getCount(); i++) // tell each of the port buttons that they will be dragged to
105  Widget(portButtons.next())<<dnd;
106 }
107 
108 string ClientIOGui::getWidgetsPortName(GtkWidget *wid){
109  string dragClientPortInfo;
110  dragClientPortInfo=getClientName(); // start with the client name
111  if (wid!=clientNameButton.current()){ // if it isn't the client widget, the find the actual port
112  dragClientPortInfo+=':'; // append the port name after a semicolon delimiter
113  int index;
114  if ((index=portButtons.findIndex(wid))==0) // if not found. Indicate an error
115  dragClientPortInfo=""; // use the empty string to indicate an error.
116  else {
117  portButtons.grab(index);
118  dragClientPortInfo+=portButtons.getLabel(); // append the port name to indicate the complete client:port string to pass when dropped.
119  }
120  }
121  return dragClientPortInfo;
122 }
123 
124 void ClientIOGui::dragDataGet(GtkWidget *w, GtkSelectionData *selectionData, guint info) {
125  // For this widget which has been dragged from here, find its client name and if it isn't the client button then the port name as well.
126  //cout<<"ClientIOGui::dragDataGet"<<endl;
127  string dragClientPortInfo=getWidgetsPortName(w);
128  gtk_selection_data_set(selectionData, gtk_selection_data_get_target(selectionData), sizeof(char), (unsigned char*)dragClientPortInfo.c_str(), dragClientPortInfo.length());
129 }
130 
132  inputPortGui.renameClient(getClientName());
133  outputPortGui.renameClient(getClientName());
134  outputPortGui.reverseHBoxStacking(); // show the client name on the right. This makes ports face each other
135 
136  // work through each client and the known ports ensuring the Gui elements are present.
137  inputPortGui.setPorts(inputPortNamesAndConnections);
138  outputPortGui.setPorts(outputPortNames);
139 }
140 
141 bool JackBaseWithPortNamesGui::dragDataReceived(GtkWidget *w, GtkWidget *sourceWidget, int info, const unsigned char *selectionStoredData, int length) {
142  //cout<<"JackBaseWithPortNamesGui::dragDataReceived"<<endl;
143  string inputData((const char*)selectionStoredData);
144  // if the client button is dropped on by an input client, attempt to connect all client ports together.
145  // if the client button is dropped on by an input port, connect the port to all of this client's ports.
146  if (info==JackPortMonitorGui::CONNECT_PORTS) // connecting ports
147  if (w==inputPortGui.getClientWidget()) // if the dropped to widget is the client, then attempt to connect all client ports together
148  connectPorts(inputPortGui.getClientName(), inputData); // connect as many ports as possible from the input client to the output client's ports
149  else
150  connectPorts(inputPortGui.getFullPortName(w), inputData); // connect as many ports as possible from the input client to the output client's ports
151  if (info==JackPortMonitorGui::DISCONNECT_PORTS) // disconnecting ports
152  if (w==outputPortGui.getClientWidget()) // if the dropped to widget is the client, then attempt to disconnect all client ports
153  disconnectPorts(outputPortGui.getClientName(), inputData); // disconnect as many ports as possible from the input client to the output client's ports
154  else
155  disconnectPorts(outputPortGui.getFullPortName(w), inputData); // disconnect as many ports as possible from the input client to the output client's ports
156 
157  if (info==JackPortMonitorGui::CONNECT_PORTS || info==JackPortMonitorGui::DISCONNECT_PORTS) // either connecting nor disconnecting, all ok.
158  return true;
159 
160  JackDebug().evaluateError(JACK_UNKNOWN_DND_TYPE_ERROR, "JackBaseWithPortNamesGui::dragDataReceived : unknown drop request, neither connecting nor disconnecting : bad GtkTargetEntry value");
161  return false;
162 }
163 
164 int JackBaseWithPortNamesGui::chooseTheTargetToUse(GtkWidget *w, GtkWidget *sourceWidget, DragNDrop &dnd){
165  // find out whether the target widget (w) is in the inputs (returning CONNECT_PORTS) or outputs (returning DISCONNECT_PORTS).
166  if (inputPortGui.getWidgetsPortName(w)!="") // if the widget belongs to the input ports, then the port name isn't empty.
167  return JackPortMonitorGui::CONNECT_PORTS; // indicate that the ports are connecting, as the destination widget was found in the input ports.
168  if (outputPortGui.getWidgetsPortName(w)!="") // if the widget belongs to the output ports, then the port name isn't empty.
169  return JackPortMonitorGui::DISCONNECT_PORTS; // indicate that the ports are disconnecting, as the destination widget was found in the output ports.
170 
171  return JACK_DRAG_OPTION_UNKNOWN_ERROR; // return the error when the widget can't be found
172 }
173 
174 void ConnectionSurface::drawConnections(const map<GtkWidget*, vector<GtkWidget*> > &connections) {
175  //cout<<"ConnectionSurface::drawConnections"<<endl;
176  cairo_t *cr=cairo_create(getSurface()); // get the cairo context to draw to
177  cairo_set_source_rgb(cr, 1.,1.,1.); // set the cairo colour to draw with
178  float width=1.5; // the line width
179  cairo_set_line_width(cr, width);
180  bool closed=true, filled=false; // whether to draw the arrow heads closed and filled.
181  map<GtkWidget*, vector<GtkWidget*> >::const_iterator wids;
182  for (wids=connections.begin(); wids!=connections.end(); ++wids) { // for each input port widget, draw an arrow to the output port widgets
183  GtkWidget *inWid=(*wids).first;
184  int inX, inY, inW, inH; // the input port widget's location and size
185  Widget iWid(inWid);
186  iWid.getLocationSize(inX, inY, inW, inH);
187 
188  vector<GtkWidget*>::const_iterator oWids;
189  for (oWids=(*wids).second.begin(); oWids!=(*wids).second.end(); ++oWids) { // for each output port widget, draw an arrow from the input port to this widget
190  int outX, outY, outW, outH; // the output port widget's location and size
191  Widget((GtkWidget*)(*oWids)).getLocationSize(outX, outY, outW, outH);
192 
193  int surfaceW, surfaceH;
194  getSize(surfaceW, surfaceH);
195  //cout<<"drawing from : "<<inX<<','<<inY<<" to "<<outX<<','<<outY<<endl;
196  //cout<<"surface w, h "<<surfaceW<<'\t'<<surfaceH<<endl;
197  CairoArrow().draw(cr, 0, outY+outH/2, surfaceW, inY+inH/2, .08, width, closed, filled);
198  }
199  }
200 
201  // destroy the cairo context and redraw the widget
202  cairo_destroy(cr);
203  //gtk_widget_queue_draw(getWidget());
204 }
205 
207  if (knownClients.size()>0) { // remove any known clients.
208  for (int i=0; i<knownClients.size(); i++)
209  delete knownClients[i];
210  knownClients.resize(0);
211  }
212 
213  Buttons controlButtons;
214 
215 
216  *this<<BoxIS(true, true, true)
217  <<(VBox()<<BoxIS(true, true, true)
218  <<(HBox()<<BoxIS(true, true, true)<<(Frame("Readers")<<outputPortBox.show()).show() // show the input ports
219  <<BoxIS(true, true, true)<<connectionSurface // show the connection surface
220  <<BoxIS(true, true, false)<<(Frame("Writers")<<inputPortBox.show()).show() // show the output ports
221  ).show()
222  <<BoxIS(true, false, false)
223  <<(HBox()<<
224  (controlButtons<<BUTTONCHECKSTRUCT("Connect 1 to 1", reinterpret_cast<GCallback>(connect1To1Static), this)
225  <<BUTTONCHECKSTRUCT("Autoconnect net clients", reinterpret_cast<GCallback>(autoConnectNetClientsPortsStatic), this))
226  ).show()
227  ).show();
228  reSyncPorts();
229  reSyncConnections();
230 
231  connectExposeEventCallback(reinterpret_cast<GCallback>(exposeEventStatic), this);
232  connectConfigureEventCallback(connectionSurface.getWidget(), reinterpret_cast<GCallback>(reDrawConnectionsStatic), this);
233 
234  controlButtons.grab(1); // the first button is the connect1To1 button, the second is the net autoconnect
235  controlButtons.setActive(connect1To1); // sync the check box to the state of the connection mode
236  controlButtons.next(); // the second is the net autoconnect
237  controlButtons.setActive(autoConnectNetClients); // sync the check box to the state of the autoconnect flag
238 }
239 
240 void JackPortMonitorGui::jackPortConnected(jack_port_id_t a, jack_port_id_t b, int connect) {
241  gdk_threads_enter();
242  JackPortMonitor::jackPortConnected(a, b, connect);
243  gdk_threads_leave();
244 }
245 
246 void JackPortMonitorGui::jackPortRegistered(jack_port_id_t port, int reg) {
247  gdk_threads_enter();
249  gdk_threads_leave();
250 }
251 
252 void JackPortMonitorGui::jackPortRenamed(jack_port_id_t port, const char *oldName, const char *newName) {
253  gdk_threads_enter();
254  JackPortMonitor::jackPortRenamed(port, oldName, newName);
255  gdk_threads_leave();
256 }
257 
259  //cout<<"JackBaseWithPortNamesGui::reSyncPorts"<<endl;
260  for (typename vector<JackBaseWithPortNames*>::iterator kc=knownClients.begin(); kc!=knownClients.end(); ++kc) {
261  inputPortBox>>static_cast<HBox>(dynamic_cast<JackBaseWithPortNamesGui*>(*kc)->inputPortGui).getWidget();
262  outputPortBox>>static_cast<HBox>(dynamic_cast<JackBaseWithPortNamesGui*>(*kc)->outputPortGui).getWidget();
263  }
264 
266 
267  // go through each of the known clients and replace them with their Gui counterparts.
268  for (typename vector<JackBaseWithPortNames*>::iterator kc=knownClients.begin(); kc!=knownClients.end(); ++kc) {
269  JackBaseWithPortNames *oldJB=*kc;
270  //cout<<"original ports "<<*oldJB<<endl;
271  *kc=new JackBaseWithPortNamesGui; // TODO : check that there aren't any memory allocation issues here.
272  *(*kc)=*oldJB;
273  delete oldJB;
274  //cout<<"new ports "<<*kc<<endl;
275  }
276 
277  DragNDrop dnd; // Setup the drag and drop feature
278  dnd<<(GtkTargetEntry){(char*)"CONNECT", 0, CONNECT_PORTS}<<(GtkTargetEntry){(char*)"DISCONNECT", 0, DISCONNECT_PORTS}; // setup a data type for the dnd system
279  for (typename vector<JackBaseWithPortNames*>::iterator kc=knownClients.begin(); kc!=knownClients.end(); ++kc) {
280  dynamic_cast<JackBaseWithPortNamesGui*>(*kc)->reSyncPortGui();
281  // ensure the client is shown in both half duplex modes.
282  inputPortBox<<BoxIS(true,true,true)<<static_cast<HBox>(dynamic_cast<JackBaseWithPortNamesGui*>(*kc)->inputPortGui).show();
283  outputPortBox<<BoxIS(true,true,true)<<static_cast<HBox>(dynamic_cast<JackBaseWithPortNamesGui*>(*kc)->outputPortGui).show();
284 
285  // connect the drag and drop feature for making connections - drags from inputs to outputs
286  dynamic_cast<JackBaseWithPortNamesGui*>(*kc)->inputPortGui.setupDrag(dnd); // input widgets will be dragged around - this one for making connections
287  dnd<<*dynamic_cast<JackBaseWithPortNamesGui*>(*kc); // tell dnd that this class is the user data for DND callbacks (in the case of dropping)
288  dynamic_cast<JackBaseWithPortNamesGui*>(*kc)->outputPortGui.setupDrop(dnd); // output widgets will be dropped onto - this one for making connections
289 
290  // connect the drag and drop feature for disconnections - drags from outputs to inputs
291  dynamic_cast<JackBaseWithPortNamesGui*>(*kc)->outputPortGui.setupDrag(dnd); // output widgets will be dragged around - this one for disconnecting
292  dnd<<*dynamic_cast<JackBaseWithPortNamesGui*>(*kc); // tell dnd that this class is the user data for DND callbacks (in the case of dropping)
293  dynamic_cast<JackBaseWithPortNamesGui*>(*kc)->inputPortGui.setupDrop(dnd); // input widgets will be dropped onto - this one for disconnecting
294  }
295 }
296 
298  //cout<<"JackPortMonitorGui::reSyncConnections"<<endl;
299  JackPortMonitor::reSyncConnections(); // resync the list of input port connections
300 
301  // fill the list of widget connections
302  typename vector<JackBaseWithPortNames *>::iterator kc;
303  for (kc=knownClients.begin(); kc!=knownClients.end(); ++kc) { // go through the connections for each known client
304  dynamic_cast<JackBaseWithPortNamesGui*>(*kc)->inputPortGui.clearAllWidgetConnections(); // make sure we can rebuild the list of widget connections from scratch
305  map<string, map<string, vector<string> > >::iterator ipnac; // Iterate through each of the known input ports for this client
306  for (ipnac=(*kc)->inputPortNamesAndConnections.begin(); ipnac!=(*kc)->inputPortNamesAndConnections.end(); ++ipnac) {
307  string portName=(*ipnac).first;
308  GtkWidget *ip=dynamic_cast<JackBaseWithPortNamesGui*>(*kc)->inputPortGui.getPortWidget(portName);
309  if (ip) {
310  map<string, vector<string> >::iterator connectedClientsPorts; // Iterate through each of the known connected ports for this clients port
311  for (connectedClientsPorts=(*ipnac).second.begin(); connectedClientsPorts!=(*ipnac).second.end(); ++connectedClientsPorts) {
312  CompareStrings cs((*connectedClientsPorts).first); // get the client name and create a functor which can compare a client pointer's client name to a client name string
313  typename vector<JackBaseWithPortNames *>::iterator cc=find_if(knownClients.begin(), knownClients.end(), cs);
314  if (cc!=knownClients.end()) { // if we have found the client, then add each of the connected the port's widgets to the list
315  vector<string>::iterator connectedPorts;
316  for (connectedPorts=(*connectedClientsPorts).second.begin(); connectedPorts!=(*connectedClientsPorts).second.end(); ++connectedPorts) {
317  GtkWidget *op=dynamic_cast<JackBaseWithPortNamesGui*>(*cc)->outputPortGui.getPortWidget(*connectedPorts); // find the output port widget which matches the port
318  if (op) {// If we have successfully located the corresponding output port widget, then add it to the list
319  //cout<<"port ... "<<(*kc)->getClientName()<<":"<<portName<<" connected client "<<cs.cn<<" port found "<<*connectedPorts<<endl;
320  dynamic_cast<JackBaseWithPortNamesGui*>(*kc)->inputPortGui.addWidgetConnections(ip, op); // get the connected widgets for this connection
321  //cout<<(*kc)->inputPortGui.getWidgetConnections(ip).size()<<endl;
322  } else // if we couldn't find the corresponding port widget, print the error.
323  JackDebug().evaluateError(JACK_PORTNAME_NOTFOUND_ERROR, string("port ... ")+(*kc)->getClientName()+":"+portName+" connected client "+cs.cn+" couldn't find the port "+*connectedPorts);
324  }
325  } else
326  JackDebug().evaluateError(JACK_PORTNAME_NOTFOUND_ERROR, string("port ... ")+(*kc)->getClientName()+":"+portName+" couldn't find the connected client "+cs.cn);
327  }
328 
329  } else
330  JackDebug().evaluateError(JACK_PORTNAME_NOTFOUND_ERROR, string("JackPortMonitorGui::reSyncConnections port ")+portName+" not found");
331  }
332  }
333  reDrawConnections();
334 }
335 
337  //cout<<"JackPortMonitorGui::reDrawConnections : knowclient count = "<<knownClients.size()<<endl;
338  // Draw connections to the connectionSurface
339  connectionSurface.clear();
340  typename vector<JackBaseWithPortNames *>::iterator kc;
341  for (kc=knownClients.begin(); kc!=knownClients.end(); ++kc) // go through the connections for each known client
342  connectionSurface.drawConnections(dynamic_cast<JackBaseWithPortNamesGui*>(*kc)->inputPortGui.getInputWidgetConn());
343  gtk_widget_queue_draw(connectionSurface.getWidget());
344 }
345 
347  init();
348 }
349 
350 JackPortMonitorGui::JackPortMonitorGui(bool monitorPorts) : JackPortMonitor(monitorPorts) {
351  init();
352 }
353 
354 JackPortMonitorGui::JackPortMonitorGui(bool monitorPorts, bool autoConnectNetClientsIn) : JackPortMonitor(monitorPorts, autoConnectNetClientsIn) {
355  init();
356 }
357 
358 JackPortMonitorGui::JackPortMonitorGui(string clientName_) : JackPortMonitor(clientName_) {
359  init();
360 }
361 
362 JackPortMonitorGui::JackPortMonitorGui(string clientName_, bool monitorPorts) : JackPortMonitor(clientName_, monitorPorts) {
363  init();
364 }
365 
366 JackPortMonitorGui::JackPortMonitorGui(string clientName_, bool monitorPorts, bool autoConnectNetClientsIn) : JackPortMonitor(clientName_, monitorPorts, autoConnectNetClientsIn) {
367  init();
368 }
369 
370 JackPortMonitorGui::JackPortMonitorGui(string clientName_, string serverName) : JackPortMonitor(clientName_, serverName) {
371  init();
372 }
373 
374 JackPortMonitorGui::JackPortMonitorGui(string clientName_, string serverName, bool monitorPorts) : JackPortMonitor(clientName_, serverName, monitorPorts) {
375  init();
376 }
377 
378 JackPortMonitorGui::JackPortMonitorGui(string clientName_, string serverName, bool monitorPorts, bool autoConnectNetClientsIn) : JackPortMonitor(clientName_, serverName, monitorPorts, autoConnectNetClientsIn) {
379  init();
380 }
virtual void jackPortRenamed(jack_port_id_t port, const char *oldName, const char *newName)
GtkWidget * getPortWidget(string portName)
int findIndex(GtkWidget *widget)
Definition: Buttons.H:461
ClientIOGui outputPortGui
The output port gui.
const gchar * getLabel()
Definition: Buttons.H:453
#define JACK_UNKNOWN_DND_TYPE_ERROR
error when a GUI drop signals neither CONNECT_PORTS nor DISCONNECT_PORTS
Definition: JackBase.H:53
#define BUTTONCHECKSTRUCT(s, f, d)
Definition: Buttons.H:165
void setupDrop(DragNDrop &dnd)
void renameClient(string clientName_)
void setPorts(vector< string > &portNames)
Definition: Box.H:351
virtual int evaluateError(int errorNum)
Definition: Debug.H:132
virtual void reSyncPorts(void)
void draw(cairo_t *cr, float xBase, float yBase, float xPoint, float yPoint, float headToLengthRatio, float width, bool closed, bool filled)
Definition: CairoArrow.H:105
Buttons clientNameButton
Button representing all of the half duplex client ports.
void clearAllWidgetConnections(void)
#define BUTTONLABELSTRUCT(s, f, d)
Definition: Buttons.H:73
float p
virtual void jackPortConnected(jack_port_id_t a, jack_port_id_t b, int connect)
HBox()
Definition: Box.H:370
string cn
The string to compare against.
void connectConfigureEventCallback(GCallback callback, void *data)
Definition: Widget.H:270
static void setActive(GtkWidget *wid, bool state)
Definition: Buttons.H:495
void addWidgetConnections(GtkWidget *wid, GtkWidget *cWid)
string getClientName(void)
void connectExposeEventCallback(GCallback callback, void *data)
Definition: Widget.H:245
Definition: Box.H:366
void reverseHBoxStacking()
ClientIOGui inputPortGui
The input port gui.
virtual int chooseTheTargetToUse(GtkWidget *w, GtkWidget *sourceWidget, DragNDrop &dnd)
void setupDrag(DragNDrop &dnd)
virtual void reSyncConnections(void)
void getSize(int &width, int &height)
Definition: Widget.H:113
#define JACK_PORTNAME_NOTFOUND_ERROR
error when the port name is not found
Definition: JackBase.H:50
GtkWidget * show(void)
Definition: Widget.H:65
Buttons portButtons
The clients half duplex ports. either input or output.
virtual void dragDataGet(GtkWidget *w, GtkSelectionData *selectionData, guint info)
map< GtkWidget *, vector< GtkWidget * > > inputWidgetConnections
Each of the port buttons map to connected port buttons.
string getWidgetsPortName(GtkWidget *wid)
virtual void jackPortRegistered(jack_port_id_t port, int reg)
void drawConnections(const map< GtkWidget *, vector< GtkWidget *> > &connections)
virtual void reSyncPorts(void)
virtual void reSyncConnections(void)
virtual void jackPortRegistered(jack_port_id_t port, int reg)
VBox portVBox
A holder for the port buttons.
GtkWidget * getWidget(void)
Definition: Widget.H:91
string getFullPortName(GtkWidget *wid)
virtual void jackPortConnected(jack_port_id_t a, jack_port_id_t b, int connect)
GtkWidget * ref(void)
Definition: Widget.H:51
Definition: Widget.H:31
virtual bool dragDataReceived(GtkWidget *w, GtkWidget *sourceWidget, int info, const unsigned char *selectionStoredData, int length)
Definition: Frame.H:27
BoxIS(void)
Definition: Box.H:63
#define JACK_DRAG_OPTION_UNKNOWN_ERROR
error when the the drag and drop drops to a widget which can&#39;t be found
Definition: JackBase.H:51
Widget()
Construcotr.
Definition: Widget.H:36
Class to setup buttons whic are either text, image or toggle types. Buttons are defined in terms of t...
Definition: Buttons.H:184
void getLocationSize(int &x, int &y, int &width, int &height)
Definition: Widget.H:142
void unref(void)
Definition: Widget.H:58
void connect(const char *event, GCallback callback, gpointer data)
Definition: Widget.H:224
virtual void jackPortRenamed(jack_port_id_t port, const char *oldName, const char *newName)
gtkIOStream: /tmp/gtkiostream/src/JackPortMonitorGui.C Source File
GTK+ IOStream  Beta