Skip to content
Permalink
Browse files

DM_GETDIALOGINFО clarification, warnings, redundant #include removed

  • Loading branch information...
alabuzhev committed May 11, 2016
1 parent cbd8b14 commit 9df0dfbd4f14b996f557367d0207ac31a28ee4fc
@@ -49,9 +49,9 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "keys.hpp"
#include "language.hpp"
#include "filepanels.hpp"
#include "strmix.hpp"

#define OLDFAR_TO_FAR_MAP(x) { oldfar::x, x }
#include "strmix.hpp"

DECLARE_PLUGIN_FUNCTION(iClosePanel, void (WINAPI*)(HANDLE hPlugin))
DECLARE_PLUGIN_FUNCTION(iCompare, int (WINAPI*)(HANDLE hPlugin, const wrapper::oldfar::PluginPanelItem *Item1, const wrapper::oldfar::PluginPanelItem *Item2, unsigned int Mode))
@@ -1,4 +1,12 @@
drkns 10.05.2016 22:45:32 +0200 - build 4669
drkns 11.05.2016 23:59:21 +0200 - build 4670

1. Уточнение обработки DM_GETDIALOGINFО.

2. Warnings.

3. Убраны неиспользуемые #include.

drkns 10.05.2016 22:45:32 +0200 - build 4669

1. Немного переделан способ вывода прогресса копирования.
По идее, должны исправиться все существующие баги с прорисовкой.
@@ -56,7 +56,6 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "pathmix.hpp"
#include "dirmix.hpp"
#include "strmix.hpp"
#include "keyboard.hpp"
#include "mix.hpp"
#include "console.hpp"
#include "panelmix.hpp"
@@ -43,7 +43,6 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "configdb.hpp"
#include "FarDlgBuilder.hpp"
#include "DlgGuid.hpp"
#include "constitle.hpp"
#include "strmix.hpp"

codepages& Codepages()
@@ -63,7 +63,6 @@ namespace components
if (!list)
{
list = item;
ptr = list;
}
else
{
@@ -57,20 +57,17 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "configdb.hpp"
#include "KnownGuids.hpp"
#include "vmenu2.hpp"
#include "codepage.hpp"
#include "DlgGuid.hpp"
#include "hmenu.hpp"
#include "usermenu.hpp"
#include "filetype.hpp"
#include "shortcuts.hpp"
#include "plist.hpp"
#include "hotplug.hpp"
#include "datetime.hpp"
#include "setcolor.hpp"
#include "language.hpp"
#include "plugins.hpp"
#include "manager.hpp"
#include "constitle.hpp"
#include "xlat.hpp"
#include "panelctype.hpp"
#include "colormix.hpp"
@@ -36,7 +36,6 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "console.hpp"
#include "imports.hpp"
#include "config.hpp"
#include "colors.hpp"
#include "colormix.hpp"
#include "interf.hpp"
#include "setcolor.hpp"
@@ -38,7 +38,6 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "language.hpp"
#include "config.hpp"
#include "synchro.hpp"
#include "console.hpp"
#include "farversion.hpp"
#include "scrbuf.hpp"
#include "strmix.hpp"
@@ -36,7 +36,6 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

#include "copy.hpp"
#include "keys.hpp"
#include "colors.hpp"
#include "flink.hpp"
#include "dialog.hpp"
#include "ctrlobj.hpp"
@@ -46,18 +45,14 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "treelist.hpp"
#include "chgprior.hpp"
#include "scantree.hpp"
#include "constitle.hpp"
#include "filefilter.hpp"
#include "fileview.hpp"
#include "TPreRedrawFunc.hpp"
#include "syslog.hpp"
#include "TaskBar.hpp"
#include "cddrv.hpp"
#include "interf.hpp"
#include "keyboard.hpp"
#include "colormix.hpp"
#include "message.hpp"
#include "config.hpp"
#include "stddlg.hpp"
#include "fileattr.hpp"
#include "datetime.hpp"
@@ -68,10 +63,8 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "strmix.hpp"
#include "panelmix.hpp"
#include "processname.hpp"
#include "mix.hpp"
#include "DlgGuid.hpp"
#include "console.hpp"
#include "wakeful.hpp"
#include "language.hpp"
#include "manager.hpp"
#include "copy_progress.hpp"
@@ -62,7 +62,8 @@ copy_progress::copy_progress(bool Move, bool Total, bool Time):
m_SpeedUpdateCheck(time_check::immediate, 3000 * CLOCKS_PER_SEC / 1000),
m_SecurityTimeCheck(time_check::immediate, GetRedrawTimeout()),
m_Files(),
m_Bytes()
m_Bytes(),
m_CalcTime()
{
m_CurrentBar = make_progressbar(m_CurrentBarSize, 0, false, false);
m_TotalBar = make_progressbar(m_TotalBarSize, 0, false, false);
@@ -184,9 +185,6 @@ void copy_progress::Flush()

void copy_progress::SetProgressValue(UINT64 CompletedSize, UINT64 TotalSize)
{
m_LastCopied = CompletedSize;
m_LastTotal = TotalSize;

SetCurrentProgress(CompletedSize, TotalSize);

auto BytesDone = GetBytesDone();
@@ -111,8 +111,6 @@ class copy_progress: noncopyable
uint64_t CurrCopied;
}
m_Bytes;

uint64_t m_LastCopied, m_LastTotal;
};

#endif // COPY_PROGRESS_HPP_3D1EAAD8_8353_459C_8826_33AAAE06D01F
@@ -49,7 +49,6 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "poscache.hpp"
#include "plugins.hpp"
#include "desktop.hpp"
#include "menubar.hpp"
#include "colormix.hpp"

ControlObject::ControlObject()
@@ -37,10 +37,8 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "delete.hpp"
#include "flink.hpp"
#include "chgprior.hpp"
#include "filepanels.hpp"
#include "scantree.hpp"
#include "treelist.hpp"
#include "manager.hpp"
#include "constitle.hpp"
#include "TPreRedrawFunc.hpp"
#include "TaskBar.hpp"
@@ -40,7 +40,6 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "interf.hpp"
#include "config.hpp"
#include "keys.hpp"
#include "scrbuf.hpp"
#include "help.hpp"

desktop::desktop(private_tag)
@@ -416,7 +416,7 @@ Dialog::~Dialog()
_DIALOG(SysLog(L"[%p] Dialog::~Dialog()",this));
DeleteDialogObjects();

Hide();
Dialog::Hide();
if (Global)
{
if (Global->Opt->Clock && Global->WindowManager->IsPanelsActive(true))
@@ -4527,31 +4527,6 @@ intptr_t Dialog::DefProc(intptr_t Msg, intptr_t Param1, void* Param2)
return FALSE;
case DN_ENTERIDLE:
return 0; // always 0
case DM_GETDIALOGINFO:
{
bool Result=false;

if (Param2)
{
if (IdExist)
{
const auto di = reinterpret_cast<DialogInfo*>(Param2);

if (CheckStructSize(di))
{
di->Id=m_Id;
di->Owner=FarGuid;
Result=true;
if (PluginOwner)
{
di->Owner = PluginOwner->GetGUID();
}
}
}
}

return Result;
}
default:
break;
}
@@ -4888,7 +4863,19 @@ intptr_t Dialog::SendMessage(intptr_t Msg,intptr_t Param1,void* Param2)
/*****************************************************************/
case DM_GETDIALOGINFO:
{
return DlgProc(DM_GETDIALOGINFO,Param1,Param2);
if (IdExist)
{
if (const auto di = reinterpret_cast<DialogInfo*>(Param2))
{
if (CheckStructSize(di))
{
di->Id = m_Id;
di->Owner = PluginOwner? PluginOwner->GetGUID() : FarGuid;
return true;
}
}
}
return false;
}
/*****************************************************************/
// Param1=0, Param2=FarDialogItemData, Ret=size (without '\0')
@@ -235,7 +235,7 @@ class separator
{
public:
separator():m_value(L' '){}
const string Get()
string Get()
{
wchar_t c = m_value;
m_value = BoxSymbols[BS_V1];
@@ -144,7 +144,7 @@ void DizList::Read(const string& Path, const string* DizName)
{
auto NameBegin = DizText.cbegin();
auto NameEnd = DizText.cend();
auto DescBegin = DizText.cend();
auto DescBegin = NameEnd;

if (DizText.front() == L'"')
{
@@ -36,13 +36,10 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

#include "execute.hpp"
#include "keyboard.hpp"
#include "filepanels.hpp"
#include "ctrlobj.hpp"
#include "scrbuf.hpp"
#include "chgprior.hpp"
#include "cmdline.hpp"
#include "imports.hpp"
#include "manager.hpp"
#include "interf.hpp"
#include "message.hpp"
#include "config.hpp"
@@ -51,9 +48,6 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "constitle.hpp"
#include "console.hpp"
#include "language.hpp"
#include "colormix.hpp"
#include "desktop.hpp"
#include "keybar.hpp"

struct IMAGE_HEADERS
{
@@ -318,8 +318,16 @@ bool dlgSaveFileAs(string &strFileName, int &TextFormat, uintptr_t &codepage,boo
}

FileEditor::FileEditor(private_tag):
F4KeyOnly(),
AttrStr(),
m_FileAttributes(),
FileAttributesModified(),
m_bClosing(),
bEE_READ_Sent(),
bLoaded(),
m_bAddSignature(),
BadConversion(false),
m_codepage(CP_DEFAULT),
f8cps(false)
{
}
@@ -1939,7 +1947,7 @@ int FileEditor::SaveFile(const string& Name,int Ask, bool bSaveAs, int TextForma
{
BOOL UseDefChar = FALSE;
WideCharToMultiByte(codepage, WC_NO_BEST_FIT_CHARS, &i, 1, nullptr, 0, nullptr, &UseDefChar);
return UseDefChar == TRUE;
return UseDefChar != FALSE;
});

if (BadCharIterator != SaveStr.cend())
@@ -78,7 +78,6 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "panelmix.hpp"
#include "processname.hpp"
#include "mix.hpp"
#include "constitle.hpp"
#include "elevation.hpp"
#include "FarGuid.hpp"
#include "DlgGuid.hpp"
@@ -157,7 +157,6 @@ bool filemasks::Set(const string& masks, DWORD Flags)
{
break;
}
ptr = nextpos;
}
ptr = SkipSeparators(ptr, End);
nextpos = SkipMasks(ptr, End);
@@ -49,7 +49,6 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "namelist.hpp"
#include "scantree.hpp"
#include "manager.hpp"
#include "scrbuf.hpp"
#include "filemasks.hpp"
#include "filefilter.hpp"
#include "farexcpt.hpp"
@@ -67,7 +67,6 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "elevation.hpp"
#include "stddlg.hpp"
#include "vmenu2.hpp"
#include "constitle.hpp"
#include "usermenu.hpp"
#include "filemasks.hpp"
#include "plugins.hpp"
@@ -48,7 +48,6 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "FarDlgBuilder.hpp"
#include "clipboard.hpp"
#include "language.hpp"
#include "constitle.hpp"
#include "strmix.hpp"

static string FormatErrorString(bool Nt, DWORD Code)
@@ -36,10 +36,7 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#pragma hdrstop

#include "modal.hpp"
#include "keys.hpp"
#include "help.hpp"
#include "lockscrn.hpp"
#include "keyboard.hpp"

SimpleModal::SimpleModal(): m_EndLoop(false)
{
@@ -46,7 +46,6 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "FarGuid.hpp"
#include "processname.hpp"
#include "language.hpp"
#include "scrbuf.hpp"

DECLARE_PLUGIN_FUNCTION(iClosePanel, void (WINAPI*)(const ClosePanelInfo *Info))
DECLARE_PLUGIN_FUNCTION(iCompare, intptr_t (WINAPI*)(const CompareInfo *Info))
@@ -52,7 +52,6 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "ctrlobj.hpp"
#include "window.hpp"
#include "scrbuf.hpp"
#include "constitle.hpp"
#include "TPreRedrawFunc.hpp"
#include "syslog.hpp"
#include "interf.hpp"
@@ -80,7 +79,6 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "xlat.hpp"
#include "dirinfo.hpp"
#include "language.hpp"
#include "desktop.hpp"
#include "viewer.hpp"
#include "datetime.hpp"

@@ -50,12 +50,12 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "language.hpp"
#include "plugins.hpp"
#include "colormix.hpp"
#include "strmix.hpp"

#define PRINTER_INFO_LEVEL 4
#define GENERATE_PRINTER_INFO(prefix, value) prefix##value##W
#define PRINTER_INFO_X(level) GENERATE_PRINTER_INFO(PRINTER_INFO_, level)
#define PRINTER_INFO PRINTER_INFO_X(PRINTER_INFO_LEVEL)
#include "strmix.hpp"

static void AddToPrintersMenu(VMenu2 *PrinterList, const PRINTER_INFO *pi, int PrinterNumber)
{
Oops, something went wrong.

0 comments on commit 9df0dfb

Please sign in to comment.
You can’t perform that action at this time.