X-Git-Url: https://git.brokenzipper.com/gitweb?a=blobdiff_plain;f=src%2FIconmenu.cc;h=dba587a2bdebffc11d7969ecc6d4bed158edafb7;hb=87e63d53af67d5ea98f55a27007663d4c9c8fc6c;hp=0adc10a75c8818ecc57ce5d8e04fd54957a1dfb0;hpb=4602d87180951a4b7a40283a2fb77f31cad4d789;p=chaz%2Fopenbox diff --git a/src/Iconmenu.cc b/src/Iconmenu.cc index 0adc10a7..dba587a2 100644 --- a/src/Iconmenu.cc +++ b/src/Iconmenu.cc @@ -1,5 +1,6 @@ -// Iconmenu.cc for Openbox -// Copyright (c) 2001 Sean 'Shaleh' Perry +// -*- mode: C++; indent-tabs-mode: nil; -*- +// Icon.cc for Blackbox - an X11 Window manager +// Copyright (c) 2001 - 2002 Sean 'Shaleh' Perry // Copyright (c) 1997 - 2000 Brad Hughes (bhughes@tcac.net) // // Permission is hereby granted, free of charge, to any person obtaining a @@ -20,36 +21,30 @@ // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -// stupid macros needed to access some functions in version 2 of the GNU C -// library -#ifndef _GNU_SOURCE -#define _GNU_SOURCE -#endif // _GNU_SOURCE - #ifdef HAVE_CONFIG_H # include "../config.h" #endif // HAVE_CONFIG_H -#include "i18n.h" -#include "Iconmenu.h" -#include "Screen.h" -#include "Window.h" +#include "i18n.hh" +#include "Iconmenu.hh" +#include "Screen.hh" +#include "Window.hh" -Iconmenu::Iconmenu(BScreen &scrn) : Basemenu(scrn), screen(scrn) { +Iconmenu::Iconmenu(BScreen *scrn) : Basemenu(scrn) { setInternalMenu(); - setLabel(i18n->getMessage(IconSet, IconIcons, "Icons")); + setLabel(i18n(IconSet, IconIcons, "Icons")); update(); } -void Iconmenu::itemSelected(int button, int index) { +void Iconmenu::itemSelected(int button, unsigned int index) { if (button != 1) return; - if (index >= 0 && index < screen.getIconCount()) { - OpenboxWindow *win = screen.getIcon(index); + if (index < getScreen()->getIconCount()) { + BlackboxWindow *win = getScreen()->getIcon(index); if (win) { win->deiconify(); @@ -57,6 +52,6 @@ void Iconmenu::itemSelected(int button, int index) { } } - if (! (screen.getWorkspacemenu()->isTorn() || isTorn())) + if (! (getScreen()->getWorkspacemenu()->isTorn() || isTorn())) hide(); }