libmoldeo (Moldeo 1.0 Core)  1.0
libmoldeo is the group of objects and functions that executes the basic operations of Moldeo 1.0 Platform.
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
moPort.h
Go to the documentation of this file.
1 /*******************************************************************************
2  moPort.h
3  ****************************************************************************
4  * *
5  * This source is free software; you can redistribute it and/or modify *
6  * it under the terms of the GNU General Public License as published by *
7  * the Free Software Foundation; either version 2 of the License, or *
8  * (at your option) any later version. *
9  * *
10  * This code is distributed in the hope that it will be useful, but *
11  * WITHOUT ANY WARRANTY; without even the implied warranty of *
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
13  * General Public License for more details. *
14  * *
15  * A copy of the GNU General Public License is available on the World *
16  * Wide Web at <http://www.gnu.org/copyleft/gpl.html>. You can also *
17  * obtain it by writing to the Free Software Foundation, *
18  * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
19  * *
20  ****************************************************************************
21 
22  Copyright(C) 2006 Fabricio Costa
23 
24  Authors:
25  Fabricio Costa
26  Andrs Colubri
27 
28  ******************************************************************************
29  Use it for Linux compilation.
30  Must use autotools to determine this compatibility
31  ******************************************************************************/
32 
33 #ifndef _MOPORT_H_
34 #define _MOPORT_H_
35 
36 #include <stdio.h>
37 #include <cstdio>
38 
39 inline int
40 getch (void)
41 {
42  int ch=0, charactr=0;
43  while ((ch = getchar ()) != '\n')
44  {
45  charactr = ch;
46  }
47  return charactr;
48 }
49 
50 
51 inline char *
52 itoa (int value, char *str, int base=10)
53 {
54  char buffer[100];
55  char *res;
56 
57  base = 0;
58  // Memory-safe version of sprintf.
59  if (str==NULL) {
60  if (base==10) snprintf (buffer, 100, "%i", value);
61  if (base==16) snprintf (buffer, 100, "%x", value);
62  } else {
63  if (base==10) snprintf (str, 100, "%i", value);
64  if (base==16) snprintf (str, 100, "%x", value);
65  return str;
66  }
67  res = buffer;
68  return res;
69 }
70 
71 
72 /* Bug! Esto ya est definido en FreeImage.h */
73 /*
74 typedef uint8_t BYTE;
75 
76 struct RGBTRIPLE
77 {
78  BYTE rgbtBlue;
79  BYTE rgbtGreen;
80  BYTE rgbtRed;
81  RGBTRIPLE(BYTE r, BYTE g, BYTE b)
82  : rgbtBlue(b), rgbtGreen(g), rgbtRed(r) {}
83 };
84 */
85 
86 // Estas constantes fueron agregadas para solucionar errores de compilacion cuando se compara un ajTexto
87 // char*(by Andres)
88 const char *const LINEAL_STR = "L";
89 const char *const EXPONENCIAL_STR = "E";
90 const char *const INVERSO_STR = "I";
91 const char *const OTRA_STR = "O";
92 
93 const char *const BORRADO_STR = "borrado";
94 const char *const MIRROR_STR = "mirror";
95 const char *const MIRRORG_STR = "mirrorg";
96 const char *const MIRRORMORPHING_STR = "mirrormorphing";
97 
98 const char *const DEBUG_STR = "debug";
99 const char *const VIDEOWALL_STR = "videowall";
100 const char *const VIDEOWALLMORPHING_STR = "videowallmorphing";
101 
102 const char *const imagen_STR = "imagen";
103 const char *const emergente1_STR = "emergente1";
104 const char *const emergente2_STR = "emergente2";
105 const char *const emergente3_STR = "emergente3";
106 const char *const emergente4_STR = "emergente4";
107 const char *const icono_STR = "icono";
108 const char *const luces_STR = "luces";
109 const char *const texto_STR = "texto";
110 const char *const dibujoanimado_STR = "dibujoanimado";
111 const char *const interferencia_STR = "interferencia";
112 const char *const tunel_STR = "tunel";
113 const char *const grilla_STR = "grilla";
114 const char *const pelicula_STR = "pelicula";
115 const char *const multicitas_STR = "multicitas";
116 const char *const percusionluces_STR = "percusionluces";
117 const char *const cubemap_STR = "cubemap";
118 const char *const solido_STR = "solido";
119 const char *const escena_STR = "escena";
120 const char *const escena3d_STR = "escena3d";
121 const char *const icono3d_STR = "icono3d";
122 
123 #include <string>
124 using namespace std;
125 
126 #ifdef MO_LINUX
127 inline bool
128 stricmp (const char *str1, const char *str2)
129 {
130  return strcmp (str1, str2);
131 }
132 #endif
133 
134 #endif /* _MOPORT_H_ */
const char *const cubemap_STR
Definition: moPort.h:117
const char *const luces_STR
Definition: moPort.h:108
const char *const pelicula_STR
Definition: moPort.h:114
const char *const multicitas_STR
Definition: moPort.h:115
const char *const emergente2_STR
Definition: moPort.h:104
const char *const MIRRORMORPHING_STR
Definition: moPort.h:96
const char *const DEBUG_STR
Definition: moPort.h:98
const char *const tunel_STR
Definition: moPort.h:112
const char *const escena_STR
Definition: moPort.h:119
const char *const grilla_STR
Definition: moPort.h:113
const char *const OTRA_STR
Definition: moPort.h:91
const char *const VIDEOWALLMORPHING_STR
Definition: moPort.h:100
char * itoa(int value, char *str, int base=10)
Definition: moPort.h:52
const char *const interferencia_STR
Definition: moPort.h:111
const char *const LINEAL_STR
Definition: moPort.h:88
const char *const icono3d_STR
Definition: moPort.h:121
const char *const percusionluces_STR
Definition: moPort.h:116
const char *const MIRROR_STR
Definition: moPort.h:94
const char *const MIRRORG_STR
Definition: moPort.h:95
const char *const EXPONENCIAL_STR
Definition: moPort.h:89
const char *const texto_STR
Definition: moPort.h:109
const char *const icono_STR
Definition: moPort.h:107
const char *const escena3d_STR
Definition: moPort.h:120
const char *const solido_STR
Definition: moPort.h:118
const char *const imagen_STR
Definition: moPort.h:102
const char *const VIDEOWALL_STR
Definition: moPort.h:99
const char *const emergente3_STR
Definition: moPort.h:105
const char *const emergente4_STR
Definition: moPort.h:106
int getch(void)
Definition: moPort.h:40
const char *const dibujoanimado_STR
Definition: moPort.h:110
const char *const BORRADO_STR
Definition: moPort.h:93
const char *const emergente1_STR
Definition: moPort.h:103
const char *const INVERSO_STR
Definition: moPort.h:90