os_linuxbsd.h 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. /*************************************************************************/
  2. /* os_linuxbsd.h */
  3. /*************************************************************************/
  4. /* This file is part of: */
  5. /* GODOT ENGINE */
  6. /* https://godotengine.org */
  7. /*************************************************************************/
  8. /* Copyright (c) 2007-2020 Juan Linietsky, Ariel Manzur. */
  9. /* Copyright (c) 2014-2020 Godot Engine contributors (cf. AUTHORS.md). */
  10. /* */
  11. /* Permission is hereby granted, free of charge, to any person obtaining */
  12. /* a copy of this software and associated documentation files (the */
  13. /* "Software"), to deal in the Software without restriction, including */
  14. /* without limitation the rights to use, copy, modify, merge, publish, */
  15. /* distribute, sublicense, and/or sell copies of the Software, and to */
  16. /* permit persons to whom the Software is furnished to do so, subject to */
  17. /* the following conditions: */
  18. /* */
  19. /* The above copyright notice and this permission notice shall be */
  20. /* included in all copies or substantial portions of the Software. */
  21. /* */
  22. /* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */
  23. /* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */
  24. /* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/
  25. /* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */
  26. /* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */
  27. /* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
  28. /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
  29. /*************************************************************************/
  30. #ifndef OS_LINUXBSD_H
  31. #define OS_LINUXBSD_H
  32. #include "core/input/input.h"
  33. #include "crash_handler_linuxbsd.h"
  34. #include "drivers/alsa/audio_driver_alsa.h"
  35. #include "drivers/alsamidi/midi_driver_alsamidi.h"
  36. #include "drivers/pulseaudio/audio_driver_pulseaudio.h"
  37. #include "drivers/unix/os_unix.h"
  38. #include "joypad_linux.h"
  39. #include "servers/audio_server.h"
  40. #include "servers/rendering/rasterizer.h"
  41. #include "servers/rendering_server.h"
  42. class OS_LinuxBSD : public OS_Unix {
  43. virtual void delete_main_loop();
  44. bool force_quit;
  45. #ifdef JOYDEV_ENABLED
  46. JoypadLinux *joypad;
  47. #endif
  48. #ifdef ALSA_ENABLED
  49. AudioDriverALSA driver_alsa;
  50. #endif
  51. #ifdef ALSAMIDI_ENABLED
  52. MIDIDriverALSAMidi driver_alsamidi;
  53. #endif
  54. #ifdef PULSEAUDIO_ENABLED
  55. AudioDriverPulseAudio driver_pulseaudio;
  56. #endif
  57. CrashHandler crash_handler;
  58. MainLoop *main_loop;
  59. protected:
  60. virtual void initialize();
  61. virtual void finalize();
  62. virtual void initialize_joypads();
  63. virtual void set_main_loop(MainLoop *p_main_loop);
  64. public:
  65. virtual String get_name() const;
  66. virtual MainLoop *get_main_loop() const;
  67. virtual String get_config_path() const;
  68. virtual String get_data_path() const;
  69. virtual String get_cache_path() const;
  70. virtual String get_system_dir(SystemDir p_dir) const;
  71. virtual Error shell_open(String p_uri);
  72. virtual String get_unique_id() const;
  73. virtual bool _check_internal_feature_support(const String &p_feature);
  74. void run();
  75. void disable_crash_handler();
  76. bool is_disable_crash_handler() const;
  77. virtual Error move_to_trash(const String &p_path);
  78. OS_LinuxBSD();
  79. };
  80. #endif