session.screen0.defaultDeco now understands TAB, BORDER, etc.

This commit is contained in:
markt 2007-03-06 17:20:13 +00:00
parent 8c5fd07d77
commit ed3731fa30
6 changed files with 44 additions and 42 deletions

View file

@ -1,13 +1,16 @@
(Format: Year/Month/Day)
Changes for 1.0rc3:
*07/03/03
*07/03/06:
* session.screen<N>.defaultDeco now allows same strings as apps file (Mark)
Screen.cc/hh Window.cc Remember.cc/hh
*07/03/03:
* Added typeahead support to menus (patch by Philipp Goedl, modified by Mark
and Matteo Galiazzo)
- Added new style item menu.frame.underlineColor: <color> for displaying
matching items
FbTk/Menu.cc/hh MenuItem.cc/hh MenuTheme.cc/hh Makefile.am and added
FbTk/ITypeAheadable.hh TypeAhead.hh SearchResult.cc/hh
*07/03/02
*07/03/02:
* Added support for keypad enter key in menu (Mark)
FbTk/Menu.cc
*07/02/28:

View file

@ -290,6 +290,32 @@ Remember::~Remember() {
s_instance = 0;
}
int Remember::getDecoFromString(const string &str_label) {
if (strcasecmp(str_label.c_str(), "NONE") == 0)
return 0;
if (strcasecmp(str_label.c_str(), "NORMAL") == 0)
return FluxboxWindow::DECORM_LAST - 1;
if (strcasecmp(str_label.c_str(), "TINY") == 0)
return FluxboxWindow::DECORM_TITLEBAR
| FluxboxWindow::DECORM_ICONIFY
| FluxboxWindow::DECORM_MENU
| FluxboxWindow::DECORM_TAB;
if (strcasecmp(str_label.c_str(), "TOOL") == 0)
return FluxboxWindow::DECORM_TITLEBAR
| FluxboxWindow::DECORM_MENU;
if (strcasecmp(str_label.c_str(), "BORDER") == 0)
return FluxboxWindow::DECORM_BORDER
| FluxboxWindow::DECORM_MENU;
if (strcasecmp(str_label.c_str(), "TAB") == 0)
return FluxboxWindow::DECORM_BORDER
| FluxboxWindow::DECORM_MENU
| FluxboxWindow::DECORM_TAB;
unsigned int mask;
if (getuint(str_label.c_str(), mask))
return mask;
return -1;
}
Application* Remember::find(WinClient &winclient) {
// if it is already associated with a application, return that one
// otherwise, check it against every pattern that we've got
@ -448,40 +474,11 @@ int Remember::parseApp(ifstream &file, Application &app, string *first_line) {
app.rememberIconHiddenstate((strcasecmp(str_label.c_str(), "yes") == 0));
app.rememberFocusHiddenstate((strcasecmp(str_label.c_str(), "yes") == 0));
} else if (strcasecmp(str_key.c_str(), "Deco") == 0) {
if (strcasecmp(str_label.c_str(), "NONE") == 0) {
app.rememberDecostate((unsigned int) 0);
} else if (strcasecmp(str_label.c_str(), "NORMAL") == 0) {
app.rememberDecostate((unsigned int) 0xfffffff);
} else if (strcasecmp(str_label.c_str(), "TINY") == 0) {
app.rememberDecostate((unsigned int)
FluxboxWindow::DECORM_TITLEBAR
| FluxboxWindow::DECORM_ICONIFY
| FluxboxWindow::DECORM_MENU
| FluxboxWindow::DECORM_TAB
);
} else if (strcasecmp(str_label.c_str(), "TOOL") == 0) {
app.rememberDecostate((unsigned int)
FluxboxWindow::DECORM_TITLEBAR
| FluxboxWindow::DECORM_MENU
);
} else if (strcasecmp(str_label.c_str(), "BORDER") == 0) {
app.rememberDecostate((unsigned int)
FluxboxWindow::DECORM_BORDER
| FluxboxWindow::DECORM_MENU
);
} else if (strcasecmp(str_label.c_str(), "TAB") == 0) {
app.rememberDecostate((unsigned int)
FluxboxWindow::DECORM_BORDER
| FluxboxWindow::DECORM_MENU
| FluxboxWindow::DECORM_TAB
);
} else {
unsigned int mask;
if (getuint(str_label.c_str(), mask))
app.rememberDecostate(mask);
else
had_error = 1;
}
int deco = getDecoFromString(str_label);
if (deco == -1)
had_error = 1;
else
app.rememberDecostate((unsigned int)deco);
} else if (strcasecmp(str_key.c_str(), "Alpha") == 0) {
int focused_a, unfocused_a;
if (sscanf(str_label.c_str(), "%i %i", &focused_a, &unfocused_a) == 2)

View file

@ -205,6 +205,8 @@ public:
Remember();
~Remember();
static int getDecoFromString(const std::string &str);
Application* find(WinClient &winclient);
Application* add(WinClient &winclient);
FluxboxWindow* findGroup(Application *, BScreen &screen);

View file

@ -293,7 +293,7 @@ BScreen::ScreenResource::ScreenResource(FbTk::ResourceManager &rm,
auto_raise(rm, true, scrname+".autoRaise", altscrname+".AutoRaise"),
click_raises(rm, true, scrname+".clickRaises", altscrname+".ClickRaises"),
decorate_transient(rm, true, scrname+".decorateTransient", altscrname+".DecorateTransient"),
default_deco(rm, FluxboxWindow::DECORM_LAST-1, scrname+".defaultDeco", altscrname+".DefaultDeco"),
default_deco(rm, "NORMAL", scrname+".defaultDeco", altscrname+".DefaultDeco"),
rootcommand(rm, "", scrname+".rootCommand", altscrname+".RootCommand"),
resize_model(rm, BOTTOMRESIZE, scrname+".resizeMode", altscrname+".ResizeMode"),
tab_placement(rm, FbWinFrame::TOPLEFT, scrname+".tab.placement", altscrname+".Tab.Placement"),

View file

@ -123,7 +123,7 @@ public:
bool doFullMax() const { return *resource.full_max; }
bool doShowWindowPos() const { return *resource.show_window_pos; }
bool decorateTransient() const { return *resource.decorate_transient; }
unsigned int defaultDeco() const { return *resource.default_deco; }
const std::string &defaultDeco() const { return *resource.default_deco; }
const std::string &windowMenuFilename() const { return *resource.windowmenufile; }
FbTk::ImageControl &imageControl() { return *m_image_control.get(); }
// menus
@ -449,7 +449,7 @@ private:
workspace_warping,
desktop_wheeling, reverse_wheeling, show_window_pos,
auto_raise, click_raises, decorate_transient;
FbTk::Resource<unsigned int> default_deco;
FbTk::Resource<std::string> default_deco;
FbTk::Resource<std::string> rootcommand;
FbTk::Resource<ResizeModel> resize_model;
FbTk::Resource<FbWinFrame::TabPlacement> tab_placement;

View file

@ -394,10 +394,10 @@ void FluxboxWindow::init() {
m_blackbox_attrib.premax_w = m_blackbox_attrib.premax_h = 0;
// set default decorations but don't apply them
setDecorationMask(screen().defaultDeco(), false);
setDecorationMask(Remember::getDecoFromString(screen().defaultDeco()), false);
functions.resize = functions.move = functions.iconify = functions.maximize = functions.close = functions.tabable = true;
decorations.close = false;
functions.resize = functions.move = functions.iconify = functions.maximize
= functions.close = functions.tabable = true;
if (m_client->getBlackboxHint() != 0)
updateBlackboxHintsFromClient(*m_client);