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

61 lines
1.2 KiB
C
Raw Normal View History

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