Control: tags -1 patch

One solution is renaming the Window class.
I have attached a patch for your convenience.
diff -u aconnectgui-0.9.0rc2-1/src/Connection.cxx aconnectgui-0.9.0rc2-1/src/Connection.cxx
--- aconnectgui-0.9.0rc2-1/src/Connection.cxx
+++ aconnectgui-0.9.0rc2-1/src/Connection.cxx
@@ -25,7 +25,7 @@
 
 int Connection::handle(int e)
 {
-	Window* window = (Window*) parent()->parent();
+	ACGWindow* window = (ACGWindow*) parent()->parent();
 	
 	if (e==FL_PUSH) {
 		if (window->IsDisconnecting()) {
diff -u aconnectgui-0.9.0rc2-1/src/Window.cxx aconnectgui-0.9.0rc2-1/src/Window.cxx
--- aconnectgui-0.9.0rc2-1/src/Window.cxx
+++ aconnectgui-0.9.0rc2-1/src/Window.cxx
@@ -16,7 +16,7 @@
 
 int aconnect_main(int argc,char** argv);
 
-void Window::Connect(int client,int port,int clientB,int portB)
+void ACGWindow::Connect(int client,int port,int clientB,int portB)
 {
 	Connector *a = 0,*b = 0;
 	
@@ -29,7 +29,7 @@
 	}
 }		
 
-void Window::Disconnect(
+void ACGWindow::Disconnect(
 int fromClientId,int fromPortId,int toClientId,int toPortId)
 {
 Connection* c = mConnections->Find(
@@ -45,7 +45,7 @@
 	}
 }
 
-void Window::Disconnect(Connection* c)
+void ACGWindow::Disconnect(Connection* c)
 {
 	mConnections->remove(c);
 	mConnections->redraw();
@@ -58,7 +58,7 @@
 	mConnections->redraw();
 }
 
-void Window::Connect(Connector* a,Connector* b)
+void ACGWindow::Connect(Connector* a,Connector* b)
 {
 	a->Unselect();
 	b->Unselect();
@@ -80,12 +80,12 @@
 	mConnections->Unclutter();
 }
 
-int Window::IsLegal(Connector* a,Connector* b)
+int ACGWindow::IsLegal(Connector* a,Connector* b)
 {
 	return a->Type()!=b->Type();
 }
 
-Client* Window::AddClient(snd_seq_client_info_t* cinfo)
+Client* ACGWindow::AddClient(snd_seq_client_info_t* cinfo)
 {
 	// some of this code should be in Window
 	Client* c= mClients->FindClient(snd_seq_client_info_get_client(cinfo));
@@ -107,7 +107,7 @@
 	}
 	return mCurClient;
 }
-Port* Window::AddPort(snd_seq_port_info_t* pinfo)
+Port* ACGWindow::AddPort(snd_seq_port_info_t* pinfo)
 {
 	// some of this code should be in Window
 	int dy = mCurClient->y()+mCurClient->h();
@@ -129,7 +129,7 @@
 	return mCurPort;
 }
 
-bool Window::HandleConnect(Connector* a,Connector* b)
+bool ACGWindow::HandleConnect(Connector* a,Connector* b)
 {
 	int argc;
 	char* argv[16];
@@ -147,7 +147,7 @@
 	return (aconnect_main(argc,argv)==0);
 }
 
-bool Window::HandleDisconnect(Connection* c)
+bool ACGWindow::HandleDisconnect(Connection* c)
 {
 	int argc;
 	char* argv[16];
@@ -169,7 +169,7 @@
 	return (aconnect_main(argc,argv)==0);
 }
 
-Window::Window():Fl_Window(300,33,"ALSA Sequencer")
+ACGWindow::ACGWindow():Fl_Window(300,33,"ALSA Sequencer")
 {
 	mClients = new Clients(0,33,140,0);
 	mConnections = new Connections(140,33,160,0);
@@ -253,13 +253,13 @@
 	snd_seq_nonblock(mHandle, 1);
 }
 
-Window::~Window()
+ACGWindow::~ACGWindow()
 {
 	snd_seq_close(mHandle);
 }
 
 
-void Window::Timeout(void)
+void ACGWindow::Timeout(void)
 {
 	int count;
 	snd_seq_event_t *ev;
@@ -347,10 +347,10 @@
 		}
 	} while (ev);
 
-	Fl::add_timeout(0.1,Window::TimeoutStatic,this);
+	Fl::add_timeout(0.1,ACGWindow::TimeoutStatic,this);
 }
 
-Window* patchbay = 0;
+ACGWindow* patchbay = 0;
 
 int main()
 {
@@ -359,7 +359,7 @@
 	
 	Fl::get_system_colors();
 	
-	patchbay = new Window;
+	patchbay = new ACGWindow;
 
 	/* NB the concept of input of aconnect and the  classes is reverse...
 	*/
@@ -380,7 +380,7 @@
 
 	patchbay->show();
 
-	Fl::add_timeout(0.1,Window::TimeoutStatic,patchbay);
+	Fl::add_timeout(0.1,ACGWindow::TimeoutStatic,patchbay);
 
 	Fl::run();
 }
diff -u aconnectgui-0.9.0rc2-1/src/Window.hxx aconnectgui-0.9.0rc2-1/src/Window.hxx
--- aconnectgui-0.9.0rc2-1/src/Window.hxx
+++ aconnectgui-0.9.0rc2-1/src/Window.hxx
@@ -12,7 +12,7 @@
 
 #include <alsa/asoundlib.h>
 
-class Window:public Fl_Window
+class ACGWindow:public Fl_Window
 {
 private:
 	Connections* mConnections;
@@ -32,8 +32,8 @@
 	int mClientId;
 
 public:
-	Window();
-	~Window();
+	ACGWindow();
+	~ACGWindow();
 
 	Connections* GetConnections(void) { return mConnections; }
 
@@ -74,7 +74,7 @@
 	
 	static void TimeoutStatic(void* ptr)
 	{
-		((Window*)ptr)->Timeout();
+		((ACGWindow*)ptr)->Timeout();
 	}
 	
 	void Timeout(void);
diff -u aconnectgui-0.9.0rc2-1/src/aconnect.cxx aconnectgui-0.9.0rc2-1/src/aconnect.cxx
--- aconnectgui-0.9.0rc2-1/src/aconnect.cxx
+++ aconnectgui-0.9.0rc2-1/src/aconnect.cxx
@@ -30,7 +30,7 @@
 
 #ifdef ACONNECT_GUI
 #include "Window.hxx"
-extern Window* patchbay;
+extern ACGWindow* patchbay;
 #endif
 
 static void error_handler(const char *file, int line, const char *function, int err, const char *fmt, ...)
@@ -127,7 +127,7 @@
 				patchbay->FindOutput(addr->client, addr->port);
 			if (output)
 			{
-				patchbay->Window::Connect(output,patchbay->GetCurPort()->Input());
+				patchbay->ACGWindow::Connect(output,patchbay->GetCurPort()->Input());
 			}
 		}
 #else
only in patch2:
unchanged:
--- aconnectgui-0.9.0rc2-1.orig/src/Client.cxx
+++ aconnectgui-0.9.0rc2-1/src/Client.cxx
@@ -158,7 +158,7 @@
 	static Connector* a,*b,*prev;
 	static Connection* c=0;
 
-	Window* patchbay = ((Window*)parent());
+	ACGWindow* patchbay = ((ACGWindow*)parent());
 	Connections* connections = patchbay->GetConnections();
 
 	if (e==FL_PUSH && patchbay->IsConnecting()) {

Reply via email to