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

mmsconfigdata.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 MMSCONFIGDATA_H_
00034 #define MMSCONFIGDATA_H_
00035 
00036 #include "mmstools/mmstypes.h"
00037 #include "mmstools/mmsdbconnmgr.h"
00038 
00039 using namespace std;
00040 
00041 
00042 class MMSConfigDataGlobal {
00043     public:
00044         string logfile;
00045         string inputmap;
00046         string prefix;
00047         string theme;
00048         string sysconfig;
00049         string data;
00050         bool   stdout;
00051         int    inputinterval;
00052         string firstplugin;
00053         bool   shutdown;
00054         string shutdowncmd;
00055         string inputmode;
00056         string actmonaddress;
00057         unsigned int actmonport;
00058 
00059         MMSConfigDataGlobal() :
00060             logfile("/tmp/mmscore"),
00061             inputmap("default"),
00062             prefix(""),
00063             theme("default"),
00064             sysconfig(""),
00065             data(""),
00066             stdout(false),
00067             inputinterval(0),
00068             firstplugin("<none>"),
00069             shutdown(false),
00070             shutdowncmd(""),
00071             inputmode(""),
00072             actmonaddress("127.0.0.1"),
00073             actmonport(9999) {}
00074 };
00075 
00076 class MMSConfigDataDB {
00077     public:
00078         string       dbms;
00079         string       address;
00080         unsigned int port;
00081         string       user;
00082         string       password;
00083         string       database;
00084 
00085         MMSConfigDataDB(const string database = "") :
00086             dbms(DBMS_SQLITE3),
00087             address(""),
00088             port(0),
00089             user(""),
00090             password(""),
00091             database("") {}
00092 };
00093 
00094 class MMSConfigDataLayer {
00095     public:
00096         MMSFBOutputType         outputtype;
00097         int                     id;
00098         MMSFBRectangle          rect;
00099         MMSFBSurfacePixelFormat pixelformat;
00100         string                  options;
00101         string                  buffermode;
00102 
00103         MMSConfigDataLayer() :
00104             outputtype(MMSFB_OT_XSHM),
00105             id(0),
00106             rect(MMSFBRectangle(50,50,800,600)),
00107             pixelformat(MMSFB_PF_RGB32),
00108             options(""),
00109             buffermode("BACKSYSTEM") {}
00110 };
00111 
00112 class MMSConfigDataGraphics {
00113     public:
00114         MMSFBBackend            backend;
00115         MMSConfigDataLayer      videolayer;
00116         MMSConfigDataLayer      graphicslayer;
00117         MMSFBRectangle          vrect;
00118         MMSFBRectangle          touchrect;
00119         MMSFBPointerMode        pointer;
00120         MMSFBSurfacePixelFormat graphicswindowpixelformat;
00121         MMSFBSurfacePixelFormat graphicssurfacepixelformat;
00122         bool                    extendedaccel;
00123         string                  allocmethod;
00124         MMSFBFullScreenMode     fullscreen;
00125         int                     rotatescreen;
00126         bool                    hideapplication;
00127         bool                    initialload;
00128         bool                    debugframes;
00129         bool                    touchSwapX;                 /**< swap x axis (maximum value becomes minimum) */
00130         bool                    touchSwapY;                 /**< swap y axis (maximum value becomes minimum) */
00131         bool                    touchSwapXY;                /**< swap x and y axis (x axis events are handled as y axis and vice versa) */
00132 
00133         MMSConfigDataGraphics() :
00134             backend(MMSFB_BE_X11),
00135             vrect(MMSFBRectangle(0,0,0,0)),
00136             touchrect(MMSFBRectangle(0,0,0,0)),
00137             pointer(MMSFB_PM_FALSE),                        // use the mouse pointer, default no
00138             graphicswindowpixelformat(MMSFB_PF_NONE),       // supported values: ARGB, AiRGB or AYUV, NONE means auto detection
00139             graphicssurfacepixelformat(MMSFB_PF_NONE),      // supported values: ARGB, AiRGB or AYUV, NONE means auto detection
00140             extendedaccel(true),                            // use lowlevel disko routines for faster pixel manipulation
00141             allocmethod(""),                                // the current alloc method
00142             fullscreen(MMSFB_FSM_FALSE),                    // x11 fullscreen?, default no
00143             rotatescreen(0),                                // rotate screen by X degree, default 0
00144             hideapplication(false),
00145             initialload(false),
00146             debugframes(false),
00147             touchSwapX(false),
00148             touchSwapY(false),
00149             touchSwapXY(false) {}
00150 };
00151 
00152 class MMSConfigDataLanguage {
00153     public:
00154         MMSLanguage sourcelang;
00155         MMSLanguage defaulttargetlang;
00156         bool   addtranslations;
00157         string languagefiledir;
00158 
00159         MMSConfigDataLanguage() :
00160             sourcelang(MMSLANG_NONE),
00161             defaulttargetlang(MMSLANG_NONE),
00162             addtranslations(false),
00163             languagefiledir("") {}
00164 };
00165 
00166 class MMSConfigData {
00167     private:
00168         static MMSConfigDataGlobal      global;
00169         static MMSConfigDataDB          configdb, datadb;
00170         static MMSConfigDataGraphics    graphics;
00171         static MMSConfigDataLanguage    language;
00172 
00173     public:
00174         // call this to set the values
00175         MMSConfigData(MMSConfigDataGlobal   global,
00176                       MMSConfigDataDB       configdb,
00177                       MMSConfigDataDB       datadb,
00178                       MMSConfigDataGraphics graphics,
00179                       MMSConfigDataLanguage language);
00180 
00181         // call if you want to read the values
00182         MMSConfigData();
00183         ~MMSConfigData();
00184 
00185         // global section getters
00186         const string getLogfile();
00187         const string getInputMap();
00188         const string getPrefix();
00189         const string getTheme();
00190         const string getSysConfig();
00191         const string getData();
00192         const bool   getStdout();
00193         const int    getInputInterval();
00194         const string getFirstPlugin();
00195         const bool   getShutdown();
00196         const string getShutdownCmd();
00197         const string getInputMode();
00198         const string getActMonAddress();
00199         const unsigned int getActMonPort();
00200 
00201         // db section getters
00202         const string       getConfigDBDBMS();
00203         const string       getConfigDBAddress();
00204         const unsigned int getConfigDBPort();
00205         const string       getConfigDBUser();
00206         const string       getConfigDBPassword();
00207         const string       getConfigDBDatabase();
00208         const string       getDataDBDBMS();
00209         const string       getDataDBAddress();
00210         const unsigned int getDataDBPort();
00211         const string       getDataDBUser();
00212         const string       getDataDBPassword();
00213         const string       getDataDBDatabase();
00214 
00215         // graphics section getters
00216         const MMSConfigDataLayer getVideoLayer();
00217         const MMSConfigDataLayer getGraphicsLayer();
00218         const MMSFBBackend getBackend();
00219         const MMSFBRectangle getVRect();
00220         const MMSFBRectangle getTouchRect();
00221         const MMSFBPointerMode getPointer();
00222         const MMSFBSurfacePixelFormat getGraphicsWindowPixelformat();
00223         const MMSFBSurfacePixelFormat getGraphicsSurfacePixelformat();
00224         const bool   getExtendedAccel();
00225         const string getAllocMethod();
00226         const MMSFBFullScreenMode   getFullScreen();
00227         const int getRotateScreen();
00228         const bool   getHideApplication();
00229         const bool   getInitialLoad();
00230         const bool   getDebugFrames();
00231         const bool   getTouchSwapX();
00232         const bool   getTouchSwapY();
00233         const bool   getTouchSwapXY();
00234 
00235         // graphics section setters
00236         void setVideoLayer(MMSConfigDataLayer layer);
00237         void setGraphicsLayer(MMSConfigDataLayer layer);
00238         void setFullScreen(MMSFBFullScreenMode fsm);
00239         void setRotateScreen(int rs);
00240         void setHideApplication(bool hideapplication);
00241         void setInitialLoad(bool initialload);
00242         void setDebugFrames(bool debugframes);
00243 
00244         // language section getters
00245         const MMSLanguage getSourceLang();
00246         const MMSLanguage getDefaultTargetLang();
00247         const bool   getAddTranslations();
00248         const string getLanguagefileDir();
00249 
00250 };
00251 
00252 #endif /*MMSCONFIGDATA_H_*/
00253 

Generated by doxygen