// -----------------------------------------------------------------------------
// CMessageMonitorPlugin::ConstructL
// -----------------------------------------------------------------------------
//
void CMessageMonitorPlugin::ConstructL() 
	{
	WRITELOG("ENTER CMessageMonitorPlugin::ConstructL");
	
	CreateFileNameL();
	
	WRITELOG("END CMessageMonitorPlugin::ConstructL");
	}
// -----------------------------------------------------------------------------
// CMessageMonitorPlugin::CMessageMonitorPlugin
// -----------------------------------------------------------------------------
//
CMessageMonitorPlugin::CMessageMonitorPlugin() : CMonitorPlugin(), 
												 iMonitorPluginObserver( NULL ),
												 iMsvSession( NULL ),
												 iMdeSession( NULL ),
												 iMessageScannerAO( NULL )
	{
	WRITELOG("ENTER CMessageMonitorPlugin::CMessageMonitorPlugin");
	WRITELOG("END CMessageMonitorPlugin::CMessageMonitorPlugin");		
	}
// -----------------------------------------------------------------------------
// CMessageMonitorPlugin::ResumeMonitoring
// -----------------------------------------------------------------------------
//
TBool CMessageMonitorPlugin::ResumeMonitoring( MMonitorPluginObserver& /*aObserver*/, 
											   CMdESession* /*aMdEClient*/, 
											   CContextEngine* /*aCtxEngine*/,
											   CHarvesterPluginFactory* /*aHarvesterPluginFactory*/ )
	{
	WRITELOG("ENTER CMessageMonitorPlugin::ResumeMonitoring");
	WRITELOG("END CMessageMonitorPlugin::ResumeMonitoring");
	
	return ETrue;
	}
Beispiel #4
0
BOOL CControlsModule::onInit(PPBSTRUCT pPBStructure)
{
	WNDCLASS wndclass;
	LPFNREGKEYNOTIFY reg_keystate;
	LPFNREGKEYBOARDNOTIFY reg_keyboard;

	wcscpy (m_szModName, MODULE_NAME);

	// Preload the Fusion library - it crashes if it's loaded after a previous navigation
	LoadLibrary (L"FusionPublicAPI.dll");

	//RegisterForEvent (PB_APPFOCUSEVENT);
	RegisterForEvent (PB_BROWSER_BEFORE_NAV_EVENT);
	RegisterForEvent (PB_BROWSER_DOC_COMPLETE_EVENT);
	RegisterForEvent (PB_PRIMARY_MESSAGE);
	RegisterForEvent (PB_WINDOWCHANGED_EVENT);

	// Create an invisible window to receive key state messages
	// Only a single window needed because there is only a single physical keyboard
	// Return TRUE on error as the user may not be using key state in any case
	memset (&wndclass, 0, sizeof wndclass);
	wndclass.lpfnWndProc = StaticKeyWindowProc;
	wndclass.hInstance = pPBStructure->hInstance;
	wndclass.lpszClassName = L"KeyStateEvent";
	RegisterClass (&wndclass);

	hKeyStateWindow = CreateWindow (L"KeyStateEvent", NULL, 0, 0, 0, 0, 0, NULL, (HMENU) 0, pPBStructure->hInstance, NULL);
	if (!hKeyStateWindow)
	{
		WRITELOG (L"Cannot create key state event window");
		return TRUE;
	}

	// Add a pointer to ourselves to the window
	SetWindowLong (hKeyStateWindow, GWL_USERDATA, (LONG) this);

	// Load the keyboard driver DLL
	hKeyboardDriver = LoadLibrary (KEYBOARD_DLL);
	if (!hKeyboardDriver)
	{
		WRITELOG (L"Cannot load keyboard driver DLL");
		return TRUE;
	}

	// Register for key state events
	reg_keystate = (LPFNREGKEYNOTIFY) GetProcAddress (hKeyboardDriver, REGKEYNOTIFY);
	if (reg_keystate)
		(*reg_keystate) (hKeyStateWindow, KEY_EVENT);

	reg_keyboard = (LPFNREGKEYBOARDNOTIFY) GetProcAddress (hKeyboardDriver, REGKEYBOARDNOTIFY);
	if (reg_keyboard)
		(*reg_keyboard) (hKeyStateWindow, KEYBOARD_EVENT);

	return true;
}
// -----------------------------------------------------------------------------
// CMessageMonitorPlugin::CreateUriL
// -----------------------------------------------------------------------------
//	
HBufC* CMessageMonitorPlugin::CreateUriL( const TUid& /*aMsgTypeUid*/, const TMsvId aMsgId )
	{
	WRITELOG("ENTER CMessageMonitorPlugin::CreateUriL");
	
    HBufC* uri = HBufC::NewL( KUriLength );
	TPtr ptrUri = uri->Des();
	ptrUri.Format( KMsgURI, aMsgId );	
	
	WRITELOG("END CMessageMonitorPlugin::CreateUriL");	
		
	return uri;
	}
// -----------------------------------------------------------------------------
// CMessageMonitorPlugin::StopMonitoring
// -----------------------------------------------------------------------------
//
TBool CMessageMonitorPlugin::StopMonitoring()
	{
	WRITELOG("ENTER CMessageMonitorPlugin::StopMonitoring");
	if( iMsvSession )
		{
	    delete iMsvSession;  
		iMsvSession = NULL;
		}
	
	WRITELOG("END CMessageMonitorPlugin::StopMonitoring");	
	
	return ETrue;
	}
Beispiel #7
0
int d3d_enum_devices(GUID *pguid)
{
	HRESULT res; 
	GUID guid;

	res = IDirect3D_EnumDevices(_lpD3D, d3d_enum_callback, (LPVOID)&guid);
	if (res != DD_OK) {
		WRITELOG((LogFile, "Unable to find a proper 3D hardware device.\n"));
		return d3d_handle_error(res);
	}

	WRITELOG((LogFile, "Found 3D Device (%s)\n", d3dCaps.devname));

	memcpy(pguid, &guid, sizeof(GUID));
	return 0;
}
EXPORT_C CHarvesterEventManager* CHarvesterEventManager::GetInstanceL()
	{
	WRITELOG( "CHarvesterEventManager::GetInstanceL" );
	OstTrace0( TRACE_NORMAL, CHARVESTEREVENTMANAGER_GETINSTANCEL, "CHarvesterEventManager::GetInstanceL" );	

	CHarvesterEventManagerStaticData* data = 
		static_cast<CHarvesterEventManagerStaticData*>( 
				UserSvr::DllTls( KHarvesterEventManagerTLSKey ) );

	CHarvesterEventManager* instance = NULL;

	if ( !data )
        {
        instance = new (ELeave) CHarvesterEventManager();
        CleanupStack::PushL( instance );
        instance->ConstructL();
        UserSvr::DllSetTls( KHarvesterEventManagerTLSKey,
        	new (ELeave) CHarvesterEventManagerStaticData(instance) );
        CleanupStack::Pop( instance );
        }
    else
        {
        instance = data->iHEM;
        data->iRefCount++;
        }

    return instance;
	}
Beispiel #9
0
SHORT CfsNVRPluginCtrl::SetWndChannelSelect(SHORT nWndIndex, SHORT nChannel)
{
	AFX_MANAGE_STATE(AfxGetStaticModuleState());

	WRITELOG("SetWndChannelSelect  [%d][%d]", nWndIndex, nChannel);
	return Glue_SetWndChannelSelect(mGlue, nWndIndex, nChannel);
}
Beispiel #10
0
SHORT CfsNVRPluginCtrl::GetWndChannelCount(SHORT nWndIndex)
{
	AFX_MANAGE_STATE(AfxGetStaticModuleState());
	SHORT count = Glue_GetWndChannelCount(mGlue, nWndIndex);
	WRITELOG("Glue_GetWndChannelCount  [%d][%d]", nWndIndex, count);
	return count;
}
TBool CMMCMonitorAO::StopMonitoring()
	{
	WRITELOG( "CMMCMonitorAO::StopNotify" ); // DEBUG INFO
	
	Cancel();
	return ETrue;
	}
Beispiel #12
0
void yyerror(char *error)
{
	WRITELOG(ERROR, "Error in configuration file %s:\n", file_error);
	WRITELOG(ERROR, "%s.\n", error);
  free(x_sessions_directory);
  free(text_sessions_directory);
  free(xinit);
  free(font);
  free(theme_dir);
	free(screensavers_dir);
	free(themes_dir);
	set_default_paths();
  theme_dir = StrApp((char**)NULL, themes_dir, "/default/", (char*)NULL);

	settings_parse_error = 1;
}
Beispiel #13
0
BOOL CControlsModule::onBeforeNavigate (int iInstID)
{
	// Get the instance data - problem if it's not available
	INSTANCE_DATA *pdata = (INSTANCE_DATA*) GetObjFromID (iInstID);
	if (!pdata)
	{
		WRITELOG (L"Instance data not available");
		return FALSE;
	}

	if (pdata->pStopButton)
		pdata->pStopButton->Display(TRUE);

	if (pdata->pGoButton)
		pdata->pGoButton->Display (FALSE);

	// GD TEST
	if (pdata->pSignal)
		pdata->pSignal->OnBeforeNavigate ();

	if (pdata->pBattery)
		pdata->pBattery->OnBeforeNavigate ();
	// GD TEST

	return TRUE;
}
Beispiel #14
0
// ============================================================================
// MethodLogger Defenition
// ============================================================================
MethodLogger::MethodLogger(const char *function) :
    mFunction( function )
{
    QString msg;
    msg.sprintf(KLogEnter, mFunction);
    WRITELOG(msg);
}
Beispiel #15
0
void add_to_options(char *option)
{
#ifdef USE_SCREEN_SAVERS
  static struct _screensaver_options *temp = NULL;
  
  if (!option) return;

	/* the following is necessary to detect that options list got cleared */
	if (!screensaver_options) temp = NULL;	

  if (!temp)
	{
		screensaver_options = (struct _screensaver_options *) calloc(1, sizeof(struct _screensaver_options));
		temp = screensaver_options;
	}
  else
	{
		temp->next = (struct _screensaver_options *) calloc(1, sizeof(struct _screensaver_options));
		temp = temp->next;
	}
  
  temp->option = strdup(option);
  temp->next = NULL;
  WRITELOG(DEBUG, "Added '%s' to screen saver options...\n", option);
#else  /* no screensaver support */
	if (option) {} /* only to avoid compiler warnings */
#endif
}
TBool CMMCMonitorAO::StartMonitoring( MMMCMonitorObserver& aObserver, RArray<TMdEMediaInfo>& aMedias )
	{
	WRITELOG( "CMMCMonitorAO::StartMonitoring" ); // DEBUG INFO

	iObserver = &aObserver;
	
    BuildDriveList();
    
    const TInt count( aMedias.Count() );
    for ( TInt i = 0; i < count; i++ )
    	{
    	TInt drive(0);
    	const TInt err = iFs.CharToDrive( aMedias[i].iDrive, drive );
    	if ( err == KErrNone )
    		{
    		WRITELOG2( "CMMCMonitorAO::StartMonitoring - set drive %d mediaid to %d ", drive, aMedias[i].iMediaId );
    		iDriveList[drive] = 1; // fake value for startup (not KDriveAbsent)
        	iMediaIdList[drive] = aMedias[i].iMediaId;
    		}
    	}
    
	iPreviousDriveList.Zero();
	iPreviousDriveList.Copy( iDriveList );

#ifdef _DEBUG
	PrintAllLists();
#endif

	CompareDriveLists();

	StartNotify();
	
	return ETrue;
	}
CMMCMonitorAO::~CMMCMonitorAO()
	{
	WRITELOG( "CMMCMonitorAO::~CMMCMonitorAO" ); // DEBUG INFO
	
	StopMonitoring();
    iFs.Close();
	}
Beispiel #18
0
VARIANT_BOOL CfsNVRPluginCtrl::SetSelectWnd(SHORT nWndIndex)
{
	AFX_MANAGE_STATE(AfxGetStaticModuleState());
	bool bRlt = Glue_SetSelectWnd(mGlue, nWndIndex);
	WRITELOG("Glue_SetSelectWnd [%d], return[%d]", nWndIndex, bRlt);
	return bRlt;
}
// -----------------------------------------------------------------------------
// CMessageMonitorPlugin::HandleMsgCreatedChangedL
// -----------------------------------------------------------------------------
//
void CMessageMonitorPlugin::HandleMsgCreatedChangedL( const CMsvEntrySelection& aSelection,
                                          	   		  const TMsvId aFolderId,
                                          	          const TMsvSessionEvent aEvent )
	{
	WRITELOG("ENTER CMessageMonitorPlugin::HandleMsgCreatedChangedL");
	
	TInt count( aSelection.Count() );
	
    // cycle through every message in the CMsvEntrySelection
	for ( TInt i=0; i < count; ++i )
		{
		// extract the message server entry from the parameters
		TMsvId msgId = aSelection[i];
		WRITELOG1("msgId: %d", msgId );					
		
        TMsvId service = 0;
        TMsvEntry entry;
		TInt err = iMsvSession->GetEntry( msgId, service, entry );

		WRITELOG1("HandleMsgCreatedChangedL error: %d ", err);		
		
		THarvesterEventType event = 
						( aEvent == EMsvEntriesCreated ) || entry.Unread() ? 
						  	  								 EHarvesterAdd : 
															 EHarvesterEdit;
		
        
        // ... we only want to process message entries, that are in the inbox
        // ... and are valid for adding to Mds.
        if ( ( !err ) && 
            ( KUidMsvMessageEntry == entry.iType ) && 
            ( KMsvGlobalInBoxIndexEntryId == aFolderId ) &&
            ( entry.Visible() && entry.Complete() && !entry.InPreparation() ) &&
            ( IsValidMessageTypeL( entry, *iMsvSession ) ) )
            {
            HBufC* uri = CreateUriL( entry.iMtm, msgId );    
            CleanupStack::PushL( uri );
            CHarvesterData* hd = CHarvesterData::NewL( uri );
            CleanupStack::Pop( uri );
            hd->SetEventType( event );
            hd->SetBinary( EFalse );
            hd->SetTakeSnapshot( EFalse );
			iMonitorPluginObserver->MonitorEvent( hd );
            }
        }
	WRITELOG("END CMessageMonitorPlugin::HandleMsgCreatedChangedL");	        
	}
Beispiel #20
0
SHORT CfsNVRPluginCtrl::SetWndChannels(SHORT nWndId, SHORT nChannels)
{
	AFX_MANAGE_STATE(AfxGetStaticModuleState());

	// TODO: Add your dispatch handler code here
	WRITELOG("Glue_SetWndChannels [%d], [%d]", nWndId, nChannels);
	return Glue_SetWndChannels(mGlue, nWndId, nChannels);
}
Beispiel #21
0
void CfsNVRPluginCtrl::NextFrame(void)
{
	AFX_MANAGE_STATE(AfxGetStaticModuleState());

	// TODO: Add your dispatch handler code here
	Glue_NextFrame(mGlue);
	WRITELOG("NextFrame");
}
// -----------------------------------------------------------------------------
// CMessageMonitorPlugin::HandleMsgDeletedL
// -----------------------------------------------------------------------------
//
void CMessageMonitorPlugin::HandleMsgDeletedL( const CMsvEntrySelection& aSelection )
	{
	WRITELOG("ENTER CMessageMonitorPlugin::HandleMsgDeletedL");
	
	TInt count( aSelection.Count() );	
	// cycle through every message in the CMsvEntrySelection
	for( TInt i = 0; i < count; ++i )
		{
		TMsvId msgId = aSelection[i];	
		WRITELOG1("msgId: %d", msgId );
		HBufC* uri = CreateUriL( KUidMsgTypeSMS, msgId );
		CleanupStack::PushL( uri );
		RemoveObjectL( *uri );
		CleanupStack::PopAndDestroy( uri );
		}
	WRITELOG("END CMessageMonitorPlugin::HandleMsgDeletedL");	
	}	
Beispiel #23
0
void CfsNVRPluginCtrl::OnSize(UINT nType, int cx, int cy)
{
	COleControl::OnSize(nType, cx, cy);

	// TODO: 在此处添加消息处理程序代码
	Glue_OnSize(mGlue, cx, cy);
	WRITELOG("Change Windows Size");
}
Beispiel #24
0
void CfsNVRPluginCtrl::FullScreen(void)
{
	AFX_MANAGE_STATE(AfxGetStaticModuleState());

	// TODO: 在此添加调度处理程序代码
	Glue_FullScreen(mGlue);
	WRITELOG("Full Screen");
}
Beispiel #25
0
void COnDemandAO::StartL()
	{
	WRITELOG("COnDemandAO::StartL");
	// Cancel any request, just to be sure
	Cancel ();
	iMdEHarvesterSession->SetHarvestingPrioritizationChunkL( 16384 );
	WaitHarvestingRequest ();
	}
Beispiel #26
0
COnDemandAO* COnDemandAO::NewL( CMdESession& aSession, MMonitorPluginObserver& aObserver,
		CHarvesterPluginFactory& aPluginFactory, RPointerArray<CHarvesterData>* aPhArray )
	{
	WRITELOG("COnDemandAO::NewL");
	COnDemandAO* self = COnDemandAO::NewLC ( aSession, aObserver, aPluginFactory, aPhArray );
	CleanupStack::Pop (); // self;
	return self;
	}
Beispiel #27
0
void COnDemandAO::WaitHarvestingRequest()
	{
	WRITELOG("COnDemandAO::WaitHarvestingRequest");
	iStatus = KRequestPending;
	iMdEHarvesterSession->AddHarvestingPrioritizationObserver( iStatus );
	// Tell scheduler a request is active
	SetActive();
	}
Beispiel #28
0
int
main()
{
	cb_buf_t cb;
	char *mem = (char*)malloc(BUF_LEN);
	if(mem == NULL)
	{
		WRITELOG("malloc failed! return...");
		return -1;
	}

	cb_init(&cb, mem, BUF_LEN/sizeof(int), sizeof(int));
	
	int i = 0;
	char *tmpbuf = NULL;
	for(i = 0; i < BUF_LEN/sizeof(int); i++)
	{
		tmpbuf = cb_write(&cb);			
		if(tmpbuf == NULL)	
		{
			WRITELOG("get from cb failed %d", i);	
		} else {
			WRITELOG("get success: %p\n", tmpbuf);
		}

		memcpy(tmpbuf, &i, sizeof(int));

		cb_done_write(&cb);
	}

	for(i = 0; i < BUF_LEN/sizeof(int); i++)
	{
		tmpbuf = cb_read(&cb);
		if(tmpbuf == NULL)
		{
			WRITELOG("read from ccb failed %d", i);
		} else {
			WRITELOG("read success: %d", (int)(*tmpbuf));
		}

		cb_done_read(&cb);
	}

	return 0;
}
Beispiel #29
0
COnDemandAO* COnDemandAO::NewLC( CMdESession& aSession, MMonitorPluginObserver& aObserver,
		CHarvesterPluginFactory& aPluginFactory, RPointerArray<CHarvesterData>* aPhArray )
	{
	WRITELOG("COnDemandAO::NewLC");
	COnDemandAO* self = new ( ELeave ) COnDemandAO();
	CleanupStack::PushL ( self);
	self->ConstructL ( aSession, aObserver, aPluginFactory, aPhArray );
	return self;
	}
Beispiel #30
0
SHORT CfsNVRPluginCtrl::Snap(LPCTSTR savePath)
{
	AFX_MANAGE_STATE(AfxGetStaticModuleState());

	// TODO: Add your dispatch handler code here
	SHORT rlt = Glue_Snap(mGlue, savePath);
	WRITELOG("Glue_Snap return[%d], savepath:%s", rlt,  savePath);
	return rlt;
}