File: sdltoprojectM.h

package info (click to toggle)
projectm 2.1.0%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd, wheezy
  • size: 32,256 kB
  • ctags: 13,810
  • sloc: cpp: 31,087; ansic: 26,914; sh: 816; makefile: 20
file content (171 lines) | stat: -rw-r--r-- 4,555 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
/**
 * projectM -- Milkdrop-esque visualisation SDK
 * Copyright (C)2003-2004 projectM Team
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU General Public
 * License along with this library; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 * See 'LICENSE.txt' included within this release
 *
 */


/**
 * $Id: sdltoprojectM.h,v 1.1.1.1 2005/12/23 19:54:50 psperl Exp $
 *
 * Translates SDL -> projectM variables
 *
 * $Log: sdltoprojectM.h,v $
 * Revision 1.1.1.1  2005/12/23 19:54:50  psperl
 *
 *
 * Revision 1.1.1.1  2005/12/23 18:42:00  psperl
 * Initial Import
 *
 * Revision 1.1  2004/10/08 00:35:28  cvs
 * Moved and imported
 *
 * Revision 1.1.1.1  2004/10/04 12:56:00  cvs
 * Imported
 *
 */

#ifndef _SDLTOPROJECTM_H
#define _SDLTOPROJECTM_H

#include <event.h>
#ifdef WIN32
#include <SDL.h>
#else
#include <SDL/SDL.h>
#endif

projectMEvent sdl2pmEvent( SDL_Event event ) { \
							
    switch ( event.type ) { \
        case SDL_VIDEORESIZE:
            return PROJECTM_VIDEORESIZE; \
        case SDL_KEYUP: \
            return PROJECTM_KEYUP; \
        case SDL_KEYDOWN: \
            return PROJECTM_KEYDOWN; \
        default:
            return PROJECTM_KEYUP; \
      } \
  } \

projectMKeycode sdl2pmKeycode( SDLKey keysym ) { \
    switch ( keysym ) { \
        case SDLK_F1: \
            return PROJECTM_K_F1; \
        case SDLK_F2: \
            return PROJECTM_K_F2; \
        case SDLK_F3: \
            return PROJECTM_K_F3; \
        case SDLK_F4: \
            return PROJECTM_K_F4; \
        case SDLK_F5: \
            return PROJECTM_K_F5; \
        case SDLK_F6: \
            return PROJECTM_K_F6; \
        case SDLK_F7: \
            return PROJECTM_K_F7; \
        case SDLK_F8: \
            return PROJECTM_K_F8; \
        case SDLK_F9: \
            return PROJECTM_K_F9; \
        case SDLK_F10: \
            return PROJECTM_K_F10; \
        case SDLK_F11: \
            return PROJECTM_K_F11; \
        case SDLK_F12: \
            return PROJECTM_K_F12; \
	  case SDLK_ESCAPE: \
	    return PROJECTM_K_ESCAPE; 
    case SDLK_a:
      return PROJECTM_K_a;
    case SDLK_b:
      return PROJECTM_K_b;
    case SDLK_c:  
      return PROJECTM_K_c;
    case SDLK_d: 
      return PROJECTM_K_d; 
    case SDLK_e:
      return PROJECTM_K_e; 
    case SDLK_f: 
      return PROJECTM_K_f; 
    case SDLK_g: 
      return PROJECTM_K_g; 
    case SDLK_h: 
      return PROJECTM_K_h; 
    case SDLK_i: 
      return PROJECTM_K_i; 
    case SDLK_j:
      return PROJECTM_K_j;
    case SDLK_k:
      return PROJECTM_K_k;
    case SDLK_l:  
      return PROJECTM_K_l;
    case SDLK_m: 
      return PROJECTM_K_m; 
    case SDLK_n:
      return PROJECTM_K_n; 
    case SDLK_o: 
      return PROJECTM_K_o; 
    case SDLK_p: 
      return PROJECTM_K_p; 
    case SDLK_q: 
      return PROJECTM_K_q; 
    case SDLK_r: 
      return PROJECTM_K_r; 
    case SDLK_s: 
      return PROJECTM_K_s; 
    case SDLK_t:
      return PROJECTM_K_t; 
    case SDLK_u: 
      return PROJECTM_K_u; 
    case SDLK_v: 
      return PROJECTM_K_v; 
    case SDLK_w: 
      return PROJECTM_K_w; 
    case SDLK_x: 
      return PROJECTM_K_x; 
    case SDLK_y: 
      return PROJECTM_K_y; 
    case SDLK_z: 
      return PROJECTM_K_z; 
    case SDLK_UP:
      return PROJECTM_K_UP;
    case SDLK_RETURN:
      return PROJECTM_K_RETURN;
    case SDLK_RIGHT:
      return PROJECTM_K_RIGHT;
    case SDLK_LEFT:
      return PROJECTM_K_LEFT;
    case SDLK_DOWN:
      return PROJECTM_K_DOWN;
    case SDLK_PAGEUP:
      return PROJECTM_K_PAGEUP;
    case SDLK_PAGEDOWN:
      return PROJECTM_K_PAGEDOWN;
   
        default: \
            return PROJECTM_K_NONE; \
      } \
  } \

projectMModifier sdl2pmModifier( SDLMod mod ) { \
    return PROJECTM_KMOD_LSHIFT; \
  } \

#endif /** _SDLTOPROJECTM_H */