00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024 #include "GenericTool.hh"
00025 #include "FbTk/FbWindow.hh"
00026
00027 #include <string>
00028
00029 GenericTool::GenericTool(FbTk::FbWindow *new_window, ToolbarItem::Type type,
00030 ToolTheme &theme):
00031 ToolbarItem(type),
00032 m_window(new_window),
00033 m_theme(theme) {
00034
00035 theme.reconfigSig().attach(this);
00036
00037 if (new_window == 0)
00038 throw std::string("GenericTool: Error! Tried to create a tool with window = 0");
00039 }
00040
00041 GenericTool::~GenericTool() {
00042
00043 }
00044
00045 void GenericTool::move(int x, int y) {
00046 m_window->move(x, y);
00047 }
00048
00049 void GenericTool::resize(unsigned int width, unsigned int height) {
00050 m_window->resize(width, height);
00051 }
00052
00053 void GenericTool::moveResize(int x, int y,
00054 unsigned int width, unsigned int height) {
00055 m_window->moveResize(x, y, width, height);
00056 }
00057
00058 void GenericTool::show() {
00059 m_window->show();
00060 }
00061
00062 void GenericTool::hide() {
00063 m_window->hide();
00064 }
00065
00066 unsigned int GenericTool::width() const {
00067 return m_window->width();
00068 }
00069
00070 unsigned int GenericTool::height() const {
00071 return m_window->height();
00072
00073 }
00074
00075 unsigned int GenericTool::borderWidth() const {
00076 return m_window->borderWidth();
00077 }
00078
00079
00080 void GenericTool::renderTheme() {
00081 m_window->setAlpha(theme().alpha());
00082 m_window->clear();
00083 m_window->updateTransparent();
00084 }
00085
00086 void GenericTool::update(FbTk::Subject *subj) {
00087 renderTheme();
00088 }