summaryrefslogtreecommitdiff
path: root/src/IconMenu.cc
diff options
context:
space:
mode:
authormarkt <markt>2007-10-13 21:51:37 (GMT)
committermarkt <markt>2007-10-13 21:51:37 (GMT)
commita59428d67a95a9df16554962f0a6257d6378328a (patch)
treef856ed9300c34f7a17d499f22d895610cfbc08e5 /src/IconMenu.cc
parent41b5c6dadb1f474675660cef18b812d4c2338ed2 (diff)
downloadfluxbox_lack-a59428d67a95a9df16554962f0a6257d6378328a.zip
fluxbox_lack-a59428d67a95a9df16554962f0a6257d6378328a.tar.bz2
merged changes from pre-devel
Diffstat (limited to 'src/IconMenu.cc')
-rw-r--r--src/IconMenu.cc66
1 files changed, 0 insertions, 66 deletions
diff --git a/src/IconMenu.cc b/src/IconMenu.cc
deleted file mode 100644
index 33ef05a..0000000
--- a/src/IconMenu.cc
+++ /dev/null
@@ -1,66 +0,0 @@
1// IconMenu.cc for Fluxbox
2// Copyright (c) 2004 Henrik Kinnunen (fluxgen at fluxbox dot org)
3//
4// Permission is hereby granted, free of charge, to any person obtaining a
5// copy of this software and associated documentation files (the "Software"),
6// to deal in the Software without restriction, including without limitation
7// the rights to use, copy, modify, merge, publish, distribute, sublicense,
8// and/or sell copies of the Software, and to permit persons to whom the
9// Software is furnished to do so, subject to the following conditions:
10//
11// The above copyright notice and this permission notice shall be included in
12// all copies or substantial portions of the Software.
13//
14// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
17// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
19// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
20// DEALINGS IN THE SOFTWARE.
21
22// $Id$
23
24#include "IconMenu.hh"
25
26#include "Screen.hh"
27#include "IconMenuItem.hh"
28#include "Layer.hh"
29#include "FbTk/I18n.hh"
30
31#include <typeinfo>
32
33static void updateItems(FbTk::Menu &menu, BScreen &screen) {
34 menu.removeAll();
35 BScreen::Icons::iterator it = screen.iconList().begin();
36 BScreen::Icons::iterator it_end = screen.iconList().end();
37 for (; it != it_end; ++it) {
38 FluxboxWindow::ClientList::iterator client_it = (*it)->clientList().begin();
39 FluxboxWindow::ClientList::iterator client_it_end = (*it)->clientList().end();
40 for (; client_it != client_it_end; ++client_it)
41 menu.insert(new IconMenuItem(**client_it));
42 }
43 menu.updateMenu();
44}
45
46IconMenu::IconMenu(BScreen &screen):
47 FbMenu(screen.menuTheme(),
48 screen.imageControl(),
49 *screen.layerManager().
50 getLayer(Layer::MENU)) {
51
52 _FB_USES_NLS;
53 setLabel(_FB_XTEXT(Menu, Icons, "Icons", "Iconic windows menu title"));
54 screen.iconListSig().attach(this);
55 updateItems(*this, screen);
56}
57
58void IconMenu::update(FbTk::Subject *subj) {
59 if (subj == 0)
60 FbTk::Menu::update(subj);
61 else if (typeid(*subj) == typeid(BScreen::ScreenSubject)) {
62 BScreen &screen = static_cast<BScreen::ScreenSubject *>(subj)->screen();
63 updateItems(*this, screen);
64 } else
65 FbTk::Menu::update(subj);
66}