Mercurial > sdl-ios-xcode
comparison src/video/directfb/SDL_DirectFB_events.c @ 3013:8cc00819c8d6
Reverted Bob's indent checkin
author | Sam Lantinga <slouken@libsdl.org> |
---|---|
date | Sat, 10 Jan 2009 21:50:26 +0000 |
parents | 8f4ed5ec2b06 |
children | d72a0dd80e8b |
comparison
equal
deleted
inserted
replaced
3012:7e30c2dc7783 | 3013:8cc00819c8d6 |
---|---|
58 SDL_VideoDisplay *display = SDL_GetDisplayFromWindow(window); | 58 SDL_VideoDisplay *display = SDL_GetDisplayFromWindow(window); |
59 DFB_DisplayData *dispdata = (DFB_DisplayData *) display->driverdata; | 59 DFB_DisplayData *dispdata = (DFB_DisplayData *) display->driverdata; |
60 int ret; | 60 int ret; |
61 | 61 |
62 if (dispdata->vidIDinuse) | 62 if (dispdata->vidIDinuse) |
63 SDL_DFB_CHECKERR(dispdata-> | 63 SDL_DFB_CHECKERR(dispdata->vidlayer-> |
64 vidlayer->SwitchContext(dispdata->vidlayer, | 64 SwitchContext(dispdata->vidlayer, DFB_TRUE)); |
65 DFB_TRUE)); | |
66 | 65 |
67 error: | 66 error: |
68 return; | 67 return; |
69 #endif | 68 #endif |
70 | 69 |
147 case DWET_BUTTONDOWN: | 146 case DWET_BUTTONDOWN: |
148 if (!devdata->use_linux_input) { | 147 if (!devdata->use_linux_input) { |
149 SDL_SendMouseMotion(devdata->mouse_id[0], 0, evt.cx, | 148 SDL_SendMouseMotion(devdata->mouse_id[0], 0, evt.cx, |
150 evt.cy, 0); | 149 evt.cy, 0); |
151 SDL_SendMouseButton(devdata->mouse_id[0], SDL_PRESSED, | 150 SDL_SendMouseButton(devdata->mouse_id[0], SDL_PRESSED, |
152 DirectFB_TranslateButton | 151 DirectFB_TranslateButton(evt. |
153 (evt.button)); | 152 button)); |
154 } else { | 153 } else { |
155 MotionAllMice(_this, evt.x, evt.y); | 154 MotionAllMice(_this, evt.x, evt.y); |
156 } | 155 } |
157 break; | 156 break; |
158 case DWET_BUTTONUP: | 157 case DWET_BUTTONUP: |
159 if (!devdata->use_linux_input) { | 158 if (!devdata->use_linux_input) { |
160 SDL_SendMouseMotion(devdata->mouse_id[0], 0, evt.cx, | 159 SDL_SendMouseMotion(devdata->mouse_id[0], 0, evt.cx, |
161 evt.cy, 0); | 160 evt.cy, 0); |
162 SDL_SendMouseButton(devdata->mouse_id[0], | 161 SDL_SendMouseButton(devdata->mouse_id[0], |
163 SDL_RELEASED, | 162 SDL_RELEASED, |
164 DirectFB_TranslateButton | 163 DirectFB_TranslateButton(evt. |
165 (evt.button)); | 164 button)); |
166 } else { | 165 } else { |
167 MotionAllMice(_this, evt.x, evt.y); | 166 MotionAllMice(_this, evt.x, evt.y); |
168 } | 167 } |
169 break; | 168 break; |
170 case DWET_MOTION: | 169 case DWET_MOTION: |
520 && (evt->key_symbol > 0 && evt->key_symbol < 255)) | 519 && (evt->key_symbol > 0 && evt->key_symbol < 255)) |
521 keysym->unicode = evt->key_symbol; | 520 keysym->unicode = evt->key_symbol; |
522 | 521 |
523 return keysym; | 522 return keysym; |
524 } | 523 } |
525 | |
526 static int | 524 static int |
527 DirectFB_TranslateButton(DFBInputDeviceButtonIdentifier button) | 525 DirectFB_TranslateButton(DFBInputDeviceButtonIdentifier button) |
528 { | 526 { |
529 switch (button) { | 527 switch (button) { |
530 case DIBI_LEFT: | 528 case DIBI_LEFT: |
602 DirectFB_InitOSKeymap(_this, &oskeymap[0], SDL_arraysize(oskeymap)); | 600 DirectFB_InitOSKeymap(_this, &oskeymap[0], SDL_arraysize(oskeymap)); |
603 | 601 |
604 devdata->num_keyboard = 0; | 602 devdata->num_keyboard = 0; |
605 if (devdata->use_linux_input) { | 603 if (devdata->use_linux_input) { |
606 sys_ids = 0; | 604 sys_ids = 0; |
607 SDL_DFB_CHECK(devdata-> | 605 SDL_DFB_CHECK(devdata->dfb-> |
608 dfb->EnumInputDevices(devdata->dfb, EnumKeyboards, | 606 EnumInputDevices(devdata->dfb, EnumKeyboards, devdata)); |
609 devdata)); | |
610 if (devdata->num_keyboard == 0) { | 607 if (devdata->num_keyboard == 0) { |
611 sys_ids = 1; | 608 sys_ids = 1; |
612 SDL_DFB_CHECK(devdata-> | 609 SDL_DFB_CHECK(devdata->dfb-> |
613 dfb->EnumInputDevices(devdata->dfb, EnumKeyboards, | 610 EnumInputDevices(devdata->dfb, EnumKeyboards, |
614 devdata)); | 611 devdata)); |
615 } | 612 } |
616 } else { | 613 } else { |
617 SDL_DFB_CHECK(devdata-> | 614 SDL_DFB_CHECK(devdata->dfb-> |
618 dfb->EnumInputDevices(devdata->dfb, input_device_cb, | 615 EnumInputDevices(devdata->dfb, input_device_cb, |
619 devdata)); | 616 devdata)); |
620 } | 617 } |
621 } | 618 } |
622 | 619 |
623 void | 620 void |
624 DirectFB_QuitKeyboard(_THIS) | 621 DirectFB_QuitKeyboard(_THIS) |
651 mod = 0; | 648 mod = 0; |
652 | 649 |
653 switch (evt.type) { | 650 switch (evt.type) { |
654 case DIET_BUTTONPRESS: | 651 case DIET_BUTTONPRESS: |
655 posted += SDL_PrivateMouseButton(SDL_PRESSED, | 652 posted += SDL_PrivateMouseButton(SDL_PRESSED, |
656 DirectFB_TranslateButton | 653 DirectFB_TranslateButton(evt. |
657 (evt.button), 0, 0); | 654 button), |
655 0, 0); | |
658 break; | 656 break; |
659 case DIET_BUTTONRELEASE: | 657 case DIET_BUTTONRELEASE: |
660 posted += SDL_PrivateMouseButton(SDL_RELEASED, | 658 posted += SDL_PrivateMouseButton(SDL_RELEASED, |
661 DirectFB_TranslateButton | 659 DirectFB_TranslateButton(evt. |
662 (evt.button), 0, 0); | 660 button), |
661 0, 0); | |
663 break; | 662 break; |
664 case DIET_KEYPRESS: | 663 case DIET_KEYPRESS: |
665 posted += SDL_PrivateKeyboard(SDL_PRESSED, | 664 posted += SDL_PrivateKeyboard(SDL_PRESSED, |
666 DirectFB_TranslateKey | 665 DirectFB_TranslateKey(evt. |
667 (evt.key_id, evt.key_symbol, | 666 key_id, |
668 mod, &keysym)); | 667 evt. |
668 key_symbol, | |
669 mod, | |
670 &keysym)); | |
669 break; | 671 break; |
670 case DIET_KEYRELEASE: | 672 case DIET_KEYRELEASE: |
671 posted += SDL_PrivateKeyboard(SDL_RELEASED, | 673 posted += SDL_PrivateKeyboard(SDL_RELEASED, |
672 DirectFB_TranslateKey | 674 DirectFB_TranslateKey(evt. |
673 (evt.key_id, evt.key_symbol, | 675 key_id, |
674 mod, &keysym)); | 676 evt. |
677 key_symbol, | |
678 mod, | |
679 &keysym)); | |
675 break; | 680 break; |
676 case DIET_AXISMOTION: | 681 case DIET_AXISMOTION: |
677 if (evt.flags & DIEF_AXISREL) { | 682 if (evt.flags & DIEF_AXISREL) { |
678 if (evt.axis == DIAI_X) | 683 if (evt.axis == DIAI_X) |
679 posted += | 684 posted += |