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

mmstypes.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-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 MMSTYPES_H_
00034 #define MMSTYPES_H_
00035 
00036 using namespace std;
00037 
00038 #include <sigc++/sigc++.h>
00039 #include <string>
00040 
00041 // sigc++ accumulators.......................................................
00042 
00043 //example from: http://libsigc.sourceforge.net/libsigc2/docs/reference/html/classsigc_1_1signal_1_1accumulated.html
00044 //! this accumulator calculates the arithmetic mean value
00045 struct arithmetic_mean_accumulator
00046 {
00047   typedef double result_type;
00048   template<typename T_iterator>
00049   result_type operator()(T_iterator first, T_iterator last) const
00050   {
00051     result_type value_ = 0;
00052     int n_ = 0;
00053     for (; first != last; ++first, ++n_)
00054       value_ += *first;
00055     return value_ / n_;
00056   }
00057 };
00058 
00059 //example from: http://libsigc.sourceforge.net/libsigc2/docs/reference/html/classsigc_1_1signal_1_1accumulated.html
00060 //! this accumulator stops signal emission when a slot returns zero
00061 struct interruptable_accumulator
00062 {
00063   typedef bool result_type;
00064   template<typename T_iterator>
00065   result_type operator()(T_iterator first, T_iterator last) const
00066   {
00067     int n_ = 0;
00068     for (; first != last; ++first, ++n_)
00069       if (!*first) return false;
00070     return true;
00071   }
00072 };
00073 
00074 //! bool accumulator
00075 /*!
00076 with this accumulator the emit() method of a callback ends with
00077  - true,  if the no callback methods are connected or all connected callback methods returns true
00078  - false, if at least one connected callback method returns false
00079 */
00080 struct bool_accumulator
00081 {
00082   typedef bool result_type;
00083   template<typename T_iterator>
00084   result_type operator()(T_iterator first, T_iterator last) const
00085   {
00086     bool ret_ = true;
00087     int n_ = 0;
00088     for (; first != last; ++first, ++n_)
00089       if (!*first) ret_ = false;
00090     return ret_;
00091   }
00092 };
00093 
00094 
00095 //! bool accumulator (not)
00096 /*!
00097 with this accumulator the emit() method of a callback ends with
00098  - false, if the no callback methods are connected or all connected callback methods returns false
00099  - true,  if at least one connected callback method returns true
00100 */
00101 struct neg_bool_accumulator
00102 {
00103   typedef bool result_type;
00104   template<typename T_iterator>
00105   result_type operator()(T_iterator first, T_iterator last) const
00106   {
00107     bool ret_ = false;
00108     int n_ = 0;
00109     for (; first != last; ++first, ++n_)
00110       if (*first) ret_ = true;
00111     return ret_;
00112   }
00113 };
00114 
00115 
00116 
00117 // plane description.........................................................
00118 
00119 //! Describes up to 3 planes of an surface buffer.
00120 class MMSFBSurfacePlanes {
00121     public:
00122         //! buffer is a hardware buffer?
00123         bool    hwbuffer;
00124         //! the current pixel data describes a full opaque surface
00125         bool    opaque;
00126         //! the current pixel data describes a full transparent surface
00127         bool    transparent;
00128         //! first plane
00129         void    *ptr;
00130         //! pitch of first plane
00131         int     pitch;
00132         //! second plane or NULL if surface has only one plane
00133         void    *ptr2;
00134         //! pitch of second plane
00135         int     pitch2;
00136         //! third plane or NULL if surface has only one or two planes
00137         void    *ptr3;
00138         //! pitch of third plane
00139         int     pitch3;
00140 
00141         MMSFBSurfacePlanes(void *ptr = NULL, int pitch = 0, void *ptr2 = NULL, int pitch2 = 0, void *ptr3 = NULL, int pitch3 = 0) {
00142             this->hwbuffer      = false;
00143             this->opaque        = false;
00144             this->transparent   = false;
00145             this->ptr           = ptr;
00146             this->pitch         = pitch;
00147             this->ptr2          = ptr2;
00148             this->pitch2        = pitch2;
00149             this->ptr3          = ptr3;
00150             this->pitch3        = pitch3;
00151         }
00152 };
00153 
00154 //! for compatibility reason
00155 #define MMSFBExternalSurfaceBuffer  MMSFBSurfacePlanes
00156 
00157 //! max. number of buffers (3=TRIPLE buffering)
00158 #define MMSFB_MAX_SURFACE_PLANES_BUFFERS    3
00159 
00160 //! describes multiple buffers for backbuffer/triple buffer handling
00161 typedef class MMSFBSurfacePlanes MMSFBSurfacePlanesBuffer[MMSFB_MAX_SURFACE_PLANES_BUFFERS];
00162 
00163 
00164 // display backend types.....................................................
00165 
00166 //! supported display backends
00167 typedef enum {
00168     //! none
00169     MMSFB_BE_NONE = 0,
00170     //! directfb backend
00171     MMSFB_BE_DFB,
00172     //! X11 backend from disko framework
00173     MMSFB_BE_X11,
00174     //! FBDEV backend from disko framework
00175     MMSFB_BE_FBDEV
00176 } MMSFBBackend;
00177 
00178 //! backend: none
00179 #define MMSFB_BE_NONE_STR       ""
00180 //! backend: DFB
00181 #define MMSFB_BE_DFB_STR        "DFB"
00182 //! backend: X11
00183 #define MMSFB_BE_X11_STR        "X11"
00184 //! backend: FBDEV
00185 #define MMSFB_BE_FBDEV_STR      "FBDEV"
00186 
00187 //! list of valid backend types
00188 #define MMSFB_BE_VALID_VALUES   "DFB, X11, FBDEV"
00189 
00190 //! list of valid backend types for output types MMSFB_OT_xxxFB
00191 #define MMSFB_BE_VALID_VALUES_OT_FB "DFB, FBDEV"
00192 
00193 //! list of valid backend types for output type MMSFB_OT_X11
00194 #define MMSFB_BE_VALID_VALUES_OT_X11    "DFB, X11"
00195 
00196 //! list of valid backend types for output type MMSFB_OT_X
00197 #define MMSFB_BE_VALID_VALUES_OT_X      "X11"
00198 
00199 // conversion routines for backend types
00200 string getMMSFBBackendString(MMSFBBackend be);
00201 MMSFBBackend getMMSFBBackendFromString(string be);
00202 
00203 
00204 // output types..............................................................
00205 
00206 //! supported output types
00207 typedef enum {
00208     //! none
00209     MMSFB_OT_NONE = 0,
00210     //! STDFB (backend: DFB and FBDEV)
00211     MMSFB_OT_STDFB,
00212     //! MATROXFB (backend: DFB and FBDEV)
00213     MMSFB_OT_MATROXFB,
00214     //! VIAFB (backend: DFB)
00215     MMSFB_OT_VIAFB,
00216     //! X11 (backend: DFB and X11)
00217     MMSFB_OT_X11,
00218     //! XSHM (backend: X11)
00219     MMSFB_OT_XSHM,
00220     //! XVSHM (backend: X11)
00221     MMSFB_OT_XVSHM,
00222     //! DAVINCIFB (backend: DFB and FBDEV)
00223     MMSFB_OT_DAVINCIFB,
00224     //! OMAPFB (backend: DFB and FBDEV)
00225     MMSFB_OT_OMAPFB,
00226     //! OGL (backend: X11 and FBDEV)
00227     MMSFB_OT_OGL
00228 } MMSFBOutputType;
00229 
00230 //! output type: none
00231 #define MMSFB_OT_NONE_STR       ""
00232 //! output type: STDFB (backend: DFB and FBDEV)
00233 #define MMSFB_OT_STDFB_STR      "STDFB"
00234 //! output type: MATROXFB (backend: DFB and FBDEV)
00235 #define MMSFB_OT_MATROXFB_STR   "MATROXFB"
00236 //! output type: VIAFB (backend: DFB)
00237 #define MMSFB_OT_VIAFB_STR      "VIAFB"
00238 //! output type: X11 (backend: DFB and X11)
00239 #define MMSFB_OT_X11_STR        "X11"
00240 //! output type: XSHM (backend: X11)
00241 #define MMSFB_OT_XSHM_STR       "XSHM"
00242 //! output type: XVSHM (backend: X11)
00243 #define MMSFB_OT_XVSHM_STR      "XVSHM"
00244 //! output type: DAVINCIFB (backend: DFB and FBDEV)
00245 #define MMSFB_OT_DAVINCIFB_STR  "DAVINCIFB"
00246 //! output type: OMAPFB (backend: DFB and FBDEV)
00247 #define MMSFB_OT_OMAPFB_STR "OMAPFB"
00248 //! output type: OGL (backend: X11 and FBDEV)
00249 #define MMSFB_OT_OGL_STR        "OGL"
00250 
00251 //! list of valid output types
00252 #define MMSFB_OT_VALID_VALUES           "STDFB, MATROXFB, VIAFB, X11, XSHM, XVSHM, DAVINCIFB, OMAPFB, OGL"
00253 
00254 //! list of valid output types for backend MMSFB_BE_DFB
00255 #define MMSFB_OT_VALID_VALUES_BE_DFB    "STDFB, MATROXFB, VIAFB, X11, DAVINCIFB, OMAPFB"
00256 
00257 //! list of valid output types for backend MMSFB_BE_X11
00258 #define MMSFB_OT_VALID_VALUES_BE_X11    "X11, XSHM, XVSHM, OGL"
00259 
00260 //! list of valid output types for backend MMSFB_BE_FBDEV
00261 #define MMSFB_OT_VALID_VALUES_BE_FBDEV  "STDFB, MATROXFB, DAVINCIFB, OMAPFB, OGL"
00262 
00263 // conversion routines for output types
00264 string getMMSFBOutputTypeString(MMSFBOutputType ot);
00265 MMSFBOutputType getMMSFBOutputTypeFromString(string ot);
00266 
00267 
00268 // full screen modes.........................................................
00269 
00270 //! supported full screen modes
00271 typedef enum {
00272     //! none
00273     MMSFB_FSM_NONE = 0,
00274     //! disabled
00275     MMSFB_FSM_FALSE,
00276     //! enabled
00277     MMSFB_FSM_TRUE,
00278     //! enabled, using the correct aspect ratio
00279     MMSFB_FSM_ASPECT_RATIO
00280 } MMSFBFullScreenMode;
00281 
00282 //! full screen mode: none
00283 #define MMSFB_FSM_NONE_STR          ""
00284 //! full screen mode: disabled
00285 #define MMSFB_FSM_FALSE_STR         "FALSE"
00286 //! full screen mode: enabled
00287 #define MMSFB_FSM_TRUE_STR          "TRUE"
00288 //! full screen mode: enabled, using the correct aspect ratio
00289 #define MMSFB_FSM_ASPECT_RATIO_STR  "ASPECT_RATIO"
00290 
00291 //! list of valid full screen modes
00292 #define MMSFB_FSM_VALID_VALUES      "FALSE, TRUE, ASPECT_RATIO"
00293 
00294 // conversion routines for full screen modes
00295 string getMMSFBFullScreenModeString(MMSFBFullScreenMode fsm);
00296 MMSFBFullScreenMode getMMSFBFullScreenModeFromString(string fsm);
00297 
00298 
00299 // pixelformats..............................................................
00300 
00301 //! supported pixel formats
00302 typedef enum {
00303     //! none
00304     MMSFB_PF_NONE = 0,
00305     //! 16 bit RGB (2 byte, red 5\@11, green 6\@5, blue 5\@0)
00306     MMSFB_PF_RGB16,
00307     //! 24 bit RGB (3 byte, red 8\@16, green 8\@8, blue 8\@0)
00308     MMSFB_PF_RGB24,
00309     //! 24 bit RGB (4 byte, nothing 8\@24, red 8\@16, green 8\@8, blue 8\@0)
00310     MMSFB_PF_RGB32,
00311     //! 32 bit ARGB (4 byte, alpha 8\@24, red 8\@16, green 8\@8, blue 8\@0)
00312     MMSFB_PF_ARGB,
00313     //! 8 bit alpha (1 byte, alpha 8\@0), e.g. anti-aliased glyphs
00314     MMSFB_PF_A8,
00315     //! 16 bit YUV (4 byte/2 pixel, macropixel contains CbYCrY [31:0])
00316     MMSFB_PF_YUY2,
00317     //! 16 bit YUV (4 byte/2 pixel, macropixel contains YCbYCr [31:0])
00318     MMSFB_PF_UYVY,
00319     //! 12 bit YUV (8 bit Y plane followed by 8 bit quarter size U/V planes)
00320     MMSFB_PF_I420,
00321     //! 12 bit YUV (8 bit Y plane followed by 8 bit quarter size V/U planes)
00322     MMSFB_PF_YV12,
00323     //! 32 bit ARGB (4 byte, inv. alpha 8\@24, red 8\@16, green 8\@8, blue 8\@0)
00324     MMSFB_PF_AiRGB,
00325     //! 1 bit alpha (1 byte/8 pixel, most significant bit used first)
00326     MMSFB_PF_A1,
00327     //! 12 bit YUV (8 bit Y plane followed by one 16 bit quarter size CbCr [15:0] plane)
00328     MMSFB_PF_NV12,
00329     //! 16 bit YUV (8 bit Y plane followed by one 16 bit half width CbCr [15:0] plane)
00330     MMSFB_PF_NV16,
00331     //! 12 bit YUV (8 bit Y plane followed by one 16 bit quarter size CrCb [15:0] plane)
00332     MMSFB_PF_NV21,
00333     //! 32 bit AYUV (4 byte, alpha 8\@24, Y 8\@16, Cb 8\@8, Cr 8\@0)
00334     MMSFB_PF_AYUV,
00335     //! 4 bit alpha (1 byte/2 pixel, more significant nibble used first)
00336     MMSFB_PF_A4,
00337     //! 19 bit ARGB (3 byte, nothing 5\@19, alpha 1\@18, red 6\@12, green 6\@6, blue 6\@0)
00338     MMSFB_PF_ARGB1666,
00339     //! 24 bit ARGB (3 byte, alpha 6\@18, red 6\@12, green 6\@6, blue 6\@0)
00340     MMSFB_PF_ARGB6666,
00341     //! 18 bit RGB (3 byte, nothing 6\@18, red 6\@12, green 6\@6, blue 6\@0)
00342     MMSFB_PF_RGB18,
00343     //! 2 bit LUT (1 byte/4 pixel, 2 bit color and alpha lookup from palette)
00344     MMSFB_PF_LUT2,
00345     //! 12 bit RGB (2 byte, nothing 4\@12, red 4\@8, green 4\@4, blue 4\@0)
00346     MMSFB_PF_RGB444,
00347     //! 15 bit RGB (2 byte, nothing 1\@15, red 5\@10, green 5\@5, blue 5\@0)
00348     MMSFB_PF_RGB555,
00349     //! 16 bit ARGB (2 byte, alpha 1\@15, red 5\@10, green 5\@5, blue 5\@0)
00350     MMSFB_PF_ARGB1555,
00351     //! 8 bit RGB (1 byte, red 3\@5, green 3\@2, blue 2\@0)
00352     MMSFB_PF_RGB332,
00353     //! 8 bit ALUT (1 byte, alpha 4\@4, color lookup 4\@0)
00354     MMSFB_PF_ALUT44,
00355     //! 8 bit LUT (8 bit color and alpha lookup from palette)
00356     MMSFB_PF_LUT8,
00357     //! 16 bit ARGB (2 byte, alpha 2\@14, red 5\@9, green 5\@4, blue 4\@0)
00358     MMSFB_PF_ARGB2554,
00359     //! 16 bit ARGB (2 byte, alpha 4\@12, red 4\@8, green 4\@4, blue 4\@0)
00360     MMSFB_PF_ARGB4444,
00361     //! 19 bit ARGB (16 bit RGB565 plane followed by 4 bit alpha plane (highest bit unused))
00362     MMSFB_PF_ARGB3565,
00363     //! 24 bit BGR (3 byte, blue 8\@16, green 8\@8, red 8\@0)
00364     MMSFB_PF_BGR24,
00365     //! 15 bit BGR (2 byte, nothing 1\@15, blue 5\@10, green 5\@5, red 5\@0)
00366     MMSFB_PF_BGR555,
00367     //! 32 bit ABGR (4 byte, alpha 8\@24, blue 8\@16, green 8\@8, red 8\@0)
00368     MMSFB_PF_ABGR,
00369     //! number of supported pixelformats
00370     MMSFB_PF_CNT
00371 } MMSFBSurfacePixelFormat;
00372 
00373 //! pixel format: none
00374 #define MMSFB_PF_NONE_STR       ""
00375 //! pixel format: 16 bit RGB (2 byte, red 5\@11, green 6\@5, blue 5\@0)
00376 #define MMSFB_PF_RGB16_STR      "RGB16"
00377 //! pixel format: 24 bit RGB (3 byte, red 8\@16, green 8\@8, blue 8\@0)
00378 #define MMSFB_PF_RGB24_STR      "RGB24"
00379 //! pixel format: 24 bit RGB (4 byte, nothing 8\@24, red 8\@16, green 8\@8, blue 8\@0)
00380 #define MMSFB_PF_RGB32_STR      "RGB32"
00381 //! pixel format: 32 bit ARGB (4 byte, alpha 8\@24, red 8\@16, green 8\@8, blue 8\@0)
00382 #define MMSFB_PF_ARGB_STR       "ARGB"
00383 //! pixel format: 8 bit alpha (1 byte, alpha 8\@0), e.g. anti-aliased glyphs
00384 #define MMSFB_PF_A8_STR         "A8"
00385 //! pixel format: 16 bit YUV (4 byte/2 pixel, macropixel contains CbYCrY [31:0])
00386 #define MMSFB_PF_YUY2_STR       "YUY2"
00387 //! pixel format: 16 bit YUV (4 byte/2 pixel, macropixel contains YCbYCr [31:0])
00388 #define MMSFB_PF_UYVY_STR       "UYVY"
00389 //! pixel format: 12 bit YUV (8 bit Y plane followed by 8 bit quarter size U/V planes)
00390 #define MMSFB_PF_I420_STR       "I420"
00391 //! pixel format: 12 bit YUV (8 bit Y plane followed by 8 bit quarter size V/U planes)
00392 #define MMSFB_PF_YV12_STR       "YV12"
00393 //! pixel format: 32 bit ARGB (4 byte, inv. alpha 8\@24, red 8\@16, green 8\@8, blue 8\@0)
00394 #define MMSFB_PF_AiRGB_STR      "AiRGB"
00395 //! pixel format: 1 bit alpha (1 byte/8 pixel, most significant bit used first)
00396 #define MMSFB_PF_A1_STR         "A1"
00397 //! pixel format: 12 bit YUV (8 bit Y plane followed by one 16 bit quarter size CbCr [15:0] plane)
00398 #define MMSFB_PF_NV12_STR       "NV12"
00399 //! pixel format: 16 bit YUV (8 bit Y plane followed by one 16 bit half width CbCr [15:0] plane)
00400 #define MMSFB_PF_NV16_STR       "NV16"
00401 //! pixel format: 12 bit YUV (8 bit Y plane followed by one 16 bit quarter size CrCb [15:0] plane)
00402 #define MMSFB_PF_NV21_STR       "NV21"
00403 //! pixel format: 32 bit AYUV (4 byte, alpha 8\@24, Y 8\@16, Cb 8\@8, Cr 8\@0)
00404 #define MMSFB_PF_AYUV_STR       "AYUV"
00405 //! pixel format: 4 bit alpha (1 byte/2 pixel, more significant nibble used first)
00406 #define MMSFB_PF_A4_STR         "A4"
00407 //! pixel format: 19 bit ARGB (3 byte, nothing 5\@19, alpha 1\@18, red 6\@12, green 6\@6, blue 6\@0)
00408 #define MMSFB_PF_ARGB1666_STR   "ARGB1666"
00409 //! pixel format: 24 bit ARGB (3 byte, alpha 6\@18, red 6\@12, green 6\@6, blue 6\@0)
00410 #define MMSFB_PF_ARGB6666_STR   "ARGB6666"
00411 //! pixel format: 18 bit RGB (3 byte, nothing 6\@18, red 6\@12, green 6\@6, blue 6\@0)
00412 #define MMSFB_PF_RGB18_STR      "RGB18"
00413 //! pixel format: 2 bit LUT (1 byte/4 pixel, 2 bit color and alpha lookup from palette)
00414 #define MMSFB_PF_LUT2_STR       "LUT2"
00415 //! pixel format: 12 bit RGB (2 byte, nothing 4\@12, red 4\@8, green 4\@4, blue 4\@0)
00416 #define MMSFB_PF_RGB444_STR     "RGB444"
00417 //! pixel format: 15 bit RGB (2 byte, nothing 1\@15, red 5\@10, green 5\@5, blue 5\@0)
00418 #define MMSFB_PF_RGB555_STR     "RGB555"
00419 //! pixel format: 16 bit ARGB (2 byte, alpha 1\@15, red 5\@10, green 5\@5, blue 5\@0)
00420 #define MMSFB_PF_ARGB1555_STR   "ARGB1555"
00421 //! pixel format: 8 bit RGB (1 byte, red 3\@5, green 3\@2, blue 2\@0)
00422 #define MMSFB_PF_RGB332_STR     "RGB332"
00423 //! pixel format: 8 bit ALUT (1 byte, alpha 4\@4, color lookup 4\@0)
00424 #define MMSFB_PF_ALUT44_STR     "ALUT44"
00425 //! pixel format: 8 bit LUT (8 bit color and alpha lookup from palette)
00426 #define MMSFB_PF_LUT8_STR       "LUT8"
00427 //! pixel format: 16 bit ARGB (2 byte, alpha 2\@14, red 5\@9, green 5\@4, blue 4\@0)
00428 #define MMSFB_PF_ARGB2554_STR   "ARGB2554"
00429 //! pixel format: 16 bit ARGB (2 byte, alpha 4\@12, red 4\@8, green 4\@4, blue 4\@0)
00430 #define MMSFB_PF_ARGB4444_STR   "ARGB4444"
00431 //! pixel format: 19 bit ARGB (16 bit RGB565 plane followed by 4 bit alpha plane (highest bit unused))
00432 #define MMSFB_PF_ARGB3565_STR   "ARGB3565"
00433 //! pixel format: 24 bit BGR (3 byte, blue 8\@16, green 8\@8, red 8\@0)
00434 #define MMSFB_PF_BGR24_STR      "BGR24"
00435 //! pixel format: 15 bit BGR (2 byte, nothing 1\@15, blue 5\@10, green 5\@5, red 5\@0)
00436 #define MMSFB_PF_BGR555_STR     "BGR555"
00437 //! pixel format: 32 bit ABGR (4 byte, alpha 8\@24, blue 8\@16, green 8\@8, red 8\@0)
00438 #define MMSFB_PF_ABGR_STR       "ABGR"
00439 
00440 //! list of valid pixelformats
00441 #define MMSFB_PF_VALID_VALUES   "RGB16, RGB24, RGB32, ARGB, A8, YUY2, UYVY, I420, YV12, AiRGB, A1, NV12, NV16, NV21, AYUV, A4, ARGB1666, ARGB6666, RGB18, LUT2, RGB444, RGB555, ARGB1555, RGB332, ALUT44, LUT8, ARGB2554, ARGB4444, ARGB3565, BGR24, BGR555, ABGR"
00442 
00443 //! list of valid pixelformats used for layer surfaces
00444 #define MMSFB_PF_VALID_VALUES_LAYER "RGB16, RGB24, RGB32, ARGB, YUY2, UYVY, I420, YV12, AiRGB, NV12, NV16, NV21, AYUV, ARGB1666, ARGB6666, RGB18, LUT2, RGB444, RGB555, ARGB1555, RGB332, LUT8, ARGB2554, ARGB4444, ARGB3565, BGR24, BGR555, ABGR"
00445 
00446 //! list of valid pixelformats used for windows surfaces
00447 #define MMSFB_PF_VALID_VALUES_WINDOWS   "ARGB, AiRGB, AYUV, ARGB4444, RGB16, ABGR, empty string for auto detection"
00448 
00449 //! list of valid pixelformats used for worker surfaces
00450 #define MMSFB_PF_VALID_VALUES_SURFACES  "ARGB, AiRGB, AYUV, ARGB4444, RGB16, ABGR, empty string for auto detection"
00451 
00452 //! list of valid pixelformats for X11.XVSHM
00453 #define MMSFB_PF_VALID_VALUES_BE_X11_OT_XVSHM   "YV12"
00454 
00455 //! list of valid pixelformats for X11.XSHM
00456 #define MMSFB_PF_VALID_VALUES_BE_X11_OT_XSHM    "RGB32, ARGB, YV12"
00457 
00458 //! list of valid pixelformats for X11.OGL
00459 #define MMSFB_PF_VALID_VALUES_BE_X11_OT_OGL "RGB32, ARGB, ABGR"
00460 
00461 //! list of valid pixelformats for DAVINCIFB, OSD Layer
00462 #define MMSFB_PF_VALID_VALUES_BE_FBDEV_OT_DAVINCIFB_LAYER_0 "ARGB3565, RGB16"
00463 
00464 //! list of valid pixelformats for DAVINCIFB, Video Layer
00465 #define MMSFB_PF_VALID_VALUES_BE_FBDEV_OT_DAVINCIFB_LAYER_1 "YUY2"
00466 
00467 //! list of valid pixelformats for OMAPFB, OSD Layer
00468 #define MMSFB_PF_VALID_VALUES_BE_FBDEV_OT_OMAPFB_LAYER_0    "ARGB, RGB32, RGB16"
00469 
00470 //! list of valid pixelformats for OMAPFB, Video Layer
00471 #define MMSFB_PF_VALID_VALUES_BE_FBDEV_OT_OMAPFB_LAYER_1    "YUY2, RGB32"
00472 
00473 //! list of valid pixelformats for FBDEV.OGL
00474 #define MMSFB_PF_VALID_VALUES_BE_FBDEV_OT_OGL   "RGB32, ARGB, ABGR"
00475 
00476 //! list of valid pixelformats used for layer surfaces
00477 #define MMSFB_PF_VALID_BUFFERMODES "BACKVIDEO BACKSYSTEM FRONTONLY TRIPLE WINDOWS"
00478 #define MMSFB_PF_VALID_BUFFERMODES_X11 "BACKVIDEO BACKSYSTEM TRIPLE WINDOWS"
00479 
00480 // conversion routines for pixel formats
00481 string getMMSFBPixelFormatString(MMSFBSurfacePixelFormat pf);
00482 MMSFBSurfacePixelFormat getMMSFBPixelFormatFromString(string pf);
00483 
00484 
00485 // color definition..........................................................
00486 
00487 //! describes a color with alpha
00488 class MMSFBColor {
00489     public:
00490         //! red
00491         unsigned char r;
00492         //! green
00493         unsigned char g;
00494         //! blue
00495         unsigned char b;
00496         //! alphachannel
00497         unsigned char a;
00498 
00499         MMSFBColor() {
00500             this->r = 0x00;
00501             this->g = 0x00;
00502             this->b = 0x00;
00503             this->a = 0x00;
00504         }
00505 
00506         MMSFBColor(unsigned char r, unsigned char g, unsigned char b, unsigned char a) {
00507             this->r = r;
00508             this->g = g;
00509             this->b = b;
00510             this->a = a;
00511         }
00512 
00513         MMSFBColor(unsigned int argb) {
00514             this->b = argb & 0xff;
00515             this->g = (argb << 16) >> 24;
00516             this->r = (argb << 8)  >> 24;
00517             this->a = argb >> 24;
00518         }
00519 
00520         unsigned int getARGB() {
00521             unsigned int argb;
00522             argb = (unsigned int)this->b;
00523             argb|= ((unsigned int)this->g) << 8;
00524             argb|= ((unsigned int)this->r) << 16;
00525             argb|= ((unsigned int)this->a) << 24;
00526             return argb;
00527         }
00528 
00529         bool operator==(const MMSFBColor &c) {
00530             return (this->r == c.r && this->g == c.g && this->b == c.b && this->a == c.a);
00531         }
00532 
00533         bool operator!=(const MMSFBColor &c) {
00534             return (this->r != c.r || this->g != c.g || this->b != c.b || this->a != c.a);
00535         }
00536 
00537 };
00538 
00539 //! Convert a color string into MMSFBColor.
00540 /*!
00541 The input string has the syntax "#rrggbbaa".
00542 
00543     rr - hex value for red
00544     gg - hex value for green
00545     bb - hex value for blue
00546     aa - hex value for alpha channel (value ff means full opaque)
00547 
00548 \param input  the input string
00549 \param color  pointer to the color to be returned
00550 \return true if input is correct
00551 \note If the function fails, the color is set to "#00000000".
00552 */
00553 bool getMMSFBColorFromString(string input, MMSFBColor *color);
00554 
00555 
00556 //! Convert MMSFBColor to a color string.
00557 /*!
00558 The output string has the syntax "#rrggbbaa".
00559 
00560     rr - hex value for red
00561     gg - hex value for green
00562     bb - hex value for blue
00563     aa - hex value for alpha channel (value ff means full opaque)
00564 
00565 \param color  color to be converted
00566 \return color string
00567 */
00568 string getMMSFBColorString(MMSFBColor color);
00569 
00570 
00571 // rectangles, regions, etc..................................................
00572 
00573 //! describes a rectangle
00574 class MMSFBRectangle {
00575     public:
00576         //! x
00577         int x;
00578         //! y
00579         int y;
00580         //! width
00581         int w;
00582         //! height
00583         int h;
00584 
00585         MMSFBRectangle(int x = 0, int y = 0, int w = 0, int h = 0) {
00586             this->x = x;
00587             this->y = y;
00588             this->w = w;
00589             this->h = h;
00590         }
00591 };
00592 
00593 //! describes a region
00594 class MMSFBRegion {
00595     public:
00596         //! x1
00597         int x1;
00598         //! y1
00599         int y1;
00600         //! x2
00601         int x2;
00602         //! y2
00603         int y2;
00604 
00605         MMSFBRegion(int x1 = 0, int y1 = 0, int x2 = 0, int y2 = 0) {
00606             this->x1 = x1;
00607             this->y1 = y1;
00608             this->x2 = x2;
00609             this->y2 = y2;
00610         }
00611 };
00612 
00613 //! describes a triangle
00614 class MMSFBTriangle {
00615     public:
00616         //! x1
00617         int x1;
00618         //! y1
00619         int y1;
00620         //! x2
00621         int x2;
00622         //! y2
00623         int y2;
00624         //! x3
00625         int x3;
00626         //! y3
00627         int y3;
00628 
00629         MMSFBTriangle(int x1 = 0, int y1 = 0, int x2 = 0, int y2 = 0, int x3 = 0, int y3 = 0) {
00630             this->x1 = x1;
00631             this->y1 = y1;
00632             this->x2 = x2;
00633             this->y2 = y2;
00634             this->x3 = x3;
00635             this->y3 = y3;
00636         }
00637 };
00638 
00639 
00640 
00641 
00642 // pointer mode..............................................................
00643 
00644 //! supported pointer modes
00645 typedef enum {
00646     //! none
00647     MMSFB_PM_NONE = 0,
00648     //! disabled
00649     MMSFB_PM_FALSE,
00650     //! enabled, using internal mouse pointer
00651     MMSFB_PM_TRUE,
00652     //! enabled, using external mouse pointer e.g. from X11, if using the X11 backend
00653     MMSFB_PM_EXTERNAL
00654 } MMSFBPointerMode;
00655 
00656 //! pointer mode: none
00657 #define MMSFB_PM_NONE_STR           ""
00658 //! pointer mode: disabled
00659 #define MMSFB_PM_FALSE_STR          "FALSE"
00660 //! pointer mode: enabled, using internal mouse pointer
00661 #define MMSFB_PM_TRUE_STR           "TRUE"
00662 //! pointer mode: enabled, using external mouse pointer e.g. from X11, if using the X11 backend
00663 #define MMSFB_PM_EXTERNAL_STR       "EXTERNAL"
00664 
00665 //! list of valid pointer modes
00666 #define MMSFB_PM_VALID_VALUES       "FALSE, TRUE, EXTERNAL"
00667 
00668 
00669 // conversion routines for pointer modes
00670 string getMMSFBPointerModeString(MMSFBPointerMode pm);
00671 MMSFBPointerMode getMMSFBPointerModeFromString(string pm);
00672 
00673 // media backend types.......................................................
00674 
00675 //! supported media backends
00676 typedef enum {
00677     //! none
00678     MMSMEDIA_BE_NONE = 0,
00679     //! xine
00680     MMSMEDIA_BE_XINE,
00681     //! gstreamer
00682     MMSMEDIA_BE_GST
00683 } MMSMEDIABackend;
00684 
00685 
00686 
00687 // key symbols...............................................................
00688 
00689 //! supported keys
00690 typedef enum {
00691     MMSKEY_UNKNOWN=0,
00692     MMSKEY_BACKSPACE=1,
00693     MMSKEY_TAB=2,
00694     MMSKEY_RETURN=3,
00695     MMSKEY_CANCEL=4,
00696     MMSKEY_ESCAPE=5,
00697     MMSKEY_SPACE=6,
00698     MMSKEY_EXCLAMATION_MARK=7,
00699     MMSKEY_QUOTATION=8,
00700     MMSKEY_NUMBER_SIGN=9,
00701     MMSKEY_DOLLAR_SIGN=10,
00702     MMSKEY_PERCENT_SIGN=11,
00703     MMSKEY_AMPERSAND=12,
00704     MMSKEY_APOSTROPHE=13,
00705     MMSKEY_PARENTHESIS_LEFT=14,
00706     MMSKEY_PARENTHESIS_RIGHT=15,
00707     MMSKEY_ASTERISK=16,
00708     MMSKEY_PLUS_SIGN=17,
00709     MMSKEY_COMMA=18,
00710     MMSKEY_MINUS_SIGN=19,
00711     MMSKEY_PERIOD=20,
00712     MMSKEY_SLASH=21,
00713     MMSKEY_0=22,
00714     MMSKEY_1=23,
00715     MMSKEY_2=24,
00716     MMSKEY_3=25,
00717     MMSKEY_4=26,
00718     MMSKEY_5=27,
00719     MMSKEY_6=28,
00720     MMSKEY_7=29,
00721     MMSKEY_8=30,
00722     MMSKEY_9=31,
00723     MMSKEY_COLON=32,
00724     MMSKEY_SEMICOLON=33,
00725     MMSKEY_LESS_THAN_SIGN=34,
00726     MMSKEY_EQUALS_SIGN=35,
00727     MMSKEY_GREATER_THAN_SIGN=36,
00728     MMSKEY_QUESTION_MARK=37,
00729     MMSKEY_AT=38,
00730     MMSKEY_CAPITAL_A=39,
00731     MMSKEY_CAPITAL_B=40,
00732     MMSKEY_CAPITAL_C=41,
00733     MMSKEY_CAPITAL_D=42,
00734     MMSKEY_CAPITAL_E=43,
00735     MMSKEY_CAPITAL_F=44,
00736     MMSKEY_CAPITAL_G=45,
00737     MMSKEY_CAPITAL_H=46,
00738     MMSKEY_CAPITAL_I=47,
00739     MMSKEY_CAPITAL_J=48,
00740     MMSKEY_CAPITAL_K=49,
00741     MMSKEY_CAPITAL_L=50,
00742     MMSKEY_CAPITAL_M=51,
00743     MMSKEY_CAPITAL_N=52,
00744     MMSKEY_CAPITAL_O=53,
00745     MMSKEY_CAPITAL_P=54,
00746     MMSKEY_CAPITAL_Q=55,
00747     MMSKEY_CAPITAL_R=56,
00748     MMSKEY_CAPITAL_S=57,
00749     MMSKEY_CAPITAL_T=58,
00750     MMSKEY_CAPITAL_U=59,
00751     MMSKEY_CAPITAL_V=60,
00752     MMSKEY_CAPITAL_W=61,
00753     MMSKEY_CAPITAL_X=62,
00754     MMSKEY_CAPITAL_Y=63,
00755     MMSKEY_CAPITAL_Z=64,
00756     MMSKEY_SQUARE_BRACKET_LEFT=65,
00757     MMSKEY_BACKSLASH=66,
00758     MMSKEY_SQUARE_BRACKET_RIGHT=67,
00759     MMSKEY_CIRCUMFLEX_ACCENT=68,
00760     MMSKEY_UNDERSCORE=69,
00761     MMSKEY_GRAVE_ACCENT=70,
00762     MMSKEY_SMALL_A=71,
00763     MMSKEY_SMALL_B=72,
00764     MMSKEY_SMALL_C=73,
00765     MMSKEY_SMALL_D=74,
00766     MMSKEY_SMALL_E=75,
00767     MMSKEY_SMALL_F=76,
00768     MMSKEY_SMALL_G=77,
00769     MMSKEY_SMALL_H=78,
00770     MMSKEY_SMALL_I=79,
00771     MMSKEY_SMALL_J=80,
00772     MMSKEY_SMALL_K=81,
00773     MMSKEY_SMALL_L=82,
00774     MMSKEY_SMALL_M=83,
00775     MMSKEY_SMALL_N=84,
00776     MMSKEY_SMALL_O=85,
00777     MMSKEY_SMALL_P=86,
00778     MMSKEY_SMALL_Q=87,
00779     MMSKEY_SMALL_R=88,
00780     MMSKEY_SMALL_S=89,
00781     MMSKEY_SMALL_T=90,
00782     MMSKEY_SMALL_U=91,
00783     MMSKEY_SMALL_V=92,
00784     MMSKEY_SMALL_W=93,
00785     MMSKEY_SMALL_X=94,
00786     MMSKEY_SMALL_Y=95,
00787     MMSKEY_SMALL_Z=96,
00788     MMSKEY_CURLY_BRACKET_LEFT=97,
00789     MMSKEY_VERTICAL_BAR=98,
00790     MMSKEY_CURLY_BRACKET_RIGHT=99,
00791     MMSKEY_TILDE=100,
00792     MMSKEY_DELETE=101,
00793     MMSKEY_CURSOR_LEFT=102,
00794     MMSKEY_CURSOR_RIGHT=103,
00795     MMSKEY_CURSOR_UP=104,
00796     MMSKEY_CURSOR_DOWN=105,
00797     MMSKEY_INSERT=106,
00798     MMSKEY_HOME=107,
00799     MMSKEY_END=108,
00800     MMSKEY_PAGE_UP=109,
00801     MMSKEY_PAGE_DOWN=110,
00802     MMSKEY_PRINT=111,
00803     MMSKEY_PAUSE=112,
00804     MMSKEY_OK=113,
00805     MMSKEY_SELECT=114,
00806     MMSKEY_GOTO=115,
00807     MMSKEY_CLEAR=116,
00808     MMSKEY_POWER=117,
00809     MMSKEY_POWER2=118,
00810     MMSKEY_OPTION=119,
00811     MMSKEY_MENU=120,
00812     MMSKEY_HELP=121,
00813     MMSKEY_INFO=122,
00814     MMSKEY_TIME=123,
00815     MMSKEY_VENDOR=124,
00816     MMSKEY_ARCHIVE=125,
00817     MMSKEY_PROGRAM=126,
00818     MMSKEY_CHANNEL=127,
00819     MMSKEY_FAVORITES=128,
00820     MMSKEY_EPG=129,
00821     MMSKEY_PVR=130,
00822     MMSKEY_MHP=131,
00823     MMSKEY_LANGUAGE=132,
00824     MMSKEY_TITLE=133,
00825     MMSKEY_SUBTITLE=134,
00826     MMSKEY_ANGLE=135,
00827     MMSKEY_ZOOM=136,
00828     MMSKEY_MODE=137,
00829     MMSKEY_KEYBOARD=138,
00830     MMSKEY_PC=139,
00831     MMSKEY_SCREEN=140,
00832     MMSKEY_TV=141,
00833     MMSKEY_TV2=142,
00834     MMSKEY_VCR=143,
00835     MMSKEY_VCR2=144,
00836     MMSKEY_SAT=145,
00837     MMSKEY_SAT2=146,
00838     MMSKEY_CD=147,
00839     MMSKEY_TAPE=148,
00840     MMSKEY_RADIO=149,
00841     MMSKEY_TUNER=150,
00842     MMSKEY_PLAYER=151,
00843     MMSKEY_TEXT=152,
00844     MMSKEY_DVD=153,
00845     MMSKEY_AUX=154,
00846     MMSKEY_MP3=155,
00847     MMSKEY_PHONE=156,
00848     MMSKEY_AUDIO=157,
00849     MMSKEY_VIDEO=158,
00850     MMSKEY_INTERNET=159,
00851     MMSKEY_MAIL=160,
00852     MMSKEY_NEWS=161,
00853     MMSKEY_DIRECTORY=162,
00854     MMSKEY_LIST=163,
00855     MMSKEY_CALCULATOR=164,
00856     MMSKEY_MEMO=165,
00857     MMSKEY_CALENDAR=166,
00858     MMSKEY_EDITOR=167,
00859     MMSKEY_RED=168,
00860     MMSKEY_GREEN=169,
00861     MMSKEY_YELLOW=170,
00862     MMSKEY_BLUE=171,
00863     MMSKEY_CHANNEL_UP=172,
00864     MMSKEY_CHANNEL_DOWN=173,
00865     MMSKEY_BACK=174,
00866     MMSKEY_FORWARD=175,
00867     MMSKEY_FIRST=176,
00868     MMSKEY_LAST=177,
00869     MMSKEY_VOLUME_UP=178,
00870     MMSKEY_VOLUME_DOWN=179,
00871     MMSKEY_MUTE=180,
00872     MMSKEY_AB=181,
00873     MMSKEY_PLAYPAUSE=182,
00874     MMSKEY_PLAY=183,
00875     MMSKEY_STOP=184,
00876     MMSKEY_RESTART=185,
00877     MMSKEY_SLOW=186,
00878     MMSKEY_FAST=187,
00879     MMSKEY_RECORD=188,
00880     MMSKEY_EJECT=189,
00881     MMSKEY_SHUFFLE=190,
00882     MMSKEY_REWIND=191,
00883     MMSKEY_FASTFORWARD=192,
00884     MMSKEY_PREVIOUS=193,
00885     MMSKEY_NEXT=194,
00886     MMSKEY_BEGIN=195,
00887     MMSKEY_DIGITS=196,
00888     MMSKEY_TEEN=197,
00889     MMSKEY_TWEN=198,
00890     MMSKEY_BREAK=199,
00891     MMSKEY_EXIT=200,
00892     MMSKEY_SETUP=201,
00893     MMSKEY_CURSOR_LEFT_UP=202,
00894     MMSKEY_CURSOR_LEFT_DOWN=203,
00895     MMSKEY_CURSOR_UP_RIGHT=204,
00896     MMSKEY_CURSOR_DOWN_RIGHT=205,
00897     MMSKEY_F1=206,
00898     MMSKEY_F2=207,
00899     MMSKEY_F3=208,
00900     MMSKEY_F4=209,
00901     MMSKEY_F5=210,
00902     MMSKEY_F6=211,
00903     MMSKEY_F7=212,
00904     MMSKEY_F8=213,
00905     MMSKEY_F9=214,
00906     MMSKEY_F10=215,
00907     MMSKEY_F11=216,
00908     MMSKEY_F12=217,
00909     MMSKEY_SHIFT=218,
00910     MMSKEY_CONTROL=219,
00911     MMSKEY_ALT=220,
00912     MMSKEY_ALTGR=221,
00913     MMSKEY_META=222,
00914     MMSKEY_SUPER=223,
00915     MMSKEY_HYPER=224,
00916     MMSKEY_CAPS_LOCK=225,
00917     MMSKEY_NUM_LOCK=226,
00918     MMSKEY_SCROLL_LOCK=227,
00919     MMSKEY_DEAD_ABOVEDOT=228,
00920     MMSKEY_DEAD_ABOVERING=229,
00921     MMSKEY_DEAD_ACUTE=230,
00922     MMSKEY_DEAD_BREVE=231,
00923     MMSKEY_DEAD_CARON=232,
00924     MMSKEY_DEAD_CEDILLA=233,
00925     MMSKEY_DEAD_CIRCUMFLEX=234,
00926     MMSKEY_DEAD_DIAERESIS=235,
00927     MMSKEY_DEAD_DOUBLEACUTE=236,
00928     MMSKEY_DEAD_GRAVE=237,
00929     MMSKEY_DEAD_IOTA=238,
00930     MMSKEY_DEAD_MACRON=239,
00931     MMSKEY_DEAD_OGONEK=240,
00932     MMSKEY_DEAD_SEMIVOICED_SOUND=241,
00933     MMSKEY_DEAD_TILDE=242,
00934     MMSKEY_DEAD_VOICED_SOUND=243,
00935     MMSKEY_CUSTOM0=244,
00936     MMSKEY_CUSTOM1=245,
00937     MMSKEY_CUSTOM2=246,
00938     MMSKEY_CUSTOM3=247,
00939     MMSKEY_CUSTOM4=248,
00940     MMSKEY_CUSTOM5=249,
00941     MMSKEY_CUSTOM6=250,
00942     MMSKEY_CUSTOM7=251,
00943     MMSKEY_CUSTOM8=252,
00944     MMSKEY_CUSTOM9=253,
00945     MMSKEY_CUSTOM10=254,
00946     MMSKEY_CUSTOM11=255,
00947     MMSKEY_CUSTOM12=256,
00948     MMSKEY_CUSTOM13=257,
00949     MMSKEY_CUSTOM14=258,
00950     MMSKEY_CUSTOM15=259,
00951     MMSKEY_CUSTOM16=260,
00952     MMSKEY_CUSTOM17=261,
00953     MMSKEY_CUSTOM18=262,
00954     MMSKEY_CUSTOM19=263,
00955     MMSKEY_CUSTOM20=264,
00956     MMSKEY_CUSTOM21=265,
00957     MMSKEY_CUSTOM22=266,
00958     MMSKEY_CUSTOM23=267,
00959     MMSKEY_CUSTOM24=268,
00960     MMSKEY_CUSTOM25=269,
00961     MMSKEY_CUSTOM26=270,
00962     MMSKEY_CUSTOM27=271,
00963     MMSKEY_CUSTOM28=272,
00964     MMSKEY_CUSTOM29=273,
00965     MMSKEY_CUSTOM30=274,
00966     MMSKEY_CUSTOM31=275,
00967     MMSKEY_CUSTOM32=276,
00968     MMSKEY_CUSTOM33=277,
00969     MMSKEY_CUSTOM34=278,
00970     MMSKEY_CUSTOM35=279,
00971     MMSKEY_CUSTOM36=280,
00972     MMSKEY_CUSTOM37=281,
00973     MMSKEY_CUSTOM38=282,
00974     MMSKEY_CUSTOM39=283,
00975     MMSKEY_CUSTOM40=284,
00976     MMSKEY_CUSTOM41=285,
00977     MMSKEY_CUSTOM42=286,
00978     MMSKEY_CUSTOM43=287,
00979     MMSKEY_CUSTOM44=288,
00980     MMSKEY_CUSTOM45=289,
00981     MMSKEY_CUSTOM46=290,
00982     MMSKEY_CUSTOM47=291,
00983     MMSKEY_CUSTOM48=292,
00984     MMSKEY_CUSTOM49=293,
00985     MMSKEY_CUSTOM50=294,
00986     MMSKEY_CUSTOM51=295,
00987     MMSKEY_CUSTOM52=296,
00988     MMSKEY_CUSTOM53=297,
00989     MMSKEY_CUSTOM54=298,
00990     MMSKEY_CUSTOM55=299,
00991     MMSKEY_CUSTOM56=300,
00992     MMSKEY_CUSTOM57=301,
00993     MMSKEY_CUSTOM58=302,
00994     MMSKEY_CUSTOM59=303,
00995     MMSKEY_CUSTOM60=304,
00996     MMSKEY_CUSTOM61=305,
00997     MMSKEY_CUSTOM62=306,
00998     MMSKEY_CUSTOM63=307,
00999     MMSKEY_CUSTOM64=308,
01000     MMSKEY_CUSTOM65=309,
01001     MMSKEY_CUSTOM66=310,
01002     MMSKEY_CUSTOM67=311,
01003     MMSKEY_CUSTOM68=312,
01004     MMSKEY_CUSTOM69=313,
01005     MMSKEY_CUSTOM70=314,
01006     MMSKEY_CUSTOM71=315,
01007     MMSKEY_CUSTOM72=316,
01008     MMSKEY_CUSTOM73=317,
01009     MMSKEY_CUSTOM74=318,
01010     MMSKEY_CUSTOM75=319,
01011     MMSKEY_CUSTOM76=320,
01012     MMSKEY_CUSTOM77=321,
01013     MMSKEY_CUSTOM78=322,
01014     MMSKEY_CUSTOM79=323,
01015     MMSKEY_CUSTOM80=324,
01016     MMSKEY_CUSTOM81=325,
01017     MMSKEY_CUSTOM82=326,
01018     MMSKEY_CUSTOM83=327,
01019     MMSKEY_CUSTOM84=328,
01020     MMSKEY_CUSTOM85=329,
01021     MMSKEY_CUSTOM86=330,
01022     MMSKEY_CUSTOM87=331,
01023     MMSKEY_CUSTOM88=332,
01024     MMSKEY_CUSTOM89=333,
01025     MMSKEY_CUSTOM90=334,
01026     MMSKEY_CUSTOM91=335,
01027     MMSKEY_CUSTOM92=336,
01028     MMSKEY_CUSTOM93=337,
01029     MMSKEY_CUSTOM94=338,
01030     MMSKEY_CUSTOM95=339,
01031     MMSKEY_CUSTOM96=340,
01032     MMSKEY_CUSTOM97=341,
01033     MMSKEY_CUSTOM98=342,
01034     MMSKEY_CUSTOM99=343,
01035     MMSKEY_NULL=344
01036 } MMSKeySymbol;
01037 
01038 // returned strings must be equal to XKeysymToString()
01039 // we use GStreamer function gst_element_send_event() which uses "application/x-gst-navigation"
01040 const char *convertMMSKeySymbolToXKeysymString(MMSKeySymbol key);
01041 
01042 
01043 // Special State Type .......................................................
01044 
01045 //! special state type
01046 typedef enum {
01047     //! false
01048     MMSSTATE_FALSE = 0,
01049     //! true
01050     MMSSTATE_TRUE,
01051     //! auto
01052     MMSSTATE_AUTO
01053 } MMSSTATE;
01054 
01055 
01056 
01057 // Sequence mode ............................................................
01058 
01059 //! sequence mode
01060 typedef enum {
01061     //! no sequence
01062     MMSSEQUENCEMODE_NONE = 0,
01063     //! linear sequence
01064     MMSSEQUENCEMODE_LINEAR,
01065     //! logarithmical sequence, soft start and stop of the sequence
01066     MMSSEQUENCEMODE_LOG,
01067     //! logarithmical sequence, soft start
01068     MMSSEQUENCEMODE_LOG_SOFT_START,
01069     //! logarithmical sequence, soft end
01070     MMSSEQUENCEMODE_LOG_SOFT_END
01071 } MMSSEQUENCEMODE;
01072 
01073 
01074 
01075 // known languages...........................................................
01076 
01077 //! known languages
01078 typedef enum {
01079     //! none
01080     MMSLANG_NONE = 0,
01081     //! german
01082     MMSLANG_DE,
01083     //! english
01084     MMSLANG_EN,
01085     //! denmark
01086     MMSLANG_DK,
01087     //! spanish
01088     MMSLANG_ES,
01089     //! finnish
01090     MMSLANG_FI,
01091     //! french
01092     MMSLANG_FR,
01093     //! italian
01094     MMSLANG_IT,
01095     //! dutch
01096     MMSLANG_NL,
01097     //! norwegian
01098     MMSLANG_NO,
01099     //! swedish
01100     MMSLANG_SE,
01101     //! turkish
01102     MMSLANG_TR,
01103     //! chinese
01104     MMSLANG_CN,
01105     //! israeli
01106     MMSLANG_IL,
01107     //! arabic
01108     MMSLANG_AR,
01109     //! number of languages
01110     MMSLANG_SIZE
01111 } MMSLanguage;
01112 
01113 //! language: none
01114 #define MMSLANG_NONE_STR        ""
01115 //! language: german
01116 #define MMSLANG_DE_STR          "DE"
01117 //! language: english
01118 #define MMSLANG_EN_STR          "EN"
01119 //! language: denmark
01120 #define MMSLANG_DK_STR          "DK"
01121 //! language: spanish
01122 #define MMSLANG_ES_STR          "ES"
01123 //! language: finnish
01124 #define MMSLANG_FI_STR          "FI"
01125 //! language: french
01126 #define MMSLANG_FR_STR          "FR"
01127 //! language: italian
01128 #define MMSLANG_IT_STR          "IT"
01129 //! language: dutch
01130 #define MMSLANG_NL_STR          "NL"
01131 //! language: norwegian
01132 #define MMSLANG_NO_STR          "NO"
01133 //! language: swedish
01134 #define MMSLANG_SE_STR          "SE"
01135 //! language: turkish
01136 #define MMSLANG_TR_STR          "TR"
01137 //! language: chinese
01138 #define MMSLANG_CN_STR          "CN"
01139 //! language: israeli
01140 #define MMSLANG_IL_STR          "IL"
01141 //! language: arabic
01142 #define MMSLANG_AR_STR          "AR"
01143 
01144 // conversion routines for languages
01145 string getMMSLanguageString(MMSLanguage lang);
01146 MMSLanguage getMMSLanguageFromString(string lang);
01147 
01148 
01149 
01150 
01151 // -15 stored using a single precision bias of 127
01152 const unsigned int HALF_FLOAT_MIN_BIASED_EXP_AS_SINGLE_FP_EXP = 0x38000000;
01153 
01154 // max exponent value in single precision that will be converted
01155 // to Inf or Nan when stored as a half-float
01156 const unsigned int HALF_FLOAT_MAX_BIASED_EXP_AS_SINGLE_FP_EXP = 0x47800000;
01157 
01158 // 255 is the max exponent biased value
01159 const unsigned int FLOAT_MAX_BIASED_EXP = (0xFF << 23);
01160 const unsigned int HALF_FLOAT_MAX_BIASED_EXP = (0x1F << 10);
01161 
01162 // half-float type
01163 typedef unsigned short MMS_HALF_FLOAT;
01164 
01165 MMS_HALF_FLOAT convertFloat2HalfFloat(float f);
01166 float convertHalfFloat2Float(MMS_HALF_FLOAT hf);
01167 
01168 
01169 
01170 //! type of vertex data
01171 typedef enum {
01172     MMS_VERTEX_DATA_TYPE_FLOAT = 0,
01173     MMS_VERTEX_DATA_TYPE_HALF_FLOAT
01174 } MMS_VERTEX_DATA_TYPE;
01175 
01176 //! vertex array
01177 typedef struct {
01178     //! type of vertex data
01179     MMS_VERTEX_DATA_TYPE    dtype;
01180     //! vertex data
01181     void    *data;
01182     //! number of values per vertex
01183     int     eSize;
01184     //! number of vertices
01185     int     eNum;
01186 } MMS_VERTEX_ARRAY;
01187 
01188 #define MMS_VA_SET_VERTEX_2v(va, idx, val0, val1)   \
01189             if (va) { \
01190                 if (va->dtype == MMS_VERTEX_DATA_TYPE_HALF_FLOAT) { \
01191                     ((MMS_HALF_FLOAT*)va->data)[(idx) * va->eSize + 0] = convertFloat2HalfFloat((float)(val0)); \
01192                     ((MMS_HALF_FLOAT*)va->data)[(idx) * va->eSize + 1] = convertFloat2HalfFloat((float)(val1)); \
01193                 } else { \
01194                     ((float*)va->data)[(idx) * va->eSize + 0] = (float)(val0); \
01195                     ((float*)va->data)[(idx) * va->eSize + 1] = (float)(val1); \
01196                 } \
01197             }
01198 
01199 #define MMS_VA_SET_VERTEX_3v(va, idx, val0, val1, val2) \
01200             if (va) { \
01201                 if (va->dtype == MMS_VERTEX_DATA_TYPE_HALF_FLOAT) { \
01202                     ((MMS_HALF_FLOAT*)va->data)[(idx) * va->eSize + 0] = convertFloat2HalfFloat((float)(val0)); \
01203                     ((MMS_HALF_FLOAT*)va->data)[(idx) * va->eSize + 1] = convertFloat2HalfFloat((float)(val1)); \
01204                     ((MMS_HALF_FLOAT*)va->data)[(idx) * va->eSize + 2] = convertFloat2HalfFloat((float)(val2)); \
01205                 } else { \
01206                     ((float*)va->data)[(idx) * va->eSize + 0] = (float)(val0); \
01207                     ((float*)va->data)[(idx) * va->eSize + 1] = (float)(val1); \
01208                     ((float*)va->data)[(idx) * va->eSize + 2] = (float)(val2); \
01209                 } \
01210             }
01211 
01212 //! vertex buffer
01213 typedef struct {
01214     //! type of vertex data
01215     MMS_VERTEX_DATA_TYPE    dtype;
01216     //! id of buffer object
01217     unsigned int bo;
01218     //! offset into the buffer object's data store where data replacement will begin
01219     unsigned int offs;
01220     //! number of floats per vertex
01221     int     eSize;
01222     //! number of vertices
01223     int     eNum;
01224 } MMS_VERTEX_BUFFER;
01225 
01226 //! element type
01227 typedef enum {
01228     MMS_INDEX_ARRAY_TYPE_TRIANGLES = 0,
01229     MMS_INDEX_ARRAY_TYPE_TRIANGLE_STRIP,
01230     MMS_INDEX_ARRAY_TYPE_TRIANGLE_FAN,
01231     MMS_INDEX_ARRAY_TYPE_LINES,
01232     MMS_INDEX_ARRAY_TYPE_LINE_STRIP,
01233     MMS_INDEX_ARRAY_TYPE_LINE_LOOP
01234 } MMS_INDEX_ARRAY_TYPE;
01235 
01236 //! index array
01237 typedef struct {
01238     //! element type
01239     MMS_INDEX_ARRAY_TYPE    type;
01240     //! array of unsigned ints
01241     unsigned int    *data;
01242     //! number of indices
01243     int             eNum;
01244 } MMS_INDEX_ARRAY;
01245 
01246 //! index buffer
01247 typedef struct {
01248     //! element type
01249     MMS_INDEX_ARRAY_TYPE    type;
01250     //! id of buffer object
01251     unsigned int    bo;
01252     //! offset into the buffer object's data store where data replacement will begin
01253     unsigned int    offs;
01254     //! number of indices
01255     int             eNum;
01256 } MMS_INDEX_BUFFER;
01257 
01258 
01259 //! Initialize a MMS_VERTEX_ARRAY.
01260 /*!
01261 \param array    MMS_VERTEX_ARRAY to initialize
01262 \param eSize    number of values per vertex
01263 \param eNum     number of vertices
01264 \param dtype    type of vertex data, default is MMS_VERTEX_DATA_TYPE_FLOAT
01265 \param data     pointer to existing vertex data or NULL, default is NULL
01266 \return true if the array is successfully initialized
01267 \note If no data pointer is given by the caller, the function will allocate new space for vertex data.
01268 */
01269 bool initVertexArray(MMS_VERTEX_ARRAY *array, int eSize, int eNum,
01270                      MMS_VERTEX_DATA_TYPE dtype = MMS_VERTEX_DATA_TYPE_FLOAT, void *data = NULL);
01271 
01272 //! Release allocated space of a MMS_VERTEX_ARRAY.
01273 void freeVertexArray(MMS_VERTEX_ARRAY *array);
01274 
01275 //! Get size of a MMS_VERTEX_ARRAY in bytes.
01276 unsigned int getVertexArraySize(MMS_VERTEX_ARRAY *array);
01277 
01278 
01279 //! Initialize a MMS_INDEX_ARRAY.
01280 /*!
01281 \param array    MMS_INDEX_ARRAY to initialize
01282 \param type     specifies what kind of primitives to render
01283 \param eNum     number of indices or 0, default is 0
01284 \param data     pointer to existing index data or NULL, default is NULL
01285 \return true if the array is successfully initialized
01286 \note It is possible to have an index array with 0 indices.
01287 \note If no data pointer is given by the caller, the function will allocate new space for index data.
01288 */
01289 bool initIndexArray(MMS_INDEX_ARRAY *array, MMS_INDEX_ARRAY_TYPE type, int eNum = 0, unsigned int *data = NULL);
01290 
01291 //! Release allocated space of a MMS_INDEX_ARRAY.
01292 void freeIndexArray(MMS_INDEX_ARRAY *array);
01293 
01294 //! Get size of a MMS_INDEX_ARRAY in bytes.
01295 unsigned int getIndexArraySize(MMS_INDEX_ARRAY *array);
01296 
01297 
01298 typedef struct {
01299     float r;
01300     float g;
01301     float b;
01302     float a;
01303 } MMS3D_RGBA;
01304 
01305 typedef struct {
01306     MMS3D_RGBA  emission;
01307     MMS3D_RGBA  ambient;
01308     MMS3D_RGBA  diffuse;
01309     MMS3D_RGBA  specular;
01310     float       shininess;
01311 } MMS3D_MATERIAL_S;
01312 
01313 typedef float MMS3D_MATERIAL_A[17];
01314 
01315 typedef union {
01316     //! structure access
01317     MMS3D_MATERIAL_S    s;
01318     //! array access
01319     MMS3D_MATERIAL_A    a;
01320 } MMS3D_MATERIAL;
01321 
01322 
01323 
01324 
01325 
01326 
01327 #define MMS_PI 3.1415926535897932384626433832795f
01328 
01329 typedef float MMSMatrix[4][4];
01330 
01331 void multiplyMatrix(MMSMatrix result, MMSMatrix srcA, MMSMatrix srcB);
01332 void copyMatrix(MMSMatrix result, MMSMatrix src);
01333 bool equalMatrix(MMSMatrix result, MMSMatrix src);
01334 void loadIdentityMatrix(MMSMatrix result);
01335 void scaleMatrix(MMSMatrix result, float sx, float sy, float sz);
01336 void translateMatrix(MMSMatrix result, float tx, float ty, float tz);
01337 void rotateMatrix(MMSMatrix result, float angle, float x, float y, float z);
01338 void frustumMatrix(MMSMatrix result, float left, float right, float bottom, float top, float nearZ, float farZ);
01339 void perspectiveMatrix(MMSMatrix result, float fovy, float aspect, float nearZ, float farZ);
01340 void orthoMatrix(MMSMatrix result, float left, float right, float bottom, float top, float nearZ, float farZ);
01341 
01342 
01343 //! decribes a 3D object which can be rendered
01344 typedef struct _bei_object {
01345     //! parent of object or NULL
01346     _bei_object *parent;
01347 
01348     //! index to available vertices, else negative
01349     int     vertices;
01350 
01351     //! index to available normals, else negative
01352     int     normals;
01353 
01354     //! index to available texture coordinates, else negative
01355     int     texcoords;
01356 
01357     //! index to available indices, else negative
01358     int     indices;
01359 
01360     //! index to available material, else negative
01361     int     material;
01362 
01363     //! index to available texture, else negative
01364     int     texture;
01365 
01366     //! object is shown?
01367     bool    shown;
01368 
01369     //! cull face?
01370     bool    cullface;
01371 
01372     //! matrix of the object
01373     MMSMatrix   matrix;
01374 } MMS3D_OBJECT;
01375 
01376 
01377 bool isMMS3DObjectShown(MMS3D_OBJECT *object);
01378 
01379 
01380 
01381 
01382 
01383 
01384 #endif /* MMSTYPES_H_ */
01385 
01386 
01387 
01388 
01389 

Generated by doxygen