00001 /*************************************************************************** 00002 * Copyright (C) 2005-2007 Stefan Schwarzer, Jens Schneider, * 00003 * Matthias Hardt, Guido Madaus * 00004 * * 00005 * Copyright (C) 2007-2008 BerLinux Solutions GbR * 00006 * Stefan Schwarzer & Guido Madaus * 00007 * * 00008 * Copyright (C) 2009-2013 BerLinux Solutions GmbH * 00009 * * 00010 * Authors: * 00011 * Stefan Schwarzer <stefan.schwarzer@diskohq.org>, * 00012 * Matthias Hardt <matthias.hardt@diskohq.org>, * 00013 * Jens Schneider <jens.schneider@diskohq.org>, * 00014 * Guido Madaus <guido.madaus@diskohq.org>, * 00015 * Patrick Helterhoff <patrick.helterhoff@diskohq.org>, * 00016 * René Bählkow <rene.baehlkow@diskohq.org> * 00017 * * 00018 * This library is free software; you can redistribute it and/or * 00019 * modify it under the terms of the GNU Lesser General Public * 00020 * License version 2.1 as published by the Free Software Foundation. * 00021 * * 00022 * This library is distributed in the hope that it will be useful, * 00023 * but WITHOUT ANY WARRANTY; without even the implied warranty of * 00024 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * 00025 * Lesser General Public License for more details. * 00026 * * 00027 * You should have received a copy of the GNU Lesser General Public * 00028 * License along with this library; if not, write to the * 00029 * Free Software Foundation, Inc., * 00030 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * 00031 **************************************************************************/ 00032 00033 #ifndef MMSWINDOWMANAGER_H_ 00034 #define MMSWINDOWMANAGER_H_ 00035 00036 #include "mmsgui/interfaces/immswindowmanager.h" 00037 00038 class MMSWindowManager : public IMMSWindowManager { 00039 private: 00040 //! visible screen area 00041 MMSFBRectangle vrect; 00042 00043 //! windows known by the window manager 00044 vector<MMSWindow*> windows; 00045 00046 //! the toplevel window 00047 MMSWindow *toplevel; 00048 00049 //! the background window 00050 MMSWindow *backgroundwindow; 00051 00052 //! translator instance which can be used to translate text 00053 MMSTranslator translator; 00054 00055 //! connection object for MMSTranslator::onTargetLangChanged callback 00056 sigc::connection onTargetLangChanged_connection; 00057 00058 //! theme manager instance 00059 MMSThemeManager themeManager; 00060 00061 //! connection object for MMSThemeManager::onThemeChanged callback 00062 sigc::connection onThemeChanged_connection; 00063 00064 //! pulser object for the animated theme switch 00065 MMSPulser pulser; 00066 00067 //! connection object for MMSPulser::onAnimation callback 00068 sigc::connection onAnimation_connection; 00069 00070 //! connection object for MMSPulser::onAfterAnimation callback 00071 sigc::connection onAfterAnimation_connection; 00072 00073 //! temporary window for animated theme switch 00074 MMSFBWindow *anim_saved_screen; 00075 00076 //! Internal method: Make the default background window visible. 00077 void showBackgroundWindow(); 00078 00079 //! Internal method: Target Language Changed callback from MMSTranslator. 00080 void onTargetLangChanged(MMSLanguage lang); 00081 00082 //! Internal method: Theme Changed callback from MMSThemeManager. 00083 void onThemeChanged(string themeName, bool fade_in); 00084 00085 //! Internal method: Animation callback from MMSPulser used in onThemeChanged() callback. 00086 bool onAnimation(MMSPulser *pulser); 00087 00088 //! Internal method: After Animation callback from MMSPulser used in onThemeChanged() callback. 00089 void onAfterAnimation(MMSPulser *pulser); 00090 00091 public: 00092 MMSWindowManager(MMSFBRectangle vrect); 00093 virtual ~MMSWindowManager(); 00094 void reset(); 00095 00096 MMSFBRectangle getVRect(); 00097 00098 void addWindow(MMSWindow *window); 00099 void removeWindow(MMSWindow *window); 00100 00101 bool lowerToBottom(MMSWindow *window); 00102 bool raiseToTop(MMSWindow *window); 00103 00104 bool hideAllMainWindows(bool goback = false); 00105 bool hideAllPopupWindows(bool except_modal = false); 00106 bool hideAllRootWindows(bool willshown = false); 00107 00108 bool setToplevelWindow(MMSWindow *window); 00109 MMSWindow *getToplevelWindow(); 00110 void removeWindowFromToplevel(MMSWindow *window); 00111 00112 void setBackgroundWindow(MMSWindow *window); 00113 MMSWindow *getBackgroundWindow(); 00114 00115 void setPointerPosition(int pointer_posx, int pointer_posy, bool pressed = true); 00116 00117 MMSTranslator *getTranslator(); 00118 00119 MMSThemeManager *getThemeManager(); 00120 00121 unsigned int printStack(char *buffer = NULL); 00122 }; 00123 00124 #endif /*MMSWINDOWMANAGER_H_*/