This repository has been archived on 2025-03-02. You can view files and clone it, but cannot push or open issues or pull requests.
neofx-zoomedit/SidebarToolbox.h

60 lines
1.2 KiB
C++

#ifndef SIDEBARTOOLBOX_H_
#define SIDEBARTOOLBOX_H_
#include <gtk/gtk.h>
#include <map>
#include <list>
#include "EditManager.h"
#include "Sidebar.h"
#include "Tool.h"
#include "ToolSelector.h"
class Window;
class SidebarToolbox : Sidebar {
private:
GtkWidget *widget;
Window *window;
std::list<Tool*> tools;
std::map<Tool*, GtkWidget*> buttons;
std::map<GtkWidget*, Tool*> buttonsRev;
Tool *activeTool;
ToolSelector toolSelector;
int cols, rows;
void updateRows(bool changed);
void activateTool(Tool *tool);
// prevent shallow copy
SidebarToolbox(const SidebarToolbox &w);
const SidebarToolbox& operator=(const SidebarToolbox &w);
static void buttonToggled(GtkWidget *button, SidebarToolbox *toolbox);
static void sizeAllocate(GtkWidget *widget, GtkAllocation *allocation, SidebarToolbox *toolbox);
public:
SidebarToolbox(Window *window);
virtual ~SidebarToolbox();
GtkWidget* getWidget() {
return widget;
}
Tool& getActiveTool() {
return *activeTool;
}
void addTool(Tool *tool);
void removeTool(Tool *tool);
void update();
};
#endif /*SIDEBARTOOLBOX_H_*/