system.h 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. #ifndef BB_BRL_SYSTEM_H
  2. #define BB_BRL_SYSTEM_H
  3. #include <brl.mod/blitz.mod/blitz.h>
  4. #include <brl.mod/event.mod/event.h> //event enums
  5. #include <brl.mod/keycodes.mod/keycodes.h> //keycode enums
  6. typedef int (*BBAsyncOp)( int asyncInfo );
  7. typedef void (*BBSyncOp)( BBObject *syncInfo,size_t asyncRet );
  8. void bbSystemPostSyncOp( BBSyncOp syncOp,BBObject *syncInfo,size_t asyncRet );
  9. void bbSystemStartAsyncOp( BBAsyncOp asyncOp,int asyncInfo,BBSyncOp syncOp,BBObject *syncInfo );
  10. #ifdef __cplusplus
  11. extern "C"{
  12. #endif
  13. void bbSystemEmitEvent( int id,BBObject *source,int data,int mods,int x,int y,BBObject *extra );
  14. #if _WIN32
  15. #include <windows.h>
  16. #define WM_BBRESERVED1 0x7001
  17. void bbSystemEmitOSEvent( HWND hwnd,UINT msg,WPARAM wParam,LPARAM lParam,BBObject *source );
  18. #elif __APPLE__
  19. #define BB_RESERVEDEVENTSUBTYPE1 0x7001 //reserved event substype
  20. #ifdef __OBJC__
  21. #include <AppKit/AppKit.h>
  22. @interface BBSystemAppDelegate : NSObject{
  23. }
  24. @end
  25. #else
  26. typedef void *NSView;
  27. typedef void *NSEvent;
  28. #endif
  29. int bbSystemTranslateKey( int key );
  30. int bbSystemTranslateChar( int chr );
  31. int bbSystemTranslateMods( int mods );
  32. void bbSystemViewClosed( NSView *view );
  33. void bbSystemEmitOSEvent( NSEvent *event,NSView *view,BBObject *source );
  34. BBString * brl_blitz_bbStringFromUTF8String(const char * text);
  35. #elif __linux__
  36. #include <X11/Xlib.h>
  37. void bbSystemEmitOSEvent( XEvent *event,BBObject *source );
  38. #endif
  39. #ifdef __cplusplus
  40. }
  41. #endif
  42. #endif