30 #include <unordered_map>
90 std::shared_ptr<TSBarsData>
tsData,
105 [[nodiscard]]
unsigned int getSpaceN()
const;
111 [[nodiscard]]
unsigned int getSpaceS()
const;
117 [[nodiscard]]
unsigned int getSpaceE()
const;
123 [[nodiscard]]
unsigned int getSpaceW()
const;
124 const std::unordered_map<std::string, std::string> &
getData()
const;
151 std::vector<std::unique_ptr<Bar>>
bars;
155 std::unordered_map<std::string, std::string>
data;
Class to manage the bars This class is a singleton and is responsible for managing the bars instancia...
Definition: Bars.hpp:56
static Bars * instance
Definition: Bars.hpp:150
std::shared_ptr< TSBarsData > tsData
Definition: Bars.hpp:154
std::shared_ptr< ConfigDataBars > configData
Definition: Bars.hpp:153
void setWidgetTypeHandle(const std::string &widgetType, void *handle)
Definition: Bars.cpp:153
std::vector< Window > windows
Definition: Bars.hpp:152
void run()
Run the Bars class in a separate thread.
Definition: Bars.cpp:93
std::unordered_map< std::string, void * > widgetTypeHandle
Definition: Bars.hpp:164
Bars & operator=(const Bars &)=delete
Display * display
Definition: Bars.hpp:156
const std::set< std::string > & getPluginsLocations() const
Definition: Bars.cpp:139
unsigned int getSpaceE() const
Get the spaceE value used to calculate the space left for the Layout Manager.
Definition: Bars.cpp:188
Bars(const Bars &)=delete
Bars()
Definition: Bars.cpp:124
void stop_thread()
Stop the thread (join)
Definition: Bars.cpp:195
void redraw()
Redraw the bars by calling the draw method of each bar.
Definition: Bars.cpp:119
unsigned int getSpaceS() const
Get the spaceS value used to calculate the space left for the Layout Manager.
Definition: Bars.cpp:187
std::vector< std::unique_ptr< Bar > > bars
Definition: Bars.hpp:151
void start_thread()
Definition: Bars.cpp:90
unsigned int spaceE
Definition: Bars.hpp:160
unsigned int getSpaceN() const
Get the spaceN value used to calculate the space left for the Layout Manager.
Definition: Bars.cpp:186
unsigned int spaceS
Definition: Bars.hpp:159
void * getWidgetTypeHandle(const std::string &widgetType)
Definition: Bars.cpp:143
void init(std::shared_ptr< ConfigDataBars > configData, std::shared_ptr< TSBarsData > tsData, Display *display, Window root)
Initialize the Bars class.
Definition: Bars.cpp:40
unsigned int getSpaceW() const
Get the spaceW value used to calculate the space left for the Layout Manager.
Definition: Bars.cpp:189
const std::unordered_map< std::string, std::string > & getData() const
Definition: Bars.cpp:190
void addPluginLocation(const std::string &location)
Definition: Bars.cpp:135
std::set< std::string > pluginsLocations
Definition: Bars.hpp:163
unsigned int spaceW
Definition: Bars.hpp:161
~Bars()
Definition: Bars.cpp:156
bool isBarWindow(Window window)
Check if the window is a bar window used to filter events in EventHandler.
Definition: Bars.cpp:191
static void createInstance()
Create the singleton instance if the instance is already created, it will do nothing.
Definition: Bars.cpp:173
static Bars & getInstance()
Get the singleton instance if the instance is not created, it will create it.
Definition: Bars.cpp:177
unsigned int spaceN
Definition: Bars.hpp:158
static void destroy()
Destroy the singleton instance if the instance is not created, it will do nothing.
Definition: Bars.cpp:182
Window root
Definition: Bars.hpp:157
void subscribeWidget(Widget *w)
Definition: Bars.cpp:199
std::thread barThread
Definition: Bars.hpp:162
std::unordered_map< std::string, std::vector< Widget * > > subscriptions
Definition: Bars.hpp:165
std::unordered_map< std::string, std::string > data
Definition: Bars.hpp:155
ConfigDataBars class.
Definition: ConfigDataBars.hpp:42
Definition: TSBarsData.hpp:32