Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions HACKING.md
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ to obtain file group
* `DN_DROPDOWNOPENED` - Param2 = 1 - open, 0 - closed.

Note that all true-color capable messages extend but don't replace 'base' 16 palette colors. This is done intentionally as far2l may run in terminal that doesn't support true color palette, and in such case 24bit colors will be ignored and base palette attributes will be used instead.
Size of colors array is `DLG_ITEM_MAX_CUST_COLORS` which is currently 5.

### Added new flags:
* Flags to **manage markers** in **panel** from plugins API
Expand Down
3 changes: 1 addition & 2 deletions NetRocks/src/UI/Activities/ComplexOperationProgress.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ void ComplexOperationProgress::OnIdle()
bool path, file, all, count, errors;
} changed = {};
bool paused;
uint64_t Colors[4];
uint64_t Colors[DLG_ITEM_MAX_CUST_COLORS];
{
std::lock_guard<std::mutex> locker(_state.mtx);
if (_last_path != _state.path) {
Expand Down Expand Up @@ -339,4 +339,3 @@ RemoveProgress::RemoveProgress(const std::string &site_dir, ProgressState &state
: ComplexOperationProgress(site_dir, state, wea_state, MRemoveTitle, false, false)
{
}

2 changes: 1 addition & 1 deletion NetRocks/src/UI/Activities/SimpleOperationProgress.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ void SimpleOperationProgress::Show()

LONG_PTR SimpleOperationProgress::DlgProc(int msg, int param1, LONG_PTR param2)
{
uint64_t Colors[4];
uint64_t Colors[DLG_ITEM_MAX_CUST_COLORS];

//fprintf(stderr, "%x %x\n", msg, param1);
if (msg == DN_ENTERIDLE) {
Expand Down
1 change: 1 addition & 0 deletions far2l/far2sdk/farplug-mb.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ namespace oldfar
#endif
#endif
const int NM = MAX_PATH;
const size_t DLG_ITEM_MAX_CUST_COLORS = 5;

enum FARMESSAGEFLAGS
{
Expand Down
9 changes: 6 additions & 3 deletions far2l/far2sdk/farplug-wide.h
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,9 @@ typedef struct _CHAR_INFO CHAR_INFO;
typedef uint32_t FARMESSAGEFLAGS;
typedef GUID UUID;

FAR_INLINE_CONSTANT size_t
DLG_ITEM_MAX_CUST_COLORS = 5;

FAR_INLINE_CONSTANT FARMESSAGEFLAGS
FMSG_WARNING = 0x00000001,
FMSG_ERRORTYPE = 0x00000002,
Expand Down Expand Up @@ -355,11 +358,11 @@ enum FarMessagesProc

// DM_GETCOLOR,
// DM_SETCOLOR,
DM_GETDEFAULTCOLOR, // Param1 - Item ID, Param2 - uint64_t * -> uint64_t ItemColors[4]
DM_GETDEFAULTCOLOR, // Param1 - Item ID, Param2 - uint64_t * -> uint64_t ItemColors[DLG_ITEM_MAX_CUST_COLORS]

DM_GETTRUECOLOR, // Param1 - Item ID, Param2 - uint64_t * -> uint64_t ItemColors[4]
DM_GETTRUECOLOR, // Param1 - Item ID, Param2 - uint64_t * -> uint64_t ItemColors[DLG_ITEM_MAX_CUST_COLORS]
DM_GETCOLOR = DM_GETTRUECOLOR,
DM_SETTRUECOLOR, // Param1 - Item ID, Param2 - uint64_t * -> uint64_t ItemColors[4]
DM_SETTRUECOLOR, // Param1 - Item ID, Param2 - uint64_t * -> uint64_t ItemColors[DLG_ITEM_MAX_CUST_COLORS]
DM_SETCOLOR = DM_SETTRUECOLOR,

DM_SETTEXTPTRSILENT,
Expand Down
4 changes: 2 additions & 2 deletions far2l/src/dialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6361,7 +6361,7 @@ LONG_PTR SendDlgMessageSynched(HANDLE hDlg, int Msg, int Param1, LONG_PTR Param2
///case DM_GETCOLOR:///
case DM_GETTRUECOLOR: {
if (Param2)
memcpy((uint64_t *)Param2, CurItem->customItemColor, sizeof(uint64_t) * 4);
memcpy((uint64_t *)Param2, CurItem->customItemColor, sizeof(uint64_t) * DLG_ITEM_MAX_CUST_COLORS);
// if (!CurItem->TrueColors) {
// memset((uint64_t *)Param2, 0, sizeof(DialogItemTrueColors));
// } else {
Expand All @@ -6375,7 +6375,7 @@ LONG_PTR SendDlgMessageSynched(HANDLE hDlg, int Msg, int Param1, LONG_PTR Param2
///case DM_SETCOLOR:///
case DM_SETTRUECOLOR: {
if (Param2)
memcpy(CurItem->customItemColor, (uint64_t *)Param2, sizeof(uint64_t) * 4);
memcpy(CurItem->customItemColor, (uint64_t *)Param2, sizeof(uint64_t) * DLG_ITEM_MAX_CUST_COLORS);

// if (!CurItem->TrueColors) {
// CurItem->TrueColors.reset(new DialogItemTrueColors);
Expand Down
2 changes: 0 additions & 2 deletions far2l/src/dialog.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,6 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "CriticalSections.hpp"

class History;

constexpr size_t DLG_ITEM_MAX_CUST_COLORS = 5;
// Флаги текущего режима диалога
enum DIALOG_MODES
{
Expand Down
Loading