コード例 #1
0
ファイル: duZorderList.cpp プロジェクト: tantaishan/MyEcho
void duZorderList::DispatchOnCreate()
{
	duCtrlManager *pCtrlManager = GetCtrlManager(m_pRoot->GetHwnd());
	if (pCtrlManager == NULL)
		return;

	duPlugin *pPlugin = NULL;
	int i, j;
	int nLevelCount = GetLayerCount();
	for (i = 0;i < nLevelCount; i++)
	{
		int nCtrlCount = GetLayerChildCount(i);
		for (j = nCtrlCount - 1;j >= 0; j--)
		{
			pPlugin = GetPlugin(i, j);
			if (pPlugin == NULL || !Plugin_IsValid(pPlugin))
				continue;

			pCtrlManager->AddName(pPlugin);
		}
	}

	for (i = 0;i < nLevelCount; i++)
	{
		int nCtrlCount = GetLayerChildCount(i);
		for (j = nCtrlCount - 1;j >= 0; j--)
		{
			pPlugin = GetPlugin(i, j);
			if (pPlugin == NULL || !Plugin_IsValid(pPlugin))
				continue;

			pPlugin->OnCreate();
		}
	}
}
コード例 #2
0
ファイル: FarConfiguration.cpp プロジェクト: Ugnis/Far-NetBox
void TFarConfiguration::CacheFarSettings()
{
  if (GetPlugin())
  {
    FFarConfirmations = GetPlugin()->FarAdvControl(ACTL_GETCONFIRMATIONS);
  }
}
コード例 #3
0
void SvnUpdateHandler::Process(const wxString& output)
{
    bool conflictFound ( false  );
    wxString svnOutput ( output );

    svnOutput.MakeLower();
    if (svnOutput.Contains(wxT("summary of conflicts:"))) {
        // A conflict was found
        conflictFound = true;
    }

    // Reload any modified files
    EventNotifier::Get()->PostReloadExternallyModifiedEvent( false );

    // After 'Update' we usually want to do the following:
    // Reload workspace (if a project file or the workspace were modified)
    // or retag the workspace
    if ( !conflictFound ) {

        // Retag workspace only if no conflict were found
        // send an event to the main frame indicating that a re-tag is required
        if( GetPlugin()->GetSettings().GetFlags() & SvnRetagWorkspace ) {
            wxCommandEvent e(wxEVT_COMMAND_MENU_SELECTED, XRCID("retag_workspace"));
            GetPlugin()->GetManager()->GetTheApp()->GetTopWindow()->GetEventHandler()->AddPendingEvent(e);
        }
    }

    // Post event about file system updated
    clFileSystemEvent fsEvent(wxEVT_FILE_SYSTEM_UPDATED);
    fsEvent.SetPath(GetPlugin()->GetSvnView()->GetRootDir());
    EventNotifier::Get()->AddPendingEvent(fsEvent);

    // And finally, update the Subversion view
    SvnDefaultCommandHandler::Process(output);
}
コード例 #4
0
ファイル: FarConfiguration.cpp プロジェクト: Ugnis/Far-NetBox
void TFarConfiguration::SetPlugin(TCustomFarPlugin * Value)
{
  if (GetPlugin() != Value)
  {
    DebugAssert(!GetPlugin() || !Value);
    FFarPlugin = Value;
  }
}
コード例 #5
0
void SvnRepoListHandler::Process(const wxString& output)
{
    if(output.StartsWith(wxT("svn:"))) {
        // error occured
        GetPlugin()->GetConsole()->AppendText(output);
        GetPlugin()->GetConsole()->AppendText(wxT("--------\n"));
        return;
    }
    GetPlugin()->FinishSyncProcess(m_proj, m_workDir, m_excludeBin, m_excludeExtensions, output);
}
コード例 #6
0
void SvnDefaultCommandHandler::Process(const wxString &output)
{
	wxUnusedVar(output);

	// Reload any modified files
	wxCommandEvent e(wxEVT_COMMAND_MENU_SELECTED, wxEVT_CMD_RELOAD_EXTERNALLY_MODIFIED_NOPROMPT);
	GetPlugin()->GetManager()->GetTheApp()->GetTopWindow()->GetEventHandler()->AddPendingEvent(e);

	// Refresh the SVN output page
	GetPlugin()->GetSvnView()->BuildTree();
}
コード例 #7
0
ファイル: FarConfiguration.cpp プロジェクト: Ugnis/Far-NetBox
intptr_t TFarConfiguration::FarConfirmations() const
{
  if (GetPlugin() && (GetCurrentThreadId() == GetPlugin()->GetFarThreadId()))
  {
    return GetPlugin()->FarAdvControl(ACTL_GETCONFIRMATIONS);
  }
  else
  {
    DebugAssert(FFarConfirmations >= 0);
    return FFarConfirmations;
  }
}
コード例 #8
0
void SvnPatchDryRunHandler::Process(const wxString& output)
{
    GetPlugin()->GetConsole()->EnsureVisible();
    GetPlugin()->GetConsole()->AppendText(_("===== APPLYING PATCH - DRY RUN =====\n"));
    GetPlugin()->GetConsole()->AppendText(output);
    GetPlugin()->GetConsole()->AppendText(_("===== OUTPUT END =====\n"));

    if(delFileWhenDone) {
        // delete the patch file
        wxRemoveFile(patchFile);
    }
}
コード例 #9
0
void SvnLogHandler::Process(const wxString& output)
{
    // create new editor and set the output to it
    wxString changeLog (output);
    if(m_compact) {
        // remove non interesting lines
        changeLog = Compact(changeLog);
    }

    ChangeLogPage *page = new ChangeLogPage(GetPlugin()->GetManager()->GetTheApp()->GetTopWindow(), GetPlugin());
    page->SetUrl(m_url);
    page->AppendText( changeLog );
    GetPlugin()->GetManager()->AddPage( page, _("Change Log"), _("Change Log"), wxNullBitmap, true );
}
コード例 #10
0
void SvnBlameHandler::Process(const wxString& output)
{
    if(output.StartsWith(wxT("svn:"))) {
        // error occured
        GetPlugin()->GetConsole()->AppendText(output);
        GetPlugin()->GetConsole()->AppendText(wxT("--------\n"));
        return;
    }

    GetPlugin()->GetConsole()->AppendText(_("Loading Svn blame dialog...\n"));
    GetPlugin()->GetConsole()->AppendText(wxT("--------\n"));
    SvnBlameFrame *blameFrame = new SvnBlameFrame(GetPlugin()->GetManager()->GetTheApp()->GetTopWindow(), m_filename, output);
    blameFrame->Show();
}
コード例 #11
0
void SvnDiffHandler::Process(const wxString& output)
{
    // Open the changes inside the editor only if we are not using an external
    // diff viewer
    if(GetPlugin()->GetSettings().GetFlags() & SvnUseExternalDiff)
        return;

    IEditor *editor = GetPlugin()->GetManager()->NewEditor();
    if(editor) {
        // Set the lexer name to 'Diff'
        editor->SetLexerName(wxT("Diff"));
        editor->AppendText(output);
    }
}
コード例 #12
0
void SvnVersionHandler::Process(const wxString& output)
{
    //GetPlugin()->GetConsole()->AppendText(output);
    wxRegEx reVersion(wxT("svn, version ([0-9]\\.[0-9])(\\.[0-9])"));
    if(reVersion.Matches(output)) {
        wxString strVersion = reVersion.GetMatch(output, 1);

        double version(0.0);
        strVersion.ToDouble(&version);

        GetPlugin()->GetConsole()->AppendText(wxString::Format(wxT("-- Svn client version: %s\n"), strVersion.c_str()));
        GetPlugin()->SetSvnClientVersion(version);
    }
}
コード例 #13
0
void ObserverModule::CloseArchive(const GUID& uidPlugin, ObserverArchive* pArchive)
{
	ObserverPlugin* pPlugin = GetPlugin(uidPlugin);

	if ( pPlugin )
		pPlugin->CloseArchive(pArchive);
}
コード例 #14
0
long CMUSHclientDoc::EnablePlugin(LPCTSTR PluginID, BOOL Enabled) 
{
CPlugin * pPlugin = GetPlugin (PluginID); 

  if (!pPlugin)                            
	  return eNoSuchPlugin;                       

  if (pPlugin->m_bEnabled == (Enabled != 0))
    return eOK;   // already same state

  pPlugin->m_bEnabled = Enabled != 0;

  CPlugin * pSavedPlugin = m_CurrentPlugin;

  // otherwise plugin won't know who itself is
  m_CurrentPlugin = pPlugin;

  if (pPlugin->m_bEnabled)
    {
    CScriptCallInfo callinfo (ON_PLUGIN_ENABLE, pPlugin->m_PluginCallbacks [ON_PLUGIN_ENABLE]);
    pPlugin->ExecutePluginScript (callinfo); 
    }
  else
    {
    CScriptCallInfo callinfo (ON_PLUGIN_DISABLE, pPlugin->m_PluginCallbacks [ON_PLUGIN_DISABLE]);
    pPlugin->ExecutePluginScript (callinfo); 
    }
  
  m_CurrentPlugin = pSavedPlugin;

  return eOK;
}   // end of CMUSHclientDoc::EnablePlugin
コード例 #15
0
void ObjectBarDialog::OnBeginDrag(NMHDR* pNMHDR, LRESULT* pResult) 
{
	NM_LISTVIEW* pNMListView = (NM_LISTVIEW*)pNMHDR;
	*pResult = 0;

	POSITION Pos = objects.GetFirstSelectedItemPosition();
	int Item = objects.GetNextSelectedItem(Pos);

	if (Item == -1) return; // Safety first

	// Select in layout editor, if it's open
	if (parent.m_tabs.SelectionGet() == 0 && parent.m_tabs.ItemGetCount() == 2)
	{
		// Find a CObj for the CObjType
		CObjType* pType;
		long ID = objects.GetItemData(Item);

		if (ID == -1)
			return; //folder

		application->object_types.Lookup(ID, pType);

		// Find out if this is a nonframe object
		CPlugin plugin = GetPlugin(pType->DLLIndex);

		if (plugin.m_Flags & OF_NODRAW)
			return;

		CLayout* pLayout = parent.layout_editor[0][0]->layout;

		// We're creating a duplicate
		g_bDuplicate = TRUE;

		parent.layout_editor[0][0]->m_sel.RemoveAll();

		// Iterate each instance
		POSITION InstancePos = pLayout->objects.GetStartPosition();
		long unused = 0;
		CObj* pObj;

		while (InstancePos)
		{
			pLayout->objects.GetNextAssoc(InstancePos, unused, pObj);

			// Add 
			if (pObj->editObject->ObjectIdentifier == pType->ObjectIdentifier)
				break;
		}

		long OID = pObj->GetInstanceID();

		parent.layout_editor[0][0]->m_sel.AddTail(OID);
		CPoint pt = pObj->GetObjectRect(parent.layout_editor[0][0]).GetBoundingRect().CenterPoint();

		parent.layout_editor[0][0]->m_oldPt = pt;
		pt.Offset(3,3);

		parent.layout_editor[0][0]->InitializeMove(pt);
	}
}
コード例 #16
0
void SvnStatusHandler::Process(const wxString& output)
{
//	GetPlugin()->GetShell()->AppendText(output);
	wxArrayString modFiles, conflictedFiles, unversionedFiles, newFiles, deletedFiles;
	SvnXML::GetFiles(output, modFiles, conflictedFiles, unversionedFiles, newFiles, deletedFiles);
	GetPlugin()->GetSvnView()->UpdateTree(modFiles, conflictedFiles, unversionedFiles, newFiles, deletedFiles);
}
コード例 #17
0
ファイル: DUIControlFactory.cpp プロジェクト: achellies/DUI
CRefPtr<IDUIControl> CDUIControlFactory::CreateFromPlugin(const CDUIString& strName)
{
	CDUIString strDllName, strEntryFunction;
	if(!GetPlugin(strName, strDllName, strEntryFunction))
	{
		DUI_ASSERT(FALSE);
		return NULL;
	}

	CResLoader resLoader;
	HINSTANCE hPlugin = resLoader.LoadLibrary(strDllName);
	if(hPlugin == NULL) 
	{
		DUI_ASSERT(FALSE);
		return NULL;
	}

	typedef BOOL (WINAPI* CreateObjectProc)(VOID** ppPlugin);

	char szFunName[256] = {0};
	WideCharToMultiByte(CP_ACP, 0, strEntryFunction.c_str(), 
		strEntryFunction.size(), szFunName, sizeof(szFunName)/sizeof(char), NULL, NULL);
	CreateObjectProc pFun = (CreateObjectProc)GetProcAddress(hPlugin, szFunName);
	if(pFun == NULL)
	{
		DUI_ASSERT(FALSE);
		return NULL;
	}

	IDUIControl* pControlRet = NULL;
	BOOL bRet = pFun((VOID**)&pControlRet);
	return bRet ? pControlRet : NULL;
}
コード例 #18
0
ファイル: ma.Module.cpp プロジェクト: CyberShadow/FAR
void MaModule::CloseArchive(const GUID& uidPlugin, MaArchive* pArchive)
{
	MaPlugin* pPlugin = GetPlugin(uidPlugin);

	if ( pPlugin )
		pPlugin->CloseArchive(pArchive);
}
コード例 #19
0
ファイル: d5d.Module.cpp プロジェクト: FarGroup/FarManager
void D5DModule::CloseArchive(const GUID& uidPlugin, D5DArchive* pArchive)
{
	D5DPlugin* pPlugin = GetPlugin(uidPlugin);

	if ( pPlugin )
		pPlugin->CloseArchive(pArchive);
}
コード例 #20
0
ファイル: newarc.Module.cpp プロジェクト: FarGroup/FarManager
ArchiveFormat* ArchiveModule::GetFormat(const GUID& uidPlugin, const GUID& uidFormat)
{
	ArchivePlugin* pPlugin = GetPlugin(uidPlugin);

	if ( pPlugin )
		return pPlugin->GetFormat(uidFormat);

	return NULL;
}
コード例 #21
0
status_t
PluginManager::CreateStreamer(Streamer** streamer, BUrl* url, BDataIO** source)
{
	TRACE("PluginManager::CreateStreamer enter\n");

	entry_ref refs[MAX_STREAMERS];
	int32 count;

	status_t ret = AddOnManager::GetInstance()->GetStreamers(refs, &count,
		MAX_STREAMERS);
	if (ret != B_OK) {
		printf("PluginManager::CreateStreamer: can't get list of streamers:"
			" %s\n", strerror(ret));
		return ret;
	}

	// try each reader by calling it's Sniff function...
	for (int32 i = 0; i < count; i++) {
		entry_ref ref = refs[i];
		MediaPlugin* plugin = GetPlugin(ref);
		if (plugin == NULL) {
			printf("PluginManager::CreateStreamer: GetPlugin failed\n");
			return B_ERROR;
		}

		StreamerPlugin* streamerPlugin = dynamic_cast<StreamerPlugin*>(plugin);
		if (streamerPlugin == NULL) {
			printf("PluginManager::CreateStreamer: dynamic_cast failed\n");
			PutPlugin(plugin);
			return B_ERROR;
		}

		*streamer = streamerPlugin->NewStreamer();
		if (*streamer == NULL) {
			printf("PluginManager::CreateStreamer: NewReader failed\n");
			PutPlugin(plugin);
			return B_ERROR;
		}

		(*streamer)->fMediaPlugin = plugin;

		BDataIO* streamSource = NULL;
		if ((*streamer)->Sniff(url, &streamSource) == B_OK) {
			TRACE("PluginManager::CreateStreamer: Sniff success ");
			*source = streamSource;
			return B_OK;
		}

		DestroyStreamer(*streamer);
		*streamer = NULL;
	}

	TRACE("PluginManager::CreateStreamer leave\n");
	return B_MEDIA_NO_HANDLER;
}
コード例 #22
0
ファイル: LoadLV2.cpp プロジェクト: rbuj/audacity
IdentInterface *LV2EffectsModule::CreateInstance(const wxString & path)
{
   // Acquires a resource for the application.
   const LilvPlugin *plug = GetPlugin(path);
   if (!plug)
   {
      return NULL;
   }

   // Safety of this depends on complementary calls to DeleteInstance on the module manager side.
   return safenew LV2Effect(plug);
}
コード例 #23
0
void SvnPatchHandler::Process(const wxString& output)
{
    // Print the patch output to the subversion console
    GetPlugin()->GetConsole()->EnsureVisible();
    GetPlugin()->GetConsole()->AppendText(output);
    GetPlugin()->GetConsole()->AppendText(wxT("-----\n"));

    if(delFileWhenDone) {
        wxRemoveFile(patchFile);
    }

    // Retag workspace only if no conflict were found
    // send an event to the main frame indicating that a re-tag is required
    if( GetPlugin()->GetSettings().GetFlags() & SvnRetagWorkspace ) {
        wxCommandEvent e(wxEVT_COMMAND_MENU_SELECTED, XRCID("retag_workspace"));
        GetPlugin()->GetManager()->GetTheApp()->GetTopWindow()->GetEventHandler()->AddPendingEvent(e);
    }

    // And finally, update the Subversion view
    SvnDefaultCommandHandler::Process(output);
}
コード例 #24
0
bool PluginManager::IsRegistered(const wxString & type, const wxString & path)
{
   int cnt = GetPluginCount(type);

   for (int i = 0; i < cnt; i++) {
      wxString registered = GetPlugin(type, i);
      if (registered == path) {
         return true;
      }
   }

   return false;
}
コード例 #25
0
ファイル: ma.Module.cpp プロジェクト: CyberShadow/FAR
MaArchive* MaModule::OpenArchive(
		const GUID& uidPlugin, 
		const GUID& uidFormat, 
		const TCHAR* lpFileName,
		HANDLE hCallback,
		ARCHIVECALLBACK pfnCallback
		)
{
	MaPlugin* pPlugin = GetPlugin(uidPlugin);

	if ( pPlugin )
		return pPlugin->OpenArchive(uidFormat, lpFileName, hCallback, pfnCallback);

	return NULL;
}
コード例 #26
0
void PluginManager::EnablePlugin(const wxString & type, const wxString & path, bool enable)
{
   int cnt = GetPluginCount(type);

   for (int i = 0; i < cnt; i++) {
      wxString registered = GetPlugin(type, i);
      if (registered == path) {
         mConfig->SetPath(wxT(".."));
         mConfig->Write(wxT("Enabled"), enable);
         SetDirty(true);
         mConfig->SetPath(wxT("private"));
         break;
      }
   }
}
コード例 #27
0
bool PluginManager::IsPluginEnabled(const wxString & type, const wxString & path)
{
   int cnt = GetPluginCount(type);

   for (int i = 0; i < cnt; i++) {
      wxString registered = GetPlugin(type, i);
      if (registered == path) {
         mConfig->SetPath(wxT(".."));
         bool enabled = mConfig->Read(wxT("Enabled"), true) != false;
         mConfig->SetPath(wxT("private"));
         return enabled;
      }
   }

   return true;
}
コード例 #28
0
ファイル: LoadLV2.cpp プロジェクト: rbuj/audacity
bool LV2EffectsModule::RegisterPlugin(PluginManagerInterface & pm, const wxString & path)
{
   const LilvPlugin *plug = GetPlugin(path);
   if (!plug)
   {
      return false;
   }

   LV2Effect effect(plug);
   if (effect.SetHost(NULL))
   {
      pm.RegisterPlugin(this, &effect);
   }

   return true;
}
コード例 #29
0
long CMUSHclientDoc::PluginSupports(LPCTSTR PluginID, LPCTSTR Routine) 
{
CPlugin * pPlugin = GetPlugin (PluginID); 

  if (!pPlugin)                            
	  return eNoSuchPlugin;                       

  if (strlen (Routine) == 0)
    return eNoSuchRoutine;

DISPID iDispid = pPlugin->m_ScriptEngine->GetDispid (Routine);

  if (iDispid == DISPID_UNKNOWN)
    return eNoSuchRoutine;

	return eOK;
}   // end ofCMUSHclientDoc::PluginSupports
コード例 #30
0
ファイル: PluginManager.cpp プロジェクト: mariuz/haiku
status_t
PluginManager::CreateDecoder(Decoder** _decoder, const media_format& format)
{
	TRACE("PluginManager::CreateDecoder enter\n");

	// get decoder for this format from the server
	server_get_decoder_for_format_request request;
	server_get_decoder_for_format_reply reply;
	request.format = format;
	status_t ret = QueryServer(SERVER_GET_DECODER_FOR_FORMAT, &request,
		sizeof(request), &reply, sizeof(reply));
	if (ret != B_OK) {
		printf("PluginManager::CreateDecoder: can't get decoder for format: "
			"%s\n", strerror(ret));
		return ret;
	}

	MediaPlugin* plugin = GetPlugin(reply.ref);
	if (plugin == NULL) {
		printf("PluginManager::CreateDecoder: GetPlugin failed\n");
		return B_ERROR;
	}
	
	DecoderPlugin* decoderPlugin = dynamic_cast<DecoderPlugin*>(plugin);
	if (decoderPlugin == NULL) {
		printf("PluginManager::CreateDecoder: dynamic_cast failed\n");
		PutPlugin(plugin);
		return B_ERROR;
	}
	
	// TODO: In theory, one DecoderPlugin could support multiple Decoders,
	// but this is not yet handled (passing "0" as index/ID).
	*_decoder = decoderPlugin->NewDecoder(0);
	if (*_decoder == NULL) {
		printf("PluginManager::CreateDecoder: NewDecoder() failed\n");
		PutPlugin(plugin);
		return B_ERROR;
	}
	TRACE("  created decoder: %p\n", *_decoder);
	(*_decoder)->fMediaPlugin = plugin;

	TRACE("PluginManager::CreateDecoder leave\n");

	return B_OK;
}