KKBSwitch – keyboard layout indicator
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

singlewindowwatcher.h 2.3KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. /***************************************************************************
  2. * Copyright (C) 2004 by Leonid Zeitlin *
  3. * lz@europe.com *
  4. * *
  5. * This program is free software; you can redistribute it and/or modify *
  6. * it under the terms of the GNU General Public License as published by *
  7. * the Free Software Foundation; either version 2 of the License, or *
  8. * (at your option) any later version. *
  9. * *
  10. * This program is distributed in the hope that it will be useful, *
  11. * but WITHOUT ANY WARRANTY; without even the implied warranty of *
  12. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
  13. * GNU General Public License for more details. *
  14. * *
  15. * You should have received a copy of the GNU General Public License *
  16. * along with this program; if not, write to the *
  17. * Free Software Foundation, Inc., *
  18. * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
  19. ***************************************************************************/
  20. #ifndef SINGLEWINDOWWATCHER_H
  21. #define SINGLEWINDOWWATCHER_H
  22. #include "windowwatcher.h"
  23. #include <ntqmap.h>
  24. /**
  25. Watches for changes of active window and keep a group per each window
  26. @author Leonid Zeitlin
  27. */
  28. class SingleWindowWatcher : public WindowWatcher {
  29. Q_OBJECT
  30. private:
  31. struct KBWinInfo {
  32. int groupno;
  33. int next_groupno;
  34. };
  35. typedef TQMap<WId, KBWinInfo> KBWindowMap;
  36. KBWindowMap m_window_map;
  37. KBWindowMap::iterator m_active_window;
  38. void addWindowToMap(WId window_id);
  39. protected:
  40. virtual void windowAdded(WId /* id */) { /* do nothing */ }
  41. virtual void windowRemoved(WId id);
  42. virtual void activeWindowChanged(WId id);
  43. public:
  44. SingleWindowWatcher(KBConfig *kbconf, TQObject *parent = 0, const char *name = 0);
  45. ~SingleWindowWatcher();
  46. virtual void changeGroup(int groupno, int next_groupno);
  47. virtual void reset();
  48. };
  49. #endif