Skip to content

Commit

Permalink
Stop looking for GetColorDialog in extendedconsole.dll
Browse files Browse the repository at this point in the history
  • Loading branch information
alabuzhev committed Aug 16, 2021
1 parent 96d5f7b commit 253f760
Show file tree
Hide file tree
Showing 8 changed files with 17 additions and 18 deletions.
9 changes: 9 additions & 0 deletions far/changelog
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
--------------------------------------------------------------------------------
drkns 16.08.2021 17:34:55 +0100 - build 5876

1. Forum: some visual distinction for the "Inherit" flag in the Color dialog & hotkeys.

2. Minor executor correction.

3. Stop looking for GetColorDialog in extendedconsole.dll.

--------------------------------------------------------------------------------
drkns 12.08.2021 00:11:15 +0100 - build 5875

Expand Down
9 changes: 0 additions & 9 deletions far/console.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,6 @@ namespace console_detail
DECLARE_IMPORT_FUNCTION(GetTextAttributes, BOOL(WINAPI*)(FarColor* Attributes));
DECLARE_IMPORT_FUNCTION(SetTextAttributes, BOOL(WINAPI*)(const FarColor* Attributes));
DECLARE_IMPORT_FUNCTION(ClearExtraRegions, BOOL(WINAPI*)(const FarColor* Color, int Mode));
DECLARE_IMPORT_FUNCTION(GetColorDialog, BOOL(WINAPI*)(FarColor* Color, BOOL Centered, BOOL AddTransparent));

#undef DECLARE_IMPORT_FUNCTION
}
Expand Down Expand Up @@ -1564,14 +1563,6 @@ namespace console_detail
SetCursorPosition({ 0, static_cast<int>(WindowRect.height() - 1) });
}

bool console::GetColorDialog(FarColor& Color, bool const Centered, const FarColor* const BaseColor) const
{
if (ExternalConsole.Imports.pGetColorDialog)
return ExternalConsole.Imports.pGetColorDialog(&Color, Centered, BaseColor != nullptr) != FALSE;

return GetColorDialogInternal(Color, Centered, BaseColor);
}

short console::GetDelta() const
{
CONSOLE_SCREEN_BUFFER_INFO csbi;
Expand Down
2 changes: 0 additions & 2 deletions far/console.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -164,8 +164,6 @@ namespace console_detail
bool ResetPosition() const;
bool ResetViewportPosition() const;

bool GetColorDialog(FarColor& Color, bool Centered = false, const FarColor* BaseColor = nullptr) const;

bool ScrollNonClientArea(size_t NumLines, const FAR_CHAR_INFO& Fill) const;

bool IsViewportVisible() const;
Expand Down
4 changes: 2 additions & 2 deletions far/filefilterparams.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "interf.hpp"
#include "datetime.hpp"
#include "strmix.hpp"
#include "console.hpp"
#include "setcolor.hpp"
#include "flink.hpp"
#include "lang.hpp"
#include "locale.hpp"
Expand Down Expand Up @@ -788,7 +788,7 @@ static intptr_t FileFilterConfigDlgProc(Dialog* Dlg,intptr_t Msg,intptr_t Param1
static const PaletteColors BaseIndices[]{ COL_PANELTEXT, COL_PANELSELECTEDTEXT, COL_PANELCURSOR, COL_PANELSELECTEDCURSOR };
const auto BaseColor = colors::PaletteColorToFarColor(BaseIndices[(Param1 - ID_HER_NORMALFILE) / 2]);

if (console.GetColorDialog(((Param1-ID_HER_NORMALFILE)&1)? Context->Colors->Color[(Param1-ID_HER_NORMALFILE)/2].MarkColor : Context->Colors->Color[(Param1-ID_HER_NORMALFILE)/2].FileColor, true, &BaseColor))
if (GetColorDialog(((Param1-ID_HER_NORMALFILE)&1)? Context->Colors->Color[(Param1-ID_HER_NORMALFILE)/2].MarkColor : Context->Colors->Color[(Param1-ID_HER_NORMALFILE)/2].FileColor, true, &BaseColor))
Dlg->SendMessage(DM_REFRESHCOLORS, 0, nullptr);
}

Expand Down
3 changes: 2 additions & 1 deletion far/plugapi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "global.hpp"
#include "lockscrn.hpp"
#include "exception_handler.hpp"
#include "setcolor.hpp"

// Platform:
#include "platform.fs.hpp"
Expand Down Expand Up @@ -3085,7 +3086,7 @@ BOOL WINAPI apiColorDialog(const UUID* PluginId, COLORDIALOGFLAGS Flags, FarColo
return cpp_try(
[&]
{
return !Global->WindowManager->ManagerIsDown() && console.GetColorDialog(*Color, true);
return !Global->WindowManager->ManagerIsDown() && GetColorDialog(*Color, true);
},
[]
{
Expand Down
4 changes: 2 additions & 2 deletions far/setcolor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ static void ChangeColor(PaletteColors PaletteIndex, PaletteColors const* const B
auto NewColor = Global->Opt->Palette[PaletteIndex];
const auto BottomColor = BottomPaletteIndex? &Global->Opt->Palette[*BottomPaletteIndex] : nullptr;

if (!console.GetColorDialog(NewColor, false, BottomColor))
if (!GetColorDialog(NewColor, false, BottomColor))
return;

Global->Opt->Palette.Set(PaletteIndex, { &NewColor, 1 });
Expand Down Expand Up @@ -768,7 +768,7 @@ static intptr_t GetColorDlgProc(Dialog* Dlg, intptr_t Msg, intptr_t Param1, void
return Dlg->DefProc(Msg, Param1, Param2);
}

bool GetColorDialogInternal(FarColor& Color, bool const bCentered, const FarColor* const BaseColor)
bool GetColorDialog(FarColor& Color, bool const bCentered, const FarColor* const BaseColor)
{
auto ColorDlg = MakeDialogItems<cd_count>(
{
Expand Down
2 changes: 1 addition & 1 deletion far/setcolor.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,6 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
struct FarColor;

void SetColors();
bool GetColorDialogInternal(FarColor& Color, bool bCentered, const FarColor* BaseColor);
bool GetColorDialog(FarColor& Color, bool bCentered, const FarColor* BaseColor = {});

#endif // SETCOLOR_HPP_6E3A8440_946E_46AA_AAE1_372CAD23A7E6
2 changes: 1 addition & 1 deletion far/vbuild.m4
Original file line number Diff line number Diff line change
@@ -1 +1 @@
5875
5876

0 comments on commit 253f760

Please sign in to comment.