hedgewars/SDLh.pas
changeset 6551 a2f39cb9af62
parent 6415 af2047bb4f70
child 6580 6155187bf599
equal deleted inserted replaced
6550:4531a2b141ba 6551:a2f39cb9af62
   146     SDL_TOUCHBUTTONUP     = $704;
   146     SDL_TOUCHBUTTONUP     = $704;
   147     SDL_DOLLARGESTURE     = $800;
   147     SDL_DOLLARGESTURE     = $800;
   148     SDL_DOLLARRECORD      = $801;
   148     SDL_DOLLARRECORD      = $801;
   149     SDL_MULTIGESTURE      = $802;
   149     SDL_MULTIGESTURE      = $802;
   150     SDL_CLIPBOARDUPDATE   = $900;
   150     SDL_CLIPBOARDUPDATE   = $900;
       
   151     SDL_DROPFILE          = $1000;
   151     SDL_USEREVENT         = $8000;
   152     SDL_USEREVENT         = $8000;
   152     SDL_LASTEVENT         = $FFFF;
   153     SDL_LASTEVENT         = $FFFF;
   153     // no compatibility events $7000
   154     // no compatibility events $7000
   154 
   155 
   155     // SDL_Surface flags
   156     // SDL_Surface flags
   441         unicode: LongWord;
   442         unicode: LongWord;
   442         end;
   443         end;
   443 
   444 
   444     TSDL_WindowEvent = record
   445     TSDL_WindowEvent = record
   445         type_: LongWord;
   446         type_: LongWord;
       
   447         timestamp: LongWord;
   446         windowID: LongWord;
   448         windowID: LongWord;
   447         event: Byte;
   449         event: Byte;
   448         padding1, padding2, padding3: Byte;
   450         padding1, padding2, padding3: Byte;
   449         data1, data2: LongInt;
   451         data1, data2: LongInt;
   450         end;
   452         end;
   451 
   453 
   452     // available in sdl12 but not exposed
   454     // available in sdl12 but not exposed
   453     TSDL_TextEditingEvent = record
   455     TSDL_TextEditingEvent = record
   454         type_: LongWord;
   456         type_: LongWord;
       
   457         timestamp: LongWord;
   455         windowID: LongWord;
   458         windowID: LongWord;
   456         text: array[0..31] of Byte;
   459         text: array[0..31] of Byte;
   457         start, lenght: LongInt;
   460         start, lenght: LongInt;
   458         end;
   461         end;
   459 
   462 
   460     // available in sdl12 but not exposed
   463     // available in sdl12 but not exposed
   461     TSDL_TextInputEvent = record
   464     TSDL_TextInputEvent = record
   462         type_: LongWord;
   465         type_: LongWord;
       
   466         timestamp: LongWord;
   463         windowID: LongWord;
   467         windowID: LongWord;
   464         text: array[0..31] of Byte;
   468         text: array[0..31] of Byte;
   465         end;
   469         end;
   466 
   470 
   467     TSDL_TouchFingerEvent = record
   471     TSDL_TouchFingerEvent = record
   468         type_: LongWord;
   472         type_: LongWord;
       
   473         timestamp: LongWord;
   469         windowId: LongWord;
   474         windowId: LongWord;
   470         touchId: Int64;
   475         touchId: Int64;
   471         fingerId: Int64;
   476         fingerId: Int64;
   472         state, padding1, padding2, padding3: Byte;
   477         state, padding1, padding2, padding3: Byte;
   473         x, y: Word;
   478         x, y: Word;
   475         pressure: Word;
   480         pressure: Word;
   476         end;
   481         end;
   477 
   482 
   478     TSDL_TouchButtonEvent = record
   483     TSDL_TouchButtonEvent = record
   479         type_: LongWord;
   484         type_: LongWord;
       
   485         timestamp: LongWord;
   480         windowId: LongWord;
   486         windowId: LongWord;
   481         touchId: Int64;
   487         touchId: Int64;
   482         state, button, padding1, padding2: Byte;
   488         state, button, padding1, padding2: Byte;
   483         end;
   489         end;
   484 
   490 
   485     TSDL_MultiGestureEvent = record
   491     TSDL_MultiGestureEvent = record
   486         type_: LongWord;
   492         type_: LongWord;
       
   493         timestamp: LongWord;
   487         windowId: LongWord;
   494         windowId: LongWord;
   488         touchId: Int64;
   495         touchId: Int64;
   489         dTheta, dDist, x, y: Single;
   496         dTheta, dDist, x, y: Single;
   490         numFingers, padding: Word;
   497         numFingers, padding: Word;
   491         end;
   498         end;
   492 
   499 
   493     TSDL_DollarGestureEvent = record
   500     TSDL_DollarGestureEvent = record
   494         type_: LongWord;
   501         type_: LongWord;
       
   502         timestamp: LongWord;
   495         windowId: LongWord;
   503         windowId: LongWord;
   496         touchId: Int64;
   504         touchId: Int64;
   497         gesturedId: Int64;
   505         gesturedId: Int64;
   498         numFingers: LongWord;
   506         numFingers: LongWord;
   499         error: Single;
   507         error: Single;
   500         end;
   508         end;
   501 
   509 
       
   510     TSDL_DropEvent = record
       
   511         type_: LongWord;
       
   512         timestamp: LongWord;
       
   513         filename: PChar;
       
   514         end;
       
   515 
   502     TSDL_SysWMEvent = record
   516     TSDL_SysWMEvent = record
   503         type_: LongWord;
   517         type_: LongWord;
       
   518         timestamp: LongWord;
   504         msg: Pointer;
   519         msg: Pointer;
   505         end;
   520         end;
   506 {$ELSE}
   521 {$ELSE}
   507     TSDL_KeySym = record
   522     TSDL_KeySym = record
   508         scancode: Byte;
   523         scancode: Byte;
   524 {$ENDIF}
   539 {$ENDIF}
   525 
   540 
   526     TSDL_KeyboardEvent = record
   541     TSDL_KeyboardEvent = record
   527 {$IFDEF SDL13}
   542 {$IFDEF SDL13}
   528         type_: LongWord;
   543         type_: LongWord;
       
   544         timestamp: LongWord;
   529         windowID: LongWord;
   545         windowID: LongWord;
   530         state, repeat_, padding2, padding3: Byte;
   546         state, repeat_, padding2, padding3: Byte;
   531 {$ELSE}
   547 {$ELSE}
   532         type_, which, state: Byte;
   548         type_, which, state: Byte;
   533 {$ENDIF}
   549 {$ENDIF}
   535         end;
   551         end;
   536 
   552 
   537     TSDL_MouseMotionEvent = record
   553     TSDL_MouseMotionEvent = record
   538 {$IFDEF SDL13}
   554 {$IFDEF SDL13}
   539         type_: LongWord;
   555         type_: LongWord;
       
   556         timestamp: LongWord;
   540         windowID: LongWord;
   557         windowID: LongWord;
   541         state, padding1, padding2, padding3: Byte;
   558         state, padding1, padding2, padding3: Byte;
   542         x, y, z, xrel, yrel : LongInt;
   559         x, y, z, xrel, yrel : LongInt;
   543 {$ELSE}
   560 {$ELSE}
   544         type_, which, state: Byte;
   561         type_, which, state: Byte;
   547         end;
   564         end;
   548 
   565 
   549     TSDL_MouseButtonEvent = record
   566     TSDL_MouseButtonEvent = record
   550 {$IFDEF SDL13}
   567 {$IFDEF SDL13}
   551         type_: LongWord;
   568         type_: LongWord;
       
   569         timestamp: LongWord;
   552         windowID: LongWord;
   570         windowID: LongWord;
   553         buttonm, state, padding1, padding2: Byte;
   571         buttonm, state, padding1, padding2: Byte;
   554         x, y: LongInt;
   572         x, y: LongInt;
   555 {$ELSE}
   573 {$ELSE}
   556         type_, which, button, state: Byte;
   574         type_, which, button, state: Byte;
   559         end;
   577         end;
   560 
   578 
   561     TSDL_MouseWheelEvent = record
   579     TSDL_MouseWheelEvent = record
   562         type_: LongWord;
   580         type_: LongWord;
   563 {$IFDEF SDL13}
   581 {$IFDEF SDL13}
       
   582         timestamp: LongWord;
   564         windowID: LongWord;
   583         windowID: LongWord;
   565 {$ELSE}
   584 {$ELSE}
   566         which: Byte;
   585         which: Byte;
   567 {$ENDIF}
   586 {$ENDIF}
   568         x, y: LongInt;
   587         x, y: LongInt;
   569         end;
   588         end;
   570 
   589 
   571     TSDL_JoyAxisEvent = record
   590     TSDL_JoyAxisEvent = record
   572         type_: {$IFDEF SDL13}LongWord{$ELSE}Byte{$ENDIF};
   591 {$IFDEF SDL13}
       
   592         type_: LongWord;
       
   593         timestamp: LongWord;
       
   594 {$ELSE}
       
   595         type_: Byte;
       
   596 {$ENDIF}
   573         which: Byte;
   597         which: Byte;
   574         axis: Byte;
   598         axis: Byte;
   575 {$IFDEF SDL13}
   599 {$IFDEF SDL13}
   576         padding1, padding2: Byte;
   600         padding1, padding2: Byte;
   577         value: LongInt;
   601         value: LongInt;
   579         value: SmallInt;
   603         value: SmallInt;
   580 {$ENDIF}
   604 {$ENDIF}
   581         end;
   605         end;
   582 
   606 
   583     TSDL_JoyBallEvent = record
   607     TSDL_JoyBallEvent = record
   584         type_: {$IFDEF SDL13}LongWord{$ELSE}Byte{$ENDIF};
   608 {$IFDEF SDL13}
       
   609         type_: LongWord;
       
   610         timestamp: LongWord;
       
   611 {$ELSE}
       
   612         type_: Byte;
       
   613 {$ENDIF}
   585         which: Byte;
   614         which: Byte;
   586         ball: Byte;
   615         ball: Byte;
   587 {$IFDEF SDL13}
   616 {$IFDEF SDL13}
   588         padding1, padding2: Byte;
   617         padding1, padding2: Byte;
   589         xrel, yrel: LongInt;
   618         xrel, yrel: LongInt;
   591         xrel, yrel: SmallInt;
   620         xrel, yrel: SmallInt;
   592 {$ENDIF}
   621 {$ENDIF}
   593         end;
   622         end;
   594 
   623 
   595     TSDL_JoyHatEvent = record
   624     TSDL_JoyHatEvent = record
   596         type_: {$IFDEF SDL13}LongWord{$ELSE}Byte{$ENDIF};
   625 {$IFDEF SDL13}
       
   626         type_: LongWord;
       
   627         timestamp: LongWord;
       
   628 {$ELSE}
       
   629         type_: Byte;
       
   630 {$ENDIF}
   597         which: Byte;
   631         which: Byte;
   598         hat: Byte;
   632         hat: Byte;
   599         value: Byte;
   633         value: Byte;
   600 {$IFDEF SDL13}
   634 {$IFDEF SDL13}
   601         padding1: Byte;
   635         padding1: Byte;
   602 {$ENDIF}
   636 {$ENDIF}
   603         end;
   637         end;
   604 
   638 
   605     TSDL_JoyButtonEvent = record
   639     TSDL_JoyButtonEvent = record
   606         type_: {$IFDEF SDL13}LongWord{$ELSE}Byte{$ENDIF};
   640 {$IFDEF SDL13}
       
   641         type_: LongWord;
       
   642         timestamp: LongWord;
       
   643 {$ELSE}
       
   644         type_: Byte;
       
   645 {$ENDIF}
   607         which: Byte;
   646         which: Byte;
   608         button: Byte;
   647         button: Byte;
   609         state: Byte;
   648         state: Byte;
   610 {$IFDEF SDL13}
   649 {$IFDEF SDL13}
   611         padding1: Byte;
   650         padding1: Byte;
   612 {$ENDIF}
   651 {$ENDIF}
   613         end;
   652         end;
   614 
   653 
   615     TSDL_QuitEvent = record
   654     TSDL_QuitEvent = record
   616         type_: {$IFDEF SDL13}LongWord{$ELSE}Byte{$ENDIF};
   655 {$IFDEF SDL13}
       
   656         type_: LongWord;
       
   657         timestamp: LongWord;
       
   658 {$ELSE}
       
   659         type_: Byte;
       
   660 {$ENDIF}
   617         end;
   661         end;
   618 
   662 
   619     TSDL_UserEvent = record
   663     TSDL_UserEvent = record
   620 {$IFDEF SDL13}
   664 {$IFDEF SDL13}
   621         type_: LongWord;
   665         type_: LongWord;
       
   666         timestamp: LongWord;
   622         windowID: LongWord;
   667         windowID: LongWord;
   623 {$ELSE}
   668 {$ELSE}
   624         type_: Byte;
   669         type_: Byte;
   625 {$ENDIF}
   670 {$ENDIF}
   626         code: LongInt;
   671         code: LongInt;
   654             SDL_FINGERMOTION: (tfinger: TSDL_TouchFingerEvent);
   699             SDL_FINGERMOTION: (tfinger: TSDL_TouchFingerEvent);
   655             SDL_TOUCHBUTTONUP,
   700             SDL_TOUCHBUTTONUP,
   656             SDL_TOUCHBUTTONDOWN: (tbutton: TSDL_TouchButtonEvent);
   701             SDL_TOUCHBUTTONDOWN: (tbutton: TSDL_TouchButtonEvent);
   657             SDL_MULTIGESTURE: (mgesture: TSDL_MultiGestureEvent);
   702             SDL_MULTIGESTURE: (mgesture: TSDL_MultiGestureEvent);
   658             SDL_DOLLARGESTURE: (dgesture: TSDL_DollarGestureEvent);
   703             SDL_DOLLARGESTURE: (dgesture: TSDL_DollarGestureEvent);
       
   704             SDL_DROPFILE: (drop: TSDL_DropEvent);
   659             SDL_ALLEVENTS: (foo: shortstring);
   705             SDL_ALLEVENTS: (foo: shortstring);
   660 {$ELSE}
   706 {$ELSE}
   661         case Byte of
   707         case Byte of
   662             SDL_NOEVENT: (type_: Byte);
   708             SDL_NOEVENT: (type_: Byte);
   663             SDL_ACTIVEEVENT: (active: TSDL_ActiveEvent);
   709             SDL_ACTIVEEVENT: (active: TSDL_ActiveEvent);