Skip to content

Commit

Permalink
Release 1.0.14
Browse files Browse the repository at this point in the history
* Improved code base by using PVS Studio static code analyzer.
* Fixed several issues reported by PVS Studio static analyzer.
* Added tk::Menu::showmp method to show menu at current mouse cursor's position
  as a window transient for specified widget.
* Updated module versions in dependencies.
  • Loading branch information
sadko4u committed Sep 9, 2023
2 parents 2f6bd99 + be9244c commit cb8718e
Show file tree
Hide file tree
Showing 89 changed files with 779 additions and 768 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,13 @@
* RECENT CHANGES
*******************************************************************************

=== 1.0.14 ===
* Improved code base by using PVS Studio static code analyzer.
* Fixed several issues reported by PVS Studio static analyzer.
* Added tk::Menu::showmp method to show menu at current mouse cursor's position
as a window transient for specified widget.
* Updated module versions in dependencies.

=== 1.0.13 ===
* Several fixes and optimizations related to tk::LedMeterChannel and tk::LedMeter.
* Fixed bug in tk::TabControl widget destruction.
Expand Down
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -329,4 +329,7 @@ The result of this example:
![Indicator widget](res/doc/example-msg.png)
## SAST Tools
* [PVS-Studio](https://pvs-studio.com/en/pvs-studio/?utm_source=website&utm_medium=github&utm_campaign=open_source) - static analyzer for C, C++, C#, and Java code.
18 changes: 10 additions & 8 deletions include/lsp-plug.in/tk/prop/base/Flags.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,19 +33,12 @@ namespace lsp

class Flags: public Property
{
private:
Flags & operator = (const Flags &);
Flags(const Flags &);

protected:
size_t nFlags; // Bit field of flags
const char * const *pFlags; // Flag description
atom_t *vAtoms; // List of associated atoms

protected:
virtual void push();
virtual void commit(atom_t property);

status_t unbind();
status_t bind(atom_t id, Style *style);
status_t bind(const char *id, Style *style);
Expand All @@ -59,9 +52,18 @@ namespace lsp
bool unset(size_t ordinal);
bool toggle(size_t ordinal);

protected:
virtual void push() override;
virtual void commit(atom_t property) override;

protected:
explicit Flags(const char * const *flags, atom_t *atoms, prop::Listener *listener = NULL);
virtual ~Flags();
Flags(const Flags &) = delete;
Flags(Flags &&) = delete;
virtual ~Flags() override;

Flags & operator = (const Flags &) = delete;
Flags & operator = (Flags &&) = delete;
};

} /* namespace tk */
Expand Down
17 changes: 9 additions & 8 deletions include/lsp-plug.in/tk/prop/flags/Allocation.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* Copyright (C) 2020 Linux Studio Plugins Project <https://lsp-plug.in/>
* (C) 2020 Vladimir Sadovnikov <[email protected]>
* Copyright (C) 2023 Linux Studio Plugins Project <https://lsp-plug.in/>
* (C) 2023 Vladimir Sadovnikov <[email protected]>
*
* This file is part of lsp-tk-lib
* Created on: 16 мая 2020 г.
Expand Down Expand Up @@ -39,10 +39,6 @@ namespace lsp
*/
class Allocation: public Flags
{
private:
Allocation & operator = (const Allocation &);
Allocation(const Allocation &);

protected:
static const char * const FLAGS[];

Expand All @@ -62,7 +58,12 @@ namespace lsp
atom_t vAtoms[F_TOTAL];

protected:
inline Allocation(prop::Listener *listener = NULL): Flags(FLAGS, vAtoms, listener) {}
Allocation(prop::Listener *listener = NULL);
Allocation(const Allocation &) = delete;
Allocation(Allocation &&) = delete;

Allocation & operator = (const Allocation &) = delete;
Allocation & operator = (Allocation &&) = delete;

public:
inline bool hfill() const { return Flags::get(F_HFILL); }
Expand Down Expand Up @@ -119,7 +120,7 @@ namespace lsp
*/
inline status_t unbind() { return tk::Allocation::unbind(); };
};
}
} /* namespace prop */

} /* namespace tk */
} /* namespace lsp */
Expand Down
19 changes: 10 additions & 9 deletions include/lsp-plug.in/tk/prop/flags/WindowActions.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* Copyright (C) 2020 Linux Studio Plugins Project <https://lsp-plug.in/>
* (C) 2020 Vladimir Sadovnikov <[email protected]>
* Copyright (C) 2023 Linux Studio Plugins Project <https://lsp-plug.in/>
* (C) 2023 Vladimir Sadovnikov <[email protected]>
*
* This file is part of lsp-tk-lib
* Created on: 8 мая 2020 г.
Expand Down Expand Up @@ -35,15 +35,16 @@ namespace lsp

class WindowActions: public BitEnum
{
private:
WindowActions & operator = (const WindowActions &);
WindowActions(const WindowActions &);

protected:
static const prop::enum_t ENUM[];

protected:
explicit WindowActions(prop::Listener *listener = NULL): BitEnum(ENUM, listener) {};
WindowActions(const WindowActions &) = delete;
WindowActions(WindowActions &&) = delete;

WindowActions & operator = (const WindowActions &) = delete;
WindowActions & operator = (WindowActions &&) = delete;

public:
inline bool allowed(ws::window_action_t wa) const { return nValue & wa; }
Expand Down Expand Up @@ -128,9 +129,9 @@ namespace lsp
*/
inline status_t unbind() { return tk::WindowActions::unbind(); };
};
}
}
}
} /* namespace prop */
} /* namespace tk */
} /* namespace lsp */



Expand Down
8 changes: 4 additions & 4 deletions include/lsp-plug.in/tk/prop/multi/Font.h
Original file line number Diff line number Diff line change
Expand Up @@ -82,12 +82,12 @@ namespace lsp

protected:
void push_masked(size_t mask);
virtual void push();
virtual void commit(atom_t property);
virtual void push() override;
virtual void commit(atom_t property) override;

protected:
explicit Font(prop::Listener *listener = NULL);
virtual ~Font();
virtual ~Font() override;

public:
inline void set_default() { MultiProperty::set_default(vAtoms, DESC); }
Expand Down Expand Up @@ -123,7 +123,7 @@ namespace lsp
void set(const ws::Font *f);

public:
virtual void override();
virtual void override() override;

bool get_parameters(ws::ISurface *s, float scaling, ws::font_parameters_t *fp) const;
bool get_parameters(Display *dpy, float scaling, ws::font_parameters_t *fp) const;
Expand Down
17 changes: 9 additions & 8 deletions include/lsp-plug.in/tk/prop/multi/Vector2D.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,6 @@ namespace lsp
*/
class Vector2D: public MultiProperty
{
private:
Vector2D & operator = (const Vector2D &);
Vector2D(const Vector2D &);

protected:
enum property_t
{
Expand All @@ -66,16 +62,21 @@ namespace lsp
float fPhi; // Angle

protected:
virtual void push();
virtual void commit(atom_t property);
virtual void push() override;
virtual void commit(atom_t property) override;

static void calc_cart (float *dx, float *dy, float rho, float phi);
static void calc_polar (float *rho, float *phi, float dx, float dy);
static bool parse(float *dx, float *dy, float *rho, float *phi, const LSPString *s);

protected:
explicit Vector2D(prop::Listener *listener = NULL);
virtual ~Vector2D();
Vector2D(const Vector2D &) = delete;
Vector2D(Vector2D &&) = delete;
virtual ~Vector2D() override;

Vector2D & operator = (const Vector2D &) = delete;
Vector2D & operator = (Vector2D &&) = delete;

public:
inline float dx() const { return fDX; }
Expand Down Expand Up @@ -136,7 +137,7 @@ namespace lsp
*/
inline status_t unbind() { return tk::Vector2D::unbind(vAtoms, DESC, &sListener); };
};
}
} /* namespace prop */

} /* namespace tk */
} /* namespace lsp */
Expand Down
15 changes: 8 additions & 7 deletions include/lsp-plug.in/tk/prop/simple/Boolean.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* Copyright (C) 2020 Linux Studio Plugins Project <https://lsp-plug.in/>
* (C) 2020 Vladimir Sadovnikov <[email protected]>
* Copyright (C) 2023 Linux Studio Plugins Project <https://lsp-plug.in/>
* (C) 2023 Vladimir Sadovnikov <[email protected]>
*
* This file is part of lsp-tk-lib
* Created on: 7 мая 2020 г.
Expand Down Expand Up @@ -35,10 +35,6 @@ namespace lsp
*/
class Boolean: public SimpleProperty
{
private:
Boolean & operator = (const Boolean &);
Boolean(const Boolean &);

protected:
bool bValue;

Expand All @@ -48,8 +44,13 @@ namespace lsp

protected:
explicit Boolean(prop::Listener *listener = NULL);
Boolean(const Boolean &) = delete;
Boolean(Boolean &&) = delete;
virtual ~Boolean();

Boolean & operator = (const Boolean &) = delete;
Boolean & operator = (Boolean &&) = delete;

public:
/**
* Get value of the boolean property
Expand Down Expand Up @@ -127,7 +128,7 @@ namespace lsp

inline void listener(prop::Listener *listener) { pListener = listener; }
};
}
} /* namespace prop */

} /* namespace tk */
} /* namespace lsp */
Expand Down
15 changes: 8 additions & 7 deletions include/lsp-plug.in/tk/prop/simple/Float.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* Copyright (C) 2020 Linux Studio Plugins Project <https://lsp-plug.in/>
* (C) 2020 Vladimir Sadovnikov <[email protected]>
* Copyright (C) 2023 Linux Studio Plugins Project <https://lsp-plug.in/>
* (C) 2023 Vladimir Sadovnikov <[email protected]>
*
* This file is part of lsp-tk-lib
* Created on: 9 окт. 2019 г.
Expand Down Expand Up @@ -35,10 +35,6 @@ namespace lsp
*/
class Float: public SimpleProperty
{
private:
Float & operator = (const Float &);
Float(const Float &);

protected:
float fValue;

Expand All @@ -48,8 +44,13 @@ namespace lsp

protected:
explicit Float(prop::Listener *listener = NULL);
Float(const Float &) = delete;
Float(Float &&) = delete;
virtual ~Float();

Float & operator = (const Float &) = delete;
Float & operator = (Float &&) = delete;

public:
/**
* Get value of the float property
Expand Down Expand Up @@ -109,7 +110,7 @@ namespace lsp

inline void listener(prop::Listener *listener) { pListener = listener; }
};
}
} /* namespace prop */

} /* namespace tk */
} /* namespace lsp */
Expand Down
18 changes: 9 additions & 9 deletions include/lsp-plug.in/tk/prop/simple/Integer.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* Copyright (C) 2020 Linux Studio Plugins Project <https://lsp-plug.in/>
* (C) 2020 Vladimir Sadovnikov <[email protected]>
* Copyright (C) 2023 Linux Studio Plugins Project <https://lsp-plug.in/>
* (C) 2023 Vladimir Sadovnikov <[email protected]>
*
* This file is part of lsp-tk-lib
* Created on: 6 мая 2020 г.
Expand Down Expand Up @@ -31,26 +31,26 @@ namespace lsp
namespace tk
{
/**
* Integering property interface
* Integer property interface
*/
class Integer: public SimpleProperty
{
private:
Integer & operator = (const Integer &);
Integer(const Integer &);

protected:
ssize_t nValue;
Listener sListener;

protected:
virtual void commit(atom_t property);
virtual void push();

protected:
explicit Integer(prop::Listener *listener = NULL);
Integer(const Integer &) = delete;
Integer(Integer &&) = delete;
virtual ~Integer();

Integer & operator = (const Integer &) = delete;
Integer & operator = (Integer &&) = delete;

public:
/**
* Get value of the float property
Expand Down Expand Up @@ -107,7 +107,7 @@ namespace lsp

inline void listener(prop::Listener *listener) { pListener = listener; }
};
}
} /* namespace prop */

} /* namespace tk */
} /* namespace lsp */
Expand Down
15 changes: 8 additions & 7 deletions include/lsp-plug.in/tk/prop/simple/PathPattern.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,17 +37,18 @@ namespace lsp
*/
class PathPattern: public Property
{
private:
PathPattern & operator = (const PathPattern &);
PathPattern(const PathPattern &);

protected:
io::PathPattern sPattern;

protected:
explicit PathPattern(prop::Listener *listener = NULL);
PathPattern(const PathPattern &) = delete;
PathPattern(PathPattern &&) = delete;
virtual ~PathPattern();

PathPattern & operator = (const PathPattern &) = delete;
PathPattern & operator = (PathPattern &&);

public:
const io::PathPattern *pattern() const { return &sPattern; }
const LSPString *get() const { return sPattern.get(); }
Expand Down Expand Up @@ -85,8 +86,8 @@ namespace lsp
public:
explicit PathPattern(prop::Listener *listener = NULL): tk::PathPattern(listener) {};
};
}
}
}
} /* namespace prop */
} /* namespace tk */
} /* namespace lsp */

#endif /* LSP_PLUG_IN_TK_PROP_SIMPLE_PATHPATTERN_H_ */
Loading

0 comments on commit cb8718e

Please sign in to comment.