Logo
  • Main Page
  • Related Pages
  • Modules
  • Classes
  • Files

mmsimagewidget.h

Go to the documentation of this file.
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 MMSIMAGEWIDGET_H_
00034 #define MMSIMAGEWIDGET_H_
00035 
00036 #include "mmsgui/mmswidget.h"
00037 
00038 //! With this class you can display pictures and animations.
00039 /*!
00040 All widgets derived from the base widget class can display pictures at its background.
00041 This image class additionally can display pictures over the background.
00042 As special feature the image class can play animations. Currently the GIF format will be supported.
00043 The image widget cannot be focused.
00044 \author Jens Schneider
00045 */
00046 class MMSImageWidget : public MMSWidget {
00047     private:
00048         string              className;
00049         MMSImageWidgetClass *imageWidgetClass;
00050         MMSImageWidgetClass myImageWidgetClass;
00051 
00052         bool imagepath_set;
00053         bool selimagepath_set;
00054 
00055         bool imagepath_p_set;
00056         bool selimagepath_p_set;
00057 
00058         bool imagepath_i_set;
00059         bool selimagepath_i_set;
00060 
00061         MMSFBSurface    *image;
00062         MMSIM_DESC_SUF  *image_suf;
00063         unsigned int    image_curr_index;
00064         MMSFBSurface    *selimage;
00065         MMSIM_DESC_SUF  *selimage_suf;
00066         unsigned int    selimage_curr_index;
00067 
00068         MMSFBSurface    *image_p;
00069         MMSIM_DESC_SUF  *image_p_suf;
00070         unsigned int    image_p_curr_index;
00071         MMSFBSurface    *selimage_p;
00072         MMSIM_DESC_SUF  *selimage_p_suf;
00073         unsigned int    selimage_p_curr_index;
00074 
00075         MMSFBSurface    *image_i;
00076         MMSIM_DESC_SUF  *image_i_suf;
00077         unsigned int    image_i_curr_index;
00078         MMSFBSurface    *selimage_i;
00079         MMSIM_DESC_SUF  *selimage_i_suf;
00080         unsigned int    selimage_i_curr_index;
00081 
00082         bool    image_loaded;
00083         bool    image_p_loaded;
00084         bool    image_i_loaded;
00085         bool    selimage_loaded;
00086         bool    selimage_p_loaded;
00087         bool    selimage_i_loaded;
00088 
00089         class MMSImageWidgetThread  *imageThread;
00090 
00091         //! current foreground values set?
00092         bool            current_fgset;
00093 
00094         //! current foreground image
00095         MMSFBSurface    *current_fgimage;
00096 
00097         //! current foreground image2
00098         MMSFBSurface    *current_fgimage2;
00099 
00100         bool create(MMSWindow *root, string className, MMSTheme *theme);
00101 
00102         bool init();
00103         bool release();
00104 
00105         void getForeground(MMSFBSurface **image, MMSFBSurface **image2);
00106         bool enableRefresh(bool enable = true);
00107         bool checkRefreshStatus();
00108 
00109         bool draw(bool *backgroundFilled = NULL);
00110 
00111         void loadMyImage(string path, string filename, MMSFBSurface **surface, MMSIM_DESC_SUF **surfdesc,
00112                          unsigned int *index, unsigned int mirror_size, bool gen_taff);
00113 
00114         void workWithRatio(MMSFBSurface *suf, MMSFBRectangle *surfaceGeom);
00115 
00116     public:
00117         MMSImageWidget(MMSWindow *root, string className, MMSTheme *theme = NULL);
00118         virtual ~MMSImageWidget();
00119 
00120         MMSWidget *copyWidget();
00121 
00122         void setVisible(bool visible, bool refresh = true);
00123 
00124     public:
00125         /* theme access methods */
00126         string getImagePath();
00127         string getImageName();
00128         string getSelImagePath();
00129         string getSelImageName();
00130         string getImagePath_p();
00131         string getImageName_p();
00132         string getSelImagePath_p();
00133         string getSelImageName_p();
00134         string getImagePath_i();
00135         string getImageName_i();
00136         string getSelImagePath_i();
00137         string getSelImageName_i();
00138         bool getUseRatio();
00139         bool getFitWidth();
00140         bool getFitHeight();
00141         MMSALIGNMENT getAlignment();
00142         unsigned int getMirrorSize();
00143         bool getGenTaff();
00144 
00145         void setImagePath(string imagepath, bool load = true, bool refresh = true);
00146         void setImageName(string imagename, bool load = true, bool refresh = true);
00147         void setImage(string imagepath, string imagename, bool load = true, bool refresh = true);
00148         void setSelImagePath(string selimagepath, bool load = true, bool refresh = true);
00149         void setSelImageName(string selimagename, bool load = true, bool refresh = true);
00150         void setSelImage(string selimagepath, string selimagename, bool load = true, bool refresh = true);
00151         void setImagePath_p(string imagepath_p, bool load = true, bool refresh = true);
00152         void setImageName_p(string imagename_p, bool load = true, bool refresh = true);
00153         void setImage_p(string imagepath_p, string imagename_p, bool load = true, bool refresh = true);
00154         void setSelImagePath_p(string selimagepath_p, bool load = true, bool refresh = true);
00155         void setSelImageName_p(string selimagename_p, bool load = true, bool refresh = true);
00156         void setSelImage_p(string selimagepath_p, string selimagename_p, bool load = true, bool refresh = true);
00157         void setImagePath_i(string imagepath_i, bool load = true, bool refresh = true);
00158         void setImageName_i(string imagename_i, bool load = true, bool refresh = true);
00159         void setImage_i(string imagepath_i, string imagename_i, bool load = true, bool refresh = true);
00160         void setSelImagePath_i(string selimagepath_i, bool load = true, bool refresh = true);
00161         void setSelImageName_i(string selimagename_i, bool load = true, bool refresh = true);
00162         void setSelImage_i(string selimagepath_i, string selimagename_i, bool load = true, bool refresh = true);
00163         void setUseRatio(bool useratio, bool refresh = true);
00164         void setFitWidth(bool fitwidth, bool refresh = true);
00165         void setFitHeight(bool fitheight, bool refresh = true);
00166         void setAlignment(MMSALIGNMENT alignment, bool refresh = true);
00167         void setMirrorSize(unsigned int mirrorsize, bool refresh = true);
00168         void setGenTaff(bool gentaff, bool refresh = true);
00169 
00170         void updateFromThemeClass(MMSImageWidgetClass *themeClass);
00171 
00172     friend class MMSImageWidgetThread;
00173 };
00174 
00175 #endif /*MMSIMAGEWIDGET_H_*/

Generated by doxygen