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 MMSFBWINDOW_H_ 00034 #define MMSFBWINDOW_H_ 00035 00036 #include "mmstools/mmslogger.h" 00037 #include "mmsgui/fb/mmsfbbase.h" 00038 #include "mmsgui/fb/mmsfbsurface.h" 00039 00040 typedef struct { 00041 MMSFBSurfaceConfig surface_config; /* windows surface config */ 00042 int posx; /* pos x */ 00043 int posy; /* pos y */ 00044 unsigned char opacity; /* opacity of the window */ 00045 bool shown; /* is the window currently shown */ 00046 int zlevel; 00047 } MMSFBWindowConfig; 00048 00049 //! This class describes a window on a specific layer. 00050 /*! 00051 \author Jens Schneider 00052 */ 00053 class MMSFBWindow { 00054 private: 00055 #ifdef __HAVE_DIRECTFB__ 00056 //! dfb window if used 00057 IDirectFBWindow *dfbwindow; 00058 #endif 00059 00060 MMSFBSurface *surface; /* windows surface */ 00061 00062 MMSFBWindowConfig config; /* surface configuration */ 00063 00064 public: 00065 #ifdef USE_DFB_WINMAN 00066 MMSFBWindow(IDirectFBWindow *dfbwindow, int x, int y); 00067 #endif 00068 #ifdef USE_MMSFB_WINMAN 00069 MMSFBWindow(MMSFBSurface *surface, int x, int y); 00070 #endif 00071 virtual ~MMSFBWindow(); 00072 00073 bool getSurface(MMSFBSurface **surface); 00074 00075 bool getConfiguration(MMSFBWindowConfig *config = NULL); 00076 00077 bool isShown(); 00078 bool show(); 00079 bool hide(); 00080 00081 bool getOpacity(unsigned char *opacity); 00082 bool setOpacity(unsigned char opacity); 00083 00084 bool getPosition(int *x, int *y); 00085 bool moveTo(int x, int y, bool move_vrect = false); 00086 00087 bool getSize(int *w, int *h); 00088 bool resize(int w, int h); 00089 00090 bool raiseToTop(int zlevel = 0); 00091 bool lowerToBottom(); 00092 00093 bool setVisibleRectangle(MMSFBRectangle *rect = NULL); 00094 bool getVisibleRectangle(MMSFBRectangle *rect); 00095 00096 bool getScreenshot(); 00097 }; 00098 00099 #endif /*MMSFBWINDOW_H_*/