From 3006ba49e41538bcc0c4afe958875c59a34550a9 Mon Sep 17 00:00:00 2001 From: fluxgen Date: Tue, 19 Aug 2003 16:15:32 +0000 Subject: moved textbutton to fbtk --- src/ClockTool.hh | 6 +++--- src/FbWinFrame.cc | 30 ++++++++++++++++-------------- src/FbWinFrame.hh | 22 +++++++++++----------- src/IconButton.cc | 6 +++--- src/IconButton.hh | 7 +++---- src/Window.cc | 12 ++++++------ src/Window.hh | 8 ++++---- src/WorkspaceNameTool.hh | 6 +++--- 8 files changed, 49 insertions(+), 48 deletions(-) diff --git a/src/ClockTool.hh b/src/ClockTool.hh index 9dd6d1b..9978f27 100644 --- a/src/ClockTool.hh +++ b/src/ClockTool.hh @@ -20,15 +20,15 @@ // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -// $Id: ClockTool.hh,v 1.2 2003/08/13 09:35:38 fluxgen Exp $ +// $Id: ClockTool.hh,v 1.3 2003/08/19 16:12:43 fluxgen Exp $ #ifndef CLOCKTOOL_HH #define CLOCKTOOL_HH #include "ToolbarItem.hh" -#include "TextButton.hh" +#include "FbTk/TextButton.hh" #include "FbTk/Observer.hh" #include "FbTk/Resource.hh" #include "FbTk/Timer.hh" @@ -63,7 +63,7 @@ private: void update(FbTk::Subject *subj); void renderTheme(); - TextButton m_button; + FbTk::TextButton m_button; const ToolTheme &m_theme; BScreen &m_screen; diff --git a/src/FbWinFrame.cc b/src/FbWinFrame.cc index c65f0b6..f23568b 100644 --- a/src/FbWinFrame.cc +++ b/src/FbWinFrame.cc @@ -19,13 +19,15 @@ // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -// $Id: FbWinFrame.cc,v 1.36 2003/08/13 16:36:37 fluxgen Exp $ +// $Id: FbWinFrame.cc,v 1.37 2003/08/19 16:13:25 fluxgen Exp $ #include "FbWinFrame.hh" -#include "ImageControl.hh" -#include "EventManager.hh" -#include "TextButton.hh" -#include "App.hh" + +#include "FbTk/ImageControl.hh" +#include "FbTk/EventManager.hh" +#include "FbTk/TextButton.hh" +#include "FbTk/App.hh" + #include "FbWinFrameTheme.hh" #ifdef SHAPE #include "Shape.hh" @@ -271,7 +273,7 @@ void FbWinFrame::removeAllButtons() { } } -void FbWinFrame::addLabelButton(TextButton &btn) { +void FbWinFrame::addLabelButton(FbTk::TextButton &btn) { LabelList::iterator found_it = find(m_labelbuttons.begin(), m_labelbuttons.end(), &btn); @@ -282,7 +284,7 @@ void FbWinFrame::addLabelButton(TextButton &btn) { m_labelbuttons.push_back(&btn); } -void FbWinFrame::removeLabelButton(TextButton &btn) { +void FbWinFrame::removeLabelButton(FbTk::TextButton &btn) { LabelList::iterator erase_it = remove(m_labelbuttons.begin(), m_labelbuttons.end(), &btn); @@ -293,7 +295,7 @@ void FbWinFrame::removeLabelButton(TextButton &btn) { } -void FbWinFrame::moveLabelButtonLeft(const TextButton &btn) { +void FbWinFrame::moveLabelButtonLeft(const FbTk::TextButton &btn) { LabelList::iterator it = find(m_labelbuttons.begin(), m_labelbuttons.end(), &btn); @@ -303,7 +305,7 @@ void FbWinFrame::moveLabelButtonLeft(const TextButton &btn) { LabelList::iterator new_pos = it; new_pos--; - TextButton *item = *it; + FbTk::TextButton *item = *it; // remove from list m_labelbuttons.erase(it); // insert on the new place @@ -312,7 +314,7 @@ void FbWinFrame::moveLabelButtonLeft(const TextButton &btn) { redrawTitle(); } -void FbWinFrame::moveLabelButtonRight(const TextButton &btn) { +void FbWinFrame::moveLabelButtonRight(const FbTk::TextButton &btn) { LabelList::iterator it = find(m_labelbuttons.begin(), m_labelbuttons.end(), &btn); @@ -320,7 +322,7 @@ void FbWinFrame::moveLabelButtonRight(const TextButton &btn) { if (it == m_labelbuttons.end() || *it == m_labelbuttons.back()) return; - TextButton *item = *it; + FbTk::TextButton *item = *it; // remove from list LabelList::iterator new_pos = m_labelbuttons.erase(it); new_pos++; @@ -330,7 +332,7 @@ void FbWinFrame::moveLabelButtonRight(const TextButton &btn) { redrawTitle(); } -void FbWinFrame::setLabelButtonFocus(TextButton &btn) { +void FbWinFrame::setLabelButtonFocus(FbTk::TextButton &btn) { LabelList::iterator it = find(m_labelbuttons.begin(), m_labelbuttons.end(), &btn); @@ -1031,7 +1033,7 @@ void FbWinFrame::setBorderWidth(unsigned int borderW) { resize(width(), height() + bw_changes); } -void FbWinFrame::renderButtonFocus(TextButton &button) { +void FbWinFrame::renderButtonFocus(FbTk::TextButton &button) { button.setGC(theme().labelTextFocusGC()); button.setJustify(theme().justify()); @@ -1046,7 +1048,7 @@ void FbWinFrame::renderButtonFocus(TextButton &button) { button.clear(); } -void FbWinFrame::renderButtonUnfocus(TextButton &button) { +void FbWinFrame::renderButtonUnfocus(FbTk::TextButton &button) { button.setGC(theme().labelTextUnfocusGC()); button.setJustify(theme().justify()); button.setBorderWidth(1); diff --git a/src/FbWinFrame.hh b/src/FbWinFrame.hh index ce3fa2a..2379c24 100644 --- a/src/FbWinFrame.hh +++ b/src/FbWinFrame.hh @@ -19,7 +19,7 @@ // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -// $Id: FbWinFrame.hh,v 1.12 2003/08/13 16:36:37 fluxgen Exp $ +// $Id: FbWinFrame.hh,v 1.13 2003/08/19 16:13:25 fluxgen Exp $ #ifndef FBWINFRAME_HH #define FBWINFRAME_HH @@ -38,9 +38,9 @@ class Shape; class FbWinFrameTheme; -class TextButton; namespace FbTk { +class TextButton; class ImageControl; class Command; class Button; @@ -93,15 +93,15 @@ public: /// remove all buttons from titlebar void removeAllButtons(); /// adds a button to label window - void addLabelButton(TextButton &btn); + void addLabelButton(FbTk::TextButton &btn); /// removes a specific button from label window - void removeLabelButton(TextButton &btn); + void removeLabelButton(FbTk::TextButton &btn); /// move label button to the left - void moveLabelButtonLeft(const TextButton &btn); + void moveLabelButtonLeft(const FbTk::TextButton &btn); /// move label button to the right - void moveLabelButtonRight(const TextButton &btn); + void moveLabelButtonRight(const FbTk::TextButton &btn); /// which button is to be rendered focused - void setLabelButtonFocus(TextButton &btn); + void setLabelButtonFocus(FbTk::TextButton &btn); /// attach a client window for client area void setClientWindow(Window win); /// same as above but with FbWindow @@ -182,8 +182,8 @@ private: void renderTitlebar(); void renderHandles(); void renderButtons(); - void renderButtonFocus(TextButton &button); - void renderButtonUnfocus(TextButton &button); + void renderButtonFocus(FbTk::TextButton &button); + void renderButtonUnfocus(FbTk::TextButton &button); void renderLabel(); /// renders to pixmap or sets color void render(const FbTk::Texture &tex, FbTk::Color &col, Pixmap &pm, @@ -217,9 +217,9 @@ private: typedef std::vector ButtonList; ButtonList m_buttons_left, ///< buttons to the left m_buttons_right; ///< buttons to the right - typedef std::list LabelList; + typedef std::list LabelList; LabelList m_labelbuttons; ///< holds label buttons inside label window - TextButton *m_current_label; ///< which client button is focused at the moment + FbTk::TextButton *m_current_label; ///< which client button is focused at the moment std::string m_titletext; ///< text to be displayed int m_label int m_bevel; ///< bevel between titlebar items and titlebar bool m_use_titlebar; ///< if we should use titlebar diff --git a/src/IconButton.cc b/src/IconButton.cc index ce4719a..a1e8cf0 100644 --- a/src/IconButton.cc +++ b/src/IconButton.cc @@ -20,7 +20,7 @@ // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -// $Id: IconButton.cc,v 1.5 2003/08/16 12:04:12 fluxgen Exp $ +// $Id: IconButton.cc,v 1.6 2003/08/19 16:13:25 fluxgen Exp $ #include "IconButton.hh" @@ -42,7 +42,7 @@ IconButton::IconButton(const FbTk::FbWindow &parent, const FbTk::Font &font, FluxboxWindow &win): - TextButton(parent, font, win.winClient().title()), + FbTk::TextButton(parent, font, win.winClient().title()), m_win(win), m_icon_window(*this, 1, 1, 1, 1, ExposureMask | ButtonPressMask | ButtonReleaseMask) { @@ -51,7 +51,7 @@ IconButton::IconButton(const FbTk::FbWindow &parent, const FbTk::Font &font, setOnClick(focus); m_win.hintSig().attach(this); - + FbTk::EventManager::instance()->add(*this, m_icon_window); update(0); diff --git a/src/IconButton.hh b/src/IconButton.hh index de5440c..8367e1a 100644 --- a/src/IconButton.hh +++ b/src/IconButton.hh @@ -20,19 +20,18 @@ // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -// $Id: IconButton.hh,v 1.1 2003/08/11 15:45:50 fluxgen Exp $ +// $Id: IconButton.hh,v 1.2 2003/08/19 16:13:25 fluxgen Exp $ #ifndef ICONBUTTON_HH #define ICONBUTTON_HH #include "FbTk/FbPixmap.hh" #include "FbTk/Observer.hh" - -#include "TextButton.hh" +#include "FbTk/TextButton.hh" class FluxboxWindow; -class IconButton: public TextButton, public FbTk::Observer { +class IconButton: public FbTk::TextButton, public FbTk::Observer { public: IconButton(const FbTk::FbWindow &parent, const FbTk::Font &font, FluxboxWindow &window); virtual ~IconButton(); diff --git a/src/Window.cc b/src/Window.cc index 1ac095a..b5ef439 100644 --- a/src/Window.cc +++ b/src/Window.cc @@ -22,7 +22,7 @@ // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -// $Id: Window.cc,v 1.218 2003/08/13 16:39:24 fluxgen Exp $ +// $Id: Window.cc,v 1.219 2003/08/19 16:13:25 fluxgen Exp $ #include "Window.hh" @@ -34,7 +34,7 @@ #include "Netizen.hh" #include "FbWinFrameTheme.hh" #include "MenuTheme.hh" -#include "TextButton.hh" +#include "FbTk/TextButton.hh" #include "EventManager.hh" #include "FbAtoms.hh" #include "RootTheme.hh" @@ -371,7 +371,7 @@ void FluxboxWindow::init() { frame().gripRight().setCursor(frame().theme().lowerRightAngleCursor()); frame().resize(m_client->width(), m_client->height()); - TextButton *btn = new TextButton(frame().label(), + FbTk::TextButton *btn = new FbTk::TextButton(frame().label(), frame().theme().font(), m_client->title()); btn->setJustify(frame().theme().justify()); @@ -611,7 +611,7 @@ void FluxboxWindow::attachClient(WinClient &client) { (*client_it)->m_win = this; // create a labelbutton for this client and // associate it with the pointer - TextButton *btn = new TextButton(frame().label(), + FbTk::TextButton *btn = new FbTk::TextButton(frame().label(), frame().theme().font(), (*client_it)->title()); btn->setJustify(frame().theme().justify()); @@ -642,7 +642,7 @@ void FluxboxWindow::attachClient(WinClient &client) { } else { // client.fbwindow() == 0 // create a labelbutton for this client and associate it with the pointer - TextButton *btn = new TextButton(frame().label(), + FbTk::TextButton *btn = new FbTk::TextButton(frame().label(), frame().theme().font(), client.title()); m_labelbuttons[&client] = btn; @@ -774,7 +774,7 @@ bool FluxboxWindow::removeClient(WinClient &client) { FbTk::EventManager &evm = *FbTk::EventManager::instance(); evm.remove(client.window()); - TextButton *label_btn = m_labelbuttons[&client]; + FbTk::TextButton *label_btn = m_labelbuttons[&client]; if (label_btn != 0) { frame().removeLabelButton(*label_btn); evm.remove(label_btn->window()); diff --git a/src/Window.hh b/src/Window.hh index f65d17c..767b273 100644 --- a/src/Window.hh +++ b/src/Window.hh @@ -22,7 +22,7 @@ // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -// $Id: Window.hh,v 1.91 2003/08/11 16:57:11 fluxgen Exp $ +// $Id: Window.hh,v 1.92 2003/08/19 16:13:25 fluxgen Exp $ #ifndef WINDOW_HH #define WINDOW_HH @@ -44,10 +44,10 @@ class WinClient; class FbWinFrameTheme; class BScreen; - -class TextButton; class FbWinFrame; + namespace FbTk { +class TextButton; class MenuTheme; class ImageControl; class XLayer; @@ -428,7 +428,7 @@ private: ClientList m_clientlist; WinClient *m_client; - typedef std::map Client2ButtonMap; + typedef std::map Client2ButtonMap; Client2ButtonMap m_labelbuttons; // just temporary solution diff --git a/src/WorkspaceNameTool.hh b/src/WorkspaceNameTool.hh index 0dc49ac..f7cc4f0 100644 --- a/src/WorkspaceNameTool.hh +++ b/src/WorkspaceNameTool.hh @@ -20,14 +20,14 @@ // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -// $Id: WorkspaceNameTool.hh,v 1.2 2003/08/13 10:19:57 fluxgen Exp $ +// $Id: WorkspaceNameTool.hh,v 1.3 2003/08/19 16:15:32 fluxgen Exp $ #ifndef WORKSPACENAMETOOL_HH #define WORKSPACENAMETOOL_HH #include "ToolbarItem.hh" -#include "TextButton.hh" +#include "FbTk/TextButton.hh" #include "FbTk/Observer.hh" class BScreen; @@ -53,7 +53,7 @@ public: private: void renderTheme(); - TextButton m_button; + FbTk::TextButton m_button; const ToolTheme &m_theme; BScreen &m_screen; Pixmap m_pixmap; -- cgit v0.11.2