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-2012 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 } MMSFBWindowConfig; 00047 00048 //! This class describes a window on a specific layer. 00049 /*! 00050 \author Jens Schneider 00051 */ 00052 class MMSFBWindow { 00053 private: 00054 #ifdef __HAVE_DIRECTFB__ 00055 //! dfb window if used 00056 IDirectFBWindow *dfbwindow; 00057 #endif 00058 00059 MMSFBSurface *surface; /* windows surface */ 00060 00061 MMSFBWindowConfig config; /* surface configuration */ 00062 00063 public: 00064 #ifdef USE_DFB_WINMAN 00065 MMSFBWindow(IDirectFBWindow *dfbwindow, int x, int y); 00066 #endif 00067 #ifdef USE_MMSFB_WINMAN 00068 MMSFBWindow(MMSFBSurface *surface, int x, int y); 00069 #endif 00070 virtual ~MMSFBWindow(); 00071 00072 bool getSurface(MMSFBSurface **surface); 00073 00074 bool getConfiguration(MMSFBWindowConfig *config = NULL); 00075 00076 bool isShown(); 00077 bool show(); 00078 bool hide(); 00079 00080 bool getOpacity(unsigned char *opacity); 00081 bool setOpacity(unsigned char opacity); 00082 00083 bool getPosition(int *x, int *y); 00084 bool moveTo(int x, int y, bool move_vrect = false); 00085 00086 bool getSize(int *w, int *h); 00087 bool resize(int w, int h); 00088 00089 bool raiseToTop(int zlevel = 0); 00090 bool lowerToBottom(); 00091 00092 bool setVisibleRectangle(MMSFBRectangle *rect = NULL); 00093 bool getVisibleRectangle(MMSFBRectangle *rect); 00094 00095 bool getScreenshot(); 00096 }; 00097 00098 #endif /*MMSFBWINDOW_H_*/