All pastes #762683 Raw Edit

Something

public cpp v1 · immutable
·published 2007-11-05 20:55 UTC
rendered paste body
class SREData{public:	GtkMainWindow * pMainWindow;	char * filename;	SREData(GtkMainWindow * pmw, char * fn) : pMainWindow(pmw), filename(fn)	{	}};gboolean SignatureRecdEvent(gpointer data){	assert (data);	DebugPrint("inside SignatureRecdEvent");	SREData * pSreData = (SREData *)data;	pSreData->pMainWindow->PostSignature(pSreData->filename);	delete pSreData;	return (false);}DWORD WINAPI SignatureThreadProc(LPVOID param){	// The signature-gathering process has to be done is the background	// so that the GUI thread can continue to handle events	// IMPORTANT: nothing is done to the gtk window here... the moment	// we have a signature file, we switch back to gtk thread with	// g_idle_add(..)	assert (param);	GtkMainWindow * pMainWindow = (GtkMainWindow *)param;	char * filename = pMainWindow->_signature.GetNewSignature(SIGNATURE_WIDTH,	                                                          SIGNATURE_HEIGHT);	if (!filename) {		pMainWindow->_complainer.Complain("Failed to get signature");		return (1);	}	DebugPrint("Calling SignatureRecdEvent...");	g_idle_add(SignatureRecdEvent, new SREData(pMainWindow, filename));	//g_main_context_wakeup(NULL);	return (0);}