Skip to content

Commit

Permalink
refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
alabuzhev committed Aug 2, 2016
1 parent 6a9960f commit e74fdac
Show file tree
Hide file tree
Showing 8 changed files with 1,247 additions and 1,334 deletions.
2,481 changes: 1,237 additions & 1,244 deletions far/PluginA.cpp

Large diffs are not rendered by default.

82 changes: 0 additions & 82 deletions far/PluginA.hpp
Expand Up @@ -33,91 +33,9 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#ifndef NO_WRAPPER

#include "plclass.hpp"
namespace wrapper
{

#include "pluginold.hpp"

plugin_factory_ptr CreateOemPluginFactory(PluginManager* Owner);

class file_version;

// TODO: PluginA class shouldn't be derived from Plugin.
// All exports should be provided by oem_plugin_factory.
class PluginA: public Plugin
{
public:
NONCOPYABLE(PluginA);
PluginA(plugin_factory* Factory, const string& ModuleName);
~PluginA();

virtual bool GetGlobalInfo(GlobalInfo *Info) override;
virtual bool SetStartupInfo(PluginStartupInfo* Info) override;
virtual HANDLE Open(OpenInfo* OpenInfo) override;
virtual void ClosePanel(ClosePanelInfo* Info) override;
virtual bool GetPluginInfo(PluginInfo *pi) override;
virtual void GetOpenPanelInfo(OpenPanelInfo *Info) override;
virtual int GetFindData(GetFindDataInfo* Info) override;
virtual void FreeFindData(FreeFindDataInfo* Info) override;
virtual int GetVirtualFindData(GetVirtualFindDataInfo* Info) override;
virtual void FreeVirtualFindData(FreeFindDataInfo* Info) override;
virtual int SetDirectory(SetDirectoryInfo* Info) override;
virtual int GetFiles(GetFilesInfo* Info) override;
virtual int PutFiles(PutFilesInfo* Info) override;
virtual int DeleteFiles(DeleteFilesInfo* Info) override;
virtual int MakeDirectory(MakeDirectoryInfo* Info) override;
virtual int ProcessHostFile(ProcessHostFileInfo* Info) override;
virtual int SetFindList(SetFindListInfo* Info) override;
virtual int Configure(ConfigureInfo* Info) override;
virtual void ExitFAR(ExitInfo *Info) override;
virtual int ProcessPanelInput(ProcessPanelInputInfo* Info) override;
virtual int ProcessPanelEvent(ProcessPanelEventInfo* Info) override;
virtual int ProcessEditorEvent(ProcessEditorEventInfo* Info) override;
virtual int Compare(CompareInfo* Info) override;
virtual int ProcessEditorInput(ProcessEditorInputInfo* Info) override;
virtual int ProcessViewerEvent(ProcessViewerEventInfo* Info) override;
virtual int ProcessDialogEvent(ProcessDialogEventInfo* Info) override;
virtual int ProcessSynchroEvent(ProcessSynchroEventInfo* Info) override { return 0; }
virtual int ProcessConsoleInput(ProcessConsoleInputInfo *Info) override { return 0; }
virtual void* Analyse(AnalyseInfo *Info) override { return nullptr; }
virtual void CloseAnalyse(CloseAnalyseInfo* Info) override {}

virtual int GetContentFields(const GetContentFieldsInfo* Info) override { return 0; }
virtual int GetContentData(GetContentDataInfo* Info) override { return 0; }
virtual void FreeContentData(const GetContentDataInfo* Info) override {}

virtual void* OpenFilePlugin(const wchar_t *Name, const unsigned char *Data, size_t DataSize, int OpMode) override;
virtual bool CheckMinFarVersion() override;


virtual bool IsOemPlugin() const override { return true; }
virtual const string& GetHotkeyName() const override { return GetCacheName(); }

virtual bool InitLang(const string& Path) override;
const char *GetMsgA(LNGID nID) const;

private:
virtual void Prologue() override;
virtual void Epilogue() override;

void FreePluginInfo();
void ConvertPluginInfo(const oldfar::PluginInfo &Src, PluginInfo *Dest);
void FreeOpenPanelInfo();
void ConvertOpenPanelInfo(const oldfar::OpenPanelInfo &Src, OpenPanelInfo *Dest);

PluginInfo PI;
OpenPanelInfo OPI;

oldfar::PluginPanelItem *pFDPanelItemA;
oldfar::PluginPanelItem *pVFDPanelItemA;

std::atomic_ulong OEMApiCnt;

bool opif_shortcut;
std::unique_ptr<file_version> FileVersion;
};

};
#endif // NO_WRAPPER

#endif // PLUGINA_HPP_174AA538_EA2A_43CC_B242_146456B477DB
4 changes: 4 additions & 0 deletions far/changelog
@@ -1,3 +1,7 @@
drkns 02.08.2016 22:18:59 +0200 - build 4748

1. Рефакторинг.

drkns 30.07.2016 21:27:07 +0200 - build 4747

1. Рефакторинг.
Expand Down
4 changes: 2 additions & 2 deletions far/filepanels.cpp
Expand Up @@ -80,8 +80,8 @@ filepanels_ptr FilePanels::create(bool CreateRealPanels, int DirCount)
}
else
{
FilePanelsPtr->m_Panels[panel_left].m_Panel.reset(new dummy_panel(FilePanelsPtr));
FilePanelsPtr->m_Panels[panel_right].m_Panel.reset(new dummy_panel(FilePanelsPtr));
FilePanelsPtr->m_Panels[panel_left].m_Panel = std::make_unique<dummy_panel>(FilePanelsPtr);
FilePanelsPtr->m_Panels[panel_right].m_Panel = std::make_unique<dummy_panel>(FilePanelsPtr);
}
return FilePanelsPtr;
}
Expand Down
3 changes: 1 addition & 2 deletions far/plclass.cpp
Expand Up @@ -487,8 +487,7 @@ Plugin::Plugin(plugin_factory* Factory, const string& ModuleName):
Activity(0),
bPendingRemove(false),
m_strModuleName(ModuleName),
m_strCacheName(ModuleName),
m_Instance(nullptr)
m_strCacheName(ModuleName)
{
ReplaceBackslashToSlash(m_strCacheName);
SetGuid(FarGuid);
Expand Down
3 changes: 1 addition & 2 deletions far/plclass.hpp
Expand Up @@ -310,6 +310,7 @@ class Plugin: noncopyable

std::unordered_set<window_ptr> m_dialogs;
plugin_factory* m_Factory;
plugin_factory::plugin_module_ptr m_Instance;
std::unique_ptr<Language> PluginLang;
size_t Activity;
bool bPendingRemove;
Expand All @@ -332,8 +333,6 @@ class Plugin: noncopyable

BitFlags WorkFlags; // рабочие флаги текущего плагина

plugin_factory::plugin_module_ptr m_Instance;

VersionInfo MinFarVersion;
VersionInfo PluginVersion;

Expand Down
2 changes: 1 addition & 1 deletion far/plugins.cpp
Expand Up @@ -368,7 +368,7 @@ void PluginManager::LoadFactories()
PluginFactories.emplace_back(std::make_unique<native_plugin_factory>(this));
#ifndef NO_WRAPPER
if (Global->Opt->LoadPlug.OEMPluginsSupport)
PluginFactories.emplace_back(wrapper::CreateOemPluginFactory(this));
PluginFactories.emplace_back(CreateOemPluginFactory(this));
#endif // NO_WRAPPER

ScanTree ScTree(false, true, Global->Opt->LoadPlug.ScanSymlinks);
Expand Down
2 changes: 1 addition & 1 deletion far/vbuild.m4
@@ -1 +1 @@
m4_define(BUILD,4747)m4_dnl
m4_define(BUILD,4748)m4_dnl

0 comments on commit e74fdac

Please sign in to comment.