comparison src/video/uikit/SDL_uikitview.m @ 3685:64ce267332c6

Switched from SDL_WindowID and SDL_TextureID to SDL_Window* and SDL_Texture* for code simplicity and improved performance.
author Sam Lantinga <slouken@libsdl.org>
date Thu, 21 Jan 2010 06:21:52 +0000
parents b93965a16fe0
children 3e69e077cb95 b15e7017409b
comparison
equal deleted inserted replaced
3684:cc564f08884f 3685:64ce267332c6
270 @end 270 @end
271 271
272 /* iPhone keyboard addition functions */ 272 /* iPhone keyboard addition functions */
273 #if SDL_IPHONE_KEYBOARD 273 #if SDL_IPHONE_KEYBOARD
274 274
275 int SDL_iPhoneKeyboardShow(SDL_WindowID windowID) { 275 int SDL_iPhoneKeyboardShow(SDL_Window * window) {
276 276
277 SDL_Window *window = SDL_GetWindowFromID(windowID);
278 SDL_WindowData *data; 277 SDL_WindowData *data;
279 SDL_uikitview *view; 278 SDL_uikitview *view;
280 279
281 if (NULL == window) { 280 if (NULL == window) {
282 SDL_SetError("Window does not exist"); 281 SDL_SetError("Window does not exist");
294 [view showKeyboard]; 293 [view showKeyboard];
295 return 0; 294 return 0;
296 } 295 }
297 } 296 }
298 297
299 int SDL_iPhoneKeyboardHide(SDL_WindowID windowID) { 298 int SDL_iPhoneKeyboardHide(SDL_Window * window) {
300 299
301 SDL_Window *window = SDL_GetWindowFromID(windowID);
302 SDL_WindowData *data; 300 SDL_WindowData *data;
303 SDL_uikitview *view; 301 SDL_uikitview *view;
304 302
305 if (NULL == window) { 303 if (NULL == window) {
306 SDL_SetError("Window does not exist"); 304 SDL_SetError("Window does not exist");
318 [view hideKeyboard]; 316 [view hideKeyboard];
319 return 0; 317 return 0;
320 } 318 }
321 } 319 }
322 320
323 SDL_bool SDL_iPhoneKeyboardIsShown(SDL_WindowID windowID) { 321 SDL_bool SDL_iPhoneKeyboardIsShown(SDL_Window * window) {
324 322
325 SDL_Window *window = SDL_GetWindowFromID(windowID);
326 SDL_WindowData *data; 323 SDL_WindowData *data;
327 SDL_uikitview *view; 324 SDL_uikitview *view;
328 325
329 if (NULL == window) { 326 if (NULL == window) {
330 SDL_SetError("Window does not exist"); 327 SDL_SetError("Window does not exist");
341 else { 338 else {
342 return view.keyboardVisible; 339 return view.keyboardVisible;
343 } 340 }
344 } 341 }
345 342
346 int SDL_iPhoneKeyboardToggle(SDL_WindowID windowID) { 343 int SDL_iPhoneKeyboardToggle(SDL_Window * window) {
347 344
348 SDL_Window *window = SDL_GetWindowFromID(windowID);
349 SDL_WindowData *data; 345 SDL_WindowData *data;
350 SDL_uikitview *view; 346 SDL_uikitview *view;
351 347
352 if (NULL == window) { 348 if (NULL == window) {
353 SDL_SetError("Window does not exist"); 349 SDL_SetError("Window does not exist");
360 if (NULL == view) { 356 if (NULL == view) {
361 SDL_SetError("Window has no view"); 357 SDL_SetError("Window has no view");
362 return -1; 358 return -1;
363 } 359 }
364 else { 360 else {
365 if (SDL_iPhoneKeyboardIsShown(windowID)) { 361 if (SDL_iPhoneKeyboardIsShown(window)) {
366 SDL_iPhoneKeyboardHide(windowID); 362 SDL_iPhoneKeyboardHide(window);
367 } 363 }
368 else { 364 else {
369 SDL_iPhoneKeyboardShow(windowID); 365 SDL_iPhoneKeyboardShow(window);
370 } 366 }
371 return 0; 367 return 0;
372 } 368 }
373 } 369 }
374 370
375 #else 371 #else
376 372
377 /* stubs, used if compiled without keyboard support */ 373 /* stubs, used if compiled without keyboard support */
378 374
379 int SDL_iPhoneKeyboardShow(SDL_WindowID windowID) { 375 int SDL_iPhoneKeyboardShow(SDL_Window * window) {
380 SDL_SetError("Not compiled with keyboard support"); 376 SDL_SetError("Not compiled with keyboard support");
381 return -1; 377 return -1;
382 } 378 }
383 379
384 int SDL_iPhoneKeyboardHide(SDL_WindowID windowID) { 380 int SDL_iPhoneKeyboardHide(SDL_Window * window) {
385 SDL_SetError("Not compiled with keyboard support"); 381 SDL_SetError("Not compiled with keyboard support");
386 return -1; 382 return -1;
387 } 383 }
388 384
389 SDL_bool SDL_iPhoneKeyboardIsShown(SDL_WindowID windowID) { 385 SDL_bool SDL_iPhoneKeyboardIsShown(SDL_Window * window) {
390 return 0; 386 return 0;
391 } 387 }
392 388
393 int SDL_iPhoneKeyboardToggle(SDL_WindowID windowID) { 389 int SDL_iPhoneKeyboardToggle(SDL_Window * window) {
394 SDL_SetError("Not compiled with keyboard support"); 390 SDL_SetError("Not compiled with keyboard support");
395 return -1; 391 return -1;
396 } 392 }
397 393
398 394