news download themes documentation links










GenericTool.cc

00001 // GenericTool.cc for Fluxbox
00002 // Copyright (c) 2003 Henrik Kinnunen (fluxgen at users.sourceforge.net)
00003 //
00004 // Permission is hereby granted, free of charge, to any person obtaining a
00005 // copy of this software and associated documentation files (the "Software"),
00006 // to deal in the Software without restriction, including without limitation
00007 // the rights to use, copy, modify, merge, publish, distribute, sublicense,
00008 // and/or sell copies of the Software, and to permit persons to whom the
00009 // Software is furnished to do so, subject to the following conditions:
00010 //
00011 // The above copyright notice and this permission notice shall be included in
00012 // all copies or substantial portions of the Software.
00013 //
00014 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
00015 // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
00016 // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
00017 // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
00018 // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
00019 // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
00020 // DEALINGS IN THE SOFTWARE.
00021 
00022 // $Id: GenericTool.cc,v 1.3 2004/01/13 14:41:32 rathnor Exp $
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 }

Fluxbox CVS-Jan-2003




      



Got comments about the page? Send them to webmaster.
If you have general Fluxbox related questions ask them on our irc channel or mailing lists.

Show Source








Designed by aLEczapKA