code cleaning
This commit is contained in:
parent
8735c6a08b
commit
bb02a522fb
15 changed files with 139 additions and 155 deletions
|
@ -19,7 +19,7 @@
|
||||||
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||||
// DEALINGS IN THE SOFTWARE.
|
// DEALINGS IN THE SOFTWARE.
|
||||||
|
|
||||||
// $Id: Ewmh.cc,v 1.34 2003/12/12 15:19:22 fluxgen Exp $
|
// $Id: Ewmh.cc,v 1.35 2003/12/18 18:03:21 fluxgen Exp $
|
||||||
|
|
||||||
#include "Ewmh.hh"
|
#include "Ewmh.hh"
|
||||||
|
|
||||||
|
@ -203,7 +203,7 @@ void Ewmh::updateClientList(BScreen &screen) {
|
||||||
|
|
||||||
//number of windows to show in client list
|
//number of windows to show in client list
|
||||||
num = win;
|
num = win;
|
||||||
screen.rootWindow().changeProperty(m_net_client_list,
|
screen.rootWindow().changeProperty(m_net_client_list,
|
||||||
XA_CARDINAL, 32,
|
XA_CARDINAL, 32,
|
||||||
PropModeReplace, (unsigned char *)wl, num);
|
PropModeReplace, (unsigned char *)wl, num);
|
||||||
|
|
||||||
|
|
|
@ -22,7 +22,7 @@
|
||||||
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||||
// DEALINGS IN THE SOFTWARE.
|
// DEALINGS IN THE SOFTWARE.
|
||||||
|
|
||||||
// $Id: Menu.cc,v 1.50 2003/12/17 00:43:22 fluxgen Exp $
|
// $Id: Menu.cc,v 1.51 2003/12/18 18:03:23 fluxgen Exp $
|
||||||
|
|
||||||
//use GNU extensions
|
//use GNU extensions
|
||||||
#ifndef _GNU_SOURCE
|
#ifndef _GNU_SOURCE
|
||||||
|
@ -89,9 +89,9 @@ Menu::Menu(MenuTheme &tm, ImageControl &imgctrl):
|
||||||
torn =
|
torn =
|
||||||
visible = false;
|
visible = false;
|
||||||
|
|
||||||
menu.x =
|
|
||||||
menu.y =
|
|
||||||
menu.x_shift =
|
menu.x_shift =
|
||||||
menu.y_shift =
|
menu.y_shift =
|
||||||
menu.x_move =
|
menu.x_move =
|
||||||
menu.y_move = 0;
|
menu.y_move = 0;
|
||||||
|
@ -600,8 +600,6 @@ void Menu::internal_hide() {
|
||||||
|
|
||||||
void Menu::move(int x, int y) {
|
void Menu::move(int x, int y) {
|
||||||
|
|
||||||
menu.x = x;
|
|
||||||
menu.y = y;
|
|
||||||
menu.window.move(x, y);
|
menu.window.move(x, y);
|
||||||
|
|
||||||
if (which_sub != -1)
|
if (which_sub != -1)
|
||||||
|
@ -663,47 +661,47 @@ void Menu::drawSubmenu(unsigned int index) {
|
||||||
if (item->submenu()->m_parent != this)
|
if (item->submenu()->m_parent != this)
|
||||||
item->submenu()->m_parent = this;
|
item->submenu()->m_parent = this;
|
||||||
|
|
||||||
int sbl = index / menu.persub, i = index - (sbl * menu.persub),
|
int sbl = index / menu.persub, i = index - (sbl * menu.persub);
|
||||||
x = menu.x +
|
int new_x = x() + ((menu.item_w * (sbl + 1)) + menu.window.borderWidth());
|
||||||
((menu.item_w * (sbl + 1)) + menu.window.borderWidth()), y;
|
int new_y;
|
||||||
|
|
||||||
if (m_alignment == ALIGNTOP) {
|
if (m_alignment == ALIGNTOP) {
|
||||||
y = (((shifted) ? menu.y_shift : menu.y) +
|
new_y = (((shifted) ? menu.y_shift : y()) +
|
||||||
((title_vis) ? menu.title_h + menu.title.borderWidth() : 0) -
|
((title_vis) ? menu.title_h + menu.title.borderWidth() : 0) -
|
||||||
((item->submenu()->title_vis) ?
|
((item->submenu()->title_vis) ?
|
||||||
item->submenu()->menu.title_h + menu.window.borderWidth() : 0));
|
item->submenu()->menu.title_h + menu.window.borderWidth() : 0));
|
||||||
} else {
|
} else {
|
||||||
y = (((shifted) ? menu.y_shift : menu.y) +
|
new_y = (((shifted) ? menu.y_shift : y()) +
|
||||||
(menu.item_h * i) +
|
(menu.item_h * i) +
|
||||||
((title_vis) ? menu.title_h + menu.window.borderWidth() : 0) -
|
((title_vis) ? menu.title_h + menu.window.borderWidth() : 0) -
|
||||||
((item->submenu()->title_vis) ?
|
((item->submenu()->title_vis) ?
|
||||||
item->submenu()->menu.title_h + menu.window.borderWidth() : 0));
|
item->submenu()->menu.title_h + menu.window.borderWidth() : 0));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (m_alignment == ALIGNBOTTOM &&
|
if (m_alignment == ALIGNBOTTOM &&
|
||||||
(y + item->submenu()->height()) > ((shifted) ? menu.y_shift :
|
(new_y + item->submenu()->height()) > ((shifted) ? menu.y_shift :
|
||||||
menu.y) + height()) {
|
y()) + height()) {
|
||||||
y = (((shifted) ? menu.y_shift : menu.y) +
|
new_y = (((shifted) ? menu.y_shift : y()) +
|
||||||
height() - item->submenu()->height());
|
height() - item->submenu()->height());
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((x + item->submenu()->width()) > m_screen_width) {
|
if ((new_x + item->submenu()->width()) > m_screen_width) {
|
||||||
x = ((shifted) ? menu.x_shift : menu.x) -
|
new_x = ((shifted) ? menu.x_shift : x()) -
|
||||||
item->submenu()->width() - menu.window.borderWidth();
|
item->submenu()->width() - menu.window.borderWidth();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (x < 0)
|
if (new_x < 0)
|
||||||
x = 0;
|
new_x = 0;
|
||||||
|
|
||||||
if ((y + item->submenu()->height()) > m_screen_height) {
|
if ((new_y + item->submenu()->height()) > m_screen_height) {
|
||||||
y = m_screen_height - item->submenu()->height() -
|
new_y = m_screen_height - item->submenu()->height() -
|
||||||
menu.window.borderWidth() * 2;
|
menu.window.borderWidth() * 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (y < 0)
|
if (new_y < 0)
|
||||||
y = 0;
|
new_y = 0;
|
||||||
|
|
||||||
item->submenu()->move(x, y);
|
item->submenu()->move(new_x, new_y);
|
||||||
if (! moving)
|
if (! moving)
|
||||||
drawItem(index, true);
|
drawItem(index, true);
|
||||||
|
|
||||||
|
@ -1068,8 +1066,8 @@ void Menu::buttonPressEvent(XButtonEvent &be) {
|
||||||
drawItem(w, item->isEnabled(), true, true);
|
drawItem(w, item->isEnabled(), true, true);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
menu.x_move = be.x_root - menu.x;
|
menu.x_move = be.x_root - x();
|
||||||
menu.y_move = be.y_root - menu.y;
|
menu.y_move = be.y_root - y();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1133,10 +1131,7 @@ void Menu::motionNotifyEvent(XMotionEvent &me) {
|
||||||
if (which_sub >= 0)
|
if (which_sub >= 0)
|
||||||
drawSubmenu(which_sub);
|
drawSubmenu(which_sub);
|
||||||
} else {
|
} else {
|
||||||
menu.x = me.x_root - menu.x_move,
|
menu.window.move(me.x_root - menu.x_move, me.y_root - menu.y_move);
|
||||||
menu.y = me.y_root - menu.y_move;
|
|
||||||
|
|
||||||
menu.window.move(menu.x, menu.y);
|
|
||||||
|
|
||||||
// if (which_sub >= 0)
|
// if (which_sub >= 0)
|
||||||
// drawSubmenu(which_sub);
|
// drawSubmenu(which_sub);
|
||||||
|
@ -1245,19 +1240,19 @@ void Menu::enterNotifyEvent(XCrossingEvent &ce) {
|
||||||
if (menu.frame != ce.window)
|
if (menu.frame != ce.window)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
menu.x_shift = menu.x, menu.y_shift = menu.y;
|
menu.x_shift = x(), menu.y_shift = y();
|
||||||
if (menu.x + width() > m_screen_width) {
|
if (x() + width() > m_screen_width) {
|
||||||
menu.x_shift = m_screen_width - width() - 2*m_border_width;
|
menu.x_shift = m_screen_width - width() - 2*m_border_width;
|
||||||
shifted = true;
|
shifted = true;
|
||||||
} else if (menu.x < 0) {
|
} else if (x() < 0) {
|
||||||
menu.x_shift = 0; //-m_border_width;
|
menu.x_shift = 0; //-m_border_width;
|
||||||
shifted = true;
|
shifted = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (menu.y + height() + 2*m_border_width > m_screen_height) {
|
if (y() + height() + 2*m_border_width > m_screen_height) {
|
||||||
menu.y_shift = m_screen_height - height() - 2*m_border_width;
|
menu.y_shift = m_screen_height - height() - 2*m_border_width;
|
||||||
shifted = true;
|
shifted = true;
|
||||||
} else if (menu.y + (signed) menu.title_h < 0) {
|
} else if (y() + (signed) menu.title_h < 0) {
|
||||||
menu.y_shift = 0; // -m_border_width;;
|
menu.y_shift = 0; // -m_border_width;;
|
||||||
shifted = true;
|
shifted = true;
|
||||||
}
|
}
|
||||||
|
@ -1295,7 +1290,7 @@ void Menu::leaveNotifyEvent(XCrossingEvent &ce) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (shifted) {
|
if (shifted) {
|
||||||
menu.window.move(menu.x, menu.y);
|
// menu.window.move(menu.x, menu.y);
|
||||||
shifted = false;
|
shifted = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -22,7 +22,7 @@
|
||||||
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||||
// DEALINGS IN THE SOFTWARE.
|
// DEALINGS IN THE SOFTWARE.
|
||||||
|
|
||||||
// $Id: Menu.hh,v 1.28 2003/12/17 00:43:22 fluxgen Exp $
|
// $Id: Menu.hh,v 1.29 2003/12/18 18:03:23 fluxgen Exp $
|
||||||
|
|
||||||
#ifndef FBTK_MENU_HH
|
#ifndef FBTK_MENU_HH
|
||||||
#define FBTK_MENU_HH
|
#define FBTK_MENU_HH
|
||||||
|
@ -140,8 +140,8 @@ public:
|
||||||
inline FbWindow &titleWindow() { return menu.title; }
|
inline FbWindow &titleWindow() { return menu.title; }
|
||||||
inline FbWindow &frameWindow() { return menu.frame; }
|
inline FbWindow &frameWindow() { return menu.frame; }
|
||||||
inline const std::string &label() const { return menu.label; }
|
inline const std::string &label() const { return menu.label; }
|
||||||
inline int x() const { return menu.x; }
|
inline int x() const { return menu.window.x(); }
|
||||||
inline int y() const { return menu.y; }
|
inline int y() const { return menu.window.y(); }
|
||||||
inline unsigned int width() const { return menu.window.width(); }
|
inline unsigned int width() const { return menu.window.width(); }
|
||||||
inline unsigned int height() const { return menu.window.height(); }
|
inline unsigned int height() const { return menu.window.height(); }
|
||||||
inline unsigned int numberOfItems() const { return menuitems.size(); }
|
inline unsigned int numberOfItems() const { return menuitems.size(); }
|
||||||
|
@ -203,7 +203,7 @@ private:
|
||||||
FbTk::FbWindow window, frame, title;
|
FbTk::FbWindow window, frame, title;
|
||||||
|
|
||||||
std::string label;
|
std::string label;
|
||||||
int x, y, x_move, y_move, x_shift, y_shift, sublevels, persub, minsub,
|
int x_move, y_move, x_shift, y_shift, sublevels, persub, minsub,
|
||||||
grab_x, grab_y;
|
grab_x, grab_y;
|
||||||
unsigned int title_h, frame_h, item_w, item_h, bevel_w,
|
unsigned int title_h, frame_h, item_w, item_h, bevel_w,
|
||||||
bevel_h;
|
bevel_h;
|
||||||
|
|
|
@ -19,7 +19,7 @@
|
||||||
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||||
// DEALINGS IN THE SOFTWARE.
|
// DEALINGS IN THE SOFTWARE.
|
||||||
|
|
||||||
// $Id: FbWinFrame.cc,v 1.66 2003/12/16 12:46:14 rathnor Exp $
|
// $Id: FbWinFrame.cc,v 1.67 2003/12/18 18:03:21 fluxgen Exp $
|
||||||
|
|
||||||
#include "FbWinFrame.hh"
|
#include "FbWinFrame.hh"
|
||||||
|
|
||||||
|
@ -43,11 +43,11 @@
|
||||||
using namespace std;
|
using namespace std;
|
||||||
|
|
||||||
FbWinFrame::FbWinFrame(FbWinFrameTheme &theme, FbTk::ImageControl &imgctrl,
|
FbWinFrame::FbWinFrame(FbWinFrameTheme &theme, FbTk::ImageControl &imgctrl,
|
||||||
int screen_num, int x, int y,
|
int x, int y,
|
||||||
unsigned int width, unsigned int height):
|
unsigned int width, unsigned int height):
|
||||||
m_theme(theme),
|
m_theme(theme),
|
||||||
m_imagectrl(imgctrl),
|
m_imagectrl(imgctrl),
|
||||||
m_window(screen_num, x, y, width, height, ButtonPressMask | ButtonReleaseMask |
|
m_window(theme.screenNum(), x, y, width, height, ButtonPressMask | ButtonReleaseMask |
|
||||||
ButtonMotionMask | EnterWindowMask, true),
|
ButtonMotionMask | EnterWindowMask, true),
|
||||||
m_titlebar(m_window, 0, 0, 100, 16,
|
m_titlebar(m_window, 0, 0, 100, 16,
|
||||||
ButtonPressMask | ButtonReleaseMask |
|
ButtonPressMask | ButtonReleaseMask |
|
||||||
|
|
|
@ -19,7 +19,7 @@
|
||||||
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||||
// DEALINGS IN THE SOFTWARE.
|
// DEALINGS IN THE SOFTWARE.
|
||||||
|
|
||||||
// $Id: FbWinFrame.hh,v 1.26 2003/12/16 23:34:36 fluxgen Exp $
|
// $Id: FbWinFrame.hh,v 1.27 2003/12/18 18:03:21 fluxgen Exp $
|
||||||
|
|
||||||
#ifndef FBWINFRAME_HH
|
#ifndef FBWINFRAME_HH
|
||||||
#define FBWINFRAME_HH
|
#define FBWINFRAME_HH
|
||||||
|
@ -54,8 +54,8 @@ class FbWinFrame:public FbTk::EventHandler {
|
||||||
public:
|
public:
|
||||||
|
|
||||||
/// create a top level window
|
/// create a top level window
|
||||||
FbWinFrame(FbWinFrameTheme &theme, FbTk::ImageControl &imgctrl,
|
FbWinFrame(FbWinFrameTheme &theme, FbTk::ImageControl &imgctrl,
|
||||||
int screen_num, int x, int y,
|
int x, int y,
|
||||||
unsigned int width, unsigned int height);
|
unsigned int width, unsigned int height);
|
||||||
|
|
||||||
/// create a frame window inside another FbWindow, NOT IMPLEMENTED!
|
/// create a frame window inside another FbWindow, NOT IMPLEMENTED!
|
||||||
|
|
|
@ -20,7 +20,7 @@
|
||||||
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||||
// DEALINGS IN THE SOFTWARE.
|
// DEALINGS IN THE SOFTWARE.
|
||||||
|
|
||||||
// $Id: IconbarTool.cc,v 1.22 2003/12/12 14:36:22 fluxgen Exp $
|
// $Id: IconbarTool.cc,v 1.23 2003/12/18 18:03:21 fluxgen Exp $
|
||||||
|
|
||||||
#include "IconbarTool.hh"
|
#include "IconbarTool.hh"
|
||||||
|
|
||||||
|
@ -245,7 +245,7 @@ IconbarTool::IconbarTool(const FbTk::FbWindow &parent, IconbarTheme &theme, BScr
|
||||||
screen.name() + ".iconbar.clientWidth", screen.altName() + ".Iconbar.ClientWidth"),
|
screen.name() + ".iconbar.clientWidth", screen.altName() + ".Iconbar.ClientWidth"),
|
||||||
m_rc_use_pixmap(screen.resourceManager(), true,
|
m_rc_use_pixmap(screen.resourceManager(), true,
|
||||||
screen.name() + ".iconbar.usePixmap", screen.altName() + ".Iconbar.UsePixmap"),
|
screen.name() + ".iconbar.usePixmap", screen.altName() + ".Iconbar.UsePixmap"),
|
||||||
m_menu(*screen.menuTheme(), screen.imageControl(),
|
m_menu(screen.menuTheme(), screen.imageControl(),
|
||||||
*screen.layerManager().getLayer(Fluxbox::instance()->getMenuLayer())) {
|
*screen.layerManager().getLayer(Fluxbox::instance()->getMenuLayer())) {
|
||||||
|
|
||||||
// setup mode menu
|
// setup mode menu
|
||||||
|
|
|
@ -22,7 +22,7 @@
|
||||||
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||||
// DEALINGS IN THE SOFTWARE.
|
// DEALINGS IN THE SOFTWARE.
|
||||||
|
|
||||||
// $Id: Screen.cc,v 1.250 2003/12/18 15:27:21 fluxgen Exp $
|
// $Id: Screen.cc,v 1.251 2003/12/18 18:03:21 fluxgen Exp $
|
||||||
|
|
||||||
|
|
||||||
#include "Screen.hh"
|
#include "Screen.hh"
|
||||||
|
@ -355,8 +355,8 @@ BScreen::BScreen(FbTk::ResourceManager &rm,
|
||||||
// before we load the theme
|
// before we load the theme
|
||||||
|
|
||||||
winFrameTheme().font().setAntialias(*resource.antialias);
|
winFrameTheme().font().setAntialias(*resource.antialias);
|
||||||
menuTheme()->titleFont().setAntialias(*resource.antialias);
|
menuTheme().titleFont().setAntialias(*resource.antialias);
|
||||||
menuTheme()->frameFont().setAntialias(*resource.antialias);
|
menuTheme().frameFont().setAntialias(*resource.antialias);
|
||||||
|
|
||||||
|
|
||||||
// create geometry window
|
// create geometry window
|
||||||
|
@ -600,7 +600,7 @@ void BScreen::update(FbTk::Subject *subj) {
|
||||||
}
|
}
|
||||||
|
|
||||||
FbTk::Menu *BScreen::createMenu(const std::string &label) {
|
FbTk::Menu *BScreen::createMenu(const std::string &label) {
|
||||||
FbTk::Menu *menu = new FbMenu(*menuTheme(),
|
FbTk::Menu *menu = new FbMenu(menuTheme(),
|
||||||
imageControl(),
|
imageControl(),
|
||||||
*layerManager().getLayer(Fluxbox::instance()->getMenuLayer()));
|
*layerManager().getLayer(Fluxbox::instance()->getMenuLayer()));
|
||||||
if (!label.empty())
|
if (!label.empty())
|
||||||
|
@ -1142,7 +1142,7 @@ FluxboxWindow *BScreen::createWindow(Window client) {
|
||||||
if (winclient->fbwindow()) // may have been set in an atomhandler
|
if (winclient->fbwindow()) // may have been set in an atomhandler
|
||||||
win = winclient->fbwindow();
|
win = winclient->fbwindow();
|
||||||
else {
|
else {
|
||||||
win = new FluxboxWindow(*winclient, *this,
|
win = new FluxboxWindow(*winclient,
|
||||||
winFrameTheme(),
|
winFrameTheme(),
|
||||||
*layerManager().getLayer(Fluxbox::instance()->getNormalLayer()));
|
*layerManager().getLayer(Fluxbox::instance()->getNormalLayer()));
|
||||||
|
|
||||||
|
@ -1183,7 +1183,7 @@ FluxboxWindow *BScreen::createWindow(Window client) {
|
||||||
}
|
}
|
||||||
|
|
||||||
FluxboxWindow *BScreen::createWindow(WinClient &client) {
|
FluxboxWindow *BScreen::createWindow(WinClient &client) {
|
||||||
FluxboxWindow *win = new FluxboxWindow(client, *this,
|
FluxboxWindow *win = new FluxboxWindow(client,
|
||||||
winFrameTheme(),
|
winFrameTheme(),
|
||||||
*layerManager().getLayer(Fluxbox::instance()->getNormalLayer()));
|
*layerManager().getLayer(Fluxbox::instance()->getNormalLayer()));
|
||||||
#ifdef SLIT
|
#ifdef SLIT
|
||||||
|
|
|
@ -22,7 +22,7 @@
|
||||||
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||||
// DEALINGS IN THE SOFTWARE.
|
// DEALINGS IN THE SOFTWARE.
|
||||||
|
|
||||||
// $Id: Screen.hh,v 1.127 2003/12/12 18:18:12 fluxgen Exp $
|
// $Id: Screen.hh,v 1.128 2003/12/18 18:03:21 fluxgen Exp $
|
||||||
|
|
||||||
#ifndef SCREEN_HH
|
#ifndef SCREEN_HH
|
||||||
#define SCREEN_HH
|
#define SCREEN_HH
|
||||||
|
@ -204,8 +204,8 @@ public:
|
||||||
|
|
||||||
inline FbWinFrameTheme &winFrameTheme() { return *m_windowtheme.get(); }
|
inline FbWinFrameTheme &winFrameTheme() { return *m_windowtheme.get(); }
|
||||||
inline const FbWinFrameTheme &winFrameTheme() const { return *m_windowtheme.get(); }
|
inline const FbWinFrameTheme &winFrameTheme() const { return *m_windowtheme.get(); }
|
||||||
inline MenuTheme *menuTheme() { return m_menutheme.get(); }
|
inline MenuTheme &menuTheme() { return *m_menutheme.get(); }
|
||||||
inline const MenuTheme *menuTheme() const { return m_menutheme.get(); }
|
inline const MenuTheme &menuTheme() const { return *m_menutheme.get(); }
|
||||||
inline const RootTheme &rootTheme() const { return *m_root_theme.get(); }
|
inline const RootTheme &rootTheme() const { return *m_root_theme.get(); }
|
||||||
inline WinButtonTheme &winButtonTheme() { return *m_winbutton_theme.get(); }
|
inline WinButtonTheme &winButtonTheme() { return *m_winbutton_theme.get(); }
|
||||||
inline const WinButtonTheme &winButtonTheme() const { return *m_winbutton_theme.get(); }
|
inline const WinButtonTheme &winButtonTheme() const { return *m_winbutton_theme.get(); }
|
||||||
|
|
|
@ -20,7 +20,7 @@
|
||||||
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||||
// DEALINGS IN THE SOFTWARE.
|
// DEALINGS IN THE SOFTWARE.
|
||||||
|
|
||||||
// $Id: SendToMenu.cc,v 1.6 2003/12/17 00:45:30 fluxgen Exp $
|
// $Id: SendToMenu.cc,v 1.7 2003/12/18 18:03:21 fluxgen Exp $
|
||||||
|
|
||||||
#include "SendToMenu.hh"
|
#include "SendToMenu.hh"
|
||||||
|
|
||||||
|
@ -45,7 +45,7 @@ private:
|
||||||
};
|
};
|
||||||
|
|
||||||
SendToMenu::SendToMenu(FluxboxWindow &win):
|
SendToMenu::SendToMenu(FluxboxWindow &win):
|
||||||
FbMenu(*win.screen().menuTheme(),
|
FbMenu(win.screen().menuTheme(),
|
||||||
win.screen().imageControl(),
|
win.screen().imageControl(),
|
||||||
*win.screen().layerManager().getLayer(Fluxbox::instance()->getMenuLayer())),
|
*win.screen().layerManager().getLayer(Fluxbox::instance()->getMenuLayer())),
|
||||||
m_win(win) {
|
m_win(win) {
|
||||||
|
|
10
src/Slit.cc
10
src/Slit.cc
|
@ -22,7 +22,7 @@
|
||||||
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||||
// DEALINGS IN THE SOFTWARE.
|
// DEALINGS IN THE SOFTWARE.
|
||||||
|
|
||||||
// $Id: Slit.cc,v 1.83 2003/12/10 23:08:03 fluxgen Exp $
|
// $Id: Slit.cc,v 1.84 2003/12/18 18:03:21 fluxgen Exp $
|
||||||
|
|
||||||
#include "Slit.hh"
|
#include "Slit.hh"
|
||||||
|
|
||||||
|
@ -235,16 +235,16 @@ unsigned int Slit::s_eventmask = SubstructureRedirectMask | ButtonPressMask |
|
||||||
Slit::Slit(BScreen &scr, FbTk::XLayer &layer, const char *filename)
|
Slit::Slit(BScreen &scr, FbTk::XLayer &layer, const char *filename)
|
||||||
: m_hidden(false),
|
: m_hidden(false),
|
||||||
m_screen(scr),
|
m_screen(scr),
|
||||||
m_slitmenu(*scr.menuTheme(),
|
m_slitmenu(scr.menuTheme(),
|
||||||
scr.imageControl(),
|
scr.imageControl(),
|
||||||
*scr.layerManager().getLayer(Fluxbox::instance()->getMenuLayer())),
|
*scr.layerManager().getLayer(Fluxbox::instance()->getMenuLayer())),
|
||||||
m_placement_menu(*scr.menuTheme(),
|
m_placement_menu(scr.menuTheme(),
|
||||||
scr.imageControl(),
|
scr.imageControl(),
|
||||||
*scr.layerManager().getLayer(Fluxbox::instance()->getMenuLayer())),
|
*scr.layerManager().getLayer(Fluxbox::instance()->getMenuLayer())),
|
||||||
m_clientlist_menu(*scr.menuTheme(),
|
m_clientlist_menu(scr.menuTheme(),
|
||||||
scr.imageControl(),
|
scr.imageControl(),
|
||||||
*scr.layerManager().getLayer(Fluxbox::instance()->getMenuLayer())),
|
*scr.layerManager().getLayer(Fluxbox::instance()->getMenuLayer())),
|
||||||
m_layermenu(new LayerMenu<Slit>(*scr.menuTheme(),
|
m_layermenu(new LayerMenu<Slit>(scr.menuTheme(),
|
||||||
scr.imageControl(),
|
scr.imageControl(),
|
||||||
*scr.layerManager().getLayer(Fluxbox::instance()->getMenuLayer()),
|
*scr.layerManager().getLayer(Fluxbox::instance()->getMenuLayer()),
|
||||||
this,
|
this,
|
||||||
|
|
|
@ -22,7 +22,7 @@
|
||||||
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||||
// DEALINGS IN THE SOFTWARE.
|
// DEALINGS IN THE SOFTWARE.
|
||||||
|
|
||||||
// $Id: Toolbar.cc,v 1.131 2003/12/10 23:08:03 fluxgen Exp $
|
// $Id: Toolbar.cc,v 1.132 2003/12/18 18:03:21 fluxgen Exp $
|
||||||
|
|
||||||
#include "Toolbar.hh"
|
#include "Toolbar.hh"
|
||||||
|
|
||||||
|
@ -191,15 +191,15 @@ Toolbar::Toolbar(BScreen &scrn, FbTk::XLayer &layer, size_t width):
|
||||||
frame(*this, scrn.screenNumber()),
|
frame(*this, scrn.screenNumber()),
|
||||||
m_window_pm(0),
|
m_window_pm(0),
|
||||||
m_screen(scrn),
|
m_screen(scrn),
|
||||||
m_layermenu(*scrn.menuTheme(),
|
m_layermenu(scrn.menuTheme(),
|
||||||
scrn.imageControl(),
|
scrn.imageControl(),
|
||||||
*scrn.layerManager().getLayer(Fluxbox::instance()->getMenuLayer()),
|
*scrn.layerManager().getLayer(Fluxbox::instance()->getMenuLayer()),
|
||||||
this,
|
this,
|
||||||
true),
|
true),
|
||||||
m_placementmenu(*scrn.menuTheme(),
|
m_placementmenu(scrn.menuTheme(),
|
||||||
scrn.imageControl(),
|
scrn.imageControl(),
|
||||||
*scrn.layerManager().getLayer(Fluxbox::instance()->getMenuLayer())),
|
*scrn.layerManager().getLayer(Fluxbox::instance()->getMenuLayer())),
|
||||||
m_toolbarmenu(*scrn.menuTheme(),
|
m_toolbarmenu(scrn.menuTheme(),
|
||||||
scrn.imageControl(),
|
scrn.imageControl(),
|
||||||
*scrn.layerManager().getLayer(Fluxbox::instance()->getMenuLayer())),
|
*scrn.layerManager().getLayer(Fluxbox::instance()->getMenuLayer())),
|
||||||
m_theme(scrn.screenNumber()),
|
m_theme(scrn.screenNumber()),
|
||||||
|
@ -792,7 +792,7 @@ void Toolbar::setupMenus() {
|
||||||
|
|
||||||
if (screen().hasXinerama()) {
|
if (screen().hasXinerama()) {
|
||||||
// TODO: nls (main label plus menu heading
|
// TODO: nls (main label plus menu heading
|
||||||
menu().insert("On Head...", new XineramaHeadMenu<Toolbar>(*screen().menuTheme(),
|
menu().insert("On Head...", new XineramaHeadMenu<Toolbar>(screen().menuTheme(),
|
||||||
screen(),
|
screen(),
|
||||||
screen().imageControl(),
|
screen().imageControl(),
|
||||||
*screen().layerManager().getLayer(Fluxbox::instance()->getMenuLayer()),
|
*screen().layerManager().getLayer(Fluxbox::instance()->getMenuLayer()),
|
||||||
|
|
|
@ -22,7 +22,7 @@
|
||||||
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||||
// DEALINGS IN THE SOFTWARE.
|
// DEALINGS IN THE SOFTWARE.
|
||||||
|
|
||||||
// $Id: Window.cc,v 1.253 2003/12/14 01:06:22 fluxgen Exp $
|
// $Id: Window.cc,v 1.254 2003/12/18 18:03:21 fluxgen Exp $
|
||||||
|
|
||||||
#include "Window.hh"
|
#include "Window.hh"
|
||||||
|
|
||||||
|
@ -248,7 +248,7 @@ void LayerMenuItem<FluxboxWindow>::click(int button, int time) {
|
||||||
m_object->moveToLayer(m_layernum);
|
m_object->moveToLayer(m_layernum);
|
||||||
}
|
}
|
||||||
|
|
||||||
FluxboxWindow::FluxboxWindow(WinClient &client, BScreen &scr, FbWinFrameTheme &tm,
|
FluxboxWindow::FluxboxWindow(WinClient &client, FbWinFrameTheme &tm,
|
||||||
FbTk::XLayer &layer):
|
FbTk::XLayer &layer):
|
||||||
oplock(false),
|
oplock(false),
|
||||||
m_hintsig(*this),
|
m_hintsig(*this),
|
||||||
|
@ -262,16 +262,16 @@ FluxboxWindow::FluxboxWindow(WinClient &client, BScreen &scr, FbWinFrameTheme &t
|
||||||
iconic(false), focused(false),
|
iconic(false), focused(false),
|
||||||
stuck(false), m_managed(false),
|
stuck(false), m_managed(false),
|
||||||
maximized(MAX_NONE),
|
maximized(MAX_NONE),
|
||||||
m_screen(scr),
|
m_screen(client.screen()),
|
||||||
display(FbTk::App::instance()->display()),
|
display(FbTk::App::instance()->display()),
|
||||||
m_windowmenu(*scr.menuTheme(), scr.imageControl(),
|
m_windowmenu(client.screen().menuTheme(), client.screen().imageControl(),
|
||||||
*scr.layerManager().getLayer(Fluxbox::instance()->getMenuLayer())),
|
*client.screen().layerManager().getLayer(Fluxbox::instance()->getMenuLayer())),
|
||||||
m_old_decoration(DECOR_NORMAL),
|
m_old_decoration(DECOR_NORMAL),
|
||||||
m_client(&client),
|
m_client(&client),
|
||||||
m_frame(new FbWinFrame(tm, scr.imageControl(), scr.screenNumber(), 0, 0, 100, 100)),
|
m_frame(tm, client.screen().imageControl(), 0, 0, 100, 100),
|
||||||
m_layeritem(m_frame->window(), layer),
|
m_layeritem(m_frame.window(), layer),
|
||||||
m_layernum(layer.getLayerNum()),
|
m_layernum(layer.getLayerNum()),
|
||||||
m_parent(scr.rootWindow()),
|
m_parent(client.screen().rootWindow()),
|
||||||
m_resize_corner(RIGHTBOTTOM) {
|
m_resize_corner(RIGHTBOTTOM) {
|
||||||
|
|
||||||
init();
|
init();
|
||||||
|
@ -539,12 +539,15 @@ void FluxboxWindow::init() {
|
||||||
|
|
||||||
setState(m_current_state);
|
setState(m_current_state);
|
||||||
|
|
||||||
|
// add extra menus
|
||||||
|
addExtraMenu("Send To...", new SendToMenu(*this));
|
||||||
addExtraMenu("Layer...",
|
addExtraMenu("Layer...",
|
||||||
new LayerMenu<FluxboxWindow>(*screen().menuTheme(),
|
new LayerMenu<FluxboxWindow>(screen().menuTheme(),
|
||||||
screen().imageControl(),
|
screen().imageControl(),
|
||||||
*screen().layerManager().getLayer(Fluxbox::instance()->getMenuLayer()),
|
*screen().layerManager().getLayer(Fluxbox::instance()->getMenuLayer()),
|
||||||
this,
|
this,
|
||||||
false));
|
false));
|
||||||
|
|
||||||
// the layermenu will get deleted as an extra menu
|
// the layermenu will get deleted as an extra menu
|
||||||
// don't call setupWindow here as the addExtraMenu call should
|
// don't call setupWindow here as the addExtraMenu call should
|
||||||
|
|
||||||
|
@ -3093,22 +3096,6 @@ const FbTk::FbWindow &FluxboxWindow::fbWindow() const {
|
||||||
return frame().window();
|
return frame().window();
|
||||||
}
|
}
|
||||||
|
|
||||||
int FluxboxWindow::x() const {
|
|
||||||
return frame().x();
|
|
||||||
}
|
|
||||||
|
|
||||||
int FluxboxWindow::y() const {
|
|
||||||
return frame().y();
|
|
||||||
}
|
|
||||||
|
|
||||||
unsigned int FluxboxWindow::width() const {
|
|
||||||
return frame().width();
|
|
||||||
}
|
|
||||||
|
|
||||||
unsigned int FluxboxWindow::height() const {
|
|
||||||
return frame().height();
|
|
||||||
}
|
|
||||||
|
|
||||||
unsigned int FluxboxWindow::titlebarHeight() const {
|
unsigned int FluxboxWindow::titlebarHeight() const {
|
||||||
return frame().titlebarHeight();
|
return frame().titlebarHeight();
|
||||||
}
|
}
|
||||||
|
@ -3321,7 +3308,6 @@ void FluxboxWindow::setupWindow() {
|
||||||
// sets up our window
|
// sets up our window
|
||||||
// we allow both to be done at once to share the commands
|
// we allow both to be done at once to share the commands
|
||||||
|
|
||||||
FbWinFrame &frame = *m_frame.get();
|
|
||||||
WinButtonTheme &winbutton_theme = screen().winButtonTheme();
|
WinButtonTheme &winbutton_theme = screen().winButtonTheme();
|
||||||
|
|
||||||
typedef FbTk::RefCount<FbTk::Command> CommandRef;
|
typedef FbTk::RefCount<FbTk::Command> CommandRef;
|
||||||
|
@ -3343,7 +3329,7 @@ void FluxboxWindow::setupWindow() {
|
||||||
CommandRef show_menu_cmd(new WindowCmd(*this, &FluxboxWindow::popupMenu));
|
CommandRef show_menu_cmd(new WindowCmd(*this, &FluxboxWindow::popupMenu));
|
||||||
|
|
||||||
// clear old buttons from frame
|
// clear old buttons from frame
|
||||||
frame.removeAllButtons();
|
frame().removeAllButtons();
|
||||||
//!! TODO: fix this ugly hack
|
//!! TODO: fix this ugly hack
|
||||||
// get titlebar configuration
|
// get titlebar configuration
|
||||||
const vector<Fluxbox::Titlebar> *dir = &Fluxbox::instance()->getTitlebarLeft();
|
const vector<Fluxbox::Titlebar> *dir = &Fluxbox::instance()->getTitlebarLeft();
|
||||||
|
@ -3354,14 +3340,14 @@ void FluxboxWindow::setupWindow() {
|
||||||
if (isIconifiable() && (*dir)[i] == Fluxbox::MINIMIZE) {
|
if (isIconifiable() && (*dir)[i] == Fluxbox::MINIMIZE) {
|
||||||
newbutton = new WinButton(*this, winbutton_theme,
|
newbutton = new WinButton(*this, winbutton_theme,
|
||||||
WinButton::MINIMIZE,
|
WinButton::MINIMIZE,
|
||||||
frame.titlebar(),
|
frame().titlebar(),
|
||||||
0, 0, 10, 10);
|
0, 0, 10, 10);
|
||||||
newbutton->setOnClick(iconify_cmd);
|
newbutton->setOnClick(iconify_cmd);
|
||||||
|
|
||||||
} else if (isMaximizable() && (*dir)[i] == Fluxbox::MAXIMIZE) {
|
} else if (isMaximizable() && (*dir)[i] == Fluxbox::MAXIMIZE) {
|
||||||
newbutton = new WinButton(*this, winbutton_theme,
|
newbutton = new WinButton(*this, winbutton_theme,
|
||||||
WinButton::MAXIMIZE,
|
WinButton::MAXIMIZE,
|
||||||
frame.titlebar(),
|
frame().titlebar(),
|
||||||
0, 0, 10, 10);
|
0, 0, 10, 10);
|
||||||
|
|
||||||
newbutton->setOnClick(maximize_cmd, 1);
|
newbutton->setOnClick(maximize_cmd, 1);
|
||||||
|
@ -3371,7 +3357,7 @@ void FluxboxWindow::setupWindow() {
|
||||||
} else if (m_client->isClosable() && (*dir)[i] == Fluxbox::CLOSE) {
|
} else if (m_client->isClosable() && (*dir)[i] == Fluxbox::CLOSE) {
|
||||||
newbutton = new WinButton(*this, winbutton_theme,
|
newbutton = new WinButton(*this, winbutton_theme,
|
||||||
WinButton::CLOSE,
|
WinButton::CLOSE,
|
||||||
frame.titlebar(),
|
frame().titlebar(),
|
||||||
0, 0, 10, 10);
|
0, 0, 10, 10);
|
||||||
|
|
||||||
newbutton->setOnClick(close_cmd);
|
newbutton->setOnClick(close_cmd);
|
||||||
|
@ -3379,7 +3365,7 @@ void FluxboxWindow::setupWindow() {
|
||||||
} else if ((*dir)[i] == Fluxbox::STICK) {
|
} else if ((*dir)[i] == Fluxbox::STICK) {
|
||||||
WinButton *winbtn = new WinButton(*this, winbutton_theme,
|
WinButton *winbtn = new WinButton(*this, winbutton_theme,
|
||||||
WinButton::STICK,
|
WinButton::STICK,
|
||||||
frame.titlebar(),
|
frame().titlebar(),
|
||||||
0, 0, 10, 10);
|
0, 0, 10, 10);
|
||||||
stateSig().attach(winbtn);
|
stateSig().attach(winbtn);
|
||||||
winbtn->setOnClick(stick_cmd);
|
winbtn->setOnClick(stick_cmd);
|
||||||
|
@ -3387,7 +3373,7 @@ void FluxboxWindow::setupWindow() {
|
||||||
} else if ((*dir)[i] == Fluxbox::SHADE) {
|
} else if ((*dir)[i] == Fluxbox::SHADE) {
|
||||||
WinButton *winbtn = new WinButton(*this, winbutton_theme,
|
WinButton *winbtn = new WinButton(*this, winbutton_theme,
|
||||||
WinButton::SHADE,
|
WinButton::SHADE,
|
||||||
frame.titlebar(),
|
frame().titlebar(),
|
||||||
0, 0, 10, 10);
|
0, 0, 10, 10);
|
||||||
winbtn->setOnClick(shade_cmd);
|
winbtn->setOnClick(shade_cmd);
|
||||||
}
|
}
|
||||||
|
@ -3395,33 +3381,33 @@ void FluxboxWindow::setupWindow() {
|
||||||
if (newbutton != 0) {
|
if (newbutton != 0) {
|
||||||
newbutton->show();
|
newbutton->show();
|
||||||
if (c == 0)
|
if (c == 0)
|
||||||
frame.addLeftButton(newbutton);
|
frame().addLeftButton(newbutton);
|
||||||
else
|
else
|
||||||
frame.addRightButton(newbutton);
|
frame().addRightButton(newbutton);
|
||||||
}
|
}
|
||||||
} //end for i
|
} //end for i
|
||||||
dir = &Fluxbox::instance()->getTitlebarRight();
|
dir = &Fluxbox::instance()->getTitlebarRight();
|
||||||
} // end for c
|
} // end for c
|
||||||
|
|
||||||
frame.reconfigure();
|
frame().reconfigure();
|
||||||
|
|
||||||
// setup titlebar
|
// setup titlebar
|
||||||
frame.setOnClickTitlebar(raise_and_focus_cmd, 1, false, true); // on press with button 1
|
frame().setOnClickTitlebar(raise_and_focus_cmd, 1, false, true); // on press with button 1
|
||||||
frame.setOnClickTitlebar(shade_cmd, 1, true); // doubleclick with button 1
|
frame().setOnClickTitlebar(shade_cmd, 1, true); // doubleclick with button 1
|
||||||
frame.setOnClickTitlebar(show_menu_cmd, 3); // on release with button 3
|
frame().setOnClickTitlebar(show_menu_cmd, 3); // on release with button 3
|
||||||
frame.setOnClickTitlebar(lower_cmd, 2); // on release with button 2
|
frame().setOnClickTitlebar(lower_cmd, 2); // on release with button 2
|
||||||
frame.setDoubleClickTime(Fluxbox::instance()->getDoubleClickInterval());
|
frame().setDoubleClickTime(Fluxbox::instance()->getDoubleClickInterval());
|
||||||
|
|
||||||
// end setup frame
|
// end setup frame
|
||||||
|
|
||||||
// setup menu
|
// setup menu
|
||||||
FbTk::Menu &menu = m_windowmenu;
|
|
||||||
menu.removeAll(); // clear old items
|
menu().removeAll(); // clear old items
|
||||||
menu.disableTitle(); // not titlebar
|
menu().disableTitle(); // not titlebar
|
||||||
|
|
||||||
// set new menu items
|
// set new menu items
|
||||||
menu.insert("Shade", shade_cmd);
|
menu().insert("Shade", shade_cmd);
|
||||||
menu.insert("Stick", stick_cmd);
|
menu().insert("Stick", stick_cmd);
|
||||||
// create maximize item with:
|
// create maximize item with:
|
||||||
// button1: Maximize normal
|
// button1: Maximize normal
|
||||||
// button2: Maximize Vertical
|
// button2: Maximize Vertical
|
||||||
|
@ -3430,23 +3416,23 @@ void FluxboxWindow::setupWindow() {
|
||||||
maximize_item->setCommand(1, maximize_cmd);
|
maximize_item->setCommand(1, maximize_cmd);
|
||||||
maximize_item->setCommand(2, maximize_vert_cmd);
|
maximize_item->setCommand(2, maximize_vert_cmd);
|
||||||
maximize_item->setCommand(3, maximize_horiz_cmd);
|
maximize_item->setCommand(3, maximize_horiz_cmd);
|
||||||
menu.insert(maximize_item);
|
menu().insert(maximize_item);
|
||||||
menu.insert("Iconify", iconify_cmd);
|
menu().insert("Iconify", iconify_cmd);
|
||||||
menu.insert("Raise", raise_cmd);
|
menu().insert("Raise", raise_cmd);
|
||||||
menu.insert("Lower", lower_cmd);
|
menu().insert("Lower", lower_cmd);
|
||||||
|
|
||||||
|
|
||||||
menu.insert("Send To...", new SendToMenu(*this));
|
|
||||||
|
|
||||||
ExtraMenus::iterator it = m_extramenus.begin();
|
ExtraMenus::iterator it = m_extramenus.begin();
|
||||||
ExtraMenus::iterator it_end = m_extramenus.end();
|
ExtraMenus::iterator it_end = m_extramenus.end();
|
||||||
for (; it != it_end; ++it) {
|
for (; it != it_end; ++it) {
|
||||||
it->second->disableTitle(); // be sure there is no title
|
it->second->disableTitle(); // be sure there is no title
|
||||||
menu.insert(it->first, it->second);
|
menu().insert(it->first, it->second);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
menu.insert("---");
|
menu().insert("---");
|
||||||
menu.insert("Close", close_cmd);
|
menu().insert("Close", close_cmd);
|
||||||
|
|
||||||
menu.reconfigure(); // update graphics
|
menu().reconfigure(); // update graphics
|
||||||
}
|
}
|
||||||
|
|
|
@ -22,7 +22,7 @@
|
||||||
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||||
// DEALINGS IN THE SOFTWARE.
|
// DEALINGS IN THE SOFTWARE.
|
||||||
|
|
||||||
// $Id: Window.hh,v 1.103 2003/12/17 01:21:49 fluxgen Exp $
|
// $Id: Window.hh,v 1.104 2003/12/18 18:03:22 fluxgen Exp $
|
||||||
|
|
||||||
#ifndef WINDOW_HH
|
#ifndef WINDOW_HH
|
||||||
#define WINDOW_HH
|
#define WINDOW_HH
|
||||||
|
@ -32,6 +32,7 @@
|
||||||
#include "Subject.hh"
|
#include "Subject.hh"
|
||||||
#include "EventHandler.hh"
|
#include "EventHandler.hh"
|
||||||
#include "XLayerItem.hh"
|
#include "XLayerItem.hh"
|
||||||
|
#include "FbWinFrame.hh"
|
||||||
|
|
||||||
#include <X11/Xlib.h>
|
#include <X11/Xlib.h>
|
||||||
#include <X11/Xutil.h>
|
#include <X11/Xutil.h>
|
||||||
|
@ -132,10 +133,10 @@ public:
|
||||||
};
|
};
|
||||||
|
|
||||||
enum ResizeCorner {
|
enum ResizeCorner {
|
||||||
LEFTTOP,
|
LEFTTOP,
|
||||||
LEFTBOTTOM,
|
LEFTBOTTOM,
|
||||||
RIGHTBOTTOM,
|
RIGHTBOTTOM,
|
||||||
RIGHTTOP
|
RIGHTTOP
|
||||||
};
|
};
|
||||||
|
|
||||||
typedef struct _blackbox_hints {
|
typedef struct _blackbox_hints {
|
||||||
|
@ -152,7 +153,7 @@ public:
|
||||||
typedef std::list<WinClient *> ClientList;
|
typedef std::list<WinClient *> ClientList;
|
||||||
|
|
||||||
/// create a window from a client
|
/// create a window from a client
|
||||||
FluxboxWindow(WinClient &client, BScreen &scr,
|
FluxboxWindow(WinClient &client,
|
||||||
FbWinFrameTheme &tm,
|
FbWinFrameTheme &tm,
|
||||||
FbTk::XLayer &layer);
|
FbTk::XLayer &layer);
|
||||||
|
|
||||||
|
@ -312,22 +313,24 @@ public:
|
||||||
|
|
||||||
const std::string &title() const;
|
const std::string &title() const;
|
||||||
const std::string &iconTitle() const;
|
const std::string &iconTitle() const;
|
||||||
int x() const;
|
inline int x() const { return frame().x(); }
|
||||||
int y() const;
|
inline int y() const { return frame().y(); }
|
||||||
|
inline unsigned int width() const { return frame().width(); }
|
||||||
|
inline unsigned int height() const { return frame().height(); }
|
||||||
|
|
||||||
unsigned int workspaceNumber() const { return m_workspace_number; }
|
unsigned int workspaceNumber() const { return m_workspace_number; }
|
||||||
|
|
||||||
int layerNum() const { return m_layernum; }
|
int layerNum() const { return m_layernum; }
|
||||||
void setLayerNum(int layernum);
|
void setLayerNum(int layernum);
|
||||||
|
|
||||||
unsigned int width() const;
|
|
||||||
unsigned int height() const;
|
|
||||||
unsigned int titlebarHeight() const;
|
unsigned int titlebarHeight() const;
|
||||||
|
|
||||||
bool isLowerTab() const;
|
bool isLowerTab() const;
|
||||||
int initialState() const;
|
int initialState() const;
|
||||||
|
|
||||||
FbWinFrame &frame() { return *m_frame.get(); }
|
inline FbWinFrame &frame() { return m_frame; }
|
||||||
const FbWinFrame &frame() const { return *m_frame.get(); }
|
inline const FbWinFrame &frame() const { return m_frame; }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@name signals
|
@name signals
|
||||||
|
@ -455,7 +458,7 @@ private:
|
||||||
unsigned int m_old_width, m_old_height; ///< old size so we can restore from maximized state
|
unsigned int m_old_width, m_old_height; ///< old size so we can restore from maximized state
|
||||||
int m_last_button_x, ///< last known x position of the mouse button
|
int m_last_button_x, ///< last known x position of the mouse button
|
||||||
m_last_button_y; ///< last known y position of the mouse button
|
m_last_button_y; ///< last known y position of the mouse button
|
||||||
std::auto_ptr<FbWinFrame> m_frame;
|
FbWinFrame m_frame;
|
||||||
|
|
||||||
FbTk::XLayerItem m_layeritem;
|
FbTk::XLayerItem m_layeritem;
|
||||||
int m_layernum;
|
int m_layernum;
|
||||||
|
|
|
@ -22,7 +22,7 @@
|
||||||
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||||
// DEALINGS IN THE SOFTWARE.
|
// DEALINGS IN THE SOFTWARE.
|
||||||
|
|
||||||
// $Id: Workspace.cc,v 1.87 2003/12/14 01:10:39 fluxgen Exp $
|
// $Id: Workspace.cc,v 1.88 2003/12/18 18:03:22 fluxgen Exp $
|
||||||
|
|
||||||
#include "Workspace.hh"
|
#include "Workspace.hh"
|
||||||
|
|
||||||
|
@ -110,7 +110,7 @@ Workspace::Workspace(BScreen &scrn, FbTk::MultLayers &layermanager,
|
||||||
const std::string &name, unsigned int id):
|
const std::string &name, unsigned int id):
|
||||||
m_screen(scrn),
|
m_screen(scrn),
|
||||||
m_lastfocus(0),
|
m_lastfocus(0),
|
||||||
m_clientmenu(*scrn.menuTheme(), scrn.imageControl(),
|
m_clientmenu(scrn.menuTheme(), scrn.imageControl(),
|
||||||
*scrn.layerManager().getLayer(Fluxbox::instance()->getMenuLayer())),
|
*scrn.layerManager().getLayer(Fluxbox::instance()->getMenuLayer())),
|
||||||
m_layermanager(layermanager),
|
m_layermanager(layermanager),
|
||||||
m_name(name),
|
m_name(name),
|
||||||
|
@ -123,7 +123,7 @@ Workspace::Workspace(BScreen &scrn, FbTk::MultLayers &layermanager,
|
||||||
m_cascade_x[i] = 32 + scrn.getHeadX(i);
|
m_cascade_x[i] = 32 + scrn.getHeadX(i);
|
||||||
m_cascade_y[i] = 32 + scrn.getHeadY(i);
|
m_cascade_y[i] = 32 + scrn.getHeadY(i);
|
||||||
}
|
}
|
||||||
m_clientmenu.setInternalMenu();
|
menu().setInternalMenu();
|
||||||
setName(name);
|
setName(name);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -254,7 +254,7 @@ void Workspace::removeAll() {
|
||||||
|
|
||||||
|
|
||||||
void Workspace::reconfigure() {
|
void Workspace::reconfigure() {
|
||||||
m_clientmenu.reconfigure();
|
menu().reconfigure();
|
||||||
|
|
||||||
Windows::iterator it = m_windowlist.begin();
|
Windows::iterator it = m_windowlist.begin();
|
||||||
Windows::iterator it_end = m_windowlist.end();
|
Windows::iterator it_end = m_windowlist.end();
|
||||||
|
@ -361,7 +361,7 @@ bool Workspace::loadGroups(const std::string &filename) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void Workspace::update(FbTk::Subject *subj) {
|
void Workspace::update(FbTk::Subject *subj) {
|
||||||
m_clientmenu.update();
|
menu().update();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -379,8 +379,8 @@ void Workspace::setName(const std::string &name) {
|
||||||
|
|
||||||
screen().updateWorkspaceNamesAtom();
|
screen().updateWorkspaceNamesAtom();
|
||||||
|
|
||||||
m_clientmenu.setLabel(m_name.c_str());
|
menu().setLabel(m_name.c_str());
|
||||||
m_clientmenu.update();
|
menu().update();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -400,7 +400,7 @@ void Workspace::shutdown() {
|
||||||
|
|
||||||
void Workspace::updateClientmenu() {
|
void Workspace::updateClientmenu() {
|
||||||
// remove all items and then add them again
|
// remove all items and then add them again
|
||||||
m_clientmenu.removeAll();
|
menu().removeAll();
|
||||||
// for each fluxboxwindow add every client in them to our clientlist
|
// for each fluxboxwindow add every client in them to our clientlist
|
||||||
Windows::iterator win_it = m_windowlist.begin();
|
Windows::iterator win_it = m_windowlist.begin();
|
||||||
Windows::iterator win_it_end = m_windowlist.end();
|
Windows::iterator win_it_end = m_windowlist.end();
|
||||||
|
@ -411,10 +411,10 @@ void Workspace::updateClientmenu() {
|
||||||
FluxboxWindow::ClientList::iterator client_it_end =
|
FluxboxWindow::ClientList::iterator client_it_end =
|
||||||
(*win_it)->clientList().end();
|
(*win_it)->clientList().end();
|
||||||
for (; client_it != client_it_end; ++client_it)
|
for (; client_it != client_it_end; ++client_it)
|
||||||
m_clientmenu.insert(new ClientMenuItem(*(*client_it)));
|
menu().insert(new ClientMenuItem(*(*client_it)));
|
||||||
}
|
}
|
||||||
|
|
||||||
m_clientmenu.update();
|
menu().update();
|
||||||
}
|
}
|
||||||
|
|
||||||
void Workspace::placeWindow(FluxboxWindow &win) {
|
void Workspace::placeWindow(FluxboxWindow &win) {
|
||||||
|
|
|
@ -71,7 +71,7 @@ public:
|
||||||
FluxboxWindow *lastFocusedWindow() { return m_lastfocus; }
|
FluxboxWindow *lastFocusedWindow() { return m_lastfocus; }
|
||||||
const FluxboxWindow *lastFocusedWindow() const { return m_lastfocus; }
|
const FluxboxWindow *lastFocusedWindow() const { return m_lastfocus; }
|
||||||
|
|
||||||
FbTk::Menu &menu() { return m_clientmenu; }
|
inline FbTk::Menu &menu() { return m_clientmenu; }
|
||||||
inline const FbTk::Menu &menu() const { return m_clientmenu; }
|
inline const FbTk::Menu &menu() const { return m_clientmenu; }
|
||||||
/// name of this workspace
|
/// name of this workspace
|
||||||
inline const std::string &name() const { return m_name; }
|
inline const std::string &name() const { return m_name; }
|
||||||
|
|
Loading…
Reference in a new issue