all repos — fluxbox @ 3006ba49e41538bcc0c4afe958875c59a34550a9

custom fork of the fluxbox windowmanager

moved textbutton to fbtk
fluxgen fluxgen
commit

3006ba49e41538bcc0c4afe958875c59a34550a9

parent

3dc7ab05994208549917e57323ba60194b2ec420

M src/ClockTool.hhsrc/ClockTool.hh

@@ -20,15 +20,15 @@ // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING

// 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 @@ void updateTime();

void update(FbTk::Subject *subj); void renderTheme(); - TextButton m_button; + FbTk::TextButton m_button; const ToolTheme &m_theme; BScreen &m_screen;
M src/FbWinFrame.ccsrc/FbWinFrame.cc

@@ -19,13 +19,15 @@ // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING

// 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 @@ m_buttons_right.pop_back();

} } -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 @@

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 @@ m_labelbuttons.erase(erase_it);

} -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 @@ return;

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 @@ // update titlebar

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 @@ // make sure we found it and we're not at the last item

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 @@ // update titlebar

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 @@ if (bw_changes != 0)

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 @@

button.clear(); } -void FbWinFrame::renderButtonUnfocus(TextButton &button) { +void FbWinFrame::renderButtonUnfocus(FbTk::TextButton &button) { button.setGC(theme().labelTextUnfocusGC()); button.setJustify(theme().justify()); button.setBorderWidth(1);
M src/FbWinFrame.hhsrc/FbWinFrame.hh

@@ -19,7 +19,7 @@ // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING

// 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 @@ #include <memory>

class Shape; class FbWinFrameTheme; -class TextButton; namespace FbTk { +class TextButton; class ImageControl; class Command; class Button;

@@ -93,15 +93,15 @@ void addRightButton(FbTk::Button *btn);

/// 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 @@ //@{

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 @@ //@}

typedef std::vector<FbTk::Button *> ButtonList; ButtonList m_buttons_left, ///< buttons to the left m_buttons_right; ///< buttons to the right - typedef std::list<TextButton *> LabelList; + typedef std::list<FbTk::TextButton *> 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
M src/IconButton.ccsrc/IconButton.cc

@@ -20,7 +20,7 @@ // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING

// 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 @@ #endif // SHAPE

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 @@ FbTk::RefCount<FbTk::Command> focus(new FbTk::SimpleCommand<FluxboxWindow>(m_win, &FluxboxWindow::raiseAndFocus));

setOnClick(focus); m_win.hintSig().attach(this); - + FbTk::EventManager::instance()->add(*this, m_icon_window); update(0);
M src/IconButton.hhsrc/IconButton.hh

@@ -20,19 +20,18 @@ // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING

// 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();
M src/Window.ccsrc/Window.cc

@@ -22,7 +22,7 @@ // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING

// 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 "StringUtil.hh"

#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 @@ frame().gripLeft().setCursor(frame().theme().lowerLeftAngleCursor());

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 @@

(*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 @@ delete old_win;

} 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 @@

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());
M src/Window.hhsrc/Window.hh

@@ -22,7 +22,7 @@ // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING

// 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 @@ Decoration m_old_decoration;

ClientList m_clientlist; WinClient *m_client; - typedef std::map<WinClient *, TextButton *> Client2ButtonMap; + typedef std::map<WinClient *, FbTk::TextButton *> Client2ButtonMap; Client2ButtonMap m_labelbuttons; // just temporary solution
M src/WorkspaceNameTool.hhsrc/WorkspaceNameTool.hh

@@ -20,14 +20,14 @@ // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING

// 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 @@ void update(FbTk::Subject *subj);

private: void renderTheme(); - TextButton m_button; + FbTk::TextButton m_button; const ToolTheme &m_theme; BScreen &m_screen; Pixmap m_pixmap;