kwin Library API Documentation

WebButtonSticky.cpp

00001 /* 00002 'Web' kwin client 00003 00004 Copyright (C) 2001 Rik Hemsley (rikkus) <rik@kde.org> 00005 00006 This program is free software; you can redistribute it and/or 00007 modify it under the terms of the GNU General Public 00008 License as published by the Free Software Foundation; either 00009 version 2 of the License, or (at your option) any later version. 00010 00011 This program is distributed in the hope that it will be useful, 00012 but WITHOUT ANY WARRANTY; without even the implied warranty of 00013 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00014 General Public License for more details. 00015 00016 You should have received a copy of the GNU General Public License 00017 along with this program; see the file COPYING. If not, write to 00018 the Free Software Foundation, Inc., 59 Temple Place - Suite 330, 00019 Boston, MA 02111-1307, USA. 00020 */ 00021 00022 #include "WebButtonSticky.h" 00023 00024 namespace Web { 00025 00026 static unsigned char sticky_bits[] = 00027 { 00028 0x20, 0x70, 0xfa, 0x7e, 0x3c, 0x1c, 0x32, 0x01 00029 }; 00030 00031 static unsigned char unsticky_bits[] = 00032 { 00033 0x1c, 0x1c, 0x1c, 0x3e, 0x7f, 0x08, 0x08, 0x08 00034 }; 00035 00036 WebButtonSticky::WebButtonSticky(bool sticky, QWidget * parent, WebClient* deco) 00037 : WebButton(parent, sticky?i18n("Not On All Desktops"):i18n("On All Desktops"), deco) 00038 { 00039 QBitmap b(8, 8, sticky ? unsticky_bits : sticky_bits, true /* isXBitmap */); 00040 b.setMask(b); 00041 setBitmap(b); 00042 } 00043 00044 void 00045 WebButtonSticky::slotOnAllDesktopsChange(bool sticky) 00046 { 00047 QBitmap b(8, 8, sticky ? unsticky_bits : sticky_bits, true /* isXBitmap */); 00048 b.setMask(b); 00049 setBitmap(b); 00050 setTipText(sticky ? i18n("Not On All Desktops") : i18n("On All Desktops")); 00051 } 00052 00053 void 00054 WebButtonSticky::clickEvent(int /* button */) 00055 { 00056 emit(toggleSticky()); 00057 } 00058 00059 } 00060 00061 #include "WebButtonSticky.moc" 00062 // vim:ts=2:sw=2:tw=78:set et:
KDE Logo
This file is part of the documentation for kwin Library Version 3.2.2.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Thu Sep 16 15:59:33 2004 by doxygen 1.3.7 written by Dimitri van Heesch, © 1997-2003